[Bugfix] Fix precedence between caller runtime args and default stage configs (#2076)

Signed-off-by: xiaohajiayou <923390377@qq.com>
Co-authored-by: 汪志鹏 <wangzhipeng628@gmail.com>
Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-04-09 16:44:31 +08:00
1 parent e2b0ee4b87
commit 2d980133fe
4 files changed
+73 -16

No files matched your search

+4 -3
View File
@@ -92,9 +92,10 @@ def test_set_stage_devices_handles_not_enough_devices(mocker: MockerFixture, mon
mock_platform,
)
# Raise since we need 4 GPUs, but we only have 2 visible
with pytest.raises(ValueError):
set_stage_devices(stage_id=0, devices="0,1,2,3")
# Keep the logical mapping and resolve to the visible subset.
set_stage_devices(stage_id=0, devices="0,1,2,3")
assert os.environ["CUDA_VISIBLE_DEVICES"] == "6,7"
@pytest.mark.usefixtures("clean_gpu_memory_between_tests")