Skip to content

Commit 9b562f5

Browse files
committed
revert fp8 sweep stride
Signed-off-by: Jennifer Chen <jennifchen@nvidia.com>
1 parent 2a2ffc3 commit 9b562f5

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

  • modelopt/torch/quantization/calib

modelopt/torch/quantization/calib/mse.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,10 @@ def __init__(
181181
axis: int | tuple | list | None = None,
182182
quant_func: Callable | None = None,
183183
error_func: Callable | None = None,
184-
fp8_scale_sweep_stride: int = 1,
185184
):
186185
"""Initialize NVFP4 MSE calibrator with per-block and global amax."""
187186
super().__init__(amax=amax, axis=axis, quant_func=quant_func, error_func=error_func)
188187
self._global_amax = global_amax
189-
self._fp8_scale_sweep_stride = max(1, fp8_scale_sweep_stride or 1)
190188

191189
def _compute_candidate_amax(self, candidates: torch.Tensor) -> torch.Tensor:
192190
if candidates.ndim != 0: # Called during final compute amax
@@ -199,9 +197,4 @@ def _generate_candidates(self, device: torch.device) -> torch.Tensor:
199197
fp8_values = uint8_values.view(torch.float8_e4m3fn).float()
200198
valid_mask = torch.isfinite(fp8_values) & (fp8_values > 0)
201199
fp8_values = fp8_values[valid_mask]
202-
if self._fp8_scale_sweep_stride > 1:
203-
candidates = fp8_values[:: self._fp8_scale_sweep_stride]
204-
if candidates[-1] != fp8_values[-1]:
205-
candidates = torch.cat([candidates, fp8_values[-1:]])
206-
fp8_values = candidates
207200
return fp8_values / 448.0

0 commit comments

Comments
 (0)