facebookresearch / facebookresearch/sam3

Hardcoded "cuda" in TransformerDecoderLayer __init__

Open Beginner friendly
#550 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.