The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: TypeError
Message: Couldn't cast array of type
struct<name: string, tps: double, n: int64, wall: double, draft_n: int64, draft_accepted: int64, acc: double, prompt_ms: double, timings: struct<cache_n: int64, prompt_n: int64, prompt_ms: double, prompt_per_token_ms: double, prompt_per_second: double, predicted_n: int64, predicted_ms: double, predicted_per_token_ms: double, predicted_per_second: double, draft_n: int64, draft_n_accepted: int64>>
to
{'name': Value('string'), 'tps': Value('float64'), 'n': Value('int64'), 'wall': Value('float64'), 'dn': Value('int64'), 'da': Value('int64')}
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2373, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2398, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2118, in cast_array_to_feature
casted_array_values = _c(array.values, feature.feature)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2158, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<name: string, tps: double, n: int64, wall: double, draft_n: int64, draft_accepted: int64, acc: double, prompt_ms: double, timings: struct<cache_n: int64, prompt_n: int64, prompt_ms: double, prompt_per_token_ms: double, prompt_per_second: double, predicted_n: int64, predicted_ms: double, predicted_per_token_ms: double, predicted_per_second: double, draft_n: int64, draft_n_accepted: int64>>
to
{'name': Value('string'), 'tps': Value('float64'), 'n': Value('int64'), 'wall': Value('float64'), 'dn': Value('int64'), 'da': Value('int64')}Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Ternary-Bonsai-2-27B + in-file MTP: reproduction bundle (RTX 4080 SUPER, Ada/SM89)
This repository holds the raw data. The method (build script, harness, launch units, write-up) lives on GitHub: https://github.com/zhaoyilun/bonsai2-27b-mtp-repro
Both are the same piece of work: the GitHub repo has the code and the how-to, this dataset has the measurements it produced. Cross-linked in both directions.
Raw measurements, scripts and notes for the two discussions:
- official model repo: https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf/discussions/23
- drafter repo: https://huggingface.co/ProCreations/Ternary-Bonsai-2-27B-MTP/discussions/2
Headline: with the MTP block packaged inside the target GGUF (so the draft context is created against the target and shares its vocabulary), MTP speculative decoding gives a median 1.338x decode speedup (range 1.23xβ1.70x, aggregate draft acceptance 68.1%, 803/1180) on a single 16 GB Ada card β after working around a hard guard in the official fork that refuses the MTP graph on Hadamard-folded weights.
Environment
| item | value |
|---|---|
| GPU | NVIDIA RTX 4080 SUPER, 16376 MiB (Ada, SM89) |
| Driver / toolkit | CUDA UMD 13.3, CUDA toolkit 13.3.73 |
| Host | WSL2 (kernel 5.15), 32-core CPU, 46 GB RAM |
| Model | ProCreations/Ternary-Bonsai-2-27B-MTP β Ternary-Bonsai-2-27B-PQ2_0-MTP-Q8_0.gguf, 7.66 GB, sha256 3cb3f0056d2e34ee44245a64396004a21f8492573d6ce1266ec4b7222c131dd4 (matches the publisher's SHA256SUMS) |
| Runtime | built from runtime/prism-dflash2-source.tar.gz, sha256 8c0f589673b25574f27f013bb3278824384eb35eb984034a2445af3c437b9d05, base d8f26ee, -DCMAKE_CUDA_ARCHITECTURES=89 |
The published prebuilt runtime archive is CUDA 13.3 SM120 (Blackwell) only, so on Ada it has to be built from the source they ship. Build on 32 cores: 484 targets, ~9 minutes.
One gotcha worth knowing: with nvcc not on PATH, CMake fails with CMAKE_CUDA_COMPILER-NOTFOUND unless the
compiler is passed explicitly:
cmake -S llama -B llama/build -G Ninja -DGGML_CUDA=ON \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
-DCMAKE_CUDA_ARCHITECTURES=89 -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=OFF
cmake --build llama/build -j 28 --target llama-server llama-bench
The blocker on the official fork, and the fix
prism-b10683-d8f26ee refuses to create the MTP context for this file:
E llama_init_from_model: failed to initialize the context: Hadamard-latent table 'token_embd.weight' is read without the inverse transform
E common_speculative_init_result: failed to create MTP context
The guard is llama_verify_hadamard_graph (both strings are visible in libllama.so); no flag bypasses it. The MTP
graph reads token_embd with a plain ggml_get_rows, but the table is stored in the rotated (Hadamard-latent) basis.
The fix is to apply the inverse transform to that lookup β runtime/bonsai-mtp-embedding.patch in the drafter repo
does exactly that in src/models/qwen35.cpp::graph_mtp, and the source archive already contains it.
Results
A/B, 12 prompts x 5 categories, n_predict = 128
Both arms identical except --spec-type:
llama-server -m Ternary-Bonsai-2-27B-PQ2_0-MTP-Q8_0.gguf \
-ngl 99 -fa on -c 262144 -ctk q4_0 -ctv q4_0 -np 1 -t 16 --temp 0 \
--spec-type none # arm A
--spec-type draft-mtp --spec-draft-n-max 2 # arm B
Sampling: POST /completion, temperature=0, top_k=1, seed=7, cache_prompt=false. Acceptance is read from the
response timings object (draft_n, draft_n_accepted) β llama-cli does not print acceptance, only the server does.
| # | prompt (abbrev.) | baseline t/s | draft-mtp t/s | speedup | acceptance | accepted/drafted |
|---|---|---|---|---|---|---|
| R1 | reasoning prose | 67.2 | 88.0 | 1.31x | 57.6% | 68/118 |
| R2 | reasoning prose | 65.4 | 82.0 | 1.25x | 47.7% | 62/130 |
| R3 | reasoning prose | 66.6 | 84.6 | 1.27x | 57.6% | 68/118 |
| C1 | Python continuation | 67.1 | 99.8 | 1.49x | 77.0% | 77/100 |
| C2 | Python continuation | 67.4 | 114.8 | 1.70x | 94.3% | 83/88 |
| C3 | async Python | 67.7 | 89.2 | 1.32x | 62.5% | 70/112 |
| M1 | step-by-step math | 68.1 | 97.2 | 1.43x | 72.1% | 75/104 |
| M2 | probability recursion | 68.2 | 84.0 | 1.23x | 54.5% | 66/121 |
| F1 | JSON repetition | 68.3 | 111.5 | 1.63x | 90.0% | 81/90 |
| F2 | list continuation | 68.3 | 112.3 | 1.64x | 92.1% | 82/89 |
| Z1 | Chinese rewrite | 68.5 | 91.7 | 1.34x | 64.5% | 71/110 |
| median | 67.5 | 90.4 | 1.338x | 68.1% | 803/1180 |
By category: code 1.32β1.70x (acceptance 62β94%), format/repetitive 1.63β1.64x (90β92%), math 1.23β1.43x, reasoning prose 1.25β1.31x (48β58%). The pattern is the usual one: speculation pays where text is predictable.
A 12th prompt (a second Chinese prompt) stopped after 1 token with
stop_type=eosand empty content in both arms β an artifact of raw/completionwithout a chat template, not a model defect. It is recorded inab_base.json/ab_mtp.jsonand excluded from the statistics above.
Draft length
--spec-draft-n-max 2 vs 3 on a 3-prompt quick set: 82.4 vs 83.0 t/s total (acceptance 69.9% vs 59.0%).
Roughly a wash; lower draft length favors repetitive text, higher favors code.
Independent verification (third party)
Both the failure and the fix were reproduced on entirely different hardware β RDNA3 / ROCm 6.4 / Windows 11
(RX 7900 XTX, gfx1100) β reported on PR #205:
identical latent lookup 'mtp_tok_embd-64' failure without the patch, then decode 41.6 -> 75.9 t/s (1.82x) with
it at 0.82 acceptance and 2.64 tokens committed per round. On this machine (Ada/CUDA) the same fix gives
~67 -> ~90 t/s (1.34x) at 0.68 aggregate acceptance.
The multiples differ because the baselines differ: speculation pays more where the target decodes slower, since the draft's roughly fixed per-round cost is then a smaller fraction of a round. The depth sweep below shows the same effect along the context axis β decode falls 87 -> 35 t/s while acceptance rises 66% -> 84%.
Long context (chat path, natural text, exact depths via /tokenize)
| depth (tokens) | prefill t/s (MTP) | decode t/s (MTP) | acceptance | decode t/s (no spec) | MTP speedup |
|---|---|---|---|---|---|
| 8,020 | 1855 | 86.9 | 65.8% | 63.0 | 1.38x |
| 31,939 | 1674 | 62.4 | 52.2% | 53.7 | 1.16x |
| 64,084 | 1332 | 55.4 | 67.9% | 43.4 | 1.28x |
| 127,870 | 974 | 46.1 | 82.3% | 33.3 | 1.38x |
| 191,099 | 722 | 35.0 | 84.1% | 26.5 | 1.32x |
Decode falls hard with depth (87 -> 35 t/s with MTP; 63 -> 26.5 without) β that is KV cache traffic, and it dominates long-context interactivity far more than the weight packing does. MTP's edge does not decay with depth (1.16-1.38x); acceptance actually rises (66% -> 84%) because a long natural-text context constrains the continuation while the draft's own cost stays flat.
Gotcha for anyone measuring this: timings.prompt_n reports only the newly evaluated tokens. A
191k-token prompt can come back as prompt_n = 63745 because llama-server reuses the cached prefix; the server
log shows n_tokens = 191139, truncated = 0, so nothing is being dropped. Interleaving a short "cache buster"
request does not evict the checkpoints β use POST /tokenize for the true length, or sum the incremental
prompt_ms across a cumulative ladder.
Prefix reuse (same config, no speculation)
Re-sending an identical 12,485-token prompt evaluates only prompt_n = 4 tokens in 0.28 s (0.4 s wall). So a
continuing conversation does not repay prefill; switching conversations does (single KV slot, -np 1).
16 GB VRAM: KV precision is the trap, context size is not
config (-c 262144) |
prefill (12.5k prompt) | decode | VRAM |
|---|---|---|---|
PQ2_0 + MTP, -ctk q8_0 -ctv q8_0 |
101 β 35 t/s (10,240 tokens took 293 s) | β | 15.7 GiB |
PQ2_0 + MTP, -ctk q4_0 -ctv q4_0 |
1726 t/s | 90.4 t/s (median) | 15.7 GiB |
PTQ1_0 (no MTP), -ctk q4_0 -ctv q4_0 |
1073 t/s | ~76 t/s | 12.4 GiB |
The common_fit_params: failed to fit params to free device memory warning appears in the q4_0/262144 state too,
but performance is unaffected β the prefill collapse tracks KV cache size, not the warning. Also note PQ2_0
prefill here is 1.6x faster than PTQ1_0 at the same context, consistent with the model card.
Files
| file | what |
|---|---|
mtp_ab.py |
the 12-prompt A/B harness (reads draft_n/draft_n_accepted from timings) |
ab_driver.sh |
launches one arm as a transient unit, runs the harness, tears down |
mtp_bench.py |
smaller 3-prompt quick bench |
run_mtp_ab2.sh |
single-arm driver |
ab_base.json, ab_mtp.json |
raw per-prompt results and timings for both arms |
mtp_n3.json |
--spec-draft-n-max 3 arm |
What was NOT measured
The official 14-benchmark suite; multi-run means per prompt (each prompt was run once); contexts beyond 262,144; CPU-only runs; DFlash2 head comparison. These are single-machine measurements and should be read as such.
Credits
Model: prism-ml/Ternary-Bonsai-2-27B-gguf (Apache 2.0). MTP head, patch and patched runtime source:
ProCreations/Ternary-Bonsai-2-27B-MTP. This bundle only records an independent reproduction on Ada/SM89 plus
the measurement protocol.
- Downloads last month
- 897
