Skip to content

Add quantization tests for HF backend - #19

Merged
antonpibm merged 2 commits into
mainfrom
issue-16
May 12, 2026
Merged

antonpibm merged 2 commits into
mainfrom
issue-16

Conversation

@ItzikVa

@ItzikVa ItzikVa commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Tests verify that BnB (NF4, FP4) and Quanto (INT4, FP8) quantization:

  1. Preserves adapter activation (output differs with/without control token)
  2. Keeps LoRA/aLoRA weights in full precision (bfloat16)
  3. Actually quantizes base model linear layers

Relates to #16

Tests verify that BnB (NF4, FP4) and Quanto (INT4, FP8) quantization:
1. Preserves adapter activation (output differs with/without control token)
2. Keeps LoRA/aLoRA weights in full precision (bfloat16)
3. Actually quantizes base model linear layers

Relates to #16
Comment thread tests/hf/test_quantization.py Resolved
Comment thread tests/hf/test_quantization.py Resolved
Comment thread tests/hf/test_quantization.py Resolved
Comment thread tests/hf/test_quantization.py Resolved
- Load ibm-granite/granite-switch-4.1-3b-preview directly from HF
- Use chat template (adapter_name=...) for adapter activation
- Test BnB NF4/FP4 and Quanto INT4/FP8 quantization methods
- Verify adapter activation, LoRA precision, and base layer quantization
- Add bitsandbytes and optimum-quanto to [test] extra

Relates to #16
@antonpibm
antonpibm merged commit d41a4cc into main May 12, 2026
@ItzikVa
ItzikVa deleted the issue-16 branch May 19, 2026 08:11
vedem1192 pushed a commit to vedem1192/granite-switch that referenced this pull request Nov 20, 2026
* Add quantization tests for HF backend

Tests verify that BnB (NF4, FP4) and Quanto (INT4, FP8) quantization:
1. Preserves adapter activation (output differs with/without control token)
2. Keeps LoRA/aLoRA weights in full precision (bfloat16)
3. Actually quantizes base model linear layers

Relates to generative-computing#16

* Add quantization tests for HF backend

- Load ibm-granite/granite-switch-4.1-3b-preview directly from HF
- Use chat template (adapter_name=...) for adapter activation
- Test BnB NF4/FP4 and Quanto INT4/FP8 quantization methods
- Verify adapter activation, LoRA precision, and base layer quantization
- Add bitsandbytes and optimum-quanto to [test] extra

Relates to generative-computing#16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants