Skip to content

ci: pin torchvision alongside torch in vlm 8-GPU workflow - #3047

Merged
tianyu-l merged 1 commit into
pytorch:mainfrom
rishisinhanj:fix-rocm-torchvision-install-batch
Apr 22, 2026
Merged

tianyu-l merged 1 commit into
pytorch:mainfrom
rishisinhanj:fix-rocm-torchvision-install-batch

Conversation

@rishisinhanj

@rishisinhanj rishisinhanj commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Add torchvision to the pip install --force-reinstall --pre torch ... line in the VLM 8-GPU integration test workflow:

  • integration_test_8gpu_vlm.yaml

Same one-line fix that landed in #3002 for integration_test_8gpu_transformers_modeling_backend.yaml.

Why

Force-reinstalling only torch from the nightly index leaves the pre-installed torchvision (built against an older nightly) in place. Pip's resolver doesn't catch the resulting ABI break (pip check passes), but any code path that does import torchvision fails:

RuntimeError: operator torchvision::nms does not exist
  File ".../torchvision/_meta_registrations.py", line 163, in <module>
    @torch.library.register_fake("torchvision::nms")

The VLM workflow's test entry point pulls torchvision transitively (image-utils path through transformers), so the ABI break is fatal at import time.

Scope note

An earlier revision of this PR also patched features.yaml, torchft.yaml, and autoparallel.yaml. Removed — those workflows are red on ROCm for an unrelated reason (DCP planner EOFError in gather_object, see #3051), and a torchvision pin there would be speculative. Will file separately if/when verified.

Repro / verification (local, MI325X / rocm/pytorch:latest)

Step Result
Force-reinstall torch only from nightly/rocm7.1 torch upgraded to 2.13.0.dev, torchvision left at 0.25.0
import torchvision RuntimeError: operator torchvision::nms does not exist
pip check "No broken requirements" — silent ABI break
Apply fix (install torch torchvision together) torch 2.13.0.dev + torchvision 0.27.0.dev
import torchvision succeeds

The exact same shape was previously confirmed and merged for transformers_modeling_backend.yaml in #3002.

Note comment

Per review feedback on #3002, the touched file gets a 2-line # NOTE: explaining why torchvision is on the install line, so future maintainers don't strip it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 21, 2026
@pytorch-bot

pytorch-bot Bot commented Apr 21, 2026

Copy link
Copy Markdown

Unknown label ciflow/rocm-mi300.
Currently recognized labels are

  • ciflow/8gpu
  • ciflow/h100.8

@pytorch-bot

pytorch-bot Bot commented Apr 21, 2026 •

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I knew that transformers backend will likely import torchvision internally.

This and models.py test (https://github.com/pytorch/torchtitan/blob/main/tests/integration_tests/models.py#L192) will use torchvision, but for others where is torchvision needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right, sorry, it should be vlm only. I'll make the change. Honestly given vlm is currently green though, I'm not sure it's worth pushing the narrowed version either; happy to either re-scope or close, whichever you'd prefer.

Separately: 8 GPU Feature Tests has been red since ~04-13 from a different bug (EOFError in dcp.load gather_object, it looks ROCm-specific, save takes 16s vs 2s on CUDA). Looking into that now.

@tianyu-l tianyu-l Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

happy to either re-scope or close, whichever you'd prefer

I think it's more principled to include torchvision nightly, so let's do that even if we don't hit a conflict today. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Force-reinstalling only torch from the nightly index leaves the
pre-installed torchvision (built against an older nightly) in place.
Pip's resolver doesn't catch the resulting ABI break (pip check passes),
but any code path that does `import torchvision` fails:

  RuntimeError: operator torchvision::nms does not exist

Same one-line fix that landed in pytorch#3002 for the transformers modeling
backend workflow. Narrowing this PR to the vlm workflow only — the
other ROCm 8-GPU workflows (features/torchft/autoparallel) are
failing for unrelated reasons and a torchvision pin there would be
speculative.

Verified locally on MI325X / rocm/pytorch:latest against the
nightly/rocm7.1 index: bug reproduced before fix, import succeeds
after.
@rishisinhanj
rishisinhanj force-pushed the fix-rocm-torchvision-install-batch branch from 13e4c67 to 6591c54 Compare April 22, 2026 03:42
@rishisinhanj rishisinhanj changed the title ci: pin torchvision alongside torch in 4 ROCm 8-GPU workflows ci: pin torchvision alongside torch in vlm 8-GPU workflow Apr 22, 2026
@tianyu-l
tianyu-l merged commit 7129134 into pytorch:main Apr 22, 2026
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm-mi300 ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants