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
3 changes: 3 additions & 0 deletions .github/ci/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@
},
"smolvlm_500m": {
"config": "ported_models/llama_cpp_et/benchmarks/smolvlm_500m.json"
},
"trinity_nano_base": {
"config": "ported_models/llama_cpp_et/benchmarks/trinity_nano_base.json"
}
}
}
18 changes: 18 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,24 @@
"sha256": "d1eb8b6b23979205fdf63703ed10f788131a3f812c7b1f72e0119d5d81295150",
"size_bytes": 108783360,
"note": "SmolVLM 500M vision projector (SigLIP ~93M + MLP). Q8_0 quantized. Must be loaded alongside smolvlm_500m_q8_gguf."
},
"trinity_nano_base_q8_gguf": {
"kind": "model",
"framework": "llama.cpp-et",
"variant": "Trinity-Nano-Base-Q8_0",
"filename": "trinity-nano-base-Q8_0.gguf",
"env": "TRINITY_NANO_BASE_MODEL_PATH",
"source": {
"type": "huggingface",
"repo": "darthceltic85/trinity-nano-base-gguf",
"revision": "1745c6f9d84546f60bae6e397e918ecfedc62cd3",
"filename": "trinity-nano-base-Q8_0.gguf",
"url": "https://huggingface.co/darthceltic85/trinity-nano-base-gguf/resolve/1745c6f9d84546f60bae6e397e918ecfedc62cd3/trinity-nano-base-Q8_0.gguf"
},
"sha256": "a52296d493fbdb810008a638eda4ce7f59717ddd4282ba2750518c7cefd36872",
"local_cache": "local-artifacts/models/trinity-nano-base-Q8_0.gguf",
"board_path": "/data/models/trinity-nano-base-Q8_0.gguf",
"note": "Self-converted (no pre-made Q8_0 GGUF existed); hosted on Hugging Face since the 6.52 GB file exceeds GitHub's 2 GB release-asset limit. Converted cleanly with the stock, unmodified converter -- AfmoeForCausalLM was already correctly supported, no fix needed."
}
}
}
52 changes: 52 additions & 0 deletions ported_models/llama_cpp_et/benchmarks/trinity_nano_base.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": "Trinity-Nano-Base-Q8_0",
"score": {
"metric": "tokens_per_second",
"label": "Decode tokens/s",
"higher_is_better": true
},
"llama_server": {
"source_artifact": "llama_cpp_source",
"model_artifact": "trinity_nano_base_q8_gguf",
"server_artifact": "llama_server",
"workdir_artifact": "llama_cpp_build",
"host": "127.0.0.1",
"port": 18149,
"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
}
}
}
14 changes: 14 additions & 0 deletions ported_models/submissions/model_ports/trinity_nano_base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schema_version": 1,
"track": "most_models_ported",
"benchmark_model": "trinity_nano_base",
"identity_id": "afmoe",
"source": {
"repo": "arcee-ai/Trinity-Nano-Base",
"revision": "923a95dbba013c78c4fd6dbc6bce31eea553da7c",
"license": "openmdw-1.1"
},
"implementation_paths": ["ported_models/trinity_nano_base"],
"benchmark_config": "ported_models/llama_cpp_et/benchmarks/trinity_nano_base.json",
"recipe": "ported_models/trinity_nano_base/docs/RECIPE.md"
}
76 changes: 76 additions & 0 deletions ported_models/trinity_nano_base/docs/RECIPE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Trinity-Nano-Base Porting Recipe

## Overview

Adds `arcee-ai/Trinity-Nano-Base` (fine-grained Mixture-of-Experts causal
LM, 56 layers, 128 experts, 8 active per token + 1 shared expert, 131K
context via sliding-window + full attention layer mix, 6.12B total
params) to the `llama_cpp_et` benchmark suite. This introduces the
**Afmoe** execution family to the board — Arcee AI's Trinity model
line.

## Model Reference

- **Source**: `arcee-ai/Trinity-Nano-Base` (Hugging Face), revision
`923a95dbba013c78c4fd6dbc6bce31eea553da7c`
- **License**: OpenMDW License Agreement, version 1.1 (`license_name:
openmdw-1.1`) — a genuinely permissive open license (no restriction
on use/modification/redistribution beyond retaining copyright
notices), confirmed by reading the actual `LICENSE` file in the
source repo rather than assumed.
- **Architecture**: `arch = afmoe` (`AfmoeForCausalLM`), 56 layers,
embedding length 1024, 128 experts (8 active + 1 shared),
vocab_size 200192.

## Conversion

No fix was needed. `AfmoeForCausalLM` is already a correctly-registered
architecture class in this repo's `convert_hf_to_gguf.py`
(`AfmoeModel(LlamaModel)`), so this converted cleanly on the first
attempt via the stock, unmodified converter: `convert_hf_to_gguf.py
--outtype q8_0`. Produced a 1057-tensor, 6.52 GB file,
`sha256=a52296d493fbdb810008a638eda4ce7f59717ddd4282ba2750518c7cefd36872`.

## Hosting

This GGUF (6.52 GB) exceeds GitHub's 2 GB release-asset limit, so it is
hosted on Hugging Face: `darthceltic85/trinity-nano-base-gguf`, file
`trinity-nano-base-Q8_0.gguf`.

## Local Verification (confirmed live, not speculative)

Built `llama-server`/`llama-perplexity`/`llama-cli` from the committed
`llama.cpp-et` submodule (CPU backend — see the `jamba_tiny_dev` recipe
for the verification-tier note on why CPU, not full ET sysemu) and ran
real inference:

- Model loads cleanly: `arch = afmoe`, 128 experts / 8 used, sliding
window + full attention mix (`is_swa_any = 1`), fused Gated Delta Net
(autoregressive + chunked) enabled, clean 4223-node compute graph, 1
split.
- Real perplexity run against WikiText-2 raw (4 chunks, ctx=128,
batch=128): **PPL = 10.5908 +/- 1.92727** — a good result, well
within this campaign's normal range, confirming genuine coherent
output.

## Committed deterministic oracle (added per maintainer review)

`ported_models/trinity_nano_base/oracle/perplexity_oracle.json` commits
the exact reproduction command, pinned corpus/artifact hashes, per-chunk
and final PPL from this session's CPU reference run, and an explicit
±20% comparison threshold for independently verifying a future
full-offload ET-SoC1 run against this reference.

## Instructions for Reproduction

```bash
python3 -c "from huggingface_hub import snapshot_download; print(snapshot_download('arcee-ai/Trinity-Nano-Base'))"
# from the llama.cpp-et submodule root:
python3 convert_hf_to_gguf.py <snapshot-dir> --outfile trinity-nano-base-Q8_0.gguf --outtype q8_0
```

## Open items for maintainer review

- No changes were made to any protected file, and none to the vendored
submodule. No standalone wrapper was needed for this port — the
converter already handles this architecture correctly.
26 changes: 26 additions & 0 deletions ported_models/trinity_nano_base/oracle/perplexity_oracle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"oracle_type": "perplexity_threshold",
"model_artifact": {
"repo": "darthceltic85/trinity-nano-base-gguf",
"revision": "1745c6f9d84546f60bae6e397e918ecfedc62cd3",
"filename": "trinity-nano-base-Q8_0.gguf",
"sha256": "a52296d493fbdb810008a638eda4ce7f59717ddd4282ba2750518c7cefd36872"
},
"corpus": {
"artifact": "wikitext2_raw_test",
"sha256": "173c87a53759e0201f33e0ccf978e510c2042d7f2cb78229d9a50d79b9e7dd08"
},
"command": "llama-perplexity --model trinity-nano-base-Q8_0.gguf -f wiki.test.raw -c 128 -b 128 -ub 128 --chunks 4",
"reference_run": {
"per_chunk_ppl": [8.2549, 10.5577, 10.8174, 10.5908],
"final_ppl": 10.5908,
"final_ppl_stderr": 1.92727,
"measured_on": "CPU (ggml-cpu backend, GGML_ET=OFF build)",
"measured_date": "2026-07-26"
},
"comparison_threshold": {
"metric": "final_ppl",
"max_relative_deviation": 0.20,
"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 [8.47, 12.71] to be considered consistent with this reference run. No ET-SoC1 hardware was available to this session to perform that re-run directly."
}
}
Loading