Skip to content

ci(pytorch): add optional PyTorch git origin override to wheel builds#6782

Draft
ethanwee1 wants to merge 1 commit into
mainfrom
users/ethanwee/pytorch-gitrepo-origin
Draft

ci(pytorch): add optional PyTorch git origin override to wheel builds#6782
ethanwee1 wants to merge 1 commit into
mainfrom
users/ethanwee/pytorch-gitrepo-origin

Conversation

@ethanwee1

@ethanwee1 ethanwee1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an optional pytorch_gitrepo_origin input to the multi-arch PyTorch wheel build workflows so a build can check out PyTorch from an alternate origin (for example, a fork URL) for pre-merge testing.

Split out from #6735 per review, and applied to both the Linux and Windows workflows to keep them in sync.

Changes

  • .github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml
  • .github/workflows/multi_arch_build_windows_pytorch_wheels.yml

For each: add the pytorch_gitrepo_origin input to the workflow_call and workflow_dispatch input blocks, and use it in the "Checkout PyTorch source repos (stable)" step as --gitrepo-origin.

Behavior

  • Default is "", which resolves to https://github.com/ROCm/pytorch.git in the stable checkout step, so existing behavior is unchanged.
  • When set, the stable checkout uses the provided origin instead. Only affects non-nightly refs (the nightly checkout is unchanged).

Add an optional `pytorch_gitrepo_origin` input to the multi-arch PyTorch
wheel build workflows (Linux and Windows, kept in sync). When set, the
stable checkout uses it as the `--gitrepo-origin` (for example, a fork URL
for pre-merge testing); it defaults to https://github.com/ROCm/pytorch.git
so existing behavior is unchanged.
@therock-pr-bot

therock-pr-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
JIRA ID : TESTAUTO-6039
JIRA ID - #330
JIRA ID #330
JIRA ID (on separate line)
ROCM-25757
ISSUE ID : TESTUTO-3334
ISSUE ID #3334
ISSUE ID - TESTAUTO-3433
ISSUE ID (on separate line)
AIRUNTIME-2352
ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Closes #10
Fixes octo-org/octo-repo#100
Resolves: #123
#123
https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Title/Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot therock-pr-bot Bot added the Not ready to Review PR has unresolved policy failures — reviews blocked label Jul 22, 2026
@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

Comment on lines +244 to +249
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}" \

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:

- ccache
default: sccache

run-name: Build Multi-Arch Windows PyTorch Wheels (${{ inputs.release_type }}, ${{ inputs.python_version }}, ${{ inputs.pytorch_git_ref }})

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.

We could also include the gitrepo_origin in the run-name if one is provided, but I think just the ref should be sufficient. What do you think? Would you want it included in the run name? We might be short on character count since repository URLs are pretty long...

If we did make that sort of change, we'd want a multiline string so optional values can be checked, like this:

run-name: >-
Multi-Arch Release (${{ inputs.release_type }})
| Linux: ${{ inputs.linux_amdgpu_families || 'none' }}
| Windows: ${{ inputs.windows_amdgpu_families || 'none' }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Not ready to Review PR has unresolved policy failures — reviews blocked

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

2 participants