Skip to content
Open
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
58 changes: 46 additions & 12 deletions .github/ci/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@
},
{
"address": "0x02000000",
"paths": ["yolo/weights_region.bin"],
"paths": [
"yolo/weights_region.bin"
],
"required": true
},
{
"address": "0x04A00000",
"paths": ["yolo/coco_room_000139_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_room_000139_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand All @@ -122,15 +126,21 @@
"image_count": 5,
"min_image_count": 5,
"reference_contract": ".github/ci/reference/yolo.json",
"source_shape": [480, 640, 3]
"source_shape": [
480,
640,
3
]
},
"benchmark_cases": [
{
"name": "coco_room_000139",
"file_loads": [
{
"address": "0x04A00000",
"paths": ["yolo/coco_room_000139_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_room_000139_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand All @@ -146,7 +156,9 @@
"file_loads": [
{
"address": "0x04A00000",
"paths": ["yolo/coco_cat_524280_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_cat_524280_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand All @@ -162,7 +174,9 @@
"file_loads": [
{
"address": "0x04A00000",
"paths": ["yolo/coco_giraffes_296969_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_giraffes_296969_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand All @@ -178,7 +192,9 @@
"file_loads": [
{
"address": "0x04A00000",
"paths": ["yolo/coco_elephants_445248_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_elephants_445248_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand All @@ -194,7 +210,9 @@
"file_loads": [
{
"address": "0x04A00000",
"paths": ["yolo/coco_baseball_043816_raw_480x640x3_uint8_rgb.bin"],
"paths": [
"yolo/coco_baseball_043816_raw_480x640x3_uint8_rgb.bin"
],
"required": true
}
],
Expand Down Expand Up @@ -234,17 +252,24 @@
"file_loads": [
{
"address": "0x0",
"paths": ["zero2m.bin", "common/zero2m.bin"],
"paths": [
"zero2m.bin",
"common/zero2m.bin"
],
"required": true
},
{
"address": "0x2000",
"paths": ["dncnn/dncnn20l64_input.bin"],
"paths": [
"dncnn/dncnn20l64_input.bin"
],
"required": true
},
{
"address": "0x14000",
"paths": ["dncnn/dncnn20l64_weights.bin"],
"paths": [
"dncnn/dncnn20l64_weights.bin"
],
"required": true
}
],
Expand All @@ -253,7 +278,10 @@
"accuracy": {
"kind": "uint8_npy",
"offset": "0x10000",
"shape": [64, 64],
"shape": [
64,
64
],
"max_abs": 2,
"reference_path": "ported_models/dncnn/refs/dncnn20l64_reference.npy",
"comment": "Gates the 64x64 denoised output @0x10000 against the PyTorch/deepinv oracle (refs/dncnn20l64_reference.npy, produced by scripts/gen_dncnn_oracle.py running deepinv.models.DnCNN on the pinned weights). Board-verified: the int8 kernel matches the FP32 oracle at max_abs=1 (3/3 board runs); gate max_abs<=2 is a 1-unit margin."
Expand Down Expand Up @@ -315,6 +343,12 @@
},
"smolvlm_500m": {
"config": "ported_models/llama_cpp_et/benchmarks/smolvlm_500m.json"
},
"phi3_mini": {
"config": "ported_models/llama_cpp_et/benchmarks/phi3_mini.json"
},
"minicpm3_4b": {
"config": "ported_models/llama_cpp_et/benchmarks/minicpm3_4b.json"
}
}
}
66 changes: 66 additions & 0 deletions ported_models/bitnet_2b/docs/RECIPE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# BitNet-b1.58-2B-4T -- Negative Result

## Summary

Attempted to add `microsoft/bitnet-b1.58-2B-4T` (2B-parameter, native
1.58-bit ternary weight causal LM) to the `llama.cpp-et` framework. **Does
not load with this repo's vendored `llama.cpp-et` submodule.** No
model-ports claim is filed for this model; this recipe documents the
failure rather than a working port.

## Model Reference

- **Source**: `microsoft/bitnet-b1.58-2B-4T` (Hugging Face), revision
`04c3b9ad9361b824064a1f25ea60a8be9599b127`
- **License**: MIT
- **GGUF source**: `microsoft/bitnet-b1.58-2B-4T-gguf` (official), file
`ggml-model-i2_s.gguf`,
`sha256=4221b252fdd5fd25e15847adfeb5ee88886506ba50b8a34548374492884c2162`
(verified locally against the downloaded file)
- GGUF metadata (read via a minimal custom KV-only parser, since the
installed `gguf` PyPI package's tensor-dtype enum doesn't recognize this
file's dtype either): `general.architecture = bitnet-b1.58`, 332 tensors.

## Root cause: confirmed, not speculative

Built a plain CPU-only (`GGML_ET=OFF`) configuration of the exact vendored
`llama.cpp-et` source in this repo and tried to load the file with
`llama-perplexity`. It fails at model load, before any ET-specific code
runs at all:

```
gguf_init_from_file_impl: tensor 'blk.0.ffn_down.weight' of type 36
(TYPE_IQ4_NL_4_4 REMOVED, use IQ4_NL with runtime repacking) has 6912
elements per row, not a multiple of block size (0)
gguf_init_from_file_impl: failed to read tensor info
llama_model_load: error loading model: llama_model_loader: failed to load
model from ggml-model-i2_s.gguf
```

This repo's vendored `llama.cpp-et` fork is from a point in llama.cpp's
history where GGML tensor-type id 36 was `TYPE_IQ4_NL_4_4`, since removed
upstream. BitNet's official GGUF export uses type id 36 for its native
`i2_s` ternary format. The two collide: this fork's tensor-type enum
interprets BitNet's ternary tensors as a stale, incompatible legacy type,
and rejects the file outright at the format-parsing stage -- before
reaching any question of whether the ET backend's `MUL_MAT` could handle
ternary matmul.

## Why no claim is filed

The port genuinely does not run, on CPU or otherwise, with this repo's
current vendored source. Filing a model-ports claim for something that
doesn't load would be exactly the kind of unsubstantiated submission this
process is meant to prevent. This is the same category as this campaign's
other documented negative results (RWKV-6, PLaMo-2 -- both blocked on
missing `GGML_OP_CPY` support) -- a real, reproducible incompatibility,
not a hedge or a "maybe."

## What would need to change

Either this repo's vendored `llama.cpp-et` needs to be updated past the
point where type id 36 was reused for ternary support (a submodule bump,
out of scope for a model-port PR), or BitNet's GGUF would need
re-exporting against an older, non-conflicting tensor-type scheme (not
attempted -- would change the model's actual on-disk representation, not
just add board wiring).
36 changes: 36 additions & 0 deletions ported_models/llama_cpp_et/artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,42 @@
"sha256": "d1eb8b6b23979205fdf63703ed10f788131a3f812c7b1f72e0119d5d81295150",
"size_bytes": 108783360,
"note": "SmolVLM 500M vision projector (SigLIP ~93M + MLP). Q8_0 quantized. Must be loaded alongside smolvlm_500m_q8_gguf."
},
"phi3_mini_q4_gguf": {
"kind": "model",
"framework": "llama.cpp-et",
"variant": "Phi-3-mini-4k-instruct-q4",
"filename": "Phi-3-mini-4k-instruct-q4.gguf",
"env": "PHI3_MINI_MODEL_PATH",
"source": {
"type": "huggingface",
"repo": "microsoft/Phi-3-mini-4k-instruct-gguf",
"revision": "main",
"filename": "Phi-3-mini-4k-instruct-q4.gguf",
"url": "https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi-3-mini-4k-instruct-q4.gguf"
},
"sha256": "8a83c7fb9049a9b2e92266fa7ad04933bb53aa1e85136b7b30f1b8000ff2edef",
"size": 2393231072,
"local_cache": "local-artifacts/models/Phi-3-mini-4k-instruct-q4.gguf",
"board_path": "/data/models/Phi-3-mini-4k-instruct-q4.gguf"
},
"minicpm3_4b_q8_gguf": {
"kind": "model",
"framework": "llama.cpp-et",
"variant": "MiniCPM3-4B-Q8_0",
"filename": "MiniCPM3-4B-Q8_0.gguf",
"env": "MINICPM3_4B_MODEL_PATH",
"source": {
"type": "huggingface",
"repo": "QuantFactory/MiniCPM3-4B-GGUF",
"revision": "main",
"filename": "MiniCPM3-4B.Q8_0.gguf",
"url": "https://huggingface.co/QuantFactory/MiniCPM3-4B-GGUF/resolve/main/MiniCPM3-4B.Q8_0.gguf"
},
"sha256": "a540961f131d6ab9616b6cb1c266be86735afe84907a445ad68e1e3e9422d122",
"size": 4331349440,
"local_cache": "local-artifacts/models/MiniCPM3-4B-Q8_0.gguf",
"board_path": "/data/models/MiniCPM3-4B-Q8_0.gguf"
}
}
}
52 changes: 52 additions & 0 deletions ported_models/llama_cpp_et/benchmarks/minicpm3_4b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"runner": "llama_server",
"board": true,
"framework": {
"name": "llama.cpp-et",
"runner": "llama_server",
"source_artifact": "llama_cpp_source"
},
"artifacts_file": "../artifacts.json",
"canonical_variant": "MiniCPM3-4B-Q8_0",
"score": {
"metric": "tokens_per_second",
"label": "Decode tokens/s",
"higher_is_better": true
},
"llama_server": {
"source_artifact": "llama_cpp_source",
"model_artifact": "minicpm3_4b_q8_gguf",
"server_artifact": "llama_server",
"workdir_artifact": "llama_cpp_build",
"host": "127.0.0.1",
"port": 18134,
"device": "ET",
"gpu_layers": 99,
"ctx_size": 2048,
"batch_size": 256,
"ubatch_size": 128,
"parallel": 1,
"cache_ram_mib": 0,
"ready_timeout_s": 300,
"request_timeout_s": 420,
"flash_attn": false,
"api": "completion",
"prompt": "Repeat this token sequence without commentary: OK OK OK OK OK OK OK OK OK OK",
"max_tokens": 96,
"temperature": 0,
"ignore_eos": true,
"min_completion_tokens": 32,
"perplexity": {
"enabled": true,
"perplexity_artifact": "llama_perplexity",
"corpus_artifact": "wikitext2_raw_test",
"ctx_size": 128,
"batch_size": 128,
"ubatch_size": 128,
"timeout_s": 420,
"min_ppl": 1.0,
"max_ppl": 1000.0,
"chunks": 4
}
}
}
52 changes: 52 additions & 0 deletions ported_models/llama_cpp_et/benchmarks/phi3_mini.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"runner": "llama_server",
"board": true,
"framework": {
"name": "llama.cpp-et",
"runner": "llama_server",
"source_artifact": "llama_cpp_source"
},
"artifacts_file": "../artifacts.json",
"canonical_variant": "Phi-3-mini-4k-instruct-q4",
"score": {
"metric": "tokens_per_second",
"label": "Decode tokens/s",
"higher_is_better": true
},
"llama_server": {
"source_artifact": "llama_cpp_source",
"model_artifact": "phi3_mini_q4_gguf",
"server_artifact": "llama_server",
"workdir_artifact": "llama_cpp_build",
"host": "127.0.0.1",
"port": 18133,
"device": "ET",
"gpu_layers": 99,
"ctx_size": 2048,
"batch_size": 256,
"ubatch_size": 128,
"parallel": 1,
"cache_ram_mib": 0,
"ready_timeout_s": 300,
"request_timeout_s": 420,
"flash_attn": false,
"api": "completion",
"prompt": "Repeat this token sequence without commentary: OK OK OK OK OK OK OK OK OK OK",
"max_tokens": 96,
"temperature": 0,
"ignore_eos": true,
"min_completion_tokens": 32,
"perplexity": {
"enabled": true,
"perplexity_artifact": "llama_perplexity",
"corpus_artifact": "wikitext2_raw_test",
"ctx_size": 128,
"batch_size": 128,
"ubatch_size": 128,
"timeout_s": 420,
"min_ppl": 1.0,
"max_ppl": 1000.0,
"chunks": 4
}
}
}
Loading
Loading