pytorch / pytorch/vision

torchvision.roi_align does not support TPU

Open
#3,056 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

Hello.
We are using TPU in GCP.

We are currently modifying the code to allow the TPU to return to Detectron2.
However, there is an error that roi_align in Torchvision is not supported by TPU.
Please check the bottom. Can you solve it for me?

File "/anaconda3/envs/torch-xla-1.7/lib/python3.6/site-packages/torchvision/ops/roi_align.py", line 51, in roi_align return torch.ops.torchvision.roi_align(input, rois, spatial_scale, output_size[0], output_size[1], sampling_ratio, aligned) RuntimeError: Could not run 'torchvision::roi_align' with arguments from the 'XLA' backend. 'torchvision::roi_align' is only available for these backends: [CPU, BackendSelect, Named, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with torchvision/ops/roi_align.py and the torch.ops.torchvision.roi_align entry point shown in the traceback, then reproduce the operation on the XLA backend with a TPU. Done means roi_align executes successfully on XLA without the reported backend error and the behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.