You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TEST] test_checkpoint_interop_4053::test_load_state_dict_round_trip_preserves_v1_model[gptq_triton] is red on main after #4871: _logits() forwards CPU input_ids into a CUDA model #4908
PYTHONPATH=<main> /root/venv/bin/python -m pytest tests/test_checkpoint_interop_4053.py -q -p no:randomly
1 failed, 26 passed, 1 skipped (exit 1)
FAILED tests/test_checkpoint_interop_4053.py::test_load_state_dict_round_trip_preserves_v1_model[gptq_triton]
E RuntimeError: Expected all tensors to be on the same device, but got index is on cpu,
different from other tensors on cuda:0 (when checking argument in method wrapper_CUDA__index_select)
torch/nn/functional.py:2621 (F.embedding)
1ba67030 (#4871, "drop the reference cycles a single-device GPU load leaves behind")
1 failed, 1 passed
d8758c48 (main)
1 failed, 26 passed, 1 skipped
#4871 is the first bad commit. It is a regression of the test, not of the product: its commit message states the intended contract change — "direct CPU-tensor forwards now require the model device, which is what accelerate and transformers do when no hook is installed" — and simple_dispatch_model now skips AlignDevicesHook for a single-device map, so nothing moves inputs any more.
The tensor is always on the CPU, but the [gptq_triton] case loads the model with device="cuda". Before #4871 the per-module AlignDevicesHook(io_same_device=True) moved the input; now the forward raises.
Fix
Move the fixture's inputs to the model's device (or the test's device argument) so the test exercises the round-trip identity rather than the removed implicit move. The [gptq_torch] CPU case must keep working. generate() on CPU input_ids is unaffected (transformers moves them), so the product contract from #4871 stands.
This is the only failing case in the file; no other test in it forwards CPU tensors into a CUDA model.
Fix the stale direct-forward fixture in tests/test_checkpoint_interop_4053.py: move _logits() inputs to the model device after #4871 removed the implicit input move; verify gptq_torch (CPU) and gptq_triton (CUDA) cases.
Activity
Qubitium commentedon Nov 17, 2026
Agent claim released:
agent-53ba17eb4d83finished this issue.Pull request: #4911
Fix the stale direct-forward fixture in tests/test_checkpoint_interop_4053.py: move _logits() inputs to the model device after #4871 removed the implicit input move; verify gptq_torch (CPU) and gptq_triton (CUDA) cases.
test(interop): forward the round-trip fixture's inputs on the model d…