diff --git a/.github/workflows/torchbench.yml b/.github/workflows/torchbench.yml index f3d7d9e8d6c..a3ff79a20fb 100644 --- a/.github/workflows/torchbench.yml +++ b/.github/workflows/torchbench.yml @@ -97,4 +97,18 @@ jobs: exec_command: bash ./pytorch_blade/benchmark/TorchBench/test_torch_bench.sh cpu full push_command: "" remote_dev_docker: "" - secrets: inherit \ No newline at end of file + secrets: inherit + TorchBenchCpuFull8Threads: + if: github.event.schedule == '30 15 * * 5' + uses: ./.github/workflows/reusable.yml + with: + name: torch-offcial-benchmark + base_image: bladedisc/bladedisc:latest-runtime-torch1.12.0-cpu + device: cpu_benchmark + timeout_minutes: 4320 # 72h + dockerfile: docker/cronjobs/Dockerfile.torch.bench + extra_envs: -e RELATED_DIFF_PERCENT=3 + exec_command: bash ./pytorch_blade/benchmark/TorchBench/test_torch_bench.sh cpu full 8 "0-7" + push_command: "" + remote_dev_docker: "" + secrets: inherit diff --git a/pytorch_blade/benchmark/TorchBench/requirements_cpu.txt b/pytorch_blade/benchmark/TorchBench/requirements_cpu.txt index 10457a6b7de..9ca70c1b61a 100644 --- a/pytorch_blade/benchmark/TorchBench/requirements_cpu.txt +++ b/pytorch_blade/benchmark/TorchBench/requirements_cpu.txt @@ -4,4 +4,7 @@ librosa torchvision==0.13.0+cpu torchaudio==0.12.0+cpu torchtext==0.13.0 -torchdynamo +onnx +onnxruntime +intel_extension_for_pytorch==1.12.0 +torchdynamo==1.13.0 diff --git a/pytorch_blade/benchmark/TorchBench/test_torch_bench.sh b/pytorch_blade/benchmark/TorchBench/test_torch_bench.sh index e2f33800a13..d38a4268ceb 100755 --- a/pytorch_blade/benchmark/TorchBench/test_torch_bench.sh +++ b/pytorch_blade/benchmark/TorchBench/test_torch_bench.sh @@ -34,20 +34,30 @@ ln -s $benchmark_repo_dir torchbenchmark # setup benchmark env export DISC_EXPERIMENTAL_SPECULATION_TLP_ENHANCE=true \ DISC_CPU_LARGE_CONCAT_NUM_OPERANDS=4 DISC_CPU_ENABLE_EAGER_TRANSPOSE_FUSION=1 \ - OMP_NUM_THREADS=1 TORCHBENCH_ATOL=1e-2 TORCHBENCH_RTOL=1e-2 + TORCHBENCH_ATOL=1e-2 TORCHBENCH_RTOL=1e-2 config_file=blade_$1_$2.yaml bench_target=$2 +binding_cores=0 if [ $1 == "cpu" ] then - # 4 cores - export GOMP_CPU_AFFINITY="2-5" + if [ -z "$3" ] + then + export OMP_NUM_THREADS=1 GOMP_CPU_AFFINITY=0 + else + # eg: bash test_torch_bench.sh cpu tiny 32 "0-63:2" + export OMP_NUM_THREADS=$3 GOMP_CPU_AFFINITY=$4 + binding_cores=$4 + fi results=(eval-cpu-fp32) + taskset -c $binding_cores python3 torchbenchmark/.github/scripts/run-config.py \ + -c $config_file -b ./torchbenchmark/ --output-dir . else results=(eval-cuda-fp32 eval-cuda-fp16) + python3 torchbenchmark/.github/scripts/run-config.py \ + -c $config_file -b ./torchbenchmark/ --output-dir . fi -python3 torchbenchmark/.github/scripts/run-config.py -c $config_file -b ./torchbenchmark/ --output-dir . # results date_str=$(date '+%Y%m%d-%H')