Skip to content

Move GPU unit tests to OSDC runners - #1970

Open
jeanschmidt wants to merge 1 commit into
masterfrom
nm/439/1
Open

jeanschmidt wants to merge 1 commit into
masterfrom
nm/439/1

Conversation

@jeanschmidt

Copy link
Copy Markdown

🏖️ nmc:

Impact: GPU unit-test CI job (test-pip-gpu.yml)
Risk: low

What

Moves the GPU test job from test-infra linux_job_v2.yml on the EC2 label linux.4xlarge.nvidia.gpu to linux_job_v3.yml on the OSDC label mt-l-x86iavx512-29-115-t4 (1x T4, same pytorch/almalinux-builder:cuda12.6 image), with a writable Hugging Face cache and a check that torch is a CUDA build.

Why

No runner serves linux.4xlarge.nvidia.gpu for this repo any more: every run of this workflow since at least October has queued for 24 hours and been cancelled, and the last successful run is from 2026-02-21. mt-l-x86iavx512-29-115-t4 is the label pytorch/ci-infra's runner naming convention maps it to; linux_job_v3.yml runs the job inside its container with the GPU, as OSDC requires.

Notes

  • OSDC runners add a CPU-only torch index through PIP_EXTRA_INDEX_URL, which can serve a newer torch than cu126 and would let the CUDA tests skip silently on a CPU build. The script unsets it and asserts torch.cuda.is_available() and torch.version.cuda after the installs.
  • OSDC runners point HF_HOME at a read-only model cache that differs per region, and the tests download a tiny model from the Hub; the job turns v3's hf-cache off and exports a writable HF_HOME.
  • With no GPU run for months, a test failure here may be drift in captum's GPU code paths rather than the runner move; the PR run tells which.

Switch the GPU test job from test-infra linux_job_v2.yml on
linux.4xlarge.nvidia.gpu, a label no runner serves for this repo any
more, to linux_job_v3.yml on mt-l-x86iavx512-29-115-t4 (1x T4, the
OSDC label mapped to g4dn.4xlarge). v3 runs the job inside the same
pytorch/almalinux-builder:cuda12.6 image, with the GPU.

- OSDC runners point HF_HOME at a read-only, per-region model cache, and
  the HF compatibility tests download a tiny model from the Hub, so the
  job turns v3's hf-cache off and uses a writable HF_HOME.
- OSDC runners add a CPU-only torch index through PIP_EXTRA_INDEX_URL,
  which can serve a newer torch than cu126; the job unsets it and checks
  that the installed torch is a CUDA build that sees the GPU.
@meta-cla meta-cla Bot added the cla signed label Nov 19, 2026
@jeanschmidt
jeanschmidt marked this pull request as ready for review November 20, 2026 19:34
# OSDC runners set HF_HOME to a read-only shared cache; the tests download models from the Hub.
export HF_HOME="${RUNNER_TEMP}/hf_home"
# OSDC runners add a CPU-only torch index through PIP_EXTRA_INDEX_URL, which can win over cu126.
unset PIP_EXTRA_INDEX_URL

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm, I thought we kill this?

hf-cache: false
script: |
# OSDC runners set HF_HOME to a read-only shared cache; the tests download models from the Hub.
export HF_HOME="${RUNNER_TEMP}/hf_home"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same comment, we can use https://github.com/pytorch/test-infra/blob/main/tools/scripts/hf_cache_sync.py to warm up the cache, then you don't need to set HF_HOME here anymore

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants