@@ -21,7 +21,7 @@ class QuIPModifier(Modifier):
21
21
[QuIP: 2-Bit Quantization of Large Language Models With Guarantees](https://arxiv.org/abs/2307.13304) # noqa: E501
22
22
23
23
Transforms (rotations) are extra layers added to a model which reduce the accuracy
24
- loss induced by quantization. This is achived through "rotating" weights and
24
+ loss induced by quantization. This is achieved through "rotating" weights and
25
25
activations into a space with a smaller dynamic range of values, thus decreasing
26
26
the range of scales required for quantization.
27
27
@@ -31,7 +31,7 @@ class QuIPModifier(Modifier):
31
31
:param transform_type: The type of transform to apply to the model.
32
32
`"hadamard"` has the least performance cost but only supports sizes which are
33
33
powers of power of two.
34
- `"random-matrix "` has more performance cost, but supports a much larger set of
34
+ `"random-hadamard "` has more performance cost, but supports a much larger set of
35
35
sizes.
36
36
`"random-matrix"` has the greatest performance cost, but supports any size
37
37
:param randomize: If true, create distinct transforms for each application
@@ -53,7 +53,9 @@ class QuIPModifier(Modifier):
53
53
54
54
@field_validator ("randomize" , "learnable" , mode = "before" )
55
55
def validate_not_implemented (cls , value , info : ValidationInfo ):
56
- raise NotImplementedError (f"{ info .field_name } is not supported right now" )
56
+ if value :
57
+ raise NotImplementedError (f"{ info .field_name } is not supported right now" )
58
+ return value
57
59
58
60
def on_initialize (self , state : State , ** kwargs ) -> bool :
59
61
if self .transform_config is not None :
@@ -102,6 +104,7 @@ def _create_config(self) -> TransformConfig:
102
104
TransformArgs (
103
105
targets = ["Linear" ],
104
106
location = "weight_input" ,
107
+ # location="input",
105
108
inverse = True ,
106
109
ignore = self .ignore ,
107
110
),
@@ -115,6 +118,7 @@ def _create_config(self) -> TransformConfig:
115
118
TransformArgs (
116
119
targets = ["Linear" ],
117
120
location = "weight_output" ,
121
+ # location="output",
118
122
ignore = self .ignore ,
119
123
),
120
124
TransformArgs (
0 commit comments