FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix matmul_4bit gemv path for mismatched quant_state layout by datavorous · Pull Request #1906 · bitsandbytes-foundation/bitsandbytes · GitHub

Fix matmul_4bit gemv path for mismatched quant_state layout - #1906

Closed
datavorous wants to merge 2 commits into
bitsandbytes-foundation:mainfrom
datavorous:fix/matmul4bit-gemv-shape-guard
Closed

Fix matmul_4bit gemv path for mismatched quant_state layout#1906
datavorous wants to merge 2 commits into
bitsandbytes-foundation:mainfrom
datavorous:fix/matmul4bit-gemv-shape-guard

Conversation

Copy link
Copy Markdown

Fixes #1862

Problem: gemv fast path in matmul_4bit assumes quant_state.shape follows (out_features, in_features), and can silently produce wrong output shape/values for transposed layout metadata.

Fix: add a minimal shape guard in matmul_4bit vector fast path; on mismatch, fall back to MatMul4Bit.apply.

Scope: no kernel changes, no API changes, minimal 2-line guard.

Copy link
Copy Markdown
Member

Thanks for the fix. This is superseded by #1949 which handles weight orientation more comprehensively - matmul_4bit now normalizes packed weights to a canonical shape internally and explicitly detects the transposed (in_features, out_features) layout, emitting a DeprecationWarning and falling back correctly. Since we are deprecating support for that layout, silently guarding it would go the wrong direction. Closing in favor of #1949.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gemv_4bit silently produces wrong results when weight is quantized in (in_features, out_features) layout

2 participants


Back | FazBrowse Home | New Git URL