forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 78
rocm/pytorch:latest broken: torchvision import crashes with 'operator torchvision::nms does not exist' #3109
Copy link
Copy link
Open
Description
Summary
rocm/pytorch:latest Docker image ships a broken torchvision — import torchvision crashes immediately.
Reproducer
docker run --rm rocm/pytorch:latest python3 -c "import torchvision"Error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/venv/lib/python3.12/site-packages/torchvision/__init__.py", line 10, in <module>
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
File "/opt/venv/lib/python3.12/site-packages/torchvision/_meta_registrations.py", line 163, in <module>
@torch.library.register_fake("torchvision::nms")
File "/opt/venv/lib/python3.12/site-packages/torch/library.py", line 1062, in register
use_lib._register_fake(
File "/opt/venv/lib/python3.12/site-packages/torch/library.py", line 210, in _register_fake
handle = entry.fake_impl.register(
File "/opt/venv/lib/python3.12/site-packages/torch/_library/fake_impl.py", line 50, in register
if torch._C._dispatch_has_kernel_for_dispatch_key(self.qualname, "Meta"):
RuntimeError: operator torchvision::nms does not exist
Versions in the image
torch: 2.9.1+rocm7.2.1.lw.gitff65f5bc
torchvision: 0.24.1
Python: 3.12
Impact
- Breaks all downstream CI pipelines that depend on
rocm/pytorch:latest(ATOM, vLLM OOT tests, etc.) - Any code path that triggers
import torchvision(including HuggingFacetransformersimage processing) will crash - ATOM CI is currently blocked by this: https://github.com/ROCm/ATOM/actions/runs/23675231613/job/68977006040
Root cause
torchvision's C++ extension (_C.so) does not have the custom ops (torchvision::nms, torchvision::roi_align, etc.) registered. This suggests torchvision was installed from a pre-built CPU-only wheel rather than being compiled from source against the ROCm torch build.
Suggested fix
Rebuild torchvision from source against the torch in the container, or install from the ROCm-compatible wheel index:
pip install --force-reinstall torchvision --index-url https://download.pytorch.org/whl/rocm7.2Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels