Skip to content

[staging] unslothai/unsloth#18379: fit the context again on a same-model GGUF reload under any preset - #262

Closed
Lyxot wants to merge 8 commits into
staging/18379-basefrom
staging/18379-head
Closed

Lyxot wants to merge 8 commits into
staging/18379-basefrom
staging/18379-head

Conversation

@Lyxot

@Lyxot Lyxot commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Staging CI for unslothai#18379 at head 6fa9600, with base set to its merge-base with main (021b878). Not for merging.

oobabooga and others added 8 commits November 18, 2026 12:30
…reset

On Auto context, resolveLoadMaxSeqLength sent 0 for a GGUF load only when the
active preset was the untouched built-in Default. Under a saved preset, or after
any Run settings edit (which marks Default as modified), a reload of the same
model and variant resent the resident fitted window with
max_seq_length_auto_derived. The backend reads a positive max_seq_length as an
explicit context and only re-fits it when MTP is forced, so switching the KV
cache type, vision or GPUs kept the old window: a change that frees memory
never grew it, and one that needs more memory kept the window and gave up
something else (the vision projector moved to the CPU).

An Auto GGUF load now always sends 0, so a reload is sized like a fresh load
whatever preset is active. A typed Context Length is still sent as typed, and
Manual memory with fixed layers still pins the resident context before the
resolver runs. The replay flag no longer has a sender and is removed from the
frontend; the backend keeps accepting it. The memory estimate follows the same
rule.
… pin

The config page decided whether a same-model reload keeps the resident context
from the raw per-model gpuMemoryMode, but an unset per-model mode means the
standing preference, which is what performLoad resolves. With 20 fixed layers,
no per-model mode, Auto context and a standing Manual preference, Reload sends
the resident 32768 while the estimate priced 0. Both fixed-layer checks on the
page now go through fixedLayerContextPin, which resolves the mode the same way.
test_fixed_layer_gguf_pins_displayed_context and test_fixed_layer_pin_recomputed_after_committing_gpu_layers matched the inline conditions that moved into fixedLayerContextPin. They now check that the estimate pin reads the rendered loadableConfig and the Apply pin reads the committed effectiveConfig, both with the standing GPU memory preference.
…ory estimate context

Every Auto GGUF load now sends 0, and the resident context is only known for a GGUF, so the estimate's resident fallback and its skip flag can no longer change the result. resolveEstimateContext takes the pin alone.
…and the config page

performLoad kept its own copy of the Manual fixed-layer rule that keeps the resident context on a same-model Auto reload, so a change there was only caught by a source match. It now calls fixedLayerContextPin, which takes the resolved GPU memory mode and keeps no context of 0. The MLX estimate uses resolveEstimateContext, which now does the same thing. Tests check the rule by behavior instead of by source text.
Also clarify which loads fixedLayerContextPin answers for, describe resolveEstimateContext for both engines, and drop a comment that repeated the helper's docstring.
@Lyxot

Lyxot commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Closing: staging run for unslothai#18379 at 6fa9600 is done.

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.

2 participants