From 7f2110278aad3331233a1dcddfeb557bd01272e9 Mon Sep 17 00:00:00 2001 From: Dundy Pasupuleti Date: Wed, 11 Nov 2026 13:33:35 -0500 Subject: [PATCH] Use the accelerator device in TestZero3SynchronizedEarlyStop The test hardcoded torch.device(f"cuda:{rank}"), so the cpu multi-rank nightly fails with "Torch not compiled with CUDA enabled" as soon as the prompt tensors are built. Take the device from get_accelerator() like the rest of the suite. Signed-off-by: Dundy Pasupuleti --- tests/unit/runtime/rollout/test_hybrid_engine_rollout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/runtime/rollout/test_hybrid_engine_rollout.py b/tests/unit/runtime/rollout/test_hybrid_engine_rollout.py index 046ab8189f2b..c557dbbc2857 100644 --- a/tests/unit/runtime/rollout/test_hybrid_engine_rollout.py +++ b/tests/unit/runtime/rollout/test_hybrid_engine_rollout.py @@ -1218,7 +1218,7 @@ def test(self): from transformers import Qwen2Config, Qwen2ForCausalLM rank = dist.get_rank() - device = torch.device(f"cuda:{rank}") + device = torch.device(get_accelerator().current_device_name()) model = Qwen2ForCausalLM( Qwen2Config( vocab_size=32,