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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ if(ONEBIT_JINJA)
${_onebit_jinja_dir}/jinja/caps.cpp
# jinja/value.cpp includes the fork's unicode.h, and these are its implementation
${_onebit_jinja_dir}/unicode.cpp)
# engine#2138: from llama.cpp #327 on, jinja/value.cpp works through common_json (common/json.cpp),
# whose JSON_ASSERT is GGML_ASSERT. The binary does not link ggml, so the one function that needs,
# ggml_abort(), comes from app/jinja_ggml_abort.cpp; ggml.h is read for its declaration only.
target_sources(onebit_jinja PRIVATE ${_onebit_jinja_dir}/json.cpp ${CMAKE_SOURCE_DIR}/app/jinja_ggml_abort.cpp)
target_include_directories(onebit_jinja PRIVATE ${CMAKE_SOURCE_DIR}/third_party/llama.cpp/ggml/include)
target_include_directories(onebit_jinja PUBLIC ${_onebit_jinja_dir})
target_link_libraries(onebit_jinja PUBLIC nlohmann_json::nlohmann_json)
target_compile_definitions(onebit_jinja PUBLIC ONEBIT_JINJA=1)
Expand Down
39 changes: 39 additions & 0 deletions app/jinja_ggml_abort.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2026 bong-water-water-bong
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// engine#2138: the one ggml symbol the fork's chat-template sources reach for.
//
// From llama.cpp #327 on, common/jinja/value.cpp works through common_json (common/json.cpp), and
// json.cpp routes nlohmann's JSON_ASSERT to GGML_ASSERT, which calls ggml_abort(). The 1bit binary
// does not link ggml (the HRX and Vulkan servers are separate processes), so onebit_jinja carries
// this definition: the same message ggml prints (file:line: text) on stderr, then abort(). It has
// no abort callback and no backtrace, because nothing in the binary sets one.
#include "ggml.h"

#include <cstdarg>
#include <cstdio>
#include <cstdlib>

extern "C" void ggml_abort(const char* file, int line, const char* fmt, ...) {
std::fflush(stdout);
char message[2048];
const int offset = std::snprintf(message, sizeof message, "%s:%d: ", file, line);
va_list args;
va_start(args, fmt);
if (offset >= 0 && size_t(offset) < sizeof message) std::vsnprintf(message + offset, sizeof message - size_t(offset), fmt, args);
va_end(args);
std::fprintf(stderr, "%s\n", message);
std::abort();
}
5 changes: 4 additions & 1 deletion app/npu_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "jinja/parser.h"
#include "jinja/runtime.h"
#include "jinja/value.h"
#include "json.h" // common_json, the fork's JSON type global_from_json takes (engine#2138)
#endif

namespace onebit::npu {
Expand Down Expand Up @@ -212,7 +213,9 @@ inline std::string render_chat_template(const ChatTemplate& tmpl, const nlohmann
if (tmpl.wants_user_system_prompt && !in.contains("user_system_prompt")) in["user_system_prompt"] = "";
// mark_input=true: everything that came in as data (messages, tool arguments, extra request
// fields) is marked, so the tokenizer can refuse to parse special tokens inside it.
jinja::global_from_json(ctx, in, /*mark_input=*/true);
// The fork's renderer takes its own common_json (common/json.h, an ordered_json underneath since
// llama.cpp #327), so the round trip through text keeps the order set above.
jinja::global_from_json(ctx, common_json::parse(in.dump()), /*mark_input=*/true);

jinja::runtime runtime(ctx);
const jinja::value result = runtime.execute(prog);
Expand Down
18 changes: 18 additions & 0 deletions docs/arch-gaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ carries `"watch": "report"`, so the census watcher lists new uploads of it as `.
does not alert while no pinned backend can serve the class; remove that field (and record
`mapped_ok`) when the llama.cpp pin gains `hrm_text`.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): `conversion/hrm_text.py` registers `HrmTextForCausalLM` as `hrm_text`, `src/llama-arch.cpp` registers `LLM_ARCH_HRM_TEXT`, and `src/models/hrm-text.cpp` builds its own graph: a second architecture, not an alias of a supported one.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

### `dflash2` - `nchapman/Qwen3.5-4B-DFlash2` (also `arc-kumbhar/incoai-Qwen3.8-27B-DFlash2`)

Architecture class `DFlash2DraftModel`, no `auto_map` and `library_name: speculators` on the
Expand Down Expand Up @@ -453,6 +456,9 @@ new uploads of it as `. REVIEWED` and does not alert; remove that field (and rec
when a pin bump reaches DFlash2 support (selector + conv heads, per-layer window) and its
converter class registers `DFlash2DraftModel`.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): the condition above is met. `conversion/qwen.py` registers `DFlash2DraftModel` with `DFlashDraftModel` and writes `conv_kernel_size`, `conv_group_size`, `selector_rank`, `selector_top_k` and the `candidate_selector` codebooks; `src/models/dflash.cpp` loads the selector tensors and builds the conv and selector heads (`build_dflash2_conv`, `build_dflash2_selector`). The draft no longer drops them.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

### `tashkeel_nano` - `ahmadsy/tashkeel-nano-1p1m`

Architecture class `DiacritizerModel`, `model_type: tashkeel_nano`, no `library_name` and no
Expand Down Expand Up @@ -550,6 +556,9 @@ the target box today. Reviewed 2026-10-17: **not an alias**. Its `registry/signi
entry carries `"watch": "report"`, so the census watcher lists new uploads as `. REVIEWED` and
does not alert; remove that field (and record `mapped_ok`) when the pin gains `muse-spark`.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): `conversion/muse_spark.py` registers `MuseSparkForConditionalGeneration` as `muse_spark`, `src/llama-arch.cpp` registers `LLM_ARCH_MUSE_SPARK`, and `src/models/muse-spark.cpp` builds its own graph.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

### `glm5_next` - `azampatti/GLM-5.3-Flash-AZ` (also `zai-org/GLM-5.3-Flash`)

Architecture class `Glm5NextForConditionalGeneration`, `model_type: glm5_next`, no `auto_map` and
Expand Down Expand Up @@ -602,6 +611,9 @@ counts as supported. Reviewed 2026-10-23: **not an alias**. Its `registry/signif
carries `"watch": "report"`, so the census watcher lists new uploads as `. REVIEWED` and does not
alert; remove that field (and record `mapped_ok`) when the pin gains `glm5-next`.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): `conversion/glm.py` (text) and `conversion/qwen3vl.py` (the vision tower) register `Glm5NextForConditionalGeneration`, `src/llama-arch.cpp` registers `LLM_ARCH_GLM5_NEXT` with its KDA + MLA cache layout in `src/llama-model.cpp`, and `src/models/glm5-next.cpp` builds its own graph.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

### 2026-10-27 batch (engine#619)

All four classes in that census run are reviewed below. The mirror the run named for
Expand Down Expand Up @@ -704,6 +716,9 @@ family already ships GGUFs (`ibm-granite/granite-switch-4.1-8b-GGUF`, whose
uploads as `. REVIEWED` instead of filing an issue; remove that field (and record `mapped_ok`)
when the pin gains `graniteswitch`.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): `conversion/granite.py` registers `GraniteSwitchForCausalLM` as `graniteswitch`, `src/llama-arch.cpp` registers `LLM_ARCH_GRANITE_SWITCH`, and `src/models/granite-switch.cpp` builds its own graph.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

### 2026-11-05 batch (engine#619)

Two classes were reported `UNCOVERED` on 2026-11-05: `Ernie5_5_MoeForCausalLM` (3 models in
Expand Down Expand Up @@ -816,6 +831,9 @@ inline `config` and the repo's own `config.json`; metadata only, no weights).
rotary, 7-tap conv) in the pinned backend, validated against HF reference logits. The family is
already 96 models in the census, so this is worth its own issue rather than an alias.

* **Mapped since `2c178f44b`** (2026-11-13, the llama.cpp #327 pin engine#2138 moves to): `conversion/lfm3.py` registers `Lfm3ForCausalLM` as `lfm3`, `src/llama-arch.cpp` registers `LLM_ARCH_LFM3`, and `src/models/lfm3.cpp` builds its own graph: not an alias of `lfm2`/`lfm2moe`.
`registry/significant.json` records the same fact as a `mapped_ok` reason, so `--check-gaps` stays quiet.

#### `needle` - `Amdkn7/needle3`

* **Class / model_type**: `NeedleForToolCalling` / `needle`, `library_name: cactus-compute`,
Expand Down
Loading
Loading