mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2967] [Engine] Add experimental RoPE-to-YaRN 4x saved-cache migration #4368
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#4368
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/2967
Author: @CC-David-CC
Created: 10/17/2026
Status: 🔄 Open
Base:
main← Head:feat/rope-yarn4-cache-minimal📝 Commits (2)
e45bd5ffeat: experimental RoPE to YaRN 4x saved-cache migration6d29b11test: cover saved-cache migration and provenance📊 Changes
17 files changed (+726 additions, -57 deletions)
View changed files
📝
CMakeLists.txt(+5 -1)➕
docs/ROPE_CACHE_MIGRATION.md(+32 -0)📝
include/strata/core/conversation_cache.hpp(+3 -0)📝
include/strata/core/conversation_file.hpp(+1 -1)📝
include/strata/core/conversation_snapshot.hpp(+7 -0)➕
include/strata/core/rope_cache_migration.hpp(+29 -0)📝
include/strata/kernels/rope_scaling.hpp(+24 -0)📝
serve/server.py(+16 -11)📝
serve/test_slots.py(+37 -0)📝
src/core/conversation_file.cpp(+29 -9)📝
src/core/conversation_file_test.cpp(+1 -1)📝
src/core/conversation_state.cpp(+21 -8)📝
src/core/conversation_validation_test.cpp(+12 -0)➕
src/core/rope_cache_migration.cpp(+187 -0)➕
src/core/rope_cache_migration_test.cpp(+222 -0)📝
src/kernels/cuda/rope.cu(+3 -17)📝
src/program/generate.cpp(+97 -9)📄 Description
Problem and result
An ordinary-RoPE saved session cannot normally be restored under different YaRN settings. Add opt-in migration to approximate YaRN 4x history, including MTP draft keys, while retaining the original saved file and marking converted history as approximate.
Related discussion
#1698. This updates the existing saved-cache migration proposal onto current main.
Approach
Rebased onto main
90767252f, preserving the new server admission/queue methods and engine source registration. Require--experimental-rope-yarn4-cache,STRATA_ROPE_TABLE=1, FP16 KV, text-only and one GPU. Convert eligible keys, preserve provenance through save/reload, and refuse incompatible or repeated migration. Added the migration and slot regressions to the branch.Usage:
docs/ROPE_CACHE_MIGRATION.md.Validation
Tested revision:
6d29b11ae.Passed:
git diff --check upstream/main.strata,rope_cache_migration_test,conversation_file_test,conversation_validation_testandrope_parity. All four selected CTests passed.stratabuild and the same four CTests passed on llm-79, RX 7900 XTX (gfx1100), ROCm 7.15 / Clang 23.stratabuilt with Intel oneAPI 2026.1; no Intel GPU execution claimed.python -m unittest serve.test_slots serve.test_queue_keepalive -vpassed all 37 tests. Windows also passed, with the symlink check skipped there and covered on Linux.Failed:
Full HIP build: installed Clang 17 rejects two
__shared__ alignas(16)declarations in unchanged upstreamsrc/kernels/cuda/iq_kernels.cu(lines 2263 and 2450). This older-toolchain failure remains on A5500; the full build and tests passed on llm-79 with its installed ROCm toolchain.An initial real-model run refused migration because the model fingerprint differed. A diagnostic run and a subsequent run of the unchanged production executable passed. The initial refusal remains unexplained; the identity check was retained.
Not run:
Limits
Converted keys do not recompute the historical attention that produced retained values and recurrent state; migration is approximate, not equivalent to fresh YaRN prefill. Keep the same model, MTP and execution settings. Vision, batching, multiple GPUs and non-FP16 KV are excluded. The source session is retained; existing destinations and repeated conversions are refused.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.