Files
Strata/tools/dflash2
Niko1221 237ecb176a tools, setup: the preparation tools use strata_gguf / strata_quants; STRATA_GGUF_PY stays an override
iq_pack, embd_bf16_pack, mtp_pack, mtp_rt, nvfp4_local_pack (slim, verify), nvfp4_verify(_gguf), q8_dense_gguf, iq_fixture, the oracles and dev tools
(canonical_xcheck, ref/load.py, metal check_ref, dflash2_ref, dsv41/ref_gguf, tests/split) get their GGUF library from _paths.gguf_lib(): ours, or
llama.cpp's gguf-py when STRATA_GGUF_PY names it. setup.py stops putting STRATA_GGUF_PY into the tools' environment (gguf_py_env(): only the user's own
override). The install gate checks tools/strata_gguf.py instead of third_party/strata-gguf-py. nvfp4_convert and its converter stay on the vendored gguf-py.
2026-11-09 04:09:03 +01:00
..

DFlash2 acceptance experiment

Research tooling, not shipped with the app. It measures how many tokens per round the incoai DFlash2 drafter for Qwen3.8-Flash-Next would accept on Strata's quantized target. The measurement is offline, from hidden states the engine dumps. It is for developers who want to repeat or extend the experiment.

The scripts keep the paths of the original run (C:\dflash2-work on the development PC, C:\strata-test\dflash2 on the test box). Edit the paths before you reuse them. The method and results are in the project's internal notes and are not part of this tree.

Engine variables

Both are off unless set.

Variable Effect
STRATA_TAP_FILE=<file> Writes pos, token, taps records. Verifier::record_window copies each verified row's completed layer output (the mean of the 4 hyper-connection streams, the quantity the drafter was trained on) and Verifier::run appends it.
STRATA_TAP_LAYERS Layers to tap, default 5,15,25,35,45. Used with STRATA_TAP_FILE.
STRATA_SPEC_T_CYCLE=1,2,...,8 CLI bench only. The verify window size cycles; the report line window cost (ms/round) gives the cost of each width.

Scripts

Script Purpose
mk_prompts.py Builds chat-template prompt ids with the server's own tokenizer and template.
orch.py <prompt> <max_new> [gen,genf,genfm,tap] Drives run_one.ps1 on the test box: free generation (ids and MTP statistics), the same text with MTP only, and the teacher-forced tap dump with oracle drafts (--spec 8 --spec-oracle --spec-follow, a 2-token prompt, because a native pack never starts the speculative loop from a 1-token prompt).
dflash2_ref.py Plain-torch port of z-lab's DFlash2DraftModel, with the target's embedding and head dequantized from the GGUF. test_port.py checks it against the original.
run_eval.py Walks the tap file with a few block sizes.
run_all2.py Evaluates every position, resumable: per-anchor correctness and the selector's confidences.
analyze2.py, final_tables.py Moved to history/tools/dflash2: policies, and speed estimates from the measured window costs. They read result files that only exist in C:\dflash2-work on the original PC.