Skip to content

quantize: row-chunks stream to avoid thread starvation - #27830

Merged
ngxson merged 1 commit into
masterfrom
xsn/quant_stream
Sep 1, 2026
Merged

ngxson merged 1 commit into
masterfrom
xsn/quant_stream

Conversation

@ngxson

@ngxson ngxson commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Overview

Alternative solution to #27770

Original idea taken from https://github.com/ngxson/quant-studio

"Stream" here means: tensor is split into row-slabs --> each slab is split into row-chunks --> chunks fed into thread

It's not real streaming like what quant-studio does (no overlap between I/O, dequant and quantization), but pretty close, without invasive changes to the existing code base

Work size limit from #27795 is still being respected

Requirements

@ngxson ngxson changed the title quantize: row-slab stream to avoid thread starvation quantize: row-chunks stream to avoid thread starvation Aug 27, 2026
@bartowski1182

Copy link
Copy Markdown
Contributor

Tested this out and got identical sha256sum and 20-70% speed up depending on the tensor type when using 64 threads! LGTM!

@ngxson
ngxson marked this pull request as ready for review August 31, 2026 23:26
@ngxson
ngxson requested a review from ggerganov as a code owner August 31, 2026 23:26
@ngxson
ngxson requested a review from ServeurpersoCom August 31, 2026 23:26
@ngxson
ngxson merged commit 1b89a43 into master Sep 1, 2026
24 of 26 checks passed
thecodacus pushed a commit to thecodacus/llama.cpp that referenced this pull request Sep 7, 2026
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
pl752 pushed a commit to pl752/llama.cpp that referenced this pull request Sep 15, 2026
zsogitbe pushed a commit to zsogitbe/llama.cpp that referenced this pull request Sep 17, 2026
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
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.

3 participants