Complete the v1 environment migration runbook and validation pipeline - #152
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fe246f83f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| source env/docker/cu130/scripts/activate_v1.sh | ||
|
|
||
| Start the KDN CLI: | ||
| DOC=/workspace/llm-stack/CacheRoute/data/CacheRoute_dataset/knowledge_document/668f6bd1ad2419d9dfbcda0b689311b8b6696c7ed772001bea7bd12573137b4a.txt |
There was a problem hiding this comment.
Extract the quickstart document before registration
On a fresh checkout, this path does not exist: a repo-wide tracked-file search shows only CacheRoute_test_nq.zip and README.md in this directory, with the named text file stored inside the ZIP, and no preceding quickstart step extracts it. Consequently, the first --build-kv-file "$DOC" command fails before registration; add an extraction step or use a document that is present in the working tree.
AGENTS.md reference: AGENTS.md:L91-L95
Useful? React with 👍 / 👎.
|
|
||
| if len(dump_files) != len(records): | ||
| errors.append(f"manifest records={len(records)} but dump files={len(dump_files)}") | ||
| if run_meta: |
There was a problem hiding this comment.
Reject artifacts without run_meta
When run_meta.json is absent or contains an empty object, this condition skips every metadata check, so inspect reports success as long as the manifest and dump counts match even though the artifact's runtime profile, key format, and build count are unknown. This contradicts the documented promise to verify run_meta.json and can approve an incomplete or incompatible artifact for injection; treat missing or empty metadata as an inspection error.
AGENTS.md reference: AGENTS.md:L227-L232
Useful? React with 👍 / 👎.
Purpose
Close out the CUDA 13 / vLLM 0.25.1 / LMCache 0.5.2 migration by turning the successfully validated manual workflow into a maintained runbook and a reproducible, safety-gated validation pipeline.
This PR builds on merged PRs #149 and #151. It does not restructure the repository homepage and does not change serving, routing, queueing, or cache runtime behavior.
Scope
Shared v1 shell activation
Add
env/docker/cu130/scripts/activate_v1.shfor every modern service terminal. It:CACHEROUTE_RUNTIME_PROFILE=v1;PYTHONPATHwithout duplication;PYTHONHASHSEEDandOMP_NUM_THREADSdefaults;LMCACHE_CONFIG_FILEinterface;PYTORCH_CUDA_ALLOC_CONFfor the validated MP startup path;Non-destructive environment check
Add
env/docker/cu130/scripts/check_v1_environment.pyto validate:Unavailable services are warnings by default and errors with
--require-running.Staged KDN round-trip validator
Add
scripts/validate_v1_kdn_roundtrip.pywith four explicit stages:build: register a document and build its KV artifact without manual--matchor Redis flush;inspect: validate KID,run_meta.json, manifest, dump count, and payload size;inject: restore the artifact throughKVCacheInjectorand verify key sets, lengths, payload bytes, and sampled SHA256 values;consume: send the exact builder-style system prefix and verify vLLM external-cache plus LMCache lookup/L2 metrics.Destructive cleanup is guarded: Redis
FLUSHDBrequires both--flush-redisand--yes. Injection and consumption remain separate because LMCache and vLLM must be restarted between them to clear L1/GPU state before proving an RESP L2 load.Documentation closeout
docs/quickstart_v1.mdwith the complete startup and validation pipeline, Python Redis fallback, correct metrics endpoints, normal no---matchregistration, and staged acceptance criteria.env/docker/cu130/README.mdto use mergedmaininstead of the historical migration branch, document the new scripts, and record the completed KDN validation.docs/runtime_compatibility_v1.mdto replace the obsolete “cache consumption not yet proven” boundary with the validated result.docs/v1_migration_closeout.mdas the migration baseline, evidence record, safety contract, compatibility checklist, and Definition of Done.Completed runtime evidence
The validated dataset document produced the following result under TP=8, LMCache chunk size 256, and
sha256_cbor:The physical layout is consistent:
This closes the previous validation gap: the locally saved artifact was restored byte-for-byte, discovered in Redis RESP L2, loaded into LMCache L1, and consumed by vLLM as external prefix cache.
Metrics correction
The documentation now distinguishes:
LMCache lookup metrics may not exist before the first request. Direct KDN injection bypasses LMCache store accounting, so
lmcache_mp_l2_usage_bytesis not proof of Redis contents.Compatibility and non-regression
This PR does not modify:
README.md;env/README.mdpath;requirements.txtorpyproject.toml;The changed-file set is limited to three existing v1 documents, one new migration closeout document, and three v1 activation/validation tools. While this PR was being prepared,
mainadded separate Chinese and English KDN/LMCache architecture-amendment documents; those files do not overlap with this PR.The legacy path remains available through
CACHEROUTE_RUNTIME_PROFILE=legacy; the modern path usesv1; generic compatibility remainsauto.Validation performed for this PR
bash -n env/docker/cu130/scripts/activate_v1.sh— passed.python3 -m py_compile env/docker/cu130/scripts/check_v1_environment.py scripts/validate_v1_kdn_roundtrip.py— passed.The newly packaged validator has been syntax-checked in this PR; the full GPU pipeline was validated manually before packaging and is now represented by the staged commands.
Superseded work
PR #150 is fully incorporated by merged PR #149 and this migration closeout. It should remain closed/superseded rather than being merged separately.