Skip to content

Add BF16 support for int8_vectorwise_quant / LLM.int8 activation quant#1985

Open
kru2710shna wants to merge 1 commit into
bitsandbytes-foundation:mainfrom
kru2710shna:feature/int8-bf16-vectorwise-quant
Open

Add BF16 support for int8_vectorwise_quant / LLM.int8 activation quant#1985
kru2710shna wants to merge 1 commit into
bitsandbytes-foundation:mainfrom
kru2710shna:feature/int8-bf16-vectorwise-quant

Conversation

@kru2710shna

Copy link
Copy Markdown

Templates int8VectorQuant on T and adds bf16 kernel instantiations plus a cint8_vector_quant_bf16 C ABI entry point, mirroring the existing gemm_4bit_inference_naive fp16/bf16/fp32 pattern. The blockwise absmax reduction now accumulates in float rather than T: required for bf16 to compile cleanly and slightly improves fp16 accuracy (rowStats was already float, so downstream is unaffected). Removes the forced A.to(torch.float16) casts in MatMul8bitLt so bf16 activations quantize natively.

Closes #1868.

Templates int8VectorQuant on T and adds bf16 kernel instantiations plus a
cint8_vector_quant_bf16 C ABI entry point, mirroring the existing
gemm_4bit_inference_naive fp16/bf16/fp32 pattern. The blockwise absmax
reduction now accumulates in float rather than T: required for bf16 to
compile cleanly and slightly improves fp16 accuracy (rowStats was already
float, so downstream is unaffected). Removes the forced A.to(torch.float16)
casts in MatMul8bitLt so bf16 activations quantize natively.

Closes bitsandbytes-foundation#1868.
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.

Question: intentional FP16-only path for int8_vectorwise_quant / LLM.int8 activation quant? (BF16 support + removing casts)

1 participant