Skip to content

Fixing Gpt2 demo failing#890

Open
vzeljkovicTT wants to merge 2 commits intomainfrom
vzeljkovic/fixing_gpt2_demo
Open

Fixing Gpt2 demo failing#890
vzeljkovicTT wants to merge 2 commits intomainfrom
vzeljkovic/fixing_gpt2_demo

Conversation

@vzeljkovicTT
Copy link
Contributor

Issue: tenstorrent/tt-xla#3291

Problem:
When importing torchvision with ghcr.io/tenstorrent/tt-xla-slim docker image, users encounter a RuntimeError: operator torchvision::nms does not exist due to version incompatibility between torch and torchvision packages.

vzeljkovic@wh-lb-37-special-vzeljkovic-for-reservation-18832:/localdev/vzeljkovic/tt-forge$ pip list | grep -i torch
torch                             2.9.0+cpu
torch-xla                         2.9.0+git061c1e7
torchaudio                        2.9.0
torchvision                       0.24.0
vzeljkovic@wh-lb-37-special-vzeljkovic-for-reservation-18832:/localdev/vzeljkovic/tt-forge$ 
vzeljkovic@wh-lb-37-special-vzeljkovic-for-reservation-18832:/localdev/vzeljkovic/tt-forge$ python
Python 3.11.14 (main, Oct 10 2025, 08:54:03) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> import torch
>>> import torchvision
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/dist-packages/torchvision/__init__.py", line 10, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils  # usort:skip
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/torchvision/_meta_registrations.py", line 163, in <module>
    @torch.library.register_fake("torchvision::nms")
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/torch/library.py", line 1063, in register
    use_lib._register_fake(
  File "/usr/local/lib/python3.11/dist-packages/torch/library.py", line 211, in _register_fake
    handle = entry.fake_impl.register(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-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

Updated torchvision to use the CPU-compatible version that matches the torch installation

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant