[GH-ISSUE #3832] [GUI] Context-size selector does not update the VRAM/RAM estimate (512K still reports fits fully in memory) #1626

Closed
opened 2026-11-04 01:52:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3832

Area

[GUI] (the desktop app)

Desktop app, Terminal or source?

Desktop app (Windows, Linux or Mac)

What happened

In the Models page, the Conversation context selector and the This computer estimate disagree with each other. With Swift 1.5 IQ3_XXS selected (43.9 GB RAM + VRAM), the installed app shows:

  • Conversation context: 512K
  • Graphics memory: 16 GB of 16 GB
  • RAM: 32.9 GB of 63.8 GB
  • Verdict: Fits fully in memory. / 完全装得进内存。

Changing the Conversation context dropdown to a different size leaves the two meters and the verdict unchanged. The selected context is therefore not reflected in the estimate, and the page cannot tell the user what size their machine can actually handle.

This is not live memory telemetry that only changes after a reload. The meters are an estimate: PcFitCard receives fitOn(selectedSize, fitHardware) and draws fit.vramUseGb, fit.ramUseGb and fit.spillGb (NativeModels.tsx L207, PcFitCard.tsx L23-L26). The selected context state exists on the same page (NativeModels.tsx L41, selector at L187), but it is not passed to the fit calculation.

fitOn takes only the model and the available RAM/VRAM (native-fit.ts L33-L44). Its fixed DENSE_GB = 5 is documented as dense weights, buffers and a 32K cache (native-fit.ts L4-L7, L22). Selecting 512K is 16 times that assumed cache in token count, before considering the KV format, yet the number does not move at all. The same estimate also ignores the kv (INT8 / Q4 / K8V4) setting.

This is not only a missing number. The card uses fit.spillGb to say Fits fully in memory. (PcFitCard.tsx L26), so it can promise a fit for a 512K configuration whose context cache will not fit when the model is loaded. Related report #3723 records a 512K load on the same class of machine failing with no VRAM left and a 7361 MiB KV cache at 524288 tokens; that issue is about the missing engine error text, not this estimate.

Expected: changing Conversation context should immediately update the estimated VRAM/RAM use, the remaining headroom, and the fit verdict. The estimate should include the context/KV cache (and the selected KV format), not only the weights. If a reliable estimate is not possible for a configuration, the card should say so instead of claiming that it fits.

Smallest steps or command that reproduce it

  1. Open Models and select a large model, for example Swift 1.5 IQ3_XXS (43.9 GB RAM + VRAM).
  2. Leave Conversation context at 512K and note the Graphics memory, RAM and Fits fully in memory. values in the This computer card.
  3. Change Conversation context to a smaller value such as 32K, 128K or 256K.
  4. Observe that the two meters and the fit verdict remain unchanged.
  5. Change it back to 512K: the page still gives the same estimate.

Reproduction status

Reproduced locally

The screenshot and the unchanged values come from the installed 0.2.3 app. I confirmed the code path in the same commit, but did not run separate GUI automation. The estimate itself is deterministic: fitOn has no context input, so its result cannot depend on the selector.

Strata version

Strata 0.2.3, engine 0.1.48, commit 5c8dd322528cc84f68f461ad54a506b9da8fa8d4.

Graphics card, memory and system

NVIDIA GeForce RTX 3080 Ti Laptop GPU, 16 GB VRAM · 63.8 GB RAM · Windows 11 Pro 26H2, build 26300.

Model, size and settings

Swift 1.5 IQ3_XXS · 43.9 GB RAM + VRAM · 512K context · predicted graphics memory Automatic (recommended) · Chinese UI.

Logs

No new engine log: the misleading estimate is visible before the model is loaded. The 512K load failure and its engine log are already recorded in #3723.

Root cause and suggested fix

  • NativeModels keeps context in state and uses it when loading, but the fit card always calls fitOn(selectedSize, fitHardware) without the selected context.
  • fitOn hard-codes a 32K cache inside DENSE_GB and never receives the KV format.
  • PcFitCard presents the result as an estimate and turns spillGb === 0 into Fits fully in memory., so the incorrect number becomes a misleading verdict.

Suggested fix:

  1. Extend the native fit input/function with context and kv, and compute the KV cache from the model's kvKbPerToken. The managed catalog already has that value (apps/host/server/catalog.mjs L56), and the web model screen already uses kvKbPerToken * context (apps/host/src/lib/experience.ts L82-L88, apps/host/src/lib/model-versions.ts L5); the native NativeSize payload does not currently carry it, so expose the same per-model value or use the engine's planning endpoint. The native page should share that calculation rather than keeping a separate weights-only estimate.
  2. Recompute on every context/KV change and show the estimate as weights + context cache + runtime/overhead. Include the selected resource profile's headroom.
  3. Only show Fits fully in memory. when the full estimated total fits; otherwise show the shortfall or Fit unknown.
  4. Add a regression test that asserts two different context sizes produce different VRAM/RAM estimates and that a 512K estimate is not reported as fitting when the cache exceeds the available memory.

Avoid using the fixed 32K cache as a stand-in for every selectable context. It is correct only near 32K and becomes increasingly optimistic at 128K/256K/512K.

Searched open and closed issues and PRs for context, context size, VRAM, RAM, memory, estimate, Fits fully in memory, 预测显存, 上下文, 显存, 内存, and the code terms fitOn, PcFitCard and native-fit.

No report covers the native Models page's context-size field failing to update its memory estimate. The closest reports are #3723 (KV-format explanation and missing out-of-VRAM error text) and #3750 (engine VRAM reserve), neither of which reports this fit-card calculation. #765 is a closed engine-side VRAM budgeting issue, not the desktop estimate.

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3832 ## Area [GUI] (the desktop app) ## Desktop app, Terminal or source? Desktop app (Windows, Linux or Mac) ## What happened In the Models page, the **Conversation context** selector and the **This computer** estimate disagree with each other. With `Swift 1.5 IQ3_XXS` selected (43.9 GB RAM + VRAM), the installed app shows: - Conversation context: `512K` - Graphics memory: `16 GB of 16 GB` - RAM: `32.9 GB of 63.8 GB` - Verdict: `Fits fully in memory.` / `完全装得进内存。` Changing the Conversation context dropdown to a different size leaves the two meters and the verdict unchanged. The selected context is therefore not reflected in the estimate, and the page cannot tell the user what size their machine can actually handle. This is not live memory telemetry that only changes after a reload. The meters are an estimate: `PcFitCard` receives `fitOn(selectedSize, fitHardware)` and draws `fit.vramUseGb`, `fit.ramUseGb` and `fit.spillGb` ([NativeModels.tsx L207](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/components/NativeModels.tsx#L207), [PcFitCard.tsx L23-L26](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/components/PcFitCard.tsx#L23-L26)). The selected `context` state exists on the same page ([NativeModels.tsx L41](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/components/NativeModels.tsx#L41), selector at [L187](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/components/NativeModels.tsx#L187)), but it is not passed to the fit calculation. `fitOn` takes only the model and the available RAM/VRAM ([native-fit.ts L33-L44](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/native-fit.ts#L33-L44)). Its fixed `DENSE_GB = 5` is documented as dense weights, buffers and **a 32K cache** ([native-fit.ts L4-L7](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/native-fit.ts#L4-L7), [L22](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/native-fit.ts#L22)). Selecting 512K is 16 times that assumed cache in token count, before considering the KV format, yet the number does not move at all. The same estimate also ignores the `kv` (INT8 / Q4 / K8V4) setting. This is not only a missing number. The card uses `fit.spillGb` to say `Fits fully in memory.` ([PcFitCard.tsx L26](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/components/PcFitCard.tsx#L26)), so it can promise a fit for a 512K configuration whose context cache will not fit when the model is loaded. Related report #3723 records a 512K load on the same class of machine failing with no VRAM left and a 7361 MiB KV cache at 524288 tokens; that issue is about the missing engine error text, not this estimate. Expected: changing Conversation context should immediately update the estimated VRAM/RAM use, the remaining headroom, and the fit verdict. The estimate should include the context/KV cache (and the selected KV format), not only the weights. If a reliable estimate is not possible for a configuration, the card should say so instead of claiming that it fits. ## Smallest steps or command that reproduce it 1. Open Models and select a large model, for example `Swift 1.5 IQ3_XXS` (43.9 GB RAM + VRAM). 2. Leave Conversation context at `512K` and note the Graphics memory, RAM and `Fits fully in memory.` values in the This computer card. 3. Change Conversation context to a smaller value such as 32K, 128K or 256K. 4. Observe that the two meters and the fit verdict remain unchanged. 5. Change it back to 512K: the page still gives the same estimate. ## Reproduction status Reproduced locally The screenshot and the unchanged values come from the installed 0.2.3 app. I confirmed the code path in the same commit, but did not run separate GUI automation. The estimate itself is deterministic: `fitOn` has no context input, so its result cannot depend on the selector. ## Strata version Strata 0.2.3, engine 0.1.48, commit `5c8dd322528cc84f68f461ad54a506b9da8fa8d4`. ## Graphics card, memory and system NVIDIA GeForce RTX 3080 Ti Laptop GPU, 16 GB VRAM · 63.8 GB RAM · Windows 11 Pro 26H2, build 26300. ## Model, size and settings Swift 1.5 IQ3_XXS · 43.9 GB RAM + VRAM · 512K context · predicted graphics memory `Automatic (recommended)` · Chinese UI. ## Logs No new engine log: the misleading estimate is visible before the model is loaded. The 512K load failure and its engine log are already recorded in #3723. ## Root cause and suggested fix - `NativeModels` keeps `context` in state and uses it when loading, but the fit card always calls `fitOn(selectedSize, fitHardware)` without the selected context. - `fitOn` hard-codes a 32K cache inside `DENSE_GB` and never receives the KV format. - `PcFitCard` presents the result as an estimate and turns `spillGb === 0` into `Fits fully in memory.`, so the incorrect number becomes a misleading verdict. Suggested fix: 1. Extend the native fit input/function with `context` and `kv`, and compute the KV cache from the model's `kvKbPerToken`. The managed catalog already has that value (`apps/host/server/catalog.mjs` L56), and the web model screen already uses `kvKbPerToken * context` (`apps/host/src/lib/experience.ts` L82-L88, `apps/host/src/lib/model-versions.ts` L5); the native `NativeSize` payload does not currently carry it, so expose the same per-model value or use the engine's planning endpoint. The native page should share that calculation rather than keeping a separate weights-only estimate. 2. Recompute on every context/KV change and show the estimate as weights + context cache + runtime/overhead. Include the selected resource profile's headroom. 3. Only show `Fits fully in memory.` when the full estimated total fits; otherwise show the shortfall or `Fit unknown`. 4. Add a regression test that asserts two different context sizes produce different VRAM/RAM estimates and that a 512K estimate is not reported as fitting when the cache exceeds the available memory. Avoid using the fixed 32K cache as a stand-in for every selectable context. It is correct only near 32K and becomes increasingly optimistic at 128K/256K/512K. ## Duplicate search Searched open and closed issues and PRs for `context`, `context size`, `VRAM`, `RAM`, `memory`, `estimate`, `Fits fully in memory`, `预测显存`, `上下文`, `显存`, `内存`, and the code terms `fitOn`, `PcFitCard` and `native-fit`. No report covers the native Models page's context-size field failing to update its memory estimate. The closest reports are #3723 (KV-format explanation and missing out-of-VRAM error text) and #3750 (engine VRAM reserve), neither of which reports this fit-card calculation. #765 is a closed engine-side VRAM budgeting issue, not the desktop estimate.
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

Thank you. Fixed in 0.2.5: the Models page now counts the Conversation context and the cache format you choose in its memory estimate, so the two meters and the verdict change with the selector.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5

<!-- gh-comment-id:6491888164 --> @Niko1221 commented on GitHub (Oct 29, 2026): Thank you. Fixed in 0.2.5: the Models page now counts the Conversation context and the cache format you choose in its memory estimate, so the two meters and the verdict change with the selector. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.5
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1626
No description provided.