facebookresearch / facebookresearch/sam3
Hardcoded "cuda" in TransformerDecoderLayer __init__
- Dominant language
- Python
- Stars
- 11.7k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
The current implementation hardcodes device="cuda" when generating coordinate tensors, which causes failures when running on CPU or on a non-default GPU (e.g., "cuda:1").
https://github.com/facebookresearch/sam3/blob/2814fa619404a722d03e9a012e083e4f293a4e53/sam3/model/decoder.py#L280-L286
Contributor guide
Research direction
Start in sam3/model/decoder.py at lines 280-286, inside TransformerDecoderLayer.__init__, and trace how the coordinate tensors receive their device. Verify the behavior on CPU and a non-default GPU such as cuda:1. Done means initialization no longer fails because of a hardcoded cuda device and existing model checks still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100