Skip to content

Include TheRock _rocm_init.py via scikit-build wheel.exclude negation - #191632

Closed
ethanwee1 wants to merge 1 commit into
pytorch:mainfrom
ethanwee1:ew/pyproject-wheel-rocm-init
Closed

ethanwee1 wants to merge 1 commit into
pytorch:mainfrom
ethanwee1:ew/pyproject-wheel-rocm-init

Conversation

@ethanwee1

@ethanwee1 ethanwee1 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

After the scikit-build-core wheel migration, the Windows ROCm wheel drops TheRock's generated torch/_rocm_init.py because scikit-build-core excludes gitignored files, and without it import torch fails with WinError 126 on c10_hip.dll. This adds a one-line wheel.exclude negation in pyproject.toml so the file ships when present, matching the existing nativert pattern and staying a no-op on non-ROCm builds. It replaces the temporary force-include TheRock currently carries in ROCm/TheRock#7009.

Fixes ROCm/TheRock#6965
Supported by @jeffdaily

@pytorch-bot

pytorch-bot Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/191632

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (3 Unrelated Failures)

As of commit d41a80b with merge base 3022368 (image):

NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following jobs failed, but the AI CI Advisor judged the failures not to be evidence against this change:

  • linux-aarch64-binary-manywheel / manywheel-cuda-aarch64-cu130-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ModuleNotFoundError: No module named 'tabulate'

    AI verdict: AI verdict: not related

    The build fails because the CMake target bolt_profile_quality_summary runs tools/bolt_profile_quality.py, which imports tabulate, and tabulate isn't installed in the aarch64 manywheel build image. The suspect commit only adds a wheel.exclude negation for torch/_rocm_init.py in pyproject.toml. The same error shows up in the nightly trunk run and in another PR's run of the same job.

    Full reasoning on HUD →

  • linux-aarch64-binary-manywheel / manywheel-cuda-aarch64-cu132-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ModuleNotFoundError: No module named 'tabulate'

    AI verdict: AI verdict: not related

    The build fails because the CMake BOLT summary step runs tools/bolt_profile_quality.py, which imports tabulate, and tabulate is not installed in the aarch64 manywheel image. The suspect commit only adds a !torch/_rocm_init.py wheel-exclude negation to pyproject.toml. The same error already appears in the main nightly (ed267a0, about 6 hours earlier) and in the same job on unrelated PRs 200931 and 191629.

    Full reasoning on HUD →

  • linux-aarch64-binary-manywheel / manywheel-cuda-aarch64-cu134-build (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ModuleNotFoundError: No module named 'tabulate'

    AI verdict: AI verdict: not related

    The build dies when the CMake target bolt_profile_quality_summary runs tools/bolt_profile_quality.py, which does import tabulate, and the aarch64 manywheel build Python doesn't have tabulate installed. The suspect commit only adds a !torch/_rocm_init.py line to the wheel.exclude list in pyproject.toml, which has nothing to do with this. The same error already shows up in the trunk nightly and in other unrelated PRs.

    Full reasoning on HUD →

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added module: rocm AMD GPU support for Pytorch topic: not user facing topic category labels Jul 30, 2026
ScottTodd added a commit to ROCm/TheRock that referenced this pull request Jul 30, 2026
… PRs land (#7009)

## Motivation

This passes scikit-build-core force-include settings for our generated
and .gitignore'd `_rocm_init.py` file and Windows OpenMP runtime files.

* Local patch for #6965
* This should be compatible with
  * pytorch/pytorch#191625
  * pytorch/pytorch#191632
  * pytorch/pytorch#191629

## Technical Details

* `python -m build` backend configuration
(https://build.pypa.io/en/stable/how-to/config-settings.html) documents
`-C` as shorthand for `--config-setting`. It forwards `KEY=VALUE`
settings to the selected PEP 517 backend.
* scikit-build-core configuration
(https://scikit-build-core.readthedocs.io/en/stable/configuration/#configuration)
says every setting can be supplied through `pyproject.toml`, PEP 517
config settings, or environment variables. Its examples use dotted CLI
keys such as `-Ccmake.build-type=Debug` (see
https://scikit-build-core.readthedocs.io/en/stable/reference/configs.html#confval-cmake.build-type)
* scikit-build-core’s `wheel.force-include` section
(https://scikit-build-core.readthedocs.io/en/stable/configuration/#force-including-files)
documents the source-to-destination mapping and notes that exact
force-includes override exclusions.

## Test Plan

Trigger builds of pytorch on linux and windows using 'nightly', look for
`_rocm_init.py` and library load succeeding

| Config | Logs | Result |
-- | -- | --
Linux 'nightly' |
https://github.com/ROCm/TheRock/actions/runs/30588591418 | Pending
Linux 'release/2.12' |
https://github.com/ROCm/TheRock/actions/runs/30589526077 | Pending
Windows 'nightly' |
https://github.com/ROCm/TheRock/actions/runs/30588680552 | Pending

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.

Co-authored-by: Codex <[email protected]>
@ethanwee1
ethanwee1 marked this pull request as ready for review July 31, 2026 15:30

@jithunnair-amd jithunnair-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ethanwee1 Lgtm, but can you please post a link to theRock validation build, since pytorch/pytorch CI doesn't have a build to test this yet?

@jithunnair-amd jithunnair-amd added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 3, 2026
@ethanwee1

Copy link
Copy Markdown
Contributor Author

TheRock validation for this PR (pyproject wheel.exclude negation for _rocm_init.py):

Run (in progress): https://github.com/ROCm/TheRock/actions/runs/30864648889

Input Value
TheRock repo/ref ethanwee1/TheRock @ users/ethanwee/test-191632-pyproject-rocm-init
PyTorch fork ethanwee1/pytorch @ ew/pyproject-wheel-rocm-init (patched into nightly checkout)
pytorch_git_ref nightly
rocm_version 10.1.0a20260803
rocm_package_index_url https://rocm.nightlies.amd.com/whl-multi-arch/
amdgpu_families gfx1100
cache_type none
test_amdgpu_families none

Note: yesterday's run https://github.com/ROCm/TheRock/actions/runs/30844303146 used pytorch_git_ref=ew/pyproject-wheel-rocm-init (stable checkout path) and failed early on missing torchaudio related commits — not a valid test of the wheel fix. This dispatch uses the test branch + nightly path instead.

@ethanwee1

Copy link
Copy Markdown
Contributor Author

Status update: first run today (30864648889) failed because the test branch was stale vs TheRock main (build_prod_wheels.py: unrecognized arguments: --release-type=dev). Refreshed users/ethanwee/test-191632-pyproject-rocm-init on latest main.

Re: pytorch_git_ref: the dispatch input stays nightly, but the test-branch workflow patches the nightly checkout to ethanwee1/pytorch @ ew/pyproject-wheel-rocm-init. Setting pytorch_git_ref=ew/pyproject-wheel-rocm-init directly hits the stable checkout path (needs torchaudio related commits) — that's what broke yesterday's run. So your branch is what gets built; nightly is just the workflow selector for the patched code path.

New run (queued): https://github.com/ROCm/TheRock/actions/runs/30866436372

@jithunnair-amd

jithunnair-amd commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

@ethanwee1 Please follow up on this; theROCk build you linked to in your last comment failed to build

@ethanwee1
ethanwee1 force-pushed the ew/pyproject-wheel-rocm-init branch from ad903e3 to a5304f3 Compare October 14, 2026 14:27
@pytorch-bot

pytorch-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@jithunnair-amd jithunnair-amd added ciflow/binaries_wheel Trigger binary build and upload jobs for wheel on the PR keep-going Don't stop on first failure, keep running tests until the end labels Oct 14, 2026
TheRock writes torch/_rocm_init.py before ROCm wheel builds; .gitignore
drops it from scikit-build-core's package walk. Add a wheel.exclude
negation so the file is shipped when present (ScottTodd's pyproject.toml
suggestion; same pattern as nativert .py un-excludes).

Alternative to CMake install (pytorch#191625); safe when the file is
absent on non-ROCm builds unlike wheel.force-include.

Fixes ROCm/TheRock#6965
Fixes ROCm/TheRock#6991
@ethanwee1
ethanwee1 force-pushed the ew/pyproject-wheel-rocm-init branch from a5304f3 to d41a80b Compare October 15, 2026 16:09
@ethanwee1 ethanwee1 closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries_wheel Trigger binary build and upload jobs for wheel on the PR ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end module: rocm AMD GPU support for Pytorch open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] PyTorch nightly builds are missing _rocm_init.py. Windows fails to load c10_hip.dll, Linux fails to load libMIOpen.so.1

4 participants