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"
},
"mamba_1_4b": {
"config": "ported_models/llama_cpp_et/benchmarks/mamba_1_4b.json"
},
"chatglm3_6b": {
"config": "ported_models/llama_cpp_et/benchmarks/chatglm3_6b.json"
}
}
}
55 changes: 55 additions & 0 deletions ported_models/chatglm3_6b/docs/RECIPE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# ChatGLM3-6B Porting Recipe

## Overview

Adds `zai-org/chatglm3-6b` (6B-parameter causal LM, Zhipu AI's ChatGLM3;
this model was previously published under `THUDM/chatglm3-6b`, which now
redirects to `zai-org`) to the `llama.cpp-et` framework. Confirmed via
local GGUF metadata inspection: `general.architecture = chatglm` --
distinct from `glm4` (already ported earlier in this campaign), a
separate, older execution family in llama.cpp (ChatGLM uses a distinct
attention-bias/RoPE convention from GLM4).

## Model Reference

- **Source**: `zai-org/chatglm3-6b` (Hugging Face), revision
`e9e0406d062cdb887444fe5bd546833920abd4ac`
- **License**: Apache-2.0
- **GGUF source**: `hellork/chatglm3-6b-128k-Q8_0-GGUF` (a 128k-context
fine-tune/extension of the base model, same architecture), file
`chatglm3-6b-128k-q8_0.gguf`
- **Quantization**: Q8_0,
`sha256=805e3761a997486eb08f45e0f74efa5c1cc0be8475afa2b170263b490a3ba8c8`
(verified locally against the downloaded file)
- **Architecture**: `arch = chatglm` per GGUF metadata, 199 tensors.

## Verification performed this round

Host reference: built a plain CPU-only (`GGML_ET=OFF`) configuration of the
same vendored `llama.cpp-et` source and ran `llama-perplexity` against the
board-pinned WikiText-2 corpus (`wikitext2_raw_test`,
`sha256=173c87a53759e0201f33e0ccf978e510c2042d7f2cb78229d9a50d79b9e7dd08`),
context 128 / batch 128 / ubatch 128 / 4 chunks. The model loads and runs
cleanly:

```
Final estimate: PPL = 15.9100 +/- 3.37450
```

## Why this port likely needs no new ET-SoC1 kernel work

`LLM_ARCH_CHATGLM`'s graph builder uses standard ops already proven on the
ET backend (RMSNorm, RoPE, MHA/GQA with a QKV bias term, GELU-based FFN) --
no new op type. ET-SoC1 board execution itself is not something this
session can produce.

## Open items for maintainer review

- Registered in `artifacts.json`, `ported_models/llama_cpp_et/benchmarks/chatglm3_6b.json`,
and `.github/ci/benchmark_config.json` (port 18140) -- board-testable now,
independent of the model-ports track claim below.
- `ported_models/submissions/model_ports/chatglm3_6b.json` is the
model-ports track claim, pending identity approval.
- No changes to any protected file or the vendored submodule.
- GGUF used is a 128k-context fine-tune, not a base-model quant -- same
architecture and weights lineage, flagged for transparency.
25 changes: 25 additions & 0 deletions ported_models/chatglm3_6b/oracle/perplexity_oracle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"oracle_type": "perplexity_threshold",
"model_artifact": {
"repo": "hellork/chatglm3-6b-128k-Q8_0-GGUF",
"revision": "main",
"filename": "chatglm3-6b-128k-q8_0.gguf",
"sha256": "805e3761a997486eb08f45e0f74efa5c1cc0be8475afa2b170263b490a3ba8c8"
},
"corpus": {
"artifact": "wikitext2_raw_test",
"sha256": "173c87a53759e0201f33e0ccf978e510c2042d7f2cb78229d9a50d79b9e7dd08"
},
"command": "llama-perplexity --model chatglm3-6b-128k-Q8_0.gguf -f wiki.test.raw -c 128 -b 128 -ub 128 --chunks 4",
"reference_run": {
"final_ppl": 15.91,
"final_ppl_stderr": 3.3745,
"measured_on": "CPU (ggml-cpu backend, GGML_ET=OFF build)",
"measured_date": "2026-07-25"
},
"comparison_threshold": {
"metric": "final_ppl",
"max_relative_deviation": 0.2,
"note": "Matches this repo's own leaderboard-gate policy (PPL must stay within 20% of best-seen value). A full-offload ET-SoC1 re-run against this exact command/corpus/artifact should land at final_ppl within [12.73, 19.09] to be considered consistent with this reference run. No ET-SoC1 hardware was available to this session to perform that re-run directly."
}
}
67 changes: 67 additions & 0 deletions ported_models/flan_t5_base/docs/RECIPE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# FLAN-T5-base -- Inconclusive Result (No Claim Filed)

## Summary

Attempted to add `google/flan-t5-base` (250M-parameter encoder-decoder
causal LM, an instruction-tuned T5) to the `llama.cpp-et` framework.
**The model loads and its compute graph builds successfully, but neither of
the two standard tools in this vendored `llama.cpp-et` submodule
(`llama-perplexity`, `llama-cli`) can actually drive it to produce output.**
No model-ports claim is filed -- this recipe documents the finding rather
than a working port.

## Model Reference

- **Source**: `google/flan-t5-base` (Hugging Face), revision
`7bcac572ce56db69c1ea7c8af255c5d7c9672fc2`
- **License**: Apache-2.0
- **GGUF source**: `Felladrin/gguf-flan-t5-base`, file
`flan-t5-base.Q8_0.gguf`
- **Quantization**: Q8_0,
`sha256=73eb18e2341b28f40e9596c3740ef46941075a57c79af1ebffab177fd66cbe50`
(verified locally against the downloaded file)
- **Architecture**: `arch = t5` per GGUF metadata, 282 tensors.

## What actually happens (both confirmed live, not speculative)

The model loads cleanly and reserves a compute graph (`llama_kv_cache`
allocated, 704 graph nodes) -- so far identical to every working port in
this campaign. Then:

1. **`llama-perplexity`** crashes with
`GGML_ASSERT(!llama_vocab_get_add_eos(vocab)) failed`. T5's tokenizer
always appends an EOS token (a fixed property of its seq2seq
vocabulary) -- the perplexity tool's raw-continuation PPL method
explicitly asserts the OPPOSITE for every model it evaluates, since
that method assumes a plain causal-LM tokenizer. This is a tool/model
mismatch, not a model defect.
2. **`llama-cli`** crashes with
`GGML_ASSERT(!cross->seq_ids_enc.empty() && "llama_encode must be called
first") failed`. T5 is encoder-decoder: its cross-attention layers need
the encoder pass (`llama_encode()`) run once before any decoder step
(`llama_decode()`). `llama-cli` goes straight to `llama_decode()` --
it never calls `llama_encode()` at all. The underlying library
(`libllama`) clearly supports the encode/decode split (the assert
exists specifically to catch exactly this ordering mistake), but
neither CLI frontend in this vendored build orchestrates it.

## Why no claim is filed

Both failures happen in the harness/tooling, not the model itself -- the
GGUF is valid and the graph builds. But this campaign's standard is
"prove the model actually runs and produces output," and neither available
tool can demonstrate that for an encoder-decoder model. Filing a claim on
"it loads" alone, with the same evidence bar as this campaign's actually-
completed ports, would overstate what was actually shown. This is a
different category from `bitnet_2b` (which fails at model load) --
here the model format is fine, but this repo's tooling has no
encoder-decoder driver.

## What would need to change

A custom driver that calls `llama_encode()` once against the input, then
loops `llama_decode()` for the output tokens (this is exactly what
llama.cpp's upstream examples do for T5/text2text tasks in some example
programs, but that driver is not present in the ported subset of tools
built in this repo's vendored submodule). Out of scope for a model-port
recipe -- would be new tooling work, not board wiring.
34 changes: 34 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,40 @@
"sha256": "d1eb8b6b23979205fdf63703ed10f788131a3f812c7b1f72e0119d5d81295150",
"size_bytes": 108783360,
"note": "SmolVLM 500M vision projector (SigLIP ~93M + MLP). Q8_0 quantized. Must be loaded alongside smolvlm_500m_q8_gguf."
},
"mamba_1_4b_q6k_gguf": {
"kind": "model",
"framework": "llama.cpp-et",
"variant": "mamba-1.4b-hf-Q6_K",
"filename": "mamba-1.4b-hf-Q6_K.gguf",
"env": "MAMBA_1_4B_MODEL_PATH",
"source": {
"type": "huggingface",
"repo": "RichardErkhov/state-spaces_-_mamba-1.4b-hf-gguf",
"revision": "main",
"filename": "mamba-1.4b-hf.Q6_K.gguf",
"url": "https://huggingface.co/RichardErkhov/state-spaces_-_mamba-1.4b-hf-gguf/resolve/main/mamba-1.4b-hf.Q6_K.gguf"
},
"sha256": "a5dde81ce41c34213bf26bcaf2ba26cd1c6fde20fd20b5af6a4a76a5272478bc",
"local_cache": "local-artifacts/models/mamba-1.4b-hf-Q6_K.gguf",
"board_path": "/data/models/mamba-1.4b-hf-Q6_K.gguf"
},
"chatglm3_6b_q8_gguf": {
"kind": "model",
"framework": "llama.cpp-et",
"variant": "chatglm3-6b-128k-Q8_0",
"filename": "chatglm3-6b-128k-Q8_0.gguf",
"env": "CHATGLM3_6B_MODEL_PATH",
"source": {
"type": "huggingface",
"repo": "hellork/chatglm3-6b-128k-Q8_0-GGUF",
"revision": "main",
"filename": "chatglm3-6b-128k-q8_0.gguf",
"url": "https://huggingface.co/hellork/chatglm3-6b-128k-Q8_0-GGUF/resolve/main/chatglm3-6b-128k-q8_0.gguf"
},
"sha256": "805e3761a997486eb08f45e0f74efa5c1cc0be8475afa2b170263b490a3ba8c8",
"local_cache": "local-artifacts/models/chatglm3-6b-128k-Q8_0.gguf",
"board_path": "/data/models/chatglm3-6b-128k-Q8_0.gguf"
}
}
}
52 changes: 52 additions & 0 deletions ported_models/llama_cpp_et/benchmarks/chatglm3_6b.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": "chatglm3-6b-128k-Q8_0",
"score": {
"metric": "tokens_per_second",
"label": "Decode tokens/s",
"higher_is_better": true
},
"llama_server": {
"source_artifact": "llama_cpp_source",
"model_artifact": "chatglm3_6b_q8_gguf",
"server_artifact": "llama_server",
"workdir_artifact": "llama_cpp_build",
"host": "127.0.0.1",
"port": 18140,
"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