From 9431891f6bde8d5907eec8fd14e9b60de7d4994c Mon Sep 17 00:00:00 2001 From: Kush Zingade Date: Tue, 25 Aug 2026 01:54:04 +0800 Subject: [PATCH] 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)