MCPcopy Create free account
hub / github.com/pytorch/executorch / add_quantization_args

Function add_quantization_args

backends/mlx/llm/quantization.py:22–57  ·  view source on GitHub ↗
(parser: argparse.ArgumentParser)

Source from the content-addressed store, hash-verified

20
21
22def 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 )

Callers 3

mainFunction · 0.90
add_export_argsFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected