1111 required : true
1212 type : string
1313 description : ' The docker image which will be used to build'
14+ device :
15+ required : true
16+ type : string
17+ description : ' The device selected to run on'
1418 torch-artifact :
1519 required : false
1620 type : string
3337 runs-on : ${{ inputs.runner }}
3438 container :
3539 image : ${{ inputs.image }}
40+ volumes :
41+ - /usr/local/dcmi:/usr/local/dcmi
42+ - /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
43+ - /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
44+ - /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
45+ - /etc/ascend_install.info:/etc/ascend_install.info
3646 options : >-
3747 --network host
48+ --device ${{ inputs.device }}
49+ --device /dev/davinci_manager
50+ --device /dev/devmm_svm
51+ --device /dev/hisi_hdc
3852 env :
3953 HTTP_PROXY : http://127.0.0.1:10809
4054 HTTPS_PROXY : http://127.0.0.1:10809
@@ -117,6 +131,20 @@ jobs:
117131 echo "dist-name=${dist_name}" >> $GITHUB_OUTPUT
118132 echo "dist-path=${dist_path}" >> $GITHUB_OUTPUT
119133
134+ - name : Install torch_npu
135+ working-directory : torch_npu/dist
136+ run : |
137+ pip install ${{ steps.list-dist.outputs.dist-name }}
138+
139+ - name : List torch_npu version
140+ id : list-version
141+ run : |
142+ torch_version=$(python -c "import torch; print(torch.__version__)")
143+ torch_npu_version=$(python -c "import torch_npu; print(torch_npu.__version__)")
144+ echo "torch version: ${torch_version}"
145+ echo "torch_npu version: ${torch_npu_version}"
146+ echo "torch-npu-version=${torch_npu_version}" >> $GITHUB_OUTPUT
147+
120148 - name : Upload distribution artifact
121149 id : upload-dist
122150 uses : actions/upload-artifact@v4
@@ -130,5 +158,5 @@ jobs:
130158 - name : Write to workflow job summary
131159 if : ${{ steps.upload-dist.outputs.artifact-url }}
132160 run : |
133- echo "## torch_npu built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
161+ echo "## torch_npu-${{ steps.list-version.outputs.torch-npu-version }} built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
134162 echo "You can download the distribution package [here](${{ steps.upload-dist.outputs.artifact-url }})." >> $GITHUB_STEP_SUMMARY
0 commit comments