Skip to content

Commit a0afc16

Browse files
authored
[HPU] Add smoke unit test and torchbench model tests for hpu bridge (#13)
1. Add smoke unit tests 2. Enable the torchbench model level tests
1 parent cd36f92 commit a0afc16

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.ci/benchmark.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import argparse
22
import os
33
import sys
4+
5+
src_parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
6+
sys.path.append(src_parent_dir)
47
from src.benchmark.utils import read_metrics, to_markdown_table
58

69

.github/workflows/_gaudi_hpu_benchmark.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ jobs:
139139
run: |
140140
torch_version=$(python -c "import torch; print(torch.__version__)")
141141
torch_git_version=$(python -c "import torch; print(torch.version.git_version)")
142-
torchbench_version=$(curl https://raw.githubusercontent.com/pytorch/pytorch/${torch_git_version}/.github/ci_commit_pins/torchbench.txt)
142+
# torchbench_version=$(curl https://raw.githubusercontent.com/pytorch/pytorch/${torch_git_version}/.github/ci_commit_pins/torchbench.txt)
143+
torchbench_version=main
143144
torchvision_version=$(curl https://raw.githubusercontent.com/pytorch/pytorch/${torch_git_version}/.github/ci_commit_pins/vision.txt)
144145
torchaudio_version=$(curl https://raw.githubusercontent.com/pytorch/pytorch/${torch_git_version}/.github/ci_commit_pins/audio.txt)
145146
hf_version=$(curl https://raw.githubusercontent.com/pytorch/pytorch/${torch_git_version}/.ci/docker/ci_commit_pins/huggingface.txt)
@@ -210,10 +211,10 @@ jobs:
210211
- name: Run benchmarks
211212
working-directory: benchmark
212213
run: |
214+
export PT_HPU_LAZY_MODE=0
213215
echo "Run torchbench"
214-
touch gaudi_hpu_benchmark.json
215-
# python run_benchmark.py test_bench --accuracy --device hpu --test eval \
216-
# --output gaudi_hpu_benchmark.json
216+
python run_benchmark.py test_bench --accuracy --device hpu --test eval \
217+
--output gaudi_hpu_benchmark.json
217218
218219
- name: Upload the benchmark report file
219220
id: upload-report
@@ -228,7 +229,7 @@ jobs:
228229
- name: Write to workflow job summary
229230
run: |
230231
echo "Write to workflow job summary"
231-
# python .ci/benchmark.py --write-gh-job-summary --path benchmark/gaudi_hpu_benchmark.json
232+
python .ci/benchmark.py --write-gh-job-summary --path benchmark/gaudi_hpu_benchmark.json
232233
233234
- name: Write to workflow job summary
234235
run: |

.github/workflows/_gaudi_hpu_ut.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ jobs:
143143
pip list | grep -E 'torch|numpy'
144144
145145
- name: Do the test
146-
continue-on-error: true
146+
working-directory: pytorch
147147
run: |
148+
pip install -r .ci/docker/requirements-ci.txt
148149
echo "Call UT test scripts"
149-
# python torch_hpu/ci/access_control_test.py
150+
export PT_HPU_LAZY_MODE=0
151+
python test/run_test.py -k test_Dropout2d_hpu --include nn/test_dropout
150152
151153
- name: Cleanup workspace
152154
if: always()

0 commit comments

Comments
 (0)