Fix 4bit quantization with blocksize = 4096#1160
Merged
Titus-von-Koeller merged 2 commits intobitsandbytes-foundation:mainfrom Apr 2, 2024
Merged
Fix 4bit quantization with blocksize = 4096#1160Titus-von-Koeller merged 2 commits intobitsandbytes-foundation:mainfrom
Titus-von-Koeller merged 2 commits intobitsandbytes-foundation:mainfrom
Conversation
matthewdouglas
commented
Mar 29, 2024
|
|
||
| if(blocksize == 4096) | ||
| kQuantizeBlockwise<T, 4096, 4, STOCHASTIC, 0><<<num_blocks, 1024>>>(code, A, absmax, out, rand, rand_offset, n); | ||
| kQuantizeBlockwise<T, 4096, 4, STOCHASTIC, DATA_TYPE><<<num_blocks, 1024>>>(code, A, absmax, out, rand, rand_offset, n); |
Member
Author
There was a problem hiding this comment.
Somewhat subtle, but here's where the issue was.
matthewdouglas
commented
Mar 29, 2024
Comment on lines
-1931
to
+1933
| def test_fp4_quant(dtype): | ||
| @pytest.mark.parametrize("quant_type", ["fp4", "nf4"]) | ||
| @pytest.mark.parametrize("blocksize", [64, 128, 256, 512, 1024, 2048, 4096]) | ||
| def test_4bit_quant(dtype, quant_type, blocksize): |
Member
Author
There was a problem hiding this comment.
Previously only fp4 and blocksize=64 was tested here. Expanded these tests, but note the degradation with the larger block size.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
abhilash1910
approved these changes
Mar 30, 2024
Contributor
abhilash1910
left a comment
There was a problem hiding this comment.
This is good find, lgtm.
Collaborator
|
Cool! I'm checking with Tim for a review. Will get back to you. |
Collaborator
|
This looks good, thanks or catching it! |
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.
Fixes #1157. Not a particularly practical use case, but I would consider it a bug nonetheless.