From 9431891f6bde8d5907eec8fd14e9b60de7d4994c Mon Sep 17 00:00:00 2001 From: Kush Zingade Date: Tue, 25 Aug 2026 01:54:04 +0800 Subject: [PATCH 1/2] test: fix unreachable DeepSpeed cpu_offload xfail reason pytest.xfail() raises immediately, so the nested 'if cpu_offload' xfail and the cpu_offload_optimizer assignment after the first xfail() call could never execute. Both DeepSpeed-parametrized cases always hit the same generic 'OOMs during backprop' message, and the more specific 'CPU Adam isn't currently building correctly' reason was dead code. Reorders the checks so cpu_offload=True reports its own reason and cpu_offload=False falls through to the general one. Ref: https://github.com/instructlab/training/issues/705 Co-Authored-By: Claude Fable 5 Signed-off-by: Kush Zingade --- tests/smoke/test_train.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/smoke/test_train.py b/tests/smoke/test_train.py index 6d41da9a..dc9c191f 100644 --- a/tests/smoke/test_train.py +++ b/tests/smoke/test_train.py @@ -253,10 +253,9 @@ def test_training_feature_matrix( if dist_backend == DistributedBackend.FSDP: train_args.fsdp_options.cpu_offload_params = cpu_offload else: - pytest.xfail("DeepSpeed not currently functional. OOMs during backprop.") if cpu_offload: pytest.xfail("DeepSpeed CPU Adam isn't currently building correctly") - train_args.deepspeed_options.cpu_offload_optimizer = cpu_offload + pytest.xfail("DeepSpeed not currently functional. OOMs during backprop.") torch_args = TorchrunArgs(**DEFAULT_TORCHRUN_ARGS) From adef9f392efa8f107034ac791b48fe88ec3020a4 Mon Sep 17 00:00:00 2001 From: Kush Zingade Date: Mon, 9 Nov 2026 20:47:41 -0500 Subject: [PATCH 2/2] tests: set cpu_offload_optimizer before the DeepSpeed xfails Keep the assignment rather than deleting it, so re-enabling DeepSpeed later does not silently ignore the cpu_offload case. Signed-off-by: Kush Zingade --- tests/smoke/test_train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/smoke/test_train.py b/tests/smoke/test_train.py index dc9c191f..8cc09f85 100644 --- a/tests/smoke/test_train.py +++ b/tests/smoke/test_train.py @@ -253,6 +253,7 @@ def test_training_feature_matrix( if dist_backend == DistributedBackend.FSDP: train_args.fsdp_options.cpu_offload_params = cpu_offload else: + train_args.deepspeed_options.cpu_offload_optimizer = cpu_offload if cpu_offload: pytest.xfail("DeepSpeed CPU Adam isn't currently building correctly") pytest.xfail("DeepSpeed not currently functional. OOMs during backprop.")