Skip to content

Commit 40c8469

Browse files
authored
Prove exact Apertus GGUF runtime support (#683)
## Summary - Promote only the immutable Apertus v1.1 1.5B Instruct BF16 GGUF exact-float CPU route to final-package runtime-supported status. - Accept pinned llama.cpp v1.1 serialization: unqualified `xielu.*` metadata and factorless default RoPE, while rejecting conflicting xIELU keys, incomplete/malformed factors, unsupported scaling metadata, ignored `original_context_length`, and lossy factor storage. - Preserve graph identity independently from the subsequently written `export_report.json`, then validate the complete final runtime package including that report. - Auto-select exact immutable runtime evidence without requiring callers to repeat its evidence-pinned tokenizer repository/revision. Matching explicit flags remain accepted; conflicting explicit identities fail before serialization. - Reconcile #697 tokenizer policy without adding a broad Tekken promotion: unmatched artifacts remain deferred and tokenizer-omitted. - Replace a build-time deferred tokenizer report with supported/exported after exact materialization, so the validated package is truthfully complete and end-to-end runnable. - Use an independent raw `gguf.GGUFReader` + `dequantize` oracle with Mobius loading, mapping, tensor-processing, and normalization helpers patched to raise. ## Immutable evidence - GGUF: `MrMeOrYou/Apertus-v1.1-1.5B-Instruct-GGUF@88c75ad49566d3c2157d03709bf772262c3241ed` - File: `Apertus-v1.1-1.5B-Instruct-BF16.gguf` - Size/SHA-256: `3,028,052,608` / `f9ec154d0ec29dad1f6465b458b7f27bd25ad7b9a3899233ae98ca6d358501c2` - Official config/tokenizer: `swiss-ai/Apertus-v1.1-1.5B-Instruct@9e9d01154446a645d30f04174cf1515a38058be7` - Tensor census: 163 tensors (`BF16`: 98, `F32`: 65) - Graph fingerprint: `4bb91bade19d41559cb524e28692453851fe67274cc58109787ee968df3e0fe5` - Final runtime-package fingerprint: `97582549e9c5b4114f3bcfa81c92f16aba9d14dd0ea0d2b20acaefd9060e6486` The real-artifact test invokes runtime packaging without tokenizer source flags and proves automatic evidence-pinned materialization, full-logit prefill, fresh and cached decode parity, full-sequence replay, rollback, batch reorder, 20 exact greedy decode steps, deterministic ORT GenAI generation, tokenizer vocabulary/special-token/chat-template identity, graph/config/package fingerprints, package/report roundtrip, complete validated export reporting, and fail-closed artifact/source/tokenizer/runtime mismatches. Observed prefill max absolute difference was `0.00016784668`; cached-vs-fresh differences remained below `4e-5`. ## Truthful support boundary `source_fidelity=true` because BF16 values are exactly representable after import to float32. `storage_quantized=false` because the emitted ONNX package stores float tensors. Runtime support is evidence-gated to this exact artifact, official tokenizer revision, CPU import route, ONNX Runtime 1.29.0, and ORT GenAI 0.15.2. Other Apertus artifacts retain the generic best-effort advisory behavior and cannot inherit this evidence. This does not claim a generic independent Tekken tokenizer promotion, preserved-quantized runtime, CUDA, or other runtime versions. No Apertus model-ID/revision production gate was added, and the #675 source/import-route identity remains intact. ## Validation - Flag-free immutable Apertus runtime probe — 1 passed, 13 deselected; an initial successful run hit an intermittent ORT GenAI process-exit mutex error, and the clean replay passed with exit 0 - Focused Apertus/runtime-evidence/runtime-package/tokenizer/docs/census/schema tests — 436 passed - `python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k 'not phi4mm and not apply_weights_unknown' --tb=short` — 9,675 passed, 64 skipped, 12 deselected, 1 subtest passed - Exact evidence unit coverage: no tokenizer flags succeeds; matching explicit flags succeeds; wrong repository/revision conflicts before save; unmatched artifact does not auto-materialize - `lintrunner f --output oneline --all-files && lintrunner -a` — clean - `python scripts/generate_gguf_support_docs.py --check` — current - Focused mypy — clean - Final independent medium review found one legacy-case assertion-scope issue; it was fixed, and the follow-up review found no issues. - Both existing GitHub review threads were answered and resolved before the final push. ## Waivers - Preserved-quantized runtime: not claimed; representative evidence is BF16 imported exactly into float storage. - CUDA, Foundry Local, and Olive probes: outside this CPU ORT GenAI evidence promotion and not claimed. - Separate L4/L5 golden files: waived in favor of the immutable real-artifact harness, which asserts full logits and all 20 generated token IDs rather than prefix-only output. Semantically rebased and validated at exact base `2c981f2b631a907f43c57d3235647c22cc888eae`; exact head `256c2b15f17ec327634ef5cae1d1e902a07f5309`. Do not merge as part of this task. --------- Signed-off-by: Justin Chu <[email protected]> Copilot-Session: 75ccb9e3-3ba3-4bee-b5ff-c395a88af1ca
1 parent 2c981f2 commit 40c8469

16 files changed

Lines changed: 515 additions & 76 deletions

‎docs/api/build_from_gguf.md‎

Lines changed: 4 additions & 3 deletions
Large diffs are not rendered by default.

‎src/mobius/integrations/gguf/_apertus_test.py‎

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def test_apertus_registry_promotes_exact_float_and_quantized_graph_import() -> N
110110
assert spec.tensor_map_recipe == ("llama", "apertus_extras")
111111
assert spec.config_postprocessor == "apertus"
112112
assert spec.quantized_import.value == "supported"
113-
assert spec.runtime.value == "deferred"
113+
assert spec.runtime.value == "supported"
114+
assert spec.runtime_evidence_ids == ("apertus-v1.1-1.5b-instruct-bf16-ort-genai-0.15.2",)
114115

115116

116117
def test_apertus_consumes_serialized_rope_and_xielu_values_exactly() -> None:
@@ -132,6 +133,42 @@ def test_apertus_consumes_serialized_rope_and_xielu_values_exactly() -> None:
132133
assert config.attn_o_bias
133134

134135

136+
def test_apertus_accepts_generic_xielu_metadata_and_default_rope() -> None:
137+
metadata = _metadata()
138+
for suffix in ("alpha_p", "alpha_n", "beta", "eps"):
139+
metadata[f"xielu.{suffix}"] = metadata.pop(f"apertus.xielu.{suffix}")
140+
tensors = _tensors()
141+
tensors.pop("rope_freqs.weight")
142+
143+
config = gguf_to_config(_FakeGGUF(metadata, tensors))
144+
145+
assert config.rope_type == "default"
146+
assert config.rope_scaling is None
147+
assert config.xielu_alpha_p == (-0.2, -0.1)
148+
assert config.xielu_alpha_n == (-1.0, -0.9)
149+
150+
151+
def test_apertus_rejects_conflicting_xielu_metadata_or_unserialized_rope_scaling() -> None:
152+
metadata = _metadata()
153+
metadata["xielu.beta"] = 0.25
154+
with pytest.raises(ValueError, match=r"conflicting apertus\.xielu\.beta and xielu\.beta"):
155+
gguf_to_config(_FakeGGUF(metadata, _tensors()))
156+
157+
metadata = _metadata()
158+
metadata["apertus.rope.scaling.type"] = "longrope"
159+
tensors = _tensors()
160+
tensors.pop("rope_freqs.weight")
161+
with pytest.raises(ValueError, match="factorless RoPE"):
162+
gguf_to_config(_FakeGGUF(metadata, tensors))
163+
164+
metadata = _metadata()
165+
metadata["apertus.rope.scaling.original_context_length"] = 16
166+
tensors = _tensors()
167+
tensors.pop("rope_freqs.weight")
168+
with pytest.raises(ValueError, match="original_context_length requires"):
169+
gguf_to_config(_FakeGGUF(metadata, tensors))
170+
171+
135172
def test_apertus_maps_qk_norm_and_output_bias_without_value_transform() -> None:
136173
assert (
137174
map_gguf_to_hf_names("blk.1.attn_q_norm.bias", "apertus")
@@ -164,6 +201,11 @@ def test_apertus_rejects_quantized_or_malformed_serialized_rope_factors() -> Non
164201
with pytest.raises(ValueError, match=r"shape \(2,\)"):
165202
gguf_to_config(_FakeGGUF(_metadata(), tensors))
166203

204+
tensors = _tensors()
205+
tensors["rope_factors_short.weight"] = np.ones((2,), np.float32)
206+
with pytest.raises(ValueError, match="must contain exactly"):
207+
gguf_to_config(_FakeGGUF(_metadata(), tensors))
208+
167209

168210
def test_apertus_consumes_complete_longrope_factor_pair_exactly() -> None:
169211
tensors = _tensors()

‎src/mobius/integrations/gguf/_arch_registry.py‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,15 +2258,14 @@
22582258
model_type="apertus",
22592259
tensor_map_recipe=("llama", "apertus_extras"),
22602260
config_postprocessor="apertus",
2261-
required_metadata=(
2262-
"attention.layer_norm_rms_epsilon",
2263-
"xielu.alpha_n",
2264-
"xielu.alpha_p",
2265-
"xielu.beta",
2266-
"xielu.eps",
2261+
required_metadata=("attention.layer_norm_rms_epsilon",),
2262+
runtime=Support.SUPPORTED,
2263+
runtime_evidence_ids=("apertus-v1.1-1.5b-instruct-bf16-ort-genai-0.15.2",),
2264+
reason=(
2265+
"Runtime support is restricted to the pinned Apertus-v1.1-1.5B-Instruct "
2266+
"BF16 artifact's exact-float CPU route, official tokenizer revision, full-logit "
2267+
"stateful evidence, and ORT GenAI 0.15.2."
22672268
),
2268-
runtime=Support.DEFERRED,
2269-
reason=_RUNTIME_VALIDATION_PENDING,
22702269
),
22712270
GGUFArchitectureSpec(
22722271
gguf_arch="minicpm",

‎src/mobius/integrations/gguf/_component_export.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ def attach_runtime_unvalidated_report(
248248
else None
249249
)
250250
tokenizer_verdict = getattr(pkg, "gguf_tokenizer_verdict", None)
251-
if tokenizer is None:
251+
if tokenizer is None or (
252+
tokenizer_exported
253+
and (tokenizer.support != "supported" or tokenizer.output != "exported")
254+
):
252255
if tokenizer_verdict is None:
253256
raise ValueError(
254257
"Runtime-unvalidated packaging requires the tokenizer disposition captured "

‎src/mobius/integrations/gguf/_config_mapping.py‎

Lines changed: 71 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ def _validate_closed_rope_scaling_metadata(
473473
arch: str,
474474
*,
475475
allowed_suffixes: set[str] | None = None,
476+
allowed_types: set[str] | None = None,
476477
) -> None:
477478
"""Reject RoPE-scaling metadata outside an architecture's exact subset."""
478479
allowed = {f"{arch}.rope.scaling.{suffix}" for suffix in (allowed_suffixes or set())}
@@ -495,7 +496,8 @@ def _validate_closed_rope_scaling_metadata(
495496
f"{arch} has unsupported RoPE scaling metadata: {', '.join(sorted(unsupported))}"
496497
)
497498
scaling_type = metadata.get(f"{arch}.rope.scaling.type")
498-
if "type" in (allowed_suffixes or set()) and scaling_type not in (None, "", "none"):
499+
accepted_types = {None, "", "none", *(allowed_types or set())}
500+
if "type" in (allowed_suffixes or set()) and scaling_type not in accepted_types:
499501
raise ValueError(
500502
f"{arch} rope.scaling.type={scaling_type!r} is not in the exact supported subset"
501503
)
@@ -1415,7 +1417,24 @@ def _apertus_postprocess(
14151417
layers = config.num_hidden_layers
14161418

14171419
def per_layer(suffix: str) -> tuple[float, ...]:
1418-
raw = metadata[f"{arch}.xielu.{suffix}"]
1420+
qualified = f"{arch}.xielu.{suffix}"
1421+
generic = f"xielu.{suffix}"
1422+
if qualified in metadata and generic in metadata:
1423+
if not np.array_equal(
1424+
np.asarray(metadata[qualified]), np.asarray(metadata[generic])
1425+
):
1426+
raise ValueError(
1427+
f"GGUF architecture {arch!r} has conflicting {qualified} and {generic}"
1428+
)
1429+
raw = metadata[qualified]
1430+
elif qualified in metadata:
1431+
raw = metadata[qualified]
1432+
elif generic in metadata:
1433+
raw = metadata[generic]
1434+
else:
1435+
raise ValueError(
1436+
f"GGUF architecture {arch!r} is missing required metadata: xielu.{suffix}"
1437+
)
14191438
values = list(raw) if isinstance(raw, (list, tuple, np.ndarray)) else [raw] * layers
14201439
if len(values) != layers:
14211440
raise ValueError(
@@ -1440,15 +1459,36 @@ def per_layer(suffix: str) -> tuple[float, ...]:
14401459
}
14411460
if any(type_id not in {0, 1, 30} for type_id in raw_types.values()):
14421461
raise ValueError("Apertus serialized RoPE factors must use F32/F16/BF16 storage")
1462+
_validate_closed_rope_scaling_metadata(
1463+
metadata,
1464+
arch,
1465+
allowed_suffixes={"original_context_length", "type"},
1466+
allowed_types={"longrope"},
1467+
)
1468+
scaling_type = metadata.get(f"{arch}.rope.scaling.type")
1469+
original_context_key = f"{arch}.rope.scaling.original_context_length"
1470+
factor_pair = {"rope_factors_long.weight", "rope_factors_short.weight"}
1471+
if original_context_key in metadata and rope_names != factor_pair:
1472+
raise ValueError(
1473+
"Apertus rope.scaling.original_context_length requires the complete "
1474+
"rope_factors_long.weight/rope_factors_short.weight pair"
1475+
)
14431476

1444-
if rope_names == {"rope_freqs.weight"}:
1477+
if not rope_names:
1478+
if scaling_type not in {None, "", "none"}:
1479+
raise ValueError(
1480+
"Apertus factorless RoPE requires rope.scaling.type to be absent or 'none'"
1481+
)
1482+
short_factors = long_factors = None
1483+
original_context = config.max_position_embeddings
1484+
elif rope_names == {"rope_freqs.weight"}:
14451485
factors = np.asarray(model.get_tensor("rope_freqs.weight"), dtype=np.float32).reshape(
14461486
-1
14471487
)
14481488
short_factors = long_factors = factors
14491489
original_context = config.max_position_embeddings
1450-
elif rope_names == {"rope_factors_long.weight", "rope_factors_short.weight"}:
1451-
original_context_raw = metadata.get(f"{arch}.rope.scaling.original_context_length")
1490+
elif rope_names == factor_pair:
1491+
original_context_raw = metadata.get(original_context_key)
14521492
if original_context_raw is None:
14531493
raise ValueError(
14541494
"Apertus LongRoPE factors require apertus.rope.scaling.original_context_length"
@@ -1470,18 +1510,24 @@ def per_layer(suffix: str) -> tuple[float, ...]:
14701510
"Apertus GGUF must contain exactly rope_freqs.weight or the complete "
14711511
"rope_factors_long.weight/rope_factors_short.weight pair"
14721512
)
1513+
if rope_names and scaling_type not in {None, "", "none", "longrope"}:
1514+
raise ValueError(
1515+
"Apertus serialized RoPE factors require rope.scaling.type to be absent, "
1516+
"'none', or 'longrope'"
1517+
)
14731518

1474-
expected = config.head_dim // 2
1475-
for name, factors in (("short", short_factors), ("long", long_factors)):
1476-
if (
1477-
factors.shape != (expected,)
1478-
or not np.all(np.isfinite(factors))
1479-
or np.any(factors <= 0)
1480-
):
1481-
raise ValueError(
1482-
f"Apertus {name} RoPE factors must have shape ({expected},) and be "
1483-
"finite positive values"
1484-
)
1519+
if short_factors is not None and long_factors is not None:
1520+
expected = config.head_dim // 2
1521+
for name, factors in (("short", short_factors), ("long", long_factors)):
1522+
if (
1523+
factors.shape != (expected,)
1524+
or not np.all(np.isfinite(factors))
1525+
or np.any(factors <= 0)
1526+
):
1527+
raise ValueError(
1528+
f"Apertus {name} RoPE factors must have shape ({expected},) and be "
1529+
"finite positive values"
1530+
)
14851531

14861532
q_biases = tuple(f"blk.{layer}.attn_q_norm.bias" in names for layer in range(layers))
14871533
k_biases = tuple(f"blk.{layer}.attn_k_norm.bias" in names for layer in range(layers))
@@ -1491,11 +1537,15 @@ def per_layer(suffix: str) -> tuple[float, ...]:
14911537
attn_qk_norm=True,
14921538
attn_q_norm_biases=q_biases,
14931539
attn_k_norm_biases=k_biases,
1494-
rope_type="longrope",
1495-
rope_scaling={
1496-
"short_factor": short_factors.tolist(),
1497-
"long_factor": long_factors.tolist(),
1498-
},
1540+
rope_type="default" if short_factors is None else "longrope",
1541+
rope_scaling=(
1542+
None
1543+
if short_factors is None or long_factors is None
1544+
else {
1545+
"short_factor": short_factors.tolist(),
1546+
"long_factor": long_factors.tolist(),
1547+
}
1548+
),
14991549
original_max_position_embeddings=original_context,
15001550
xielu_alpha_p=per_layer("alpha_p"),
15011551
xielu_alpha_n=per_layer("alpha_n"),

‎src/mobius/integrations/gguf/_docs_test.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ def test_runtime_support_requires_structured_evidence() -> None:
147147
("gpt2", ("gpt2-q2-k-ort-genai-0.15.2",)),
148148
("starcoder2", ("tiny-starcoder2-q2-k-ort-genai-0.15.2",)),
149149
("olmo", ("tiny-olmo-q2-k-ort-genai-0.15.2",)),
150+
(
151+
"apertus",
152+
("apertus-v1.1-1.5b-instruct-bf16-ort-genai-0.15.2",),
153+
),
150154
("mpt", ("tiny-mpt-q2-k-ort-genai-0.15.2",)),
151155
("gptneox", ("pythia-70m-q2-k-ort-genai-0.15.2",)),
152156
("starcoder", ("tiny-starcoder-q2-k-ort-genai-0.15.2",)),

‎src/mobius/integrations/gguf/_quant_capabilities_test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ def test_selected_real_artifacts_stay_within_global_budget() -> None:
203203
assert isinstance(policy, dict)
204204
assert isinstance(artifacts, list)
205205
assert isinstance(lossy, list)
206-
assert len(artifacts) == 10
206+
assert len(artifacts) == 11
207207
assert len(lossy) == 1
208208
selected = sum(int(record["size"]) for record in [*artifacts, *lossy])
209-
assert selected == 2_724_371_296
209+
assert selected == 5_752_423_904
210210
assert selected == policy["selected_artifact_bytes"]
211211
assert selected <= policy["max_selected_artifact_bytes"]
212212
assert lossy[0]["lfs_sha256"] == (

‎src/mobius/integrations/gguf/_route_census_test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def test_every_route_has_one_actionable_classification() -> None:
5454
assert {item.category for item in items} == allowed
5555
assert all(item.batch and item.dependencies and item.reason.strip() for item in items)
5656
assert Counter(item.kind for item in items) == {
57-
"architecture": 136,
57+
"architecture": 135,
5858
"projector": 60,
5959
"tokenizer": 56,
6060
"mtp": 22,
6161
}
6262
assert Counter(item.category for item in items) == {
6363
"dependency-or-mobius-abi-blocked": 99,
64-
"evidence-only": 151,
64+
"evidence-only": 150,
6565
"intentionally-rejected": 19,
6666
"artifact-unavailable": 5,
6767
}

‎src/mobius/integrations/gguf/_runtime_evidence.py‎

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,71 @@ def _is_hex(value: str) -> bool:
534534
"dynamic KV cache prefill, full-sequence replay, rollback, reorder, and 20 decode steps"
535535
)
536536

537+
_APERTUS_15B_BF16_ORT_GENAI = GGUFRuntimeEvidence(
538+
evidence_id="apertus-v1.1-1.5b-instruct-bf16-ort-genai-0.15.2",
539+
architecture="apertus",
540+
repository="MrMeOrYou/Apertus-v1.1-1.5B-Instruct-GGUF",
541+
revision="88c75ad49566d3c2157d03709bf772262c3241ed",
542+
filename="Apertus-v1.1-1.5B-Instruct-BF16.gguf",
543+
size=3_028_052_608,
544+
lfs_sha256="f9ec154d0ec29dad1f6465b458b7f27bd25ad7b9a3899233ae98ca6d358501c2",
545+
config_repository="swiss-ai/Apertus-v1.1-1.5B-Instruct",
546+
config_revision="9e9d01154446a645d30f04174cf1515a38058be7",
547+
tokenizer_repository="swiss-ai/Apertus-v1.1-1.5B-Instruct",
548+
tokenizer_revision="9e9d01154446a645d30f04174cf1515a38058be7",
549+
tokenizer_metadata_sha256=(
550+
"3097bd9f22efd32db9045c4705d978539dc8adeeae763324062a5e1a73fc24a5"
551+
),
552+
tokenizer_assets=(
553+
(
554+
"chat_template.jinja",
555+
5_250,
556+
"4afab8361a4bd0c2994404e0b0851dbaad461a06e56bdfdb635aae3977473c19",
557+
),
558+
(
559+
"special_tokens_map.json",
560+
560,
561+
"9f69883bd70fc5d8b55822799837a216d3ac4fb565e05256a0d4f9850404bbc5",
562+
),
563+
(
564+
"tokenizer.json",
565+
17_078_368,
566+
"be12f4375d655cc740864e3a9041bcddd8477942f209d9e7f27f6c8767162638",
567+
),
568+
(
569+
"tokenizer_config.json",
570+
177_274,
571+
"77b14a0664585c26065f07d7a4c852a4615c83348d9378e23def01957bbd3f57",
572+
),
573+
),
574+
tensor_count=163,
575+
tensor_qtypes=(("BF16", 98), ("F32", 65)),
576+
import_route='{"architecture":"apertus","config_sha256":"2a9660c48656c0980e76f1b374262bf8383256603e8b4221aa99bcfa11c510b0","execution_provider":"cpu","model_type":"apertus","module_type":"apertus","preserve_quantization":false,"registry_import":{"config_key_map":null,"config_postprocessor":"apertus","llama_qk_permute":false,"offset_norm":false,"required_metadata":["attention.layer_norm_rms_epsilon"],"rope_interleave":false,"tensor_processor":null,"v_head_reorder":false,"vlm_builder":null},"route_schema":1,"static_cache":false,"task":{"class":"builtins.str","state":"text-generation"},"tensor_map_recipe":["llama","apertus_extras"]}',
577+
source_fidelity=True,
578+
storage_quantized=False,
579+
target_storage_format="float",
580+
compute_mode="float operators",
581+
graph_files=_LOW_COST_GRAPH_FILES,
582+
graph_sha256="4bb91bade19d41559cb524e28692453851fe67274cc58109787ee968df3e0fe5",
583+
runtime_package_files=(
584+
"chat_template.jinja",
585+
"export_report.json",
586+
*_LOW_COST_RUNTIME_PACKAGE_FILES,
587+
),
588+
runtime_package_sha256="97582549e9c5b4114f3bcfa81c92f16aba9d14dd0ea0d2b20acaefd9060e6486",
589+
parity_test=("test_promoted_gguf_full_runtime_evidence[apertus-v1.1-1.5b-instruct-bf16]"),
590+
parity_kind="full-logit",
591+
deterministic_test=(
592+
"test_promoted_gguf_full_runtime_evidence[apertus-v1.1-1.5b-instruct-bf16]"
593+
),
594+
stateful_semantics=_LOW_COST_STATEFUL_SEMANTICS,
595+
execution_provider="CPUExecutionProvider",
596+
onnxruntime_version="1.29.0",
597+
runtime="ort-genai",
598+
runtime_version="0.15.2",
599+
runtime_package_schema=FINAL_RUNTIME_PACKAGE_SCHEMA,
600+
)
601+
537602
_GPT2_Q2_K_ORT_GENAI = GGUFRuntimeEvidence(
538603
evidence_id="gpt2-q2-k-ort-genai-0.15.2",
539604
architecture="gpt2",
@@ -863,6 +928,7 @@ def _is_hex(value: str) -> bool:
863928
{
864929
record.evidence_id: record
865930
for record in (
931+
_APERTUS_15B_BF16_ORT_GENAI,
866932
_LFM2_350M_F16_ORT_GENAI,
867933
_QWEN25_Q8_ORT_GENAI,
868934
_QWEN35MOE_087B_Q2_K_ORT_GENAI,
@@ -993,12 +1059,7 @@ def find_matching_runtime_evidence(
9931059
"The GGUF source no longer matches the exact artifact identity captured during "
9941060
f"graph construction: built={built_identity!r}, current={current_identity!r}."
9951061
)
996-
if (
997-
not evidence_ids
998-
or runtime_version is None
999-
or tokenizer_repository is None
1000-
or tokenizer_revision is None
1001-
):
1062+
if not evidence_ids or runtime_version is None:
10021063
return None
10031064
identity = built_identity
10041065
candidates = [
@@ -1014,8 +1075,14 @@ def find_matching_runtime_evidence(
10141075
and _RUNTIME_EVIDENCE[evidence_id].tensor_count == identity.tensor_count
10151076
and _RUNTIME_EVIDENCE[evidence_id].tensor_qtypes == identity.tensor_qtypes
10161077
and _RUNTIME_EVIDENCE[evidence_id].import_route == import_route
1017-
and _RUNTIME_EVIDENCE[evidence_id].tokenizer_repository == tokenizer_repository
1018-
and _RUNTIME_EVIDENCE[evidence_id].tokenizer_revision == tokenizer_revision
1078+
and (
1079+
tokenizer_repository is None
1080+
or _RUNTIME_EVIDENCE[evidence_id].tokenizer_repository == tokenizer_repository
1081+
)
1082+
and (
1083+
tokenizer_revision is None
1084+
or _RUNTIME_EVIDENCE[evidence_id].tokenizer_revision == tokenizer_revision
1085+
)
10191086
]
10201087
if len(candidates) > 1:
10211088
raise RuntimeError(

0 commit comments

Comments
 (0)