Integrated NF4 inference tests to text-generation#2058
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for NF4 quantization via BitsAndBytes (bnb) to the text-generation examples and integrates end-to-end inference tests for Llama-3.1 models quantized with bnb.
- Introduce
--quantize_with_bnbflag in the CLI and handle it insetup_model - Extend
_test_text_generationand addtest_text_generation_bnbin the test suite - Update baseline fixtures with expected outputs and throughputs for bnb tests
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_text_generation_example.py | Added quantize_with_bnb parameter, new run_model_with_bnb test group, and test_text_generation_bnb case |
| tests/baselines/fixture/tests/test_text_generation_example.json | Added baseline entry for test_text_generation_bnb on gaudi2 |
| examples/text-generation/utils.py | Added elif args.quantize_with_bnb branch with BitsAndBytesConfig |
| examples/text-generation/run_generation.py | Added --quantize_with_bnb CLI argument |
Comments suppressed due to low confidence (1)
examples/text-generation/utils.py:302
- The new
quantize_with_bnbbranch insetup_modelisn't covered by any unit tests. Consider adding a small test or mockingBitsAndBytesConfigto verify that the correct config is passed when this flag is set.
elif args.quantize_with_bnb:
0763eb0 to
325a54a
Compare
vivekgoe
approved these changes
Jun 16, 2025
astachowiczhabana
pushed a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 3, 2025
Integrated NF4 tests to text-generation
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
that referenced
this pull request
Jul 8, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 10, 2025
astachowiczhabana
added a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Jul 11, 2025
astachowiczhabana
added a commit
that referenced
this pull request
Aug 22, 2025
astachowiczhabana
pushed a commit
that referenced
this pull request
Aug 25, 2025
astachowiczhabana
pushed a commit
that referenced
this pull request
Sep 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates inference tests (NF4 quantized Llama-3.1-8B and Llama-3.1-70B using bitsandbytes) to test-text generation