Skip to content

Commit 0a01b7b

Browse files
committed
update
1 parent 64fef53 commit 0a01b7b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/_common_build_torch.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ on:
1111
required: true
1212
type: string
1313
description: 'The docker image which will be used to build'
14+
ref:
15+
required: false
16+
type: string
17+
default: 'refs/heads/main'
18+
description: 'The branch, tag or SHA to checkout'
1419
outputs:
20+
torch_version:
21+
description: 'The version of PyTorch'
22+
value: ${{ jobs.build.outputs.torch_version }}
1523
artifact_name:
16-
description: 'The torch distribution artifact name'
24+
description: 'The distribution artifact name of PyTorch'
1725
value: ${{ jobs.build.outputs.dist_name }}
1826

1927
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
@@ -38,6 +46,7 @@ jobs:
3846
SOCKS_PROXY: socks5://127.0.0.1:10808
3947
outputs:
4048
dist_name: ${{ steps.list-dist.outputs.dist_name }}
49+
torch_version: ${{ steps.list-dist.outputs.torch_version }}
4150
steps:
4251
- name: Config mirrors
4352
run: |
@@ -54,12 +63,11 @@ jobs:
5463
run: |
5564
git config --global --add safe.directory "$GITHUB_WORKSPACE"
5665
57-
# TODO
5866
- name: Checkout PyTorch
5967
uses: actions/checkout@v4
6068
with:
6169
repository: pytorch/pytorch
62-
ref: refs/pull/142477/merge
70+
ref: ${{ inputs.ref }}
6371
submodules: recursive
6472
path: pytorch
6573

@@ -84,8 +92,10 @@ jobs:
8492
run: |
8593
dist_name=$(ls *.whl)
8694
dist_path=$(pwd)/${dist_name}
95+
torch_version=$(python -c "import torch; print(torch.__version__)")
8796
echo "dist_name=${dist_name}" >> $GITHUB_OUTPUT
8897
echo "dist_path=${dist_path}" >> $GITHUB_OUTPUT
98+
echo "torch_version=${torch_version}" >> $GITHUB_OUTPUT
8999
90100
- name: Upload distribution artifact
91101
id: upload-dist
@@ -101,5 +111,5 @@ jobs:
101111
- name: Write to workflow job summary
102112
if: ${{ steps.upload-dist.outputs.artifact-url }}
103113
run: |
104-
echo "## torch built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
114+
echo "## torch-${{ steps.list-dist.outputs.torch_version }} built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
105115
echo "You can download the distribution package [here](${{ steps.upload-dist.outputs.artifact-url }})." >> $GITHUB_STEP_SUMMARY

.github/workflows/ascend_npu_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
echo "device=${{ github.event.inputs.device || '/dev/davinci5' }}" >> $GITHUB_OUTPUT
9292
echo "image=${{ github.event.inputs.image || 'ascendai/cann:latest' }}" >> $GITHUB_OUTPUT
9393
94+
# TODO
9495
build-torch:
9596
name: Build torch
9697
needs:
@@ -99,6 +100,7 @@ jobs:
99100
with:
100101
runner: ${{ needs.prepare.outputs.runner }}
101102
image: ${{ needs.prepare.outputs.image }}
103+
ref: 'refs/pull/142477/merge'
102104

103105
# build:
104106
# name: Build torch_npu

0 commit comments

Comments
 (0)