Repository navigation
auto-decode native FP8/NVFP4 sources for W4A16 - #3084
Conversation
|
Reviewed head 1. [P1] Full NVFP4 conversion reaches dense layer materialization before the decoderThe new automatic source setup enables checkpoint-backed loading (loader.py:244–257), but the normal quantization loop still calls A ModelOpt NVFP4 weight has shape Reproduced on CPU: a meta layer containing Fix: make layer-entry materialization decoder-aware: materialize the required ordinary tensors while leaving packed floatx linears for their per-module preparation, or decode them explicitly through the appropriate path. Add a one-layer test that enters through the regular quantization lifecycle. The reported NVFP4 single-module test bypasses this failure point. 2. [P2] Automatically injected BF16 decoder can conflict with FP16 model activationsThe loader resolves and applies the model dtype before configuring floatx sources (loader.py:907–934), then unconditionally injects The decoded fallback is an ordinary Linear with BF16 parameters, without an input cast. FP16 hidden states therefore fail during fallback calibration; the same conflict can occur after a native FP8 module is replaced by its BF16 quantization source for replay. Reproduced on CPU: the actual source-builder and forward-builder methods, given an FP16 shell and FP8 checkpoint weights, produce a BF16 Linear that raises: The matching BF16 input succeeds. Fix: reconcile the shell/model activation dtype with the decoder before model construction, or preserve a compatible execution dtype with explicit conversions at the boundary. Add coverage for FP16 source configs and explicit FP16 loading, including the decoded fallback and post-quantization replay. 3. [P2] “Native forward used” and deferred-decode telemetry do not establish native executionThe new However, FP8 has a related reporting gap: Fix: distinguish wrapper/storage selection from the kernel actually executed, and emit execution/fallback events from the forward path. Keep the deferred quantization-source allocation claim separate from temporary forward dequantization. If actual FP4 GEMM is intended, configure and validate that dispatch explicitly, including its activation-quantization semantics. Validation
|
Summary
Validation