(parser: argparse.ArgumentParser)
| 20 | |
| 21 | |
| 22 | def add_quantization_args(parser: argparse.ArgumentParser) -> None: |
| 23 | parser.add_argument( |
| 24 | "--qlinear", |
| 25 | type=str, |
| 26 | choices=["4w", "8w", "nvfp4"], |
| 27 | default=None, |
| 28 | help="Quantization config for linear layers", |
| 29 | ) |
| 30 | parser.add_argument( |
| 31 | "--qembedding", |
| 32 | type=str, |
| 33 | choices=["4w", "8w", "nvfp4"], |
| 34 | default=None, |
| 35 | help="Quantization config for embedding layers", |
| 36 | ) |
| 37 | parser.add_argument( |
| 38 | "--qlinear-group-size", |
| 39 | type=int, |
| 40 | choices=[32, 64, 128], |
| 41 | default=None, |
| 42 | help="Group size for linear layer quantization (default: 32)", |
| 43 | ) |
| 44 | parser.add_argument( |
| 45 | "--qembedding-group-size", |
| 46 | type=int, |
| 47 | choices=[32, 64, 128], |
| 48 | default=None, |
| 49 | help="Group size for embedding layer quantization (default: 128)", |
| 50 | ) |
| 51 | parser.add_argument( |
| 52 | "--no-tie-word-embeddings", |
| 53 | action="store_true", |
| 54 | default=False, |
| 55 | help="Disable tying lm_head weights to embedding after quantization, " |
| 56 | "even if the model config has tie_word_embeddings=True", |
| 57 | ) |
no outgoing calls
no test coverage detected