transformers
40e6b600 - Let the swap hand every module the same storage

Commit
39 days ago
Let the swap hand every module the same storage `FineGrainedGroupedLinear` took `block_size`/`activation_scheme`/`scale_fmt` but not `weight_format`/`activation_format`, so it silently built its parent's fp8 default -- right for DeepSeek-V4's block-FP8 grouped linears today, wrong the moment a group says otherwise. It takes the pair now, which is also what let the swap drop the comprehension that picked three keys back out of `storage_for`: all three branches pass the same mapping. The experts branch was 27 of the dispatch's 40 lines, so the dispatch itself was the hard part to find. `_quantized_experts` holds the flags-twice-over dance and the post-norm carry-over, and the three-way choice now reads at a glance. `FineGrainedQuantize`'s docstring still said shapes that don't tile pass through, which stopped being true when the block quantizer learned to pad. It names `_weight_holder` as what actually decides, since rank does not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Parents
Loading