Repository navigation
test: run windows-latest train() tests on aten_half_matmuls instead of skipping - #1401
Conversation
MakazhanAlpamys
left a comment
There was a problem hiding this comment.
@UroojFatima-052, welcome, and thank you. This is a clean first PR. It does exactly what #1359 proposed, including the part that usually gets skipped, and the description says precisely what you checked and what you couldn't.
What's good:
- The new
FIXTURE_TESTScheck is what stops this list from drifting again. I removedaten_half_matmulsfrom each of the nine tests, one at a time. Every time, exactly one case failed (1 failed / 24 passed), and it named the test. - Moving the lookup into
_find_test()keeps the two checks consistent. If a test is renamed or moved, both checks still fail loudly. - Leaving
test_rewind_wiring.pyout ofFIXTURE_TESTS, with the reason written next to the list, is right. I measured it: that test runs 840 fp32SGEMMcalls and no half-precision GEMM, so it never needed the fixture.
What I ran on a Windows box (CPU, Python 3.12). The files were test_rewind_hf.py, test_rewind_wiring.py, test_v05311.py, test_issue382_windows_ci_guard_is_shared.py and test_v07202.py::TestTheWindowsCiSkipStaysNarrow:
- Your head with
CI=true: 147 passed, 3 skipped, and all ten previously skipped tests ran and passed. The 3 skips are two mlx tests and the guard file's own unskipped-state control. - Your head merged into current
main,CI=true: 147 passed, 3 skipped, all ten passed. mainwithCI=true, for comparison: 138 passed, 13 skipped, with all ten skipped under #382.MKL_VERBOSE=1:test_recorded_rows_match_sampler_ordergoes from 384GEMM_BF16BF16F32calls onmainto 0 with your change.- The GRPO step goes from 28 to 0.
- So the fixture works in these particular tests too, not only in the ones #1314 measured.
- The narrow-guard checks still hold:
- Widening
_windows_ci()to every Windows box fails 3 tests. - Widening it to every CI runner fails 4.
- Removing the skip from one NF4 test fails the trimmed
GUARDED_TESTScheck.
- Widening
Like your machine, this box can't reproduce 0xc000001d. ONEDNN_VERBOSE=1 logs no oneDNN primitive here, so this CPU never takes the code path that crashes the fleet. The three windows-latest cells are the real test. If the crash comes back in one of these tests with the fixture on, #1359's last criterion applies: only that test gets its skip back, with the log linked.
Three optional suggestions. None of them blocks the merge:
- A skip added back to one of the nine still passes the guard. I put
@skip_on_windows_ciback ontest_recorded_rows_match_sampler_orderand kept the fixture: 25 passed. Adding one assert totest_the_test_requests_the_fixturecloses that gap. It also forces the path the issue describes: move the test toGUARDED_TESTSand link the log.With it, the same mutation fails (1 failed), and the unmutated run stays at 25 passed.assert "skip_on_windows_ci" not in _decorator_names(node), ( f"{filename}::{target} requests aten_half_matmuls and must not also skip; " f"if it needs the #382 skip back, move it to GUARDED_TESTS and link the log" )
tests/test_rewind_hf.py:279-281: the arguments are indented 8 spaces and the closing):4. The same file uses the usual form at:308-310: arguments at 4 spaces,):at column 0.tests/_windows_ci.py:3-5: the module docstring still says the guard is "Imported by every test file that reaches a realtrainer.train()" and "needed in four of them". After this PR onlytest_v07202.pyimports it.
On #1303: thanks for flagging it. When it lands, nothing in the guard will fail, because KNOWN_CALL_SITES isn't compared with the files that actually import the marker. So a follow-up after it merges, as you suggested, is the right place.
This is ready to merge. It now waits only on the required checks, which are still queued because the shared runners are busy. If you push again (for example to add suggestion 1), the new run needs a maintainer's approval before it starts, since this is your first contribution, and it joins the back of the queue. So it's also fine to leave the suggestions for a follow-up.
|
Thanks @MakazhanAlpamys for the review. Since CI hadn't started yet it was cleaner to fix those suggestions in this PR. Applied all three suggestions. Looking forward to the merge and to contributing more here. |
MakazhanAlpamys
left a comment
There was a problem hiding this comment.
@UroojFatima-052, thank you for taking the three suggestions, and for doing it while the first run was still waiting. I went through the new push (f02f4dbe) and checked it against the code, not just the description.
What is good
- The skip-plus-fixture assertion works. I put
@skip_on_windows_ciback ontest_recorded_rows_match_sampler_orderand keptaten_half_matmuls: the new assert fails it (1 failed, 20 passed), and the message tells the next person to move the test toGUARDED_TESTSand link the log. Unmutated, the guard file and the narrow-skip class are 25 passed. - The docstrings now say what the code does.
tests/_windows_ci.pynames bitsandbytes only for the two NF4 tests and says the other tests request the fixture, which matches the one remaining import of the marker (test_v07202.py).
What I ran (CPU, CUDA_VISIBLE_DEVICES=-1, CI=true so the skip would fire, your head merged into current main, which merged cleanly):
test_issue382_windows_ci_guard_is_shared.py,TestTheWindowsCiSkipStaysNarrow,test_rewind_hf.py,test_rewind_wiring.py,test_v05311.py: 147 passed, 3 skipped. The 3 skips are two mlx tests and the guard file's own unskipped-state control. All ten tests that used to skip ran and passed.- Merged again with the newest
mainand re-ran the same targets with only the GRPO test fromtest_v05311.py: 59 passed, 3 skipped.ruff checkis clean. - The new guard file on clean
main: 9 failed, 12 passed. The 9 are theTestTheHalfPrecisionTestsRequestTheFixturecases, sincemainstill skips those nine tests. - Eight mutations:
- Six fail a test:
- dropping the fixture from a rewind test (1 failed);
- dropping the fixture from the GRPO test (1);
- re-adding the skip next to the fixture (1);
- removing the skip from an NF4 test (1);
- widening
_windows_ci()to every Windows box (3); - widening it to every CI runner (4).
- Making
aten_half_matmulsa no-op passes your guard file. That is expected, because your file checks that the tests request the fixture, not what the fixture does. The existingTestTheAtenMatmulSwitchStaysScoped::test_the_fixture_switches_both_offintest_issue1235_prm_fp32_master_weights.pycatches it (1 failed). - Re-adding a skip to
test_hf_training_run_records_every_row_oncepasses, because that fp32 test is in neither list. That was decided last round and I am not reopening it.
- Six fail a test:
- Your earlier head on windows-latest: the required run on
2d8d62cawas green on all three windows cells. In the 3.12 and 3.10 logs, all ten tests show PASSED, the two NF4 tests stay SKIPPED, and there is no0xc000001danywhere. That is good evidence for the approach, but it was measured on the hosts those jobs happened to get. The windows cells on this head are still the real check.
Two cosmetic leftovers. Neither blocks the merge, and there is no need to push again for them:
tests/test_rewind_hf.py:281: the arguments are at 4 spaces now, but the closing):is still at 4. Your own file uses the usual form at:308-310, with):at column 0.tests/test_issue382_windows_ci_guard_is_shared.py:200-202: the blank line after the newassertblock went away, so one blank line precedes@pytest.mark.skipif(where PEP 8 wants two.ruff checkdoes not flag it, and this repo keepsruff formatoff.
Status. Nothing in the code or the tests needs changing; it is ready to merge. The only thing it waits on is the required checks on this head. As your first contribution, a maintainer has to approve the runs for this push before they start.
One note for the record: if 0xc000001d comes back in one of these ten tests on a windows-latest cell, issue #1359's last criterion applies. Only that test gets its skip back, with the log linked.
|
Merged as |
Closes #1359
Nine tests that crashed part of the windows-latest fleet with 0xc000001d now request
aten_half_matmulsinstead of skipping, following #1314's trace to CPU bf16/fp16 matmuls. The tenth trains fp32 and just loses its skip.Changes
tests/test_rewind_hf.py: the eight realSFTTrainer.train()tests requestaten_half_matmuls; skips and the now-unused import removedtests/test_v05311.py:test_real_trl_grpotrainer_end_to_end_steprequests the fixture; skip and import removedtests/test_rewind_wiring.py: skip, its "marker follows the recorder" comment, and the import removed (fp32 run, no fixture needed)tests/_windows_ci.py:_windows_ci()docstring now names bitsandbytes only for the two NF4 tests and CPU half-precision matmuls (test(prm): run #1235's CPU bf16/fp16 steps on ATen's matmuls, fixing windows-latest 0xc000001d #1314) for the resttests/test_issue382_windows_ci_guard_is_shared.py:KNOWN_CALL_SITES/GUARDED_TESTStrimmed totest_v07202.pyand its two NF4 testsFIXTURE_TESTS+TestTheHalfPrecisionTestsRequestTheFixturechecks the nine tests still requestaten_half_matmuls_find_test(), shared by both checksVerification
Local, Windows 11, CPU only, Python 3.11, with
CI=trueset so the skip would have fired:test_rewind_hf.py: 21 passed (all eight previously skipped tests ran)test_v05311.py -k test_real_trl_grpotrainer_end_to_end_step: passedtest_rewind_wiring.py -k test_hf_training_run_records_every_row_once: passedtest_issue382_windows_ci_guard_is_shared.py: 21 passedruff check src/soup_cli/ scripts/ tests/ benchmarks/: cleanMy CPU likely doesn't hit the fleet's 0xc000001d, so the windows-latest cells are the real check.
Notes
@skip_on_windows_ciclasses from fix(train): wire resume_from_checkpoint for prm and moe_lora_routing (#1220) #1303 since that PR isn't merged yet. Happy to add them to the check in a follow-up once it lands.