Repository navigation
perf(cake_rmsnorm): blocked FP32 dw sums for the large-T GB300 backward windows - #8899
Conversation
…indows up to T 131072 More large-T windows of the deterministic=False backward on sm_103a now run a kblock single kernel up to T 131072: each row thread adds the dw products of 8-row blocks in FP32, keeps the block sums as FP32 TwoSum pairs and adds them to the FP64 sums once; at H = 1536 and 2048 a producer warp streams the rows. These windows (above T 46592 at H = 1536, above T 37888 at H = 1536 with FP32 weight, above T 61952 at H = 2048 and above T 49152 at H = 6144) ran a twosum single kernel. Above T 131072 the twosum single kernels stay. The deterministic package's main kernel and dw reduce, rendered into this package, run at H = 2048 from T 61952 to 68160, at H = 1536 from T 53184 to 76352 (from T 40448 with FP32 weight) and at H = 6144 from T 49152 to 57344 (to T 83392 with FP32 weight), where they are faster than the kblock single. In the GB300 timing record the backward of the changed windows runs 1.028 to 1.287 times as fast as the kernels they replace; their worst dw element is at most 0.997 of the per-element budget at the sampled T up to 131072.
|
@flashinfer-bot run tests/norm/test_cake_rmsnorm_det_train_aliases.py tests/norm/test_cake_rmsnorm_train.py tests/norm/test_cake_rmsnorm_train_all_sm.py tests/norm/test_cake_rmsnorm_train_api.py tests/norm/test_cake_rmsnorm_train_ckpt.py tests/norm/test_cake_rmsnorm_train_dist.py tests/norm/test_cake_rmsnorm_train_legacy.py tests/norm/test_cake_rmsnorm_train_pairs.py tests/norm/test_cake_rmsnorm_train_stall.py tests/norm/test_cake_rmsnorm_train_vendored.py tests/norm/test_cake_rmsnorm_train_windows.py |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Related issue: #8066
flashinfer.cake_rmsnorm_trainis RMSNorm for training. The forward returns y (BF16) and rstd (FP32), and the backward returns dx (BF16) and dw (FP32). The two modes,deterministic=Trueanddeterministic=False, share the forward and differ only in the backward. Both modes support:This PR follows #8577, #8626, #8655, #8704, #8810, #8827, #8848 and #8849. It changes only the
deterministic=Falsebackward on sm_103a (GB300). The change covers H1536, H2048 and H6144, with BF16 or FP32 weight, plain rows, in the windows listed below. FlashInfer main runs a TwoSum single in all of these windows, the same program that stays above T 131072. With this PR, the backward in each window runs one of two program kinds:deterministic=TrueThe windows are:
In every ratio below, a value under 1 means the baseline is faster than new. The ranges cover all rows of the table, except that the SOTA ranges leave out the rows marked !.
Measurement
deterministic=True), which this PR does not change. new = this PR's non-deterministic Cake (deterministic=False).deterministic=Falsebackward runs the TwoSum single in these windows.Key:
deterministic=True. On det rows, new us is det's measurement from the same run, so det/new is 1.0000 by construction.GB300 (sm_103a): new non-deterministic Cake vs deterministic Cake, the strongest non-Cake SOTA and main, every measured shape
Cake ships both modes of
cake_rmsnorm_train, with all the forms above, on sm_100a, sm_103a and sm_107a. This PR does not change the forward,deterministic=True, the sm_100a or sm_107a routes, or any GB300 window other than the ones above.Summary by CodeRabbit