Repository navigation
llama : reuse the tensor staging buffer and skip the direct-io bounce buffer - #31321
Merged
Merged
Conversation
am17an
added a commit
that referenced
this pull request
Oct 28, 2026
ServeurpersoCom
approved these changes
Oct 28, 2026
ServeurpersoCom
left a comment
Contributor
There was a problem hiding this comment.
Gave it a spin on my RTX PRO 6000 with gemma-4-12b and --no-mmap: with --check-tensors on CUDA the load goes from 6.5s to 2.9s, CPU repack is about twice as fast too, and RPC on localhost is a bit quicker. Same outputs as master, LGTM!
ggerganov
approved these changes
Oct 29, 2026
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.
Overview
Without mmap, tensors in non-host buffers that can't use the async upload path (RPC,
-sm row/-sm tensorsplit buffers, CPU repack buffers,--check-tensors) are loaded through a staging buffer. Today that buffer is allocated per tensor, so its pages are faulted again for every tensor, and with-lm dioread_rawalso bounces each tensor throughread_aligned_chunk.This PR:
Split out from #29413.
Additional information
Requirements