Commit c42de7f
committed
[Quantization] Pin NVFP4 calibrator collect tests to reference path
After folding the Triton fast path into NVFP4MSECalibrator.collect(),
two tests in tests/gpu/torch/quantization/test_nvfp4_static_quantizer_cuda.py
broke because they inspect path-specific state:
- test_collect_and_compute_amax asserts ``cal._losses_sum is not None``
with ``len == 126``. Only the reference 126-step sweep populates that
list; the Triton fast path produces ``_best_amax_fast`` directly and
leaves ``_losses_sum = None``.
- test_multiple_collections asserts that two ``collect()`` calls
accumulate. The Triton fast path is one-shot by design and refuses
a second collect until ``reset()``, so multi-collect is fundamentally
reference-path semantics.
Fix: take the ``monkeypatch`` fixture in both tests and force
``MODELOPT_NVFP4_TRITON_SWEEP=0`` so they exercise the reference
accumulator. Triton-path coverage stays in
test_nvfp4_fp8_sweep_kernel.py (parity, dispatch predicate, end-to-end
mtq.quantize). The other tests in the same class (initialization,
candidate generation, per-block independence) are path-agnostic and
unchanged.
Signed-off-by: Chenjie Luo <chenjiel@nvidia.com>1 parent 2bc8a54 commit c42de7f
1 file changed
Lines changed: 17 additions & 4 deletions
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
197 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
198 | 211 | | |
199 | 212 | | |
200 | 213 | | |
| |||
0 commit comments