--load-mode none/mlock silently ignored for large lazy tensors (undocumented --lazy-mode override) - #169
Open
dan64 wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KCBWCZYqbDCuEUxH5LSCJm
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.
Not a code PR — this repo has no Issues tab, so per convention I'm using a PR to report a bug (see
BUG-lazy-mode-overrides-load-mode.mdin this branch for the full writeup).TL;DR
--lazy-mode(defaultauto) forces mmap + on-demand disk reads for largearchitecture-marked tensors (e.g.
per_layer_token_embd.weightin PLE-style archs likeqwen4exp), regardless of--load-mode.--load-mode none— documented as "nospecial loading mode" — does not actually stop this. On a model whose file lives on
rotating storage, this causes ongoing disk I/O throughout generation (not just at load),
and a severe throughput regression (~22 t/s -> ~5 t/s observed, same hardware/model,
only difference being this lazy path engaging). Not mentioned in the release notes
either.
Reproduction is against the release asset (immutable), not the
b10715-mix-86bd2d3gittag — that tag currently resolves to a commit that predates this code, since the
mixbranch appears to be rebased/re-tagged over time:
https://github.com/unslothai/llama.cpp/releases/download/b10715-mix-86bd2d3/llama.cpp-source-commit-92cedc8679d145902ead3f006258e8672eac11e6.tar.gz
Full details, exact repro steps, and an illustrative fix in
BUG-lazy-mode-overrides-load-mode.md.