Skip to content

[release] Add repackage_rocm_libnuma_fix.py for ROCm import-torch deadlock (#189110)#8256

Draft
atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:repackage-rocm-libnuma-fix
Draft

[release] Add repackage_rocm_libnuma_fix.py for ROCm import-torch deadlock (#189110)#8256
atalman wants to merge 1 commit into
pytorch:mainfrom
atalman:repackage-rocm-libnuma-fix

Conversation

@atalman

@atalman atalman commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Repackages already-published ROCm torch wheels on the test channel to fix the intermittent import torch hang on no-GPU / no-kfd hosts (pytorch/pytorch#189110).

For each wheel under whl/test/<rocm> it:

  1. Downloads the wheel.
  2. Aliases the bundled versioned OS deps in torch/lib — adds libnuma.solibnuma.so.1 (and libdrm/libdrm_amdgpu/libdw/libelf/libtinfo/libgomp) as symlinks. No new binary content is bundled — just an alias to the file already in the wheel. This makes rocSHMEM's NUMAWrapper dlopen("libnuma.so") succeed instead of exit()-ing at load (which trips a racy rocprofiler-sdk atexit deadlock). RECORD is regenerated by auditwheel.
  3. Re-uploads under the same key to S3 (pytorch) and R2 (pytorch-downloads) with checksum-sha256 metadata.

Defaults: version 2.13.0, both rocm7.1 and rocm7.2, test channel only.

python release/repackage_rocm_libnuma_fix.py --dry-run   # test, 2.13.0, rocm7.1 + rocm7.2
python release/repackage_rocm_libnuma_fix.py             # real upload

Mirrors the CD-side fix in pytorch/pytorch .ci/manywheel/repair_wheel.py (pytorch/pytorch#189114), for wheels already in the wild. Modeled on release/repackage_torchaudio_cu130_to_cu132.py.

Note: the filename is unchanged but content/sha256 changes, so regenerate the PEP 503 index (s3_management/manage_v2.py) after uploading so the #sha256= fragments match.

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 7, 2026
@atalman atalman force-pushed the repackage-rocm-libnuma-fix branch 4 times, most recently from a786244 to 05d659a Compare July 7, 2026 14:37
…dlock (#189110)

Repackages already-published ROCm torch wheels on the TEST channel to fix the
intermittent `import torch` hang on no-GPU/no-kfd hosts (rocSHMEM NUMAWrapper
dlopen("libnuma.so") -> exit() -> rocprofiler atexit deadlock). For each wheel
under whl/test/<rocm> it downloads, adds bare-name OS-dep symlink aliases in
torch/lib (libnuma.so -> libnuma.so.1, ...) so the dlopen resolves, re-uploads
under the same key to S3 (pytorch) and R2 (pytorch-downloads), and verifies the
alias landed in the wheel + RECORD. RECORD regenerated via auditwheel.

Processes ONE wheel at a time (download -> repackage -> upload -> delete) so
peak disk stays at ~one wheel. --work-dir routes ALL scratch (our mkdtemp AND
auditwheel's unpack, via tempfile.tempdir) to a chosen filesystem -- important
since /tmp is often a small tmpfs. Fails fast with guidance if <25GB free.
Defaults to release 2.13 for rocm7.1/rocm7.2. --wheel <path-or-filename> does a
single wheel (downloads if not local); --output-dir writes locally, no upload.
Modeled on release/repackage_torchaudio_cu130_to_cu132.py.
@atalman atalman force-pushed the repackage-rocm-libnuma-fix branch from 05d659a to 85df54a Compare July 7, 2026 14:46
@atalman atalman marked this pull request as draft July 8, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant