|
24 | 24 | QuantizationType,
|
25 | 25 | )
|
26 | 26 | from pydantic import BaseModel, ConfigDict, model_validator
|
| 27 | +from loguru import logger |
27 | 28 |
|
28 | 29 |
|
29 | 30 | __all__ = [
|
@@ -60,15 +61,19 @@ def validate_model_after(model: "QuantizationScheme") -> "QuantizationScheme":
|
60 | 61 | format = model.format
|
61 | 62 |
|
62 | 63 | if inputs is not None:
|
63 |
| - if inputs.strategy not in ( |
64 |
| - QuantizationStrategy.TOKEN, |
65 |
| - QuantizationStrategy.TENSOR, |
66 |
| - QuantizationStrategy.GROUP, |
67 |
| - QuantizationStrategy.TENSOR_GROUP, |
68 |
| - ): |
69 |
| - raise NotImplementedError( |
70 |
| - f"Using {inputs.strategy} strategy is not supported for " |
71 |
| - "activation quantization" |
| 64 | + if inputs.strategy == QuantizationStrategy.CHANNEL: |
| 65 | + raise ValueError( |
| 66 | + "Channel-wise activation quantization is equivalent to " |
| 67 | + "tensor/token-wise activation quantization, please use one of " |
| 68 | + "those. If you mean to quantize each activation value " |
| 69 | + "individually, please use group quantization with `group_size = 1`" |
| 70 | + ) |
| 71 | + |
| 72 | + if inputs.strategy == QuantizationStrategy.BLOCK: |
| 73 | + raise ValueError( |
| 74 | + "Block-wise activation quantization is not supported. If you mean " |
| 75 | + "to quantize each activation value individually, please use group " |
| 76 | + "quantization with `group_size = 1`" |
72 | 77 | )
|
73 | 78 |
|
74 | 79 | if inputs.actorder is not None:
|
|
0 commit comments