From a0c1721c39b0dd2d132c54f4db5df21d1ec40323 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Mon, 15 Jul 2024 09:59:52 +0000 Subject: [PATCH 1/2] rename ACG_UnitTest to BasicTemporalModel --- .../benchmark_infer.py | 0 .../{ACG_UnitTest => BasicTemporalModel}/convert.py | 2 +- .../PyTorch/{ACG_UnitTest => BasicTemporalModel}/net.py | 0 .../{ACG_UnitTest => BasicTemporalModel}/pd_infer.py | 0 .../run_benchmark.sh | 0 .../{ACG_UnitTest => BasicTemporalModel}/run_convert.sh | 0 test_benchmark/PyTorch/benchmark.sh | 9 +++++---- test_benchmark/PyTorch/convert.sh | 9 +++++---- 8 files changed, 11 insertions(+), 9 deletions(-) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/benchmark_infer.py (100%) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/convert.py (92%) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/net.py (100%) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/pd_infer.py (100%) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/run_benchmark.sh (100%) rename test_benchmark/PyTorch/{ACG_UnitTest => BasicTemporalModel}/run_convert.sh (100%) diff --git a/test_benchmark/PyTorch/ACG_UnitTest/benchmark_infer.py b/test_benchmark/PyTorch/BasicTemporalModel/benchmark_infer.py similarity index 100% rename from test_benchmark/PyTorch/ACG_UnitTest/benchmark_infer.py rename to test_benchmark/PyTorch/BasicTemporalModel/benchmark_infer.py diff --git a/test_benchmark/PyTorch/ACG_UnitTest/convert.py b/test_benchmark/PyTorch/BasicTemporalModel/convert.py similarity index 92% rename from test_benchmark/PyTorch/ACG_UnitTest/convert.py rename to test_benchmark/PyTorch/BasicTemporalModel/convert.py index 2e9fbbdbd..564dd04e2 100644 --- a/test_benchmark/PyTorch/ACG_UnitTest/convert.py +++ b/test_benchmark/PyTorch/BasicTemporalModel/convert.py @@ -16,7 +16,7 @@ def main(): model.eval() - data = np.load("input.npy") + data = np.load("../dataset/ACG_UnitTest/input.npy") data = torch.Tensor(data) result = model(data) diff --git a/test_benchmark/PyTorch/ACG_UnitTest/net.py b/test_benchmark/PyTorch/BasicTemporalModel/net.py similarity index 100% rename from test_benchmark/PyTorch/ACG_UnitTest/net.py rename to test_benchmark/PyTorch/BasicTemporalModel/net.py diff --git a/test_benchmark/PyTorch/ACG_UnitTest/pd_infer.py b/test_benchmark/PyTorch/BasicTemporalModel/pd_infer.py similarity index 100% rename from test_benchmark/PyTorch/ACG_UnitTest/pd_infer.py rename to test_benchmark/PyTorch/BasicTemporalModel/pd_infer.py diff --git a/test_benchmark/PyTorch/ACG_UnitTest/run_benchmark.sh b/test_benchmark/PyTorch/BasicTemporalModel/run_benchmark.sh similarity index 100% rename from test_benchmark/PyTorch/ACG_UnitTest/run_benchmark.sh rename to test_benchmark/PyTorch/BasicTemporalModel/run_benchmark.sh diff --git a/test_benchmark/PyTorch/ACG_UnitTest/run_convert.sh b/test_benchmark/PyTorch/BasicTemporalModel/run_convert.sh similarity index 100% rename from test_benchmark/PyTorch/ACG_UnitTest/run_convert.sh rename to test_benchmark/PyTorch/BasicTemporalModel/run_convert.sh diff --git a/test_benchmark/PyTorch/benchmark.sh b/test_benchmark/PyTorch/benchmark.sh index 163cfedbf..0ac30d2f9 100644 --- a/test_benchmark/PyTorch/benchmark.sh +++ b/test_benchmark/PyTorch/benchmark.sh @@ -6,8 +6,9 @@ find . -name "pd_model_script" | xargs rm -rf find . -name "run.log" | xargs rm -rf find . -name "run.err" | xargs rm -rf -num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | wc -l) -num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | wc -l)` +models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird') +num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird' | wc -l) +num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | grep -v 'MockingBird' | wc -l)` if [ $num_of_pb_files -ne $num_of_models ] then @@ -16,7 +17,7 @@ then fi counter=1 -for model in $(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset') +for model in $models do echo "[X2Paddle-PyTorch] ${counter}/${num_of_models} $model ..." cd $model @@ -33,7 +34,7 @@ done wait rm -rf result.txt touch result.txt -for model in $(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset') +for model in $models do cat ${model}/result.txt >> ./result.txt done diff --git a/test_benchmark/PyTorch/convert.sh b/test_benchmark/PyTorch/convert.sh index 28e852a13..9f18bdaa8 100644 --- a/test_benchmark/PyTorch/convert.sh +++ b/test_benchmark/PyTorch/convert.sh @@ -17,8 +17,9 @@ find . -name "pd_model_script" | xargs rm -rf find . -name "run.log" | xargs rm -rf find . -name "run.err" | xargs rm -rf -num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | wc -l) -num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | wc -l)` +models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird') +num_of_models=$(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset' | grep -v 'MockingBird' | wc -l) +num_of_pb_files=`expr $(find . -name "convert.py" | wc -l) + $(find . -name "convert_trace.py" | grep -v 'MockingBird' | wc -l)` if [ $num_of_pb_files -ne $num_of_models ] then @@ -27,7 +28,7 @@ then fi counter=1 -for model in $(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset') +for model in $models do echo "[X2Paddle-PyTorch] ${counter}/${num_of_models} $model ..." cd $model @@ -44,7 +45,7 @@ done wait rm -rf result.txt touch result.txt -for model in $(ls -d */ | grep -v 'tools' | grep -v 'output' | grep -v 'dataset') +for model in $models do cat ${model}/result.txt >> ./result.txt done From bbfa641bef93d6962198801e35e2456f2dfb6869 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Mon, 15 Jul 2024 10:03:52 +0000 Subject: [PATCH 2/2] rebase --- .../{BasicTemporalModel => ACG_UnitTest}/benchmark_infer.py | 0 .../PyTorch/{BasicTemporalModel => ACG_UnitTest}/convert.py | 0 .../PyTorch/{BasicTemporalModel => ACG_UnitTest}/net.py | 0 .../PyTorch/{BasicTemporalModel => ACG_UnitTest}/pd_infer.py | 2 +- .../{BasicTemporalModel => ACG_UnitTest}/run_benchmark.sh | 0 .../PyTorch/{BasicTemporalModel => ACG_UnitTest}/run_convert.sh | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/benchmark_infer.py (100%) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/convert.py (100%) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/net.py (100%) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/pd_infer.py (96%) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/run_benchmark.sh (100%) rename test_benchmark/PyTorch/{BasicTemporalModel => ACG_UnitTest}/run_convert.sh (100%) diff --git a/test_benchmark/PyTorch/BasicTemporalModel/benchmark_infer.py b/test_benchmark/PyTorch/ACG_UnitTest/benchmark_infer.py similarity index 100% rename from test_benchmark/PyTorch/BasicTemporalModel/benchmark_infer.py rename to test_benchmark/PyTorch/ACG_UnitTest/benchmark_infer.py diff --git a/test_benchmark/PyTorch/BasicTemporalModel/convert.py b/test_benchmark/PyTorch/ACG_UnitTest/convert.py similarity index 100% rename from test_benchmark/PyTorch/BasicTemporalModel/convert.py rename to test_benchmark/PyTorch/ACG_UnitTest/convert.py diff --git a/test_benchmark/PyTorch/BasicTemporalModel/net.py b/test_benchmark/PyTorch/ACG_UnitTest/net.py similarity index 100% rename from test_benchmark/PyTorch/BasicTemporalModel/net.py rename to test_benchmark/PyTorch/ACG_UnitTest/net.py diff --git a/test_benchmark/PyTorch/BasicTemporalModel/pd_infer.py b/test_benchmark/PyTorch/ACG_UnitTest/pd_infer.py similarity index 96% rename from test_benchmark/PyTorch/BasicTemporalModel/pd_infer.py rename to test_benchmark/PyTorch/ACG_UnitTest/pd_infer.py index bd448acb4..115fc2517 100644 --- a/test_benchmark/PyTorch/BasicTemporalModel/pd_infer.py +++ b/test_benchmark/PyTorch/ACG_UnitTest/pd_infer.py @@ -6,7 +6,7 @@ f = open('result.txt', 'w') -f.write("======BasicTemporalModel: \n") +f.write("======ACG_UnitTest: \n") try: paddle.enable_static() exe = paddle.static.Executor(paddle.CPUPlace()) diff --git a/test_benchmark/PyTorch/BasicTemporalModel/run_benchmark.sh b/test_benchmark/PyTorch/ACG_UnitTest/run_benchmark.sh similarity index 100% rename from test_benchmark/PyTorch/BasicTemporalModel/run_benchmark.sh rename to test_benchmark/PyTorch/ACG_UnitTest/run_benchmark.sh diff --git a/test_benchmark/PyTorch/BasicTemporalModel/run_convert.sh b/test_benchmark/PyTorch/ACG_UnitTest/run_convert.sh similarity index 100% rename from test_benchmark/PyTorch/BasicTemporalModel/run_convert.sh rename to test_benchmark/PyTorch/ACG_UnitTest/run_convert.sh