Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
878dba9
add rabbit feedback
Fridah-nv Feb 6, 2026
9545e2f
minor
Fridah-nv Feb 13, 2026
7d56d64
tested perplexity
sugunav14 Feb 4, 2026
da41e3f
tested, revert later
sugunav14 Feb 9, 2026
f98154c
tested
sugunav14 Feb 10, 2026
1120b74
refactor
sugunav14 Feb 11, 2026
a16fcae
Track global_amax for weight FP4 MSE sweep; Refactor to NVFP4StaticQa…
realAsma Feb 6, 2026
2771a9d
address reviewers feedback, delegate scaling factor calculation to NV…
Fridah-nv Feb 6, 2026
e73dc52
tested perplexity
sugunav14 Feb 4, 2026
da757d4
tested exported checkpoints on 0211
sugunav14 Feb 12, 2026
2fdcd22
tested nano v3
sugunav14 Feb 13, 2026
49aa3d3
added activation MSE logging
sugunav14 Feb 16, 2026
1cf4b1a
super v3 run
sugunav14 Feb 17, 2026
f9b1487
added activationmse logging helper
sugunav14 Feb 17, 2026
b62f381
input amax sync added + tested gptq super sft checkpoint
sugunav14 Feb 19, 2026
636c88a
checkpoints generated on 0223
sugunav14 Feb 23, 2026
88c9908
tested perplexity
sugunav14 Feb 4, 2026
7ebd5ef
tested, revert later
sugunav14 Feb 9, 2026
26ac174
tested
sugunav14 Feb 10, 2026
868c7d6
initial cleanup
sugunav14 Feb 24, 2026
6f8870d
cleanup
sugunav14 Feb 24, 2026
91f3d2d
removed stray prints
sugunav14 Feb 24, 2026
cb46d7e
fix rebase issues
sugunav14 Mar 6, 2026
0bde840
minor
sugunav14 Mar 6, 2026
6c478a7
tested e2e on qwen
sugunav14 Mar 6, 2026
539d3bf
removed perplexity eval
sugunav14 Mar 6, 2026
f38a5cc
update
sugunav14 Mar 6, 2026
e4f7534
revert later
sugunav14 Mar 16, 2026
7177246
minor update
sugunav14 Mar 19, 2026
ccee659
update
sugunav14 Mar 18, 2026
3a5d235
gptq faster
sugunav14 Mar 18, 2026
d4c8a11
added metrics files, remove later
sugunav14 Mar 20, 2026
2129511
claude review
sugunav14 Mar 21, 2026
364cc54
remove stray files
sugunav14 Mar 21, 2026
2574475
refactor
sugunav14 Mar 22, 2026
0c6ec11
claude review + coderabbit review
sugunav14 Mar 23, 2026
e2eb25a
refactor
sugunav14 Mar 23, 2026
472ec34
stray changes removed
sugunav14 Mar 23, 2026
b1dcdfc
Address PR comments
sugunav14 Mar 25, 2026
a95bb77
fixed circular import issue
sugunav14 Mar 25, 2026
b64b7d3
refactor for MIT license
sugunav14 Apr 6, 2026
7de3cc0
PR review addressed
sugunav14 Apr 6, 2026
748b6bf
moved promote_nvfp4_static_quantizers to utils
sugunav14 Apr 6, 2026
06ec8b0
fixed unit tests
sugunav14 Apr 7, 2026
8feb42f
updated precision to bfloat16
sugunav14 Apr 7, 2026
446c8a7
Revert "updated precision to bfloat16"
sugunav14 Apr 7, 2026
1394a33
rebase fixes
sugunav14 Apr 7, 2026
f080214
minor rename
sugunav14 Apr 7, 2026
d64df14
fixed circular import
sugunav14 Apr 7, 2026
3e75415
fixed circular import
sugunav14 Apr 7, 2026
e734cee
minor fix
sugunav14 Apr 7, 2026
4073789
rebase fix
sugunav14 Apr 7, 2026
f43dc7a
Merge branch 'main' into svelury/gptq-official
sugunav14 Apr 7, 2026
5c7a024
Merge branch 'main' into svelury/gptq-official
sugunav14 Apr 8, 2026
bea8ec1
Merge branch 'main' into svelury/gptq-official
sugunav14 Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ repos:
# Instead, we should manually add the license header to those files *after* the original header.
exclude: >
(?x)^(
modelopt/torch/quantization/utils/calib_utils.py|
modelopt/onnx/quantization/operators.py|
modelopt/onnx/quantization/ort_patching.py|
modelopt/torch/_deploy/utils/onnx_utils.py|
Expand Down
26 changes: 8 additions & 18 deletions modelopt/torch/quantization/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,24 +1503,20 @@ class SVDQuantConfig(QuantizeAlgorithmConfig):
)


class GPTQLiteConfig(QuantizeAlgorithmConfig):
"""The config for GPTQ lite.
class GPTQCalibConfig(QuantizeAlgorithmConfig):
"""The config for GPTQ quantization.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use_sequential be part of the GPTQConfig?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think sequential calibration can be a general feature which can be used for other calibration algorithms in the future. @realAsma what do you think?


GPTQ lite is a variant of GPTQ that does not exactly follow the official GPTQ implementation.

GPTQ lite does not perform sequential quantization of layers. This means that the updated
activations are not used to process the next layer.
GPTQ minimizes the layer-wise quantization error by using second-order (Hessian) information
to perform blockwise weight updates that compensate for rounding loss. Layers are quantized
sequentially so that each layer's Hessian is computed from activations that already reflect
the quantization of preceding layers.

The default values are taken from the official GPTQ implementation:
https://github.com/IST-DASLab/FP-Quant/blob/d2e3092f968262c4de5fb050e1aef568a280dadd/src/quantization/gptq.py#L35

Note: This feature is currently experimental and may not translate to improved accuracy as expected.


"""

method: Literal["gptq_lite"] = ModeloptField("gptq_lite")
percdamp: float | None = ModeloptField(
method: Literal["gptq"] = ModeloptField("gptq")
perc_damp: float | None = ModeloptField(
default=0.01,
gt=0.0,
le=1.0,
Expand All @@ -1533,12 +1529,6 @@ class GPTQLiteConfig(QuantizeAlgorithmConfig):
description="""The block size for GPTQ weight update, which must be a multiple of the
group_size used in the quantization.""",
)
hessian_state_path: str | None = ModeloptField(
default=None,
title="Path to the Hessian state file.",
description="""The path to the Hessian state file. If hessian path exists, we load from
hessian file instead of recomputing them.""",
)


QuantizeQuantCfgType = list[QuantizerCfgEntry]
Expand Down
14 changes: 7 additions & 7 deletions modelopt/torch/quantization/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
AWQFullCalibConfig,
AWQLiteCalibConfig,
CompressConfig,
GPTQLiteConfig,
GPTQCalibConfig,
LocalHessianCalibConfig,
MaxCalibConfig,
MseCalibConfig,
Expand All @@ -59,7 +59,7 @@
)
from .model_calib import (
awq,
gptq_lite,
gptq,
local_hessian_calibrate,
max_calibrate,
mse_calibrate,
Expand Down Expand Up @@ -240,8 +240,8 @@ def wrapped_calib_func(
if sequential:
if forward_loop is None:
raise ValueError("forward_loop is required for calibration but got None.")
assert method in ["max"], (
f"Sequential calibration currently only supports max calibration, got {method}"
assert method in ["max", "gptq"], (
f"Sequential calibration currently only supports max and gptq calibration, got {method}"
)
# Wrap with sequential processing
sequential_calibrate(
Expand Down Expand Up @@ -493,12 +493,12 @@ def restore(self) -> RestoreEntrypoint:


@CalibrateModeRegistry.register_mode
class GPTQLiteModeDescriptor(BaseCalibrateModeDescriptor):
class GPTQModeDescriptor(BaseCalibrateModeDescriptor):
"""Mode for GPTQ calibration algorithm."""

@property
def config_class(self) -> type[QuantizeAlgorithmConfig]:
"""Specifies the config class for the mode."""
return GPTQLiteConfig
return GPTQCalibConfig

_calib_func = gptq_lite
_calib_func = gptq
Comment thread
sugunav14 marked this conversation as resolved.
Loading
Loading