Repository navigation
Conversation
…uned CSV (Refs #6255) --run_config <tuned_csv> reads its shapes from the tuned file, but _run_selected called pre_process first and GemmCommonTuner.pre_process asserts that the untuned CSV exists, so the run died on a machine without the default untuned file. Skip only that read: while --run_config <file> is given without --compare or --all, a missing untuned CSV reads as an empty frame. pre_process itself still runs, so a tuner's own setup stays in place (gemm_a8w8_mxfp8_bpreshuffle sets _mxscale_table and its tuned file there, and run_config uses both).
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
Refs #6255
Summary
--run_config <tuned.csv>now runs on a machine that has no default untuned CSV. One of the three defects of #6255; the other two are in the stacked PRs for the ASM table and for CK shape legality (see "Overlap").Motivation
--run_config <tuned.csv>takes its shapes from that tuned file, butTunerCommon._run_selectedcalledpre_processfirst.GemmCommonTuner.pre_processreads the default untuned CSV and asserts that it exists (Not exist untuned file), so the run died before it looked at--run_config.Changes
aiter/utility/base_tuner.py: while--run_config <csv>is given without--compareor--all,get_untuned_gemm_listreturns an empty frame (with the tuner's key columns) for a file that does not exist, instead of asserting._run_selectedstill callspre_process, so a tuner's own setup stays in place;GemmCommonTuner.pre_processskips its tuned-row mask for an empty untuned frame..github/scripts/split_tests.sh: runs the new test.Not changed:
--compare,--all, a bare--run_config, and an existing untuned file go through the same code as before.An earlier shape of this fix skipped
pre_processas a whole. That brokegemm_a8w8_mxfp8_bpreshuffle, whosepre_processsets_mxscale_tableand swaps its tuned file, andrun_configreads both; the test below covers that tuner.Overlap with other work: #8825 and #7979 edit the a4w4 tuner file, not this one. #8847 (ASM
full_n_tile) and the CK legality PR stacked on it are independent of this change.Performance (if applicable)
Not a performance change.
Testing
Tested on MI350X (gfx950), see the Self-Review.
Documentation
The comment at
_run_selectedand the one on_untuned_file_optionaldescribe the behavior; no user-facing option changes.Dependencies
Breaking Changes
None. Before, the case that now works died with an
AssertionError.PR Self-Review
Reviewed revision
20e058d
Behavior and intent
--run_config <tuned.csv>runs the tuned kernels of that file without the default untuned CSV. The tuner's ownpre_processstill runs, so its state (for example_mxscale_tableand the swapped tuned file of the mxfp8 tuner) is in place whenrun_configruns. Only the read of a missing untuned CSV is skipped, and only when neither--comparenor--allis given.Validation and unverified scope
Hardware: mi350x8, MI350X (gfx950, 256 CU), image
rocm/atom-dev:sglang-latestwith this branch overlaid (git archiveof the branch).csrc/ck_gemm_a4w4_blockscale/gemm_a4w4_blockscale_tune.py --run_config <2-row tuned csv> -i <missing file>: rc=0, both shapesOK(M=1, N=512, K=4096 ASM row 6.0 us; M=1, N=18432, K=16384 CK row 50.6 us). The same command with this file'smainversion: rc=1,AssertionError: Not exist untuned file.csrc/gemm_a8w8_mxfp8_bpreshuffle/gemm_a8w8_mxfp8_bpreshuffle_tune.py --run_config <2-row mxscale csv> --mxscale_table -i <missing file>: rc=0, both shapesOK(5.5 us, 5.4 us; thecheckAllclosewarnings come from the kernels, not from this change).mainversion ofbase_tuner.py, 4 of the 7 fail (the missing-file case, the flag, the existing-file read, and the mxfp8 tuner).main), clean.git merge-treeagainstorigin/main: clean.Not verified:
pre_processreads the untuned file throughget_untuned_gemm_listget the same empty frame; one that indexes columns beyond its keys of that empty frame would fail on a later line instead of on the assert, which is no worse than before.-itogether with--run_config <file>is now ignored silently (the file is not needed).PR-specific question
Should
--run_config <file>with a missing-ifile log that the untuned file is ignored? I left it silent because nothing reads it.Changed op tests
op_tests/tuning_tests/test_run_config_no_untuned.py(new, CPU only, registered insplit_tests.sh, runs as a script throughunittest.main()):GemmCommonTuner:--run_config <csv>without the untuned file runs,pre_processstill runs, and the shapes come from the tuned CSV;--compare,--alland a bare--run_configstill raiseNot exist untuned file; an existing untuned file is still read; the flag is off outside the--run_config <file>case;GemmA8W8MXFP8BpreshuffleTunerwith--mxscale_table:_mxscale_tableand the swapped tuned file are set whenrun_configruns.No other op test changes.