feat: checkpoint distributed gguf runtime stories
This commit is contained in:
@@ -42,9 +42,12 @@ def _report(**overrides):
|
||||
status="passed",
|
||||
duration_ms=142,
|
||||
validated_at=1_760_000_000.0,
|
||||
owns_embedding=True,
|
||||
owns_final_head=False,
|
||||
)
|
||||
kwargs.update(overrides)
|
||||
return build_capability_report(**kwargs)
|
||||
report = build_capability_report(**kwargs)
|
||||
return report
|
||||
|
||||
|
||||
# --- model-agnostic identity ------------------------------------------------
|
||||
@@ -114,6 +117,9 @@ def test_report_dict_has_the_stable_documented_key_set():
|
||||
"shard",
|
||||
"recipe",
|
||||
"backend",
|
||||
"artifact",
|
||||
"runtime_recipe",
|
||||
"compatibility_fingerprint",
|
||||
"status",
|
||||
"validated_at",
|
||||
"duration_ms",
|
||||
@@ -121,12 +127,38 @@ def test_report_dict_has_the_stable_documented_key_set():
|
||||
}
|
||||
assert payload["schema_version"] == CAPABILITY_SCHEMA_VERSION
|
||||
assert set(payload["model"]) == {"model_id", "revision", "config_fingerprint"}
|
||||
assert set(payload["shard"]) == {"start", "end"}
|
||||
assert set(payload["shard"]) == {
|
||||
"start",
|
||||
"end",
|
||||
"owns_embedding",
|
||||
"owns_final_head",
|
||||
}
|
||||
assert set(payload["recipe"]) == {
|
||||
"recipe_id",
|
||||
"recipe_version",
|
||||
"catalogue_version",
|
||||
}
|
||||
assert set(payload["artifact"]) == {
|
||||
"model_id",
|
||||
"revision",
|
||||
"artifact_hash",
|
||||
"shard_start",
|
||||
"shard_end",
|
||||
}
|
||||
assert set(payload["runtime_recipe"]) == {
|
||||
"weight_quantization",
|
||||
"activation_dtype",
|
||||
"compute_dtype",
|
||||
"kv_dtype",
|
||||
"kv_layout",
|
||||
"tokenizer_revision",
|
||||
"architecture_adapter",
|
||||
"backend_id",
|
||||
"runtime_version",
|
||||
"boundary_schema_version",
|
||||
"cache_layout",
|
||||
"fingerprint",
|
||||
}
|
||||
assert set(payload["backend"]) == {
|
||||
"backend_id",
|
||||
"device",
|
||||
@@ -134,10 +166,19 @@ def test_report_dict_has_the_stable_documented_key_set():
|
||||
"quantization",
|
||||
"runtime",
|
||||
}
|
||||
assert payload["compatibility_fingerprint"].startswith("sha256:")
|
||||
# JSON-serializable end to end.
|
||||
assert json.loads(json.dumps(payload)) == payload
|
||||
|
||||
|
||||
def test_report_carries_endpoint_ownership():
|
||||
"Endpoint ownership is recorded alongside the shard range.\n\nTags: node, startup"
|
||||
payload = _report().to_dict()
|
||||
|
||||
assert payload["shard"]["owns_embedding"] is True
|
||||
assert payload["shard"]["owns_final_head"] is False
|
||||
|
||||
|
||||
def test_identity_key_pins_model_shard_recipe_and_backend():
|
||||
"Identity key pins model shard recipe and backend\n\nTags: node, startup"
|
||||
base = _report()
|
||||
@@ -156,6 +197,15 @@ def test_identity_key_pins_model_shard_recipe_and_backend():
|
||||
assert _report(device="other-device").identity_key() != base.identity_key()
|
||||
|
||||
|
||||
def test_compatibility_fingerprint_changes_when_the_runtime_recipe_changes():
|
||||
"The compatibility fingerprint changes when the runtime recipe changes.\n\nTags: node, startup"
|
||||
base = _report()
|
||||
altered = _report(cache_layout="stateless")
|
||||
|
||||
assert base.compatibility_fingerprint != altered.compatibility_fingerprint
|
||||
assert base.runtime_recipe.fingerprint != altered.runtime_recipe.fingerprint
|
||||
|
||||
|
||||
def test_config_fingerprint_is_stable_under_key_order_and_detects_change():
|
||||
"Config fingerprint is stable under key order and detects change\n\nTags: node, startup"
|
||||
a = config_fingerprint({"num_hidden_layers": 8, "hidden_size": 512})
|
||||
|
||||
Reference in New Issue
Block a user