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
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ See `docs/v080_qualification.md` for the v0.8.0 candidate, its wrapper gate,
carried-patch status and consumer ABI delta.
See `docs/v080_android_isa_qualification.md` for the v0.8.0/KleidiAI v1.32.0
source pair, its SVE I8MM-gated Q8 kernels and remaining gates.
See `docs/v090_qualification.md` for the v0.9.0 candidate, retired patch 0004
and consumer ABI delta, and `docs/v090_android_isa_qualification.md` for its
source pair and ggml SVE256 repack paths.
See `docs/v090_qualification.md` for the v0.9.0 candidate, patches 0003 and
0004 (kept for the older rows, not applied to v0.9.0) and consumer ABI delta,
and `docs/v090_android_isa_qualification.md` for its source pair and ggml
SVE256 repack paths.
See `docs/v080_1_wrapper_rebuild.md` for the `v0.8.0-1` Metal kernel patch and
the OS floor check `metal_os_floor.yml`, which runs on `macos-15`, `macos-26`
and the oldest iOS simulator because ggml compiles Metal source on the user's
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ if (LLAMADART_BUILD_TTS_SMOKE)
add_executable(llamadart_tts_voice_smoke tools/tts_voice_smoke.cpp)
target_compile_features(llamadart_tts_voice_smoke PRIVATE cxx_std_17)
target_link_libraries(llamadart_tts_voice_smoke PRIVATE llamadart_lib)
target_compile_definitions(llamadart_tts_voice_smoke PRIVATE
LLAMADART_MTMD_HAS_GEN_VOICES=$<BOOL:${LLAMADART_MTMD_HAS_GEN_VOICES}>)
target_include_directories(llamadart_tts_voice_smoke PRIVATE
third_party/llama.cpp/include
third_party/llama.cpp/tools/mtmd
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,10 @@ PCM. `LLAMA_DEFAULT_SEED` draws one random seed per task for both samplers.
The talker sampler gives the GGUF's `tokenizer.ggml.suppress_tokens` a `-inf`
bias, as upstream `common_sampler` does. For Qwen3-TTS these are the codec's
control tokens, which code2wav rejects as out-of-range codes, failing the
synthesis. Earlier wrappers did not apply them, so a fixed seed can give
different PCM where a control token reached the sampled candidates.
synthesis. Earlier wrappers did not apply them. A fixed seed still gives the same PCM
at default settings, `top_k 1` and `temp 0`; at high temperature with `top_k 0`
(for example `temp 2.5`) PCM can differ even when no control token is drawn,
because `dist` renormalizes without the suppressed mass.

The local smoke target is opt-in because it requires large model artifacts:

Expand Down
9 changes: 5 additions & 4 deletions docs/native174_f16_dot_accumulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ measured on that hardware.
overflow, 8/16/32-column GEMM cases, F32 controls, and ordinary and flash
attention over 16 keys for one and eight queries with an unsaturated
softmax. For 0006 it adds GEMM blocks whose F16 lane sums end exactly at
65504 and at 65536 (overflow), sums that are exact in F16 within one block
but not across two (catches a longer or missing block), block tails, and an
overflow confined to part of one tile away from the origin (catches a
partial finiteness check or a misplaced recompute). Weight rows are followed
65504 and at 65536 (overflow), lane sums of 2047 that are exact in F16 within
one block but not with a 65th product (catches a longer block), block tails,
and overflow confined to single cells of tiles away from the origin, among
them only the last row and only the last column of a tile (catches a partial
finiteness check or a misplaced recompute). Weight rows are followed
by NaN padding, so a read past the row fails; in 0006 the recompute hides an
over-read that reaches only the padding, and the attention case catches one
that reaches the next row. It reports every failing check. The macOS
Expand Down
14 changes: 10 additions & 4 deletions docs/v090_qualification.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ The wrapper builds against v0.9.0 without source changes, and every
- `MTMD_GEN_AUDIO_TYPE_CHATTERBOX` maps to `LLAMA_DART_TTS_MODEL_TYPE_UNKNOWN`,
so the TTS entry points report it unsupported. Chatterbox and the new
predefined-voice API are not wrapped.
- The TTS talker sampler now applies the GGUF's suppress tokens. A fixed
Qwen3-TTS seed can give different PCM from v0.8.0 wrappers where a codec
control token reached the sampled candidates; with the ggml-org 1.7B Base
Q4_K_M GGUF, 40 seed and sampling combinations gave identical PCM.

Evidence, 2026-11-06, Apple M4 Max, macOS arm64, Metal on, Release,
`LLAMADART_BUILD_TESTS=ON`, `LLAMADART_BUILD_TTS_SMOKE=ON`: native CTest
Expand All @@ -38,6 +34,16 @@ Evidence, 2026-11-06, Apple M4 Max, macOS arm64, Metal on, Release,
`llamadart_f16_dot_accumulation_test`; the same export and `check-apple`
checks pass.

## TTS sampler behavior

Separately from the v0.9.0 build, the TTS talker sampler applies the GGUF's
suppress tokens, which earlier wrappers did not. A fixed Qwen3-TTS seed gives
the same PCM as before at default settings, `top_k 1` and `temp 0`, which
the ggml-org 1.7B Base Q4_K_M GGUF confirmed over 40 seed and sampling
combinations. At high temperature with `top_k 0` (for example `temp 2.5`), PCM
can differ even when no control token is drawn, because `dist` renormalizes
without the suppressed mass.

## Carried patches

Reviewed 2026-11-07 against v0.9.0 and upstream `master`
Expand Down
3 changes: 2 additions & 1 deletion patches/llama.cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ library lacks the `text` of an `android_markers` entry. It reads the built
library, so it does not matter why the patch is missing. The release runs it
on every Android bundle and `validate_wrapper.yml` on the pinned upstream, so
a patch that upstream has outgrown fails the pull request that moves the
upstream, or the release, the automatic stable release included. Check then
upstream, or the manually dispatched release (`native_release.yml`, or
`auto_native_release.yml` for a new stable upstream tag). Check then
whether upstream fixed the defect, and refresh the patch or delete it.

For that reason every patch must have at least one marker, and so must change
Expand Down
20 changes: 14 additions & 6 deletions tests/f16_dot_accumulation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ enum class Pattern {
block_maximum,
// As block_maximum but each lane sums to 65536, which overflows in F16.
block_overflow,
// Lane sums stay exact in F16 within a block but not over two blocks.
// Each lane sums 64 products to 2047, exact in F16; a 65th product of 32
// gives the odd 2079, which F16 cannot hold.
block_exact,
};

Expand Down Expand Up @@ -129,7 +130,7 @@ void dot_case(ggml_backend_t backend, int width, float magnitude,
qv = 2048.0f / gemm_block_steps -
(pattern == Pattern::block_maximum && last_step ? 1.0f : 0.0f);
} else if (pattern == Pattern::block_exact) {
kv = 2048.0f / gemm_block_steps - 1.0f;
kv = (i % gemm_block) / 8 == 1 ? 31.0f : 32.0f;
qv = 1.0f;
}
for (int r = 0; r < rows; ++r) {
Expand Down Expand Up @@ -163,8 +164,11 @@ void dot_case(ggml_backend_t backend, int width, float magnitude,
}

// Sixteen weight rows times twelve query columns with exact integer products.
// In the K tail after one GEMM block, rows 5-6 times columns 8-9 overflow F16:
// part of the 4x6 tile at rows 4-7 and columns 6-11, which alone is redone in F32.
// In the K tail after one GEMM block, lane 0 overflows F16 for rows 5-6 times
// columns 8-9 and lane 1 for rows 1 and 7 times columns 2 and 11. The 4x6 tiles
// sit at rows 4i..4i+3 and columns 6j..6j+5, so tile (4-7, 0-5) overflows only
// in its last row (7, 2), tile (0-3, 6-11) only in its last column (1, 11), and
// the finiteness check must see every cell to redo each tile in F32.
void gemm_tile_case(ggml_backend_t backend) {
constexpr int rows = 16;
constexpr int cols = 12;
Expand All @@ -182,10 +186,14 @@ void gemm_tile_case(ggml_backend_t backend) {
std::vector<ggml_fp16_t> keys(static_cast<size_t>(stride) * rows, ggml_fp32_to_fp16(NAN));
std::vector<float> queries(static_cast<size_t>(width) * cols);
auto key = [](int r, int i) {
return i >= gemm_block && (r == 5 || r == 6) ? 4096.0f : 1.0f + r % 3;
const int lane = i - gemm_block;
const bool large = (lane == 0 && (r == 5 || r == 6)) || (lane == 1 && (r == 1 || r == 7));
return large ? 4096.0f : 1.0f + r % 3;
};
auto query = [](int c, int i) {
return i >= gemm_block ? (c == 8 || c == 9 ? 16.0f : 1.0f) : 1.0f + c % 4;
const int lane = i - gemm_block;
const bool large = (lane == 0 && (c == 8 || c == 9)) || (lane == 1 && (c == 2 || c == 11));
return large ? 16.0f : i >= gemm_block ? 1.0f : 1.0f + c % 4;
};
for (int r = 0; r < rows; ++r) {
for (int i = 0; i < width; ++i) {
Expand Down
29 changes: 11 additions & 18 deletions tests/test_android_cpu_isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,16 @@ def test_tree_hash_binds_names_contents_and_new_callers(self):
self.assertNotEqual(original, audit.tree_digest(root))

def test_exact_reviewed_source_pairs_are_required(self):
expected = frozenset((ggml, "64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c")
for ggml in (
"c4dc92a7d95ebfad7f5f55e75be2ae773b7d95faf72a9581c9479c42bc41bca0",
"dcb0f04ebb9654b1fe5ac7cc45737c79e62b116a2063ceda81a7ec1ddb1b20e2",
"bf7ae6d2ea861ce6cd4b56afce154a45461df79b46c02e340d1adfe0075467b5",
"68d5bc369749e78545f50dd5107368ec7ee1874619794795cd142b0043c747f6",
"adc8d989599211a4b789b2c595b2ae52335c5a390e6c4972171c46589aa05e7e",
)) | frozenset({(
"b571df853210d243a83b1ec34a6936f147916f0369d792f8bb0d17f37fc7894b",
"deb324dbcf8c952ec149433ab58cbed0b2ab2374a557f0a4eea575b2da761377",
), (
"0b14cd6eac9832e7e50cee546495581c0067e7bca5c0db1dee6c3f7c0f7cf1f3",
"fd5b9ca98d07b81671eca377c258da74e72173f92f3cab0acdf6c17ab870bd9d",
), (
"fead7601e3b35651ee62764c76f28b50ee564160b543ff79be6fcc81837216c4",
"fd5b9ca98d07b81671eca377c258da74e72173f92f3cab0acdf6c17ab870bd9d",
)})
expected = frozenset({(
"b571df853210d243a83b1ec34a6936f147916f0369d792f8bb0d17f37fc7894b",
"deb324dbcf8c952ec149433ab58cbed0b2ab2374a557f0a4eea575b2da761377",
), (
"0b14cd6eac9832e7e50cee546495581c0067e7bca5c0db1dee6c3f7c0f7cf1f3",
"fd5b9ca98d07b81671eca377c258da74e72173f92f3cab0acdf6c17ab870bd9d",
), (
"fead7601e3b35651ee62764c76f28b50ee564160b543ff79be6fcc81837216c4",
"fd5b9ca98d07b81671eca377c258da74e72173f92f3cab0acdf6c17ab870bd9d",
)})
self.assertEqual(audit.SOURCE_PAIRS, expected)
for ggml, kai in expected:
with self.subTest(ggml=ggml):
Expand Down Expand Up @@ -144,7 +137,7 @@ def test_cli_binds_exact_function_ranges_to_the_reviewed_source_pair(self):
audit.V080_SOURCE_PAIR: audit.DISPATCHED_FUNCTIONS_V080,
audit.V090_SOURCE_PAIR: audit.DISPATCHED_FUNCTIONS_V080}
for pair in audit.SOURCE_PAIRS:
allowed = allowed_by_pair.get(pair, audit.DISPATCHED_FUNCTIONS)
allowed = allowed_by_pair[pair]
for artifact_ranges in (audit.DISPATCHED_FUNCTIONS, audit.DISPATCHED_FUNCTIONS_V070,
audit.DISPATCHED_FUNCTIONS_V080):
names = sorted(artifact_ranges)
Expand Down
5 changes: 5 additions & 0 deletions tools/tts_voice_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ static bool list_voices(mtmd_context *mtmd, uint32_t bit, std::vector<std::strin
if (llama_dart_tts_get_voice_count(mtmd, bit, &count) != LLAMA_DART_TTS_STATUS_OK || count <= 0) {
return fail("the projector lists no predefined voice");
}
#if LLAMADART_MTMD_HAS_GEN_VOICES
if (count != mtmd_gen_audio_get_info(mtmd).n_voices) {
return fail("the wrapper's voice count differs from upstream's");
}
#endif
for (int32_t i = 0; i < count; ++i) {
size_t length = 0;
if (llama_dart_tts_get_voice_name(mtmd, bit, i, nullptr, 0, &length) != LLAMA_DART_TTS_STATUS_OK ||
Expand Down
26 changes: 2 additions & 24 deletions tools/validate_android_cpu_isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

# Bind complete source subtree pairs, not independent hash sets: a new caller
# or a different KleidiAI combination invalidates the dispatch audit.
# Candidate audit evidence: docs/post_v040_qualification.md,
# docs/v041_android_isa_qualification.md, docs/v050_android_isa_qualification.md
# docs/v060_android_isa_qualification.md, docs/v070_android_isa_qualification.md,
# Candidate audit evidence: docs/v070_android_isa_qualification.md,
# docs/v080_android_isa_qualification.md and docs/v090_android_isa_qualification.md.
V070_SOURCE_PAIR = (
"b571df853210d243a83b1ec34a6936f147916f0369d792f8bb0d17f37fc7894b",
Expand All @@ -36,26 +34,6 @@
"fd5b9ca98d07b81671eca377c258da74e72173f92f3cab0acdf6c17ab870bd9d",
)
SOURCE_PAIRS = frozenset({
( # llama.cpp v0.4.0 / KleidiAI v1.24.0
"c4dc92a7d95ebfad7f5f55e75be2ae773b7d95faf72a9581c9479c42bc41bca0",
"64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c",
),
( # Exact upstream 73ab7599b553c03f6f5d2db24a18ad76f2eb36a3, same KleidiAI
"dcb0f04ebb9654b1fe5ac7cc45737c79e62b116a2063ceda81a7ec1ddb1b20e2",
"64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c",
),
( # llama.cpp v0.4.1 b29c606e28a01b1bc8c1351026a0fa6e616bf6c4
"bf7ae6d2ea861ce6cd4b56afce154a45461df79b46c02e340d1adfe0075467b5",
"64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c",
),
( # llama.cpp v0.5.0 7fe450e19305b828c199d602c23a8337aaa1f03b
"68d5bc369749e78545f50dd5107368ec7ee1874619794795cd142b0043c747f6",
"64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c",
),
( # llama.cpp v0.6.0 d81235049384534c167caea52b85a694f6103d14
"adc8d989599211a4b789b2c595b2ae52335c5a390e6c4972171c46589aa05e7e",
"64189fc613c1c4c3aaeeb6bb12b38d85dd6728cafd2261a5a88f1b77b10fe59c",
),
V070_SOURCE_PAIR, # llama.cpp v0.7.0 / KleidiAI v1.31.0
V080_SOURCE_PAIR, # llama.cpp v0.8.0 8642541b255bfb5dc39cd351a178be09013a55d6 / KleidiAI v1.32.0
V090_SOURCE_PAIR, # llama.cpp v0.9.0 cd959bae99ff4bed22bef2604f45241c09bbb8c8 / KleidiAI v1.32.0
Expand Down Expand Up @@ -87,7 +65,7 @@

# KleidiAI 1.31 moves BF16 packing into a sized assembly function. The two
# Q4_K kernels are reachable only through the SME2 + FP16 table. Do not grant
# these exceptions to legacy source pairs or accept legacy ranges for v0.7.0.
# these exceptions to older source pairs or accept older ranges for v0.7.0.
DISPATCHED_FUNCTIONS_V070 = (DISPATCHED_FUNCTIONS - {
"kai_run_lhs_pack_bf16p2vlx2_f32_sme",
}) | frozenset("""
Expand Down
Loading