mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2399] [Engine] allow elastic expert cache and growing K/V on Linux HIP #4026
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4026
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2399
Author: @i-Vladimir-i
Created: 10/14/2026
Status: 🔄 Open
Base:
main← Head:kvgrow-elastic-v2📝 Commits (1)
ef7aca7[Codex]: allow elastic expert cache and growing K/V on Linux HIP📊 Changes
7 files changed (+502 additions, -212 deletions)
View changed files
📝
docs/DETAILS.md(+10 -6)📝
docs/VRAM_ELASTIC.md(+46 -8)📝
include/strata/core/vmm.hpp(+12 -1)📝
src/core/expert_cache.cpp(+25 -158)📝
src/core/vmm.cpp(+260 -9)📝
src/program/generate.cpp(+117 -28)📝
tests/core/vmm_test.cpp(+32 -2)📄 Description
Problem and result
On Linux HIP, elastic expert-cache resizing is disabled, and
--vram-elasticcannotshare the address range used by
--kv-grow. This change enables the opt-in HIP pathafter a per-device runtime safety probe and lets reserve/return coexist with growing K/V.
The feature remains off by default. Windows HIP remains disabled.
Related discussion
This updates the existing #2399 scope. It does not add the layer-split/per-device API
from #2522. The two proposals still have three textual conflicts and different cache
admission requirements; their combination has not been built or executed.
Approach
Reuse the VMM implementation for segmented and shared-arena caches. On Linux HIP,
check recommended allocation granularity, actual release behavior and the file limit
needed by physical allocations. Fail the probe with a reason and retain the existing
single-allocation path. With both opt-ins, reserve/return takes and refills chunks in
the existing K/V arena without moving the prompt loan. Refilling may select different
experts, so matching capacity alone does not establish matching expert membership.
Validation
Tested on Linux, AMD Radeon AI PRO R9700/gfx1201, official GGML
3cf03257f219afbe7334045ff7c6a06ac68c627d.Engine base:
9f7d977d220e9fdf2ec53cf2620cdadac1cfb24e; tested candidate tree:dfa2d887cf852d9c039808287374386399da263e.The published refresh on
54828c7ediffers only in eight upstream sponsor README files;its feature patch is byte-identical, SHA256
6d2e751f205f598e93c4313cd9ab85b5c8d440f18aceb8b0550f3d06a515935c.The separate evidence package records command arrays, individual failures/skips and input hashes.
Passed:
python -B -m unittest discover -s serve -p 'test_*.py' -v, 1450 tests, 17 skips, exit 0.main 211 passed/13 skipped; candidate 212/12, exit 0. The candidate's segmented-cache
test ran. Numeric PLE and stock upstream MMQ passed; unsupported trellis host types
are recorded as skipped, not numeric passes.
ctest --test-dir "$QUALIFIED_DIR" --output-on-failure --timeout 180 -j1 --output-junit "$XML". Seven disclosed test supports: separate ISA checker,private copy-stream warmup binary, explicit PLE arguments and four scratch
CWD/output/consumer redirects. Inventory, dependencies, timeouts and skip codes
otherwise preserved; none of these supports enters this PR.
native SAVE/RESTORE/checksum and byte-identical round-trip sessions. Main/candidate
cold, warm and full-restore token IDs/text match; same-regime repeat/restore checks pass.
10948/10948/10857 slots. Six independent VMM/malloc consumers physically held
8 GiB; DRM residency and zero model-VRAM shortfall checked. Consumers released
before generation.
deterministic diagnostic profile, not production tuning.
and candidate budgets 4096/2048/1536 MiB. A separate 1024 MiB case recovered text
service after a resource limit; it is not counted as GPU_PASS.
config/engine/catalog/sampling/service invariants unchanged. Independent readers exit 0.
Failed:
qualification passes. Original failures are retained.
A new scratch-only revision passed without changing native sources/binaries.
peaks.pybytes. A separate reader,qualified by five CPU regressions, verified that conversion and existing mappings
without overwrite. The original failed postflight remains recorded; GPU was not rerun.
Same-regime restore repeats pass. This does not establish arbitrary-resize parity
or prove a restore defect; expert membership was not instrumented.
Not run:
Local Metal build/runtime; NVIDIA, Intel Arc and Windows hardware execution;
combined #2522 multi-GPU; restore with an external 8 GiB allocation still held;
fresh uncached image after idle; increased image-token counts; general quality parity.
Limits
Keep this PR in Draft pending missing backend/hardware checks. CUDA/SYCL compilation
is not hardware execution. Synthetic generations are capped at 96 tokens and end by
length; fixture success is not unrestricted answer-quality acceptance. The diagnostic
profile fixes pcie-frac0, IQ_MT_MIN1, PREFILL_CPU_SHARE0 and adaptation off; a previous
performance-profile baseline failure remains outside this result. Both image sizes
normalize to 1024 image tokens; the idle case reuses cached embeddings. Sampled 250 ms
VRAM peaks are lower bounds, not absolute maxima or separate verify peaks.
Published candidate and evidence
Head
ef7aca7cf474e16c4bf49e1cff8c1e4eeb378d83, parent54828c7efbcdf9474697e70922d851f6707f4b32.Reconstruct the SHA256-verified evidence ZIP.
ZIP SHA256:
4f795ed12c1091b6d9394c6e4e0935a1e19684d389fb8fa120abee8d9a7b8756. All three public raw files and decoded ZIP were read back exactly.CI on the updated head
Head
ef7aca7cf474e16c4bf49e1cff8c1e4eeb378d83.Metal CI compiled and linked the engine. It did not execute Metal inference or establish runtime GPU-kernel compilation/correctness. Local Metal hardware and the other Not run items above remain unavailable/unverified.
This PR remains Draft as requested.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.