Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ if(ONEBIT_LAYA_ROUTE_MODEL)
add_test(NAME laya_route_e2e COMMAND ${CMAKE_SOURCE_DIR}/tests/laya_route_e2e.sh $<TARGET_FILE:onebit> ${ONEBIT_LAYA_ROUTE_MODEL})
endif()

# The registry against the reviewed not-an-alias list (docs/arch-gaps.md): no pins or network.
find_package(Python3 COMPONENTS Interpreter)
if(Python3_Interpreter_FOUND)
add_test(NAME registry_gaps COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/registry_build.py --check-gaps)
endif()

add_executable(npu_full_elf_test tests/npu_full_elf_test.cpp)
target_link_libraries(npu_full_elf_test PRIVATE onebit_npu)
add_test(NAME npu_full_elf_md5 COMMAND npu_full_elf_test)
Expand Down
322 changes: 322 additions & 0 deletions docs/arch-gaps.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ hand:

At the current pins: 265 HF architectures, vulkan 265, hrx 246, zinc 44, npu 1.

**Reviewed gaps.** Some unmapped architectures only look like a supported family. [Architecture gaps](arch-gaps.md) records why each of them is not an alias. `registry/significant.json` lists those classes, and `tools/registry_build.py --check-gaps` (ctest `registry_gaps`) fails if one becomes mapped without a recorded reason.

## Checked models

`tools/registry_check.py <1bit> --models <dir>` runs `tests/serve_e2e.sh` for every row of
Expand Down
49 changes: 49 additions & 0 deletions registry/significant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"about": "HF architecture classes reviewed as NOT aliases of a supported family (docs/arch-gaps.md). tools/registry_build.py --check-gaps fails if one becomes mapped without a 'mapped_ok' reason.",
"classes": {
"DeepseekV41ForCausalLM": {
"model_type": "deepseek_v41",
"family": "DeepSeek V4.1"
},
"Qwen3Mamba3ForCausalLM": {
"model_type": "qwen3_mamba3",
"family": "Qwen3 + Mamba-3 hybrid"
},
"MolmoAct2ForConditionalGeneration": {
"model_type": "molmoact2",
"family": "MolmoAct2, vision-language-action"
},
"Cosmos3EdgeForConditionalGeneration": {
"model_type": "cosmos3_edge",
"family": "Cosmos3-Edge, video world model"
},
"QwenDriveForPlanning": {
"model_type": "qwen_drive",
"family": "Qwen-Drive, driving planner"
},
"EnglishBaseForCausalLM": {
"model_type": "fabryka_english_base",
"family": "relu2 MLP + parameter-free QK-norm (implemented in the old engine only)"
},
"GDN2ForCausalLM": {
"model_type": "gdn2",
"family": "GDN2 hybrid (fla config)"
},
"HaikuForCausalLM": {
"model_type": "haiku",
"family": "Haiku"
},
"VaporForCausalLM": {
"model_type": "vapor",
"family": "Vapor (lfm2-shaped config, different tensors)"
},
"FidelForCausalLM": {
"model_type": "fidel",
"family": "Mamba/MoE hybrid"
},
"Zarya": {
"model_type": "zarya",
"family": "Zarya, diffusion LM sampler"
}
}
}
26 changes: 26 additions & 0 deletions tools/registry_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,38 @@ def build():
}


def gap_violations(registry):
"""Classes reviewed as not aliases (registry/significant.json, docs/arch-gaps.md) that the
registry maps without a recorded reason ('mapped_ok'): each needs a person's look."""
sig = json.load(open(os.path.join(ROOT, "registry/significant.json")))["classes"]
mapped = registry["architectures"]
return [(cls, mapped[cls]) for cls, e in sig.items() if cls in mapped and not e.get("mapped_ok")]


def report_gaps(registry):
bad = gap_violations(registry)
for cls, m in bad:
print(f"{cls} is mapped (gguf {m['gguf']}, {', '.join(m['backends'])}) but docs/arch-gaps.md reviewed it as "
f"not an alias: check that the pinned backend really implements it, then record why in "
f"registry/significant.json ('mapped_ok')")
return bad


def main():
ap = argparse.ArgumentParser()
ap.add_argument("--out", default=os.path.join(ROOT, "registry/architectures.json"))
ap.add_argument("--check", action="store_true")
ap.add_argument("--check-gaps", action="store_true",
help="only check the committed registry against registry/significant.json (no pins needed)")
a = ap.parse_args()
if a.check_gaps:
bad = report_gaps(json.load(open(a.out)))
if not bad:
n = len(json.load(open(os.path.join(ROOT, "registry/significant.json")))["classes"])
print(f"none of the {n} reviewed significant classes is mapped without a reason")
return 1 if bad else 0
text = json.dumps(build(), indent=1, sort_keys=False) + "\n"
report_gaps(json.loads(text))
if a.check:
old = open(a.out).read() if os.path.exists(a.out) else ""
if old != text:
Expand Down
2 changes: 1 addition & 1 deletion tools/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
("Start", [("serve", "1bit serve"), ("lemonade", "Lemonade")]),
("Devices", [("npu", "NPU"), ("hrx", "HRX + Vulkan"), ("vulkan", "Vulkan (upstream)"), ("lean", "Lean (ROCmFP4, ROCmI4)"),
("zinc", "ZINC"), ("apple", "Apple Silicon")]),
("Components", [("moe-streaming", "MoE streaming"), ("laya", "Laya router"), ("registry", "Model registry"), ("comfyui", "ComfyUI.cpp"), ("tokenizers", "Tokenizers"), ("kernel", "Linux kernel")]),
("Components", [("moe-streaming", "MoE streaming"), ("laya", "Laya router"), ("registry", "Model registry"), ("arch-gaps", "Architecture gaps"), ("comfyui", "ComfyUI.cpp"), ("tokenizers", "Tokenizers"), ("kernel", "Linux kernel")]),
("Project", [("PORTING", "Porting map")]),
]

Expand Down
Loading