Skip to content

Feat (ex/llm): custom quantizer plugin allows to modify quant model#1508

Open
Giuseppe5 wants to merge 2 commits into
Xilinx:devfrom
Giuseppe5:custom_quant_model
Open

Feat (ex/llm): custom quantizer plugin allows to modify quant model#1508
Giuseppe5 wants to merge 2 commits into
Xilinx:devfrom
Giuseppe5:custom_quant_model

Conversation

@Giuseppe5
Copy link
Copy Markdown
Collaborator

Reason for this PR

In certain scenarios it is useful to have fine-grained control over what happens on your model once quantization has been applied.

This could be useful to share quantizers in scenarios like exporting to vLLM, where for certain quantization configuration it is mondatory to have Q/K/V quantizers shared, as well as Gate Proj/Up Proj.

Changes Made in this PR

Extend the current mechanism to define custom quantizer so that it also allows to define a custom function to modify the quant model.

If inheriting from BaseQuantizer, it is possible to only override one of the two methods while preserving the default behaviour (no-op) for the other one.

Testing Summary

Added tests

@Giuseppe5 Giuseppe5 requested a review from pablomlago April 10, 2026 15:11
@Giuseppe5 Giuseppe5 self-assigned this Apr 10, 2026
@Giuseppe5 Giuseppe5 added next release PRs which should be merged for the next release labels Apr 20, 2026
Comment thread tests/brevitas_examples/llm_example_quantizer.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next release PRs which should be merged for the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants