Repository navigation
fix: wrong absmax indexing in AVX512 dequantizeBlockwise4bitCpu - #2096
Open
NanoCode012 wants to merge 1 commit into
Open
NanoCode012 wants to merge 1 commit into
NanoCode012 wants to merge 1 commit into
Conversation
1 task done
This branch has not been deployed
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.
Was adding a mini test in Axolotl for merge qlora and found an edge case on GitHub CI that didn't appear on local Mac testing. Claude helped solve this, but repro is ran and verified on a L40s with AVX512.
Bug:
On an x86 CPU with AVX512 (like Github CPU CI), there's a guard missing in dequantizeBlockwise4bitCpu unlike in the ARM path (
n % blocksize == 0).This PR adds the same condition to the AVX512 branch, so those shapes fall through to the scalar path, which indexes
absmaxby flat offset.Repro:
On an AVX512 CPU with no visible GPU:
The quantized bytes are identical for the 2D and flattened inputs, so both dequantizations should match.
AMD EPYC 9554 with bnb 0.50.2 and torch 2.13.0:
(64, 16)(64, 80)(64, 64)The same results hold with
compress_statistics=True.