Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/deepseek_v4/tp4_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cache_model_profile": "deepseek-v4-fp8-hma",
"published_runtime_base": "ghcr.io/fujitsupolycom/gb10-vllm-serving@sha256:6fc26fdad81a18f0fff67ce0a05f6d90165625ea2e1cac8a6f39bfb462017028",
"sparkcache": {
"source_sha256": "88633ef676b4dfe258a6fa9b788ddeb22cad68349d0cae0c503ee404d1724f7b"
"source_sha256": "83853050f790b18af95d424fec837abeb1a9a33f0538b5e4b97c16fb9c681781"
},
"model": {
"repository": "deepseek-ai/DeepSeek-V4-Flash-0731",
Expand Down
2 changes: 1 addition & 1 deletion deploy/glm52_35bpw/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"published_runtime_base": "ghcr.io/fujitsupolycom/gb10-vllm-serving@sha256:6fc26fdad81a18f0fff67ce0a05f6d90165625ea2e1cac8a6f39bfb462017028",
"base_image_requirement": "exact GLM-5.2 3.5-bpw R7 image recorded by the source container inspection",
"sparkcache": {
"source_sha256": "88633ef676b4dfe258a6fa9b788ddeb22cad68349d0cae0c503ee404d1724f7b"
"source_sha256": "83853050f790b18af95d424fec837abeb1a9a33f0538b5e4b97c16fb9c681781"
},
"model": {
"repository": "brandonmusic/GLM-5.2-EXL3-TR3v4-3.5bpw-MTP78",
Expand Down
4 changes: 2 additions & 2 deletions patches/vllm-glm53-b12x-kda-adaptive-mtp/source-receipt.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
],
"contract": {
"path": "sparkcache/runtime_patches/vllm-kv-block-lease-contract-glm53-b12x-kda-adaptive-mtp.json",
"sha256": "45d7a92b38b836a4f829f02df85e339cfeea860e1080e4663a8340af6c125125"
"sha256": "f36ed14eaf1f97a5dffa94bda8151b1e0fa182afc0d121b757b70bebc6a43811"
},
"result": "All four patches apply in order to the LF source tree, and the eleven-file SparkCache contract verifies the resulting source bytes, including the live-tensor B12X KDA implementation."
"result": "All four SparkCache patches apply in order to the LF source tree and produce the exact preimages required by the recurrent-boundary producer. The eleven-file final-runtime contract verifies only after that producer creates its four recurrent postimages; it also covers the unchanged live-tensor B12X KDA surface."
}
8 changes: 6 additions & 2 deletions sparkcache/runtime_patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ exact-input overlays under `patches/vllm-glm53-b12x-kda-adaptive-mtp`.
The three KDA commits after `e10536a` change only the KDA implementation and
its model tests. Ten SparkCache ownership files remain byte-identical, while
the eleventh contract file binds the live-tensor B12X KDA implementation.
The contract has **implemented** status. Four-rank TP4/DCP1 serving remains
unqualified until a receipt names an immutable image built from this revision.
The four SparkCache patches produce the exact preimages consumed by the
recurrent-boundary producer. The contract names one coherent final runtime
state across all eleven files and is valid only after that producer creates its
four recurrent postimages. It has **implemented** status. Four-rank TP4/DCP1
serving remains unqualified until a receipt names an immutable image built from
this revision.

```bash
python -m sparkcache.runtime_patches.verify_lease_contract \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def test_glm53_b12x_kda_adaptive_mtp_contract_attests_the_complete_sparkcache_vl
KDA_PATH,
}
for record in contract["files"]:
expected_roles = {SOURCE_ROLE}
if record["path"] in RECURRENT_BOUNDARY_FILES:
expected_roles.add(RECURRENT_BOUNDARY_ROLE)
assert set(record["accepted_sha256"]) == expected_roles
assert set(record["accepted_sha256"]) == {RECURRENT_BOUNDARY_ROLE}
assert all(record["required_symbols"] for record in contract["files"])

by_path = {record["path"]: record for record in contract["files"]}
Expand Down Expand Up @@ -147,11 +144,11 @@ def test_glm53_b12x_kda_adaptive_mtp_overlay_has_exact_preimage_and_postimage_re
assert patch_positions == sorted(patch_positions)


def test_glm53_b12x_kda_adaptive_mtp_patch_sequence_terminates_at_attested_contract_postimages() -> None:
def test_glm53_b12x_kda_adaptive_mtp_patch_sequence_precedes_the_final_contract() -> None:
receipts = json.loads(PREIMAGES.read_text(encoding="utf-8"))
contract = json.loads(CONTRACT.read_text(encoding="utf-8"))
accepted = {
record["path"]: record["accepted_sha256"][SOURCE_ROLE]
record["path"]: record["accepted_sha256"][RECURRENT_BOUNDARY_ROLE]
for record in contract["files"]
}
scheduler_recovery = receipts["030-sparkcache-hma-load-failure.patch"]
Expand All @@ -163,13 +160,53 @@ def test_glm53_b12x_kda_adaptive_mtp_patch_sequence_terminates_at_attested_contr
scheduler_recovery["accepted_postimage_sha256"][SOURCE_ROLE]
== scheduler_attach["accepted_preimage_sha256"][SOURCE_ROLE]
)
assert (
scheduler_attach["accepted_postimage_sha256"][SOURCE_ROLE]
== accepted[scheduler_attach["target_path"]]
)
assert (
manager_lease["accepted_postimage_sha256"][SOURCE_ROLE]
== accepted[manager_lease["target_path"]]
assert scheduler_attach["accepted_postimage_sha256"][SOURCE_ROLE] != accepted[
scheduler_attach["target_path"]
]
assert manager_lease["accepted_postimage_sha256"][SOURCE_ROLE] != accepted[
manager_lease["target_path"]
]


def test_glm53_recurrent_contract_verifies_one_coherent_final_source_state(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
) -> None:
contract = json.loads(CONTRACT.read_text(encoding="utf-8"))
accepted_by_path: dict[Path, str] = {}
for record in contract["files"]:
relative = Path(record["path"])
accepted_by_path[relative] = record["accepted_sha256"][
RECURRENT_BOUNDARY_ROLE
]
classes: dict[str, list[str]] = {}
for symbol in record["required_symbols"]:
class_name, member_name = symbol.split(".")
classes.setdefault(class_name, []).append(member_name)
source = tmp_path / relative
source.parent.mkdir(parents=True, exist_ok=True)
source.write_text(
"\n\n".join(
"class "
+ class_name
+ ":\n"
+ "\n".join(
f" def {member_name}(self):\n pass"
for member_name in members
)
for class_name, members in classes.items()
)
+ "\n",
encoding="utf-8",
)

def exact_composed_digest(path: Path) -> str:
return accepted_by_path[path.resolve().relative_to(tmp_path.resolve())]

monkeypatch.setattr(verifier, "_sha256", exact_composed_digest)
verified = verifier.verify_contract(tmp_path, CONTRACT)
assert [path.relative_to(tmp_path) for path in verified] == list(
accepted_by_path
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"path": "vllm/distributed/kv_transfer/kv_connector/v1/base.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "bc1965431087676876f58360cd9cc07ab6c06febe6d747695f10b051fd85c412"
"recurrent_boundary_contract": "bc1965431087676876f58360cd9cc07ab6c06febe6d747695f10b051fd85c412"
},
"required_symbols": [
"KVConnectorBase_V1.handle_preemptions",
Expand All @@ -16,7 +16,7 @@
{
"path": "vllm/distributed/kv_transfer/kv_connector/utils.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "115512dca36b0711223f55f5ff304abffccc6d078923ba4c6bbb3cdb7fdd39a2"
"recurrent_boundary_contract": "115512dca36b0711223f55f5ff304abffccc6d078923ba4c6bbb3cdb7fdd39a2"
},
"required_symbols": [
"KVOutputAggregator.from_connector",
Expand All @@ -26,7 +26,6 @@
{
"path": "vllm/v1/core/sched/scheduler.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "6d397c97f31e67a75efc01b5ddd89fa58db425de14fa43965ef2d6146b6b9bdb",
"recurrent_boundary_contract": "260f36ce8fabf70c193b20009ea465eea7b1b6c8e9fb72f2307a01ba8fcf7b2a"
},
"required_symbols": [
Expand All @@ -42,7 +41,6 @@
{
"path": "vllm/v1/core/kv_cache_manager.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "ee03dc9ce2b720c0be6e9f572d23580ba96eff68fe3406250557e83071654af0",
"recurrent_boundary_contract": "c5b83d382c96b2bf8c466a993ed77123a14a971e2661797128533319388d0b5f"
},
"required_symbols": [
Expand All @@ -60,7 +58,6 @@
{
"path": "vllm/v1/core/sched/output.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "65235eba652e5a3ccee18bf3cbfeac9bf4da8fb9c61e961580f612cfb7e593bc",
"recurrent_boundary_contract": "9911b3f9d21815a185285852b5a6176e5484e1ab0ff5c30f7caaa68ea0fab543"
},
"required_symbols": [
Expand All @@ -72,7 +69,7 @@
{
"path": "vllm/v1/worker/gpu_model_runner.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "5ac63bf43acc6b254282426a8a9b989cc07fcdbd07223101bdc99f91f4e4ce5f"
"recurrent_boundary_contract": "5ac63bf43acc6b254282426a8a9b989cc07fcdbd07223101bdc99f91f4e4ce5f"
},
"required_symbols": [
"GPUModelRunner.execute_model",
Expand All @@ -82,7 +79,7 @@
{
"path": "vllm/v1/core/block_pool.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "ddee56dccb2208411b3a035918e917ce8f56a9858471e9ca12b420d5d79bc69c"
"recurrent_boundary_contract": "ddee56dccb2208411b3a035918e917ce8f56a9858471e9ca12b420d5d79bc69c"
},
"required_symbols": [
"BlockPool.touch",
Expand All @@ -92,7 +89,7 @@
{
"path": "vllm/v1/core/kv_cache_coordinator.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "37be4bb55d40d78e2210b28c0a3f55e1027872af21335de5ca3c61f09c3856af"
"recurrent_boundary_contract": "37be4bb55d40d78e2210b28c0a3f55e1027872af21335de5ca3c61f09c3856af"
},
"required_symbols": [
"KVCacheCoordinator.allocate_new_computed_blocks",
Expand All @@ -103,7 +100,6 @@
{
"path": "vllm/v1/core/single_type_kv_cache_manager.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "e4b1c5c38b63b708fd55aa40a9ab0d008b266d006a63dcfcef55890ac1371cb8",
"recurrent_boundary_contract": "f67a1850a7e0288baaa6d42e7ec55b22b09c156720767e23acaabedcae333c8a"
},
"required_symbols": [
Expand All @@ -120,7 +116,7 @@
{
"path": "vllm/v1/kv_cache_interface.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "72acc5ae3f61f7ecbebdb3a3a16b7c69c064d6fd7af23a1fcc3cf946bdaee952"
"recurrent_boundary_contract": "72acc5ae3f61f7ecbebdb3a3a16b7c69c064d6fd7af23a1fcc3cf946bdaee952"
},
"required_symbols": [
"MambaSpec.max_num_blocks_per_req"
Expand All @@ -129,7 +125,7 @@
{
"path": "vllm/model_executor/layers/mamba/gdn/kimi_gdn_linear_attn.py",
"accepted_sha256": {
"source_built_glm53_b12x_kda_adaptive_mtp": "8bf8bc579dd4a80224dc1633e7513f2a0c58e07db72a736c7e41d28d3c35f3b9"
"recurrent_boundary_contract": "8bf8bc579dd4a80224dc1633e7513f2a0c58e07db72a736c7e41d28d3c35f3b9"
},
"required_symbols": [
"KimiGatedDeltaNetAttention._initialize_b12x_kda_decode",
Expand Down