Summary
The Responses API Triton backend independently selects its CUDA device from global RANK:
rank = int(os.environ.get("RANK", 0))
...
torch.cuda.set_device(rank)
device = torch.device(f"cuda:{rank}")
This backend does not use gpt_oss.torch.utils.init_distributed(), so the local-rank correction in #267 does not cover it.
Under standard multi-node torchrun, global ranks continue across nodes while each host's CUDA devices are indexed by node-local LOCAL_RANK. For example, a worker can have RANK=4, LOCAL_RANK=0 on a four-GPU host; the current backend attempts to bind cuda:4 instead of cuda:0.
Impact
The reference Responses API Triton backend can fail with an invalid CUDA device ordinal on nodes after the first in a standard multi-node launch.
Proposed resolution
Keep global RANK for distributed identity/logging, but use LOCAL_RANK for torch.cuda.set_device() and the CUDA device object. Fall back to RANK when LOCAL_RANK is absent to preserve existing single-node/custom launch behavior.
Add a CPU-only mocked regression with different global and local ranks.
Summary
The Responses API Triton backend independently selects its CUDA device from global
RANK:This backend does not use
gpt_oss.torch.utils.init_distributed(), so the local-rank correction in #267 does not cover it.Under standard multi-node
torchrun, global ranks continue across nodes while each host's CUDA devices are indexed by node-localLOCAL_RANK. For example, a worker can haveRANK=4,LOCAL_RANK=0on a four-GPU host; the current backend attempts to bindcuda:4instead ofcuda:0.Impact
The reference Responses API Triton backend can fail with an invalid CUDA device ordinal on nodes after the first in a standard multi-node launch.
Proposed resolution
Keep global
RANKfor distributed identity/logging, but useLOCAL_RANKfortorch.cuda.set_device()and the CUDA device object. Fall back toRANKwhenLOCAL_RANKis absent to preserve existing single-node/custom launch behavior.Add a CPU-only mocked regression with different global and local ranks.