Skip to content

Commit 9e3c383

Browse files
committed
update
1 parent e03979d commit 9e3c383

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

.github/workflows/_ascend_npu_benchmark.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,16 @@ jobs:
7070
repository: pytorch/benchmark
7171
path: benchmark
7272

73-
# TODO
73+
- name: Download ${{ inputs.artifact_name }}
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: ${{ inputs.artifact_name }}
77+
path: ascend_npu
78+
7479
- name: Install torch_npu
80+
working-directory: ascend_npu
7581
run: |
76-
pip install torch-npu --index-url https://pypi.org/simple
82+
pip install ${{ inputs.artifact_name }}
7783
7884
- name: Install torch_npu dependencies
7985
working-directory: ascend_npu
@@ -83,11 +89,17 @@ jobs:
8389
8490
- name: Install benchmark dependencies
8591
run: |
86-
ls -al ascend_npu
87-
echo "\n"
8892
pip install -r benchmark/requirements.txt --constraint ascend_npu/requirements.txt
8993
python benchmark/install.py --userbenchmark test_bench --models BERT_pytorch hf_GPT2
9094
95+
- name: Show environment info
96+
run: |
97+
npu_is_available=$(python -c "import torch; print(torch.npu.is_available())")
98+
npu_count=$(python -c "import torch; print(torch.npu.device_count())")
99+
echo "NPU is available: ${npu_is_available}"
100+
echo "NPU count: ${npu_count}"
101+
pip list | grep torch
102+
91103
- name: Run benchmarks
92104
working-directory: benchmark
93105
run: |

.github/workflows/ascend_npu_test.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,35 @@ jobs:
7373
echo "device=${{ github.event.inputs.device || '/dev/davinci4' }}" >> $GITHUB_OUTPUT
7474
echo "image=${{ github.event.inputs.image || 'ascendai/cann:latest' }}" >> $GITHUB_OUTPUT
7575
76+
build:
77+
name: Build torch_npu
78+
needs:
79+
- prepare
80+
uses: ./.github/workflows/_ascend_npu_build.yml
81+
with:
82+
runner: ${{ needs.prepare.outputs.runner }}
83+
image: ${{ needs.prepare.outputs.image }}
84+
85+
# test:
86+
# name: Test torch_npu
87+
# needs:
88+
# - prepare
89+
# - build
90+
# uses: ./.github/workflows/_ascend_npu_test.yml
91+
# with:
92+
# runner: ${{ needs.prepare.outputs.runner }}
93+
# image: ${{ needs.prepare.outputs.image }}
94+
# device: ${{ needs.prepare.outputs.device }}
95+
# artifact_name: ${{ needs.build.outputs.artifact_name }}
96+
7697
benchmark:
7798
name: Run benchmarks
7899
needs:
79100
- prepare
101+
- build
80102
uses: ./.github/workflows/_ascend_npu_benchmark.yml
81103
with:
82104
runner: ${{ needs.prepare.outputs.runner }}
83105
image: ${{ needs.prepare.outputs.image }}
84106
device: ${{ needs.prepare.outputs.device }}
85-
artifact_name: 'tmp'
107+
artifact_name: ${{ needs.build.outputs.artifact_name }}

0 commit comments

Comments
 (0)