From f84d82d0cb5f4a8c22122de862d97dd4b1f9c867 Mon Sep 17 00:00:00 2001 From: tangwei Date: Wed, 22 Apr 2020 17:01:14 +0800 Subject: [PATCH] update run version judge --- fleetrec/run.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fleetrec/run.py b/fleetrec/run.py index f49d85fa..c7bc096a 100644 --- a/fleetrec/run.py +++ b/fleetrec/run.py @@ -1,8 +1,7 @@ import argparse import os - +import subprocess import yaml -from paddle.fluid.incubate.fleet.parameter_server import version from fleetrec.core.factory import TrainerFactory from fleetrec.core.utils import envs @@ -12,6 +11,18 @@ engines = {"TRAINSPILER": {}, "PSLIB": {}} clusters = ["SINGLE", "LOCAL_CLUSTER", "CLUSTER"] +def is_transpiler(): + FNULL = open(os.devnull, 'w') + cmd = ["python", "-c", + "import paddle.fluid as fluid; fleet_ptr = fluid.core.Fleet(); [fleet_ptr.copy_table_by_feasign(10, 10, [2020, 1010])];"] + proc = subprocess.Popen(cmd, stdout=FNULL, stderr=FNULL, cwd=os.getcwd()) + ret = proc.wait() + if ret == -11: + return False + else: + return True + + def set_runtime_envs(cluster_envs, engine_yaml): def get_engine_extras(): with open(engine_yaml, 'r') as rb: -- GitLab