tests: fix unreachable DeepSpeed+cpu_offload xfail in test_training_feature_matrix - #714
Open
UgaTheDev wants to merge 1 commit into
Open
Conversation
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: instructlab#705 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Kush Zingade <kush.zingade@gmail.com>
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
tests/smoke/test_train.py::test_training_feature_matrix, the DeepSpeedbranch was:
pytest.xfail()raises immediately, so theif cpu_offload:block and thecpu_offload_optimizerassignment below it could never run — bothDeepSpeed-parametrized cases (
cpu_offload=Trueandcpu_offload=False)always hit the same generic message and the more specific CPU-Adam reason was
dead code.
This reorders the checks so the
cpu_offload=Truecase reports its ownspecific, more accurate xfail reason, and only the
cpu_offload=Falsecasefalls through to the general "OOMs during backprop" one:
Verified both xfail messages are now reachable by simulating the branch
logic standalone (can't run the real test without GPU hardware / the full
package installed):
Also confirmed the file still parses (
python3 -m py_compile).This is a test-only change — no non-test code touched, no new coverage
claimed, just makes the two existing xfail reasons distinguishable per the
docstring/#705 finding: "the second xfail below it for DeepSpeed plus CPU
offload... that block and the
deepspeed_options.cpu_offload_optimizerassignment after it are unreachable."
Originally flagged in #705 (comment from 2026-07-29).