Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ on:
description: PyTorch ref to checkout. Typically "nightly" or "release/X.Y".
type: string
required: true
pytorch_gitrepo_origin:
description: >-
Optional PyTorch git origin override (for example, a fork URL for
pre-merge testing). Defaults to ROCm/pytorch for stable refs.
type: string
default: ""
rocm_version:
description: ROCm package version to install and build against (e.g. 7.10.0.dev0)
type: string
Expand Down Expand Up @@ -104,6 +110,12 @@ on:
description: PyTorch ref to checkout (for example, "release/2.12").
type: string
default: "release/2.12"
pytorch_gitrepo_origin:
description: >-
Optional PyTorch git origin override (for example, a fork URL for
pre-merge testing). Defaults to ROCm/pytorch for stable refs.
type: string
default: ""
rocm_version:
description: ROCm package version to install and build against (e.g. 7.10.0.dev0)
type: string
Expand Down Expand Up @@ -229,8 +241,12 @@ jobs:
- name: Checkout PyTorch source repos (stable)
if: ${{ inputs.pytorch_git_ref != 'nightly' }}
run: |
pytorch_origin="${{ inputs.pytorch_gitrepo_origin }}"
if [ -z "${pytorch_origin}" ]; then
pytorch_origin="https://github.com/ROCm/pytorch.git"
fi
./external-builds/pytorch/pytorch_torch_repo.py checkout \
--gitrepo-origin https://github.com/ROCm/pytorch.git \
--gitrepo-origin "${pytorch_origin}" \
Comment on lines +244 to +249

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slight preference for this style of providing workflow inputs and default values where you load the input into an environment variable and provide a default if the input is empty:

env:
AWS_SHARED_CREDENTIALS_FILE: /home/awsconfig/credentials.ini
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"

For the approach I linked:

  • multiple steps throughout the workflow can use the value like ${{ env.ARTIFACT_RUN_ID }}
  • The default close to where the input is

For the approach currently on this PR:

--repo-hashtag ${{ inputs.pytorch_git_ref }} \
--no-commit-hipify
./external-builds/pytorch/pytorch_audio_repo.py checkout \
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/multi_arch_build_windows_pytorch_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ on:
description: PyTorch ref to checkout. Typically "nightly" or "release/X.Y".
type: string
required: true
pytorch_gitrepo_origin:
description: >-
Optional PyTorch git origin override (for example, a fork URL for
pre-merge testing). Defaults to ROCm/pytorch for stable refs.
type: string
default: ""
rocm_version:
description: ROCm package version to install and build against (e.g. 7.10.0.dev0)
type: string
Expand Down Expand Up @@ -98,6 +104,12 @@ on:
description: PyTorch ref to checkout (for example, "release/2.12").
type: string
default: "release/2.12"
pytorch_gitrepo_origin:
description: >-
Optional PyTorch git origin override (for example, a fork URL for
pre-merge testing). Defaults to ROCm/pytorch for stable refs.
type: string
default: ""
rocm_version:
description: ROCm package version to install and build against (e.g. 7.10.0.dev0)
type: string
Expand Down Expand Up @@ -240,9 +252,13 @@ jobs:
if: ${{ inputs.pytorch_git_ref != 'nightly' }}
run: |
git config --global core.longpaths true
pytorch_origin="${{ inputs.pytorch_gitrepo_origin }}"
if [ -z "${pytorch_origin}" ]; then
pytorch_origin="https://github.com/ROCm/pytorch.git"
fi
python ./external-builds/pytorch/pytorch_torch_repo.py checkout \
--checkout-dir ${{ env.CHECKOUT_ROOT }}/pytorch \
--gitrepo-origin https://github.com/ROCm/pytorch.git \
--gitrepo-origin "${pytorch_origin}" \
--repo-hashtag ${{ inputs.pytorch_git_ref }} \
--no-commit-hipify
python ./external-builds/pytorch/pytorch_audio_repo.py checkout \
Expand Down
Loading