-
-
Notifications
You must be signed in to change notification settings - Fork 793
Fix 4bit quantization with blocksize = 4096 #1160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 4bit quantization with blocksize = 4096 #1160
Conversation
|
|
||
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat subtle, but here's where the issue was.
| 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good find, lgtm.
|
Cool! I'm checking with Tim for a review. Will get back to you. |
|
This looks good, thanks or catching it! |
Fixes #1157. Not a particularly practical use case, but I would consider it a bug nonetheless.