Commit 712b9d1
Take the linear weight amax as an inf-norm
The same reduction as the grouped weight amax, on the dense path: the
fp32 upcast materialized the whole weight to read a single scalar from
it. One inf-norm over the bf16 weight gives a bitwise identical amax.
Per weight at DeepSeek-V3 671B MLP shapes (7168x18432), the fp32 copy,
abs and fp32 reduce cost 548.7 us together; the bf16 inf-norm costs
86.2 us. Over a 3-linear MLP block at 8192 tokens that is 18.6% of the
CuteDSL block's device time (8111 -> 6603 us) and 16.4% of Triton's
(9313 -> 7783 us), and the saving does not shrink with batch size.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 1eb1b4f commit 712b9d1
1 file changed
Lines changed: 4 additions & 1 deletion
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| |||
0 commit comments