@@ -72,8 +72,9 @@ class GPTQModifier(Modifier, QuantizationMixin):
72
72
:param block_size: Used to determine number of columns to compress in one pass
73
73
:param dampening_frac: Amount of dampening to apply to H, as a fraction of the
74
74
diagonal norm
75
- :param actorder: order in which weight columns are quantized. For more information,
76
- on actorder options, see https://github.com/vllm-project/vllm/pull/8135
75
+ :param actorder: order in which weight columns are quantized. Defaults to "static"
76
+ activation ordering, which achieves best accuracy recovery with no runtime cost.
77
+ For more information, see https://github.com/vllm-project/vllm/pull/8135
77
78
:param offload_hessians: Set to True for decreased memory usage but increased
78
79
runtime.
79
80
@@ -106,7 +107,7 @@ class GPTQModifier(Modifier, QuantizationMixin):
106
107
sequential_targets : Union [str , List [str ], None ] = None
107
108
block_size : int = 128
108
109
dampening_frac : Optional [float ] = 0.01
109
- actorder : Optional [Union [ActivationOrdering , Sentinel ]] = None
110
+ actorder : Optional [Union [ActivationOrdering , Sentinel ]] = Sentinel ( "static" )
110
111
offload_hessians : bool = False
111
112
112
113
# private variables
@@ -134,18 +135,17 @@ def resolve_actorder(existing):
134
135
return ActivationOrdering .STATIC if existing is None else existing
135
136
136
137
# user-provided value always attempts to override
137
- if self .actorder is not None :
138
- if existing is None or self .actorder == existing :
139
- return self .actorder
140
- raise ValueError (
141
- "Cannot resolve activation ordering when both "
142
- "`GPTQModifier.actorder` and `QuantizationScheme.actorder` "
143
- "are provided and differ. Either set `GPTQModifier.actorder = "
144
- "None` or remove `actorder` from config groups."
145
- )
138
+ if existing is None or self .actorder == existing :
139
+ return self .actorder
146
140
147
- # setting `GPTQModifier.actorder = None` does nothing
148
- return existing
141
+ # if existing provided and conflicts
142
+ raise ValueError (
143
+ "Cannot resolve activation ordering when both "
144
+ "`GPTQModifier.actorder` and `QuantizationScheme.actorder` "
145
+ f"are provided and differ ({ self .actorder } , { existing } ). "
146
+ "Either unset `GPTQModifier.actorder` or "
147
+ "remove `actorder` from config groups."
148
+ )
149
149
150
150
for scheme in config .config_groups .values ():
151
151
assert isinstance (scheme , QuantizationScheme )
0 commit comments