From b213dcab7e43afe52f619931647a78136c53efaa Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 Dec 2022 11:50:13 +0800 Subject: [PATCH 1/4] copy local cached model for dynas ut test Signed-off-by: chensuyue --- .azure-pipelines/scripts/ut/run_basic_others.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.azure-pipelines/scripts/ut/run_basic_others.sh b/.azure-pipelines/scripts/ut/run_basic_others.sh index 4781eb89468..60ae3f09bf6 100644 --- a/.azure-pipelines/scripts/ut/run_basic_others.sh +++ b/.azure-pipelines/scripts/ut/run_basic_others.sh @@ -22,6 +22,10 @@ sed -i '/ neural_coder\//d' run.sh sed -i '/ ipex\//d' run.sh sed -i '/ itex\//d' run.sh +echo "copy model for dynas..." +mkdir -p .torch/ofa_nets || true +cp -r /tf_dataset/ut-localfile/ofa_mbv3_d234_e346_k357_w1.2 .torch/ofa_nets || true + LOG_DIR=/neural-compressor/log_dir mkdir -p ${LOG_DIR} ut_log_name=${LOG_DIR}/ut_tf_${tensorflow_version}_pt_${pytorch_version}.log From 61a0bf21d84e4c2eba0d8425d0c52481044bf5e5 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 Dec 2022 12:01:15 +0800 Subject: [PATCH 2/4] update ut Signed-off-by: chensuyue --- .azure-pipelines/ut-basic.yml | 1 + .azure-pipelines/ut-ncoder.yml | 1 + .azure-pipelines/ut-ux.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.azure-pipelines/ut-basic.yml b/.azure-pipelines/ut-basic.yml index 05417fae4e0..b57b97b8b62 100644 --- a/.azure-pipelines/ut-basic.yml +++ b/.azure-pipelines/ut-basic.yml @@ -11,6 +11,7 @@ pr: - neural_compressor - test - setup.py + - .azure-pipelines/scripts/ut exclude: - neural_compressor/ux - test/ux diff --git a/.azure-pipelines/ut-ncoder.yml b/.azure-pipelines/ut-ncoder.yml index 14ce726c626..9663aeae21d 100644 --- a/.azure-pipelines/ut-ncoder.yml +++ b/.azure-pipelines/ut-ncoder.yml @@ -11,6 +11,7 @@ pr: - neural_coder - test/neural_coder - setup.py + - .azure-pipelines/scripts/ut pool: ICX-16C diff --git a/.azure-pipelines/ut-ux.yml b/.azure-pipelines/ut-ux.yml index 2b79fb4b9b4..25b5e5a94c0 100644 --- a/.azure-pipelines/ut-ux.yml +++ b/.azure-pipelines/ut-ux.yml @@ -11,6 +11,7 @@ pr: - neural_compressor/ux - test/ux - setup.py + - .azure-pipelines/scripts/ut pool: ICX-16C From 687df83cb2b24adab65a3f998f7a6628749a0fcd Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 Dec 2022 13:52:50 +0800 Subject: [PATCH 3/4] fix ut issue Signed-off-by: chensuyue --- test/itex/test_keras_in_keras_out.py | 1 + test/itex/test_tensorflow_itex_basic.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/itex/test_keras_in_keras_out.py b/test/itex/test_keras_in_keras_out.py index aa776d1d6fd..2394c9a58d7 100644 --- a/test/itex/test_keras_in_keras_out.py +++ b/test/itex/test_keras_in_keras_out.py @@ -119,6 +119,7 @@ def setUpClass(self): def tearDownClass(self): shutil.rmtree('baseline_model',ignore_errors=True) shutil.rmtree('itex_qdq_keras_model',ignore_errors=True) + os.system("rm *.log") def test_keras_in_keras_out(self): logger.info("Run test_keras_in_keras_out case...") diff --git a/test/itex/test_tensorflow_itex_basic.py b/test/itex/test_tensorflow_itex_basic.py index 491b97ed973..407a47e6a6e 100644 --- a/test/itex/test_tensorflow_itex_basic.py +++ b/test/itex/test_tensorflow_itex_basic.py @@ -22,6 +22,7 @@ def build_fake_yaml(fake_yaml, save_path, **kwargs): class TestItexEnabling(unittest.TestCase): @classmethod def setUpClass(self): + os.system("rm *.log") fake_yaml_1 = ''' model: name: fake_model_cpu @@ -238,8 +239,6 @@ def test_itex_benchmark_gpu(self): relu = tf.nn.relu(add) relu6 = tf.nn.relu6(relu, name='op_to_store') out_name = relu6.name.split(':')[0] - num_of_instance = 1 - cores_per_instance = 1 with tf.compat.v1.Session() as sess: sess.run(tf.compat.v1.global_variables_initializer()) output_graph_def = graph_util.convert_variables_to_constants( From a4bbf8734c9b51dbf075c8164f10bba4e5b9be19 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 Dec 2022 14:23:15 +0800 Subject: [PATCH 4/4] update fix Signed-off-by: chensuyue --- test/itex/test_keras_in_keras_out.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/itex/test_keras_in_keras_out.py b/test/itex/test_keras_in_keras_out.py index 2394c9a58d7..aa776d1d6fd 100644 --- a/test/itex/test_keras_in_keras_out.py +++ b/test/itex/test_keras_in_keras_out.py @@ -119,7 +119,6 @@ def setUpClass(self): def tearDownClass(self): shutil.rmtree('baseline_model',ignore_errors=True) shutil.rmtree('itex_qdq_keras_model',ignore_errors=True) - os.system("rm *.log") def test_keras_in_keras_out(self): logger.info("Run test_keras_in_keras_out case...")