diff --git a/.github/workflows/no-gpu.yml b/.github/workflows/no-gpu.yml index 03ce4571f80..f439ff6c73e 100644 --- a/.github/workflows/no-gpu.yml +++ b/.github/workflows/no-gpu.yml @@ -71,6 +71,9 @@ jobs: python3 tools/zig/cuda_common_check.py python3 tools/zig/cuda_fragment_check.py python3 -m unittest discover -s tools/zig -p cuda_common_check_test.py -v + # check-pdl-loads needs nvcc; its SASS rules and planted early reads are checked here on fixtures. + - name: Dependent-launch SASS checker fixtures + run: python3 tools/test_pdl_early_loads.py -v # The lean rule (600-line files, one-line comments within 120 columns, no direct getenv of a setting): no problem the base branch lacks. - name: lean check if: ${{ github.event_name != 'schedule' }} @@ -154,8 +157,8 @@ jobs: run: zig build -Dfixed-cpu test-golden # The serving pins ran only in the nightly, so a PR that touched a pinned file landed green and turned the # next nightly red (10-12 Nov). Run them on every PR: a changed pinned file needs its re-pin in the same PR. - - name: zig build test-gradient-serving test-qwen-serving-host - run: zig build -Dfixed-cpu test-gradient-serving test-qwen-serving-host + - name: zig build test-gradient-serving test-qwen-serving-host test-glm-pdl-scan + run: zig build -Dfixed-cpu test-gradient-serving test-qwen-serving-host test-glm-pdl-scan # Hostile HTTP framing, API keys and download paths, on the CPU. - name: zig build test-server-security test-pull-security run: zig build -Dfixed-cpu test-server-security test-pull-security diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a7866e6a9..8ad51d38b03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,127 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel ## Unreleased -- Nemotron on HIP: a checkpoint whose token table (`backbone.embeddings`) is stored bf16 beside quantized matrices, marked `false` in config.json's quantization block or stored without scales, is admitted and loads; its rows are gathered as stored, the memory plan counts them at their stored bytes, and the startup label adds `+bf16-embed`; a bf16 `lm_head`, projection or other unquantized tensor is still refused by name (#3575, refs #3061). Thanks to @gilby. +- Qwen on CUDA: a development build for sm_110 (`-Dsm=110`, NVIDIA Thor) refuses by name, before paging or weight loading, the modes not qualified there: `--slide`, a DSpine `--drafter`, `TF_DSPINE_WINDOW`, `--kv-cache fp8`, `--prompt-precision int8`, `--rope-yarn`, `TF_QWEN_KV_PAGES`, `TF_QWEN_KV_PAGES_ALL=1`, `TF_QWEN_KV_SHARE`, `TF_QWEN_REQUEST_STARTS=1`, `TF_QWEN_KV_PAGE_TEST`, `TF_QWEN_KEEP_LATE=1`, `TF_NO_TREES` and `TF_DRAFT_NODES`; the default path and the DFlash2 drafter are still served, and other GPUs are unchanged (#3057, refs #2319). Thanks to @yguanrong. -- GLM-5.3-Flash on Metal: prompt index scores read each row's queries once per tile and routed-expert gathers load the next step's codes ahead, so follow-up turns reach the first token sooner with unchanged outputs (#3458). +- CUDA: a Flash Next prompt pass holds 3,072 rows while other streams decode (it held 1,536), so a long prompt beside running streams takes half as many passes (#3726). Thanks to @BadAd84. + +- GLM-5.3-Flash on CUDA: the sampled draw takes its rule from the shared `cuda.sample.rule`, as MiniMax M3 does, instead of building its own copy with a fixed `near` value (#3705, part of #2680). Thanks to @jschmied. + + + +- Server: `GET /v1/models/{id}` (and `/models/{id}`) returns the entry `/v1/models` lists for the served name or an alias, the id sent as written or percent-escaped (`org%2Fname`); any other id is a 404 `model_not_found`, and API keys and key scopes treat the route as they treat `/v1/models` (#3535). + +- Server: the next turn's background prefill puts the reply's reasoning into its guess when the client sends reasoning back, so thinking requests resume from the real next prompt instead of redoing the pass from before the reply; clients whose history drops reasoning keep the old guess (#3264). + +- Core: size KV page-retirement bookkeeping by retired pages, preserving reader fences, page reuse and trim state instead of clearing a context-sized token table on the first trim (#3852). + +- HIP: an EXL3 input rotation and trellis linear kernel group (`exl3/exl3.hip`) at 2 to 8 bits, the HIP side of the projection DeepSeek-V4.1's CUDA path calls for its head, Engram's `wkv` and the indexer's `wk`, with sums in a fixed order so a row's bits do not depend on the rows beside it; nothing serves through it yet (#3314, refs #2065). Thanks to @Shoestring-dev. + +- Model configs: a `config.json` head count of 0 is refused by name before any division instead of panicking, for Qwen 3.5 on HIP (`ZeroHeadCount`), Nemotron, the Gemma 4 DFlash drafter on Metal and DeepSeek-V4.1's Metal vision config (#3777). Thanks to @jschmied. + +- GLM-5.3-Flash on CUDA: GLM's kernels and qmmf's decode linears launch as programmatic dependent launches, so a decode token's kernels lose most of their launch gaps; experts, the router plan and the RoCE exchange stay plain launches, a prompt chunk's KDA chain launches plain from 64 rows, and `TF_GLM_PDL=0` launches everything plain (#3776, refs #3652). Thanks to @ultradaoto. + + + +- dots.mocr on CUDA: `--vision` now serves images through the image tower instead of refusing them, within the request's `--vision-image-tokens` budget; text-only replies keep their pinned hashes, and the GB10 runner gains `tf-cuda-test dots-text` (three prompts of our own, served with and without `--vision`, against pinned reply hashes) and `dots-invariants` (image prompts cut into chunks against the uncut run) (#2771, refs #1927). Thanks to @laudney. + +- Qwen3.8-27B on Metal before M5: decode rounds read their cached keys through the prefix kernels, as on an M5, and prompt passes size their memory the same way; `TF_QWEN27_SHARED_PREFIX=0` keeps cached keys on the tail kernel (#3677, refs #3604). Thanks to @hobbesd. + +- `tensorfold chat`: `tensorfold chat MODEL` starts its own `tensorfold serve` on a free loopback port with a fresh key, streams each reply in the terminal and stops the server when the chat ends, and `--url URL [MODEL]` chats with a running server instead; flags after `--` go to the started server, `/bye`, `/clear`, `/system` and `/help` work in the chat, and piped stdin is sent as one message with only the reply on stdout (#3538). + +- Muse Spark Open on CUDA: served on two GB10s from a 1.8-bit EXL3 pack with the prompt cache on, on main's shared EXL3 code with its own attention, norm, router and head kernels; any other GPU or number of GPUs is refused by name, and the recipe serves it without a drafter (#1295). Thanks to @ajensenwaud. + +- Desktop: the model benchmark accepts the engine's community-v2 suite (and community-v1 receipts from older engines) instead of ending every run "protocol not satisfied", and a run that fails or is cut short keeps its checked hardware, engine version and checkpoint details (#4031, fixes #3942). + +- Desktop: an MCP server's startup diagnostics reach the Plugins preview as whole lines, masked as a whole and capped at 64 KiB, instead of one row per stderr write (#3759). Thanks to @AIFlowML. + + + +- Flash Next on HIP: the prompt chunk fallback counts the window plan's slot bytes as used before deciding whether a smaller chunk admits more streams, where it counted them as free and could keep the larger chunk (#3419). Thanks to @gilby. + +- DeepSeek-V4.1 on Metal: its GPU work goes through a Metal 4 command queue by default where the Mac has one (macOS 26 and later), with the same kernels in the same order and bit-identical outputs; `TF_METAL4=0` keeps Metal 3, `TF_METAL4_TIMELINE=n` logs per-stage GPU times for n rounds of each kind, and `TF_DSV41_ROUND_PROF=1` logs decode rounds' host and GPU milliseconds (#3374). + + + +- Flash Next on HIP: the verify window holds eight rows instead of four, so a stream alone in a round can land copy drafts of up to seven tokens a round; rounds shared by several streams keep three-token copies, MTP still drafts at most three, and each stream's window snapshots take more device memory, which admission counts (#2730). Thanks to @gilby. + +- OCR: the native HIP engine reads documents through `POST /v1/ocr` in Mistral's OCR contract (its Python and TypeScript SDKs), with dots.mocr's reader (a box for each layout block). Images and PDFs (`--vision-pdf`) share one page budget per request (`TENSORFOLD_MAX_PDF_PAGES`, default 16), each PDF measured before any inference and each page rendered just before it is read, and Mistral crops share one image budget (256 images, 4 times the page pixels, 16 MiB plus 2 MiB a page). An option that changes content and that TensorFold cannot apply, such as annotations, is refused. A page cut at the context limit or out of its model's format fails the whole request with HTTP 422; `docs/api.md` lists the contract's fields, statuses and limits (#2570, #2571, #2440). Thanks to @laudney. + +- CUDA: with `TF_FLASHNEXT_KV_PAGES` on Linux, the Flash Next page pool no longer takes its whole arena at load: its 256 MiB pieces are mapped as streams first reach them, and a helper thread maps the next ones between requests, so at 262,144 x 3 on a GB10 about 14 GiB more stays free after load (MemAvailable 40.8-41.6 GiB against 26.5-27.0). Replies are unchanged; without `TF_FLASHNEXT_KV_PAGES`, and on other systems, nothing changes (#3066). Thanks to @Arminova. + +## 1.3.0 + +- CLI: `tensorfold models` lists the chat checkpoints from the supported-models guide that fit this machine, largest first, with the memory each needs, a quality score from TensorFold Web's quality suite (receipts in `docs/receipts/quality-suite`) and a rough one-stream speed (measured on this chip, or estimated from another chip by memory bandwidth); `--all` adds the rest, `--json` adds `machine` and `catalog` to schema 1, and the cached checkpoints follow as before (#3483). + +- gpt-oss: a first host-only slice reads `openai/gpt-oss-20b`'s config and refuses unknown or unsupported fields by name, checks all 459 tensor names of the published checkpoint, and adds an MXFP4 reader for 32-value E2M1 blocks with UE8M0 scales that never rewrites checkpoint bytes; nothing is registered with the server yet (#3513). + +- DeepSeek-V4.1 on Metal: the prompt attention kernel widens bf16 keys through the `bfloat` type and lets two heads share one load of each key, with the per-key arithmetic unchanged, so output bits are the same (#3351). + +- HIP: in multi-rank runs, a follower rank refuses a step from rank 0 whose page ids, first page index, page-copy pages, snapshot slot, Flash Next begin slot or Nemotron resume row fall outside its own pool, table or slot counts, with the same `ShortMessage` error as a short message (#3081). + +- Templates: `str.format()` renders positional fields (`{}`, `{N}`) and the `{{` `}}` escapes as Python does; signed or underscored indexes, keyword, attribute, conversion and spec fields are refused by name (#3816, refs #3801). Thanks to @atakann. + +- Qwen3.8-27B on Metal: on Macs with tensor units (M5), drafted decode rounds run two 16-row query tiles in each prefix-attention threadgroup instead of up to six, with the same kernel and the same tokens; Macs without tensor units keep six on a long cache and four otherwise (#3704). Thanks to @mrv777. + +- CUDA: with `TF_FLASHNEXT_KV_PAGES` on Linux, the Flash Next page pool no longer takes its whole arena at load: its 256 MiB pieces are mapped as streams first reach them, and a helper thread maps the next ones between requests, so at 262,144 x 3 on a GB10 about 14 GiB more stays free after load (MemAvailable 40.8-41.6 GiB against 26.5-27.0). Replies are unchanged; without `TF_FLASHNEXT_KV_PAGES`, and on other systems, nothing changes (#3066). Thanks to @Arminova. +- CUDA: with `TF_FLASHNEXT_KV_PAGES` on Linux, the Flash Next page pool no longer takes its whole arena at load: its 256 MiB pieces are mapped as streams first reach them, and a helper thread maps the next ones between requests, so more memory stays free after load. Replies are unchanged; without `TF_FLASHNEXT_KV_PAGES`, and on other systems, nothing changes (#3066). Thanks to @Arminova. + +- Server: `serve --log-json` writes each request start and end as one compact JSON object on the existing log line, with no keys, headers or bodies; default logs and `/health` stay unchanged (#3195). Thanks to @mvanhorn. + +- Qwen3.8-27B on XPU: a sampled row with `top_k` from 1 to 64, a temperature above 0 and no grammar mask draws from its `top_k` largest logits kept on the card, instead of copying the whole row to the host, with the same tokens for the same seed (#3340, lands #2895). + +- dots.mocr on CUDA: the image tower (42 blocks and the 2×2 merger) is built but not yet served, so `--vision` stays refused and replies are unchanged; two GB10 runner commands check it, `tf-cuda-test dots-image` (encodes twice, compares bytes, then checks the generated page's `vision-merged` hash against its pin) and `dots-stages` (writes each stage's rows as `.npy` for the oracle) (#2770, refs #1927). Thanks to @laudney. + +- HIP on RDNA3.5: lane-round routed MoE plan buffers (`moe.planRows`) are sized to the exact window row count instead of the 16-row bucket, and rising added-row window costs are pooled within four-row tile steps (`costs.poolWindowRows`) so a tile step never prices an earlier draft step under a later one; no kernel or output token changes (#3774). Thanks to @gilby. + +- Model configs: Qwen 3.5 on CUDA and HIP and Qwen3.8-27B on Metal read their config fields through one typed reader and named end-of-sequence policies, with the same refusals and stop sets as before; a refused field now logs the file and field it came from (#3716, for #2460). Thanks to @jschmied. + +- GLM on CUDA: the window-cost cache is keyed by `TF_GLM_KDA_PAD`, `TF_ROCE`, `TF_GLM_PDL` and `TF_GLM_DSEL` too, so changing one of them times the windows again instead of reusing prices measured under the other value (#3495, fixes #3493). Thanks to @ultradaoto. + +- Server: stored Responses belong to the API key that created them. Other keys get the unknown-ID error on reads, continuations, deletion and live cancellation; keyless and single-key callers retain their own history (#3756). + +- CUDA: `nccl.Library.open()` and the tensor-parallel config now resolve `TF_NCCL_LIB` through the shared path rule, so GLM, Flash Next's `--tp 2` collective, MiniMax M3 and TP sessions open the same library; unset, empty or blank values keep `libnccl.so.2`, and a value with control characters is refused (#3106). Thanks to @vdalesandro. + +- Server: replies in recipient-addressed messages (`to=self` … `<|eom|>`, `to=user` … `<|eot|>`, as Muse Spark Open's chat template writes them) are split into reasoning, answer and tool calls, where the whole reply, markers included, ended up in `content` (#1336). Thanks to @ajensenwaud. + +- Core prompt cache: the radix store can keep a checkpoint inside a page as a writable tail, a store-held copy of that page's rows that is never written again; no family turns tails on yet, so every current store behaves as before (#3329, part of #2444). Thanks to @laudney. + +- CUDA: on a GB10, the one-launch path for two to four affine-4 prompt projections (`tf_qmm_prefill_many`) works out each thread's copy addresses once, before the K loop, instead of at every stage; the copies, their order and the math are unchanged (#2825). Thanks to @GumbiiDigital. + +- Inkling 2 Small: a host-only family package reads its config, checkpoint names and chat template and checks them against fixtures from the published release; nothing serves it yet (#3578, refs #3476). Thanks to @Nipale-ai. + +- App: Room agents keep their own reasoning effort, and an agent without one inherits the run's default (#3514). Thanks to @AIFlowML. + +- Tests: the Zig cache restat tests read `.lib_dir` from `zig env` instead of guessing a `lib` folder beside the executable, so they work with Homebrew Zig (#3786, fixes #3785). Thanks to @AIFlowML. + +- `tensorfold web`: after a PATH miss, the launcher looks in uv's tool directory for an existing Web executable before offering an install; PATH still wins and installing still needs an explicit yes (#3748, fixes #3747). Thanks to @AIFlowML. + +- Tests: the Metal kernel-contract gate checks the four `dsv41 xmma units` launches only where tensor units exist, so Gate 5 limits pass on Macs without them while the four simdgroup launches stay checked everywhere (#3522). Thanks to @gilby. + +- `tensorfold device`: a saved macOS profile is refreshed when the live GPU wired-memory limit changes, so the reported available weight bytes match the current limit (#3780, fixes #3778). Thanks to @AIFlowML. + +- GLM-5.3-Flash on CUDA: while rank 0's vision tower encodes a prompt's images, the other ranks sleep on their liveness lines instead of waiting in a collective receive for the whole pass, so a long image pass no longer trips a net plugin's operation timeout and stops every rank; replies are unchanged (#3675, for #3614). Thanks to @ultradaoto. +- Desktop: a Qwen3.8-27B checkpoint is offered and loads, where the library applied the 2B geometry to every `qwen3_5` checkpoint and rejected the supported 27B at hidden size 5,120 (#3771). Thanks to @AIFlowML. + +- Intel Arc (XPU): two or four Level Zero GPUs open as peers in one context, with new peer-to-peer all-reduce collectives (FP16, BF16 and FP32; one shot up to 512 KiB, reduce-scatter then gather above) that sum in fixed rank order for exact bits, and `zig build xpu-tp-bench` builds `tf-xpu-tp-bench` to check and time them; nothing serves through them yet (#3585, part of #3583). Thanks to @supernovae. + +- Gemma 4 on Metal: an image input whose tower cannot load is refused cleanly instead of crashing during deinit, and a host test pins that a failed tower load leaves the model with none (#3421). Thanks to @jschmied. + +- Changelog: #3125's entry appears once, under 1.2.10; the copy in 1.2.9's section, a release published before #3125 landed, is removed (#3916, refs #3125). Thanks to @Bizuayeu. + +- HIP: Qwen 3.5 prices a lone stream's copy windows (suffix matches from the prompt or the reply) from its own timed rounds, so a copy that would cost more than it lands is cut to its best prefix or left off, and keeps those prices across requests; replies are unchanged, and other families opt in through `copy_guard` (#3728, fixes #3390). Thanks to @AbrahamCete. + +- DeepSeek-V4.1 on Metal: with `TF_DSV41_PREFILL_PIECES=1`, `TENSORFOLD_PREFILL_ORDER=srpt`, a prompt policy, share or budget, or `--decode-share` set, a prompt runs a chunk at a time between the other streams' rounds, so a short request no longer waits behind a long prompt; with none of them set, prompts run whole as before (#2950, refs #2984). Thanks to @gilby. + +- `tensorfold info` on Metal: `tensorfold info MODEL [--context N] [--parallel N|auto]` prints the startup budget `serve` charges a Qwen3.8-27B-class checkpoint (weights, each stream's KV and state, the prompt scratch; no drafter or images) and whether it fits this Mac's Metal working set beside the 8 GiB margin, in place of a memory floor that ignored the context; `info` also copies `model_type` out of the parse before freeing it (#3268, refs #2761). Thanks to @cshintov. + +- Nemotron on HIP: a checkpoint whose token table (`backbone.embeddings`) is stored bf16 beside quantized matrices, marked `false` in config.json's quantization block or stored without scales, is admitted and loads; its rows are gathered as stored, the memory plan counts them at their stored bytes, and the startup label adds `+bf16-embed`; a bf16 `lm_head`, projection or other unquantized tensor is still refused by name (#3575, refs #3061). Thanks to @gilby. + +- GLM-5.3-Flash on Metal: prompt index scores read each row's queries once per tile and routed-expert gathers load the next step's codes ahead, so follow-up turns reach the first token sooner with unchanged outputs (#3458). + - Web: an explicit relative `--token-file` path for the service installer is anchored to the directory it is run from, so the file the installer prepares and the file the generated launcher opens are the same; the default path and symlink handling are unchanged (#3838, fixes #3835). Thanks to @AIFlowML. - Tests: `test-pull-host` no longer hangs on macOS, where the test allocator's stack capture on frees from the client's I/O threads deadlocked in Zig's Mach-O unwinder (#3740). @@ -22,24 +137,18 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel - Tests: a two-session KV isolation test pins that kept states across spill, offload and page reuse match by tokens only, never position (#3840). -- CI: the last four host checks excluded under #2031 return to the aggregate; recording fixtures initialize runner state and affine kernel handles. -- Server: `GET /v1/models/{id}` (and `/models/{id}`) returns the entry `/v1/models` lists for the served name or an alias, the id sent as written or percent-escaped (`org%2Fname`); any other id is a 404 `model_not_found`, and API keys and key scopes treat the route as they treat `/v1/models` (#3535). - CUDA and HIP: Qwen 3.5 settings go through the environment rules, so malformed text is refused at startup with the setting's name and accepted forms; names, defaults and clamps are unchanged (#3520). -- Qwen3.8-27B on Metal: tensor-unit qk projections, flat glue kernels and Metal 4 verify passes each have their own off switch (`TF_Q27_QK=0`, `TF_Q27_FLAT_GLUE=0`, `TF_Q27_METAL4=0`) and are bit-identical to the kernels they replace; qk and Metal 4 stay off on chips without tensor units (#2342). - Tools: the served gates (`tools/conformance.py`, the Qwen and LFM3 serve checks and the Qwen3.8-27B HTTP gate) prove they ran what they claim: drafts landed, the sampler and the prompt cache were used, and concurrent requests overlapped (#3708, follows #2460). Thanks to @jschmied. -- GLM on CUDA: a decode window's EXL3 routed experts launch on the 16-pair item plan instead of the group kernel's grid of mostly idle blocks, with the same output bytes (#2044). Thanks to @BadAd84. - Docs: the optimization ledger adds rows 30 to 32 (small-kernel fusion, stream-tile prefetch and the filled-item prompt grid), each `failed` for Flash Next on HIP with the measurements from #1603 (#3160, refs #1603). Thanks to @gilby. - Docs: the Qwen3.8-27B recipe says to serve with `--thinking-budget 4096` when thinking is on, and gives its GPQA Diamond result on TensorFold 1.2.7 and one GB10: replies cut at the limit from 78 of 198 to 0, and correct from 58.1% to 82.8% (#3373, fixes #3323). - - - Idol on CUDA: `tf-idol` runs Idol's denoiser on GB10 (sm_121) and on RTX 50-series and RTX PRO Blackwell (sm_120) cards against a reference case, gated step by step against idol-sdk's float32 run as on Metal, and refuses other GPUs by name (#1767, for #1757). Thanks to @jayleaton, with device runs from @GustavBlack and @Nipale-ai. - Docs: the drafter training recipe gains a section on adapting an already released drafter, budgeted from a few passes over the scarcest class at a low learning rate with early checkpoints, with the Qwen3.8-27B pilot behind it (#3369, refs #2667). Thanks to @Maxrio9. @@ -132,6 +241,7 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel - Web: the packaged stand-in reports the current native version after a native release bump, and Web CI now runs when `build.zig.zon` changes with a build check that the committed packaged version is fresh (#3745, fixes #3739). Thanks to @AIFlowML. + ## 1.2.10 - Server: `background: true` on `POST /v1/responses` answers at once with a queued response and generates the reply after the POST returns; `GET /v1/responses/{id}` polls it and `POST /v1/responses/{id}/cancel` or `DELETE` stops it, at most 64 are queued or running per server (16 per key, 256 MiB of copied requests) before a create answers 429, and `stream: true` with `background` is refused (#3220). @@ -397,6 +507,7 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel - GLM-5.3-Flash on CUDA with `TF_KV_SHARE` and no `--prompt-cache-gib`: the kept states' slots, `TF_KV_SHARE` at most, now come where an asked cache goes, before the windows past the engine's own, so a room that holds one more whole window no longer keeps fewer states; Jammed XSFP4 at TP=3 on three GB10s keeps all 32 at `TF_KV_SHARE=32` instead of 8, with the same tokens (#3125). Thanks to @Bizuayeu. - Metal: Baidu's Unlimited-OCR-2 is served natively from its BF16 release on M5-class Macs: page images through `serve --vision`, the family's chat template built in, its SAM and CLIP image encoders and decoder under the kernel contract; on five reference pages every departure from the release's own reply is a one-step tie (#2074). Thanks to @BobClawblaw. + ## 1.2.9 - Flash Next on CUDA: a lone stream draws on its own path again; the batched draws #2927 added now run only when two or more streams share a step, so one sampled stream no longer pays the group's whole-buffer download each step. Tokens are unchanged (#3391, after #2927). @@ -432,8 +543,6 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel is identical to the release's own `infer` in torch bf16, or departs from it only where two candidate tokens lie within one bf16 step of each other, the same two torch's float32 run weighs. The five-page document is served the same way; its departures are listed in the recipe beside float32's (#2074). Thanks to @BobClawblaw. -- GLM-5.3-Flash on CUDA with `TF_KV_SHARE` and no `--prompt-cache-gib`: the kept states' slots, `TF_KV_SHARE` at most, now come where an asked cache goes, before the windows past the engine's own, so a room that holds one more whole window no longer keeps fewer states; Jammed XSFP4 at TP=3 on three GB10s keeps all 32 at `TF_KV_SHARE=32` instead of 8, with the same tokens (#3125). Thanks to @Bizuayeu. - - Server: with thinking off, the reasoning effort a request names reaches the chat template (GLM's head follows it), and the reply reports it; a server's own `--reasoning-effort` no longer changes a thinking-off prompt (#3017, fixes #1911). Thanks to @ss-cong for the report. diff --git a/README.md b/README.md index 870a9a3dc98..7ff125609e5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Needs glibc 2.28 or newer and NVIDIA driver R580 or newer (CUDA 13.0). The [run lists the archive's requirements; Windows has [its own guide](docs/WINDOWS.md). ```sh -V=1.2.10 +V=1.3.0 case "$(uname -m)" in aarch64|arm64) PLATFORM=linux-aarch64 ;; x86_64) PLATFORM=linux-x86_64 ;; @@ -64,6 +64,17 @@ curl -fsS http://127.0.0.1:8080/v1/chat/completions \ The API also serves completions, Responses and Anthropic Messages. `/v1/models` lists the served name. +To talk to a model in the terminal in one command, `tensorfold chat MODEL` starts the server itself, streams each +reply and stops the server when the chat ends; `/help` lists the chat's commands, and `/bye` or Ctrl-D ends it: + +```sh +tensorfold chat mlx-community/Qwen3.5-2B-MLX-4bit +``` + +With the server above still running, `tensorfold chat --url http://127.0.0.1:8080` chats with it instead, and +`echo "Say hello." | tensorfold chat --url http://127.0.0.1:8080` prints one reply for a script. +See [the chat command](docs/chat.md) for its flags and the serve flags it passes on. + ## Docs - [Run guide](docs/run-guide.md): platform setup, requests, parallel requests, exact decoding, context compaction, diff --git a/RUNBOOK.md b/RUNBOOK.md index 945a87b4082..5109d6d60a9 100644 --- a/RUNBOOK.md +++ b/RUNBOOK.md @@ -19,7 +19,7 @@ For an archive installation, download the arm64 asset and its companion checksum [latest release](https://github.com/ashhart/TensorFold/releases/latest), with `V` set to its version: ```sh -V=1.2.10 +V=1.3.0 curl -fLO https://github.com/ashhart/TensorFold/releases/download/v$V/tensorfold-$V-macos-arm64.tar.gz curl -fLO https://github.com/ashhart/TensorFold/releases/download/v$V/tensorfold-$V-macos-arm64.tar.gz.sha256 shasum -a 256 -c tensorfold-$V-macos-arm64.tar.gz.sha256 @@ -210,7 +210,7 @@ Qwen4 has synthetic gates only. On a GB10 arm64 host (an x86_64 host uses `linux-x86_64` in the same commands): ```sh -V=1.2.10 +V=1.3.0 curl -fLO https://github.com/ashhart/TensorFold/releases/download/v$V/tensorfold-$V-linux-aarch64.tar.gz curl -fLO https://github.com/ashhart/TensorFold/releases/download/v$V/tensorfold-$V-linux-aarch64.tar.gz.sha256 sha256sum -c tensorfold-$V-linux-aarch64.tar.gz.sha256 @@ -494,3 +494,4 @@ Python 0.6.6 remains a separate release line. For a bug report, include the version, checkpoint revision, public reproducing request, exact command and relevant startup/request logs. `TENSORFOLD_LOG_TIME=1` starts each server log line, the `[tensorfold]` lines and every engine's warnings, with its UTC time (`2026-10-30T18:54:04.123Z [tensorfold] ...`), to match the log against other records. +`serve --log-json` writes the access, `ended` and `refused` lines as one JSON object each on that `[tensorfold]` line, with `event` set to `access`, `ended` or `refused`. `access` is written when the response starts, with the HTTP status and the request id once one is assigned. `ended` is written only when the client left or the reply failed, with `prompt` and `tokens`. `refused` is written for an error reply, before its `access` line. Long fields are cut so each line still parses. Without the flag the text lines are unchanged. JSON never includes API keys, Authorization headers or request bodies. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 1710de6711f..6f17d81d9b6 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -545,3 +545,15 @@ own code as the reference. [IN22-Gen](https://huggingface.co/datasets/ai4bharat/IN22-Gen) (AI4Bharat) in its 22 languages, unchanged, under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). It is tokenizer test input only. The composition exclusions and ZWJ/ZWNJ conjuncts after it are TensorFold's own. + +## Inkling 2 Small test fixtures + +`zig/src/families/inkling2/fixtures/` holds files and values taken from Thinking Machines' Inkling 2 Small release at +revision `2ad1157016e1aac77b6ff1b770e7c05229403134`, under the Apache License 2.0 stated on its model card (see +[the license text](LICENSES/Apache-2.0.txt)): `config.json`, `chat_template.jinja`, `mini_tokenizer.json` (its +`tokenizer.json` cut to the added tokens, the byte alphabet and the first 1,500 merges) and the prompts and ids in +`prompt_cases.json` and `mini_cases.json`, which the Hugging Face transformers and tokenizers libraries produced from +those files. `tiny_config.json` and the tensor tables +`tiny_model_header.txt` and `tiny_mtp_header.txt` describe `tiny-random/inkling-2` at revision +`0a57c72e4e5b68aafe1d983dbb62980344a5fcd7`, a randomly initialised model whose model card names that release as its base +model and states no licence; no weights are included. `tools/zig/inkling2_fixtures.py` rebuilds all of these files. diff --git a/app/docs/benchmarks.md b/app/docs/benchmarks.md index bdf0d209413..4b336bbb48a 100644 --- a/app/docs/benchmarks.md +++ b/app/docs/benchmarks.md @@ -6,7 +6,7 @@ The feature uses the bundled TensorFold 1.0.12 `benchmark` command and an instal Hugging Face checkpoint already present in the configured cache. Linked-folder models are currently unsupported; a run never downloads a model. -The standard community-v1 run uses fixed Code and Chat fixtures, temperatures 1 +The standard community-v2 run uses fixed Code and Chat fixtures, temperatures 1 and 0, five measured repetitions per cell, a 4,096-token context and a 256-token output limit. Four warm-ups plus 20 measured requests produce 24 requests in total. diff --git a/app/electron/agent/delegation-route.test.ts b/app/electron/agent/delegation-route.test.ts index c415c27e3a6..595d9f5c795 100644 --- a/app/electron/agent/delegation-route.test.ts +++ b/app/electron/agent/delegation-route.test.ts @@ -179,7 +179,7 @@ async function run() { // --- Source pins: both spawn paths route through the resolver ------------------------ { const source = (rel: string) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), 'utf8') - const roomIpc = source('../main/host/workspace-runtime-ipc.ts') + const roomIpc = source('../main/host/room-tools-runtime.ts') const delegateStart = roomIpc.indexOf('delegate: async (args, seat)') const delegateEnd = roomIpc.indexOf('read_file: async', delegateStart) assert.ok(delegateStart >= 0 && delegateEnd > delegateStart, 'room delegate tool remains discoverable') @@ -187,7 +187,7 @@ async function run() { assert.match(delegate, /resolveDelegationRoute\(store\.settings\.providers/, 'room delegate resolves the cross-model route') assert.match(delegate, /!routed\.route\) return `Cannot delegate:/, 'route errors surface as tool errors, not crashes') assert.match(delegate, /runReadOnlySubAgent\(created\.agent, prov, routed\.route\.model/, 'room delegate runs the sub-agent on the routed model') - assert.match(delegate, /parent: parentForRoomSeat\(room, s\)/, 'delegated sub-agent lineage stays under the delegating seat') + assert.match(delegate, /parent: parentForRoomSeat\(runtimeScope\.room, s\)/, 'delegated sub-agent lineage stays under the delegating seat') const threadRuntime = source('../main/host/tool-context-runtime.ts') assert.match(threadRuntime, /resolveDelegationRoute\(store\.settings\.providers/, 'thread sub-agent launcher resolves the cross-model route') diff --git a/app/electron/agent/delegation-route.ts b/app/electron/agent/delegation-route.ts index b9ebb0a0579..5af6c602825 100644 --- a/app/electron/agent/delegation-route.ts +++ b/app/electron/agent/delegation-route.ts @@ -1,4 +1,4 @@ -import type { Provider, Seat } from './types' +import type { Provider, ReasoningEffortSetting, Seat } from './types' import { resolveProviderModel, selectProviderAccount } from './provider-accounts' // Cross-model delegation routing (Traycer-style): a single spawn binds provider/account/model, @@ -10,6 +10,7 @@ export interface DelegationRouteBase { // "fall back to the active/default account" while null means "no account". providerAccountId?: string | null model: string + reasoningEffort?: ReasoningEffortSetting } export interface DelegationRouteOverride { @@ -49,10 +50,14 @@ export function resolveDelegationRoute( const seat = seats?.find((candidate) => candidate.name === targetSeat) if (!seat) return { error: `unknown seat "${targetSeat}"` } route = { providerId: seat.providerId, providerAccountId: seat.providerAccountId, model: seat.model } + if (seat.reasoningEffort !== undefined) route.reasoningEffort = seat.reasoningEffort } // A same-provider override keeps the inherited account; only a cross-provider switch // resets it (the account id is meaningless on the new provider). - if (providerId && providerId !== route.providerId) route = { providerId, model: route.model } + if (providerId && providerId !== route.providerId) { + route = { providerId, model: route.model, + ...(route.reasoningEffort === undefined ? {} : { reasoningEffort: route.reasoningEffort }) } + } const provider = providers.find((candidate) => candidate.id === route.providerId) if (!provider) return { error: `unknown provider "${route.providerId}"` } if (localOnly && provider.kind !== 'local') return { error: `provider "${provider.name}" must be a local provider for this local-only project` } diff --git a/app/electron/agent/engine/benchmark/controller.test.ts b/app/electron/agent/engine/benchmark/controller.test.ts index 33d1fac03ba..e5fd4ab3391 100644 --- a/app/electron/agent/engine/benchmark/controller.test.ts +++ b/app/electron/agent/engine/benchmark/controller.test.ts @@ -109,4 +109,22 @@ assert.equal((await quitting.controller.snapshot())?.state, 'cancelled') assert.equal((await quitting.controller.snapshot())?.restored, false) assert.equal(quitting.stats().restores, 0, 'app closing saves cancellation without reloading the previous model') await assert.rejects(quitting.controller.start({ ...input, id: 'benchmark_after_closing' }), /current local benchmark/) +const kept = fixture(); kept.missing() +const details = (({ runtime, model, hardware, settings }) => ({ runtime, model, hardware, settings }))(syntheticBenchmarkReceipt(input.model)) +let asked: unknown = null +Object.assign(kept.deps, { readDetails: async (_file: string, expected: unknown) => { asked = expected; return structuredClone(details) } }) +await kept.controller.start(input); await running(kept); kept.finish(1); await kept.controller.settle() +const keptRun = (await kept.controller.snapshot())! +assert.equal(keptRun.state, 'failed') +assert.equal(keptRun.receiptAvailable, false) +assert.deepEqual(keptRun.metadata, details, 'a failed run keeps its checked hardware, engine and checkpoint details') +assert.equal(Reflect.get(asked as object, 'engineVersion'), BENCHMARK_ENGINE_VERSION) +assert.equal((await absent.controller.snapshot())?.metadata, undefined, 'without details a failed run has no metadata') +const refused = fixture(); refused.missing() +Object.assign(refused.deps, { readDetails: async () => null }) +await refused.controller.start(input); await running(refused); refused.finish(1); await refused.controller.settle() +const refusedRun = (await refused.controller.snapshot())! +assert.equal(refusedRun.state, 'failed') +assert.equal(refusedRun.metadata, undefined, 'a receipt whose details fail their checks leaves no metadata, not null') +assert.equal(Object.hasOwn(refusedRun, 'metadata'), false) console.log('Benchmark controller exact-job admission/drain, cancel, restart/export, storage and restoration failures passed') diff --git a/app/electron/agent/engine/benchmark/controller.ts b/app/electron/agent/engine/benchmark/controller.ts index 9990e220052..faa46cd56da 100644 --- a/app/electron/agent/engine/benchmark/controller.ts +++ b/app/electron/agent/engine/benchmark/controller.ts @@ -1,6 +1,6 @@ import { isRepoId } from '../paths' import type { ModelBenchmarkInput, ModelBenchmarkReceipt, ModelBenchmarkSnapshot } from '../../../../shared/model-benchmark' -import { benchmarkCells, benchmarkProtocolComplete, parseBenchmarkReceipt } from './receipt' +import { benchmarkCells, benchmarkProtocolComplete, parseBenchmarkReceipt, type BenchmarkDetails } from './receipt' import type { BenchmarkProcessHandle } from './process' import type { ModelBenchmarkStore, SavedModelBenchmark } from './storage' import { BENCHMARK_ENGINE_VERSION } from './version' @@ -13,6 +13,7 @@ export interface ModelBenchmarkDependencies { workspace(): Promise<{ receiptPath: string; directory: string; remove(): Promise }> process(input: Required, workspace: { receiptPath: string; directory: string }, progress: (value: ModelBenchmarkSnapshot['progress']) => void, signal: AbortSignal): BenchmarkProcessHandle readReceipt(path: string, input: Required): Promise + readDetails?(path: string, expected: Required & { engineVersion: string }): Promise store: ModelBenchmarkStore changed?(snapshot: ModelBenchmarkSnapshot): void now?: () => number @@ -104,11 +105,14 @@ export class ModelBenchmarks { let duplicate = false let unsafeCleanup = false let phase: 'validation' | 'process' | 'receipt' = 'validation' + let engineVersion = BENCHMARK_ENGINE_VERSION + let checkpointChanged = false const assertAllowed = () => { if (job.controller.signal.aborted || this.disposed) throw new Error('Benchmark cancelled.'); this.deps.assertAllowed() } try { const history = await this.deps.store.list() if (history.some(record => record.snapshot.id === input.id)) { duplicate = true; throw new Error('Duplicate benchmark identifier.') } assertAllowed(); const checkpoint = await this.deps.validateModel(input.model); assertAllowed() + engineVersion = checkpoint?.engineVersion ?? BENCHMARK_ENGINE_VERSION lease = await this.deps.reserve(); job.snapshot.previousModel = lease.previousModel assertAllowed(); await lease.pause(); assertAllowed() workspace = await this.deps.workspace(); assertAllowed() @@ -124,7 +128,7 @@ export class ModelBenchmarks { const receipt = await this.deps.readReceipt(workspace.receiptPath, input) job.receipt = receipt ? parseBenchmarkReceipt(JSON.stringify(receipt), { ...input, engineVersion: checkpoint?.engineVersion ?? BENCHMARK_ENGINE_VERSION }, this.now()) : null if (job.receipt) { - if (checkpoint && (job.receipt.model.revision !== checkpoint.revision || job.receipt.model.config_sha256 !== checkpoint.configSha256)) { job.receipt = null; throw new Error('The cached checkpoint changed during the benchmark.') } + if (checkpoint && (job.receipt.model.revision !== checkpoint.revision || job.receipt.model.config_sha256 !== checkpoint.configSha256)) { job.receipt = null; checkpointChanged = true; throw new Error('The cached checkpoint changed during the benchmark.') } job.snapshot.metadata = structuredClone({ runtime: job.receipt.runtime, model: job.receipt.model, hardware: job.receipt.hardware, settings: job.receipt.settings }) job.snapshot.cells = benchmarkCells(job.receipt) job.snapshot.receiptAvailable = true @@ -142,6 +146,13 @@ export class ModelBenchmarks { else try { await lease.restore(job.restoration.signal); job.snapshot.restored = true } catch { job.snapshot.restored = false; job.snapshot.restoreError = 'The previous local model could not be restored. Reload it from My models.' } lease.release() } + // a run without a valid receipt keeps the checked hardware, engine and checkpoint details its receipt file has + if (!job.snapshot.metadata && workspace && !checkpointChanged && this.deps.readDetails) { + try { + const details = await this.deps.readDetails(workspace.receiptPath, { ...input, engineVersion }) + if (details) job.snapshot.metadata = details // a refused receipt's details fail their checks: no metadata + } catch {} + } const finalState = job.controller.signal.aborted ? 'cancelled' : job.snapshot.error || job.snapshot.restoreError || code !== 0 || !job.snapshot.cells.every(cell => cell.complete) ? 'failed' : 'complete' if (finalState === 'failed' && !job.snapshot.error && !job.snapshot.restoreError) job.snapshot.error = 'The local benchmark did not complete every measured attempt.' job.snapshot.finishedAt = this.now() diff --git a/app/electron/agent/engine/benchmark/fake-benchmark.mjs b/app/electron/agent/engine/benchmark/fake-benchmark.mjs index 5776fbeef8b..7af2c2d7b30 100644 --- a/app/electron/agent/engine/benchmark/fake-benchmark.mjs +++ b/app/electron/agent/engine/benchmark/fake-benchmark.mjs @@ -14,12 +14,13 @@ if (args[0] !== 'benchmark') { const fixture = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../test-fixtures/fake-engine.mjs') process.exit(spawnSync(process.execPath, [fixture, ...args], { stdio: 'inherit', env: process.env }).status ?? 1) } +const suites = JSON.parse(readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../shared/benchmark-suites.json'), 'utf8')) const model = args[1], output = args[args.indexOf('--output') + 1] const serial = args.includes('--serial') const root = path.join(process.env.HF_HUB_CACHE ?? '', `models--${model.replace('/', '--')}`) let revision = 'a'.repeat(40), config = Buffer.from('{}') try { revision = readFileSync(path.join(root, 'refs', 'main'), 'utf8').trim(); config = readFileSync(path.join(root, 'snapshots', revision, 'config.json')) } catch {} -const receipt = { schema_version: 1, suite: { id: 'community-v1', sha256: '9bb717da00666b90b4006174abd9ed46108affc37456b43c64a224a9c938d5be' }, run_id: '00000000-0000-4000-8000-000000000001', created_at: '2026-01-01T00:00:00Z', runtime: { tensorfold_version: scenario === 'mismatched-receipt' ? '1.0.12' : engineVersion, backend: 'mlx', python_version: 'none', platform: 'macos', dependencies: {} }, model: { repo_id: model, revision, family: 'qwen3_5', config_sha256: createHash('sha256').update(config).digest('hex'), tokenizer_sha256: null, quantization: 'mlx-4bit-g64', drafter_repo_id: null, local: false }, hardware: { cpu_model: 'Synthetic CPU', system_memory_bytes: 16 * 1024 ** 3, memory_type: 'unified', gpus: [{ name: 'Synthetic GPU', memory_bytes: null, cores: 8 }], gpu_count: 1, source: 'detected' }, settings: { tokens: 256, repetitions: 5, temperatures: [1, 0], serial, context_tokens: 4096, managed: true, rank_count: 1 }, samples: [] } +const receipt = { schema_version: 1, suite: { id: 'community-v2', sha256: suites['community-v2'] }, run_id: '00000000-0000-4000-8000-000000000001', created_at: '2026-01-01T00:00:00Z', runtime: { tensorfold_version: scenario === 'mismatched-receipt' ? '1.0.12' : engineVersion, backend: 'mlx', python_version: 'none', platform: 'macos', dependencies: {} }, model: { repo_id: model, revision, family: 'qwen3_5', config_sha256: createHash('sha256').update(config).digest('hex'), tokenizer_sha256: null, quantization: 'mlx-4bit-g64', drafter_repo_id: null, local: false }, hardware: { cpu_model: 'Synthetic CPU', system_memory_bytes: 16 * 1024 ** 3, memory_type: 'unified', gpus: [{ name: 'Synthetic GPU', memory_bytes: null, cores: 8 }], gpu_count: 1, source: 'detected' }, settings: { tokens: 256, repetitions: 5, temperatures: [1, 0], serial, context_tokens: 4096, managed: true, rank_count: 1 }, samples: [] } const sample = (fixture_id, temperature, repeat) => ({ fixture_id, temperature, repeat, seed: 1234 + Math.max(0, repeat), status: 'ok', prompt_tokens: 24, completion_tokens: 256, cached_tokens: 0, delivery_seconds: 2.55, delivery_tps: 100, ttft_seconds: 0.1, end_to_end_seconds: 2.8, server_decode_tps: 110, server_decode_seconds: null, prefill_seconds: null, token_sha: 'd'.repeat(12), error_code: null }) const save = () => writeFileSync(output, JSON.stringify(receipt), { mode: 0o600, flag: 'wx' }) const say = text => scenario === 'stderr' ? console.error(text) : console.log(text) diff --git a/app/electron/agent/engine/benchmark/fixtures.ts b/app/electron/agent/engine/benchmark/fixtures.ts index 29ec40354d1..111d6af2d33 100644 --- a/app/electron/agent/engine/benchmark/fixtures.ts +++ b/app/electron/agent/engine/benchmark/fixtures.ts @@ -1,8 +1,7 @@ -import type { ModelBenchmarkReceipt } from '../../../../shared/model-benchmark' -import { BENCHMARK_SUITE_SHA } from './receipt' +import { BENCHMARK_SUITES, BENCHMARK_SUITE_CURRENT, type ModelBenchmarkReceipt } from '../../../../shared/model-benchmark' import { BENCHMARK_ENGINE_VERSION } from './version' /** Synthetic receipt factory for regression tests, with no user or model output. */ export function syntheticBenchmarkReceipt(model = 'example-org/synthetic-model'): ModelBenchmarkReceipt { - return { schema_version: 1, suite: { id: 'community-v1', sha256: BENCHMARK_SUITE_SHA }, run_id: '00000000-0000-4000-8000-000000000001', created_at: '2026-01-01T00:00:00Z', runtime: { tensorfold_version: BENCHMARK_ENGINE_VERSION, backend: 'mlx', python_version: 'none', platform: 'macos', dependencies: {} }, model: { repo_id: model, revision: 'a'.repeat(40), family: 'qwen3_5', config_sha256: 'b'.repeat(64), tokenizer_sha256: 'c'.repeat(64), quantization: 'mlx-affine-4bit-g64', drafter_repo_id: null, local: false }, hardware: { cpu_model: 'Synthetic CPU', system_memory_bytes: 16 * 1024 ** 3, memory_type: 'unified', gpus: [{ name: 'Synthetic GPU', memory_bytes: null, cores: 8 }], gpu_count: 1, source: 'detected' }, settings: { tokens: 256, repetitions: 5, temperatures: [1, 0], serial: false, context_tokens: 4096, managed: true, rank_count: 1 }, samples: [1, 0].flatMap(temperature => (['code', 'chat'] as const).flatMap(fixture_id => Array.from({ length: 5 }, (_, repeat) => ({ fixture_id, temperature, repeat, seed: 1234 + repeat, status: 'ok' as const, prompt_tokens: 24, completion_tokens: 256, cached_tokens: 0, delivery_seconds: 2.55, delivery_tps: 100, ttft_seconds: 0.1 + repeat * 0.1, end_to_end_seconds: 2.8, server_decode_tps: 110, server_decode_seconds: null, prefill_seconds: null, token_sha: 'd'.repeat(12), error_code: null })))) } + return { schema_version: 1, suite: { id: BENCHMARK_SUITE_CURRENT, sha256: BENCHMARK_SUITES[BENCHMARK_SUITE_CURRENT] }, run_id: '00000000-0000-4000-8000-000000000001', created_at: '2026-01-01T00:00:00Z', runtime: { tensorfold_version: BENCHMARK_ENGINE_VERSION, backend: 'mlx', python_version: 'none', platform: 'macos', dependencies: {} }, model: { repo_id: model, revision: 'a'.repeat(40), family: 'qwen3_5', config_sha256: 'b'.repeat(64), tokenizer_sha256: 'c'.repeat(64), quantization: 'mlx-affine-4bit-g64', drafter_repo_id: null, local: false }, hardware: { cpu_model: 'Synthetic CPU', system_memory_bytes: 16 * 1024 ** 3, memory_type: 'unified', gpus: [{ name: 'Synthetic GPU', memory_bytes: null, cores: 8 }], gpu_count: 1, source: 'detected' }, settings: { tokens: 256, repetitions: 5, temperatures: [1, 0], serial: false, context_tokens: 4096, managed: true, rank_count: 1 }, samples: [1, 0].flatMap(temperature => (['code', 'chat'] as const).flatMap(fixture_id => Array.from({ length: 5 }, (_, repeat) => ({ fixture_id, temperature, repeat, seed: 1234 + repeat, status: 'ok' as const, prompt_tokens: 24, completion_tokens: 256, cached_tokens: 0, delivery_seconds: 2.55, delivery_tps: 100, ttft_seconds: 0.1 + repeat * 0.1, end_to_end_seconds: 2.8, server_decode_tps: 110, server_decode_seconds: null, prefill_seconds: null, token_sha: 'd'.repeat(12), error_code: null })))) } } diff --git a/app/electron/agent/engine/benchmark/receipt.test.ts b/app/electron/agent/engine/benchmark/receipt.test.ts index 4b16b0fde03..5bf99501417 100644 --- a/app/electron/agent/engine/benchmark/receipt.test.ts +++ b/app/electron/agent/engine/benchmark/receipt.test.ts @@ -1,6 +1,7 @@ import assert from 'node:assert/strict' import { syntheticBenchmarkReceipt } from './fixtures' -import { parseBenchmarkReceipt, benchmarkCells, benchmarkProtocolComplete } from './receipt' +import { parseBenchmarkReceipt, benchmarkCells, benchmarkProtocolComplete, parseBenchmarkDetails, checkedBenchmarkDetails } from './receipt' +import { BENCHMARK_SUITES } from '../../../../shared/model-benchmark' import { assertBundledBenchmarkVersion, BENCHMARK_ENGINE_VERSION } from './version' const receipt = syntheticBenchmarkReceipt() @@ -77,3 +78,21 @@ for (const formFactor of [undefined, null, 'Mac mini']) { assert.throws(() => parseBenchmarkReceipt(JSON.stringify(invalid)), /invalid|unsupported/, 'The optional key cannot admit unrelated hardware fields') } console.log('Studio accepts absent, null and six coarse product families, preserves metadata and rejects raw IDs, extra keys and invalid values.') + +assert.equal(parsed.suite.id, 'community-v2', 'the synthetic receipt is the engine\'s current suite') +const legacy = structuredClone(receipt); legacy.suite = { id: 'community-v1', sha256: BENCHMARK_SUITES['community-v1'] } +assert.equal(parseBenchmarkReceipt(JSON.stringify(legacy)).suite.id, 'community-v1', 'older engines\' community-v1 receipts still parse') +for (const suite of [{ id: 'community-v3', sha256: BENCHMARK_SUITES['community-v2'] }, { id: 'community-v2', sha256: BENCHMARK_SUITES['community-v1'] }, { id: 'community-v1', sha256: BENCHMARK_SUITES['community-v2'] }, { id: 'community-v2', sha256: '0'.repeat(64) }]) { + const wrong = structuredClone(receipt) as any; wrong.suite = suite + assert.throws(() => parseBenchmarkReceipt(JSON.stringify(wrong)), /invalid|unsupported/, `suite ${suite.id} with the wrong or unknown hash is refused`) +} +const broken = structuredClone(receipt) as any; broken.suite.id = 'community-v9'; broken.samples[0].seed = 999 +assert.throws(() => parseBenchmarkReceipt(JSON.stringify(broken)), /invalid|unsupported/) +const kept = parseBenchmarkDetails(JSON.stringify(broken), { model: receipt.model.repo_id, serial: false }) +assert.deepEqual(kept, { runtime: receipt.runtime, model: receipt.model, hardware: receipt.hardware, settings: receipt.settings }, 'a failed receipt keeps its checked details') +const leaky = structuredClone(broken); leaky.hardware.cpu_model = 'person@example.com' +assert.equal(parseBenchmarkDetails(JSON.stringify(leaky)), null, 'details that fail their privacy checks are not kept') +assert.equal(parseBenchmarkDetails(JSON.stringify(broken), { model: 'example-org/other-model', serial: false }), null) +assert.deepEqual(checkedBenchmarkDetails(kept), kept, 'saved details re-check') +assert.equal(checkedBenchmarkDetails({ ...kept, extra: 1 }), null) +console.log('Benchmark suites: community-v2 and legacy community-v1 accepted, unknown suites and wrong hashes refused; failed runs keep checked details') diff --git a/app/electron/agent/engine/benchmark/receipt.ts b/app/electron/agent/engine/benchmark/receipt.ts index 9514ac60557..258af459854 100644 --- a/app/electron/agent/engine/benchmark/receipt.ts +++ b/app/electron/agent/engine/benchmark/receipt.ts @@ -1,11 +1,11 @@ -import type { ModelBenchmarkCell, ModelBenchmarkReceipt, ModelBenchmarkSpread } from '../../../../shared/model-benchmark' +import { BENCHMARK_SUITES, type ModelBenchmarkCell, type ModelBenchmarkReceipt, type ModelBenchmarkSpread } from '../../../../shared/model-benchmark' import { isRepoId } from '../paths' import { strictBenchmarkJson } from './strict-json' import { supportedBenchmarkReceiptVersion } from './version' -export const BENCHMARK_SUITE_SHA = '9bb717da00666b90b4006174abd9ed46108affc37456b43c64a224a9c938d5be' export const BENCHMARK_RECEIPT_MAX_BYTES = 1024 * 1024 export type BenchmarkFormFactor = 'Mac mini' | 'Mac Studio' | 'MacBook Pro' | 'MacBook Air' | 'iMac' | 'Mac Pro' +export type BenchmarkDetails = Pick export type ParsedBenchmarkReceipt = ModelBenchmarkReceipt & { hardware: ModelBenchmarkReceipt['hardware'] & { form_factor?: BenchmarkFormFactor | null } } const SAMPLE_KEYS = ['fixture_id', 'temperature', 'repeat', 'seed', 'status', 'prompt_tokens', 'completion_tokens', 'cached_tokens', 'delivery_seconds', 'delivery_tps', 'ttft_seconds', 'end_to_end_seconds', 'server_decode_tps', 'server_decode_seconds', 'prefill_seconds', 'token_sha', 'error_code'] const ERROR_CODES = new Set(['http_error', 'connection_error', 'timeout', 'cancelled', 'server_error', 'invalid_stream', 'truncated_stream', 'missing_usage', 'invalid_usage', 'empty_output', 'unexpected_finish', 'token_count_mismatch', 'unmeasured_delivery']) @@ -22,15 +22,8 @@ function number(value: unknown, nullable = true, integer = false, max = 1e15): v if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > max || integer && !Number.isSafeInteger(value)) invalid() } function digest(value: unknown, sizes = [64]): void { if (value !== null && (typeof value !== 'string' || !sizes.includes(value.length) || !/^[a-f0-9]+$/.test(value))) invalid() } -export function parseBenchmarkReceipt(raw: string, expected?: { model: string; serial: boolean; engineVersion?: string }, now = Date.now()): ParsedBenchmarkReceipt { - if (Buffer.byteLength(raw) > BENCHMARK_RECEIPT_MAX_BYTES) invalid() - let value: any - try { value = strictBenchmarkJson(raw) } catch { invalid() } - object(value, ['schema_version', 'suite', 'run_id', 'created_at', 'runtime', 'model', 'hardware', 'settings', 'samples']) - if (value.schema_version !== 1 || typeof value.run_id !== 'string' || !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(value.run_id)) invalid() - if (typeof value.created_at !== 'string' || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,6})?Z$/.test(value.created_at) || !Number.isFinite(Date.parse(value.created_at)) || Date.parse(value.created_at) > now + 900_000 || new Date(value.created_at).toISOString().slice(0, 19) !== value.created_at.slice(0, 19)) invalid() - object(value.suite, ['id', 'sha256']) - if (value.suite.id !== 'community-v1' || value.suite.sha256 !== BENCHMARK_SUITE_SHA) invalid() +/** The runtime, model, hardware and settings sections, each with its own shape and privacy checks. */ +function checkDetails(value: any, expected?: { model: string; serial: boolean; engineVersion?: string }): void { const runtime = value.runtime object(runtime, ['tensorfold_version', 'backend', 'python_version', 'platform', 'dependencies']) text(runtime.tensorfold_version); text(runtime.python_version) @@ -54,6 +47,17 @@ export function parseBenchmarkReceipt(raw: string, expected?: { model: string; s object(settings, ['tokens', 'repetitions', 'temperatures', 'serial', 'context_tokens', 'managed', 'rank_count']) if (settings.tokens !== 256 || settings.repetitions !== 5 || settings.context_tokens !== 4096 || settings.managed !== true || settings.rank_count !== 1 || typeof settings.serial !== 'boolean' || !Array.isArray(settings.temperatures) || settings.temperatures.length !== 2 || settings.temperatures[0] !== 1 || settings.temperatures[1] !== 0) invalid() if (expected && (model.repo_id !== expected.model || settings.serial !== expected.serial)) invalid() +} +export function parseBenchmarkReceipt(raw: string, expected?: { model: string; serial: boolean; engineVersion?: string }, now = Date.now()): ParsedBenchmarkReceipt { + if (Buffer.byteLength(raw) > BENCHMARK_RECEIPT_MAX_BYTES) invalid() + let value: any + try { value = strictBenchmarkJson(raw) } catch { invalid() } + object(value, ['schema_version', 'suite', 'run_id', 'created_at', 'runtime', 'model', 'hardware', 'settings', 'samples']) + if (value.schema_version !== 1 || typeof value.run_id !== 'string' || !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(value.run_id)) invalid() + if (typeof value.created_at !== 'string' || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,6})?Z$/.test(value.created_at) || !Number.isFinite(Date.parse(value.created_at)) || Date.parse(value.created_at) > now + 900_000 || new Date(value.created_at).toISOString().slice(0, 19) !== value.created_at.slice(0, 19)) invalid() + object(value.suite, ['id', 'sha256']) + if (!Object.hasOwn(BENCHMARK_SUITES, value.suite.id) || BENCHMARK_SUITES[value.suite.id as keyof typeof BENCHMARK_SUITES] !== value.suite.sha256) invalid() + checkDetails(value, expected) if (!Array.isArray(value.samples) || value.samples.length < 1 || value.samples.length > 24) invalid() const seen = new Set() for (const sample of value.samples) { @@ -96,3 +100,22 @@ export function benchmarkCells(receipt?: ModelBenchmarkReceipt): ModelBenchmarkC export function benchmarkProtocolComplete(receipt: ModelBenchmarkReceipt): boolean { return benchmarkCells(receipt).every(cell => cell.complete) && receipt.model.revision !== null && receipt.model.config_sha256 !== null && receipt.hardware.source !== 'unavailable' && receipt.hardware.gpus.length > 0 && receipt.runtime.backend !== 'rocm' } + +/** A receipt's runtime, model, hardware and settings when those sections pass their checks, even if its samples do not. */ +export function parseBenchmarkDetails(raw: string, expected?: { model: string; serial: boolean; engineVersion?: string }): BenchmarkDetails | null { + try { + if (Buffer.byteLength(raw) > BENCHMARK_RECEIPT_MAX_BYTES) return null + const value: any = strictBenchmarkJson(raw) + if (!value || typeof value !== 'object' || Array.isArray(value)) return null + checkDetails(value, expected) + return structuredClone({ runtime: value.runtime, model: value.model, hardware: value.hardware, settings: value.settings }) + } catch { return null } +} +/** Saved details (runtime, model, hardware, settings) of a run without a valid receipt, re-checked; null if any fails. */ +export function checkedBenchmarkDetails(value: any): BenchmarkDetails | null { + try { + object(value, ['runtime', 'model', 'hardware', 'settings']) + checkDetails(value) + return structuredClone({ runtime: value.runtime, model: value.model, hardware: value.hardware, settings: value.settings }) + } catch { return null } +} diff --git a/app/electron/agent/engine/benchmark/state.ts b/app/electron/agent/engine/benchmark/state.ts index b1e01a50407..8a34f99be42 100644 --- a/app/electron/agent/engine/benchmark/state.ts +++ b/app/electron/agent/engine/benchmark/state.ts @@ -1,6 +1,6 @@ import type { ModelBenchmarkReceipt, ModelBenchmarkSnapshot } from '../../../../shared/model-benchmark' import { isRepoId } from '../paths' -import { benchmarkCells, benchmarkProtocolComplete } from './receipt' +import { benchmarkCells, benchmarkProtocolComplete, checkedBenchmarkDetails } from './receipt' /** Pick and validate every persisted renderer field rather than returning arbitrary stored data. */ export function savedBenchmarkSnapshot(raw: any, receipt: ModelBenchmarkReceipt | null): ModelBenchmarkSnapshot { @@ -17,5 +17,5 @@ export function savedBenchmarkSnapshot(raw: any, receipt: ModelBenchmarkReceipt const progress = raw.progress if (!progress || typeof progress !== 'object' || Object.keys(progress).sort().join(',') !== 'completedRequests,fixture,phase,repeat,temperature,totalRequests' || progress.totalRequests !== 24 || progress.completedRequests !== null && (!Number.isInteger(progress.completedRequests) || progress.completedRequests < 0 || progress.completedRequests > 24) || ![null, 'code', 'chat'].includes(progress.fixture) || ![null, 0, 1].includes(progress.temperature) || ![null, 'loading', 'warmup', 'measured'].includes(progress.phase) || progress.repeat !== null && (!Number.isInteger(progress.repeat) || progress.repeat < -1 || progress.repeat > 4)) invalid() if (!Array.isArray(raw.warnings) || raw.warnings.length > 10) invalid() - return { id: raw.id, model: raw.model, serial: raw.serial, state: raw.state, revision: raw.revision, startedAt: raw.startedAt, finishedAt: raw.finishedAt, progress: structuredClone(progress), cells: benchmarkCells(receipt ?? undefined), receiptAvailable: receipt !== null, protocolComplete: receipt ? benchmarkProtocolComplete(receipt) : false, previousModel: raw.previousModel, restored: raw.restored, restoreError: message(raw.restoreError), error: message(raw.error), storageError: message(raw.storageError), warnings: raw.warnings.map((value: unknown) => message(value) ?? invalid()), saved: raw.saved, metadata: receipt ? structuredClone({ runtime: receipt.runtime, model: receipt.model, hardware: receipt.hardware, settings: receipt.settings }) : null } + return { id: raw.id, model: raw.model, serial: raw.serial, state: raw.state, revision: raw.revision, startedAt: raw.startedAt, finishedAt: raw.finishedAt, progress: structuredClone(progress), cells: benchmarkCells(receipt ?? undefined), receiptAvailable: receipt !== null, protocolComplete: receipt ? benchmarkProtocolComplete(receipt) : false, previousModel: raw.previousModel, restored: raw.restored, restoreError: message(raw.restoreError), error: message(raw.error), storageError: message(raw.storageError), warnings: raw.warnings.map((value: unknown) => message(value) ?? invalid()), saved: raw.saved, metadata: receipt ? structuredClone({ runtime: receipt.runtime, model: receipt.model, hardware: receipt.hardware, settings: receipt.settings }) : raw.metadata == null ? null : checkedBenchmarkDetails(raw.metadata) } } diff --git a/app/electron/agent/engine/benchmark/storage.ts b/app/electron/agent/engine/benchmark/storage.ts index 4d5a868f0a5..4bb197b1c03 100644 --- a/app/electron/agent/engine/benchmark/storage.ts +++ b/app/electron/agent/engine/benchmark/storage.ts @@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto' import { writeProtectedJson } from '../../../store/write-infra' import { isProtectedJsonEnvelope, revealJsonPayload } from '../../../store/app-crypto' import type { ModelBenchmarkReceipt, ModelBenchmarkSnapshot } from '../../../../shared/model-benchmark' -import { BENCHMARK_RECEIPT_MAX_BYTES, parseBenchmarkReceipt } from './receipt' +import { BENCHMARK_RECEIPT_MAX_BYTES, parseBenchmarkDetails, parseBenchmarkReceipt, type BenchmarkDetails } from './receipt' import { savedBenchmarkSnapshot } from './state' import { strictBenchmarkJson } from './strict-json' @@ -30,6 +30,10 @@ export async function readBenchmarkReceiptFile(file: string, expected: { model: const raw = await readPrivateFile(file, BENCHMARK_RECEIPT_MAX_BYTES) return raw === null ? null : parseBenchmarkReceipt(raw, expected) } +/** The checked details of a receipt that failed or was cut short; null when the file is missing or they fail. */ +export async function readBenchmarkDetailsFile(file: string, expected: { model: string; serial: boolean; engineVersion?: string }): Promise { + try { const raw = await readPrivateFile(file, BENCHMARK_RECEIPT_MAX_BYTES); return raw === null ? null : parseBenchmarkDetails(raw, expected) } catch { return null } +} async function readPrivateFile(file: string, maxBytes: number): Promise { let handle: Awaited> try { handle = await fs.open(file, constants.O_RDONLY | constants.O_NOFOLLOW) } catch (error: any) { diff --git a/app/electron/agent/engine/geometry.ts b/app/electron/agent/engine/geometry.ts index a03b49bfc8b..3ac699088bc 100644 --- a/app/electron/agent/engine/geometry.ts +++ b/app/electron/agent/engine/geometry.ts @@ -40,6 +40,26 @@ const QWEN35: PinnedGeometry = { }, } +const QWEN27: PinnedGeometry = { + title: 'Qwen3.5 27B', + engineError: 'UnqualifiedQwenShape', + section: 'text_config', + dims: { + hidden_size: 5120, + vocab_size: 248320, + num_hidden_layers: 64, + intermediate_size: 17408, + linear_num_key_heads: 16, + linear_num_value_heads: 48, + linear_key_head_dim: 128, + linear_value_head_dim: 128, + linear_conv_kernel_dim: 4, + num_attention_heads: 24, + num_key_value_heads: 4, + head_dim: 256, + }, +} + const LFM2_MOE: PinnedGeometry = { title: 'LFM2.5', engineError: 'UnsupportedLfmGeometry', @@ -76,11 +96,15 @@ function layerTypesMatch(kind: string, layers: unknown): boolean { } export function admitGeometry(modelType: string, config: unknown): GeometryAdmission { - const pinned = PINNED[modelType] - if (!pinned) return { admitted: true, reason: null } + const defaultGeometry = PINNED[modelType] + if (!defaultGeometry) return { admitted: true, reason: null } if (!plain(config)) return { admitted: true, reason: null } - const section = pinned.section ? config[pinned.section] : config + const section = defaultGeometry.section ? config[defaultGeometry.section] : config if (!plain(section)) return { admitted: true, reason: null } + // The native dispatcher sends a tied head or the 2B hidden size to the 2B engine. + const useQwen27 = modelType === 'qwen3_5' && section.hidden_size === QWEN27.dims.hidden_size && + config.hidden_size !== QWEN35.dims.hidden_size && config.tie_word_embeddings !== true && section.tie_word_embeddings !== true + const pinned = useQwen27 ? QWEN27 : defaultGeometry for (const [key, expected] of Object.entries(pinned.dims)) { const value = section[key] if (value === undefined || value === null) continue @@ -91,7 +115,9 @@ export function admitGeometry(modelType: string, config: unknown): GeometryAdmis } } } - if (!layerTypesMatch(modelType, section.layer_types)) { + const interval = section.full_attention_interval + const wrongQwen27Interval = useQwen27 && typeof interval === 'number' && interval > 0 && interval !== 4 + if (wrongQwen27Interval || !layerTypesMatch(modelType, section.layer_types)) { return { admitted: false, reason: `This checkpoint's layer types are not the ones the bundled engine serves for ${pinned.title}; the engine refuses it (${pinned.engineError}).`, diff --git a/app/electron/agent/engine/library.test.ts b/app/electron/agent/engine/library.test.ts index 940c2b70a4b..5feee64a41f 100644 --- a/app/electron/agent/engine/library.test.ts +++ b/app/electron/agent/engine/library.test.ts @@ -200,6 +200,45 @@ try { const rescan = await lowMemory.scan() assert.deepEqual(rescan.models.map((model: any) => [model.id, model.loadable, model.reason]), lowered.models.map((model: any) => [model.id, model.loadable, model.reason]), 'a later rescan agrees with the refreshed state') + const qwen27 = { + hidden_size: 5120, vocab_size: 248320, num_hidden_layers: 64, intermediate_size: 17408, + linear_num_key_heads: 16, linear_num_value_heads: 48, linear_key_head_dim: 128, + linear_value_head_dim: 128, linear_conv_kernel_dim: 4, num_attention_heads: 24, + num_key_value_heads: 4, head_dim: 256, full_attention_interval: 4, + } + const qwen27Library = library({ appHome: path.join(root, 'qwen27-app') }) + const qwen27Models = path.join(root, 'qwen27-models') + const qwen27Cases = [ + { name: 'untied', tied: false, text: qwen27 }, + { name: 'wrong-kv-heads', tied: false, text: { ...qwen27, num_key_value_heads: 2 } }, + { name: 'wrong-interval', tied: false, text: { ...qwen27, full_attention_interval: 2 } }, + { name: 'tied-root', tied: true, text: qwen27 }, + { name: 'tied-tower', tied: false, text: { ...qwen27, tie_word_embeddings: true } }, + ] + for (const { name, tied, text } of qwen27Cases) { + const folder = path.join(qwen27Models, name) + await checkpoint(folder) + await fs.writeFile(path.join(folder, 'config.json'), JSON.stringify({ + model_type: 'qwen3_5', tie_word_embeddings: tied, quantization: { bits: 4, group_size: 64 }, + text_config: text, + })) + } + const qwen27Entries = (await qwen27Library.addFolder(qwen27Models)).models + const untied = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'untied'))! + assert.equal(untied.loadable, true, 'the qualified untied 27B is available in the library') + assert.equal((await qwen27Library.resolve(untied.id)).path, untied.path) + const wrongHeads = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'wrong-kv-heads'))! + assert.equal(wrongHeads.loadable, false) + assert.match(wrongHeads.reason!, /num key value heads is 2.*UnqualifiedQwenShape/) + const wrongInterval = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'wrong-interval'))! + assert.equal(wrongInterval.loadable, false) + assert.match(wrongInterval.reason!, /layer types/) + for (const name of ['tied-root', 'tied-tower']) { + const tied = qwen27Entries.find((model) => model.path === path.join(qwen27Models, name))! + assert.equal(tied.loadable, false) + assert.match(tied.reason!, /UnsupportedQwenGeometry/) + } + const validRegistry = await fs.readFile(lib.file, 'utf8') await fs.writeFile(lib.file, '{') await assert.rejects(() => library().snapshot(), /library is invalid/) diff --git a/app/electron/agent/engine/service.ts b/app/electron/agent/engine/service.ts index 3aeeca71044..8672bafec11 100644 --- a/app/electron/agent/engine/service.ts +++ b/app/electron/agent/engine/service.ts @@ -27,7 +27,7 @@ import { ModelComparisons } from './model-comparison' import { modelLaunchOptions } from './launch-options' import type { ModelBenchmarkInput, ModelBenchmarkReceipt, ModelBenchmarkSnapshot } from '../../../shared/model-benchmark' import { ModelBenchmarks } from './benchmark/controller' -import { createModelBenchmarkStore, benchmarkWorkspace, readBenchmarkReceiptFile, type ModelBenchmarkStore } from './benchmark/storage' +import { createModelBenchmarkStore, benchmarkWorkspace, readBenchmarkDetailsFile, readBenchmarkReceiptFile, type ModelBenchmarkStore } from './benchmark/storage' import { startBenchmarkProcess } from './benchmark/process' import { assertBundledBenchmarkVersion } from './benchmark/version' @@ -182,7 +182,7 @@ export class EngineService { reserve: () => this.supervisor.reserveSequence('local benchmark'), workspace: () => benchmarkWorkspace(options.appHome), process: (input, workspace, progress, signal) => startBenchmarkProcess({ binary: this.requireBinary(), input, ...workspace, workingDirectory: workspace.directory, env: this.env, progress, signal }), - readReceipt: (file, input) => readBenchmarkReceiptFile(file, input), + readReceipt: (file, input) => readBenchmarkReceiptFile(file, input), readDetails: (file, expected) => readBenchmarkDetailsFile(file, expected), store: options.benchmarkStore ?? createModelBenchmarkStore(options.appHome), }) } diff --git a/app/electron/agent/mcp-client-framing.test.ts b/app/electron/agent/mcp-client-framing.test.ts index b2c2d604f17..dd271372aec 100644 --- a/app/electron/agent/mcp-client-framing.test.ts +++ b/app/electron/agent/mcp-client-framing.test.ts @@ -1,5 +1,7 @@ import assert from 'node:assert/strict' +import { PassThrough } from 'node:stream' import { McpHost, createMcpServer } from './mcp-client' +import { SECRET_MASK } from './security' const host = new McpHost() const config = createMcpServer({ id: 'framing-fixture', name: 'Framing fixture', command: '/bin/echo' }) @@ -31,6 +33,44 @@ try { runtime.handleStdout(state, Buffer.from('{"jsonrpc":"1.0","id":72,"result":{"trusted":true}}\n')) assert.equal(resolved, false) }) + check('MCP startup stderr keeps a split UTF-8 diagnostic together', () => { + const stderr = new PassThrough() + const finish = runtime.captureStartupStderr(state, stderr) + const message = 'Could not open 🔐.sqlite: testing database unavailable' + const bytes = Buffer.from(message) + const split = bytes.indexOf(Buffer.from('🔐')) + 1 + state.runtime.logs = [] + stderr.write(bytes.subarray(0, split)) + stderr.write(bytes.subarray(split, split + 7)) + stderr.write(bytes.subarray(split + 7)) + assert.deepEqual(state.runtime.logs, []) + finish() + finish() + assert.deepEqual(state.runtime.logs, [message]) + stderr.write('Connected diagnostic\n') + assert.deepEqual(state.runtime.logs, [message, 'Connected diagnostic']) + }) + check('MCP startup stderr is redacted before its logical lines enter the preview', () => { + const stderr = new PassThrough() + const finish = runtime.captureStartupStderr(state, stderr) + state.runtime.logs = [] + const fence = '-----' + const keyType = ['PRIVATE', 'KEY'].join(' ') + stderr.write(`${fence}BEGIN ${keyType}${fence}\r\n`) + stderr.write('synthetic fixture only\r\n') + stderr.write(`${fence}END ${keyType}${fence}\r\n`) + finish() + assert.deepEqual(state.runtime.logs, [SECRET_MASK]) + }) + check('An oversized MCP startup diagnostic is omitted without retaining its fragments', () => { + const stderr = new PassThrough() + const finish = runtime.captureStartupStderr(state, stderr) + state.runtime.logs = [] + stderr.write(Buffer.alloc(64 * 1024, 0x61)) + stderr.write('oversized diagnostic\n') + finish() + assert.deepEqual(state.runtime.logs, ['MCP startup diagnostics exceeded the log limit.']) + }) check('The MCP frame byte limit applies before parsing newline-terminated input', () => { const frame = JSON.stringify({ jsonrpc: '2.0', id: 73, result: 'x'.repeat(8 * 1024 * 1024) }) + '\n' runtime.handleStdout(state, Buffer.from(frame)) diff --git a/app/electron/agent/mcp-client.ts b/app/electron/agent/mcp-client.ts index 965ab0c57c9..32e20c91989 100644 --- a/app/electron/agent/mcp-client.ts +++ b/app/electron/agent/mcp-client.ts @@ -22,6 +22,7 @@ import type { const MCP_PROTOCOL_VERSION = '2025-06-18' const REQUEST_TIMEOUT_MS = 20_000 const MAX_LOG_LINES = 80 +const MAX_STARTUP_STDERR_BYTES = 64 * 1024 // Cap *_list pagination so a server that returns a non-advancing or never-terminating // nextCursor can't wedge connect() in an unbounded request loop. const MAX_LIST_PAGES = 1000 @@ -234,6 +235,7 @@ export class McpHost { } const config = state.config + let finishStartupStderr: (() => void) | undefined try { const provenance = await commandProvenance(config).catch(() => null) this.assertLaunchCurrent(state, fingerprint, generation) @@ -249,7 +251,8 @@ export class McpHost { state.runtime.pid = proc.pid ?? null proc.stdout.on('data', (chunk: Buffer) => this.handleStdout(state, chunk)) - proc.stderr.on('data', (chunk: Buffer) => this.appendLog(state, chunk.toString('utf8'))) + finishStartupStderr = this.captureStartupStderr(state, proc.stderr) + proc.stderr.once('end', finishStartupStderr) proc.on('error', (error) => { this.rejectAll(state, error) state.runtime = { ...state.runtime, status: 'error', pid: null, lastError: error.message } @@ -285,6 +288,7 @@ export class McpHost { await this.refreshResources(state) await this.refreshPrompts(state) this.assertLaunchCurrent(state, fingerprint, generation) + finishStartupStderr() state.runtime = { ...state.runtime, status: 'connected', @@ -296,6 +300,7 @@ export class McpHost { } catch (error: any) { const message = error?.message ? String(error.message) : String(error) if (state.generation === generation) { + finishStartupStderr?.() state.runtime = { ...state.runtime, status: 'error', pid: null, tools: [], resources: [], prompts: [], lastError: message } this.stopState(state) } @@ -471,6 +476,30 @@ export class McpHost { })}\n`, 'utf8') } + private captureStartupStderr(state: ClientState, stderr: ChildProcessWithoutNullStreams['stderr']): () => void { + let chunks: Buffer[] = [] + let bytes = 0 + let finished = false + stderr.on('data', (chunk: Buffer) => { + if (finished) { + this.appendLog(state, chunk.toString('utf8')) + } else if (bytes <= MAX_STARTUP_STDERR_BYTES) { + bytes += chunk.length + if (bytes <= MAX_STARTUP_STDERR_BYTES) chunks.push(chunk) + else chunks = [] + } + }) + return () => { + if (finished) return + finished = true + const diagnostics = bytes > MAX_STARTUP_STDERR_BYTES + ? 'MCP startup diagnostics exceeded the log limit.' + : Buffer.concat(chunks, bytes).toString('utf8') + chunks = [] + this.appendLog(state, diagnostics) + } + } + private appendLog(state: ClientState, text: string) { // MCP subprocess stderr can contain connection strings, tokens, and request payloads. // Redact before storing so the snapshot (exposed via mcp:snapshot) never leaks secrets. diff --git a/app/electron/agent/room-delegation-effort.test.ts b/app/electron/agent/room-delegation-effort.test.ts new file mode 100644 index 00000000000..a8b26376c69 --- /dev/null +++ b/app/electron/agent/room-delegation-effort.test.ts @@ -0,0 +1,20 @@ +import assert from 'node:assert/strict' +import { resolveDelegationRoute } from './delegation-route' +import type { Provider, Seat } from './types' + +const provider: Provider = { id: 'fixture', name: 'Fixture', kind: 'local', apiKey: '', + baseUrl: 'http://127.0.0.1:1/v1', models: ['first', 'second'] } +const other: Provider = { ...provider, id: 'other' } +const base = { providerId: provider.id, model: 'first', reasoningEffort: 'low' as const } +const seats: Seat[] = [ + { id: 'reviewer', name: 'Reviewer', role: 'Review input', providerId: provider.id, model: 'second', reasoningEffort: 'high' }, + { id: 'legacy', name: 'Legacy', role: 'Review input', providerId: provider.id, model: 'first' }, +] +assert.deepEqual(resolveDelegationRoute([provider, other], base, {}).route, base) +assert.deepEqual(resolveDelegationRoute([provider, other], base, { targetSeat: 'Reviewer' }, seats).route, + { providerId: provider.id, providerAccountId: undefined, model: 'second', reasoningEffort: 'high' }) +assert.deepEqual(resolveDelegationRoute([provider, other], base, { targetSeat: 'Legacy' }, seats).route, + { providerId: provider.id, providerAccountId: undefined, model: 'first' }, 'an inherited target does not adopt the origin agent override') +assert.deepEqual(resolveDelegationRoute([provider, other], base, { providerId: other.id, model: 'second' }).route, + { providerId: other.id, model: 'second', reasoningEffort: 'low' }, 'explicit provider changes retain the originating effort') +console.log('Room delegation effort routing checks passed: origin, target agent, legacy target and explicit provider/model route.') diff --git a/app/electron/agent/room-heartbeats.ts b/app/electron/agent/room-heartbeats.ts new file mode 100644 index 00000000000..b7d65d7c678 --- /dev/null +++ b/app/electron/agent/room-heartbeats.ts @@ -0,0 +1,97 @@ +import type { RoomDeliberationEffort, Seat, SeatHeartbeat } from './types' + +// Minimal shape the heartbeat helpers need — lets tests exercise stall detection +// without standing up a full SeatRuntime (messages/recent are irrelevant here). +export interface SeatRuntimeLike { + seat: Pick + heartbeat: SeatHeartbeat +} + +// Default grace after nextDueAt before a slow seat is flagged stalled (BUG #53). +// Tolerates transient model latency so a normal slow turn does not false-positive. +const SEAT_STALL_GRACE_SECONDS = 30 + +// Heartbeat cadence derived from the room deliberation effort. Deeper sessions +// expect longer per-turn thinking, so we widen the interval to avoid false stalls. +export function seatHeartbeatIntervalSeconds(effort?: RoomDeliberationEffort | null): number { + switch (effort) { + case 'quick': return 30 + case 'deep': return 90 + case 'max': return 120 + case 'normal': + default: return 60 + } +} + +// Seed a healthy heartbeat for a seat at room start. +export function initSeatHeartbeat(seat: Pick, intervalSeconds: number, now: number): SeatHeartbeat { + return { + seatId: seat.id, + seatName: seat.name, + intervalSeconds, + stallGraceSeconds: SEAT_STALL_GRACE_SECONDS, + required: true, + count: 0, + lastBeatAt: now, + nextDueAt: now + intervalSeconds * 1000, + missedSince: null, + } +} + +// Record that a seat produced a turn: bump count, advance the clock, clear any stall. +export function recordSeatBeat(hb: SeatHeartbeat, now: number): void { + hb.count++ + hb.lastBeatAt = now + hb.nextDueAt = hb.required ? now + hb.intervalSeconds * 1000 : null + hb.missedSince = null +} + +// Names of seats currently flagged stalled (missedSince set), excluding one seat +// by name (the seat trying to FINAL is obviously alive). Used to block a premature +// finalize while a teammate is hung (BUG #53). +export function stalledSeatNames(runtimes: SeatRuntimeLike[], exclude?: string): string[] { + return runtimes + .filter((rt) => rt.heartbeat.required && rt.heartbeat.missedSince != null && rt.seat.name !== exclude) + .map((rt) => rt.seat.name) +} + +// Re-arm the stall window for seats that actually took a turn in the previous pass. +// A single pass over several slow models can take longer than interval+grace, so a +// seat that beat last pass and is merely waiting its turn must not be false-flagged; +// pushing its nextDueAt forward to this pass start prevents that. Crucially, seats +// that did NOT run last pass (e.g. one that keeps timing out without ever calling +// recordSeatBeat, or any seat on the very first pass) are left untouched so their +// window keeps counting and evaluateSeatHeartbeats can actually flag a real stall — +// re-arming every non-stalled seat unconditionally is what made stall detection dead +// code (BUG #53 regression). +export function rearmSeatHeartbeats( + runtimes: SeatRuntimeLike[], + ranLastPass: Set, + passStart: number, +): void { + for (const rt of runtimes) { + const hb = rt.heartbeat + if (hb.required && hb.missedSince == null && ranLastPass.has(rt.seat.id)) { + hb.nextDueAt = passStart + hb.intervalSeconds * 1000 + } + } +} + +// Detect seats whose turn is overdue past the grace window. Mutates each newly +// stalled heartbeat's missedSince so a stall is reported once (not every tick), +// and returns human-readable notices for the moderator to surface. +export function evaluateSeatHeartbeats(runtimes: SeatRuntimeLike[], now: number): string[] { + const stalled: string[] = [] + for (const rt of runtimes) { + const hb = rt.heartbeat + if (!hb.required || hb.lastBeatAt == null || hb.nextDueAt == null) continue + if (hb.missedSince != null) continue // already flagged; do not re-report + const stallAt = hb.nextDueAt + hb.stallGraceSeconds * 1000 + if (now >= stallAt) { + hb.missedSince = hb.nextDueAt + const ago = Math.round((now - hb.lastBeatAt) / 1000) + stalled.push(`Seat "${rt.seat.name}": heartbeat overdue (last beat ${ago}s ago)`) + } + } + return stalled +} diff --git a/app/electron/agent/room-protocol.ts b/app/electron/agent/room-protocol.ts new file mode 100644 index 00000000000..8c32d3dd60a --- /dev/null +++ b/app/electron/agent/room-protocol.ts @@ -0,0 +1,157 @@ +import type { Project, Provider, Room, RoomEventItem, Seat } from './types' +import { isExternalProvider } from '../../shared/provider-trust' +import { PROJECT_CONTEXT_WITHHELD_NOTE } from './planning-guard' +import { VONTRA_STYLE_PROMPT } from './prompt-style' +import { formatRoomMemory, seatCollaborationInstructions } from './room-collaboration' +import { roomModePromptBlock, roomOutcomeProfile } from './room-outcomes' +import { renderSharedMemory } from './shared-room-memory' + +// Ported from LLMComposer's room/huddle engine: multiple provider-bound seats +// deliberate on one shared problem as an attributed dialogue, with SENSE +// injection so each seat knows it is one of several real teammates. + +const VERBS = new Set(['SPEAK', 'ASK', 'OBJECT', 'ASSIGN', 'CLAIM', 'CHECK', 'VOTE', 'YIELD', 'FINAL', 'TOOL']) + +export function buildPrimer(project: Project, room: Room, seat: Seat, roster: Seat[], provider?: Provider): string { + const rosterText = roster.map((s) => `- ${s.name}: ${s.role} (model ${s.model})`).join('\n') + const roomMemory = formatRoomMemory(room) + const sharedMemory = room.sharedMemory ? renderSharedMemory(room.sharedMemory) : '' + return [ + `You are ${seat.name} in a live multi-agent working session with the teammates below.`, + '', + `ROOM ROLE\nYour visible room role is ${seat.role}. Use it to decide when to volunteer, challenge, defer, or take a ticket, but keep your general reasoning intact.`, + `\n${seatCollaborationInstructions(room, seat, provider)}`, + roomOutcomeProfile(room.mode) ? `\nROOM OUTCOME\n${roomModePromptBlock(roomOutcomeProfile(room.mode)!)}` : '', + project.team ? `\nTEAM CHARTER\n${project.team}` : '', + // External seats plan only and never see project memory (planning-guard.ts). + project.memory ? (isExternalProvider(provider) ? `\n${PROJECT_CONTEXT_WITHHELD_NOTE}` : `\nPROJECT MEMORY\n${project.memory}`) : '', + roomMemory ? `\nROOM MEMORY\n${roomMemory}` : '', + sharedMemory ? `\n${sharedMemory}` : '', + '', + 'ROOM CONTRACT', + 'Messages tagged [room] are what teammates actually said; [moderator] hands you the floor.', + 'Speak in first person, briefly and concretely. React to what was just said instead of restating it.', + "Never write [room] or [moderator] lines yourself, and never invent a teammate's reply.", + 'Never repeat a question or point you already made.', + 'End every reply with exactly one line: ACTION: .', + 'Verbs: SPEAK, ASK, OBJECT, ASSIGN, CLAIM, CHECK, VOTE, YIELD, FINAL, TOOL.', + 'ACTION: ASK addresses one teammate by name. ACTION: FINAL ends the room only when the task is genuinely done.', + 'When you answer a specific ASK or ASSIGN, cite it by appending RE: # to your ACTION line so the reply links back to the question.', + 'Only state what you can actually see in the [room] lines above. Do not claim progress that has not happened.', + '', + 'TEAMWORK CONTRACT', + 'Make handoffs explicit. If a teammate asks or assigns you something, answer that first and say what you are unblocking for them.', + 'Help the room finish the user goal: create or claim concrete tickets, attach evidence, start workers when ready, and yield when waiting.', + 'If you disagree, name the risk and offer the next useful move instead of reopening the whole plan.', + '', + VONTRA_STYLE_PROMPT, + '', + 'SHARED BOARD: coordinate through it so you never duplicate a teammate\'s work:', + 'ACTION: TOOL list_tickets: see every ticket and who is working on what.', + 'ACTION: TOOL claim_ticket {"title":"..."}: claim a ticket BEFORE you start it, so teammates know it is taken.', + 'ACTION: TOOL create_ticket {"title":"...","body":"...","priority":"high","risk":"medium","allowedCapabilities":["read"],"requiredEvidence":["files inspected","verification result"],"acceptanceCriteria":["..."]}: add an execution ticket to the board.', + 'ACTION: TOOL add_ticket_evidence {"title":"...","kind":"file","summary":"What you found","ref":"src/file.ts"}: attach evidence to a claimed ticket.', + 'ACTION: TOOL complete_ticket {"title":"...","evidence":[{"kind":"review","summary":"Reviewed X and found Y"}]}: mark your claimed ticket complete after attaching required evidence.', + 'ACTION: TOOL left_to_work: see the remaining room tickets, active workers, risks, and known file refs.', + 'ACTION: TOOL memory_write {"name":"decisions","content":"...","mode":"append-bullet"}: update the room\'s live shared memory (decisions, plan, blockers). Teammates see updates on their next turn.', + 'ACTION: TOOL start_ticket_work {"title":"...","phase":"build","paths":["src/x.ts"]}: ask the Room Supervisor to start a ticket worker thread in the room worktree. Use phase "review" for reviewer passes. If a file overlap is intentional, include "mergeDecision":"why this overlap is safe and how results will be merged".', + 'ACTION: TOOL delegate {"task":"..."}: hand a focused subtask to a sub-agent and get its result. Add "targetSeat":"SeatName" to run it on that seat\'s provider/model, or "providerId"/"accountId"/"model" for an explicit route; omit them to use your own.', + 'Always claim before working; never touch a ticket already claimed by someone else.', + 'Only start ticket workers for claimed or ready tickets. Declare paths when you know them so the supervisor can prevent overlapping edits.', + 'Do not ACTION: FINAL while room tickets are still open.', + '', + 'WORKSPACE: inspect the shared project safely:', + 'ACTION: TOOL read_file {"path":"src/x.ts"}: read a file.', + 'ACTION: TOOL search {"query":"..."}: find relevant code.', + 'ACTION: TOOL list_dir {"path":"src"}: inspect folders.', + 'Room agents are read-only by default. Do not attempt edit_file, write_file, or run_command unless the user opens an approved work thread for that ticket.', + 'When you know the change needed, create/claim a ticket and explain the proposed edit for an approved thread to execute.', + '', + 'TEAM ROSTER', + rosterText, + ].filter(Boolean).join('\n') +} + +export interface Action { verb: string; text: string; raw: string; prose?: string } + +// Lenient gate: missing action becomes SPEAK, empty body becomes YIELD. +export function gateAction(output: string): Action { + const raw = (output ?? '').trim() + if (!raw) return { verb: 'YIELD', text: '', raw } + const lines = raw.split('\n') + const actionLine = [...lines].reverse().find((l) => l.trim().toUpperCase().startsWith('ACTION:')) + const prose = lines.filter((l) => l !== actionLine).join('\n').trim() + if (!actionLine) return { verb: 'SPEAK', text: prose || raw, raw } + const body = actionLine.trim().slice(actionLine.trim().indexOf(':') + 1).trim() + const parts = body.split(/\s+/) + const verb = (parts[0] || '').toUpperCase() + const text = parts.slice(1).join(' ').trim() + if (!VERBS.has(verb)) return { verb: 'SPEAK', text: prose || raw, raw } + if (!text && verb !== 'YIELD') return { verb: 'YIELD', text: '', raw } + // Keep the prose so peers receive the model's actual reasoning, not just the one-line ACTION tagline. + return { verb, text, raw, prose } +} + +export function renderForRoom(ev: RoomEventItem, compact = false): string { + const label = ev.kind.toUpperCase() + // Addressed asks/assigns carry a short ref (#id8) so a teammate can answer with + // "RE: #"; replies show the ref they answer (re #id8). + const ref = (ev.kind === 'ask' || ev.kind === 'assign') ? ` #${ev.id.slice(0, 8)}` : '' + const reply = ev.replyTo ? ` re #${ev.replyTo.slice(0, 8)}` : '' + if (compact) return `[room] ${ev.seat} (${label}${reply}): ${ev.text}` + const head = ev.target && ev.target !== 'all' && ev.target !== ev.seat + ? `[room] ${ev.seat} (${label}, to ${ev.target}${ref}${reply}):` + : `[room] ${ev.seat} (${label}${ref}${reply}):` + return `${head}\n${ev.text}` +} + +export function signature(raw: string): string { + return raw.split('\n').filter((l) => !l.trim().toUpperCase().startsWith('ACTION:')).join(' ').trim().toLowerCase().slice(0, 400) +} + +export function blockerSignature(blockers: string[]): string { + return blockers.map((blocker) => blocker.replace(/\s+/g, ' ').trim().toLowerCase()).filter(Boolean).join('\n') +} + +export function oneLine(text: string, max = 180): string { + const compact = text.replace(/\s+/g, ' ').trim() + return compact.length > max ? `${compact.slice(0, Math.max(0, max - 3))}...` : compact +} + +export function roomTeamCue(room: Room, seat: Seat): string { + const recent = room.events.filter((event) => !['task', 'notice', 'user'].includes(event.kind)).slice(-10) + const directHandoffs = recent.filter((event) => (event.kind === 'ask' || event.kind === 'assign') && event.target === seat.name) + const latestDirect = directHandoffs[directHandoffs.length - 1] + const latestOtherHandoff = recent.filter((event) => + (event.kind === 'ask' || event.kind === 'assign') && + !!event.target && + event.target !== 'all' && + event.target !== seat.name + ).slice(-1)[0] + const latestClaim = recent.filter((event) => event.kind === 'claim').slice(-1)[0] + const latestUserSteer = room.events + .filter((event) => event.kind === 'user' && (event.target === 'all' || event.target === seat.name)) + .slice(-1)[0] + const cue: string[] = [] + + if (latestUserSteer) { + cue.push(`USER STEERING: "${oneLine(latestUserSteer.text, 220)}". Treat this as the user's latest direction and respond to it before lower-priority room chatter.`) + } + + if (latestDirect) { + cue.push(`TEAM CUE: ${latestDirect.seat} handed work to you: "${oneLine(latestDirect.text, 220)}". Answer or unblock that first, naming ${latestDirect.seat}.`) + } else if (latestOtherHandoff) { + cue.push(`TEAM CUE: ${latestOtherHandoff.seat} handed work to ${latestOtherHandoff.target}. Let that teammate respond unless you can unblock with new evidence.`) + } + + if (latestClaim) { + cue.push(`Latest claim: ${latestClaim.seat} claimed "${oneLine(latestClaim.text, 120)}". Build on it and do not duplicate it.`) + } + + cue.push('Work like a teammate: reference who you are helping, answer direct asks before new topics, create or claim the next useful ticket, start workers when ready, and ACTION: YIELD if you are waiting.') + return cue.join(' ') +} + +export function escapeReg(s: string): string { + return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +} diff --git a/app/electron/agent/room-reasoning-effort.test.ts b/app/electron/agent/room-reasoning-effort.test.ts new file mode 100644 index 00000000000..88c1b0eebf0 --- /dev/null +++ b/app/electron/agent/room-reasoning-effort.test.ts @@ -0,0 +1,90 @@ +import assert from 'node:assert/strict' +import { createServer } from 'node:http' +import { runRoom, initSeatHeartbeat } from './rooms' +import { compactSeatRuntime, type SeatRuntime } from './room-seat-runtime' +import type { Project, Provider, Room, ReasoningEffortSetting } from './types' + +const requests: { model: string; reasoning_effort?: string }[] = [] +const reply = (model: string) => model === 'alpha' + ? 'I checked the synthetic input.\nACTION: ASK Beta confirm the result.' + : 'The synthetic result is confirmed.\nACTION: FINAL Synthetic review complete.' +let afterRequest = () => {} +const server = createServer((request, response) => { + if (request.method === 'GET') { + response.writeHead(200, { 'Content-Type': 'application/json' }) + response.end(JSON.stringify({ data: [{ id: 'alpha', object: 'model' }, { id: 'beta', object: 'model' }] })) + return + } + let raw = '' + request.on('data', chunk => { raw += chunk }) + request.on('end', () => { + const body = JSON.parse(raw) + requests.push(body) + afterRequest() + response.writeHead(200, { 'Content-Type': 'text/event-stream' }) + response.end(`data: ${JSON.stringify({ choices: [{ delta: { content: reply(body.model) }, finish_reason: 'stop' }] })}\n\ndata: [DONE]\n\n`) + }) +}) +await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)) +const baseUrl = `http://127.0.0.1:${(server.address() as { port: number }).port}/v1` +const project = { id: 'project', name: 'Synthetic project', cwd: '/workspace', workspace: null } as Project +const cases = [['high', 'low', 'high', false], ['low', 'high', 'low', false], + ['high', undefined, undefined, false], ['high', 'low', 'high', true]] as const +const observed: { transport: string; global: string; efforts: (string | undefined)[] }[] = [] +const expected: typeof observed = [] +try { + for (const transport of ['http', 'cli'] as const) { + for (const [global, alpha, beta, capturedByHost] of cases) { + const seats = [ + { id: 'alpha', name: 'Alpha', role: 'Review input', providerId: 'alpha', model: 'alpha', reasoningEffort: alpha as ReasoningEffortSetting | undefined }, + { id: 'beta', name: 'Beta', role: 'Check review', providerId: 'beta', model: 'beta', reasoningEffort: beta as ReasoningEffortSetting | undefined }, + ] + const room = { id: 'room', projectId: project.id, name: 'Synthetic room', problem: 'Review the synthetic input.', seats, events: [], memory: [], + memorySummary: '', finalText: '', state: 'queued', seatHeartbeats: {}, deliberationEffort: 'quick', + collaborationMode: 'balanced', createdAt: 1, updatedAt: 1 } as Room + const providers: Provider[] = seats.map(seat => ({ id: seat.id, name: seat.name, kind: 'local', baseUrl, + apiKey: '', models: [seat.model], transport: transport === 'http' ? 'chat-completions' : 'claude-cli' })) + const captured = new Map(seats.map(seat => [seat.id, seat.reasoningEffort ?? global])) + if (capturedByHost) for (const seat of seats) seat.reasoningEffort = 'medium' + const start = requests.length + const cliCalls: { reasoningEffort?: string }[] = [] + afterRequest = () => { + if (requests.length === start + 1) for (const seat of seats) seat.reasoningEffort = 'medium' + } + const controller = new AbortController() + const timer = setTimeout(() => controller.abort(), 5_000) + try { + await runRoom({ room, project, providers, problem: 'Review the synthetic input.', temperature: 0, + reasoningEffort: global, emit() {}, signal: controller.signal, maxTurns: 4, turnTimeoutMs: 1_000, + ...(capturedByHost ? { reasoningEffortForSeat: (seat) => captured.get(seat.id)! } : {}), + cliSeatTurn: async (params, onDelta) => { + cliCalls.push(params) + if (cliCalls.length === 1) for (const seat of seats) seat.reasoningEffort = 'medium' + const text = reply(params.model); onDelta(text); return text + }, + }) + } finally { clearTimeout(timer) } + assert.equal(room.state, 'complete', JSON.stringify(room.events)) + const efforts = transport === 'http' ? requests.slice(start).map(call => call.reasoning_effort) + : cliCalls.map(call => call.reasoningEffort) + assert.equal(efforts.length, 2, 'each real room run reaches both agents once') + observed.push({ transport, global, efforts }) + expected.push({ transport, global, efforts: [alpha ?? global, beta ?? global] }) + } + } + assert.deepEqual(observed, expected, 'HTTP and CLI room requests must retain each agent effort captured before turns start') + afterRequest = () => {} + const seat = { id: 'compact', name: 'Compact', role: 'Review input', providerId: 'alpha', model: 'alpha' } + const runtime: SeatRuntime = { seat, reasoningEffort: 'low', recent: [], heartbeat: initSeatHeartbeat(seat, 30, 1), + messages: Array.from({ length: 22 }, () => ({ role: 'user', content: 'Synthetic earlier context. '.repeat(20) })) } + const provider: Provider = { id: 'alpha', name: 'Synthetic API', kind: 'local', baseUrl, apiKey: '', models: ['alpha'] } + const before = requests.length + const compacted = await compactSeatRuntime(runtime, provider, 1, AbortSignal.timeout(2_000)) + assert.ok(compacted && compacted.folded > 0, 'real compaction folds earlier messages') + assert.equal(requests.length, before + 1) + assert.equal(requests.at(-1)?.reasoning_effort, 'low', 'private transcript compaction uses the same captured effort') + console.log('Room effort checks passed: HTTP/CLI requests, opposite agent/app settings, legacy fallback and startup snapshots.') +} finally { + server.closeAllConnections() + await new Promise(resolve => server.close(() => resolve())) +} diff --git a/app/electron/agent/room-reasoning-store.test.ts b/app/electron/agent/room-reasoning-store.test.ts new file mode 100644 index 00000000000..264a1ad8470 --- /dev/null +++ b/app/electron/agent/room-reasoning-store.test.ts @@ -0,0 +1,47 @@ +import assert from 'node:assert/strict' +import { promises as fs } from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { execFileSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' +import type { Room, Ticket } from './types' + +if (process.argv.includes('--reload')) { + const { loadRooms, loadTickets } = await import('../store') + const rooms = await loadRooms() + assert.equal(rooms.length, 1) + assert.deepEqual(rooms[0].seats.map(seat => seat.reasoningEffort), ['low', 'high', undefined]) + assert.equal(Object.hasOwn(rooms[0].seats[2], 'reasoningEffort'), false) + assert.equal((await loadTickets())[0].execution?.reasoningEffort, 'low', 'the settled worker capture survives reload') + console.log('A fresh process loaded the saved per-agent efforts and legacy fallback.') +} else { + const profile = await fs.mkdtemp(path.join(os.tmpdir(), 'tensorfold-room-effort-store-')) + const previousHome = process.env.VONTRA_HOME + process.env.VONTRA_HOME = profile + try { + const { saveRooms, saveTickets } = await import('../store') + const seat = { name: 'Reviewer', role: 'Review supplied input', providerId: 'fixture', model: 'fixture' } + const room: Room = { + id: 'room-effort', projectId: 'project', name: 'Synthetic room', problem: 'Review supplied input', + seats: [{ ...seat, id: 'low', reasoningEffort: 'low' }, { ...seat, id: 'high', reasoningEffort: 'high' }, + { ...seat, id: 'legacy' }], + state: 'ready', events: [], finalText: '', createdAt: 1, updatedAt: 1, + } + await saveRooms([room]) + const ticket: Ticket = { id: 'ticket', projectId: 'project', roomId: room.id, title: 'Synthetic work', body: '', + type: 'task', status: 'review', priority: 'medium', effort: 'small', tags: [], parentId: null, + assignee: 'Reviewer', threadId: 'worker', runState: 'done', order: 1, createdAt: 1, updatedAt: 2, + execution: { target: 'room', threadId: 'worker', reasoningEffort: 'low', startedAt: 1, finishedAt: 2, + checks: [], blockers: [], reviewVerdict: 'pending' } } + await saveTickets([ticket]) + const output = execFileSync(process.execPath, [ + 'node_modules/jiti/lib/jiti-cli.mjs', fileURLToPath(import.meta.url), '--reload', + ], { env: process.env, timeout: 15_000, encoding: 'utf8' }) + assert.match(output, /A fresh process loaded the saved per-agent efforts and legacy fallback/) + console.log('Protected Room settings survive a process restart without converting legacy defaults.') + } finally { + if (previousHome === undefined) delete process.env.VONTRA_HOME + else process.env.VONTRA_HOME = previousHome + await fs.rm(profile, { recursive: true, force: true }) + } +} diff --git a/app/electron/agent/room-seat-runtime.ts b/app/electron/agent/room-seat-runtime.ts new file mode 100644 index 00000000000..7be5de1f0ae --- /dev/null +++ b/app/electron/agent/room-seat-runtime.ts @@ -0,0 +1,107 @@ +import type { ApiMessage, Provider, Seat, SeatHeartbeat } from './types' +import type { RoomRunDeps, RoomSend } from './rooms' +import { streamChat } from './openai' +import { estimateTokens, renderTranscript } from './compaction' +import { ensureTensorFoldStudioStylePrompt } from './prompt-style' +import { isCliSeatProvider, runCliSeatTurn, type CliSeatTurnParams } from './room-cli-seat' + +export interface SeatRuntime { + seat: Seat + reasoningEffort: string + messages: { role: 'system' | 'user' | 'assistant'; content: string }[] + recent: string[] + heartbeat: SeatHeartbeat +} + +const ROOM_KEEP_PREFIX = 2 // system primer + SENSE/task +const ROOM_KEEP_RECENT = 8 + +async function summarizeRoomTranscript(provider: Provider, model: string, transcript: string, reasoningEffort: string, signal: AbortSignal): Promise { + const sys = ensureTensorFoldStudioStylePrompt([ + 'Compress a multi-agent room seat transcript into a dense private memory.', + 'Preserve the task, decisions, claims, blockers, files/tools used, open tickets, and anything directly addressed to this seat.', + 'Use terse bullets. Output only the summary.', + ].join('\n')) + let out = '' + for await (const ch of streamChat({ + provider, + baseUrl: provider.baseUrl, + apiKey: provider.apiKey, + model, + messages: [{ role: 'system', content: sys }, { role: 'user', content: transcript }], + temperature: 0.1, + reasoningEffort, + approvalMode: 'readonly', + cwd: null, + signal, + })) { + if (ch.type === 'content') out += ch.text + } + return out.trim() +} + +export async function compactSeatRuntime(rt: SeatRuntime, provider: Provider, limit: number, signal: AbortSignal): Promise<{ before: number; after: number; folded: number } | null> { + if (limit <= 0) return null + const before = estimateTokens(rt.messages as ApiMessage[]) + if (before <= limit) return null + const prefix = Math.min(ROOM_KEEP_PREFIX, rt.messages.length) + const cut = Math.max(prefix, rt.messages.length - ROOM_KEEP_RECENT) + if (cut - prefix < 2) return null + const toCompress = rt.messages.slice(prefix, cut) + const summary = await summarizeRoomTranscript(provider, rt.seat.model, renderTranscript(toCompress as ApiMessage[]), rt.reasoningEffort, signal) + if (!summary) return null + rt.messages = [ + ...rt.messages.slice(0, prefix), + { role: 'user', content: `[Earlier private room context auto-compacted to protect this model's context window. Running memory:]\n\n${summary}` }, + ...rt.messages.slice(cut), + ] + return { before, after: estimateTokens(rt.messages as ApiMessage[]), folded: toCompress.length } +} + +const DEFAULT_SEAT_TURN_TIMEOUT_MS = 180_000 + +export function createRoomSeatTurn(deps: RoomRunDeps, send: (event: RoomSend) => void) { + const { project, signal } = deps + const chat = deps.chat ?? streamChat + const cliSeatTurn = deps.cliSeatTurn ?? ((params: CliSeatTurnParams, onDelta: (text: string) => void) => runCliSeatTurn(params, onDelta)) + const streamSeatReply = async (rt: SeatRuntime, provider: Provider, turnSignal: AbortSignal): Promise => { + // CLI-backed seats run as a confined one-shot CLI invocation (room-cli-seat.ts); the + // per-turn timeout/abort wrapper in runSeatTurn applies unchanged either way. + if (isCliSeatProvider(provider)) { + return cliSeatTurn( + { provider, model: rt.seat.model, messages: rt.messages as ApiMessage[], cwd: project.cwd, reasoningEffort: rt.reasoningEffort, signal: turnSignal }, + (text) => send({ type: 'delta', seat: rt.seat.name, chunk: text }), + ) + } + let reply = '' + for await (const chunk of chat({ + provider, + baseUrl: provider.baseUrl, apiKey: provider.apiKey, model: rt.seat.model, + messages: rt.messages, temperature: deps.temperature, reasoningEffort: rt.reasoningEffort, approvalMode: 'readonly', cwd: project.cwd, signal: turnSignal, + })) { + if (chunk.type === 'content' && chunk.text) { reply += chunk.text; send({ type: 'delta', seat: rt.seat.name, chunk: chunk.text }) } + } + return reply + } + + // Run one seat turn under a per-turn timeout combined with the room signal. If the seat's model + // hangs/stalls, the turn is aborted (timedOut=true) and skipped so other models keep going, rather + // than the whole room freezing behind one slow seat. + return async (rt: SeatRuntime, provider: Provider): Promise<{ reply: string; timedOut: boolean }> => { + const timeoutMs = deps.turnTimeoutMs ?? DEFAULT_SEAT_TURN_TIMEOUT_MS + const ctrl = new AbortController() + const onAbort = () => ctrl.abort() + signal.addEventListener('abort', onAbort, { once: true }) + let timedOut = false + const timer = timeoutMs > 0 ? setTimeout(() => { timedOut = true; ctrl.abort() }, timeoutMs) : null + try { + return { reply: await streamSeatReply(rt, provider, ctrl.signal), timedOut: false } + } catch (e) { + if (timedOut) return { reply: '', timedOut: true } + throw e + } finally { + if (timer) clearTimeout(timer) + signal.removeEventListener('abort', onAbort) + } + } +} diff --git a/app/electron/agent/rooms.ts b/app/electron/agent/rooms.ts index b318ef31902..828ac93136f 100644 --- a/app/electron/agent/rooms.ts +++ b/app/electron/agent/rooms.ts @@ -1,38 +1,21 @@ +import { createRoomSeatTurn, compactSeatRuntime, type SeatRuntime } from './room-seat-runtime' +import { seatHeartbeatIntervalSeconds, initSeatHeartbeat, recordSeatBeat, stalledSeatNames, rearmSeatHeartbeats, evaluateSeatHeartbeats } from './room-heartbeats' +export { seatHeartbeatIntervalSeconds, initSeatHeartbeat, recordSeatBeat, stalledSeatNames, rearmSeatHeartbeats, evaluateSeatHeartbeats } from './room-heartbeats' +export type { SeatRuntimeLike } from './room-heartbeats' +import { buildPrimer, gateAction, renderForRoom, signature, blockerSignature, oneLine, roomTeamCue, escapeReg } from './room-protocol' import { randomUUID } from 'node:crypto' -import { streamChat } from './openai' -import { isExternalProvider } from '../../shared/provider-trust' -import { PROJECT_CONTEXT_WITHHELD_NOTE } from './planning-guard' -import { estimateTokens, kfmt, renderTranscript } from './compaction' -import { VONTRA_STYLE_PROMPT, ensureTensorFoldStudioStylePrompt } from './prompt-style' -import type { ApiMessage, Project, Provider, Room, RoomDeliberationEffort, RoomEventItem, RoomState, RoomStreamEvent, Seat, SeatHeartbeat } from './types' -import { buildRoomMemoryDiff, buildRoomRunMemoryEntry, deliberationBudgetText, deliberationProfile, formatRoomMemory, inferSeatLane, mergeRoomMemory, normalizeCollaborationMode, normalizeDeliberationEffort, roomShouldCloseOut, seatCollaborationInstructions, updateRoomMemorySummary } from './room-collaboration' +import { captureAgentReasoningEffort } from '../../shared/reasoning-effort' +import type { streamChat } from './openai' +import { kfmt } from './compaction' +import type { Project, Provider, Room, RoomEventItem, RoomState, RoomStreamEvent, Seat, SeatHeartbeat } from './types' +import { buildRoomMemoryDiff, buildRoomRunMemoryEntry, deliberationBudgetText, deliberationProfile, inferSeatLane, mergeRoomMemory, normalizeCollaborationMode, normalizeDeliberationEffort, roomShouldCloseOut, updateRoomMemorySummary } from './room-collaboration' import { validateRoomConfiguration, validateRoomTransition } from './room-invariants' -import { roomModePromptBlock, roomOutcomeGate, roomOutcomeProfile } from './room-outcomes' +import { roomOutcomeGate, roomOutcomeProfile } from './room-outcomes' import { renderSharedMemory } from './shared-room-memory' -import { isCliSeatProvider, runCliSeatTurn, type CliSeatTurnParams } from './room-cli-seat' +import type { CliSeatTurnParams } from './room-cli-seat' import { recordRoomEvent } from './orchestration-journal' import { emitRoomLifecycle } from '../main/host/orchestration-events' -// Ported from LLMComposer's room/huddle engine: multiple provider-bound seats -// deliberate on one shared problem as an attributed dialogue, with SENSE -// injection so each seat knows it is one of several real teammates. - -const VERBS = new Set(['SPEAK', 'ASK', 'OBJECT', 'ASSIGN', 'CLAIM', 'CHECK', 'VOTE', 'YIELD', 'FINAL', 'TOOL']) - -interface SeatRuntime { - seat: Seat - messages: { role: 'system' | 'user' | 'assistant'; content: string }[] - recent: string[] - heartbeat: SeatHeartbeat -} - -// Minimal shape the heartbeat helpers need — lets tests exercise stall detection -// without standing up a full SeatRuntime (messages/recent are irrelevant here). -export interface SeatRuntimeLike { - seat: Pick - heartbeat: SeatHeartbeat -} - interface SeatModelRecovery { provider: Provider providerAccountId: string | null @@ -40,242 +23,6 @@ interface SeatModelRecovery { notice: string } -// Default grace after nextDueAt before a slow seat is flagged stalled (BUG #53). -// Tolerates transient model latency so a normal slow turn does not false-positive. -const SEAT_STALL_GRACE_SECONDS = 30 - -// Heartbeat cadence derived from the room deliberation effort. Deeper sessions -// expect longer per-turn thinking, so we widen the interval to avoid false stalls. -export function seatHeartbeatIntervalSeconds(effort?: RoomDeliberationEffort | null): number { - switch (effort) { - case 'quick': return 30 - case 'deep': return 90 - case 'max': return 120 - case 'normal': - default: return 60 - } -} - -// Seed a healthy heartbeat for a seat at room start. -export function initSeatHeartbeat(seat: Pick, intervalSeconds: number, now: number): SeatHeartbeat { - return { - seatId: seat.id, - seatName: seat.name, - intervalSeconds, - stallGraceSeconds: SEAT_STALL_GRACE_SECONDS, - required: true, - count: 0, - lastBeatAt: now, - nextDueAt: now + intervalSeconds * 1000, - missedSince: null, - } -} - -// Record that a seat produced a turn: bump count, advance the clock, clear any stall. -export function recordSeatBeat(hb: SeatHeartbeat, now: number): void { - hb.count++ - hb.lastBeatAt = now - hb.nextDueAt = hb.required ? now + hb.intervalSeconds * 1000 : null - hb.missedSince = null -} - -// Names of seats currently flagged stalled (missedSince set), excluding one seat -// by name (the seat trying to FINAL is obviously alive). Used to block a premature -// finalize while a teammate is hung (BUG #53). -export function stalledSeatNames(runtimes: SeatRuntimeLike[], exclude?: string): string[] { - return runtimes - .filter((rt) => rt.heartbeat.required && rt.heartbeat.missedSince != null && rt.seat.name !== exclude) - .map((rt) => rt.seat.name) -} - -// Re-arm the stall window for seats that actually took a turn in the previous pass. -// A single pass over several slow models can take longer than interval+grace, so a -// seat that beat last pass and is merely waiting its turn must not be false-flagged; -// pushing its nextDueAt forward to this pass start prevents that. Crucially, seats -// that did NOT run last pass (e.g. one that keeps timing out without ever calling -// recordSeatBeat, or any seat on the very first pass) are left untouched so their -// window keeps counting and evaluateSeatHeartbeats can actually flag a real stall — -// re-arming every non-stalled seat unconditionally is what made stall detection dead -// code (BUG #53 regression). -export function rearmSeatHeartbeats( - runtimes: SeatRuntimeLike[], - ranLastPass: Set, - passStart: number, -): void { - for (const rt of runtimes) { - const hb = rt.heartbeat - if (hb.required && hb.missedSince == null && ranLastPass.has(rt.seat.id)) { - hb.nextDueAt = passStart + hb.intervalSeconds * 1000 - } - } -} - -// Detect seats whose turn is overdue past the grace window. Mutates each newly -// stalled heartbeat's missedSince so a stall is reported once (not every tick), -// and returns human-readable notices for the moderator to surface. -export function evaluateSeatHeartbeats(runtimes: SeatRuntimeLike[], now: number): string[] { - const stalled: string[] = [] - for (const rt of runtimes) { - const hb = rt.heartbeat - if (!hb.required || hb.lastBeatAt == null || hb.nextDueAt == null) continue - if (hb.missedSince != null) continue // already flagged; do not re-report - const stallAt = hb.nextDueAt + hb.stallGraceSeconds * 1000 - if (now >= stallAt) { - hb.missedSince = hb.nextDueAt - const ago = Math.round((now - hb.lastBeatAt) / 1000) - stalled.push(`Seat "${rt.seat.name}": heartbeat overdue (last beat ${ago}s ago)`) - } - } - return stalled -} - -const ROOM_KEEP_PREFIX = 2 // system primer + SENSE/task -const ROOM_KEEP_RECENT = 8 - -function buildPrimer(project: Project, room: Room, seat: Seat, roster: Seat[], provider?: Provider): string { - const rosterText = roster.map((s) => `- ${s.name}: ${s.role} (model ${s.model})`).join('\n') - const roomMemory = formatRoomMemory(room) - const sharedMemory = room.sharedMemory ? renderSharedMemory(room.sharedMemory) : '' - return [ - `You are ${seat.name} in a live multi-agent working session with the teammates below.`, - '', - `ROOM ROLE\nYour visible room role is ${seat.role}. Use it to decide when to volunteer, challenge, defer, or take a ticket, but keep your general reasoning intact.`, - `\n${seatCollaborationInstructions(room, seat, provider)}`, - roomOutcomeProfile(room.mode) ? `\nROOM OUTCOME\n${roomModePromptBlock(roomOutcomeProfile(room.mode)!)}` : '', - project.team ? `\nTEAM CHARTER\n${project.team}` : '', - // External seats plan only and never see project memory (planning-guard.ts). - project.memory ? (isExternalProvider(provider) ? `\n${PROJECT_CONTEXT_WITHHELD_NOTE}` : `\nPROJECT MEMORY\n${project.memory}`) : '', - roomMemory ? `\nROOM MEMORY\n${roomMemory}` : '', - sharedMemory ? `\n${sharedMemory}` : '', - '', - 'ROOM CONTRACT', - 'Messages tagged [room] are what teammates actually said; [moderator] hands you the floor.', - 'Speak in first person, briefly and concretely. React to what was just said instead of restating it.', - "Never write [room] or [moderator] lines yourself, and never invent a teammate's reply.", - 'Never repeat a question or point you already made.', - 'End every reply with exactly one line: ACTION: .', - 'Verbs: SPEAK, ASK, OBJECT, ASSIGN, CLAIM, CHECK, VOTE, YIELD, FINAL, TOOL.', - 'ACTION: ASK addresses one teammate by name. ACTION: FINAL ends the room only when the task is genuinely done.', - 'When you answer a specific ASK or ASSIGN, cite it by appending RE: # to your ACTION line so the reply links back to the question.', - 'Only state what you can actually see in the [room] lines above. Do not claim progress that has not happened.', - '', - 'TEAMWORK CONTRACT', - 'Make handoffs explicit. If a teammate asks or assigns you something, answer that first and say what you are unblocking for them.', - 'Help the room finish the user goal: create or claim concrete tickets, attach evidence, start workers when ready, and yield when waiting.', - 'If you disagree, name the risk and offer the next useful move instead of reopening the whole plan.', - '', - VONTRA_STYLE_PROMPT, - '', - 'SHARED BOARD: coordinate through it so you never duplicate a teammate\'s work:', - 'ACTION: TOOL list_tickets: see every ticket and who is working on what.', - 'ACTION: TOOL claim_ticket {"title":"..."}: claim a ticket BEFORE you start it, so teammates know it is taken.', - 'ACTION: TOOL create_ticket {"title":"...","body":"...","priority":"high","risk":"medium","allowedCapabilities":["read"],"requiredEvidence":["files inspected","verification result"],"acceptanceCriteria":["..."]}: add an execution ticket to the board.', - 'ACTION: TOOL add_ticket_evidence {"title":"...","kind":"file","summary":"What you found","ref":"src/file.ts"}: attach evidence to a claimed ticket.', - 'ACTION: TOOL complete_ticket {"title":"...","evidence":[{"kind":"review","summary":"Reviewed X and found Y"}]}: mark your claimed ticket complete after attaching required evidence.', - 'ACTION: TOOL left_to_work: see the remaining room tickets, active workers, risks, and known file refs.', - 'ACTION: TOOL memory_write {"name":"decisions","content":"...","mode":"append-bullet"}: update the room\'s live shared memory (decisions, plan, blockers). Teammates see updates on their next turn.', - 'ACTION: TOOL start_ticket_work {"title":"...","phase":"build","paths":["src/x.ts"]}: ask the Room Supervisor to start a ticket worker thread in the room worktree. Use phase "review" for reviewer passes. If a file overlap is intentional, include "mergeDecision":"why this overlap is safe and how results will be merged".', - 'ACTION: TOOL delegate {"task":"..."}: hand a focused subtask to a sub-agent and get its result. Add "targetSeat":"SeatName" to run it on that seat\'s provider/model, or "providerId"/"accountId"/"model" for an explicit route; omit them to use your own.', - 'Always claim before working; never touch a ticket already claimed by someone else.', - 'Only start ticket workers for claimed or ready tickets. Declare paths when you know them so the supervisor can prevent overlapping edits.', - 'Do not ACTION: FINAL while room tickets are still open.', - '', - 'WORKSPACE: inspect the shared project safely:', - 'ACTION: TOOL read_file {"path":"src/x.ts"}: read a file.', - 'ACTION: TOOL search {"query":"..."}: find relevant code.', - 'ACTION: TOOL list_dir {"path":"src"}: inspect folders.', - 'Room agents are read-only by default. Do not attempt edit_file, write_file, or run_command unless the user opens an approved work thread for that ticket.', - 'When you know the change needed, create/claim a ticket and explain the proposed edit for an approved thread to execute.', - '', - 'TEAM ROSTER', - rosterText, - ].filter(Boolean).join('\n') -} - -interface Action { verb: string; text: string; raw: string; prose?: string } - -// Lenient gate: missing action becomes SPEAK, empty body becomes YIELD. -function gateAction(output: string): Action { - const raw = (output ?? '').trim() - if (!raw) return { verb: 'YIELD', text: '', raw } - const lines = raw.split('\n') - const actionLine = [...lines].reverse().find((l) => l.trim().toUpperCase().startsWith('ACTION:')) - const prose = lines.filter((l) => l !== actionLine).join('\n').trim() - if (!actionLine) return { verb: 'SPEAK', text: prose || raw, raw } - const body = actionLine.trim().slice(actionLine.trim().indexOf(':') + 1).trim() - const parts = body.split(/\s+/) - const verb = (parts[0] || '').toUpperCase() - const text = parts.slice(1).join(' ').trim() - if (!VERBS.has(verb)) return { verb: 'SPEAK', text: prose || raw, raw } - if (!text && verb !== 'YIELD') return { verb: 'YIELD', text: '', raw } - // Keep the prose so peers receive the model's actual reasoning, not just the one-line ACTION tagline. - return { verb, text, raw, prose } -} - -function renderForRoom(ev: RoomEventItem, compact = false): string { - const label = ev.kind.toUpperCase() - // Addressed asks/assigns carry a short ref (#id8) so a teammate can answer with - // "RE: #"; replies show the ref they answer (re #id8). - const ref = (ev.kind === 'ask' || ev.kind === 'assign') ? ` #${ev.id.slice(0, 8)}` : '' - const reply = ev.replyTo ? ` re #${ev.replyTo.slice(0, 8)}` : '' - if (compact) return `[room] ${ev.seat} (${label}${reply}): ${ev.text}` - const head = ev.target && ev.target !== 'all' && ev.target !== ev.seat - ? `[room] ${ev.seat} (${label}, to ${ev.target}${ref}${reply}):` - : `[room] ${ev.seat} (${label}${ref}${reply}):` - return `${head}\n${ev.text}` -} - -function signature(raw: string): string { - return raw.split('\n').filter((l) => !l.trim().toUpperCase().startsWith('ACTION:')).join(' ').trim().toLowerCase().slice(0, 400) -} - -function blockerSignature(blockers: string[]): string { - return blockers.map((blocker) => blocker.replace(/\s+/g, ' ').trim().toLowerCase()).filter(Boolean).join('\n') -} - -function oneLine(text: string, max = 180): string { - const compact = text.replace(/\s+/g, ' ').trim() - return compact.length > max ? `${compact.slice(0, Math.max(0, max - 3))}...` : compact -} - -function roomTeamCue(room: Room, seat: Seat): string { - const recent = room.events.filter((event) => !['task', 'notice', 'user'].includes(event.kind)).slice(-10) - const directHandoffs = recent.filter((event) => (event.kind === 'ask' || event.kind === 'assign') && event.target === seat.name) - const latestDirect = directHandoffs[directHandoffs.length - 1] - const latestOtherHandoff = recent.filter((event) => - (event.kind === 'ask' || event.kind === 'assign') && - !!event.target && - event.target !== 'all' && - event.target !== seat.name - ).slice(-1)[0] - const latestClaim = recent.filter((event) => event.kind === 'claim').slice(-1)[0] - const latestUserSteer = room.events - .filter((event) => event.kind === 'user' && (event.target === 'all' || event.target === seat.name)) - .slice(-1)[0] - const cue: string[] = [] - - if (latestUserSteer) { - cue.push(`USER STEERING: "${oneLine(latestUserSteer.text, 220)}". Treat this as the user's latest direction and respond to it before lower-priority room chatter.`) - } - - if (latestDirect) { - cue.push(`TEAM CUE: ${latestDirect.seat} handed work to you: "${oneLine(latestDirect.text, 220)}". Answer or unblock that first, naming ${latestDirect.seat}.`) - } else if (latestOtherHandoff) { - cue.push(`TEAM CUE: ${latestOtherHandoff.seat} handed work to ${latestOtherHandoff.target}. Let that teammate respond unless you can unblock with new evidence.`) - } - - if (latestClaim) { - cue.push(`Latest claim: ${latestClaim.seat} claimed "${oneLine(latestClaim.text, 120)}". Build on it and do not duplicate it.`) - } - - cue.push('Work like a teammate: reference who you are helping, answer direct asks before new topics, create or claim the next useful ticket, start workers when ready, and ACTION: YIELD if you are waiting.') - return cue.join(' ') -} - -function escapeReg(s: string): string { - return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') -} - const ALWAYS_FULL = new Set(['final', 'task', 'user', 'file_change']) // `excludeSeatId` is a seat ID (not name): keying on id means two seats that happen to share a name @@ -290,50 +37,9 @@ function broadcast(runtimes: SeatRuntime[], item: RoomEventItem, excludeSeatId: } } -async function summarizeRoomTranscript(provider: Provider, model: string, transcript: string, signal: AbortSignal): Promise { - const sys = ensureTensorFoldStudioStylePrompt([ - 'Compress a multi-agent room seat transcript into a dense private memory.', - 'Preserve the task, decisions, claims, blockers, files/tools used, open tickets, and anything directly addressed to this seat.', - 'Use terse bullets. Output only the summary.', - ].join('\n')) - let out = '' - for await (const ch of streamChat({ - provider, - baseUrl: provider.baseUrl, - apiKey: provider.apiKey, - model, - messages: [{ role: 'system', content: sys }, { role: 'user', content: transcript }], - temperature: 0.1, - approvalMode: 'readonly', - cwd: null, - signal, - })) { - if (ch.type === 'content') out += ch.text - } - return out.trim() -} - -async function compactSeatRuntime(rt: SeatRuntime, provider: Provider, limit: number, signal: AbortSignal): Promise<{ before: number; after: number; folded: number } | null> { - if (limit <= 0) return null - const before = estimateTokens(rt.messages as ApiMessage[]) - if (before <= limit) return null - const prefix = Math.min(ROOM_KEEP_PREFIX, rt.messages.length) - const cut = Math.max(prefix, rt.messages.length - ROOM_KEEP_RECENT) - if (cut - prefix < 2) return null - const toCompress = rt.messages.slice(prefix, cut) - const summary = await summarizeRoomTranscript(provider, rt.seat.model, renderTranscript(toCompress as ApiMessage[]), signal) - if (!summary) return null - rt.messages = [ - ...rt.messages.slice(0, prefix), - { role: 'user', content: `[Earlier private room context auto-compacted to protect this model's context window. Running memory:]\n\n${summary}` }, - ...rt.messages.slice(cut), - ] - return { before, after: estimateTokens(rt.messages as ApiMessage[]), folded: toCompress.length } -} - // Distributive Omit so each union member keeps its own payload keys // (a plain Omit collapses to the members' common keys only). -type RoomSend = RoomStreamEvent extends infer T ? (T extends any ? Omit : never) : never +export type RoomSend = RoomStreamEvent extends infer T ? (T extends any ? Omit : never) : never export interface RoomRunDeps { room: Room @@ -342,6 +48,7 @@ export interface RoomRunDeps { problem: string temperature: number reasoningEffort: string + reasoningEffortForSeat?: (seat: Seat) => string emit: (e: RoomStreamEvent) => void signal: AbortSignal maxTurns?: number @@ -361,8 +68,6 @@ export interface RoomRunDeps { turnTimeoutMs?: number } -const DEFAULT_SEAT_TURN_TIMEOUT_MS = 180_000 - export async function runRoom(deps: RoomRunDeps): Promise { const { room, project, providers, problem, emit, signal } = deps const outcome = roomOutcomeProfile(room.mode) @@ -384,53 +89,13 @@ export async function runRoom(deps: RoomRunDeps): Promise { return true } const providerForSeat = (seat: Seat) => deps.providerForSeat?.(seat) ?? providers.find((p) => p.id === seat.providerId) - const chat = deps.chat ?? streamChat - const cliSeatTurn = deps.cliSeatTurn ?? ((params: CliSeatTurnParams, onDelta: (text: string) => void) => runCliSeatTurn(params, onDelta)) - const streamSeatReply = async (rt: SeatRuntime, provider: Provider, turnSignal: AbortSignal): Promise => { - // CLI-backed seats run as a confined one-shot CLI invocation (room-cli-seat.ts); the - // per-turn timeout/abort wrapper in runSeatTurn applies unchanged either way. - if (isCliSeatProvider(provider)) { - return cliSeatTurn( - { provider, model: rt.seat.model, messages: rt.messages as ApiMessage[], cwd: project.cwd, reasoningEffort: deps.reasoningEffort, signal: turnSignal }, - (text) => send({ type: 'delta', seat: rt.seat.name, chunk: text }), - ) - } - let reply = '' - for await (const chunk of chat({ - provider, - baseUrl: provider.baseUrl, apiKey: provider.apiKey, model: rt.seat.model, - messages: rt.messages, temperature: deps.temperature, reasoningEffort: deps.reasoningEffort, approvalMode: 'readonly', cwd: project.cwd, signal: turnSignal, - })) { - if (chunk.type === 'content' && chunk.text) { reply += chunk.text; send({ type: 'delta', seat: rt.seat.name, chunk: chunk.text }) } - } - return reply - } - - // Run one seat turn under a per-turn timeout combined with the room signal. If the seat's model - // hangs/stalls, the turn is aborted (timedOut=true) and skipped so other models keep going, rather - // than the whole room freezing behind one slow seat. - const runSeatTurn = async (rt: SeatRuntime, provider: Provider): Promise<{ reply: string; timedOut: boolean }> => { - const timeoutMs = deps.turnTimeoutMs ?? DEFAULT_SEAT_TURN_TIMEOUT_MS - const ctrl = new AbortController() - const onAbort = () => ctrl.abort() - signal.addEventListener('abort', onAbort, { once: true }) - let timedOut = false - const timer = timeoutMs > 0 ? setTimeout(() => { timedOut = true; ctrl.abort() }, timeoutMs) : null - try { - return { reply: await streamSeatReply(rt, provider, ctrl.signal), timedOut: false } - } catch (e) { - if (timedOut) return { reply: '', timedOut: true } - throw e - } finally { - if (timer) clearTimeout(timer) - signal.removeEventListener('abort', onAbort) - } - } + const runSeatTurn = createRoomSeatTurn(deps, send) const heartbeatInterval = seatHeartbeatIntervalSeconds(room.deliberationEffort) const heartbeatStart = Date.now() const runtimes: SeatRuntime[] = room.seats.map((seat) => ({ seat, + reasoningEffort: deps.reasoningEffortForSeat?.(seat) ?? captureAgentReasoningEffort(seat, deps.reasoningEffort), messages: [{ role: 'system', content: buildPrimer(project, room, seat, room.seats, providerForSeat(seat)) }], recent: [], heartbeat: initSeatHeartbeat(seat, heartbeatInterval, heartbeatStart), diff --git a/app/electron/agent/types/rooms.ts b/app/electron/agent/types/rooms.ts new file mode 100644 index 00000000000..620d73feeed --- /dev/null +++ b/app/electron/agent/types/rooms.ts @@ -0,0 +1,173 @@ +import type { RoomMode } from '../room-outcomes' +import type { SharedMemoryState } from '../shared-room-memory' +import type { WorkspaceLocation } from './workspace' +import type { ReasoningEffortSetting } from './settings' + +// ---- Multi-agent Rooms (Project → Room → Seats) ---- +export interface Seat { + id: string + name: string + role: string + providerId: string + providerAccountId?: string | null + model: string + reasoningEffort?: ReasoningEffortSetting + lane?: RoomSeatLane + roleProfileId?: AgentRoleProfileId + fanOutBudget?: FanOutBudget +} + +// Per-seat liveness for room deliberation (BUG #53). Parallels MissionHeartbeat: +// tracks when a seat last took a turn so a stuck/slow seat surfaces as stalled +// instead of silently locking the room. Runtime-ephemeral — stored on Room. +export interface SeatHeartbeat { + seatId: string + seatName: string + intervalSeconds: number // expected cadence between turns + stallGraceSeconds: number // tolerance after nextDueAt before signalling a stall + required: boolean + count: number // turns this seat has taken + lastBeatAt: number | null // when the seat last took a turn + nextDueAt: number | null // when the next turn is expected + missedSince: number | null // when the stall was first detected (null = healthy) +} + +export type RoomSeatLane = 'planning' | 'development' | 'review' | 'research' | 'operations' + +export type AgentRoleProfileId = 'planner' | 'builder' | 'reviewer' | 'researcher' | 'operator' + +export type FanOutBudget = 'single' | 'paired' | 'council' | 'swarm' + +export type RoomCollaborationMode = + | 'balanced' + | 'frontier_plans_local_builds' + | 'local_private' + | 'frontier_council' + | 'supervisor' + +export type RoomDeliberationEffort = 'quick' | 'normal' | 'deep' | 'max' + +export interface RoomWorkerBudget { + maxActive: number + maxStarts: number +} + +export interface RoomMemoryEntry { + id: string + kind: 'summary' | 'decision' | 'preference' | 'finding' + text: string + source: 'manual' | 'room' + createdAt: number + updatedAt: number +} + +export interface RoomMemoryDiff { + added: RoomMemoryEntry[] + removed: RoomMemoryEntry[] + summaryChanged: boolean + previousCount: number + nextCount: number +} + +export type RoomManualMemoryCommand = + | { action: 'add'; kind: RoomMemoryEntry['kind']; text: string } + | { action: 'remove'; entryId: string } + +export type RoomState = + | 'idle' + | 'created' + | 'ready' + | 'degraded' + | 'queued' + | 'running' + | 'waiting_user' + | 'waiting_external' + | 'complete' + | 'stopped' + | 'failed' + | 'archived' + | 'error' + +export interface RoomEventItem { + id: string + tick: number + kind: string // task | speak | ask | assign | object | claim | check | vote | yield | final | tool | notice | error + seat: string // seat name | 'you' | 'system' | 'moderator' + target: string + text: string + replyTo?: string // for ask/assign — the room event id this message answers (lenient RE: marker) + tool?: string // for kind 'tool' — the tool name (read_file, edit_file, run_command, …) + args?: Record // for kind 'tool' — normalized tool arguments and lifecycle metadata + subAgentId?: string // for delegate tool runs + parentSeat?: string // for delegate tool runs + status?: string // for delegate tool runs + path?: string // for file tools — the file the agent touched + createdAt: number +} + +export interface Room { + id: string + projectId: string + name: string + // Outcome mode (VST-019): what the room is FOR — sets its stop condition, expected + // final artifact, seat/moderator behavior, and default budget. Unset = legacy room + // with no outcome gate. See electron/agent/room-outcomes.ts. + mode?: RoomMode | null + seats: Seat[] + rootCwd?: string | null + workspaceCwd?: string | null + scratchpadCwd?: string | null + workspace?: WorkspaceLocation | null + collaborationMode?: RoomCollaborationMode + deliberationEffort?: RoomDeliberationEffort + workerBudget?: RoomWorkerBudget + memory?: RoomMemoryEntry[] + memorySummary?: string + // Live shared scratchpad (decisions/plan/blockers) seats read and write during a + // run via the memory_write room tool. Persisted with the room (rooms.json). + sharedMemory?: SharedMemoryState + // Per-seat liveness while the room is running (BUG #53). Keyed by seat id. + // Runtime-ephemeral; surfaced to the supervisor job + UI for stall detection. + seatHeartbeats?: Record + problem: string + state: RoomState + events: RoomEventItem[] + finalText: string + archivedAt?: number | null + /** Origin host for an Orchestrator-owned renderer projection/archive record. */ + orchestratorHostId?: string | null + createdAt: number + updatedAt: number +} + +// Room worktree merge-back result (room:mergeWorktree). 'gated' = final gates not green, +// 'blocked' = git-hygiene preflight refused, 'conflict' = merge aborted and ticketed. +export type RoomMergeStatus = 'merged' | 'nothing' | 'conflict' | 'gated' | 'blocked' | 'error' + +export interface RoomMergeConflictInfo { + branch: string + files: string[] + ticketId: string | null +} + +export interface RoomMergeResult { + ok: boolean + status: RoomMergeStatus + baseBranch: string | null + merged: string[] + remaining: string[] + conflict: RoomMergeConflictInfo | null + blockers: string[] + message: string +} + +export type RoomStreamEvent = ( + | { roomId: string; type: 'status'; state: Room['state'] } + | { roomId: string; type: 'turn'; seat: string } + | { roomId: string; type: 'delta'; seat: string; chunk: string } + | { roomId: string; type: 'event'; item: RoomEventItem } + | { roomId: string; type: 'memory'; memory: RoomMemoryEntry[]; memorySummary: string; diff?: RoomMemoryDiff } + | { roomId: string; type: 'final'; text: string } + | { roomId: string; type: 'done' } + | { roomId: string; type: 'error'; message: string; fatal?: boolean } +) & { orchestratorHostId?: string | null } diff --git a/app/electron/agent/types/workspace.ts b/app/electron/agent/types/workspace.ts index 740cfae463b..5dbcc659796 100644 --- a/app/electron/agent/types/workspace.ts +++ b/app/electron/agent/types/workspace.ts @@ -1,86 +1,26 @@ -import type { RoomMode } from '../room-outcomes' +export type { + Seat, + SeatHeartbeat, + RoomSeatLane, + AgentRoleProfileId, + FanOutBudget, + RoomCollaborationMode, + RoomDeliberationEffort, + RoomWorkerBudget, + RoomMemoryEntry, + RoomMemoryDiff, + RoomManualMemoryCommand, + RoomState, + RoomEventItem, + Room, + RoomMergeStatus, + RoomMergeConflictInfo, + RoomMergeResult, + RoomStreamEvent, +} from './rooms' export type { RoomMode, RoomArtifactKind, RoomOutcomeProfile } from '../room-outcomes' -import type { SharedMemoryState } from '../shared-room-memory' import type { ExportRedaction, ProjectKanbanSettings } from './timeline' - -// ---- Multi-agent Rooms (Project → Room → Seats) ---- -export interface Seat { - id: string - name: string - role: string - providerId: string - providerAccountId?: string | null - model: string - lane?: RoomSeatLane - roleProfileId?: AgentRoleProfileId - fanOutBudget?: FanOutBudget -} - -// Per-seat liveness for room deliberation (BUG #53). Parallels MissionHeartbeat: -// tracks when a seat last took a turn so a stuck/slow seat surfaces as stalled -// instead of silently locking the room. Runtime-ephemeral — stored on Room. -export interface SeatHeartbeat { - seatId: string - seatName: string - intervalSeconds: number // expected cadence between turns - stallGraceSeconds: number // tolerance after nextDueAt before signalling a stall - required: boolean - count: number // turns this seat has taken - lastBeatAt: number | null // when the seat last took a turn - nextDueAt: number | null // when the next turn is expected - missedSince: number | null // when the stall was first detected (null = healthy) -} - -export type RoomSeatLane = 'planning' | 'development' | 'review' | 'research' | 'operations' -export type AgentRoleProfileId = 'planner' | 'builder' | 'reviewer' | 'researcher' | 'operator' -export type FanOutBudget = 'single' | 'paired' | 'council' | 'swarm' -export type RoomCollaborationMode = - | 'balanced' - | 'frontier_plans_local_builds' - | 'local_private' - | 'frontier_council' - | 'supervisor' -export type RoomDeliberationEffort = 'quick' | 'normal' | 'deep' | 'max' -export interface RoomWorkerBudget { - maxActive: number - maxStarts: number -} - -export interface RoomMemoryEntry { - id: string - kind: 'summary' | 'decision' | 'preference' | 'finding' - text: string - source: 'manual' | 'room' - createdAt: number - updatedAt: number -} - -export interface RoomMemoryDiff { - added: RoomMemoryEntry[] - removed: RoomMemoryEntry[] - summaryChanged: boolean - previousCount: number - nextCount: number -} - -export type RoomManualMemoryCommand = - | { action: 'add'; kind: RoomMemoryEntry['kind']; text: string } - | { action: 'remove'; entryId: string } - -export type RoomState = - | 'idle' - | 'created' - | 'ready' - | 'degraded' - | 'queued' - | 'running' - | 'waiting_user' - | 'waiting_external' - | 'complete' - | 'stopped' - | 'failed' - | 'archived' - | 'error' +import type { ReasoningEffortSetting } from './settings' export type ProjectExecutionTarget = 'local' | 'orchestrator' @@ -195,23 +135,6 @@ export interface ProjectMemoryCandidateDiff { changes: Array<{ field: 'text' | 'kind' | 'confidence' | 'privacyScope' | 'sourceType' | 'sourceRef' | 'sourceIds' | 'owner' | 'lastVerifiedAt' | 'sourceThreadId' | 'sourceTurn'; before: string | null; after: string | null }> } -export interface RoomEventItem { - id: string - tick: number - kind: string // task | speak | ask | assign | object | claim | check | vote | yield | final | tool | notice | error - seat: string // seat name | 'you' | 'system' | 'moderator' - target: string - text: string - replyTo?: string // for ask/assign — the room event id this message answers (lenient RE: marker) - tool?: string // for kind 'tool' — the tool name (read_file, edit_file, run_command, …) - args?: Record // for kind 'tool' — normalized tool arguments and lifecycle metadata - subAgentId?: string // for delegate tool runs - parentSeat?: string // for delegate tool runs - status?: string // for delegate tool runs - path?: string // for file tools — the file the agent touched - createdAt: number -} - export type { AppendSubAgentMessageInput, CreateSubAgentInput, @@ -232,62 +155,6 @@ export type { SubAgentStatus, } from '../subagents' -export interface Room { - id: string - projectId: string - name: string - // Outcome mode (VST-019): what the room is FOR — sets its stop condition, expected - // final artifact, seat/moderator behavior, and default budget. Unset = legacy room - // with no outcome gate. See electron/agent/room-outcomes.ts. - mode?: RoomMode | null - seats: Seat[] - rootCwd?: string | null - workspaceCwd?: string | null - scratchpadCwd?: string | null - workspace?: WorkspaceLocation | null - collaborationMode?: RoomCollaborationMode - deliberationEffort?: RoomDeliberationEffort - workerBudget?: RoomWorkerBudget - memory?: RoomMemoryEntry[] - memorySummary?: string - // Live shared scratchpad (decisions/plan/blockers) seats read and write during a - // run via the memory_write room tool. Persisted with the room (rooms.json). - sharedMemory?: SharedMemoryState - // Per-seat liveness while the room is running (BUG #53). Keyed by seat id. - // Runtime-ephemeral; surfaced to the supervisor job + UI for stall detection. - seatHeartbeats?: Record - problem: string - state: RoomState - events: RoomEventItem[] - finalText: string - archivedAt?: number | null - /** Origin host for an Orchestrator-owned renderer projection/archive record. */ - orchestratorHostId?: string | null - createdAt: number - updatedAt: number -} - -// Room worktree merge-back result (room:mergeWorktree). 'gated' = final gates not green, -// 'blocked' = git-hygiene preflight refused, 'conflict' = merge aborted and ticketed. -export type RoomMergeStatus = 'merged' | 'nothing' | 'conflict' | 'gated' | 'blocked' | 'error' - -export interface RoomMergeConflictInfo { - branch: string - files: string[] - ticketId: string | null -} - -export interface RoomMergeResult { - ok: boolean - status: RoomMergeStatus - baseBranch: string | null - merged: string[] - remaining: string[] - conflict: RoomMergeConflictInfo | null - blockers: string[] - message: string -} - export type TicketStatus = 'todo' | 'ready' | 'in_progress' | 'needs_clarification' | 'review' | 'completed' export type TicketRisk = 'low' | 'medium' | 'high' export type TicketCapability = 'read' | 'write' | 'shell' | 'network' | 'browser' | 'connector' | 'mcp' @@ -320,6 +187,7 @@ export interface TicketExecutionRecord { hostId?: string | null providerId?: string | null model?: string | null + reasoningEffort?: ReasoningEffortSetting branch?: string | null threadId?: string | null /** Host-issued run identity for lifecycle correlation. */ @@ -375,17 +243,6 @@ export type TicketRemoteLifecycleCommand = | { action: 'start_failed'; message?: string } | { action: 'cancel' } -export type RoomStreamEvent = ( - | { roomId: string; type: 'status'; state: Room['state'] } - | { roomId: string; type: 'turn'; seat: string } - | { roomId: string; type: 'delta'; seat: string; chunk: string } - | { roomId: string; type: 'event'; item: RoomEventItem } - | { roomId: string; type: 'memory'; memory: RoomMemoryEntry[]; memorySummary: string; diff?: RoomMemoryDiff } - | { roomId: string; type: 'final'; text: string } - | { roomId: string; type: 'done' } - | { roomId: string; type: 'error'; message: string; fatal?: boolean } -) & { orchestratorHostId?: string | null } - // ---- Automations (model-pinned, scheduled headless runs) ---- export type AutomationSchedule = 'interval' | 'daily' | 'manual' // 'chat'/'agent' run a model; 'digest' composes a deterministic daily briefing from recent diff --git a/app/electron/main/host/local-delete-archive.test.ts b/app/electron/main/host/local-delete-archive.test.ts index 8b722c8b494..28163851077 100644 --- a/app/electron/main/host/local-delete-archive.test.ts +++ b/app/electron/main/host/local-delete-archive.test.ts @@ -108,9 +108,14 @@ assert.match(ticketWorker, /ticket\.archivedAt/, 'ticket worker rejects archived assert.ok(workerStart.lastIndexOf('inspectGitRepository') < workerStart.indexOf('ticket.status ='), 'all Git inspection awaits finish before ticket running state is committed') assert.ok(workerStart.indexOf('runLease.addWorkspaceKeys') < workerStart.indexOf('store.threads.unshift'), 'final-key lease conflicts fail before a new thread is persisted') -const roomStart = workspace.slice(workspace.indexOf('async function startRoomRun'), workspace.indexOf("handle('room:cancel'")) +const roomRuntime = source('./room-run-runtime.ts') +const roomStartAt = roomRuntime.indexOf('async function startRoomRun') +assert.ok(roomStartAt >= 0, 'the production Room startup remains discoverable') +const roomStart = roomRuntime.slice(roomStartAt) assert.match(roomStart, /Local room execution does not support SSH workspaces/, 'local room startup fails closed before SSH paths reach local Git') -assert.ok(roomStart.indexOf('reserveStart') < roomStart.indexOf('ensureRoomWorktree'), 'room startup reserves its workspace before asynchronous worktree setup') +const reservationAt = roomStart.indexOf('reserveRoomStartup(') +const worktreeAt = roomStart.indexOf('ensureRoomWorktree(') +assert.ok(reservationAt >= 0 && worktreeAt > reservationAt, 'room startup reserves its workspace before asynchronous worktree setup') assert.match(roomStart, /if \(!startupComplete\)[\s\S]*runLease\.release/, 'room prelaunch failures release the startup reservation') const instructionWriter = workspace.slice(workspace.indexOf('async function withProjectInstructionLease'), workspace.indexOf("handle('projects:get'")) diff --git a/app/electron/main/host/room-agent-effort-policy.test.ts b/app/electron/main/host/room-agent-effort-policy.test.ts new file mode 100644 index 00000000000..30b5689521f --- /dev/null +++ b/app/electron/main/host/room-agent-effort-policy.test.ts @@ -0,0 +1,16 @@ +import assert from 'node:assert/strict' +import { pickRoomConfigPatch } from './room-ticket-patch-policy' + +const seat = { id: 'reviewer', name: 'Reviewer', role: 'Review supplied input', providerId: 'fixture', model: 'fixture' } +for (const effort of ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultrathink', 'ultracode', 'dynamic', '512']) { + const seats = [{ ...seat, reasoningEffort: effort }] + const patch = pickRoomConfigPatch({ seats }) + assert.deepEqual(patch.seats, seats, 'a valid per-agent effort must survive the real room patch boundary') + assert.deepEqual(Object.keys(patch), ['seats']) + assert.equal(Object.getPrototypeOf(patch), null, 'the existing patch isolation boundary remains intact') +} +assert.deepEqual(pickRoomConfigPatch({ seats: [seat] }).seats, [seat], 'legacy agents keep their inherited app setting') +for (const effort of [null, '', ' ', 'HIGH', 'ultrathinks', 4, true]) { + assert.throws(() => pickRoomConfigPatch({ seats: [{ ...seat, reasoningEffort: effort }] }), /reasoningEffort/) +} +console.log('Room agent effort policy checks passed: supported saved values, legacy absence and rejected malformed values.') diff --git a/app/electron/main/host/room-child-effort.test.ts b/app/electron/main/host/room-child-effort.test.ts new file mode 100644 index 00000000000..3be5f908738 --- /dev/null +++ b/app/electron/main/host/room-child-effort.test.ts @@ -0,0 +1,67 @@ +import assert from 'node:assert/strict' +import { promises as fs } from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { createServer } from 'node:http' +import { randomUUID } from 'node:crypto' + +const home = await fs.mkdtemp(path.join(os.tmpdir(), 'tensorfold-room-child-effort-')) +const previousHome = process.env.VONTRA_HOME +process.env.VONTRA_HOME = home +const { store } = await import('../state') +const storage = await import('../../store') +const { createToolContextRuntime } = await import('./tool-context-runtime') +const { createThreadRuntime } = await import('./thread-runtime') +const { createSubAgentFromLaunch, parentForRoomSeat } = await import('../../agent/subagents') +const previousStore = { ...store } +const requests: any[] = [] +const server = createServer((request, response) => { + if (request.method === 'GET') { response.end(JSON.stringify({ data: [{ id: 'fixture' }] })); return } + let raw = '' + request.on('data', chunk => { raw += chunk }) + request.on('end', () => { + requests.push(JSON.parse(raw)) + response.writeHead(200, { 'Content-Type': 'text/event-stream' }) + response.end(`data: ${JSON.stringify({ choices: [{ delta: { content: 'Synthetic child complete.' }, finish_reason: 'stop' }] })}\n\ndata: [DONE]\n\n`) + }) +}) +await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)) +const provider: any = { id: 'fixture', name: 'Synthetic API', kind: 'local', transport: 'chat-completions', + baseUrl: `http://127.0.0.1:${(server.address() as { port: number }).port}/v1`, apiKey: '', models: ['fixture'] } +const fold = createThreadRuntime({} as any).applyEventToThread +const runtime = createToolContextRuntime({ + sshManager: { backendForWorkspace: () => ({ kind: 'ssh' }) }, persistSubAgents() {}, persistThreads() {}, + applyEventToThread: fold, emitToRenderer() {}, emitPluginEvent() {}, renderProjectMemoryBucket: () => '', + recordEmailDraft() {}, recordEmailEvent() {}, recordCalendarEvent() {}, recordMessageEvent() {}, + runBrowserAutomation() {}, mcpToolContext: () => ({}), cancelThreadRun() {}, +} as any) +try { + store.settings = { ...storage.defaultSettings(), providers: [provider], activeProviderId: provider.id, activeModel: 'fixture' } + store.threads = []; store.projects = []; store.subAgents = [] + const cases = [['high', 'low'], ['low', 'high'], ['high', undefined]] as const + for (const [global, configured] of cases) { + store.settings.reasoningEffort = global + const seat = { id: 'builder', name: 'Builder', role: 'Inspect input', providerId: provider.id, model: 'fixture' } + const room: any = { id: 'room', projectId: 'project', name: 'Synthetic room', seats: [seat] } + const created = createSubAgentFromLaunch(store.subAgents, { source: 'room_delegate', parent: parentForRoomSeat(room, seat), + task: 'Inspect synthetic input.', providerId: provider.id, model: 'fixture', runId: randomUUID(), cwd: home }) + store.subAgents = created.agents + const input = { task: 'Inspect synthetic input.', parentLabel: 'Synthetic room agent', cwd: home, + signal: AbortSignal.timeout(5_000), reasoningEffort: configured } + const result = await runtime.runReadOnlySubAgent(created.agent, provider, 'fixture', input) + assert.equal(result.agent.status, 'succeeded', result.output) + } + assert.equal(requests.length, 3, 'every real child run reaches the HTTP provider once') + assert.deepEqual(requests.map(request => request.reasoning_effort), ['low', 'high', 'high'], + 'the actual child runtime forwards its explicit Room effort and preserves the inherited fallback') + console.log('Real Room child HTTP checks passed: independent Low/High requests and legacy app inheritance.') +} finally { + server.closeAllConnections() + await new Promise(resolve => server.close(() => resolve())) + while (storage.writeChains.size) await Promise.allSettled([...storage.writeChains.values()]) + Object.assign(store, previousStore) + storage.closeSessionSearchIndexes() + await fs.rm(home, { recursive: true, force: true, maxRetries: 10, retryDelay: 20 }) + if (previousHome === undefined) delete process.env.VONTRA_HOME + else process.env.VONTRA_HOME = previousHome +} diff --git a/app/electron/main/host/room-run-runtime.ts b/app/electron/main/host/room-run-runtime.ts new file mode 100644 index 00000000000..d37de52bc15 --- /dev/null +++ b/app/electron/main/host/room-run-runtime.ts @@ -0,0 +1,429 @@ + +import type { RoomSupervisorMetadataPatch } from '../../agent/jobs' + +import { buildUserContent, contentText } from '../../agent/content' +import { normalizeAttachments } from '../../agent/attachment-policy' +import type { Attachment, Job, Provider, Room, RoomStreamEvent, Seat, Ticket } from '../../agent/types' + +import { canonicalLocalWorkspaceKey, lexicalLocalWorkspaceKey } from './workspace-mutation-guard' + +import type { WorkspaceRuntimeIpcDeps } from './workspace-runtime-ipc' +import { reserveRoomStartup } from './workspace-startup-policy' +import { createRoomTools, type RoomToolScope } from './room-tools-runtime' +import { captureAgentReasoningEffort } from '../../../shared/reasoning-effort' + +export function createRoomRunRuntime(ctx: WorkspaceRuntimeIpcDeps) { + const { + path, + store, + workspaceMutationGuard, + requireSecurityRole, + persistRooms, + roomAborters, + ensureRoomWorktree, + emitRoom, + patchRoomSupervisorJob, + finishRoomSupervisorMission, + finishJob, + ensureRoomSupervisorMission, + roomWorkerBudget, + claimJob, + patchJob, + buildRoomSupervisorJobMetadata, + ticketsForRoom, + runtimeProvider, + inferSeatLane, + appendRoomSupervisorEvent, + ticketNeedsReviewAfterBuilder, + roomTicketConflictBlockers, + parkRoomIfWorkRemains, + modelRouter, + modelRouteAutoFailoverEnabled, + effectiveContextLimit, + roomContextLimit, + auditScopedModelRoute, + runtimeProviderWithFreshModels, + assertProviderEndpoint, + modelRouteFailoverText, + roomRouteHandoff, + modelRouteResetPolicy, + roomFinalGateBlockers, + runRoom, + } = ctx +async function startRoomRun(roomId: string, problem: string, attachments?: Attachment[]): Promise<{ ok: boolean; room?: Room }> { + requireSecurityRole('operator', 'start rooms') + const room = store.rooms.find((r) => r.id === roomId) + if (!room) throw new Error('Room not found') + if (room.archivedAt) throw new Error('Restore this archived room before starting it.') + // Don't start a second run for a room that's already running — it would overwrite the live + // aborter, making both the first run uncancellable and the second un-stoppable. + if (roomAborters.has(roomId)) return { ok: false, room } + const project = store.projects.find((p) => p.id === room.projectId) + if (!project) throw new Error('Project not found') + if (project.archivedAt) throw new Error('Restore the archived project before starting this room.') + // Rooms broadcast a single text problem to every seat (many are CLI/text-only), so fold + // attachments into text: documents become labelled blocks; images are noted (vision-capable + // seats can't receive pixels through the room channel). + const safeAttachments = normalizeAttachments(attachments) + const cleanProblem = contentText(buildUserContent(String(problem || '').trim(), safeAttachments)).trim() + if (!cleanProblem) throw new Error('Add a room objective before starting.') + if (room.seats.length < 1) throw new Error('Add at least one agent to the room first.') + const reasoningEffort = store.settings.reasoningEffort + const seatEfforts = new Map(room.seats.map((seat) => [seat.id, captureAgentReasoningEffort(seat, reasoningEffort)])) + const configuredWorkspace = room.workspace ?? project.workspace ?? null + if (configuredWorkspace?.kind === 'ssh') { + throw new Error('Local room execution does not support SSH workspaces; run this room on its remote Orchestrator.') + } + const initialPaths = [configuredWorkspace?.path, room.workspaceCwd, room.rootCwd, room.scratchpadCwd, project.cwd] + .filter((value): value is string => typeof value === 'string' && value.trim().length > 0) + const initialWorkspaceKeys = initialPaths.map((value: string) => lexicalLocalWorkspaceKey(value)) + const reservation = reserveRoomStartup(roomId, roomAborters, workspaceMutationGuard, initialWorkspaceKeys) + if (!reservation) return { ok: false, room } + const { controller, runLease } = reservation + const timeout = setTimeout(() => controller.abort(), 30 * 60_000) + roomAborters.set(roomId, controller) + let startupComplete = false + try { + const roomWorkspace = await ensureRoomWorktree(project, room) + const finalWorkspaceKey = await canonicalLocalWorkspaceKey(roomWorkspace) + runLease.addWorkspaceKeys?.([finalWorkspaceKey]) + if (room.archivedAt || project.archivedAt) throw new Error('Room or project was archived while the room was starting.') + if (room.workspaceCwd !== roomWorkspace) { + room.workspaceCwd = roomWorkspace + persistRooms() + } + const roomProject = { ...project, cwd: roomWorkspace } + + room.problem = cleanProblem + room.events = [] + room.finalText = '' + room.state = 'queued' + room.updatedAt = Date.now() + persistRooms() + emitRoom({ roomId, type: 'status', state: 'queued' }) + const supervisorMission = ensureRoomSupervisorMission(room, project, roomWorkspace, cleanProblem) + const supervisorRunId = `room:${room.id}:${Date.now()}` + const configuredWorkerBudget = roomWorkerBudget(room) + let job: Job | null = claimJob({ + kind: 'room', + owner: room.id, + projectId: room.projectId, + missionId: supervisorMission.id, + roomId: room.id, + currentThreadId: null, + metadata: buildRoomSupervisorJobMetadata({ + room, + project, + tickets: ticketsForRoom(room), + patch: { missionId: supervisorMission.id, workerBudget: configuredWorkerBudget, workerStarts: 0 }, + }), + }) + job = patchJob(job, { currentRunId: supervisorRunId }) + + let lastCodeChangeAt = 0 + let greenEvidenceAt = 0 + const providerForSeat = (seat: Seat): Provider | undefined => { + const provider = store.settings.providers.find((p) => p.id === seat.providerId) + return provider ? runtimeProvider(provider, seat.providerAccountId) : undefined + } + if (roomProject.localOnly) { + const cloudSeat = room.seats.find((seat) => providerForSeat(seat)?.kind !== 'local') + if (cloudSeat) { + room.state = 'failed' + persistRooms() + emitRoom({ roomId: room.id, type: 'error', message: `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`, fatal: true }) + emitRoom({ roomId: room.id, type: 'status', state: 'failed' }) + emitRoom({ roomId: room.id, type: 'done' }) + clearTimeout(timeout) + roomAborters.delete(room.id) + job = patchRoomSupervisorJob(job, room, project) + finishRoomSupervisorMission(job, 'failed', `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`) + finishJob(job, 'failed', `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`) + return { ok: false } + } + } + const roomTickets = (): Ticket[] => ticketsForRoom(room) + // Resolve a ticket from free-form LLM tool input. Precedence: exact id, then exact (trimmed, + // case-insensitive) title equality, then a UNIQUE case-insensitive substring. A substring that + // matches multiple tickets is AMBIGUOUS — never silently pick the first (store-insertion-order) + // match, or claim/complete/start could act on the wrong ticket (e.g. "auth" hitting both + // "Add auth" and "Add auth tests"). On ambiguity, `error` is set and `ticket` is undefined. + const resolveTicket = (args: any): { ticket?: Ticket; error?: string } => { + const board = roomTickets() + const id = typeof args?.id === 'string' ? args.id : '' + if (id) { + const byId = board.find((t) => t.id === id) + if (byId) return { ticket: byId } + } + const rawTitle = typeof args?.title === 'string' ? args.title.trim() : '' + if (!rawTitle) return { ticket: undefined } + const wanted = rawTitle.toLowerCase() + const exact = board.filter((t) => t.title.trim().toLowerCase() === wanted) + if (exact.length === 1) return { ticket: exact[0] } + if (exact.length > 1) { + return { error: `"${rawTitle}" matches ${exact.length} tickets with that exact title; reference the ticket by id instead.` } + } + const substr = board.filter((t) => t.title.toLowerCase().includes(wanted)) + if (substr.length === 1) return { ticket: substr[0] } + if (substr.length > 1) { + return { error: `"${rawTitle}" is ambiguous — it matches ${substr.length} tickets (${substr.map((t) => `"${t.title}"`).join(', ')}); use a more specific title or the ticket id.` } + } + return { ticket: undefined } + } + const findTicket = (args: any): Ticket | undefined => resolveTicket(args).ticket + // Mirrors tickets.ts isReservationEvidence / meaningfulTicketEvidence (which are module-private + // there): a "Reserved for build/review worker." note placed by start_ticket_work is a placeholder, + // not real evidence, so it must not satisfy a ticket's required-evidence gate. + const isReservationEvidenceLocal = (item: { kind?: string; summary?: string; ref?: string | null }): boolean => + /\breserved for (?:build|review) worker\b/i.test(`${item.kind ?? ''} ${item.summary ?? ''} ${item.ref ?? ''}`) + const hasMeaningfulEvidence = (tk: Ticket): boolean => + (tk.evidence ?? []).some((item) => !isReservationEvidenceLocal(item)) + const workerBudget = configuredWorkerBudget + let workerStarts = 0 + const activeTicketWorkerCount = () => roomTickets().filter((ticket) => ticket.runState === 'queued' || ticket.runState === 'running').length + const touchSupervisor = (patch: RoomSupervisorMetadataPatch = {}) => { + job = patchRoomSupervisorJob(job, room, project, { workerBudget, workerStarts, ...patch }) + } + const selectAutomaticReviewSeat = (builderSeat: string): Seat | null => { + const candidates = room.seats + .map((seat, index) => { + if (seat.name === builderSeat) return null + if (!providerForSeat(seat)) return null + const reviewRank = inferSeatLane(seat) === 'review' || seat.roleProfileId === 'reviewer' ? 0 : 1 + return { seat, index, reviewRank } + }) + .filter((item): item is { seat: Seat; index: number; reviewRank: number } => !!item) + .sort((a, b) => a.reviewRank - b.reviewRank || a.index - b.index) + return candidates[0]?.seat ?? null + } + const blockAutomaticReview = (tk: Ticket, builderSeat: string, paths: string[], summary: string) => { + touchSupervisor({ phase: { phase: 'review', status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat: builderSeat, paths, summary } }) + appendRoomSupervisorEvent(room, `Automatic review not started for "${tk.title}": ${summary}`, { + tool: 'auto_review_scheduler', + args: { ticketId: tk.id, phase: 'review', builderSeat, paths }, + }) + } + const scheduleAutomaticReviewAfterBuild = async (tk: Ticket, builderSeat: string, paths: string[]) => { + if (!ticketNeedsReviewAfterBuilder(tk)) return + const reviewSeat = selectAutomaticReviewSeat(builderSeat) + if (!reviewSeat) { + blockAutomaticReview(tk, builderSeat, paths, 'No suitable different room seat is available for review.') + return + } + const blockers: string[] = roomTicketConflictBlockers({ ticket: tk, tickets: roomTickets(), phase: 'review', seat: reviewSeat.name, paths }) + if (blockers.length) { + blockAutomaticReview(tk, reviewSeat.name, paths, blockers.join(' ')) + return + } + const activeWorkers = activeTicketWorkerCount() + if (activeWorkers >= workerBudget.maxActive) { + blockAutomaticReview(tk, reviewSeat.name, paths, `Worker budget busy: ${activeWorkers}/${workerBudget.maxActive} active.`) + return + } + if (workerStarts >= workerBudget.maxStarts) { + blockAutomaticReview(tk, reviewSeat.name, paths, `Worker budget exhausted: ${workerStarts}/${workerBudget.maxStarts} started.`) + return + } + appendRoomSupervisorEvent(room, `Automatic review queued for "${tk.title}" with ${reviewSeat.name}.`, { + tool: 'auto_review_scheduler', + args: { ticketId: tk.id, phase: 'review', builderSeat, reviewSeat: reviewSeat.name, paths }, + }) + try { + await roomTools.start_ticket_work({ id: tk.id, phase: 'review', paths }, reviewSeat.name) + } catch (err: any) { + blockAutomaticReview(tk, reviewSeat.name, paths, String(err?.message ?? err)) + } + } + const emitRoomProgress = (ev: RoomStreamEvent) => { + if (ev.type === 'status') { + room.state = ev.state + room.updatedAt = Date.now() + persistRooms() + touchSupervisor() + } else if (ev.type === 'turn') { + touchSupervisor({ currentTurnSeat: ev.seat }) + } else if (ev.type === 'event') { + room.updatedAt = Date.now() + persistRooms() + touchSupervisor({ lastEventKind: ev.item.kind, lastEventSeat: ev.item.seat, lastEventAt: ev.item.createdAt }) + } else if (ev.type === 'memory') { + room.updatedAt = Date.now() + persistRooms() + touchSupervisor() + } else if (ev.type === 'final' || ev.type === 'done' || ev.type === 'error') { + touchSupervisor() + } + emitRoom(ev) + } + touchSupervisor() + const roomTools: Record Promise> = createRoomTools(ctx, { + reasoningEffort, + seatEfforts, + roomTickets, + room, + resolveTicket, + findTicket, + hasMeaningfulEvidence, + touchSupervisor, + activeTicketWorkerCount, + workerBudget, + get workerStarts() { return workerStarts }, + set workerStarts(value: RoomToolScope['workerStarts']) { workerStarts = value }, + get lastCodeChangeAt() { return lastCodeChangeAt }, + set lastCodeChangeAt(value: RoomToolScope['lastCodeChangeAt']) { lastCodeChangeAt = value }, + get greenEvidenceAt() { return greenEvidenceAt }, + set greenEvidenceAt(value: RoomToolScope['greenEvidenceAt']) { greenEvidenceAt = value }, + scheduleAutomaticReviewAfterBuild, + roomProject, + roomWorkspace, + controller, + }) + + // Supervisor mode: an ASSIGN auto-starts the addressed seat's ticket worker. + // The ticket is resolved from the ASSIGN text (a verbatim ticket title inside the + // text wins; otherwise the text minus the seat name is used as a title query), then + // routed through the standard start_ticket_work path so budget/conflict gates apply. + const autoStartAssignedTicket = async ({ target, text }: { seat: string; target: string; text: string }): Promise => { + const board = roomTickets().filter((t) => t.status !== 'completed') + const hay = text.toLowerCase() + const inText = board.filter((t) => t.title.trim() && hay.includes(t.title.trim().toLowerCase())) + let tk = inText.length === 1 ? inText[0] : undefined + if (!tk && inText.length > 1) { + const matches = inText.slice(0, 4).map((t) => `"${t.title}"`).join(', ') + return `ASSIGN auto-start skipped: the text matches ${inText.length} open tickets (${matches}). Name one verbatim to start it.` + } + if (!tk && inText.length === 0) { + const remainder = text.replace(new RegExp(`\\b${target.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\b`, 'ig'), '').trim() + const resolved = resolveTicket({ title: remainder }) + if (resolved.error) return `ASSIGN auto-start skipped: ${resolved.error}` + tk = resolved.ticket + } + if (!tk) return `ASSIGN to ${target} noted, but no open ticket title matched. Create the ticket with create_ticket first, then assign it.` + if (tk.assignee && tk.assignee !== target) return `ASSIGN auto-start skipped: "${tk.title}" is already claimed by ${tk.assignee}.` + return roomTools.start_ticket_work({ id: tk.id, phase: 'build' }, target) + } + + runRoom({ + room, project: roomProject, providers: store.settings.providers, problem: cleanProblem, + temperature: store.settings.temperature, reasoningEffort, + reasoningEffortForSeat: (seat) => seatEfforts.get(seat.id) ?? captureAgentReasoningEffort(seat, reasoningEffort), + emit: emitRoomProgress, signal: controller.signal, tools: roomTools, + onAssign: autoStartAssignedTicket, + providerForSeat, + recoverSeatModel: async (seat, error) => { + const latestBaseProvider = store.settings.providers.find((p) => p.id === seat.providerId) + if (!latestBaseProvider) return null + const currentAccountId = seat.providerAccountId ?? null + const routed = modelRouter.routeAfterError({ + role: 'room_seat', + provider: latestBaseProvider, + accountId: currentAccountId, + model: seat.model, + error, + allowFailover: modelRouteAutoFailoverEnabled(latestBaseProvider, currentAccountId), + localOnly: roomProject.localOnly === true, + contextLimit: effectiveContextLimit(latestBaseProvider, seat.model, currentAccountId), + reasoningEffort: seatEfforts.get(seat.id) ?? captureAgentReasoningEffort(seat, reasoningEffort), + budget: room.workerBudget?.maxActive ?? null, + source: 'room_seat_recovery', + }) + if (routed.signal) { + for (const audit of routed.audit) { + await auditScopedModelRoute('room', audit, routed.signal, { + roomId: room.id, + seatId: seat.id, + seatName: seat.name, + jobId: job?.id ?? null, + missionId: supervisorMission.id, + }) + } + } + if (!routed.signal || !routed.route.selected || routed.route.selectedAccountId === currentAccountId) return null + const providerAccountId = routed.route.selectedAccountId + const provider = await runtimeProviderWithFreshModels(latestBaseProvider, providerAccountId) + assertProviderEndpoint(provider) + const liveSeat = room.seats.find((candidate) => candidate.id === seat.id) + if (liveSeat) { + liveSeat.providerId = latestBaseProvider.id + liveSeat.providerAccountId = providerAccountId + liveSeat.model = seat.model + } + room.updatedAt = Date.now() + persistRooms() + const failoverText = modelRouteFailoverText(latestBaseProvider, routed.route.audit, routed.signal) + const notice = `${failoverText}\n${roomRouteHandoff(room, seat, failoverText)}` + job = patchJob(job, { + metadata: { + modelRoute: { + action: 'room_failover', + seatId: seat.id, + seatName: seat.name, + providerId: latestBaseProvider.id, + model: seat.model, + preferredProviderAccountId: currentAccountId, + failoverProviderAccountId: providerAccountId, + resetPolicy: modelRouteResetPolicy(latestBaseProvider, currentAccountId), + resetAt: routed.signal.resetAt, + reason: routed.route.audit.reason, + }, + }, + }) + touchSupervisor() + return { provider, providerAccountId, model: seat.model, notice } + }, + contextLimitForSeat: (seat) => { + if (!store.settings.autoCompact) return 0 + const provider = providerForSeat(seat) + if (!provider) return 0 + // Task #41: in a mixed-model room every seat compacts to the lowest seat's + // limit so no model silently overflows. Fall back to this seat's own limit + // if the floor can't be computed (e.g. another seat is misconfigured). + const floor = roomContextLimit( + room.seats + .map((s) => ({ provider: providerForSeat(s), model: s.model })) + .filter((entry): entry is { provider: Provider; model: string } => !!entry.provider), + { + cloudLimit: store.settings.contextLimit, + localLimit: store.settings.localContextLimit, + contextLimitExplicit: store.settings.contextLimitExplicit, + localContextLimitExplicit: store.settings.localContextLimitExplicit, + override: store.settings.contextLimitOverride, + engineModelProfiles: store.settings.engineModelProfiles, + }, + ) + return floor > 0 ? floor : effectiveContextLimit(provider, seat.model) + }, + finalGate: () => { + return roomFinalGateBlockers({ tickets: roomTickets(), lastCodeChangeAt, greenEvidenceAt }) + }, + }) + .catch((err) => emitRoomProgress({ roomId, type: 'error', message: String(err?.message ?? err), fatal: true })) + .finally(() => { + clearTimeout(timeout) + roomAborters.delete(roomId) + runLease.release() + const failed = room.state === 'failed' || room.state === 'error' + const parked = !controller.signal.aborted && !failed && parkRoomIfWorkRemains(job, room, project) + if (!parked) { + touchSupervisor({ currentTurnSeat: null }) + const outcome = controller.signal.aborted ? 'paused' : failed ? 'failed' : 'completed' + const reason = failed ? 'Room ended with an error.' : controller.signal.aborted ? 'Room paused after the active run stopped.' : undefined + finishRoomSupervisorMission(job, outcome, reason) + finishJob(job, outcome, reason) + } + room.updatedAt = Date.now() + persistRooms() + }) + + startupComplete = true + return { ok: true, room } + } finally { + if (!startupComplete) { + clearTimeout(timeout) + if (roomAborters.get(roomId) === controller) roomAborters.delete(roomId) + runLease.release() + } + } +} + return { startRoomRun } +} diff --git a/app/electron/main/host/room-ticket-patch-policy.ts b/app/electron/main/host/room-ticket-patch-policy.ts index acf7b28864a..0fff1aa3614 100644 --- a/app/electron/main/host/room-ticket-patch-policy.ts +++ b/app/electron/main/host/room-ticket-patch-policy.ts @@ -1,4 +1,5 @@ import type { Project, Provider, Room, RoomEventItem, RoomManualMemoryCommand, RoomMemoryEntry, Seat, Ticket, TicketExecutionRecord, TicketRemoteLifecycleCommand, TimelineItem } from '../../agent/types' +import { isReasoningEffortSetting } from '../../../shared/reasoning-effort' const ROOM_CONFIG_KEYS = new Set([ 'seats', @@ -106,7 +107,7 @@ function assertStringList(value: unknown, field: string, maxItems = 64, maxLengt function validateSeats(value: unknown): void { if (!Array.isArray(value) || value.length > 16) throw new Error('seats must be an array with at most 16 entries.') const ids = new Set() - const allowed = new Set(['id', 'name', 'role', 'providerId', 'providerAccountId', 'model', 'lane', 'roleProfileId', 'fanOutBudget']) + const allowed = new Set(['id', 'name', 'role', 'providerId', 'providerAccountId', 'model', 'reasoningEffort', 'lane', 'roleProfileId', 'fanOutBudget']) for (const [index, candidate] of value.entries()) { const field = `seats[${index}]` assertPlainRecord(candidate, field) @@ -116,6 +117,9 @@ function validateSeats(value: unknown): void { assertBoundedString(candidate.role, `${field}.role`, 2_000) assertBoundedString(candidate.providerId, `${field}.providerId`, 256) assertBoundedString(candidate.model, `${field}.model`, 512) + if (candidate.reasoningEffort !== undefined && !isReasoningEffortSetting(candidate.reasoningEffort)) { + throw new Error(`${field}.reasoningEffort has an invalid value.`) + } if (candidate.providerAccountId !== undefined && candidate.providerAccountId !== null) assertBoundedString(candidate.providerAccountId, `${field}.providerAccountId`, 256) if (candidate.lane !== undefined) assertEnum(candidate.lane, SEAT_LANES, `${field}.lane`) if (candidate.roleProfileId !== undefined) assertEnum(candidate.roleProfileId, ROLE_PROFILES, `${field}.roleProfileId`) diff --git a/app/electron/main/host/room-ticket-work-launch.test.ts b/app/electron/main/host/room-ticket-work-launch.test.ts index d7c6cf597de..16c7ef4e501 100644 --- a/app/electron/main/host/room-ticket-work-launch.test.ts +++ b/app/electron/main/host/room-ticket-work-launch.test.ts @@ -5,15 +5,19 @@ // localOnly guard and the memory_write renderer notification. import assert from 'node:assert/strict' import os from 'node:os' +import { randomUUID } from 'node:crypto' +import { createSubAgentFromLaunch, parentForRoomSeat, startSubAgent } from '../../agent/subagents' import { createWorkspaceRuntimeIpc } from './workspace-runtime-ipc' interface HarnessOpts { startTicketWork: (input: any) => Promise localOnly?: boolean + beforeWorkspace?: () => void } function buildHarness(opts: HarnessOpts) { const store: any = { + subAgents: [], projects: [{ id: 'p1', name: 'P', cwd: os.tmpdir(), workspace: null, localOnly: opts.localOnly === true, archivedAt: null }], rooms: [{ id: 'room-1', projectId: 'p1', name: 'Room', problem: '', state: 'idle', archivedAt: null, @@ -35,6 +39,7 @@ function buildHarness(opts: HarnessOpts) { } const emittedTickets: any[] = [] + const delegated: any[] = [] const remote: any[] = [] let persistTicketsCalls = 0 let runDeps: any = null @@ -48,7 +53,12 @@ function buildHarness(opts: HarnessOpts) { auditPreview: (s: string) => s, roomAborters: new Map(), workspaceMutationGuard: { reserveStart: () => ({ addWorkspaceKeys: () => {}, release: () => {} }) }, - ensureRoomWorktree: async () => os.tmpdir(), + ensureRoomWorktree: async () => { opts.beforeWorkspace?.(); return os.tmpdir() }, + randomUUID, createSubAgentFromLaunch, parentForRoomSeat, startSubAgent, + runReadOnlySubAgent: async (agent: any, provider: any, model: string, input: any) => { + delegated.push({ provider: provider.id, model, ...input }) + return { agent, output: 'Synthetic delegated result' } + }, persistRooms: () => {}, persistTickets: () => { persistTicketsCalls++ }, emitRoom: () => {}, @@ -89,7 +99,8 @@ function buildHarness(opts: HarnessOpts) { }) const api = createWorkspaceRuntimeIpc(ctx as any) return { - api, store, emittedTickets, remote, + api, store, emittedTickets, remote, delegated, + get runDeps() { return runDeps }, get persistTicketsCalls() { return persistTicketsCalls }, // Start the room (which captures the live room tools), then settle the run. run: async () => { @@ -180,6 +191,28 @@ async function main() { console.log('ok - memory_write notifies the renderer on change and rejects oversize content') } + { + const workerSources: any[] = [] + const h = buildHarness({ startTicketWork: async (input) => { workerSources.push(input.source); return { id: 'worker' } }, beforeWorkspace: () => { + h.store.settings.reasoningEffort = 'medium' + for (const seat of h.store.rooms[0].seats) seat.reasoningEffort = 'medium' + } }) + h.store.settings.reasoningEffort = 'xhigh' + h.store.rooms[0].seats[0].reasoningEffort = 'low' + h.store.rooms[0].seats.push({ id: 'reviewer', name: 'Reviewer', role: 'Review', providerId: 'p-local', model: 'm1', reasoningEffort: 'high' }, + { id: 'legacy', name: 'Legacy', role: 'Review', providerId: 'p-local', model: 'm1' }) + await h.run() + assert.deepEqual(h.store.rooms[0].seats.map((seat: any) => h.runDeps.reasoningEffortForSeat(seat)), ['low', 'high', 'xhigh'], + 'the actual host passes the same captured values into the Room turn engine') + await h.tool('delegate', { task: 'Review synthetic input' }, 'Builder') + await h.tool('delegate', { task: 'Review synthetic input', targetSeat: 'Reviewer' }, 'Builder') + await h.tool('delegate', { task: 'Review synthetic input', targetSeat: 'Legacy' }, 'Builder') + assert.deepEqual(h.delegated.map(call => call.reasoningEffort), ['low', 'high', 'xhigh'], + 'actual Room delegation captures origin, target and legacy app effort before workspace awaits') + await h.tool('start_ticket_work', { id: 't1', phase: 'build' }, 'Builder') + assert.equal(workerSources[0]?.reasoningEffort, 'low', 'ticket workers inherit the same Room run capture') + console.log('ok - actual Room delegation forwards independent captured efforts') + } console.log('room ticket work launch tests passed') } diff --git a/app/electron/main/host/room-tools-runtime.ts b/app/electron/main/host/room-tools-runtime.ts new file mode 100644 index 00000000000..6043e85e1ae --- /dev/null +++ b/app/electron/main/host/room-tools-runtime.ts @@ -0,0 +1,364 @@ + +import type { RoomSupervisorMetadataPatch } from '../../agent/jobs' + +import type { Project, ReasoningEffortSetting, Room, Ticket, Thread } from '../../agent/types' + +import { resolveDelegationRoute } from '../../agent/delegation-route' +import { createSharedMemory, MEMORY_MAX_BLOCK_CHARS, MEMORY_MAX_BLOCKS, renderSharedMemory, writeBlock } from '../../agent/shared-room-memory' + +import type { WorkspaceRuntimeIpcDeps } from './workspace-runtime-ipc' +import type { RoomWorkerBudget } from '../../agent/types' + +export interface RoomToolScope { + reasoningEffort: ReasoningEffortSetting + seatEfforts: ReadonlyMap + roomTickets: () => Ticket[] + room: Room + resolveTicket: (args: any) => { ticket?: Ticket; error?: string; } + findTicket: (args: any) => Ticket | undefined + hasMeaningfulEvidence: (tk: Ticket) => boolean + touchSupervisor: (patch?: RoomSupervisorMetadataPatch) => void + activeTicketWorkerCount: () => number + workerBudget: RoomWorkerBudget + workerStarts: number + lastCodeChangeAt: number + greenEvidenceAt: number + scheduleAutomaticReviewAfterBuild: (tk: Ticket, builderSeat: string, paths: string[]) => Promise + roomProject: Project + roomWorkspace: string + controller: AbortController +} + +export function createRoomTools(ctx: WorkspaceRuntimeIpcDeps, runtimeScope: RoomToolScope): Record Promise> { + const { + path, + randomUUID, + store, + auditEvent, + auditPreview, + persistRooms, + persistTickets, + persistSubAgents, + emitTicket, + publishRemote, + activeJob, + runtimeProvider, + appendRoomSupervisorEvent, + roomTicketConflictBlockers, + summarizeRoomLeftToWork, + describeTicketForRoom, + mkTicket, + normalizeTicketCapabilities, + normalizeStringList, + ticketEvidenceFromArgs, + ticketFileRefs, + startTicketWork, + createSubAgentFromLaunch, + parentForRoomSeat, + persistSubAgents: persistSubAgentsFromCtx, + startSubAgent, + runReadOnlySubAgent, + executeTool, + } = ctx + const persistSubAgentsSafe = persistSubAgentsFromCtx ?? persistSubAgents + return { + list_tickets: async () => { + const board = runtimeScope.roomTickets() + return board.length ? board.map(describeTicketForRoom).join('\n') : 'The board is empty.' + }, + left_to_work: async () => summarizeRoomLeftToWork(runtimeScope.roomTickets()), + create_ticket: async (args) => { + const tk = mkTicket(runtimeScope.room.projectId, { + roomId: runtimeScope.room.id, + title: args?.title || 'Untitled', + body: args?.body || '', + priority: args?.priority, + effort: args?.effort, + type: args?.type || 'task', + status: 'ready', + tags: args?.tags, + risk: args?.risk, + allowedCapabilities: args?.allowedCapabilities, + requiredEvidence: args?.requiredEvidence, + acceptanceCriteria: args?.acceptanceCriteria, + evidence: args?.evidence, + }) + store.tickets.unshift(tk); persistTickets(); emitTicket(tk) + return `Created ticket "${tk.title}" with ${tk.risk ?? 'low'} risk, allowed capabilities ${normalizeTicketCapabilities(tk.allowedCapabilities, ['read']).join(', ')}, and ${tk.requiredEvidence?.length ?? 0} required evidence item(s).` + }, + claim_ticket: async (args, seat) => { + const resolved = runtimeScope.resolveTicket(args) + if (resolved.error) return resolved.error + const tk = resolved.ticket + if (!tk) return `No ticket matches "${args?.title ?? args?.id ?? ''}".` + if (tk.assignee && tk.assignee !== seat) return `Already claimed by ${tk.assignee}. Pick another ticket.` + tk.assignee = seat; tk.status = 'in_progress'; tk.updatedAt = Date.now(); persistTickets(); emitTicket(tk) + const required = normalizeStringList(tk.requiredEvidence, []) + const caps = normalizeTicketCapabilities(tk.allowedCapabilities, ['read']).join(', ') + return `You claimed "${tk.title}". Allowed capabilities: ${caps}. Required evidence: ${required.length ? required.join('; ') : 'none'}.` + }, + add_ticket_evidence: async (args, seat) => { + const tk = runtimeScope.findTicket(args) + if (!tk) return 'No matching ticket.' + if (tk.assignee && tk.assignee !== seat) return `Only ${tk.assignee} can add evidence to "${tk.title}".` + const evidence = ticketEvidenceFromArgs(args, seat) + if (!evidence.length) return 'No evidence summary was provided.' + tk.assignee = tk.assignee ?? seat + tk.evidence = [...(tk.evidence ?? []), ...evidence] + tk.updatedAt = Date.now() + persistTickets(); emitTicket(tk) + return `Added ${evidence.length} evidence item(s) to "${tk.title}".` + }, + complete_ticket: async (args, seat) => { + const resolved = runtimeScope.resolveTicket(args) + if (resolved.error) return resolved.error + const tk = resolved.ticket + if (!tk) return 'No matching ticket.' + if (tk.assignee && tk.assignee !== seat) return `Only ${tk.assignee} can complete "${tk.title}".` + const evidence = ticketEvidenceFromArgs(args, seat) + if (evidence.length) tk.evidence = [...(tk.evidence ?? []), ...evidence] + const required = normalizeStringList(tk.requiredEvidence, []) + // Only MEANINGFUL evidence satisfies the required-evidence gate — reservation/placeholder notes + // appended by start_ticket_work ("Reserved for build/review worker.") must not count, or a + // ticket can be flipped to 'completed' with zero real evidence (the room final gate uses the + // same meaningful filter, so this keeps the per-ticket gate consistent with it). + if (required.length && !runtimeScope.hasMeaningfulEvidence(tk)) return `Cannot complete "${tk.title}" until evidence is attached: ${required.join('; ')}.` + tk.assignee = seat; tk.status = 'completed'; tk.updatedAt = Date.now(); persistTickets(); emitTicket(tk) + return `Completed "${tk.title}" with ${tk.evidence?.length ?? 0} evidence item(s).` + }, + start_ticket_work: async (args, seat) => { + const resolved = runtimeScope.resolveTicket(args) + if (resolved.error) return resolved.error + const tk = resolved.ticket + if (!tk) return `No ticket matches "${args?.title ?? args?.id ?? ''}".` + const phase = args?.phase === 'review' ? 'review' : 'build' + const declaredPaths: string[] = normalizeStringList(args?.paths, []) + const mergeDecision = typeof args?.mergeDecision === 'string' ? args.mergeDecision.trim() : '' + const blockers: string[] = roomTicketConflictBlockers({ ticket: tk, tickets: runtimeScope.roomTickets(), phase, seat, paths: declaredPaths }) + const overlapBlockers = blockers.filter((blocker) => /\boverlaps with\b/i.test(blocker)) + const hardBlockers = blockers.filter((blocker) => !overlapBlockers.includes(blocker)) + const effectiveBlockers = mergeDecision && overlapBlockers.length ? hardBlockers : blockers + if (blockers.length) { + if (effectiveBlockers.length) { + runtimeScope.touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: effectiveBlockers.join(' ') } }) + return `Blocked by room supervisor: ${effectiveBlockers.join(' ')}` + } + appendRoomSupervisorEvent(runtimeScope.room, `Merge decision accepted for "${tk.title}": ${mergeDecision}`, { + tool: 'merge_decision', + args: { ticketId: tk.id, phase, seat, paths: declaredPaths, blockers: overlapBlockers }, + }) + tk.evidence = [ + ...(tk.evidence ?? []), + { + id: randomUUID(), + kind: 'note', + summary: `Supervisor merge decision: ${mergeDecision}. Waived overlap blocker(s): ${overlapBlockers.join(' ')}`, + ref: declaredPaths[0] ?? null, + createdBy: 'room-supervisor', + createdAt: Date.now(), + }, + ] + } + const activeWorkers = runtimeScope.activeTicketWorkerCount() + if (activeWorkers >= runtimeScope.workerBudget.maxActive) { + runtimeScope.touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker budget busy: ${activeWorkers}/${runtimeScope.workerBudget.maxActive} active.` } }) + return `Room worker budget busy: ${activeWorkers}/${runtimeScope.workerBudget.maxActive} active ticket workers. Use left_to_work and wait for a worker result.` + } + if (runtimeScope.workerStarts >= runtimeScope.workerBudget.maxStarts) { + runtimeScope.touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker budget exhausted: ${runtimeScope.workerStarts}/${runtimeScope.workerBudget.maxStarts} started.` } }) + return `Room worker budget exhausted: ${runtimeScope.workerStarts}/${runtimeScope.workerBudget.maxStarts} ticket workers started in this room run.` + } + const seatConfig = runtimeScope.room.seats.find((candidate) => candidate.name === seat) + if (!seatConfig) return 'Cannot start worker: room seat is no longer configured.' + // Snapshot before the pre-launch mutation so a failed launch can restore the ticket + // instead of wedging it (runState 'queued' blocks retries via roomTicketConflictBlockers, + // counts against the worker budget, and keeps the final gate open). + const prevAssignee = tk.assignee + const prevStatus = tk.status + runtimeScope.workerStarts++ + // Only a BUILD-phase start takes ownership of the ticket. A review-phase start must NOT + // overwrite the builder's assignee with the reviewer — doing so erases the builder's claim and + // makes a later build-phase conflict check (roomTicketConflictBlockers) report the ticket as + // claimed by the reviewer, blocking the original builder from their own ticket. The reviewer's + // identity is tracked separately via the review evidence (createdBy), not tk.assignee. + if (phase === 'build') tk.assignee = seat + tk.status = 'in_progress' + tk.runState = 'queued' + if (declaredPaths.length) { + tk.evidence = [ + ...(tk.evidence ?? []), + ...declaredPaths.map((ref) => ({ id: randomUUID(), kind: 'file' as const, summary: `Reserved for ${phase} worker.`, ref, createdBy: seat, createdAt: Date.now() })), + ] + } + tk.updatedAt = Date.now() + persistTickets(); emitTicket(tk) + runtimeScope.touchSupervisor({ phase: { phase, status: 'queued', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: 'Ticket worker queued.' } }) + const knownPaths = ticketFileRefs(tk, declaredPaths) + let workerThreadId: string | null = null + let thread: Thread + try { + thread = await startTicketWork({ + ticketId: tk.id, + opts: { phase, providerId: seatConfig.providerId, providerAccountId: seatConfig.providerAccountId ?? null, model: seatConfig.model }, + source: { + roomId: runtimeScope.room.id, + seat, + reasoningEffort: runtimeScope.seatEfforts.get(seatConfig.id) ?? runtimeScope.reasoningEffort, + onSettled: ({ codeChanged, testsPassed, failed, jobId }) => { + if (codeChanged) runtimeScope.lastCodeChangeAt = Date.now() + if (testsPassed) runtimeScope.greenEvidenceAt = Date.now() + runtimeScope.touchSupervisor({ + phase: { + phase, + status: tk.status === 'needs_clarification' ? 'failed' : 'completed', + ticketId: tk.id, + ticketTitle: tk.title, + seat, + threadId: workerThreadId, + jobId: jobId ?? activeJob('ticket', tk.id)?.id ?? null, + paths: knownPaths, + summary: tk.status === 'needs_clarification' ? 'Ticket worker needs clarification.' : 'Ticket worker finished.', + }, + }) + if (phase === 'build' && !failed) void runtimeScope.scheduleAutomaticReviewAfterBuild(tk, seat, knownPaths) + }, + }, + }) + } catch (launchError: any) { + // Launch failed: unwind the pre-launch mutation so the ticket is retryable instead + // of wedged as 'queued' (which blocks retries, burns budget, and holds the gate). + runtimeScope.workerStarts-- + tk.runState = null + tk.status = prevStatus + tk.assignee = prevAssignee + tk.updatedAt = Date.now() + persistTickets(); emitTicket(tk) + runtimeScope.touchSupervisor({ phase: { phase, status: 'failed', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker launch failed: ${launchError?.message ?? launchError}` } }) + return `Cannot start worker: launch failed: ${launchError?.message ?? launchError}` + } + workerThreadId = thread.id + runtimeScope.touchSupervisor({ + phase: { + phase, + status: 'running', + ticketId: tk.id, + ticketTitle: tk.title, + seat, + threadId: thread.id, + jobId: activeJob('ticket', tk.id)?.id ?? null, + paths: knownPaths, + summary: 'Ticket worker running.', + }, + }) + return `Room Supervisor started ${phase} worker thread ${thread.id} for "${tk.title}"${knownPaths.length ? ` on ${knownPaths.slice(0, 4).join(', ')}` : ''}.` + }, + delegate: async (args, seat) => { + const s = runtimeScope.room.seats.find((x) => x.name === seat) + if (!s) return 'Cannot delegate: seat misconfigured.' + // Optional cross-model route: targetSeat adopts that seat's provider/account/model; + // explicit providerId/accountId/model override it; absent fields inherit this seat. + // A local-only project may not delegate out to a cloud provider (same guard the + // thread runtime and room seat config enforce). + const routed = resolveDelegationRoute(store.settings.providers, { + providerId: s.providerId, + providerAccountId: s.providerAccountId, + model: s.model, + reasoningEffort: runtimeScope.seatEfforts.get(s.id) ?? runtimeScope.reasoningEffort, + }, args ?? {}, runtimeScope.room.seats.map((seat) => ({ ...seat, + reasoningEffort: runtimeScope.seatEfforts.get(seat.id) ?? runtimeScope.reasoningEffort, + })), runtimeScope.roomProject.localOnly === true) + if (!routed.route) return `Cannot delegate: ${routed.error}.` + const routeAccountId = routed.route.providerAccountId ?? null + const routeProvider = store.settings.providers.find((p) => p.id === routed.route.providerId) + const prov = routeProvider ? runtimeProvider(routeProvider, routed.route.providerAccountId) : undefined + if (!prov) return s.providerId === routed.route.providerId ? 'Cannot delegate: seat misconfigured.' : `Cannot delegate: provider "${routed.route.providerId}" is not configured.` + const task = String(args?.task || '').trim() || 'Focused room subtask' + const name = typeof args?.name === 'string' ? args.name.trim() : '' + const runId = `subagent-${randomUUID()}` + const created = createSubAgentFromLaunch(store.subAgents, { + source: 'room_delegate', + parent: parentForRoomSeat(runtimeScope.room, s), + task, + name, + providerId: routed.route.providerId, + providerAccountId: routeAccountId, + model: routed.route.model, + runId, + cwd: runtimeScope.roomWorkspace, + }) + store.subAgents = created.agents + persistSubAgentsSafe() + if (args && typeof args === 'object') { + args.id = created.agent.id + args.name = created.agent.name + args.task = task + args.parentSeat = seat + args.providerId = routed.route.providerId + args.providerAccountId = routeAccountId + args.model = routed.route.model + if (routed.notice) args.notice = routed.notice + args.status = 'running' + } + const started = startSubAgent(store.subAgents, created.agent.id, runId) + store.subAgents = started.agents + persistSubAgentsSafe() + const launched = await runReadOnlySubAgent(created.agent, prov, routed.route.model, { + task, + parentLabel: `room seat "${seat}" in room "${runtimeScope.room.name}"`, + cwd: runtimeScope.roomWorkspace, + projectId: runtimeScope.room.projectId, + providerAccountId: routeAccountId, + signal: runtimeScope.controller.signal, + reasoningEffort: routed.route.reasoningEffort ?? runtimeScope.reasoningEffort, + project: runtimeScope.roomProject, + maxSteps: 10, + maxWallMs: 150_000, + }) + if (args && typeof args === 'object') { + args.status = launched.agent.status + args.result = launched.agent.result + args.error = launched.agent.error + } + return routed.notice ? `${routed.notice}\n${launched.output}` : launched.output + }, + // Room tools are read-only by default. Mutating tools need a future room-level approval UI. + // memory_write is room state (the shared scratchpad), not workspace mutation, so it is allowed. + memory_write: async (args, seat) => { + const name = typeof args?.name === 'string' ? args.name.trim() : '' + const content = typeof args?.content === 'string' ? args.content.trim() : '' + if (!name || !content) return 'memory_write needs a "name" (decisions, plan, blockers, or any label) and "content".' + if (!runtimeScope.room.sharedMemory) runtimeScope.room.sharedMemory = createSharedMemory() + const mode = args?.mode === 'append' || args?.mode === 'append-bullet' ? args.mode : 'replace' + const expectedRevision = typeof args?.expectedRevision === 'number' ? args.expectedRevision : undefined + const result = writeBlock(runtimeScope.room.sharedMemory, { name, content, author: seat, mode, expectedRevision }) + if (!result.ok) { + if (result.reason === 'conflict') return `Memory conflict on "${name}": current revision is ${result.currentRevision}. Re-read the block and retry.` + if (result.reason === 'content-too-large') return `Memory block "${name}" is too large: content is capped at ${MEMORY_MAX_BLOCK_CHARS} characters. Summarize it and retry.` + if (result.reason === 'block-limit') return `Shared memory is full (${MEMORY_MAX_BLOCKS} blocks). Update an existing block instead of adding a new one.` + return 'Memory write needs a non-empty name.' + } + runtimeScope.room.updatedAt = Date.now() + persistRooms() + // Live push so the renderer reflects the write without waiting for a full snapshot. + if (result.changed) publishRemote?.({ kind: 'room', data: runtimeScope.room }) + return result.changed + ? `Memory "${result.block.name}" updated (rev ${result.block.revision}).\n${renderSharedMemory(runtimeScope.room.sharedMemory)}` + : `Memory "${result.block.name}" already says that (rev ${result.block.revision}).` + }, + read_file: async (args) => { const r = await executeTool('read_file', args, { cwd: runtimeScope.roomWorkspace }); return r.output.slice(0, 4000) }, + list_dir: async (args) => { const r = await executeTool('list_dir', args, { cwd: runtimeScope.roomWorkspace }); return r.output.slice(0, 2000) }, + search: async (args) => { const r = await executeTool('search', args, { cwd: runtimeScope.roomWorkspace }); return r.output.slice(0, 2000) }, + write_file: async (args) => { + await auditEvent('room.tool_blocked', { roomId: runtimeScope.room.id, tool: 'write_file', path: auditPreview(args?.path) }) + return 'Blocked: room agents are read-only until a room-level approval gate is available. Create/claim a ticket and run the work in an approved thread.' + }, + edit_file: async (args) => { + await auditEvent('room.tool_blocked', { roomId: runtimeScope.room.id, tool: 'edit_file', path: auditPreview(args?.path) }) + return 'Blocked: room agents are read-only until a room-level approval gate is available. Create/claim a ticket and run the work in an approved thread.' + }, + run_command: async (args) => { + await auditEvent('room.tool_blocked', { roomId: runtimeScope.room.id, tool: 'run_command', command: auditPreview(args?.command) }) + return 'Blocked: room agents cannot run shell commands unattended. Ask the user to run an approved thread or terminal command.' + }, + } +} diff --git a/app/electron/main/host/room-worker-effort.test.ts b/app/electron/main/host/room-worker-effort.test.ts new file mode 100644 index 00000000000..9fd52c25c90 --- /dev/null +++ b/app/electron/main/host/room-worker-effort.test.ts @@ -0,0 +1,120 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import path from 'node:path' +import { randomUUID } from 'node:crypto' +import ts from 'typescript' +import * as tickets from '../../agent/tickets' +import { restrictTicketToolContext } from '../../agent/ticket-tool-policy' +import { requireTicketDependenciesReady } from '../../../shared/ticket-dependencies' +import { lexicalLocalWorkspaceKey } from './workspace-mutation-guard' +import * as reasoning from '../../../shared/reasoning-effort' + +const code = ts.transpileModule(readFileSync(path.join(__dirname, 'ticket-worker-runtime.ts'), 'utf8'), { + compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS, esModuleInterop: true }, +}).outputText +const observed: unknown[] = [] +const expected: unknown[] = [] +for (const [global, configured, sourceEffort] of [['high', 'low', undefined], ['low', 'high', undefined], + ['high', undefined, undefined], ['high', 'medium', 'low']] as const) { + for (const recover of [false, true]) { + let releaseWorkspace!: (cwd: string) => void + const workspace = new Promise(resolve => { releaseWorkspace = resolve }) + let releaseAgent!: () => void + const agent = new Promise(resolve => { releaseAgent = resolve }) + let finish!: () => void + const done = new Promise(resolve => { finish = resolve }) + const provider = { id: 'fixture', name: 'Fixture', kind: 'local', baseUrl: 'http://127.0.0.1:1/v1', models: ['fixture'] } + const seat: any = { id: 'builder', name: 'Builder', role: 'Review input', providerId: provider.id, + model: 'fixture', reasoningEffort: configured } + const ticket: any = { id: 'ticket', projectId: 'project', roomId: 'room', title: 'Review input', body: '', + type: 'task', status: 'ready', priority: 'medium', effort: 'small', tags: [], parentId: null, + assignee: null, threadId: null, allowedCapabilities: ['read'], requiredEvidence: [], acceptanceCriteria: [], + dependsOn: [], order: 1, createdAt: 1, updatedAt: 1 } + const store: any = { + projects: [{ id: 'project', name: 'Synthetic project', cwd: '/workspace/project' }], + rooms: [{ id: 'room', projectId: 'project', seats: [seat], state: 'running' }], tickets: [ticket], threads: [], + settings: { providers: [provider], reasoningEffort: global, approvalMode: 'suggest', temperature: 0 }, + } + const routeEfforts: unknown[] = [] + const requests: any[] = [] + const imports: Record = { + 'node:crypto': { randomUUID }, 'node:path': path, + '../../agent/response-language': { selectedResponseLocale: () => 'en' }, + '../../agent/loop': { runAgent: async (params: any) => { + requests.push(params) + if (recover && requests.length === 1) throw new Error('Synthetic provider limit') + await agent + } }, + '../../agent/security': { assertProviderEndpoint() {}, auditPreview: (value: string) => value }, + '../../agent/tickets': tickets, '../../agent/ticket-tool-policy': { restrictTicketToolContext }, + '../state': { store }, './audit': { requireSecurityRole() {}, auditEvent: async () => {} }, + './room-worktree': { ensureRoomWorktree: () => workspace }, + '../../../shared/ticket-dependencies': { requireTicketDependenciesReady }, + './workspace': { resolveWorkspaceCwd: async (cwd: string) => cwd, inspectGitRepository: async () => ({ branch: 'fixture' }) }, + './ticket-helpers': { summarizeTicketWorkerOutcome: () => ({ text: 'Synthetic result', evidence: [], + codeChanged: false, testsPassed: false, signals: { commands: [], blockers: [], files: [], diffs: [] } }) }, + './workspace-mutation-guard': { lexicalLocalWorkspaceKey }, + './renderer-events': { sendToRenderer() {} }, + '../../../shared/reasoning-effort': reasoning, + './provider-runtime': { + ticketWorkOptionsWithProjectRoute: (_project: any, opts: any) => opts, + resolveProjectProvider: () => ({ baseProvider: provider, provider, providerAccountId: null, model: 'fixture' }), + runtimeProviderWithFreshModels: async () => provider, + modelRouteAccountLabel: () => 'Fixture', modelRouteAutoFailoverEnabled: () => true, + modelRouteFailoverText: () => 'Synthetic recovery', modelRouteResetPolicy: () => 'rotate_on_limit', + modelRouter: { + select: (params: any) => { + routeEfforts.push(params.reasoningEffort) + return { selected: true, selectedAccountId: null, audit: { action: 'keep', reason: 'Fixture' } } + }, + routeAfterError: (params: any) => { + routeEfforts.push(params.reasoningEffort) + return { signal: { resetAt: 1, kind: 'rate_limit' }, audit: [], + route: { selected: true, selectedAccountId: 'recovery', audit: { reason: 'Fixture recovery' } } } + }, + }, + }, + } + const module = { exports: {} as any } + new Function('require', 'module', 'exports', code)((id: string) => { + assert.ok(id in imports, `Reviewed worker import ${id}`) + return imports[id] + }, module, module.exports) + const noop = () => {} + const runtime = module.exports.createTicketWorkerRuntime({ + persistThreads: noop, persistTickets: noop, emitTicket: noop, appendRoomSupervisorEvent: noop, + claimJob: () => ({ id: 'job', status: 'running' }), patchJob: (job: any) => job, + fullToolContext: () => ({}), drainThreadCues: () => [], waitForThreadCue: async () => {}, + approvalResolver: () => async () => 'deny', timelineErrorSince: () => null, + timelineError: () => new Error('Unexpected timeline error'), isHighRiskTool: () => false, + emitToRenderer: noop, addThreadNotice: noop, auditModelRoute: async () => {}, + markRouteErrorRecovered: noop, injectThreadRouteHandoff: () => '', aborters: new Map(), + workspaceMutationGuard: { assertThreadStartAllowed: noop, + reserveStart: () => ({ addWorkspaceKeys: noop, addThreadId: noop, release: noop }) }, + applyEventToThread: noop, activeJob: () => null, finishJob: () => finish(), + markUndrainedCues: noop, effectiveContextLimit: () => 16_384, + }) + const pending = runtime.startTicketWork({ ticketId: ticket.id, source: { roomId: 'room', seat: 'Builder', reasoningEffort: sourceEffort } }) + assert.equal(requests.length, 0, 'workspace preparation genuinely pauses the production launch') + seat.reasoningEffort = 'medium' + store.settings.reasoningEffort = 'medium' + releaseWorkspace('/workspace/room') + await pending + const captured = ticket.execution?.reasoningEffort + releaseAgent() + let timer: ReturnType | undefined + try { + await Promise.race([done, new Promise((_, reject) => { + timer = setTimeout(() => reject(new Error('Worker did not settle')), 2_000) + })]) + } finally { clearTimeout(timer) } + assert.equal(requests.length, recover ? 2 : 1, 'the actual worker executes initial and recovery routes') + const effort = sourceEffort ?? configured ?? global + observed.push({ global, configured, recover, routes: routeEfforts, + requests: requests.map(request => request.reasoningEffort), captured, settled: ticket.execution?.reasoningEffort }) + expected.push({ global, configured, recover, routes: Array(recover ? 2 : 1).fill(effort), + requests: Array(recover ? 2 : 1).fill(effort), captured: effort, settled: effort }) + } +} +assert.deepEqual(observed, expected, 'Room workers snapshot effort before awaits and retain it through recovery and settlement') +console.log('Room worker effort checks passed: opposite defaults, legacy inheritance, delayed startup, recovery and execution records.') diff --git a/app/electron/main/host/ticket-worker-runtime.ts b/app/electron/main/host/ticket-worker-runtime.ts index b0c6c5fbb2b..17334773af1 100644 --- a/app/electron/main/host/ticket-worker-runtime.ts +++ b/app/electron/main/host/ticket-worker-runtime.ts @@ -6,11 +6,12 @@ import { assertProviderEndpoint, auditPreview } from '../../agent/security' import { normalizeTicketCapabilities, settleTicketExecution, startTicketExecution, ticketFileRefs, ticketStateAfterRun, ticketWorkPrompt } from '../../agent/tickets' import { restrictTicketToolContext } from '../../agent/ticket-tool-policy' import type { JobPatch } from '../../agent/jobs' -import type { AgentCue, AgentEvent, Job, Project, Provider, Room, Thread, Ticket, TicketWorkOptions, TimelineItem } from '../../agent/types' +import type { AgentCue, AgentEvent, Job, Project, Provider, ReasoningEffortSetting, Room, Thread, Ticket, TicketWorkOptions, TimelineItem } from '../../agent/types' import { store } from '../state' import { auditEvent, requireSecurityRole } from './audit' import { ensureRoomWorktree } from './room-worktree' import { requireTicketDependenciesReady } from '../../../shared/ticket-dependencies' +import { captureAgentReasoningEffort } from '../../../shared/reasoning-effort' import { inspectGitRepository } from './workspace' import { summarizeTicketWorkerOutcome } from './ticket-helpers' import { modelRouteAccountLabel, modelRouteAutoFailoverEnabled, modelRouteFailoverText, modelRouteResetPolicy, modelRouter, resolveProjectProvider, runtimeProviderWithFreshModels, ticketWorkOptionsWithProjectRoute } from './provider-runtime' @@ -21,6 +22,7 @@ import { sendToRenderer } from './renderer-events' export interface TicketWorkerSource { roomId?: string | null seat?: string | null + reasoningEffort?: ReasoningEffortSetting onSettled?: (summary: { codeChanged: boolean; testsPassed: boolean; failed: boolean; jobId?: string | null }) => void } @@ -140,6 +142,10 @@ async function startTicketWork(input: TicketWorkerInput): Promise { requireTicketDependenciesReady(ticket, store.tickets) if (!project) throw new Error('Restore or choose an active project before starting ticket work.') if (existingThread && aborters.has(existingThread.id)) throw new Error('Ticket work is already running.') + const roomSeat = input.source?.roomId === room?.id + ? room?.seats.find((seat) => seat.name === input.source?.seat) : undefined + const configuredEffort = input.source?.reasoningEffort === undefined ? roomSeat : input.source + const reasoningEffort = captureAgentReasoningEffort(configuredEffort, store.settings.reasoningEffort) const configuredWorkspace = room?.workspace ?? project.workspace ?? null if (configuredWorkspace?.kind === 'ssh') { throw new Error('Local ticket workers do not support SSH workspaces; run this ticket on its remote Orchestrator.') @@ -173,7 +179,7 @@ async function startTicketWork(input: TicketWorkerInput): Promise { allowFailover: modelRouteAutoFailoverEnabled(routeBaseProvider, requestedProviderAccountId), localOnly: project?.localOnly === true, contextLimit: effectiveContextLimit(routeBaseProvider, resolvedRoute.model, requestedProviderAccountId), - reasoningEffort: store.settings.reasoningEffort, + reasoningEffort, budget: phase, source: 'ticket_worker_initial_route', }) @@ -233,6 +239,7 @@ async function startTicketWork(input: TicketWorkerInput): Promise { threadId: thread.id, startedAt: ticket.startedAt, }) + ticket.execution.reasoningEffort = reasoningEffort ticket.updatedAt = Date.now() persistTickets(); emitTicket(ticket) if (room && input.source?.roomId) { @@ -330,7 +337,7 @@ async function startTicketWork(input: TicketWorkerInput): Promise { model: route.model, approvalMode: store.settings.approvalMode === 'auto' ? 'suggest' : store.settings.approvalMode, temperature: store.settings.temperature, - reasoningEffort: store.settings.reasoningEffort, + reasoningEffort, autoCompact: store.settings.autoCompact, contextLimit: effectiveContextLimit(route.provider, route.model), toolContext, @@ -361,7 +368,7 @@ async function startTicketWork(input: TicketWorkerInput): Promise { allowFailover: modelRouteAutoFailoverEnabled(latestBaseProvider, activeRoute.providerAccountId) || t.modelRoute?.resetPolicy === 'rotate_on_limit', localOnly: project?.localOnly === true, contextLimit: effectiveContextLimit(latestBaseProvider, activeRoute.model, activeRoute.providerAccountId), - reasoningEffort: store.settings.reasoningEffort, + reasoningEffort, budget: phase, source: 'ticket_worker_recovery', }) diff --git a/app/electron/main/host/tool-context-runtime.ts b/app/electron/main/host/tool-context-runtime.ts index 9af9084596a..51e62269100 100644 --- a/app/electron/main/host/tool-context-runtime.ts +++ b/app/electron/main/host/tool-context-runtime.ts @@ -1,3 +1,6 @@ +import type { ReadOnlySubAgentInput, ToolContextRuntime, ToolContextRuntimeDeps } from './tool-context-types' +export type { ToolContextRuntime } from './tool-context-types' +import { captureAgentReasoningEffort } from '../../../shared/reasoning-effort' import { documentEventAllowed, documentPolicySignature, scopedDocumentLibrary, scopedDocumentSettings, validateDocumentSourceIds } from '../../document-library/scope' import { selectedResponseLocale } from '../../agent/response-language' import { documentLibrary } from './document-library-runtime' @@ -41,7 +44,6 @@ import type { ControllerActionInput } from '../../agent/controller-actions' import { store } from '../state' import { addSuggestion, type SuggestionInput } from '../../agent/suggestions' import { persistArtifacts, persistSuggestions } from './persistence' -import type { SshManager } from './ssh' import { blindSearchToken, searchSessionIndex, saveThreads, vontraPath } from '../../store' import { sendToRenderer } from './renderer-events' import { createManagedOutputStore } from './managed-outputs' @@ -49,53 +51,6 @@ import { isWhatsAppEventInCurrentScope } from '../../../shared/whatsapp-event-sc import { createGoogleContextMarker, createGoogleWorkspaceToolRunner } from './google-workspace-tool-runtime' import { googleWorkspaceService } from './google-workspace-runtime' -export interface ToolContextRuntime { - fullToolContext(run?: { thread?: Thread; provider?: Provider; model?: string; signal?: AbortSignal; subAgentId?: string; memoryPolicy?: import('../../agent/types').ThreadMemoryPolicy; memoryOwner?: { id: string; revision: number } }): any - runReadOnlySubAgent( - agent: SubAgent, - provider: Provider, - model: string, - input: { - task: string - parentLabel: string - cwd: string - projectId?: string | null - providerAccountId?: string | null - project?: Project | null - workspace?: WorkspaceLocation | null - signal: AbortSignal - memoryPolicy?: import('../../agent/types').ThreadMemoryPolicy - incognito?: boolean - memoryOwner?: { id: string; revision: number } - maxSteps?: number - maxWallMs?: number - }, - ): Promise<{ agent: SubAgent; output: string }> -} - -interface ToolContextRuntimeDeps { - sshManager: SshManager - persistSubAgents(): void - persistThreads(): void - applyEventToThread(thread: Thread, event: AgentEvent): void - emitToRenderer(event: AgentEvent): void - emitPluginEvent(event: AgentEvent): void - renderProjectMemoryBucket(project: Project | undefined): string - recordEmailDraft: any - recordEmailEvent: any - recordCalendarEvent: any - recordMessageEvent: any - runBrowserAutomation: any - mcpToolContext(): any - // Ends a thread's run; the computer-use indicator's Stop uses it. - cancelThreadRun(threadId: string): void - // Trusted repo-authored skills for a project (VST-010), served from the scan cache so - // this stays synchronous. Absent → global skills only. - projectSkills?(projectId: string | null | undefined, workspace?: WorkspaceLocation | null): Skill[] - // Observer hooks (VST-012): subagent lifecycle observation, fail-open. - observe?: (kind: 'subagent.start' | 'subagent.end', payload: Record) => void -} - export function createToolContextRuntime(deps: ToolContextRuntimeDeps): ToolContextRuntime { const { sshManager, @@ -116,21 +71,7 @@ export function createToolContextRuntime(deps: ToolContextRuntimeDeps): ToolCont agent: SubAgent, provider: Provider, model: string, - input: { - task: string - parentLabel: string - cwd: string - projectId?: string | null - providerAccountId?: string | null - project?: Project | null - workspace?: WorkspaceLocation | null - signal: AbortSignal - memoryPolicy?: import('../../agent/types').ThreadMemoryPolicy - incognito?: boolean - memoryOwner?: { id: string; revision: number } - maxSteps?: number - maxWallMs?: number - }, + input: ReadOnlySubAgentInput, ) { const storedAgent = store.subAgents.find((candidate) => candidate.id === agent.id) if (!storedAgent) throw new Error('The owning sub-agent is unavailable; refusing to start an unregistered child.') @@ -158,6 +99,7 @@ export function createToolContextRuntime(deps: ToolContextRuntimeDeps): ToolCont } } assertRequestAllowed() + const reasoningEffort = captureAgentReasoningEffort(input, store.settings.reasoningEffort) const childThread: Thread = { id: `thread-${agent.id}`, documentSourceIds: owner?.documentSourceIds ? [...validateDocumentSourceIds(owner.documentSourceIds)!] : [], @@ -201,7 +143,7 @@ export function createToolContextRuntime(deps: ToolContextRuntimeDeps): ToolCont model, approvalMode: 'readonly', temperature: store.settings.temperature, - reasoningEffort: store.settings.reasoningEffort, + reasoningEffort, emit: (event) => applyEventToThread(childThread, event), requestApproval: async () => 'deny', signal: input.signal, diff --git a/app/electron/main/host/tool-context-types.ts b/app/electron/main/host/tool-context-types.ts new file mode 100644 index 00000000000..02d6cd61d49 --- /dev/null +++ b/app/electron/main/host/tool-context-types.ts @@ -0,0 +1,52 @@ +import type { AgentEvent, Project, Provider, ReasoningEffortSetting, Skill, SubAgent, Thread, WorkspaceLocation } from '../../agent/types' +import type { SshManager } from './ssh' + +export interface ReadOnlySubAgentInput { + task: string + parentLabel: string + cwd: string + projectId?: string | null + providerAccountId?: string | null + project?: Project | null + workspace?: WorkspaceLocation | null + reasoningEffort?: ReasoningEffortSetting + signal: AbortSignal + memoryPolicy?: import('../../agent/types').ThreadMemoryPolicy + incognito?: boolean + memoryOwner?: { id: string; revision: number } + maxSteps?: number + maxWallMs?: number + } + +export interface ToolContextRuntime { + fullToolContext(run?: { thread?: Thread; provider?: Provider; model?: string; signal?: AbortSignal; subAgentId?: string; memoryPolicy?: import('../../agent/types').ThreadMemoryPolicy; memoryOwner?: { id: string; revision: number } }): any + runReadOnlySubAgent( + agent: SubAgent, + provider: Provider, + model: string, + input: ReadOnlySubAgentInput, + ): Promise<{ agent: SubAgent; output: string }> +} + +export interface ToolContextRuntimeDeps { + sshManager: SshManager + persistSubAgents(): void + persistThreads(): void + applyEventToThread(thread: Thread, event: AgentEvent): void + emitToRenderer(event: AgentEvent): void + emitPluginEvent(event: AgentEvent): void + renderProjectMemoryBucket(project: Project | undefined): string + recordEmailDraft: any + recordEmailEvent: any + recordCalendarEvent: any + recordMessageEvent: any + runBrowserAutomation: any + mcpToolContext(): any + // Ends a thread's run; the computer-use indicator's Stop uses it. + cancelThreadRun(threadId: string): void + // Trusted repo-authored skills for a project (VST-010), served from the scan cache so + // this stays synchronous. Absent → global skills only. + projectSkills?(projectId: string | null | undefined, workspace?: WorkspaceLocation | null): Skill[] + // Observer hooks (VST-012): subagent lifecycle observation, fail-open. + observe?: (kind: 'subagent.start' | 'subagent.end', payload: Record) => void +} diff --git a/app/electron/main/host/workspace-runtime-ipc.ts b/app/electron/main/host/workspace-runtime-ipc.ts index f3b1af81baf..df570176abc 100644 --- a/app/electron/main/host/workspace-runtime-ipc.ts +++ b/app/electron/main/host/workspace-runtime-ipc.ts @@ -1,42 +1,18 @@ +import { createRoomRunRuntime } from './room-run-runtime' +import type { TicketWorkerRuntime } from './ticket-worker-runtime' +import { reserveRoomStartup, assertLocalTicketGenerationProject, requireActiveRoomForCancel, assertRecordMetadataNotPatched } from './workspace-startup-policy' +export { reserveRoomStartup, assertLocalTicketGenerationProject, requireActiveRoomForCancel, assertRecordMetadataNotPatched } from './workspace-startup-policy' import { registerProjectMemoryIpc } from './project-memory-ipc' -import type { RoomSupervisorMetadataPatch } from '../../agent/jobs' + import type { runRoom as typedRunRoom } from '../../agent/rooms' -import { buildUserContent, contentText } from '../../agent/content' -import { normalizeAttachments } from '../../agent/attachment-policy' -import type { - Attachment, - Job, - Project, - ProjectMemoryCandidate, - ProjectMemoryEntry, - Provider, - RemoteControlEvent, - Room, - RoomManualMemoryCommand, - RoomMergeResult, - RoomStreamEvent, - Seat, - Skill, - Ticket, - TicketWorkOptions, - Thread, -} from '../../agent/types' + +import type { Attachment, Job, Project, RemoteControlEvent, Room, RoomManualMemoryCommand, RoomMergeResult, Skill, Ticket, TicketWorkOptions } from '../../agent/types' import type { store as typedStore } from '../state' import type { handle as typedHandle } from './ipc' import { roomModeDefaults } from '../../agent/room-outcomes' -import { resolveDelegationRoute } from '../../agent/delegation-route' -import { createSharedMemory, MEMORY_MAX_BLOCK_CHARS, MEMORY_MAX_BLOCKS, renderSharedMemory, writeBlock } from '../../agent/shared-room-memory' -import { canonicalLocalWorkspaceKey, lexicalLocalWorkspaceKey, type WorkspaceMutationGuard, type WorkspaceMutationLease } from './workspace-mutation-guard' -import { - applyRoomManualMemoryCommand, - assertRoomConfigUpdateAllowed, - assertRoomSeatRoutesConfigured, - assertTicketUserUpdateAllowed, - pickRoomConfigPatch, - pickRoomManualMemoryCommand, - pickTicketCreateInput, - pickTicketUserPatch, -} from './room-ticket-patch-policy' + +import { canonicalLocalWorkspaceKey, lexicalLocalWorkspaceKey } from './workspace-mutation-guard' +import { applyRoomManualMemoryCommand, assertRoomConfigUpdateAllowed, assertRoomSeatRoutesConfigured, assertTicketUserUpdateAllowed, pickRoomConfigPatch, pickRoomManualMemoryCommand, pickTicketCreateInput, pickTicketUserPatch } from './room-ticket-patch-policy' import { sanitizeProjectCreateInput, sanitizeProjectUpdatePatch, validateProjectExecutionTargetInput, validateProjectProviderDefaults } from './project-patch-policy' import { assertUniqueConfigName, sanitizeSkillSave } from './public-config-policy' import { scanGitHygiene } from '../../agent/git-hygiene' @@ -52,49 +28,7 @@ export interface WorkspaceRuntimeIpc { startRoomRun(roomId: string, problem: string, attachments?: Attachment[]): Promise<{ ok: boolean; room?: Room }> } -export function reserveRoomStartup( - roomId: string, - roomAborters: Map, - guard: Pick, - workspaceKeys: Iterable, -): { controller: AbortController; runLease: WorkspaceMutationLease } | null { - if (roomAborters.has(roomId)) return null - const runLease = guard.reserveStart({ workspaceKeys }) - const controller = new AbortController() - roomAborters.set(roomId, controller) - return { controller, runLease } -} - -export function assertLocalTicketGenerationProject(project: Pick): void { - if (project.workspace?.kind === 'ssh') { - throw new Error('Ticket generation for SSH projects is unavailable until the planner can run on the remote workspace.') - } -} - -export function requireActiveRoomForCancel(rooms: readonly Room[], roomId: string): Room { - const room = rooms.find((candidate) => candidate.id === roomId) - if (!room) throw new Error('Room not found') - if (room.archivedAt) throw new Error('Restore this archived room before cancelling it.') - return room -} - -export function assertRecordMetadataNotPatched(patch: object, additionalHostFields: readonly string[] = []): void { - for (const field of ['id', 'createdAt', 'updatedAt', ...additionalHostFields]) { - if (Object.prototype.hasOwnProperty.call(patch, field)) { - throw new Error(`${field} is host-owned and cannot be changed through update endpoints.`) - } - } -} - -type StartTicketWork = (input: { - ticketId: string - opts?: TicketWorkOptions - source?: { - roomId?: string | null - seat?: string | null - onSettled?: (summary: { codeChanged: boolean; testsPassed: boolean; failed: boolean; jobId?: string | null }) => void - } -}) => Promise +type StartTicketWork = TicketWorkerRuntime['startTicketWork'] export interface WorkspaceRuntimeIpcDeps { store: typeof typedStore @@ -124,64 +58,25 @@ export function createWorkspaceRuntimeIpc(ctx: WorkspaceRuntimeIpcDeps): Workspa auditEvent, auditPreview, persistProjects, - persistThreads, persistRooms, persistTickets, - persistSubAgents, persistSkills, - persistProjectMemory, - persistProjectMemoryCandidates, aborters, roomAborters, DEFAULT_ROOM_COLLABORATION_MODE, DEFAULT_ROOM_WORKER_BUDGET, - ensureRoomWorktree, emitRoom, emitTicket, - emitJob, publishRemote, activeJob, patchRoomSupervisorJob, finishRoomSupervisorMission, finishJob, - ensureRoomSupervisorMission, - roomWorkerBudget, - claimJob, - patchJob, - buildRoomSupervisorJobMetadata, - ticketsForRoom, - runtimeProvider, - inferSeatLane, - appendRoomSupervisorEvent, - ticketNeedsReviewAfterBuilder, - roomTicketConflictBlockers, - summarizeRoomLeftToWork, - describeTicketForRoom, mkTicket, assertTicketRelations, - normalizeTicketCapabilities, normalizeStringList, - ticketEvidenceFromArgs, - ticketFileRefs, startTicketWork, parkRoomIfWorkRemains, - createSubAgentFromLaunch, - parentForRoomSeat, - persistSubAgents: persistSubAgentsFromCtx, - startSubAgent, - runReadOnlySubAgent, - executeTool, - modelRouter, - modelRouteAutoFailoverEnabled, - effectiveContextLimit, - roomContextLimit, - auditScopedModelRoute, - runtimeProviderWithFreshModels, - assertProviderEndpoint, - modelRouteFailoverText, - roomRouteHandoff, - modelRouteResetPolicy, - roomFinalGateBlockers, runRoom, normalizeTicketExecution, ticketWorkOptionsWithProjectRoute, @@ -190,21 +85,12 @@ export function createWorkspaceRuntimeIpc(ctx: WorkspaceRuntimeIpcDeps): Workspa ensureTensorFoldStudioStylePrompt, streamChat, parseJsonLoose, - createProjectMemoryCandidate, - approveProjectMemoryCandidate, - rejectProjectMemoryCandidate, - projectMemoryCandidateDiff, - rollbackProjectMemoryEntry, - forgetProjectMemoryEntry, - scopeProjectMemoryEntries, - scopeProjectMemoryCandidates, registerWebhookIpc, webhookServer, rememberConnectorEvents, validateProjectCwd, confirmSensitiveAction, } = ctx - const persistSubAgentsSafe = persistSubAgentsFromCtx ?? persistSubAgents async function writeIfMissing(file: string, content: string): Promise { try { @@ -445,652 +331,7 @@ function cancelRoomRun(roomId: string): void { finishRoomSupervisorMission(job, 'cancelled', 'Room cancelled by user.') finishJob(job, 'cancelled', 'Room cancelled by user.') } - -async function startRoomRun(roomId: string, problem: string, attachments?: Attachment[]): Promise<{ ok: boolean; room?: Room }> { - requireSecurityRole('operator', 'start rooms') - const room = store.rooms.find((r) => r.id === roomId) - if (!room) throw new Error('Room not found') - if (room.archivedAt) throw new Error('Restore this archived room before starting it.') - // Don't start a second run for a room that's already running — it would overwrite the live - // aborter, making both the first run uncancellable and the second un-stoppable. - if (roomAborters.has(roomId)) return { ok: false, room } - const project = store.projects.find((p) => p.id === room.projectId) - if (!project) throw new Error('Project not found') - if (project.archivedAt) throw new Error('Restore the archived project before starting this room.') - // Rooms broadcast a single text problem to every seat (many are CLI/text-only), so fold - // attachments into text: documents become labelled blocks; images are noted (vision-capable - // seats can't receive pixels through the room channel). - const safeAttachments = normalizeAttachments(attachments) - const cleanProblem = contentText(buildUserContent(String(problem || '').trim(), safeAttachments)).trim() - if (!cleanProblem) throw new Error('Add a room objective before starting.') - if (room.seats.length < 1) throw new Error('Add at least one agent to the room first.') - const configuredWorkspace = room.workspace ?? project.workspace ?? null - if (configuredWorkspace?.kind === 'ssh') { - throw new Error('Local room execution does not support SSH workspaces; run this room on its remote Orchestrator.') - } - const initialPaths = [configuredWorkspace?.path, room.workspaceCwd, room.rootCwd, room.scratchpadCwd, project.cwd] - .filter((value): value is string => typeof value === 'string' && value.trim().length > 0) - const initialWorkspaceKeys = initialPaths.map((value: string) => lexicalLocalWorkspaceKey(value)) - const reservation = reserveRoomStartup(roomId, roomAborters, workspaceMutationGuard, initialWorkspaceKeys) - if (!reservation) return { ok: false, room } - const { controller, runLease } = reservation - const timeout = setTimeout(() => controller.abort(), 30 * 60_000) - roomAborters.set(roomId, controller) - let startupComplete = false - try { - const roomWorkspace = await ensureRoomWorktree(project, room) - const finalWorkspaceKey = await canonicalLocalWorkspaceKey(roomWorkspace) - runLease.addWorkspaceKeys?.([finalWorkspaceKey]) - if (room.archivedAt || project.archivedAt) throw new Error('Room or project was archived while the room was starting.') - if (room.workspaceCwd !== roomWorkspace) { - room.workspaceCwd = roomWorkspace - persistRooms() - } - const roomProject = { ...project, cwd: roomWorkspace } - - room.problem = cleanProblem - room.events = [] - room.finalText = '' - room.state = 'queued' - room.updatedAt = Date.now() - persistRooms() - emitRoom({ roomId, type: 'status', state: 'queued' }) - const supervisorMission = ensureRoomSupervisorMission(room, project, roomWorkspace, cleanProblem) - const supervisorRunId = `room:${room.id}:${Date.now()}` - const configuredWorkerBudget = roomWorkerBudget(room) - let job: Job | null = claimJob({ - kind: 'room', - owner: room.id, - projectId: room.projectId, - missionId: supervisorMission.id, - roomId: room.id, - currentThreadId: null, - metadata: buildRoomSupervisorJobMetadata({ - room, - project, - tickets: ticketsForRoom(room), - patch: { missionId: supervisorMission.id, workerBudget: configuredWorkerBudget, workerStarts: 0 }, - }), - }) - job = patchJob(job, { currentRunId: supervisorRunId }) - - let lastCodeChangeAt = 0 - let greenEvidenceAt = 0 - const providerForSeat = (seat: Seat): Provider | undefined => { - const provider = store.settings.providers.find((p) => p.id === seat.providerId) - return provider ? runtimeProvider(provider, seat.providerAccountId) : undefined - } - if (roomProject.localOnly) { - const cloudSeat = room.seats.find((seat) => providerForSeat(seat)?.kind !== 'local') - if (cloudSeat) { - room.state = 'failed' - persistRooms() - emitRoom({ roomId: room.id, type: 'error', message: `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`, fatal: true }) - emitRoom({ roomId: room.id, type: 'status', state: 'failed' }) - emitRoom({ roomId: room.id, type: 'done' }) - clearTimeout(timeout) - roomAborters.delete(room.id) - job = patchRoomSupervisorJob(job, room, project) - finishRoomSupervisorMission(job, 'failed', `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`) - finishJob(job, 'failed', `Project is local-only, but seat "${cloudSeat.name}" is not using a local provider.`) - return { ok: false } - } - } - const roomTickets = (): Ticket[] => ticketsForRoom(room) - // Resolve a ticket from free-form LLM tool input. Precedence: exact id, then exact (trimmed, - // case-insensitive) title equality, then a UNIQUE case-insensitive substring. A substring that - // matches multiple tickets is AMBIGUOUS — never silently pick the first (store-insertion-order) - // match, or claim/complete/start could act on the wrong ticket (e.g. "auth" hitting both - // "Add auth" and "Add auth tests"). On ambiguity, `error` is set and `ticket` is undefined. - const resolveTicket = (args: any): { ticket?: Ticket; error?: string } => { - const board = roomTickets() - const id = typeof args?.id === 'string' ? args.id : '' - if (id) { - const byId = board.find((t) => t.id === id) - if (byId) return { ticket: byId } - } - const rawTitle = typeof args?.title === 'string' ? args.title.trim() : '' - if (!rawTitle) return { ticket: undefined } - const wanted = rawTitle.toLowerCase() - const exact = board.filter((t) => t.title.trim().toLowerCase() === wanted) - if (exact.length === 1) return { ticket: exact[0] } - if (exact.length > 1) { - return { error: `"${rawTitle}" matches ${exact.length} tickets with that exact title; reference the ticket by id instead.` } - } - const substr = board.filter((t) => t.title.toLowerCase().includes(wanted)) - if (substr.length === 1) return { ticket: substr[0] } - if (substr.length > 1) { - return { error: `"${rawTitle}" is ambiguous — it matches ${substr.length} tickets (${substr.map((t) => `"${t.title}"`).join(', ')}); use a more specific title or the ticket id.` } - } - return { ticket: undefined } - } - const findTicket = (args: any): Ticket | undefined => resolveTicket(args).ticket - // Mirrors tickets.ts isReservationEvidence / meaningfulTicketEvidence (which are module-private - // there): a "Reserved for build/review worker." note placed by start_ticket_work is a placeholder, - // not real evidence, so it must not satisfy a ticket's required-evidence gate. - const isReservationEvidenceLocal = (item: { kind?: string; summary?: string; ref?: string | null }): boolean => - /\breserved for (?:build|review) worker\b/i.test(`${item.kind ?? ''} ${item.summary ?? ''} ${item.ref ?? ''}`) - const hasMeaningfulEvidence = (tk: Ticket): boolean => - (tk.evidence ?? []).some((item) => !isReservationEvidenceLocal(item)) - const workerBudget = configuredWorkerBudget - let workerStarts = 0 - const activeTicketWorkerCount = () => roomTickets().filter((ticket) => ticket.runState === 'queued' || ticket.runState === 'running').length - const touchSupervisor = (patch: RoomSupervisorMetadataPatch = {}) => { - job = patchRoomSupervisorJob(job, room, project, { workerBudget, workerStarts, ...patch }) - } - const selectAutomaticReviewSeat = (builderSeat: string): Seat | null => { - const candidates = room.seats - .map((seat, index) => { - if (seat.name === builderSeat) return null - if (!providerForSeat(seat)) return null - const reviewRank = inferSeatLane(seat) === 'review' || seat.roleProfileId === 'reviewer' ? 0 : 1 - return { seat, index, reviewRank } - }) - .filter((item): item is { seat: Seat; index: number; reviewRank: number } => !!item) - .sort((a, b) => a.reviewRank - b.reviewRank || a.index - b.index) - return candidates[0]?.seat ?? null - } - const blockAutomaticReview = (tk: Ticket, builderSeat: string, paths: string[], summary: string) => { - touchSupervisor({ phase: { phase: 'review', status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat: builderSeat, paths, summary } }) - appendRoomSupervisorEvent(room, `Automatic review not started for "${tk.title}": ${summary}`, { - tool: 'auto_review_scheduler', - args: { ticketId: tk.id, phase: 'review', builderSeat, paths }, - }) - } - const scheduleAutomaticReviewAfterBuild = async (tk: Ticket, builderSeat: string, paths: string[]) => { - if (!ticketNeedsReviewAfterBuilder(tk)) return - const reviewSeat = selectAutomaticReviewSeat(builderSeat) - if (!reviewSeat) { - blockAutomaticReview(tk, builderSeat, paths, 'No suitable different room seat is available for review.') - return - } - const blockers: string[] = roomTicketConflictBlockers({ ticket: tk, tickets: roomTickets(), phase: 'review', seat: reviewSeat.name, paths }) - if (blockers.length) { - blockAutomaticReview(tk, reviewSeat.name, paths, blockers.join(' ')) - return - } - const activeWorkers = activeTicketWorkerCount() - if (activeWorkers >= workerBudget.maxActive) { - blockAutomaticReview(tk, reviewSeat.name, paths, `Worker budget busy: ${activeWorkers}/${workerBudget.maxActive} active.`) - return - } - if (workerStarts >= workerBudget.maxStarts) { - blockAutomaticReview(tk, reviewSeat.name, paths, `Worker budget exhausted: ${workerStarts}/${workerBudget.maxStarts} started.`) - return - } - appendRoomSupervisorEvent(room, `Automatic review queued for "${tk.title}" with ${reviewSeat.name}.`, { - tool: 'auto_review_scheduler', - args: { ticketId: tk.id, phase: 'review', builderSeat, reviewSeat: reviewSeat.name, paths }, - }) - try { - await roomTools.start_ticket_work({ id: tk.id, phase: 'review', paths }, reviewSeat.name) - } catch (err: any) { - blockAutomaticReview(tk, reviewSeat.name, paths, String(err?.message ?? err)) - } - } - const emitRoomProgress = (ev: RoomStreamEvent) => { - if (ev.type === 'status') { - room.state = ev.state - room.updatedAt = Date.now() - persistRooms() - touchSupervisor() - } else if (ev.type === 'turn') { - touchSupervisor({ currentTurnSeat: ev.seat }) - } else if (ev.type === 'event') { - room.updatedAt = Date.now() - persistRooms() - touchSupervisor({ lastEventKind: ev.item.kind, lastEventSeat: ev.item.seat, lastEventAt: ev.item.createdAt }) - } else if (ev.type === 'memory') { - room.updatedAt = Date.now() - persistRooms() - touchSupervisor() - } else if (ev.type === 'final' || ev.type === 'done' || ev.type === 'error') { - touchSupervisor() - } - emitRoom(ev) - } - touchSupervisor() - const roomTools: Record Promise> = { - list_tickets: async () => { - const board = roomTickets() - return board.length ? board.map(describeTicketForRoom).join('\n') : 'The board is empty.' - }, - left_to_work: async () => summarizeRoomLeftToWork(roomTickets()), - create_ticket: async (args) => { - const tk = mkTicket(room.projectId, { - roomId: room.id, - title: args?.title || 'Untitled', - body: args?.body || '', - priority: args?.priority, - effort: args?.effort, - type: args?.type || 'task', - status: 'ready', - tags: args?.tags, - risk: args?.risk, - allowedCapabilities: args?.allowedCapabilities, - requiredEvidence: args?.requiredEvidence, - acceptanceCriteria: args?.acceptanceCriteria, - evidence: args?.evidence, - }) - store.tickets.unshift(tk); persistTickets(); emitTicket(tk) - return `Created ticket "${tk.title}" with ${tk.risk ?? 'low'} risk, allowed capabilities ${normalizeTicketCapabilities(tk.allowedCapabilities, ['read']).join(', ')}, and ${tk.requiredEvidence?.length ?? 0} required evidence item(s).` - }, - claim_ticket: async (args, seat) => { - const resolved = resolveTicket(args) - if (resolved.error) return resolved.error - const tk = resolved.ticket - if (!tk) return `No ticket matches "${args?.title ?? args?.id ?? ''}".` - if (tk.assignee && tk.assignee !== seat) return `Already claimed by ${tk.assignee}. Pick another ticket.` - tk.assignee = seat; tk.status = 'in_progress'; tk.updatedAt = Date.now(); persistTickets(); emitTicket(tk) - const required = normalizeStringList(tk.requiredEvidence, []) - const caps = normalizeTicketCapabilities(tk.allowedCapabilities, ['read']).join(', ') - return `You claimed "${tk.title}". Allowed capabilities: ${caps}. Required evidence: ${required.length ? required.join('; ') : 'none'}.` - }, - add_ticket_evidence: async (args, seat) => { - const tk = findTicket(args) - if (!tk) return 'No matching ticket.' - if (tk.assignee && tk.assignee !== seat) return `Only ${tk.assignee} can add evidence to "${tk.title}".` - const evidence = ticketEvidenceFromArgs(args, seat) - if (!evidence.length) return 'No evidence summary was provided.' - tk.assignee = tk.assignee ?? seat - tk.evidence = [...(tk.evidence ?? []), ...evidence] - tk.updatedAt = Date.now() - persistTickets(); emitTicket(tk) - return `Added ${evidence.length} evidence item(s) to "${tk.title}".` - }, - complete_ticket: async (args, seat) => { - const resolved = resolveTicket(args) - if (resolved.error) return resolved.error - const tk = resolved.ticket - if (!tk) return 'No matching ticket.' - if (tk.assignee && tk.assignee !== seat) return `Only ${tk.assignee} can complete "${tk.title}".` - const evidence = ticketEvidenceFromArgs(args, seat) - if (evidence.length) tk.evidence = [...(tk.evidence ?? []), ...evidence] - const required = normalizeStringList(tk.requiredEvidence, []) - // Only MEANINGFUL evidence satisfies the required-evidence gate — reservation/placeholder notes - // appended by start_ticket_work ("Reserved for build/review worker.") must not count, or a - // ticket can be flipped to 'completed' with zero real evidence (the room final gate uses the - // same meaningful filter, so this keeps the per-ticket gate consistent with it). - if (required.length && !hasMeaningfulEvidence(tk)) return `Cannot complete "${tk.title}" until evidence is attached: ${required.join('; ')}.` - tk.assignee = seat; tk.status = 'completed'; tk.updatedAt = Date.now(); persistTickets(); emitTicket(tk) - return `Completed "${tk.title}" with ${tk.evidence?.length ?? 0} evidence item(s).` - }, - start_ticket_work: async (args, seat) => { - const resolved = resolveTicket(args) - if (resolved.error) return resolved.error - const tk = resolved.ticket - if (!tk) return `No ticket matches "${args?.title ?? args?.id ?? ''}".` - const phase = args?.phase === 'review' ? 'review' : 'build' - const declaredPaths: string[] = normalizeStringList(args?.paths, []) - const mergeDecision = typeof args?.mergeDecision === 'string' ? args.mergeDecision.trim() : '' - const blockers: string[] = roomTicketConflictBlockers({ ticket: tk, tickets: roomTickets(), phase, seat, paths: declaredPaths }) - const overlapBlockers = blockers.filter((blocker) => /\boverlaps with\b/i.test(blocker)) - const hardBlockers = blockers.filter((blocker) => !overlapBlockers.includes(blocker)) - const effectiveBlockers = mergeDecision && overlapBlockers.length ? hardBlockers : blockers - if (blockers.length) { - if (effectiveBlockers.length) { - touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: effectiveBlockers.join(' ') } }) - return `Blocked by room supervisor: ${effectiveBlockers.join(' ')}` - } - appendRoomSupervisorEvent(room, `Merge decision accepted for "${tk.title}": ${mergeDecision}`, { - tool: 'merge_decision', - args: { ticketId: tk.id, phase, seat, paths: declaredPaths, blockers: overlapBlockers }, - }) - tk.evidence = [ - ...(tk.evidence ?? []), - { - id: randomUUID(), - kind: 'note', - summary: `Supervisor merge decision: ${mergeDecision}. Waived overlap blocker(s): ${overlapBlockers.join(' ')}`, - ref: declaredPaths[0] ?? null, - createdBy: 'room-supervisor', - createdAt: Date.now(), - }, - ] - } - const activeWorkers = activeTicketWorkerCount() - if (activeWorkers >= workerBudget.maxActive) { - touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker budget busy: ${activeWorkers}/${workerBudget.maxActive} active.` } }) - return `Room worker budget busy: ${activeWorkers}/${workerBudget.maxActive} active ticket workers. Use left_to_work and wait for a worker result.` - } - if (workerStarts >= workerBudget.maxStarts) { - touchSupervisor({ phase: { phase, status: 'blocked', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker budget exhausted: ${workerStarts}/${workerBudget.maxStarts} started.` } }) - return `Room worker budget exhausted: ${workerStarts}/${workerBudget.maxStarts} ticket workers started in this room run.` - } - const seatConfig = room.seats.find((candidate) => candidate.name === seat) - if (!seatConfig) return 'Cannot start worker: room seat is no longer configured.' - // Snapshot before the pre-launch mutation so a failed launch can restore the ticket - // instead of wedging it (runState 'queued' blocks retries via roomTicketConflictBlockers, - // counts against the worker budget, and keeps the final gate open). - const prevAssignee = tk.assignee - const prevStatus = tk.status - workerStarts++ - // Only a BUILD-phase start takes ownership of the ticket. A review-phase start must NOT - // overwrite the builder's assignee with the reviewer — doing so erases the builder's claim and - // makes a later build-phase conflict check (roomTicketConflictBlockers) report the ticket as - // claimed by the reviewer, blocking the original builder from their own ticket. The reviewer's - // identity is tracked separately via the review evidence (createdBy), not tk.assignee. - if (phase === 'build') tk.assignee = seat - tk.status = 'in_progress' - tk.runState = 'queued' - if (declaredPaths.length) { - tk.evidence = [ - ...(tk.evidence ?? []), - ...declaredPaths.map((ref) => ({ id: randomUUID(), kind: 'file' as const, summary: `Reserved for ${phase} worker.`, ref, createdBy: seat, createdAt: Date.now() })), - ] - } - tk.updatedAt = Date.now() - persistTickets(); emitTicket(tk) - touchSupervisor({ phase: { phase, status: 'queued', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: 'Ticket worker queued.' } }) - const knownPaths = ticketFileRefs(tk, declaredPaths) - let workerThreadId: string | null = null - let thread: Thread - try { - thread = await startTicketWork({ - ticketId: tk.id, - opts: { phase, providerId: seatConfig.providerId, providerAccountId: seatConfig.providerAccountId ?? null, model: seatConfig.model }, - source: { - roomId: room.id, - seat, - onSettled: ({ codeChanged, testsPassed, failed, jobId }) => { - if (codeChanged) lastCodeChangeAt = Date.now() - if (testsPassed) greenEvidenceAt = Date.now() - touchSupervisor({ - phase: { - phase, - status: tk.status === 'needs_clarification' ? 'failed' : 'completed', - ticketId: tk.id, - ticketTitle: tk.title, - seat, - threadId: workerThreadId, - jobId: jobId ?? activeJob('ticket', tk.id)?.id ?? null, - paths: knownPaths, - summary: tk.status === 'needs_clarification' ? 'Ticket worker needs clarification.' : 'Ticket worker finished.', - }, - }) - if (phase === 'build' && !failed) void scheduleAutomaticReviewAfterBuild(tk, seat, knownPaths) - }, - }, - }) - } catch (launchError: any) { - // Launch failed: unwind the pre-launch mutation so the ticket is retryable instead - // of wedged as 'queued' (which blocks retries, burns budget, and holds the gate). - workerStarts-- - tk.runState = null - tk.status = prevStatus - tk.assignee = prevAssignee - tk.updatedAt = Date.now() - persistTickets(); emitTicket(tk) - touchSupervisor({ phase: { phase, status: 'failed', ticketId: tk.id, ticketTitle: tk.title, seat, paths: declaredPaths, summary: `Worker launch failed: ${launchError?.message ?? launchError}` } }) - return `Cannot start worker: launch failed: ${launchError?.message ?? launchError}` - } - workerThreadId = thread.id - touchSupervisor({ - phase: { - phase, - status: 'running', - ticketId: tk.id, - ticketTitle: tk.title, - seat, - threadId: thread.id, - jobId: activeJob('ticket', tk.id)?.id ?? null, - paths: knownPaths, - summary: 'Ticket worker running.', - }, - }) - return `Room Supervisor started ${phase} worker thread ${thread.id} for "${tk.title}"${knownPaths.length ? ` on ${knownPaths.slice(0, 4).join(', ')}` : ''}.` - }, - delegate: async (args, seat) => { - const s = room.seats.find((x) => x.name === seat) - if (!s) return 'Cannot delegate: seat misconfigured.' - // Optional cross-model route: targetSeat adopts that seat's provider/account/model; - // explicit providerId/accountId/model override it; absent fields inherit this seat. - // A local-only project may not delegate out to a cloud provider (same guard the - // thread runtime and room seat config enforce). - const routed = resolveDelegationRoute(store.settings.providers, { - providerId: s.providerId, - providerAccountId: s.providerAccountId, - model: s.model, - }, args ?? {}, room.seats, roomProject.localOnly === true) - if (!routed.route) return `Cannot delegate: ${routed.error}.` - const routeAccountId = routed.route.providerAccountId ?? null - const routeProvider = store.settings.providers.find((p) => p.id === routed.route.providerId) - const prov = routeProvider ? runtimeProvider(routeProvider, routed.route.providerAccountId) : undefined - if (!prov) return s.providerId === routed.route.providerId ? 'Cannot delegate: seat misconfigured.' : `Cannot delegate: provider "${routed.route.providerId}" is not configured.` - const task = String(args?.task || '').trim() || 'Focused room subtask' - const name = typeof args?.name === 'string' ? args.name.trim() : '' - const runId = `subagent-${randomUUID()}` - const created = createSubAgentFromLaunch(store.subAgents, { - source: 'room_delegate', - parent: parentForRoomSeat(room, s), - task, - name, - providerId: routed.route.providerId, - providerAccountId: routeAccountId, - model: routed.route.model, - runId, - cwd: roomWorkspace, - }) - store.subAgents = created.agents - persistSubAgentsSafe() - if (args && typeof args === 'object') { - args.id = created.agent.id - args.name = created.agent.name - args.task = task - args.parentSeat = seat - args.providerId = routed.route.providerId - args.providerAccountId = routeAccountId - args.model = routed.route.model - if (routed.notice) args.notice = routed.notice - args.status = 'running' - } - const started = startSubAgent(store.subAgents, created.agent.id, runId) - store.subAgents = started.agents - persistSubAgentsSafe() - const launched = await runReadOnlySubAgent(created.agent, prov, routed.route.model, { - task, - parentLabel: `room seat "${seat}" in room "${room.name}"`, - cwd: roomWorkspace, - projectId: room.projectId, - providerAccountId: routeAccountId, - signal: controller.signal, - project: roomProject, - maxSteps: 10, - maxWallMs: 150_000, - }) - if (args && typeof args === 'object') { - args.status = launched.agent.status - args.result = launched.agent.result - args.error = launched.agent.error - } - return routed.notice ? `${routed.notice}\n${launched.output}` : launched.output - }, - // Room tools are read-only by default. Mutating tools need a future room-level approval UI. - // memory_write is room state (the shared scratchpad), not workspace mutation, so it is allowed. - memory_write: async (args, seat) => { - const name = typeof args?.name === 'string' ? args.name.trim() : '' - const content = typeof args?.content === 'string' ? args.content.trim() : '' - if (!name || !content) return 'memory_write needs a "name" (decisions, plan, blockers, or any label) and "content".' - if (!room.sharedMemory) room.sharedMemory = createSharedMemory() - const mode = args?.mode === 'append' || args?.mode === 'append-bullet' ? args.mode : 'replace' - const expectedRevision = typeof args?.expectedRevision === 'number' ? args.expectedRevision : undefined - const result = writeBlock(room.sharedMemory, { name, content, author: seat, mode, expectedRevision }) - if (!result.ok) { - if (result.reason === 'conflict') return `Memory conflict on "${name}": current revision is ${result.currentRevision}. Re-read the block and retry.` - if (result.reason === 'content-too-large') return `Memory block "${name}" is too large: content is capped at ${MEMORY_MAX_BLOCK_CHARS} characters. Summarize it and retry.` - if (result.reason === 'block-limit') return `Shared memory is full (${MEMORY_MAX_BLOCKS} blocks). Update an existing block instead of adding a new one.` - return 'Memory write needs a non-empty name.' - } - room.updatedAt = Date.now() - persistRooms() - // Live push so the renderer reflects the write without waiting for a full snapshot. - if (result.changed) publishRemote?.({ kind: 'room', data: room }) - return result.changed - ? `Memory "${result.block.name}" updated (rev ${result.block.revision}).\n${renderSharedMemory(room.sharedMemory)}` - : `Memory "${result.block.name}" already says that (rev ${result.block.revision}).` - }, - read_file: async (args) => { const r = await executeTool('read_file', args, { cwd: roomWorkspace }); return r.output.slice(0, 4000) }, - list_dir: async (args) => { const r = await executeTool('list_dir', args, { cwd: roomWorkspace }); return r.output.slice(0, 2000) }, - search: async (args) => { const r = await executeTool('search', args, { cwd: roomWorkspace }); return r.output.slice(0, 2000) }, - write_file: async (args) => { - await auditEvent('room.tool_blocked', { roomId: room.id, tool: 'write_file', path: auditPreview(args?.path) }) - return 'Blocked: room agents are read-only until a room-level approval gate is available. Create/claim a ticket and run the work in an approved thread.' - }, - edit_file: async (args) => { - await auditEvent('room.tool_blocked', { roomId: room.id, tool: 'edit_file', path: auditPreview(args?.path) }) - return 'Blocked: room agents are read-only until a room-level approval gate is available. Create/claim a ticket and run the work in an approved thread.' - }, - run_command: async (args) => { - await auditEvent('room.tool_blocked', { roomId: room.id, tool: 'run_command', command: auditPreview(args?.command) }) - return 'Blocked: room agents cannot run shell commands unattended. Ask the user to run an approved thread or terminal command.' - }, - } - - // Supervisor mode: an ASSIGN auto-starts the addressed seat's ticket worker. - // The ticket is resolved from the ASSIGN text (a verbatim ticket title inside the - // text wins; otherwise the text minus the seat name is used as a title query), then - // routed through the standard start_ticket_work path so budget/conflict gates apply. - const autoStartAssignedTicket = async ({ target, text }: { seat: string; target: string; text: string }): Promise => { - const board = roomTickets().filter((t) => t.status !== 'completed') - const hay = text.toLowerCase() - const inText = board.filter((t) => t.title.trim() && hay.includes(t.title.trim().toLowerCase())) - let tk = inText.length === 1 ? inText[0] : undefined - if (!tk && inText.length > 1) { - const matches = inText.slice(0, 4).map((t) => `"${t.title}"`).join(', ') - return `ASSIGN auto-start skipped: the text matches ${inText.length} open tickets (${matches}). Name one verbatim to start it.` - } - if (!tk && inText.length === 0) { - const remainder = text.replace(new RegExp(`\\b${target.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\b`, 'ig'), '').trim() - const resolved = resolveTicket({ title: remainder }) - if (resolved.error) return `ASSIGN auto-start skipped: ${resolved.error}` - tk = resolved.ticket - } - if (!tk) return `ASSIGN to ${target} noted, but no open ticket title matched. Create the ticket with create_ticket first, then assign it.` - if (tk.assignee && tk.assignee !== target) return `ASSIGN auto-start skipped: "${tk.title}" is already claimed by ${tk.assignee}.` - return roomTools.start_ticket_work({ id: tk.id, phase: 'build' }, target) - } - - runRoom({ - room, project: roomProject, providers: store.settings.providers, problem: cleanProblem, - temperature: store.settings.temperature, reasoningEffort: store.settings.reasoningEffort, - emit: emitRoomProgress, signal: controller.signal, tools: roomTools, - onAssign: autoStartAssignedTicket, - providerForSeat, - recoverSeatModel: async (seat, error) => { - const latestBaseProvider = store.settings.providers.find((p) => p.id === seat.providerId) - if (!latestBaseProvider) return null - const currentAccountId = seat.providerAccountId ?? null - const routed = modelRouter.routeAfterError({ - role: 'room_seat', - provider: latestBaseProvider, - accountId: currentAccountId, - model: seat.model, - error, - allowFailover: modelRouteAutoFailoverEnabled(latestBaseProvider, currentAccountId), - localOnly: roomProject.localOnly === true, - contextLimit: effectiveContextLimit(latestBaseProvider, seat.model, currentAccountId), - reasoningEffort: store.settings.reasoningEffort, - budget: room.workerBudget?.maxActive ?? null, - source: 'room_seat_recovery', - }) - if (routed.signal) { - for (const audit of routed.audit) { - await auditScopedModelRoute('room', audit, routed.signal, { - roomId: room.id, - seatId: seat.id, - seatName: seat.name, - jobId: job?.id ?? null, - missionId: supervisorMission.id, - }) - } - } - if (!routed.signal || !routed.route.selected || routed.route.selectedAccountId === currentAccountId) return null - const providerAccountId = routed.route.selectedAccountId - const provider = await runtimeProviderWithFreshModels(latestBaseProvider, providerAccountId) - assertProviderEndpoint(provider) - const liveSeat = room.seats.find((candidate) => candidate.id === seat.id) - if (liveSeat) { - liveSeat.providerId = latestBaseProvider.id - liveSeat.providerAccountId = providerAccountId - liveSeat.model = seat.model - } - room.updatedAt = Date.now() - persistRooms() - const failoverText = modelRouteFailoverText(latestBaseProvider, routed.route.audit, routed.signal) - const notice = `${failoverText}\n${roomRouteHandoff(room, seat, failoverText)}` - job = patchJob(job, { - metadata: { - modelRoute: { - action: 'room_failover', - seatId: seat.id, - seatName: seat.name, - providerId: latestBaseProvider.id, - model: seat.model, - preferredProviderAccountId: currentAccountId, - failoverProviderAccountId: providerAccountId, - resetPolicy: modelRouteResetPolicy(latestBaseProvider, currentAccountId), - resetAt: routed.signal.resetAt, - reason: routed.route.audit.reason, - }, - }, - }) - touchSupervisor() - return { provider, providerAccountId, model: seat.model, notice } - }, - contextLimitForSeat: (seat) => { - if (!store.settings.autoCompact) return 0 - const provider = providerForSeat(seat) - if (!provider) return 0 - // Task #41: in a mixed-model room every seat compacts to the lowest seat's - // limit so no model silently overflows. Fall back to this seat's own limit - // if the floor can't be computed (e.g. another seat is misconfigured). - const floor = roomContextLimit( - room.seats - .map((s) => ({ provider: providerForSeat(s), model: s.model })) - .filter((entry): entry is { provider: Provider; model: string } => !!entry.provider), - { - cloudLimit: store.settings.contextLimit, - localLimit: store.settings.localContextLimit, - contextLimitExplicit: store.settings.contextLimitExplicit, - localContextLimitExplicit: store.settings.localContextLimitExplicit, - override: store.settings.contextLimitOverride, - engineModelProfiles: store.settings.engineModelProfiles, - }, - ) - return floor > 0 ? floor : effectiveContextLimit(provider, seat.model) - }, - finalGate: () => { - return roomFinalGateBlockers({ tickets: roomTickets(), lastCodeChangeAt, greenEvidenceAt }) - }, - }) - .catch((err) => emitRoomProgress({ roomId, type: 'error', message: String(err?.message ?? err), fatal: true })) - .finally(() => { - clearTimeout(timeout) - roomAborters.delete(roomId) - runLease.release() - const failed = room.state === 'failed' || room.state === 'error' - const parked = !controller.signal.aborted && !failed && parkRoomIfWorkRemains(job, room, project) - if (!parked) { - touchSupervisor({ currentTurnSeat: null }) - const outcome = controller.signal.aborted ? 'paused' : failed ? 'failed' : 'completed' - const reason = failed ? 'Room ended with an error.' : controller.signal.aborted ? 'Room paused after the active run stopped.' : undefined - finishRoomSupervisorMission(job, outcome, reason) - finishJob(job, outcome, reason) - } - room.updatedAt = Date.now() - persistRooms() - }) - - startupComplete = true - return { ok: true, room } - } finally { - if (!startupComplete) { - clearTimeout(timeout) - if (roomAborters.get(roomId) === controller) roomAborters.delete(roomId) - runLease.release() - } - } -} + const { startRoomRun } = createRoomRunRuntime(ctx) handle('room:cancel', async (_e, roomId: string) => cancelRoomRun(roomId)) handle('room:start', async (_e, { roomId, problem, attachments }: { roomId: string; problem: string; attachments?: Attachment[] }) => startRoomRun(roomId, problem, attachments)) diff --git a/app/electron/main/host/workspace-startup-policy.ts b/app/electron/main/host/workspace-startup-policy.ts new file mode 100644 index 00000000000..f1ef24fd0b8 --- /dev/null +++ b/app/electron/main/host/workspace-startup-policy.ts @@ -0,0 +1,36 @@ +import type { Project, Room } from '../../agent/types' +import type { WorkspaceMutationGuard, WorkspaceMutationLease } from './workspace-mutation-guard' + +export function reserveRoomStartup( + roomId: string, + roomAborters: Map, + guard: Pick, + workspaceKeys: Iterable, +): { controller: AbortController; runLease: WorkspaceMutationLease } | null { + if (roomAborters.has(roomId)) return null + const runLease = guard.reserveStart({ workspaceKeys }) + const controller = new AbortController() + roomAborters.set(roomId, controller) + return { controller, runLease } +} + +export function assertLocalTicketGenerationProject(project: Pick): void { + if (project.workspace?.kind === 'ssh') { + throw new Error('Ticket generation for SSH projects is unavailable until the planner can run on the remote workspace.') + } +} + +export function requireActiveRoomForCancel(rooms: readonly Room[], roomId: string): Room { + const room = rooms.find((candidate) => candidate.id === roomId) + if (!room) throw new Error('Room not found') + if (room.archivedAt) throw new Error('Restore this archived room before cancelling it.') + return room +} + +export function assertRecordMetadataNotPatched(patch: object, additionalHostFields: readonly string[] = []): void { + for (const field of ['id', 'createdAt', 'updatedAt', ...additionalHostFields]) { + if (Object.prototype.hasOwnProperty.call(patch, field)) { + throw new Error(`${field} is host-owned and cannot be changed through update endpoints.`) + } + } +} diff --git a/app/shared/benchmark-suites.json b/app/shared/benchmark-suites.json new file mode 100644 index 00000000000..8eeb578719d --- /dev/null +++ b/app/shared/benchmark-suites.json @@ -0,0 +1,4 @@ +{ + "community-v2": "51136f5d6775b2ff427834c6b1038b584de27e0a267cfc088ff2694ea069dcdc", + "community-v1": "9bb717da00666b90b4006174abd9ed46108affc37456b43c64a224a9c938d5be" +} diff --git a/app/shared/bot-reasoning.ts b/app/shared/bot-reasoning.ts index ac8e5c8bf1e..7a2f26c4599 100644 --- a/app/shared/bot-reasoning.ts +++ b/app/shared/bot-reasoning.ts @@ -1,12 +1,9 @@ import type { ReasoningEffortSetting, Thread } from '../electron/agent/types' - -const efforts = new Set([ - 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultrathink', 'ultracode', 'dynamic', '512', -]) +import { isReasoningEffortSetting } from './reasoning-effort' export function normalizeBotReasoningEffort(value: unknown): ReasoningEffortSetting | undefined { if (value === undefined) return undefined - if (typeof value !== 'string' || !efforts.has(value as ReasoningEffortSetting)) { + if (!isReasoningEffortSetting(value)) { throw new Error('Invalid bot reasoning effort; choose an available effort level.') } return value as ReasoningEffortSetting diff --git a/app/shared/model-benchmark.ts b/app/shared/model-benchmark.ts index 68f0946cd97..8668e970d5d 100644 --- a/app/shared/model-benchmark.ts +++ b/app/shared/model-benchmark.ts @@ -1,4 +1,10 @@ /** Renderer-safe local benchmark contracts. No process paths, credentials or generated text. */ +import suites from './benchmark-suites.json' + +/** The engine's benchmark suites by id and manifest sha256: community-v2 now, community-v1 from older engines. */ +export type ModelBenchmarkSuiteId = 'community-v2' | 'community-v1' +export const BENCHMARK_SUITES: Readonly> = suites +export const BENCHMARK_SUITE_CURRENT: ModelBenchmarkSuiteId = 'community-v2' export type ModelBenchmarkState = 'preparing' | 'running' | 'restoring' | 'complete' | 'cancelled' | 'failed' export type ModelBenchmarkFixture = 'code' | 'chat' export type ModelBenchmarkSampleStatus = 'ok' | 'early_eos' | 'error' | 'unmeasured' @@ -69,10 +75,10 @@ export interface ModelBenchmarkSample { token_sha: string | null error_code: string | null } -/** Exact community-v1 export schema. Supplemental GUI state stays outside this object. */ +/** Exact community benchmark export schema (BENCHMARK_SUITES). Supplemental GUI state stays outside this object. */ export interface ModelBenchmarkReceipt { schema_version: 1 - suite: { id: 'community-v1'; sha256: string } + suite: { id: ModelBenchmarkSuiteId; sha256: string } run_id: string created_at: string runtime: { tensorfold_version: string; backend: 'mlx' | 'cuda' | 'rocm'; python_version: string; platform: 'macos' | 'linux'; dependencies: Record } diff --git a/app/shared/reasoning-effort.ts b/app/shared/reasoning-effort.ts new file mode 100644 index 00000000000..5d9670146e1 --- /dev/null +++ b/app/shared/reasoning-effort.ts @@ -0,0 +1,19 @@ +import type { ReasoningEffortSetting } from '../electron/agent/types' + +const efforts = new Set([ + 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultrathink', 'ultracode', 'dynamic', '512', +]) + +export function isReasoningEffortSetting(value: unknown): value is ReasoningEffortSetting { + return typeof value === 'string' && efforts.has(value as ReasoningEffortSetting) +} + +export function captureAgentReasoningEffort( + agent: { reasoningEffort?: ReasoningEffortSetting } | undefined, + fallback: T, +): ReasoningEffortSetting | T { + const value = agent?.reasoningEffort + if (value === undefined) return fallback + if (!isReasoningEffortSetting(value)) throw new Error('Invalid agent reasoning effort; choose an available effort level.') + return value +} diff --git a/app/src/components/ReasoningEffortSelect.tsx b/app/src/components/ReasoningEffortSelect.tsx new file mode 100644 index 00000000000..6c6d926d763 --- /dev/null +++ b/app/src/components/ReasoningEffortSelect.tsx @@ -0,0 +1,30 @@ +import { useAuthoredText } from '../lib/preferences/useAuthoredText' +import { effortDisplayLabel, providerEffortOptions } from '../lib/provider-model-metadata' +import type { Provider, ReasoningEffortSetting } from '../lib/types' + +export function effortForModel(value: ReasoningEffortSetting | undefined, provider?: Provider, model?: string): ReasoningEffortSetting | undefined { + if (value === undefined) return undefined + const options = providerEffortOptions(model?.trim() ? provider : undefined, model) + return options.some((option) => option.value === value) ? value : options.find((option) => option.isDefault)?.value ?? options[0]?.value +} + +export function ReasoningEffortSelect({ provider, model, value, defaultEffort, disabled = false, onChange }: { + provider?: Provider + model?: string + value?: ReasoningEffortSetting + disabled?: boolean + defaultEffort?: ReasoningEffortSetting + onChange(value: ReasoningEffortSetting | undefined): void +}) { + const tx = useAuthoredText() + const options = providerEffortOptions(model?.trim() ? provider : undefined, model) + const unavailable = value !== undefined && !options.some((option) => option.value === value) + return +} diff --git a/app/src/components/Thread.tsx b/app/src/components/Thread.tsx index dd8066ff1d8..0ddcd77b899 100644 --- a/app/src/components/Thread.tsx +++ b/app/src/components/Thread.tsx @@ -32,6 +32,7 @@ import { TurnOutcome } from './turn/TurnOutcome' import { QuestionCard } from './user-question/QuestionCard' import { BotChatContext } from './bots/BotChatContext' import { BotComposerSettings } from './bots/BotComposerSettings' +import { activeRoomWorkerEffort } from '../lib/room-worker-effort' import { BrandMark } from './BrandMark' import { isBuiltInProvider, isExternalProvider } from '../../shared/provider-trust' import { useEngineStatus } from '../lib/engine' @@ -42,6 +43,7 @@ const BUSY_STATES = ['thinking', 'streaming', 'tool', 'awaiting'] export function ThreadView({ threadId, simpleLayout = false }: { threadId: string; simpleLayout?: boolean }) { const tx = useAuthoredText() const thread = useStore((s) => s.threads.find((t) => t.id === threadId)) + const roomWorkerEffort = useStore((s) => activeRoomWorkerEffort(s.tickets, threadId)) const st = useStore((s) => s.status[threadId]) const approvals = useStore((s) => s.approvals[threadId]) const durableJobs = useStore((s) => s.jobs) @@ -284,7 +286,7 @@ export function ThreadView({ threadId, simpleLayout = false }: { threadId: strin onAllow={() => approve(threadId, pendingApproval.callId, 'allow')} /> )} - + diff --git a/app/src/components/bots/BotComposerSettings.test.tsx b/app/src/components/bots/BotComposerSettings.test.tsx index 472b124aacd..2dddba1e72b 100644 --- a/app/src/components/bots/BotComposerSettings.test.tsx +++ b/app/src/components/bots/BotComposerSettings.test.tsx @@ -55,7 +55,7 @@ function productionElement(file: string, tag: string, wrapper?: string) { } const renderThreadComposer = productionElement('../Thread.tsx', 'Composer', 'BotComposerSettings') const provider: Provider = { id: 'fixture', name: 'Fixture', kind: 'local', baseUrl: 'http://127.0.0.1', apiKey: '', models: ['fixture'] } -function composer(bot: BotThreadConfig | undefined, effort: ReasoningEffortSetting) { +function composer(bot: BotThreadConfig | undefined, effort: ReasoningEffortSetting, roomWorkerEffort?: ReasoningEffortSetting) { const thread = { id: 'captured-bot-fixture', bot } function Composer() { return React.createElement(picker.ModelPickerMenu, { @@ -65,10 +65,10 @@ function composer(bot: BotThreadConfig | undefined, effort: ReasoningEffortSetti detail: metadata.effortDisplayLabel(provider, 'fixture', effort), disabled: !!bot, }) } - return renderThreadComposer({ thread, Composer, BotComposerSettings: context.BotComposerSettings }) + return renderThreadComposer({ thread, roomWorkerEffort, Composer, BotComposerSettings: context.BotComposerSettings }) } const bot = (reasoningEffort?: ReasoningEffortSetting) => ({ reasoningEffort } as BotThreadConfig) -const markup = (captured: BotThreadConfig | undefined, global: ReasoningEffortSetting) => renderToStaticMarkup(composer(captured, global)) +const markup = (captured: BotThreadConfig | undefined, global: ReasoningEffortSetting, room?: ReasoningEffortSetting) => renderToStaticMarkup(composer(captured, global, room)) assert.match(markup(bot('low'), 'high'), />Low<\/span>/, 'the real thread/provider/picker wiring displays captured Low, not global High') assert.match(markup(bot('high'), 'low'), />High<\/span>/, 'captured High remains independent of global Low') assert.match(markup(bot(), 'high'), />High<\/span>/, 'a legacy bot without captured effort displays its global fallback') @@ -79,4 +79,7 @@ assert.match(markup(captured, 'medium'), />Low<\/span>/, 'changing the app setti const siblings = renderToStaticMarkup(React.createElement(React.Fragment, null, composer(captured, 'high'), composer(undefined, 'high'))) assert.equal((siblings.match(/>Low<\/span>/g) ?? []).length, 1) assert.equal((siblings.match(/>High<\/span>/g) ?? []).length, 1, 'a captured value cannot leak into an adjacent ordinary composer') +assert.match(markup(undefined, 'high', 'low'), />Low<\/span>/, 'the real worker composer displays captured Low instead of app High') +assert.match(markup(undefined, 'low', 'high'), />High<\/span>/, 'captured Room effort stays independent from app Low') +assert.match(markup(undefined, 'high'), />High<\/span>/, 'a completed worker returns to the ordinary app fallback') console.log('Bot composer checks passed: captured/legacy/global badges, actual parent wiring and sibling isolation.') diff --git a/app/src/components/bots/BotComposerSettings.tsx b/app/src/components/bots/BotComposerSettings.tsx index 0773efefeaa..bb77ae0eb8a 100644 --- a/app/src/components/bots/BotComposerSettings.tsx +++ b/app/src/components/bots/BotComposerSettings.tsx @@ -1,9 +1,10 @@ import { createContext, useContext, type ReactNode } from 'react' import type { BotThreadConfig } from '../../lib/types' -const BotComposerContext = createContext(undefined) +type CapturedComposerSettings = Pick +const BotComposerContext = createContext(undefined) -export function BotComposerSettings({ bot, children }: { bot?: BotThreadConfig; children: ReactNode }) { +export function BotComposerSettings({ bot, children }: { bot?: CapturedComposerSettings; children: ReactNode }) { return {children} } diff --git a/app/src/components/bots/BotReasoningEffort.test.tsx b/app/src/components/bots/BotReasoningEffort.test.tsx index 511d986e5bd..c1e66982748 100644 --- a/app/src/components/bots/BotReasoningEffort.test.tsx +++ b/app/src/components/bots/BotReasoningEffort.test.tsx @@ -7,18 +7,23 @@ import ts from 'typescript' import * as metadata from '../../lib/provider-model-metadata' import type { Provider } from '../../lib/types' -const source = readFileSync(new URL('./BotReasoningEffort.tsx', import.meta.url), 'utf8') -const output = ts.transpileModule(source, { compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS, jsx: ts.JsxEmit.ReactJSX } }).outputText const jsx = (type: any, props: any, key: any) => React.createElement(type, { ...props, ...(key == null ? {} : { key }) }) -const imports: Record = { 'react/jsx-runtime': { jsx, jsxs: jsx }, '../../lib/provider-model-metadata': metadata } -const module = { exports: {} as any } -new Function('require', 'module', 'exports', output)((id: string) => { - const reviewed = reviewedLanguageImport(id, imports) - if (reviewed.matched) return reviewed.value - assert.ok(id in imports, `Reviewed component import ${id}`) - return imports[id] -}, module, module.exports) -const { BotReasoningEffort, effortForBotModel } = module.exports +function load(file: string, imports: Record) { + const source = readFileSync(new URL(file, import.meta.url), 'utf8') + const output = ts.transpileModule(source, { compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS, jsx: ts.JsxEmit.ReactJSX } }).outputText + const module = { exports: {} as any } + new Function('require', 'module', 'exports', output)((id: string) => { + const reviewed = reviewedLanguageImport(id, imports) + if (reviewed.matched) return reviewed.value + assert.ok(id in imports, `Reviewed component import ${id}`) + return imports[id] + }, module, module.exports) + return module.exports +} +const control = load('../ReasoningEffortSelect.tsx', { + 'react/jsx-runtime': { jsx, jsxs: jsx }, '../lib/provider-model-metadata': metadata, +}) +const { BotReasoningEffort, effortForBotModel } = load('./BotReasoningEffort.tsx', { '../ReasoningEffortSelect': control }) const gemini: Provider = { id: 'gemini', name: 'Gemini API', kind: 'cloud', baseUrl: 'https://model.example.test/v1', apiKey: '', models: ['gemini-2.5-pro', 'gemini-3-pro'] } const choices = (provider?: Provider, model?: string) => { const tree = BotReasoningEffort({ provider, model, value: 'low', onChange() {} }) @@ -42,4 +47,5 @@ select.props.onChange({ target: { value: 'low' } }) assert.equal(selected, 'low', 'changing the rendered control updates the stored bot parameter') select.props.onChange({ target: { value: '' } }) assert.equal(selected, undefined) +assert.match(renderToStaticMarkup(BotReasoningEffort({ disabled: true, onChange() {} })), / onChange(event.target.value ? event.target.value as ReasoningEffortSetting : undefined)} className="h-10 w-full min-w-0 rounded-lg border border-line bg-card-2 px-2 text-[13px] text-ink"> - - {unavailable && } - {options.map((option) => )} - - -} +export { ReasoningEffortSelect as BotReasoningEffort, effortForModel as effortForBotModel } from '../ReasoningEffortSelect' diff --git a/app/src/components/models/ModelDetailsDrawer.tsx b/app/src/components/models/ModelDetailsDrawer.tsx index 8cb9d0a5e19..cd8ad9efc81 100644 --- a/app/src/components/models/ModelDetailsDrawer.tsx +++ b/app/src/components/models/ModelDetailsDrawer.tsx @@ -73,7 +73,7 @@ export function ModelDetailsDrawer({ model, status, blocked, onClose, onBenchmar
{tx("Source and technical details")}
{model.localPath && }

{tx("Quantization is not reported separately by this engine; check the model identifier and its source details.")}

- + } function Fact({ label, value }: { label: string; value: string }) { return
{label}
{value}
} diff --git a/app/src/components/models/benchmark/BenchmarkResults.tsx b/app/src/components/models/benchmark/BenchmarkResults.tsx index 4b63be5367c..218e746d6dd 100644 --- a/app/src/components/models/benchmark/BenchmarkResults.tsx +++ b/app/src/components/models/benchmark/BenchmarkResults.tsx @@ -13,7 +13,7 @@ export function BenchmarkResults({ run }: { run: ModelBenchmarkSnapshot }) { return

{run.model}

{run.serial ? tx("Serial baseline") : tx("Standard run")} · {new Date(run.startedAt).toLocaleString(currentIntlLocale())}

{stateLabel}

{active && <>

{reported ? tx("{value0} of {value1} requests reported", { value0: count, value1: run.progress.totalRequests }) : tx("Request counts have not been reported yet; progress is indeterminate.")}{run.progress.phase ? run.progress.phase === 'warmup' ? tx(' · Warm-up') : run.progress.phase === 'measured' ? tx(' · Measured request') : tx(' · Model loading') : ''}{run.progress.fixture ? ` · ${run.progress.fixture}` : ''}{run.progress.temperature !== null ? tx(" · Temperature {value0}", { value0: run.progress.temperature }) : ''}

} - {!active &&

{run.protocolComplete ? tx("All community-v1 cells meet the complete protocol.") : tx("The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.")}

} + {!active &&

{run.protocolComplete ? tx("All community-v2 cells meet the complete protocol.") : tx("The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.")}

}
{run.error &&

{{run.error}}

}
{run.cells.map((cell) =>

{benchmarkCellLabel(cell)}

{cell.complete ? tx("Complete") : active && cell.attempted === 0 ? tx("Not reported yet") : tx("Incomplete")}

{cell.successful} {tx("of ")}{cell.expected} {tx("valid measured samples")}{cell.failedWarmups ? tx(" · {value0} failed warm-up", { value0: cell.failedWarmups }) : ''}

{tx("Median delivery speed")}
{benchmarkMetric(cell.deliveryTokensPerSecond, cell.complete, 'tokens/s')}
{benchmarkRange(cell.deliveryTokensPerSecond, cell.complete, 'tokens/s') &&

{tx("Observed range ")}{benchmarkRange(cell.deliveryTokensPerSecond, cell.complete, 'tokens/s')}

}
{tx("Median first-text latency")}
{benchmarkMetric(cell.firstTextSeconds, cell.complete, 's')}
{!cell.complete &&

{cell.earlyEos ? tx("Early endings: {count}. ", { count: cell.earlyEos }) : ''}{cell.errors ? tx("Errors: {count}. ", { count: cell.errors }) : ''}{cell.unmeasured ? tx("{value0} unmeasured. ", { value0: cell.unmeasured }) : ''}{tx("Medians require all five valid samples and a successful warm-up.")}

}
{tx("Additional timings")}
)}
diff --git a/app/src/components/models/benchmark/ModelBenchmarkDrawer.tsx b/app/src/components/models/benchmark/ModelBenchmarkDrawer.tsx index 3e272b36034..2b08d6b301e 100644 --- a/app/src/components/models/benchmark/ModelBenchmarkDrawer.tsx +++ b/app/src/components/models/benchmark/ModelBenchmarkDrawer.tsx @@ -29,7 +29,7 @@ export function ModelBenchmarkDrawer({ models, activeModel, preferredModel, bloc if (blockedReason || state.loading || state.error || running || acting || !valid) return void controller.start({ id: `benchmark_${crypto.randomUUID().replaceAll('-', '')}`, model, serial }) } - return {running ? : }}> + return {running ? : }}>

{tx("Uses fixed code and chat fixtures, a 4,096-token context and 256 output tokens; 24 requests include four warm-ups and 20 measured samples at temperatures 0 and 1.")}

{tx("This temporarily reserves an idle app-managed engine, pauses its server and restores the previous model and profile afterward; finish chat/API work first, and no models are downloaded automatically.")}

{blockedReason && !running &&

{blockedReason}

} diff --git a/app/src/components/models/benchmark/benchmark-display.ts b/app/src/components/models/benchmark/benchmark-display.ts index e12ae1fdef8..4c6d10000cd 100644 --- a/app/src/components/models/benchmark/benchmark-display.ts +++ b/app/src/components/models/benchmark/benchmark-display.ts @@ -1,5 +1,6 @@ import type { EngineInstalledModel } from '../../../lib/types' import type { ModelBenchmarkCell, ModelBenchmarkSnapshot, ModelBenchmarkSpread } from '../../../../shared/model-benchmark' +import { BENCHMARK_SUITE_CURRENT } from '../../../../shared/model-benchmark' export const benchmarkActive = (run: ModelBenchmarkSnapshot | null) => !!run && ['preparing', 'running', 'restoring'].includes(run.state) export const cachedBenchmarkModels = (models: EngineInstalledModel[]) => models.filter((model) => model.fitsMemory === true && model.source !== 'library' && !model.repo.startsWith('TensorFoldLocal/') && /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(model.repo)) @@ -15,7 +16,7 @@ export function benchmarkRange(value: ModelBenchmarkSpread | null, complete: boo } export function benchmarkCellLabel(cell: ModelBenchmarkCell): string { return `${cell.fixture === 'code' ? 'Code' : 'Chat'} · Temperature ${cell.temperature}` } export function benchmarkBasicSummary(run: ModelBenchmarkSnapshot): string { - return [`TensorFold · community-v1`, `Model: ${run.model}`, `Mode: ${run.serial ? 'Serial baseline' : 'Standard'}`, `State: ${run.state}; complete protocol: ${run.protocolComplete ? 'yes' : 'no'}`, + return [`TensorFold · ${BENCHMARK_SUITE_CURRENT}`, `Model: ${run.model}`, `Mode: ${run.serial ? 'Serial baseline' : 'Standard'}`, `State: ${run.state}; complete protocol: ${run.protocolComplete ? 'yes' : 'no'}`, ...run.cells.map((cell) => `${benchmarkCellLabel(cell)}: ${cell.complete ? `median delivery ${benchmarkMetric(cell.deliveryTokensPerSecond, true, 'tokens/s')}; first text ${benchmarkMetric(cell.firstTextSeconds, true, 's')}` : `incomplete, ${cell.successful}/${cell.expected} valid samples`}`), 'Measured speed is not a quality ranking.'].join('\n') } diff --git a/app/src/components/models/benchmark/useModelBenchmark.test.ts b/app/src/components/models/benchmark/useModelBenchmark.test.ts index ed1dee83562..eefa55446fc 100644 --- a/app/src/components/models/benchmark/useModelBenchmark.test.ts +++ b/app/src/components/models/benchmark/useModelBenchmark.test.ts @@ -48,7 +48,7 @@ try { assert.equal(timers.size, 0, 'terminal status ends the polling loop') await hook.controller.export(); await hook.controller.copy() assert.deepEqual(calls.find((call) => call[0] === 'export'), ['export', latest.id]) - assert.match(calls.find((call) => call[0] === 'copy')[1], /community-v1/) + assert.match(calls.find((call) => call[0] === 'copy')[1], /community-v2/) assert.match(hook.controller.snapshot().notice, /copied/) slots.forEach((slot) => slot?.cleanup?.()) assert.equal(calls.filter((call) => call[0] === 'cancel').length, 1, 'hook cleanup does not invoke engine cancellation') diff --git a/app/src/components/rooms/RoomAgentsSection.tsx b/app/src/components/rooms/RoomAgentsSection.tsx new file mode 100644 index 00000000000..cfa93cc5d43 --- /dev/null +++ b/app/src/components/rooms/RoomAgentsSection.tsx @@ -0,0 +1,383 @@ +import { useAuthoredText } from '../../lib/preferences/useAuthoredText' +import { authoredText } from '../../lib/preferences/language-packs' +import { useStore as useLocaleStore } from '../../lib/store' +import { useEffect, useMemo, useState, type Dispatch, type SetStateAction } from 'react' +import clsx from 'clsx' +import { useStore } from '../../lib/store' +import { basename, relativeTime } from '../../lib/format' +import { Icon, type IconName } from '../../lib/icons' +import { FileGlyph } from '../../lib/fileicon' +import { Button, Input } from '../ui' +import { allowedProviders, projectDefaultModel } from '../../lib/policy' +import { accountLabel, modelDisplayName, providerAccountChoices, providerModelGroups } from '../../lib/provider-accounts' +import { buildRoomAgentTree, type RoomAgentTreeNode } from '../../lib/room-agent-tree' +import type { AgentPreset, AgentRoleProfileId, FanOutBudget, Provider, Room, RoomSeatLane, Seat, Ticket } from '../../lib/types' +import { FAN_OUT_OPTIONS, FILE_TOOL_VERB, ROLE_PROFILES, Avatar, availableSeatName, isActiveRunState, modelChoiceValue, parseModelChoice, pickProvider, seatModelChoice } from './helpers' +import { ReasoningEffortSelect, effortForModel } from '../ReasoningEffortSelect' +import type { ReasoningEffortSetting } from '../../lib/types' + +const AGENT_NODE_STATUS_LABEL: Record = { + get idle() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Idle") }, + get active() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Active") }, + get done() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Done") }, + get failed() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Failed") }, +} + +function AgentStatusDot({ status }: { status: RoomAgentTreeNode['status'] }) { + const tx = useAuthoredText() + return ( + + ) +} + +function RoomAgentDelegates({ node }: { node: RoomAgentTreeNode | undefined }) { + const tx = useAuthoredText() + if (!node?.children.length) return null + return ( +
+
+ + {tx("Delegates")} + {node.children.length} +
+
+ {node.children.map((child) => )} +
+
+ ) +} + +function RoomAgentDelegateRow({ node }: { node: RoomAgentTreeNode }) { + const tx = useAuthoredText() + return ( +
+
+ +
+
+ {node.name} + {node.children.length > 0 && {node.children.length}} + {AGENT_NODE_STATUS_LABEL[node.status]} +
+
{node.detail}
+
+
+ {node.children.length > 0 && ( +
+ {node.children.map((child) => )} +
+ )} +
+ ) +} + +function roomSeatFocus(room: Room, tickets: Ticket[], seat: Seat, node: RoomAgentTreeNode | undefined): { label: string; detail: string; icon: IconName; tone: 'active' | 'blocked' | 'done' | 'idle' } { + const heartbeat = room.seatHeartbeats?.[seat.id] + if (heartbeat?.missedSince) { + return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Stalled") }, detail: `missed heartbeat ${relativeTime(heartbeat.missedSince)}`, icon: 'warning', tone: 'blocked' } + } + + const pendingHandoff = [...room.events].reverse().find((event) => { + if (!(event.kind === 'ask' || event.kind === 'assign') || event.target !== seat.name) return false + return !room.events.some((candidate) => + candidate.createdAt > event.createdAt && + candidate.seat === seat.name && + !['yield', 'notice', 'error'].includes(candidate.kind), + ) + }) + if (pendingHandoff) { + return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Answering handoff") }, detail: `${pendingHandoff.seat} is waiting`, icon: 'message', tone: 'active' } + } + + const claimed = tickets.find((t) => t.assignee === seat.name && t.projectId === room.projectId && t.roomId === room.id && (t.status === 'in_progress' || t.status === 'review' || isActiveRunState(t.runState))) + if (claimed) { + const running = isActiveRunState(claimed.runState) + return { label: running ? 'Worker running' : claimed.status === 'review' ? 'Reviewing' : 'Working ticket', detail: claimed.title, icon: running ? 'play' : 'check', tone: 'active' } + } + + if (node?.children.some((child) => child.status === 'active')) { + return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Delegated") }, detail: `${node.children.filter((child) => child.status === 'active').length} active delegate${node.children.filter((child) => child.status === 'active').length === 1 ? '' : 's'}`, icon: 'branch', tone: 'active' } + } + + const last = [...room.events].reverse().find((event) => event.seat === seat.name && event.kind !== 'yield') + if (last) { + const label = last.kind === 'tool' ? `Used ${last.tool ?? 'tool'}` : last.kind === 'claim' ? 'Claimed work' : last.kind === 'final' ? 'Concluded' : `${last.kind[0]?.toUpperCase() ?? ''}${last.kind.slice(1)}` + return { label, detail: last.text.replace(/\s+/g, ' ').trim().slice(0, 90), icon: last.kind === 'tool' ? 'grid' : last.kind === 'final' ? 'check' : 'spark', tone: last.kind === 'final' ? 'done' : 'idle' } + } + + return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Available") }, detail: seat.lane ? `${seat.lane} lane` : 'Ready for a handoff', icon: 'clock', tone: 'idle' } +} + +function SeatFocusLine({ focus }: { focus: ReturnType }) { + const tx = useAuthoredText() + return ( +
+ + {focus.label} + {focus.detail} +
+ ) +} + +export function RoomAgentsSection({ + room, + providers, + tickets, + running, + adding, + setAdding, + setSeats, +}: { + room: Room + providers: Provider[] + tickets: Ticket[] + running: boolean + adding: boolean + setAdding: Dispatch> + setSeats: (seats: Seat[]) => void +}) { + const tx = useAuthoredText() + const defaultEffort = useStore((state) => state.settings?.reasoningEffort) + const modelGroups = providers.flatMap((provider) => providerModelGroups(provider).map((group) => ({ provider, group }))) + const agentTree = useMemo(() => buildRoomAgentTree(room), [room, tx]) + const agentTreeBySeat = useMemo(() => new Map(agentTree.map((node) => [node.seatName, node])), [agentTree, tx]) + const updateSeatModel = (seat: Seat, value: string) => { + const picked = parseModelChoice(value) + if (!picked) return + const provider = providers.find((candidate) => candidate.id === picked.providerId) + setSeats(room.seats.map((candidate) => candidate.id === seat.id ? { + ...candidate, ...picked, reasoningEffort: effortForModel(candidate.reasoningEffort, provider, picked.model), + } : candidate)) + } + const removeSeat = (seatId: string) => setSeats(room.seats.filter((seat) => seat.id !== seatId)) + + return ( +
+
+
+
{tx("Room agents")}
+
{tx("Pick the model each local or cloud agent uses.")}
+
+ +
+
+ {room.seats.map((seat) => { + const claimed = tickets.find((t) => t.assignee === seat.name && t.projectId === room.projectId && t.roomId === room.id && (t.status === 'in_progress' || t.status === 'review')) + const recentFiles = [...new Set([...room.events].reverse().filter((ev) => ev.seat === seat.name && ev.tool && ev.path && FILE_TOOL_VERB[ev.tool]).map((ev) => ev.path!))].slice(0, 2) + const seatProvider = providers.find((p) => p.id === seat.providerId) + const choiceValue = seatModelChoice(seat, providers) + const treeNode = agentTreeBySeat.get(seat.name) + const focus = roomSeatFocus(room, tickets, seat, treeNode) + return ( +
+
+ +
+
+ {seat.name} + {seat.roleProfileId && {seat.roleProfileId}} +
+
{seat.lane ? `${seat.lane} · ` : ''}{seat.role}
+
+ +
+ + +
+ setSeats(room.seats.map((candidate) => + candidate.id === seat.id ? { ...candidate, reasoningEffort } : candidate))} /> +
+ {seatProvider &&
{seatProvider.name}
} + {claimed &&
{claimed.title}
} + {recentFiles.length > 0 && ( +
+ {recentFiles.map((path) =>
{basename(path)}
)} +
+ )} + +
+ ) + })} + {adding && { setSeats([...room.seats, seat]); setAdding(false) }} onCancel={() => setAdding(false)} />} + {room.seats.length === 0 && !adding &&
{tx("No agents yet. Add one or use the preset below.")}
} +
+
+ ) +} + +function AddSeat({ room, running, onAdd, onCancel }: { room: Room; running: boolean; onAdd: (s: Seat) => void; onCancel: () => void }) { + const tx = useAuthoredText() + const settings = useStore((s) => s.settings)! + const project = useStore((s) => s.projects.find((p) => p.id === room.projectId)) ?? null + const agentPresets = (settings.agentPresets ?? []).filter((preset) => !preset.archivedAt && !preset.paused) + const pickerProviders = allowedProviders(settings.providers, project) + const def = projectDefaultModel(project, settings.providers) + // Name seats after their role (planner, planner-2, …) so the chosen role is + // visible in the name, and suggest a fitting model per role (#47): builders and + // operators run local; planners, reviewers and researchers run on a frontier + // (cloud) model. + const roleSeatName = (base: string) => { + const used = new Set(room.seats.map((s) => s.name.toLowerCase())) + if (!used.has(base.toLowerCase())) return base + for (let i = 2; i < 99; i++) if (!used.has(`${base}-${i}`)) return `${base}-${i}` + return base + } + const suggestModelFor = (laneFor: RoomSeatLane) => + pickProvider(pickerProviders, laneFor === 'development' || laneFor === 'operations' ? 'local' : 'cloud', def) + const [roleProfileId, setRoleProfileId] = useState('builder') + const [name, setName] = useState(() => roleSeatName('builder')) + const [nameTouched, setNameTouched] = useState(false) + const [role, setRole] = useState('Engineer') + const [lane, setLane] = useState('development') + const [fanOutBudget, setFanOutBudget] = useState('single') + // Seed the form with the model that fits the default 'builder' role (local). + const initialPick = suggestModelFor('development') + const [providerId, setProviderId] = useState(initialPick.provider?.id || def.providerId || pickerProviders[0]?.id || '') + const provider = pickerProviders.find((p) => p.id === providerId) || pickerProviders[0] + const [providerAccountId, setProviderAccountId] = useState(initialPick.provider ? initialPick.providerAccountId : (project?.defaultProviderAccountId ?? provider?.defaultAccountId ?? null)) + const accountChoices = provider ? providerAccountChoices(provider) : [] + const selectedAccount = accountChoices.find((account) => account.id === (providerAccountId ?? null)) ?? accountChoices[0] + const modelChoices = selectedAccount?.models?.length ? selectedAccount.models : (provider?.models ?? []) + const [model, setModel] = useState(initialPick.model || def.model || modelChoices[0] || '') + const [reasoningEffort, setReasoningEffort] = useState() + const selectedAccountLabel = provider ? accountLabel(provider, providerAccountId) : null + const noAllowedProviders = pickerProviders.length === 0 + const currentModelChoice = provider && model ? modelChoiceValue(provider.id, providerAccountId, model) : '' + + useEffect(() => { + setReasoningEffort((current) => effortForModel(current, provider, model)) + }, [provider, model]) + + useEffect(() => { + if (!provider) return + const account = providerAccountChoices(provider).find((choice) => choice.id === (providerAccountId ?? null)) ?? providerAccountChoices(provider)[0] + if ((providerAccountId ?? null) !== (account?.id ?? null)) setProviderAccountId(account?.id ?? null) + const models = account?.models?.length ? account.models : provider.models + if (models.length && !models.includes(model)) setModel(models[0]) + }, [provider?.id, providerAccountId, model, pickerProviders.length]) // eslint-disable-line + + const add = () => { + if (running || !provider || !model) return + const n = (name.trim() || role.toLowerCase()).replace(/\s+/g, '-') + onAdd({ id: crypto.randomUUID(), name: n, role: role.trim() || 'Agent', lane, roleProfileId, fanOutBudget, providerId: provider.id, providerAccountId: providerAccountId ?? null, model, reasoningEffort }) + } + const pickModel = (value: string) => { + const picked = parseModelChoice(value) + if (!picked) return + setProviderId(picked.providerId) + setProviderAccountId(picked.providerAccountId) + setModel(picked.model) + } + const applyAgentPreset = (presetId: string) => { + const preset = agentPresets.find((candidate) => candidate.id === presetId) + if (!preset) return + setName(availableSeatName(preset.name, room.seats)) + setNameTouched(true) + setRole(preset.role) + setLane(preset.lane) + setProviderId(preset.providerId) + setProviderAccountId(preset.providerAccountId ?? null) + setModel(preset.model) + setReasoningEffort(effortForModel(preset.reasoningEffort, pickerProviders.find((candidate) => candidate.id === preset.providerId), preset.model)) + } + + return ( +
+ {agentPresets.length > 0 && ( + + )} + + { setNameTouched(true); setName(e.target.value) }} placeholder={tx("Name (e.g. architect)")} className="mb-2 h-8" /> + setRole(e.target.value)} placeholder={tx("Role (e.g. Architect)")} className="mb-2 h-8" /> +
+ + +
+ {noAllowedProviders ? ( +
+ {tx("This project is local-only, but no local providers are configured.")}
+ ) : ( +
+ +
{provider?.name}{selectedAccountLabel ? ` · ${selectedAccountLabel}` : ''}
+
+ )} +
+ +
+
+ + +
+
+ ) +} diff --git a/app/src/components/rooms/RoomPanels.tsx b/app/src/components/rooms/RoomPanels.tsx index 4b99d5d7e1a..d9ba0cb7ba1 100644 --- a/app/src/components/rooms/RoomPanels.tsx +++ b/app/src/components/rooms/RoomPanels.tsx @@ -1,44 +1,18 @@ import { useAuthoredText } from '../../lib/preferences/useAuthoredText' -import { authoredText } from '../../lib/preferences/language-packs' -import { useStore as useLocaleStore } from '../../lib/store' -import { useEffect, useMemo, useState, type Dispatch, type SetStateAction } from 'react' +import { useState } from 'react' import clsx from 'clsx' -import { useStore } from '../../lib/store' -import { basename, relativeTime } from '../../lib/format' -import { Icon, type IconName } from '../../lib/icons' +import { basename } from '../../lib/format' +import { Icon } from '../../lib/icons' import { FileGlyph } from '../../lib/fileicon' -import { Button, Input } from '../ui' -import { allowedProviders, projectDefaultModel } from '../../lib/policy' -import { accountLabel, modelDisplayName, providerAccountChoices, providerModelGroups } from '../../lib/provider-accounts' -import { buildRoomAgentTree, type RoomAgentTreeNode } from '../../lib/room-agent-tree' -import type { AgentPreset, AgentRoleProfileId, FanOutBudget, Job, Project, Provider, Room, RoomCollaborationMode, RoomEventItem, RoomMode, RoomSeatLane, RoomState, Seat, Ticket } from '../../lib/types' -import { - ACTIVE_ROOM_STATES, - FAN_OUT_OPTIONS, - FILE_TOOL_VERB, - ROLE_PROFILES, - ROOM_COLLABORATION_OPTIONS, - ROOM_MODE_OPTIONS, - ROOM_STATE_LABEL, - Avatar, - availableSeatName, - presetSeats, - seatForRole, - isActiveRunState, - modelChoiceValue, - parseModelChoice, - pickProvider, - roomJobDetail, - roomJobTitle, - roomSupervisorPhase, - seatModelChoice, - ticketFileRefsForDisplay, - ticketPhaseLabel, - ticketStatusLabel, - ticketWorkerLabel, -} from './helpers' +import { Button } from '../ui' +import { allowedProviders } from '../../lib/policy' +import { modelDisplayName } from '../../lib/provider-accounts' +import type { AgentRoleProfileId, Job, Project, Provider, Room, RoomCollaborationMode, RoomEventItem, RoomMode, RoomState, Seat, Ticket } from '../../lib/types' +import { ACTIVE_ROOM_STATES, ROLE_PROFILES, ROOM_COLLABORATION_OPTIONS, ROOM_MODE_OPTIONS, ROOM_STATE_LABEL, Avatar, presetSeats, seatForRole, isActiveRunState, roomJobDetail, roomJobTitle, roomSupervisorPhase, ticketFileRefsForDisplay, ticketPhaseLabel, ticketStatusLabel, ticketWorkerLabel } from './helpers' import type { RoomConflictBlocker } from './helpers' +export { RoomAgentsSection } from './RoomAgentsSection' + export function RoomSupervisorPanel({ room, roomState, @@ -295,212 +269,6 @@ export function RoomStat({ icon, label, value, accent }: { icon: 'cpu' | 'list' ) } -const AGENT_NODE_STATUS_LABEL: Record = { - get idle() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Idle") }, - get active() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Active") }, - get done() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Done") }, - get failed() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Failed") }, -} - -function AgentStatusDot({ status }: { status: RoomAgentTreeNode['status'] }) { - const tx = useAuthoredText() - return ( - - ) -} - -function RoomAgentDelegates({ node }: { node: RoomAgentTreeNode | undefined }) { - const tx = useAuthoredText() - if (!node?.children.length) return null - return ( -
-
- - {tx("Delegates")} - {node.children.length} -
-
- {node.children.map((child) => )} -
-
- ) -} - -function RoomAgentDelegateRow({ node }: { node: RoomAgentTreeNode }) { - const tx = useAuthoredText() - return ( -
-
- -
-
- {node.name} - {node.children.length > 0 && {node.children.length}} - {AGENT_NODE_STATUS_LABEL[node.status]} -
-
{node.detail}
-
-
- {node.children.length > 0 && ( -
- {node.children.map((child) => )} -
- )} -
- ) -} - -function roomSeatFocus(room: Room, tickets: Ticket[], seat: Seat, node: RoomAgentTreeNode | undefined): { label: string; detail: string; icon: IconName; tone: 'active' | 'blocked' | 'done' | 'idle' } { - const heartbeat = room.seatHeartbeats?.[seat.id] - if (heartbeat?.missedSince) { - return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Stalled") }, detail: `missed heartbeat ${relativeTime(heartbeat.missedSince)}`, icon: 'warning', tone: 'blocked' } - } - - const pendingHandoff = [...room.events].reverse().find((event) => { - if (!(event.kind === 'ask' || event.kind === 'assign') || event.target !== seat.name) return false - return !room.events.some((candidate) => - candidate.createdAt > event.createdAt && - candidate.seat === seat.name && - !['yield', 'notice', 'error'].includes(candidate.kind), - ) - }) - if (pendingHandoff) { - return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Answering handoff") }, detail: `${pendingHandoff.seat} is waiting`, icon: 'message', tone: 'active' } - } - - const claimed = tickets.find((t) => t.assignee === seat.name && t.projectId === room.projectId && t.roomId === room.id && (t.status === 'in_progress' || t.status === 'review' || isActiveRunState(t.runState))) - if (claimed) { - const running = isActiveRunState(claimed.runState) - return { label: running ? 'Worker running' : claimed.status === 'review' ? 'Reviewing' : 'Working ticket', detail: claimed.title, icon: running ? 'play' : 'check', tone: 'active' } - } - - if (node?.children.some((child) => child.status === 'active')) { - return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Delegated") }, detail: `${node.children.filter((child) => child.status === 'active').length} active delegate${node.children.filter((child) => child.status === 'active').length === 1 ? '' : 's'}`, icon: 'branch', tone: 'active' } - } - - const last = [...room.events].reverse().find((event) => event.seat === seat.name && event.kind !== 'yield') - if (last) { - const label = last.kind === 'tool' ? `Used ${last.tool ?? 'tool'}` : last.kind === 'claim' ? 'Claimed work' : last.kind === 'final' ? 'Concluded' : `${last.kind[0]?.toUpperCase() ?? ''}${last.kind.slice(1)}` - return { label, detail: last.text.replace(/\s+/g, ' ').trim().slice(0, 90), icon: last.kind === 'tool' ? 'grid' : last.kind === 'final' ? 'check' : 'spark', tone: last.kind === 'final' ? 'done' : 'idle' } - } - - return { get label() { return authoredText(useLocaleStore.getState().settings?.uiPreferences?.locale, "Available") }, detail: seat.lane ? `${seat.lane} lane` : 'Ready for a handoff', icon: 'clock', tone: 'idle' } -} - -function SeatFocusLine({ focus }: { focus: ReturnType }) { - const tx = useAuthoredText() - return ( -
- - {focus.label} - {focus.detail} -
- ) -} - -export function RoomAgentsSection({ - room, - providers, - tickets, - running, - adding, - setAdding, - setSeats, -}: { - room: Room - providers: Provider[] - tickets: Ticket[] - running: boolean - adding: boolean - setAdding: Dispatch> - setSeats: (seats: Seat[]) => void -}) { - const tx = useAuthoredText() - const modelGroups = providers.flatMap((provider) => providerModelGroups(provider).map((group) => ({ provider, group }))) - const agentTree = useMemo(() => buildRoomAgentTree(room), [room, tx]) - const agentTreeBySeat = useMemo(() => new Map(agentTree.map((node) => [node.seatName, node])), [agentTree, tx]) - const updateSeatModel = (seat: Seat, value: string) => { - const picked = parseModelChoice(value) - if (!picked) return - setSeats(room.seats.map((candidate) => candidate.id === seat.id ? { ...candidate, ...picked } : candidate)) - } - const removeSeat = (seatId: string) => setSeats(room.seats.filter((seat) => seat.id !== seatId)) - - return ( -
-
-
-
{tx("Room agents")}
-
{tx("Pick the model each local or cloud agent uses.")}
-
- -
-
- {room.seats.map((seat) => { - const claimed = tickets.find((t) => t.assignee === seat.name && t.projectId === room.projectId && t.roomId === room.id && (t.status === 'in_progress' || t.status === 'review')) - const recentFiles = [...new Set([...room.events].reverse().filter((ev) => ev.seat === seat.name && ev.tool && ev.path && FILE_TOOL_VERB[ev.tool]).map((ev) => ev.path!))].slice(0, 2) - const seatProvider = providers.find((p) => p.id === seat.providerId) - const choiceValue = seatModelChoice(seat, providers) - const treeNode = agentTreeBySeat.get(seat.name) - const focus = roomSeatFocus(room, tickets, seat, treeNode) - return ( -
-
- -
-
- {seat.name} - {seat.roleProfileId && {seat.roleProfileId}} -
-
{seat.lane ? `${seat.lane} · ` : ''}{seat.role}
-
- -
- - - {seatProvider &&
{seatProvider.name}
} - {claimed &&
{claimed.title}
} - {recentFiles.length > 0 && ( -
- {recentFiles.map((path) =>
{basename(path)}
)} -
- )} - -
- ) - })} - {adding && { setSeats([...room.seats, seat]); setAdding(false) }} onCancel={() => setAdding(false)} />} - {room.seats.length === 0 && !adding &&
{tx("No agents yet. Add one or use the preset below.")}
} -
-
- ) -} - // #52/#54 — the center "build your room" canvas. Drag a role into the room (or // click) to add an agent with a fitting model, then pick how they collaborate. // Shown before the huddle has a transcript, so room-building happens in the @@ -602,142 +370,3 @@ export function RoomCanvas({ room, providers, project, onSetSeats, onSetCollabor
) } - -function AddSeat({ room, onAdd, onCancel }: { room: Room; onAdd: (s: Seat) => void; onCancel: () => void }) { - const tx = useAuthoredText() - const settings = useStore((s) => s.settings)! - const project = useStore((s) => s.projects.find((p) => p.id === room.projectId)) ?? null - const agentPresets = (settings.agentPresets ?? []).filter((preset) => !preset.archivedAt && !preset.paused) - const pickerProviders = allowedProviders(settings.providers, project) - const def = projectDefaultModel(project, settings.providers) - // Name seats after their role (planner, planner-2, …) so the chosen role is - // visible in the name, and suggest a fitting model per role (#47): builders and - // operators run local; planners, reviewers and researchers run on a frontier - // (cloud) model. - const roleSeatName = (base: string) => { - const used = new Set(room.seats.map((s) => s.name.toLowerCase())) - if (!used.has(base.toLowerCase())) return base - for (let i = 2; i < 99; i++) if (!used.has(`${base}-${i}`)) return `${base}-${i}` - return base - } - const suggestModelFor = (laneFor: RoomSeatLane) => - pickProvider(pickerProviders, laneFor === 'development' || laneFor === 'operations' ? 'local' : 'cloud', def) - const [roleProfileId, setRoleProfileId] = useState('builder') - const [name, setName] = useState(() => roleSeatName('builder')) - const [nameTouched, setNameTouched] = useState(false) - const [role, setRole] = useState('Engineer') - const [lane, setLane] = useState('development') - const [fanOutBudget, setFanOutBudget] = useState('single') - // Seed the form with the model that fits the default 'builder' role (local). - const initialPick = suggestModelFor('development') - const [providerId, setProviderId] = useState(initialPick.provider?.id || def.providerId || pickerProviders[0]?.id || '') - const provider = pickerProviders.find((p) => p.id === providerId) || pickerProviders[0] - const [providerAccountId, setProviderAccountId] = useState(initialPick.provider ? initialPick.providerAccountId : (project?.defaultProviderAccountId ?? provider?.defaultAccountId ?? null)) - const accountChoices = provider ? providerAccountChoices(provider) : [] - const selectedAccount = accountChoices.find((account) => account.id === (providerAccountId ?? null)) ?? accountChoices[0] - const modelChoices = selectedAccount?.models?.length ? selectedAccount.models : (provider?.models ?? []) - const [model, setModel] = useState(initialPick.model || def.model || modelChoices[0] || '') - const selectedAccountLabel = provider ? accountLabel(provider, providerAccountId) : null - const noAllowedProviders = pickerProviders.length === 0 - const currentModelChoice = provider && model ? modelChoiceValue(provider.id, providerAccountId, model) : '' - - useEffect(() => { - if (!provider) return - const account = providerAccountChoices(provider).find((choice) => choice.id === (providerAccountId ?? null)) ?? providerAccountChoices(provider)[0] - if ((providerAccountId ?? null) !== (account?.id ?? null)) setProviderAccountId(account?.id ?? null) - const models = account?.models?.length ? account.models : provider.models - if (models.length && !models.includes(model)) setModel(models[0]) - }, [provider?.id, providerAccountId, model, pickerProviders.length]) // eslint-disable-line - - const add = () => { - if (!provider || !model) return - const n = (name.trim() || role.toLowerCase()).replace(/\s+/g, '-') - onAdd({ id: crypto.randomUUID(), name: n, role: role.trim() || 'Agent', lane, roleProfileId, fanOutBudget, providerId: provider.id, providerAccountId: providerAccountId ?? null, model }) - } - const pickModel = (value: string) => { - const picked = parseModelChoice(value) - if (!picked) return - setProviderId(picked.providerId) - setProviderAccountId(picked.providerAccountId) - setModel(picked.model) - } - const applyAgentPreset = (presetId: string) => { - const preset = agentPresets.find((candidate) => candidate.id === presetId) - if (!preset) return - setName(availableSeatName(preset.name, room.seats)) - setNameTouched(true) - setRole(preset.role) - setLane(preset.lane) - setProviderId(preset.providerId) - setProviderAccountId(preset.providerAccountId ?? null) - setModel(preset.model) - } - - return ( -
- {agentPresets.length > 0 && ( - - )} - - { setNameTouched(true); setName(e.target.value) }} placeholder={tx("Name (e.g. architect)")} className="mb-2 h-8" /> - setRole(e.target.value)} placeholder={tx("Role (e.g. Architect)")} className="mb-2 h-8" /> -
- - -
- {noAllowedProviders ? ( -
- {tx("This project is local-only, but no local providers are configured.")}
- ) : ( -
- -
{provider?.name}{selectedAccountLabel ? ` · ${selectedAccountLabel}` : ''}
-
- )} -
- - -
-
- ) -} diff --git a/app/src/lib/preferences/packs/es/008.json b/app/src/lib/preferences/packs/es/008.json index 93faa97d016..1177e324b79 100644 --- a/app/src/lib/preferences/packs/es/008.json +++ b/app/src/lib/preferences/packs/es/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Quitar una carpeta detiene su descubrimiento, pero no elimina modelos. El modelo activo sigue cargado hasta detener el servidor.", "Rename": "Renombrar", "Render the plan panel with block progress bars and status glyphs.": "Mostrar el plan con barras de progreso y símbolos de estado.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Mediciones community-v1 repetibles con modelos en caché de este Mac.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Mediciones community-v2 repetibles con modelos en caché de este Mac.", "repeated checks": "comprobaciones repetidas", "Replace matching records from the backup": "Sustituir registros coincidentes por los de la copia", "replaces the current instructions": "sustituye las instrucciones actuales", diff --git a/app/src/lib/preferences/packs/es/011.json b/app/src/lib/preferences/packs/es/011.json index 51fe4c8a73c..f3f39fa3ecd 100644 --- a/app/src/lib/preferences/packs/es/011.json +++ b/app/src/lib/preferences/packs/es/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Usa pruebas community-v1 fijas de código y chat con cinco muestras por celda. Guarda ajustes, termina el trabajo local y usa un modelo en caché compatible con este Mac.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Usa pruebas community-v2 fijas de código y chat con cinco muestras por celda. Guarda ajustes, termina el trabajo local y usa un modelo en caché compatible con este Mac.", "Use gateway-qualified model ids such as": "Usa IDs admitidos por la pasarela, como", "Use installed": "Usar instalado", "Use light, dark, or match your system.": "Usa tema claro, oscuro o del sistema.", diff --git a/app/src/lib/preferences/packs/es/012.json b/app/src/lib/preferences/packs/es/012.json index 31e3d19da30..b9ad67fe0af 100644 --- a/app/src/lib/preferences/packs/es/012.json +++ b/app/src/lib/preferences/packs/es/012.json @@ -12,7 +12,7 @@ "After this change": "Después del cambio", "All": "Todos", "All assistant sources": "Todas las fuentes del asistente", - "All community-v1 cells meet the complete protocol.": "Todas las celdas community-v1 cumplen el protocolo completo.", + "All community-v2 cells meet the complete protocol.": "Todas las celdas community-v2 cumplen el protocolo completo.", "Allow Kokoro watch replies for {value0}": "Permitir respuestas Kokoro en el reloj para {value0}", "Allow private network for {value0}": "Permitir red privada para {value0}", "Allowed": "Permitido", diff --git a/app/src/lib/preferences/packs/es/016.json b/app/src/lib/preferences/packs/es/016.json index cf916052f39..b0f6d9faf16 100644 --- a/app/src/lib/preferences/packs/es/016.json +++ b/app/src/lib/preferences/packs/es/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "No se pudo abrir la página comunitaria; prueba en tu navegador.", "The comparison could not finish.": "No se pudo completar la comparación.", "The comparison stopped before changing the engine.": "La comparación se detuvo antes de cambiar el motor.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "No se cumplió el protocolo community-v1 completo; las celdas incompletas no puntúan rendimiento.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "No se cumplió el protocolo community-v2 completo; las celdas incompletas no puntúan rendimiento.", "The conversation could not be renamed.": "No se pudo renombrar la conversación.", "The document worker is not installed.": "El trabajador documental no está instalado.", "The download action could not complete. Try again.": "No se pudo completar la descarga. Reintenta.", diff --git a/app/src/lib/preferences/packs/hi/008.json b/app/src/lib/preferences/packs/hi/008.json index 438e0088c3e..2bcabd75178 100644 --- a/app/src/lib/preferences/packs/hi/008.json +++ b/app/src/lib/preferences/packs/hi/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "फ़ोल्डर हटाने से वहाँ खोजना बंद होता है, मॉडल नहीं मिटते। चालू मॉडल सर्वर रोकने तक लोड रहता है।", "Rename": "नाम बदलें", "Render the plan panel with block progress bars and status glyphs.": "योजना पैनल में प्रगति पट्टियाँ और स्थिति चिह्न दिखाएँ।", - "Repeatable community-v1 measurements for cached models on this Mac.": "इस Mac के कैश मॉडल पर दोहराने योग्य community-v1 माप।", + "Repeatable community-v2 measurements for cached models on this Mac.": "इस Mac के कैश मॉडल पर दोहराने योग्य community-v2 माप।", "repeated checks": "दोहराई जाँचें", "Replace matching records from the backup": "बैकअप से मेल खाते रिकॉर्ड बदलें", "replaces the current instructions": "वर्तमान निर्देश बदलता है", diff --git a/app/src/lib/preferences/packs/hi/011.json b/app/src/lib/preferences/packs/hi/011.json index 0bfc432b52f..dc5ca7d4e81 100644 --- a/app/src/lib/preferences/packs/hi/011.json +++ b/app/src/lib/preferences/packs/hi/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "कैश मॉडल पर तय community-v1 कोड/चैट नमूनों की पाँच माप लें। पहले सेटिंग सहेजें और स्थानीय काम पूरा करें। मॉडल इस Mac पर फिट होना पुष्ट चाहिए।", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "कैश मॉडल पर तय community-v2 कोड/चैट नमूनों की पाँच माप लें। पहले सेटिंग सहेजें और स्थानीय काम पूरा करें। मॉडल इस Mac पर फिट होना पुष्ट चाहिए।", "Use gateway-qualified model ids such as": "गेटवे से सत्यापित मॉडल ID दें, जैसे", "Use installed": "इंस्टॉल वाला लें", "Use light, dark, or match your system.": "हल्की, गहरी या सिस्टम थीम लें।", diff --git a/app/src/lib/preferences/packs/hi/012.json b/app/src/lib/preferences/packs/hi/012.json index fa11b29c5b9..e6a52b27074 100644 --- a/app/src/lib/preferences/packs/hi/012.json +++ b/app/src/lib/preferences/packs/hi/012.json @@ -12,7 +12,7 @@ "After this change": "इस बदलाव के बाद", "All": "सभी", "All assistant sources": "सहायक के सभी स्रोत", - "All community-v1 cells meet the complete protocol.": "सभी community-v1 सेल पूरा प्रोटोकॉल मानते हैं।", + "All community-v2 cells meet the complete protocol.": "सभी community-v2 सेल पूरा प्रोटोकॉल मानते हैं।", "Allow Kokoro watch replies for {value0}": "{value0} के लिए वॉच पर Kokoro उत्तर दें", "Allow private network for {value0}": "{value0} के लिए निजी नेटवर्क दें", "Allowed": "अनुमति है", diff --git a/app/src/lib/preferences/packs/hi/016.json b/app/src/lib/preferences/packs/hi/016.json index 2b1eecb2530..2b413a3c6f2 100644 --- a/app/src/lib/preferences/packs/hi/016.json +++ b/app/src/lib/preferences/packs/hi/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "समुदाय पेज नहीं खुला। ब्राउज़र में फिर करें।", "The comparison could not finish.": "तुलना पूरी नहीं हुई।", "The comparison stopped before changing the engine.": "इंजन बदलने से पहले तुलना रुकी।", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "पूरा community-v1 प्रोटोकॉल नहीं मिला; अधूरे सेल प्रदर्शन स्कोर नहीं हैं।", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "पूरा community-v2 प्रोटोकॉल नहीं मिला; अधूरे सेल प्रदर्शन स्कोर नहीं हैं।", "The conversation could not be renamed.": "बातचीत का नाम नहीं बदला।", "The document worker is not installed.": "दस्तावेज़ वर्कर इंस्टॉल नहीं।", "The download action could not complete. Try again.": "डाउनलोड कार्रवाई पूरी नहीं हुई। फिर करें।", diff --git a/app/src/lib/preferences/packs/id/008.json b/app/src/lib/preferences/packs/id/008.json index e81e15cba6a..1d3f7e851f9 100644 --- a/app/src/lib/preferences/packs/id/008.json +++ b/app/src/lib/preferences/packs/id/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Menghapus folder menghentikan penemuan di sana, tidak menghapus model; model berjalan tetap dimuat hingga server dihentikan.", "Rename": "Ganti nama", "Render the plan panel with block progress bars and status glyphs.": "Tampilkan panel rencana dengan bilah kemajuan dan ikon status.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Pengukuran community-v1 terulang untuk model cache di Mac ini.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Pengukuran community-v2 terulang untuk model cache di Mac ini.", "repeated checks": "pemeriksaan berulang", "Replace matching records from the backup": "Ganti catatan sesuai dari cadangan", "replaces the current instructions": "mengganti instruksi saat ini", diff --git a/app/src/lib/preferences/packs/id/011.json b/app/src/lib/preferences/packs/id/011.json index ffaecb51b32..5b28b7843c9 100644 --- a/app/src/lib/preferences/packs/id/011.json +++ b/app/src/lib/preferences/packs/id/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Gunakan uji kode/chat tetap community-v1 dengan lima sampel per sel; simpan pengaturan dan selesaikan pekerjaan lokal dahulu. Model harus dalam cache dan terkonfirmasi sesuai Mac.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Gunakan uji kode/chat tetap community-v2 dengan lima sampel per sel; simpan pengaturan dan selesaikan pekerjaan lokal dahulu. Model harus dalam cache dan terkonfirmasi sesuai Mac.", "Use gateway-qualified model ids such as": "Gunakan ID model lengkap gateway seperti", "Use installed": "Gunakan terpasang", "Use light, dark, or match your system.": "Gunakan terang, gelap, atau sesuaikan sistem.", diff --git a/app/src/lib/preferences/packs/id/012.json b/app/src/lib/preferences/packs/id/012.json index 74971cafee0..14c7c44e4e9 100644 --- a/app/src/lib/preferences/packs/id/012.json +++ b/app/src/lib/preferences/packs/id/012.json @@ -12,7 +12,7 @@ "After this change": "Setelah perubahan ini", "All": "Semua", "All assistant sources": "Semua sumber asisten", - "All community-v1 cells meet the complete protocol.": "Semua sel community-v1 memenuhi protokol lengkap.", + "All community-v2 cells meet the complete protocol.": "Semua sel community-v2 memenuhi protokol lengkap.", "Allow Kokoro watch replies for {value0}": "Izinkan jawaban Kokoro ke jam untuk {value0}", "Allow private network for {value0}": "Izinkan jaringan pribadi untuk {value0}", "Allowed": "Diizinkan", diff --git a/app/src/lib/preferences/packs/id/016.json b/app/src/lib/preferences/packs/id/016.json index 9d6317df710..7353e31b500 100644 --- a/app/src/lib/preferences/packs/id/016.json +++ b/app/src/lib/preferences/packs/id/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "Halaman komunitas tidak terbuka; coba di browser.", "The comparison could not finish.": "Perbandingan tidak selesai.", "The comparison stopped before changing the engine.": "Perbandingan berhenti sebelum mengubah mesin.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "Protokol community-v1 lengkap belum terpenuhi; sel tidak lengkap bukan skor performa.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "Protokol community-v2 lengkap belum terpenuhi; sel tidak lengkap bukan skor performa.", "The conversation could not be renamed.": "Percakapan tidak dapat diganti nama.", "The document worker is not installed.": "Pekerja dokumen belum terpasang.", "The download action could not complete. Try again.": "Tindakan unduhan gagal. Coba lagi.", diff --git a/app/src/lib/preferences/packs/ja/008.json b/app/src/lib/preferences/packs/ja/008.json index ffa0d894ab1..078e52558e6 100644 --- a/app/src/lib/preferences/packs/ja/008.json +++ b/app/src/lib/preferences/packs/ja/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "フォルダーを削除すると、その場所の検出を停止します。モデル自体は削除しません。稼働中モデルはサーバーを停止するまで保持します。", "Rename": "名前を変更", "Render the plan panel with block progress bars and status glyphs.": "計画パネルにブロック型の進捗バーと状態アイコンを表示します。", - "Repeatable community-v1 measurements for cached models on this Mac.": "この Mac のキャッシュ済みモデルで再現可能な community-v1 測定を実行します。", + "Repeatable community-v2 measurements for cached models on this Mac.": "この Mac のキャッシュ済みモデルで再現可能な community-v2 測定を実行します。", "repeated checks": "回の繰り返しチェック", "Replace matching records from the backup": "一致する記録をバックアップで置き換える", "replaces the current instructions": "現在の指示を置き換えます", diff --git a/app/src/lib/preferences/packs/ja/011.json b/app/src/lib/preferences/packs/ja/011.json index ad6afe5e6b8..8f3b7d16160 100644 --- a/app/src/lib/preferences/packs/ja/011.json +++ b/app/src/lib/preferences/packs/ja/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "固定の community-v1 コード・チャット例で各セル 5 サンプルを測ります。先に設定編集を保存しローカル作業を終えてください。モデルはキャッシュ済みで、この Mac への適合確認が必要です。", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "固定の community-v2 コード・チャット例で各セル 5 サンプルを測ります。先に設定編集を保存しローカル作業を終えてください。モデルはキャッシュ済みで、この Mac への適合確認が必要です。", "Use gateway-qualified model ids such as": "ゲートウェイに対応するモデル ID を使用(例):", "Use installed": "インストール済みを使用", "Use light, dark, or match your system.": "ライト、ダーク、システムに合わせる設定が使えます。", diff --git a/app/src/lib/preferences/packs/ja/extra-000.json b/app/src/lib/preferences/packs/ja/extra-000.json index 87434fd677f..8e67e996091 100644 --- a/app/src/lib/preferences/packs/ja/extra-000.json +++ b/app/src/lib/preferences/packs/ja/extra-000.json @@ -106,7 +106,7 @@ "After this change": "この変更後", "All": "すべて", "All assistant sources": "助手の全ソース", - "All community-v1 cells meet the complete protocol.": "community-v1 の全セルが完全な測定手順を満たしています。", + "All community-v2 cells meet the complete protocol.": "community-v2 の全セルが完全な測定手順を満たしています。", "Allow Kokoro watch replies for {value0}": "{value0} の Kokoro Watch 返信を許可", "Allow private network for {value0}": "{value0} のプライベートネットワークを許可", "Allowed": "許可済み", diff --git a/app/src/lib/preferences/packs/ja/extra-004.json b/app/src/lib/preferences/packs/ja/extra-004.json index 887ca2fde4c..89bd651ca80 100644 --- a/app/src/lib/preferences/packs/ja/extra-004.json +++ b/app/src/lib/preferences/packs/ja/extra-004.json @@ -165,7 +165,7 @@ "The community page could not open; try again in your browser.": "コミュニティページを開けません。ブラウザーで再試行してください。", "The comparison could not finish.": "比較を完了できませんでした。", "The comparison stopped before changing the engine.": "エンジンを変える前に比較を停止しました。", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "完全な community-v1 プロトコルを満たしていません。不完全なセルは性能スコアではありません。", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "完全な community-v2 プロトコルを満たしていません。不完全なセルは性能スコアではありません。", "The conversation could not be renamed.": "会話の名前を変更できませんでした。", "The document worker is not installed.": "ドキュメントワーカーが未インストールです。", "The download action could not complete. Try again.": "ダウンロード操作を完了できません。再試行してください。", diff --git a/app/src/lib/preferences/packs/ko/008.json b/app/src/lib/preferences/packs/ko/008.json index 636ff17a9da..455d3729466 100644 --- a/app/src/lib/preferences/packs/ko/008.json +++ b/app/src/lib/preferences/packs/ko/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "폴더를 제거하면 그곳의 모델 탐색을 중단합니다. 모델 자체는 삭제하지 않으며 실행 중인 모델은 서버를 중지할 때까지 유지됩니다.", "Rename": "이름 변경", "Render the plan panel with block progress bars and status glyphs.": "계획 패널을 블록 진행 막대와 상태 기호로 표시합니다.", - "Repeatable community-v1 measurements for cached models on this Mac.": "이 Mac의 캐시 모델에 대한 재현 가능한 community-v1 측정입니다.", + "Repeatable community-v2 measurements for cached models on this Mac.": "이 Mac의 캐시 모델에 대한 재현 가능한 community-v2 측정입니다.", "repeated checks": "회 반복 검사", "Replace matching records from the backup": "일치하는 기록을 백업에서 교체", "replaces the current instructions": "현재 지시를 교체합니다", diff --git a/app/src/lib/preferences/packs/ko/011.json b/app/src/lib/preferences/packs/ko/011.json index 539d82a1eb4..20ed9b366ff 100644 --- a/app/src/lib/preferences/packs/ko/011.json +++ b/app/src/lib/preferences/packs/ko/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "고정 community-v1 코드/채팅 데이터로 셀마다 샘플 5개를 측정합니다. 먼저 설정을 저장하고 로컬 작업을 마치세요. 모델은 캐시되었고 이 Mac에 적합하다고 확인되어야 합니다.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "고정 community-v2 코드/채팅 데이터로 셀마다 샘플 5개를 측정합니다. 먼저 설정을 저장하고 로컬 작업을 마치세요. 모델은 캐시되었고 이 Mac에 적합하다고 확인되어야 합니다.", "Use gateway-qualified model ids such as": "게이트웨이 한정 모델 ID를 사용하세요. 예:", "Use installed": "설치된 항목 사용", "Use light, dark, or match your system.": "밝은 모드, 어두운 모드 또는 시스템 설정을 사용하세요.", diff --git a/app/src/lib/preferences/packs/ko/extra-000.json b/app/src/lib/preferences/packs/ko/extra-000.json index a6b36412f3d..c7b848cea14 100644 --- a/app/src/lib/preferences/packs/ko/extra-000.json +++ b/app/src/lib/preferences/packs/ko/extra-000.json @@ -106,7 +106,7 @@ "After this change": "이 변경 후", "All": "모두", "All assistant sources": "모든 어시스턴트 소스", - "All community-v1 cells meet the complete protocol.": "모든 community-v1 셀이 전체 프로토콜을 충족합니다.", + "All community-v2 cells meet the complete protocol.": "모든 community-v2 셀이 전체 프로토콜을 충족합니다.", "Allow Kokoro watch replies for {value0}": "{value0}의 Kokoro 시계 응답 허용", "Allow private network for {value0}": "{value0}의 사설 네트워크 허용", "Allowed": "허용됨", diff --git a/app/src/lib/preferences/packs/ko/extra-004.json b/app/src/lib/preferences/packs/ko/extra-004.json index 13a9d37c100..b1b742b22f0 100644 --- a/app/src/lib/preferences/packs/ko/extra-004.json +++ b/app/src/lib/preferences/packs/ko/extra-004.json @@ -165,7 +165,7 @@ "The community page could not open; try again in your browser.": "커뮤니티 페이지를 열 수 없습니다. 브라우저에서 다시 시도하세요.", "The comparison could not finish.": "비교를 완료할 수 없습니다.", "The comparison stopped before changing the engine.": "엔진 변경 전에 비교를 중지했습니다.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "전체 community-v1 프로토콜을 충족하지 않았습니다. 불완전한 셀은 성능 점수가 아닙니다.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "전체 community-v2 프로토콜을 충족하지 않았습니다. 불완전한 셀은 성능 점수가 아닙니다.", "The conversation could not be renamed.": "대화 이름을 변경할 수 없습니다.", "The document worker is not installed.": "문서 워커가 설치되지 않았습니다.", "The download action could not complete. Try again.": "다운로드 작업을 완료할 수 없습니다. 다시 시도하세요.", diff --git a/app/src/lib/preferences/packs/la/008.json b/app/src/lib/preferences/packs/la/008.json index 53ff67ef4ab..991f220bdda 100644 --- a/app/src/lib/preferences/packs/la/008.json +++ b/app/src/lib/preferences/packs/la/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Directorium removere detectionem ibi sistit, exemplaria numquam delet. Exemplar currens oneratum manet donec ministrum sistas.", "Rename": "Renomina", "Render the plan panel with block progress bars and status glyphs.": "Consilium cum fasciis progressus et signis status ostende.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Mensurae community-v1 repetibiles exemplaribus conditis huius Mac.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Mensurae community-v2 repetibiles exemplaribus conditis huius Mac.", "repeated checks": "probationes repetitae", "Replace matching records from the backup": "Recordationes congruentes ex copia substitue", "replaces the current instructions": "praecepta praesentia substituit", diff --git a/app/src/lib/preferences/packs/la/011.json b/app/src/lib/preferences/packs/la/011.json index 12df394842d..874679a541e 100644 --- a/app/src/lib/preferences/packs/la/011.json +++ b/app/src/lib/preferences/packs/la/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Speciminibus fixis community-v1 codicis et colloquii utere, quinque mensuris per cellam. Optiones serva et opus locale perfice; exemplar conditum et huic Mac probatum esse debet.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Speciminibus fixis community-v2 codicis et colloquii utere, quinque mensuris per cellam. Optiones serva et opus locale perfice; exemplar conditum et huic Mac probatum esse debet.", "Use gateway-qualified model ids such as": "Indices portae plenos adhibe, velut", "Use installed": "Instituto utere", "Use light, dark, or match your system.": "Clarum, obscurum aut systema sequere.", diff --git a/app/src/lib/preferences/packs/la/012.json b/app/src/lib/preferences/packs/la/012.json index f245f54f5da..4911514b3db 100644 --- a/app/src/lib/preferences/packs/la/012.json +++ b/app/src/lib/preferences/packs/la/012.json @@ -12,7 +12,7 @@ "After this change": "Post hanc mutationem", "All": "Omnia", "All assistant sources": "Omnes fontes adiutoris", - "All community-v1 cells meet the complete protocol.": "Omnes cellae community-v1 protocollo pleno satisfaciunt.", + "All community-v2 cells meet the complete protocol.": "Omnes cellae community-v2 protocollo pleno satisfaciunt.", "Allow Kokoro watch replies for {value0}": "Responsa Kokoro horologii pro {value0} permitte", "Allow private network for {value0}": "Rete privatum pro {value0} permitte", "Allowed": "Permissum", diff --git a/app/src/lib/preferences/packs/la/016.json b/app/src/lib/preferences/packs/la/016.json index 2eeeeefc070..6c63af41c8d 100644 --- a/app/src/lib/preferences/packs/la/016.json +++ b/app/src/lib/preferences/packs/la/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "Pagina communitatis aperiri non potuit; in navigatore itera.", "The comparison could not finish.": "Comparatio perfici non potuit.", "The comparison stopped before changing the engine.": "Comparatio ante machinam mutandam stetit.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "Protocollo community-v1 pleno non satisfactum; cellae incompletae mensurae non sunt.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "Protocollo community-v2 pleno non satisfactum; cellae incompletae mensurae non sunt.", "The conversation could not be renamed.": "Colloquium renominari non potuit.", "The document worker is not installed.": "Operarius documentorum non institutus.", "The download action could not complete. Try again.": "Receptio perfici non potuit. Itera.", diff --git a/app/src/lib/preferences/packs/pl/008.json b/app/src/lib/preferences/packs/pl/008.json index f635d229151..52611933158 100644 --- a/app/src/lib/preferences/packs/pl/008.json +++ b/app/src/lib/preferences/packs/pl/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Usunięcie folderu zatrzymuje wykrywanie w nim; nie usuwa modeli, a działający pozostaje wczytany do zatrzymania serwera.", "Rename": "Zmień nazwę", "Render the plan panel with block progress bars and status glyphs.": "Wyświetl panel planu z paskami postępu i symbolami stanu.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Powtarzalne pomiary community-v1 dla modeli z pamięci podręcznej na Macu.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Powtarzalne pomiary community-v2 dla modeli z pamięci podręcznej na Macu.", "repeated checks": "powtórzone kontrole", "Replace matching records from the backup": "Zastąp pasujące rekordy z kopii", "replaces the current instructions": "zastępuje bieżące instrukcje", diff --git a/app/src/lib/preferences/packs/pl/011.json b/app/src/lib/preferences/packs/pl/011.json index 1ac7008971e..13d2995ee69 100644 --- a/app/src/lib/preferences/packs/pl/011.json +++ b/app/src/lib/preferences/packs/pl/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Stałe testy kodu i czatu community-v1 z pięcioma próbkami na komórkę; zapisz ustawienia i zakończ pracę lokalną. Model musi być w pamięci podręcznej i pasować do Maca.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Stałe testy kodu i czatu community-v2 z pięcioma próbkami na komórkę; zapisz ustawienia i zakończ pracę lokalną. Model musi być w pamięci podręcznej i pasować do Maca.", "Use gateway-qualified model ids such as": "Używaj kwalifikowanych identyfikatorów modeli bramy, np.", "Use installed": "Użyj zainstalowanego", "Use light, dark, or match your system.": "Jasny, ciemny lub zgodny z systemem.", diff --git a/app/src/lib/preferences/packs/pl/012.json b/app/src/lib/preferences/packs/pl/012.json index 5600d03e21c..044114bdc5b 100644 --- a/app/src/lib/preferences/packs/pl/012.json +++ b/app/src/lib/preferences/packs/pl/012.json @@ -12,7 +12,7 @@ "After this change": "Po tej zmianie", "All": "Wszystkie", "All assistant sources": "Wszystkie źródła asystenta", - "All community-v1 cells meet the complete protocol.": "Wszystkie komórki community-v1 spełniają pełny protokół.", + "All community-v2 cells meet the complete protocol.": "Wszystkie komórki community-v2 spełniają pełny protokół.", "Allow Kokoro watch replies for {value0}": "Zezwól na odpowiedzi Kokoro na zegarku dla {value0}", "Allow private network for {value0}": "Zezwól na prywatną sieć dla {value0}", "Allowed": "Dozwolone", diff --git a/app/src/lib/preferences/packs/pl/016.json b/app/src/lib/preferences/packs/pl/016.json index 3d162fae612..e4c4b1a926d 100644 --- a/app/src/lib/preferences/packs/pl/016.json +++ b/app/src/lib/preferences/packs/pl/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "Nie otwarto strony społeczności; spróbuj w przeglądarce.", "The comparison could not finish.": "Porównanie nie zakończyło się.", "The comparison stopped before changing the engine.": "Porównanie zatrzymano przed zmianą silnika.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "Pełny protokół community-v1 niespełniony; niepełne komórki nie są oceną wydajności.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "Pełny protokół community-v2 niespełniony; niepełne komórki nie są oceną wydajności.", "The conversation could not be renamed.": "Nie zmieniono nazwy rozmowy.", "The document worker is not installed.": "Nie zainstalowano modułu dokumentów.", "The download action could not complete. Try again.": "Pobieranie nie zakończyło się. Ponów.", diff --git a/app/src/lib/preferences/packs/ru/008.json b/app/src/lib/preferences/packs/ru/008.json index d3eb4845a58..6aade0f2fcc 100644 --- a/app/src/lib/preferences/packs/ru/008.json +++ b/app/src/lib/preferences/packs/ru/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Удаление папки прекращает поиск моделей в ней, но не удаляет модели. Работающая модель остаётся загруженной до остановки сервера.", "Rename": "Переименовать", "Render the plan panel with block progress bars and status glyphs.": "Показывать план с полосами прогресса и значками состояния.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Воспроизводимые измерения community-v1 для моделей из кэша на этом Mac.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Воспроизводимые измерения community-v2 для моделей из кэша на этом Mac.", "repeated checks": "повторные проверки", "Replace matching records from the backup": "Заменить совпадающие записи из копии", "replaces the current instructions": "заменяет текущие инструкции", diff --git a/app/src/lib/preferences/packs/ru/011.json b/app/src/lib/preferences/packs/ru/011.json index 9106a4a23f5..1d2ea4a4ebf 100644 --- a/app/src/lib/preferences/packs/ru/011.json +++ b/app/src/lib/preferences/packs/ru/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Используйте фиксированные тесты кода и чата community-v1, по пять замеров в ячейке; сначала сохраните настройки и завершите локальную работу. Модель должна быть в кэше и подтверждённо подходить этому Mac.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Используйте фиксированные тесты кода и чата community-v2, по пять замеров в ячейке; сначала сохраните настройки и завершите локальную работу. Модель должна быть в кэше и подтверждённо подходить этому Mac.", "Use gateway-qualified model ids such as": "Используйте полные ID моделей шлюза, например", "Use installed": "Использовать установленное", "Use light, dark, or match your system.": "Светлая, тёмная или системная тема.", diff --git a/app/src/lib/preferences/packs/ru/012.json b/app/src/lib/preferences/packs/ru/012.json index 72f3a0fdc57..71c9fa757ce 100644 --- a/app/src/lib/preferences/packs/ru/012.json +++ b/app/src/lib/preferences/packs/ru/012.json @@ -12,7 +12,7 @@ "After this change": "После изменения", "All": "Все", "All assistant sources": "Все источники помощника", - "All community-v1 cells meet the complete protocol.": "Все ячейки community-v1 соответствуют полному протоколу.", + "All community-v2 cells meet the complete protocol.": "Все ячейки community-v2 соответствуют полному протоколу.", "Allow Kokoro watch replies for {value0}": "Разрешить ответы Kokoro на часы для {value0}", "Allow private network for {value0}": "Разрешить частную сеть для {value0}", "Allowed": "Разрешено", diff --git a/app/src/lib/preferences/packs/ru/016.json b/app/src/lib/preferences/packs/ru/016.json index 97ff600831a..e0ce7191728 100644 --- a/app/src/lib/preferences/packs/ru/016.json +++ b/app/src/lib/preferences/packs/ru/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "Не удалось открыть страницу сообщества; попробуйте в браузере.", "The comparison could not finish.": "Сравнение не завершилось.", "The comparison stopped before changing the engine.": "Сравнение остановлено до изменения движка.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "Полный протокол community-v1 не выполнен; неполные ячейки не являются оценками производительности.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "Полный протокол community-v2 не выполнен; неполные ячейки не являются оценками производительности.", "The conversation could not be renamed.": "Не удалось переименовать разговор.", "The document worker is not installed.": "Обработчик документов не установлен.", "The download action could not complete. Try again.": "Не удалось выполнить загрузку. Повторите.", diff --git a/app/src/lib/preferences/packs/th/008.json b/app/src/lib/preferences/packs/th/008.json index 4d0ac781590..c4eb4c0f229 100644 --- a/app/src/lib/preferences/packs/th/008.json +++ b/app/src/lib/preferences/packs/th/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "นำโฟลเดอร์ออกจะหยุดค้นโมเดลที่นั่น ไม่ลบโมเดล และโมเดลที่ทำงานยังโหลดอยู่จนหยุดเซิร์ฟเวอร์", "Rename": "เปลี่ยนชื่อ", "Render the plan panel with block progress bars and status glyphs.": "แสดงแผนด้วยแถบความคืบหน้าแบบบล็อกและสัญลักษณ์สถานะ", - "Repeatable community-v1 measurements for cached models on this Mac.": "การวัด community-v1 ทำซ้ำได้สำหรับโมเดลแคชบน Mac นี้", + "Repeatable community-v2 measurements for cached models on this Mac.": "การวัด community-v2 ทำซ้ำได้สำหรับโมเดลแคชบน Mac นี้", "repeated checks": "การตรวจซ้ำ", "Replace matching records from the backup": "แทนข้อมูลที่ตรงจากสำรอง", "replaces the current instructions": "แทนคำแนะนำปัจจุบัน", diff --git a/app/src/lib/preferences/packs/th/011.json b/app/src/lib/preferences/packs/th/011.json index 2c5f5e9e403..f79f9e271dd 100644 --- a/app/src/lib/preferences/packs/th/011.json +++ b/app/src/lib/preferences/packs/th/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "ใช้ข้อมูลทดสอบ community-v1 โค้ด/แชตคงที่ ห้าตัวอย่างต่อเซลล์ บันทึกค่าและจบงานในเครื่องก่อน โมเดลต้องอยู่ในแคชและยืนยันว่าเหมาะ Mac นี้", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "ใช้ข้อมูลทดสอบ community-v2 โค้ด/แชตคงที่ ห้าตัวอย่างต่อเซลล์ บันทึกค่าและจบงานในเครื่องก่อน โมเดลต้องอยู่ในแคชและยืนยันว่าเหมาะ Mac นี้", "Use gateway-qualified model ids such as": "ใช้ ID โมเดลที่ผ่านเกตเวย์ เช่น", "Use installed": "ใช้ที่ติดตั้ง", "Use light, dark, or match your system.": "ใช้สว่าง มืด หรือตามระบบ", diff --git a/app/src/lib/preferences/packs/th/extra-000.json b/app/src/lib/preferences/packs/th/extra-000.json index f6c9ed7ed9a..35486480975 100644 --- a/app/src/lib/preferences/packs/th/extra-000.json +++ b/app/src/lib/preferences/packs/th/extra-000.json @@ -106,7 +106,7 @@ "After this change": "หลังเปลี่ยนนี้", "All": "ทั้งหมด", "All assistant sources": "ทุกแหล่งผู้ช่วย", - "All community-v1 cells meet the complete protocol.": "ทุกเซลล์ community-v1 ผ่านขั้นตอนครบ", + "All community-v2 cells meet the complete protocol.": "ทุกเซลล์ community-v2 ผ่านขั้นตอนครบ", "Allow Kokoro watch replies for {value0}": "อนุญาตคำตอบนาฬิกา Kokoro สำหรับ {value0}", "Allow private network for {value0}": "อนุญาตเครือข่ายส่วนตัวสำหรับ {value0}", "Allowed": "อนุญาตแล้ว", diff --git a/app/src/lib/preferences/packs/th/extra-004.json b/app/src/lib/preferences/packs/th/extra-004.json index 634f49dd31b..228b226e7fc 100644 --- a/app/src/lib/preferences/packs/th/extra-004.json +++ b/app/src/lib/preferences/packs/th/extra-004.json @@ -165,7 +165,7 @@ "The community page could not open; try again in your browser.": "เปิดหน้าชุมชนไม่ได้ ลองในเบราว์เซอร์", "The comparison could not finish.": "เปรียบเทียบไม่เสร็จ", "The comparison stopped before changing the engine.": "หยุดเปรียบเทียบก่อนเปลี่ยนเอนจิน", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "ไม่ผ่านขั้นตอน community-v1 ครบ เซลล์ไม่สมบูรณ์ไม่ใช่คะแนนประสิทธิภาพ", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "ไม่ผ่านขั้นตอน community-v2 ครบ เซลล์ไม่สมบูรณ์ไม่ใช่คะแนนประสิทธิภาพ", "The conversation could not be renamed.": "เปลี่ยนชื่อการสนทนาไม่ได้", "The document worker is not installed.": "ไม่ได้ติดตั้งเวิร์กเกอร์เอกสาร", "The download action could not complete. Try again.": "ดาวน์โหลดไม่เสร็จ ลองใหม่", diff --git a/app/src/lib/preferences/packs/vi/008.json b/app/src/lib/preferences/packs/vi/008.json index cc109d8b600..bd50a2dc8f3 100644 --- a/app/src/lib/preferences/packs/vi/008.json +++ b/app/src/lib/preferences/packs/vi/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "Bỏ thư mục chỉ ngừng tìm mô hình, không xóa mô hình. Mô hình đang nạp giữ tới khi dừng máy chủ.", "Rename": "Đổi tên", "Render the plan panel with block progress bars and status glyphs.": "Hiển thị kế hoạch bằng thanh tiến độ và biểu tượng trạng thái.", - "Repeatable community-v1 measurements for cached models on this Mac.": "Đo community-v1 lặp lại cho mô hình đệm trên Mac.", + "Repeatable community-v2 measurements for cached models on this Mac.": "Đo community-v2 lặp lại cho mô hình đệm trên Mac.", "repeated checks": "kiểm tra lặp lại", "Replace matching records from the backup": "Thay bản ghi khớp bằng bản sao lưu", "replaces the current instructions": "thay chỉ dẫn hiện tại", diff --git a/app/src/lib/preferences/packs/vi/011.json b/app/src/lib/preferences/packs/vi/011.json index 656e1ce1ef9..0fe099fbc9b 100644 --- a/app/src/lib/preferences/packs/vi/011.json +++ b/app/src/lib/preferences/packs/vi/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Dùng mẫu code/chat community-v1 với năm lần đo mỗi ô. Lưu cài đặt, xong việc cục bộ; mô hình phải có đệm và xác nhận vừa Mac.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "Dùng mẫu code/chat community-v2 với năm lần đo mỗi ô. Lưu cài đặt, xong việc cục bộ; mô hình phải có đệm và xác nhận vừa Mac.", "Use gateway-qualified model ids such as": "Dùng ID đã xác minh bởi cổng như", "Use installed": "Dùng bản đã cài", "Use light, dark, or match your system.": "Dùng giao diện sáng, tối hoặc theo hệ thống.", diff --git a/app/src/lib/preferences/packs/vi/012.json b/app/src/lib/preferences/packs/vi/012.json index a8d161ad096..efaeae350bc 100644 --- a/app/src/lib/preferences/packs/vi/012.json +++ b/app/src/lib/preferences/packs/vi/012.json @@ -12,7 +12,7 @@ "After this change": "Sau thay đổi này", "All": "Tất cả", "All assistant sources": "Mọi nguồn trợ lý", - "All community-v1 cells meet the complete protocol.": "Mọi ô community-v1 đạt giao thức đầy đủ.", + "All community-v2 cells meet the complete protocol.": "Mọi ô community-v2 đạt giao thức đầy đủ.", "Allow Kokoro watch replies for {value0}": "Cho phép Kokoro trả lời trên đồng hồ của {value0}", "Allow private network for {value0}": "Cho phép mạng riêng cho {value0}", "Allowed": "Được phép", diff --git a/app/src/lib/preferences/packs/vi/016.json b/app/src/lib/preferences/packs/vi/016.json index df25ed52974..56bde913081 100644 --- a/app/src/lib/preferences/packs/vi/016.json +++ b/app/src/lib/preferences/packs/vi/016.json @@ -71,7 +71,7 @@ "The community page could not open; try again in your browser.": "Không mở trang cộng đồng; thử bằng trình duyệt.", "The comparison could not finish.": "So sánh không hoàn tất.", "The comparison stopped before changing the engine.": "So sánh dừng trước khi đổi engine.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "Chưa đạt toàn bộ community-v1; ô thiếu không phải điểm hiệu năng.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "Chưa đạt toàn bộ community-v2; ô thiếu không phải điểm hiệu năng.", "The conversation could not be renamed.": "Không đổi tên hội thoại được.", "The document worker is not installed.": "Chưa cài trình xử lý tài liệu.", "The download action could not complete. Try again.": "Không hoàn tất tải. Thử lại.", diff --git a/app/src/lib/preferences/packs/zh-Hans/008.json b/app/src/lib/preferences/packs/zh-Hans/008.json index 06df29591c8..dfe1ab4bf99 100644 --- a/app/src/lib/preferences/packs/zh-Hans/008.json +++ b/app/src/lib/preferences/packs/zh-Hans/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.": "移除文件夹会停止在其中发现模型,绝不会删除模型;运行中的模型会保持加载,直到你停止服务器。", "Rename": "重命名", "Render the plan panel with block progress bars and status glyphs.": "使用块状进度条与状态符号显示计划面板。", - "Repeatable community-v1 measurements for cached models on this Mac.": "在此 Mac 的已缓存模型上执行可重复的 community-v1 测量。", + "Repeatable community-v2 measurements for cached models on this Mac.": "在此 Mac 的已缓存模型上执行可重复的 community-v2 测量。", "repeated checks": "次重复检查", "Replace matching records from the backup": "使用备份替换匹配记录", "replaces the current instructions": "替换当前指令", diff --git a/app/src/lib/preferences/packs/zh-Hans/011.json b/app/src/lib/preferences/packs/zh-Hans/011.json index 6d87a6f2b37..c906d3b50e3 100644 --- a/app/src/lib/preferences/packs/zh-Hans/011.json +++ b/app/src/lib/preferences/packs/zh-Hans/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "使用固定 community-v1 代码/聊天样例,每个单元格测量五个样本;请先保存设置编辑并完成本地工作,且模型必须已缓存并确认适合此 Mac。", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.": "使用固定 community-v2 代码/聊天样例,每个单元格测量五个样本;请先保存设置编辑并完成本地工作,且模型必须已缓存并确认适合此 Mac。", "Use gateway-qualified model ids such as": "使用网关限定的模型 ID,例如", "Use installed": "使用已安装版本", "Use light, dark, or match your system.": "使用浅色、深色或跟随系统。", diff --git a/app/src/lib/preferences/packs/zh-Hans/extra-000.json b/app/src/lib/preferences/packs/zh-Hans/extra-000.json index f7cbfdf2704..98320c01207 100644 --- a/app/src/lib/preferences/packs/zh-Hans/extra-000.json +++ b/app/src/lib/preferences/packs/zh-Hans/extra-000.json @@ -106,7 +106,7 @@ "After this change": "此次更改后", "All": "全部", "All assistant sources": "所有助手来源", - "All community-v1 cells meet the complete protocol.": "所有 community-v1 单元格均满足完整测试协议。", + "All community-v2 cells meet the complete protocol.": "所有 community-v2 单元格均满足完整测试协议。", "Allow Kokoro watch replies for {value0}": "允许 {value0} 接收 Kokoro 手表回复", "Allow private network for {value0}": "允许 {value0} 使用私有网络", "Allowed": "已允许", diff --git a/app/src/lib/preferences/packs/zh-Hans/extra-004.json b/app/src/lib/preferences/packs/zh-Hans/extra-004.json index 7ecbd9b02ca..54834fe86d7 100644 --- a/app/src/lib/preferences/packs/zh-Hans/extra-004.json +++ b/app/src/lib/preferences/packs/zh-Hans/extra-004.json @@ -165,7 +165,7 @@ "The community page could not open; try again in your browser.": "无法打开社区页面;请在浏览器中重试。", "The comparison could not finish.": "比较无法完成。", "The comparison stopped before changing the engine.": "比较在更改引擎前已停止。", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.": "未满足完整 community-v1 协议;不完整单元格不是性能评分。", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.": "未满足完整 community-v2 协议;不完整单元格不是性能评分。", "The conversation could not be renamed.": "无法重命名对话。", "The document worker is not installed.": "未安装文档工作者。", "The download action could not complete. Try again.": "下载操作无法完成。请重试。", diff --git a/app/src/lib/preferences/packs/zh-Hant/008.json b/app/src/lib/preferences/packs/zh-Hant/008.json index 53d9da98e1e..9f0c18a3601 100644 --- a/app/src/lib/preferences/packs/zh-Hant/008.json +++ b/app/src/lib/preferences/packs/zh-Hant/008.json @@ -28,7 +28,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server." : "移除文件夾會停止在其中發現模型,絕不會刪除模型;運行中的模型會保持加載,直到你停止服務器。", "Rename" : "重命名", "Render the plan panel with block progress bars and status glyphs." : "使用塊狀進度條與狀態符號顯示計劃面板。", - "Repeatable community-v1 measurements for cached models on this Mac." : "在此 Mac 的已緩存模型上執行可重復的 community-v1 測量。", + "Repeatable community-v2 measurements for cached models on this Mac." : "在此 Mac 的已緩存模型上執行可重復的 community-v2 測量。", "repeated checks" : "次重復檢查", "Replace matching records from the backup" : "使用備份替換匹配記錄", "replaces the current instructions" : "替換當前指令", diff --git a/app/src/lib/preferences/packs/zh-Hant/011.json b/app/src/lib/preferences/packs/zh-Hant/011.json index 1f423a403db..e10c20d4959 100644 --- a/app/src/lib/preferences/packs/zh-Hant/011.json +++ b/app/src/lib/preferences/packs/zh-Hant/011.json @@ -1,5 +1,5 @@ { - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac." : "使用固定 community-v1 代碼/聊天樣例,每個單元格測量五個樣本;請先保存設置編輯並完成本地工作,且模型必須已緩存並確認適合此 Mac。", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac." : "使用固定 community-v2 代碼/聊天樣例,每個單元格測量五個樣本;請先保存設置編輯並完成本地工作,且模型必須已緩存並確認適合此 Mac。", "Use gateway-qualified model ids such as" : "使用網關限定的模型 ID,例如", "Use installed" : "使用已安裝版本", "Use light, dark, or match your system." : "使用淺色、深色或跟隨系統。", diff --git a/app/src/lib/preferences/packs/zh-Hant/extra-000.json b/app/src/lib/preferences/packs/zh-Hant/extra-000.json index be87c6e6559..a90f54302d6 100644 --- a/app/src/lib/preferences/packs/zh-Hant/extra-000.json +++ b/app/src/lib/preferences/packs/zh-Hant/extra-000.json @@ -103,7 +103,7 @@ "After this change" : "此次更改後", "All" : "全部", "All assistant sources" : "所有助手來源", - "All community-v1 cells meet the complete protocol." : "所有 community-v1 單元格均滿足完整測試協議。", + "All community-v2 cells meet the complete protocol." : "所有 community-v2 單元格均滿足完整測試協議。", "Allow Kokoro watch replies for {value0}" : "允許 {value0} 接收 Kokoro 手錶回復", "Allow private network for {value0}" : "允許 {value0} 使用私有網絡", "Allowed" : "已允許", diff --git a/app/src/lib/preferences/packs/zh-Hant/extra-004.json b/app/src/lib/preferences/packs/zh-Hant/extra-004.json index a382a8e9da0..8186f54350c 100644 --- a/app/src/lib/preferences/packs/zh-Hant/extra-004.json +++ b/app/src/lib/preferences/packs/zh-Hant/extra-004.json @@ -164,7 +164,7 @@ "The community page could not open; try again in your browser." : "無法打開社區頁面;請在瀏覽器中重試。", "The comparison could not finish." : "比較無法完成。", "The comparison stopped before changing the engine." : "比較在更改引擎前已停止。", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores." : "未滿足完整 community-v1 協議;不完整單元格不是性能評分。", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores." : "未滿足完整 community-v2 協議;不完整單元格不是性能評分。", "The conversation could not be renamed." : "無法重命名對話。", "The document worker is not installed." : "未安裝文檔工作者。", "The download action could not complete. Try again." : "下載操作無法完成。請重試。", diff --git a/app/src/lib/preferences/sources/006.json b/app/src/lib/preferences/sources/006.json index a38fbf41ddb..5735773fb87 100644 --- a/app/src/lib/preferences/sources/006.json +++ b/app/src/lib/preferences/sources/006.json @@ -228,7 +228,7 @@ "Removing a folder stops discovery there; it never deletes its models, and a running model stays loaded until you stop the server.", "Rename", "Render the plan panel with block progress bars and status glyphs.", - "Repeatable community-v1 measurements for cached models on this Mac.", + "Repeatable community-v2 measurements for cached models on this Mac.", "repeated checks", "Replace matching records from the backup", "replaces the current instructions", diff --git a/app/src/lib/preferences/sources/009.json b/app/src/lib/preferences/sources/009.json index 6c23673c0cb..1386fef9343 100644 --- a/app/src/lib/preferences/sources/009.json +++ b/app/src/lib/preferences/sources/009.json @@ -49,7 +49,7 @@ "Use document task", "Use existing Codex CLI subscription logins, including GPT 5.4/5.5 with reasoning effort.", "Use existing folder…", - "Use fixed community-v1 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.", + "Use fixed community-v2 code/chat fixtures with five measured samples per cell; save settings edits and finish local work first, and the model must be cached and confirmed to fit this Mac.", "Use gateway-qualified model ids such as", "Use installed", "Use light, dark, or match your system.", diff --git a/app/src/lib/preferences/sources/010.json b/app/src/lib/preferences/sources/010.json index 62b13ce9db2..1af926e2be2 100644 --- a/app/src/lib/preferences/sources/010.json +++ b/app/src/lib/preferences/sources/010.json @@ -12,7 +12,7 @@ "After this change", "All", "All assistant sources", - "All community-v1 cells meet the complete protocol.", + "All community-v2 cells meet the complete protocol.", "Allow Kokoro watch replies for {value0}", "Allow private network for {value0}", "Allowed", diff --git a/app/src/lib/preferences/sources/013.json b/app/src/lib/preferences/sources/013.json index b60193b0e5d..25782699101 100644 --- a/app/src/lib/preferences/sources/013.json +++ b/app/src/lib/preferences/sources/013.json @@ -171,7 +171,7 @@ "The community page could not open; try again in your browser.", "The comparison could not finish.", "The comparison stopped before changing the engine.", - "The complete community-v1 protocol was not satisfied; incomplete cells are not performance scores.", + "The complete community-v2 protocol was not satisfied; incomplete cells are not performance scores.", "The conversation could not be renamed.", "The document worker is not installed.", "The download action could not complete. Try again.", diff --git a/app/src/lib/room-worker-effort.test.ts b/app/src/lib/room-worker-effort.test.ts new file mode 100644 index 00000000000..8f0721b7d64 --- /dev/null +++ b/app/src/lib/room-worker-effort.test.ts @@ -0,0 +1,20 @@ +import assert from 'node:assert/strict' +import { activeRoomWorkerEffort } from './room-worker-effort' +import type { Ticket } from './types' + +const ticket: Ticket = { + id: 'ticket', projectId: 'project', title: 'Synthetic work', body: '', type: 'task', status: 'in_progress', + priority: 'medium', effort: 'small', tags: [], parentId: null, assignee: 'Builder', threadId: 'worker', + runState: 'running', order: 1, createdAt: 1, updatedAt: 1, + execution: { target: 'room', threadId: 'worker', reasoningEffort: 'low', startedAt: 1, finishedAt: null, + checks: [], blockers: [], reviewVerdict: null }, +} +assert.equal(activeRoomWorkerEffort([ticket], 'worker'), 'low') +assert.equal(activeRoomWorkerEffort([ticket], 'other-thread'), undefined, 'effort is scoped to the actual thread') +assert.equal(activeRoomWorkerEffort([{ ...ticket, runState: null }], 'worker'), undefined, 'parked runs clear the override') +assert.equal(activeRoomWorkerEffort([{ ...ticket, runState: 'done' }], 'worker'), undefined, 'settled runs restore manual defaults') +assert.equal(activeRoomWorkerEffort([{ ...ticket, execution: { ...ticket.execution!, finishedAt: 2 } }], 'worker'), undefined) +assert.equal(activeRoomWorkerEffort([{ ...ticket, execution: { ...ticket.execution!, threadId: 'old-worker' } }], 'worker'), undefined) +assert.equal(activeRoomWorkerEffort([{ ...ticket, execution: { ...ticket.execution!, target: 'solo' } }], 'worker'), undefined) +assert.equal(activeRoomWorkerEffort([{ ...ticket, execution: { ...ticket.execution!, reasoningEffort: undefined } }], 'worker'), undefined) +console.log('Room worker effort display checks passed: explicit thread ownership, active lifecycle and legacy/manual fallback.') diff --git a/app/src/lib/room-worker-effort.ts b/app/src/lib/room-worker-effort.ts new file mode 100644 index 00000000000..849b449905c --- /dev/null +++ b/app/src/lib/room-worker-effort.ts @@ -0,0 +1,7 @@ +import type { ReasoningEffortSetting, Ticket } from './types' + +export function activeRoomWorkerEffort(tickets: readonly Ticket[], threadId: string): ReasoningEffortSetting | undefined { + return tickets.find((ticket) => ticket.runState === 'running' && ticket.threadId === threadId + && ticket.execution?.target === 'room' && ticket.execution.threadId === threadId + && ticket.execution.finishedAt === null)?.execution?.reasoningEffort +} diff --git a/build.zig b/build.zig index e16067b1965..94dc3e33e42 100644 --- a/build.zig +++ b/build.zig @@ -125,6 +125,8 @@ pub fn build(b: *std.Build) void { @import("zig/build/h3_image_contract.zig").steps(b, target, optimize); @import("zig/build/h3_image_vision.zig").steps(b, target, optimize, test_step); @import("zig/build/ling_host.zig").tests(b, target, test_step); + @import("zig/build/inkling2_host.zig").tests(b, target, test_step); + @import("zig/build/gpt_oss_host.zig").tests(b, test_step); @import("zig/build/digest.zig").steps(b, test_step, draft_ids, build_options); @import("zig/build/flashnext_budget.zig").steps(b, test_step); @import("zig/build/flashnext_batch_host.zig").tests(b, test_step); @@ -216,6 +218,7 @@ pub fn build(b: *std.Build) void { @import("zig/build/tp.zig").add(b, target, optimize, test_step, tp_options); @import("zig/build/tp_check.zig").add(b, target, test_step); @import("zig/build/gradient_host.zig").add(b); + @import("zig/build/glm_pdl_scan.zig").add(b); @import("zig/build/living_tools_host.zig").steps(b); cuda_build.hostTests(b, draft_ids, build_options, test_step, target.result.os.tag != .macos); @import("zig/build/env_defaults.zig").steps(b, draft_ids, test_step); diff --git a/build.zig.zon b/build.zig.zon index 526c7a4685f..6fe11a29bd8 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,6 @@ .{ .name = .tensorfold, - .version = "1.2.10", + .version = "1.3.0", .fingerprint = 0xb6dc5a482d53980a, // Changing this has security and trust implications. .minimum_zig_version = "0.17.0", .dependencies = .{}, diff --git a/docs/api.md b/docs/api.md index 69c1304b18e..e5cd1909494 100644 --- a/docs/api.md +++ b/docs/api.md @@ -45,8 +45,8 @@ different scopes, or scopes a key the flags or environment already give, is refu | Scope | Routes | | --- | --- | -| `inference` | POST `/v1/chat/completions`, `/v1/completions`, `/v1/responses`, `/v1/messages`, `/v1/messages/count_tokens`, `/v1/tokenize`, `/v1/detokenize`, `/v1/apply-template`, `/v1/audio/speech`, `/v1/images/generations`, `/v1/embeddings`, `/v1/decisions`, `/v1/systemone`, `/score`, `/v1/score`, `/v2/rerank`, `/v1/rerank` (also by PUT), `/v1/ocr`, and the same paths without `/v1` where the server has them; GET `/v1/models`, `/models`, `/v1/voices`; a WebSocket upgrade on GET `/v1/responses` or `/responses` | -| `read` | GET `/metrics`, `/v1/metrics`, `/v1/load`, `/memory`, `/v1/memory`, `/stats`, `/dashboard`, `/v1/benchmark/manifest`, `/v1/models`, `/models`, `/v1/voices` | +| `inference` | POST `/v1/chat/completions`, `/v1/completions`, `/v1/responses`, `/v1/messages`, `/v1/messages/count_tokens`, `/v1/tokenize`, `/v1/detokenize`, `/v1/apply-template`, `/v1/audio/speech`, `/v1/images/generations`, `/v1/embeddings`, `/v1/decisions`, `/v1/systemone`, `/score`, `/v1/score`, `/v2/rerank`, `/v1/rerank` (also by PUT), `/v1/ocr`, and the same paths without `/v1` where the server has them; GET `/v1/models`, `/models`, `/v1/models/{id}`, `/models/{id}`, `/v1/voices`; a WebSocket upgrade on GET `/v1/responses` or `/responses` | +| `read` | GET `/metrics`, `/v1/metrics`, `/v1/load`, `/memory`, `/v1/memory`, `/stats`, `/dashboard`, `/v1/benchmark/manifest`, `/v1/models`, `/models`, `/v1/models/{id}`, `/models/{id}`, `/v1/voices` | A scoped key reaches nothing else: not the stored Responses (GET or DELETE `/v1/responses/ID`), Recall, Sliding Weights, `/v1/imprint`, adding or deleting voices (`--manage-voices`), another method, or a suffix alias such as `/alt/completions` @@ -114,6 +114,7 @@ routes still require when keys are on. Without the flag no reply carries a CORS | Route | Behavior | | --- | --- | | `GET /v1/models` | Served model ID and any configured aliases (both servers); native entries carry [capabilities](#model-capabilities) | +| `GET /v1/models/{id}` | One served ID or alias: the entry `/v1/models` lists for it, or 404 `model_not_found` (native server; see [One model](#one-model)) | | `GET /health` | Liveness, the served model, the queue and live rates; open with keys (see [Health](#health)) | | `GET /memory`, `GET /v1/memory` | Native read-only memory snapshot ([memory diagnostics](memory-diagnostics.md)) | | `GET /metrics`, `GET /v1/metrics` | Prometheus text: requests, KV occupancy, drafts and latency (both servers) | @@ -181,6 +182,16 @@ Discovery and boolean request checks use the same loaded flag reader. Publicatio Flags describe the engine; request combinations, context, template and format constraints still apply. greedy_only and plain_only describe restrictions, and context_fitted says the context was limited to memory. +## One model + +`GET /v1/models/{id}` (or `/models/{id}`) is OpenAI's retrieve-model route on the native server. For the served name or +one of its `--alias` names it returns the object `GET /v1/models` lists for that id, capabilities included. The id is +percent-decoded once, so `org/name` may be sent as written or as `org%2Fname`; an id holding a `%` that starts no hex +pair is matched as written. Any other id answers 404 with `"code": "model_not_found"`, `"type": "invalid_request_error"`, +`"param": "model"` and the decoded id in the message. A path that ends in `/models` still lists every model; send an +id ending in `/models` as `org%2Fmodels`. Keys and [key scopes](#key-scopes) apply as they do to `GET /v1/models`. +The Python 0.6.6 server, the other server that lists models, has no such route. + ## Decisions `POST /v1/decisions` is served by Flash Next on one CUDA GPU, by LFM2 on CUDA and by Gemma 4 on XPU. @@ -260,7 +271,7 @@ context-window check still applies. Cohere-style requests retain the reranker's ## OCR -The native HIP engine reads page images through Mistral's OCR contract when it serves a model with an OCR reader +The native HIP engine reads pages through Mistral's OCR contract when it serves a model with an OCR reader and `--vision`. | Route | Contract | Request | Reply | Written for | @@ -296,41 +307,48 @@ The reader writes block text in one Markdown flavour, the one Mistral's page Mar - Images are PNG, JPEG or WebP, one page each, up to the 32 MiB body limit and the reader's decoded-pixel limit: 16 megapixels and 8192 pixels a side for dots.mocr; a larger image is bad input. An image whose header and decoded pixels disagree is refused as bad input. -- PDF documents and `pages` are not read: a PDF document is HTTP 400 "PDF documents are not read on POST /v1/ocr; - send each page as a PNG, JPEG or WebP image", and any non-null `pages` is HTTP 400 "pages selects pages of a PDF - document; POST /v1/ocr reads one page image". -- `https://` URLs (`document_url` and `image_url`) are fetched only with `--vision-urls`: images, at most 32 MiB. - `http://` URLs are refused. +- PDFs need `--vision-pdf`. PDFium renders each selected page at up to 144 DPI, at most 2048 pixels a side and + about 3.6 megapixels; boxes and sizes are in pixels of the rendered page. Mistral reports that DPI (72 for an + image). Every PDF of a request is measured before the first page is read (its page count and each selected + page's size, with no rendering), so a page index out of range, the page budget or a page that does not load fails + before any GPU work. Each page is then rendered just before it is read and freed when it is done, so one rendered + page is in memory at a time; a page that loads but does not render fails the request when it is reached. +- `https://` URLs (`document_url` and `image_url`) are fetched only with `--vision-urls`: images, and PDFs when + `--vision-pdf` is on, at most 32 MiB. `http://` URLs are refused. +- Page budget: images count one page each and PDFs their selected pages; a request reads at most + `TENSORFOLD_MAX_PDF_PAGES` pages (default 16, also the most it may be set to). `--vision-max-images` does not + apply. Over the budget, a request is refused before any inference. - Image budget, for Mistral crops (`include_image_base64`): at most 256 encoded images, 4 times the request's page pixels, and 16 MiB plus 2 MiB a page of encoded bytes. Crossing one fails the whole request as an unreadable page, "too many image regions". The encode needs libjpeg-turbo 3.1.4.1 (`TENSORFOLD_LIBTURBOJPEG` names its file); without it `include_image_base64` is HTTP 400. -The page is read as one user turn (the page image, then the reader's prompt), greedy, with thinking off and -`max_tokens` equal to all the context the prompt leaves. It succeeds only when the reply stops on its end token -and the reader can parse it. +Pages are read one at a time, each as one user turn (the page image, then the reader's prompt), greedy, with +thinking off and `max_tokens` equal to all the context the prompt leaves. A page succeeds only when the reply +stops on its end token and the reader can parse it. ### Failures | Failure | Mistral | | --- | --- | -| Bad input: an undecodable or unsupported file, a page or option the server cannot serve | 400 | +| Bad input: an undecodable or unsupported file, a page or option the server cannot serve, over the page budget | 400 | | Unreadable page: the reply was cut at the context limit, repeated without end, broke the model's format or gave a box that is not finite; the image budget was crossed | 422 | | The engine stopped the page (it closed or drained) | 503, `Retry-After: 1` | -| Engine fault or out of memory | 500 | +| Engine fault, out of memory, PDF renderer crash or deadline | 500 | | Envelope | `{"detail": [{"loc", "msg", "type"}]}`, `type` `bad_input`, `unreadable_page`, `capacity` or `internal` | -An unreadable page's message names its index, and the model's raw text goes to the server log, never to the -client. 422 means the same request fails the same way again under greedy decoding; a 503 carries `Retry-After`. -A client that disconnects stops the request before its page is read. +A failed page fails the whole request: no reply returns some pages and drops others. An unreadable page's +message names its index, and the model's raw text goes to the server log, never to the client. 422 means the +same request fails the same way again under greedy decoding; a 503 carries `Retry-After`. A client that disconnects +stops the request before its next page or PDF render. ### Mistral: `POST /v1/ocr` | Field | Meaning | | --- | --- | | `model` | Any string or null. The reply names the requested id when it is the served name or an `--alias`, else the served name, so `--alias mistral-ocr-latest` lets copied examples echo it | -| `document` | `{"type": "document_url", "document_url"}` or `{"type": "image_url", "image_url"}` (a string or `{"url"}`): a `data:` URL, or an `https://` URL as above. The bytes must be a PNG, JPEG or WebP image; a PDF is HTTP 400 (above). `{"type": "file"}` is HTTP 400 | -| `pages` | Any non-null value is HTTP 400 (above): an image has one page | +| `document` | `{"type": "document_url", "document_url"}` or `{"type": "image_url", "image_url"}` (a string or `{"url"}`): a `data:` URL, or an `https://` URL as above. The bytes decide PDF or image. `{"type": "file"}` is HTTP 400 | +| `pages` | 0-based page indices as a list or a string such as `"0,2-4"`; duplicates are merged. An image has only page `0`. At most 1024 entries (a range counts its length) before merging, and the page budget after | | `table_format` | Null: tables stay in the page Markdown as pipe tables (a spanned HTML table becomes a pipe table with the spanned text in its first cell). `"markdown"` or `"html"`: each table becomes a `tables[]` entry (`tbl-N.md` or `tbl-N.html`) and the Markdown links it; under `"markdown"` a table with spanned cells stays HTML, the only form that keeps it | | `extract_header`, `extract_footer` | Move page headers or footers out of `markdown` into `header` and `footer` | | `include_blocks` | Default `true`: one block for each region with a box. `false` leaves `blocks` out | @@ -344,8 +362,7 @@ A client that disconnects stops the request before its page is read. `dimensions` (`dpi`, `height`, `width`) and `blocks`; `hyperlinks` is left out. A block has `type` (`text`, `title`, `list`, `table`, `equation`, `code`, `caption`, `header`, `footer` or `image`), an integer box and `content`, its own Markdown with its tables in the `table_format` form; image blocks add `image_id` and table -blocks `table_id`. `usage_info` gives `pages_processed` and `doc_size_bytes`, the decoded document's size. An -image's `dimensions.dpi` is 72. +blocks `table_id`. `usage_info` gives `pages_processed` and `doc_size_bytes`, the decoded document's size. ## System One on a Clef engine @@ -598,9 +615,10 @@ are the exception: absent both, replies take 0.8 of that time and a filling prom from 32 to 512 rows after eight, while `--decode-share 0` keeps the 32-row steps with the prompt first. `TENSORFOLD_PREFILL_ORDER=srpt` lets a running reply that would end within a quarter of a filling long prompt's estimated time left take rounds first, the prompt keeping at least 10% of the time and lending at most a quarter of its own. It's the default for Qwen3.8-27B -on Metal when neither `--decode-share` nor `TENSORFOLD_PREFILL_SHARE` is set; any other value of the variable turns it off. With `--decode-share` it keeps that share when the prompt goes first and takes at most 10% when a reply does, and `--decode-share 0` still prefills each prompt whole. The CUDA, qwen27 Metal and -hip_serve servers pass the flag to their lane host and take its time share; the DeepSeek, Spark-X on Metal, Qwen4 -and XPU servers do not parse or apply the flag. `--decode-share 0` prefills each prompt +on Metal when neither `--decode-share` nor `TENSORFOLD_PREFILL_SHARE` is set; any other value of the variable turns it off. With `--decode-share` it keeps that share when the prompt goes first and takes at most 10% when a reply does, and `--decode-share 0` still prefills each prompt whole. The CUDA, qwen27 Metal, DeepSeek-V4.1 Metal and +hip_serve servers pass the flag to their lane host and take its time share (DeepSeek-V4.1 on Metal also runs prompts in +steps with it, replies taking 0.25 when it is absent and steps are on; `TF_DSV41_PREFILL_PIECES`); the DeepSeek CUDA, +Spark-X on Metal, Qwen4 and XPU servers do not parse or apply the flag. `--decode-share 0` prefills each prompt whole first, in arrival order, as 0.3.6.2 did. Background work waits behind foreground requests. An active background request yields when a foreground request needs its lane or memory, then restarts with already-delivered tokens diff --git a/docs/chat.md b/docs/chat.md new file mode 100644 index 00000000000..f0b43f433a8 --- /dev/null +++ b/docs/chat.md @@ -0,0 +1,82 @@ +# Chat in the terminal + +`tensorfold chat MODEL` starts `tensorfold serve MODEL` as a child of the same binary, waits until it is ready, chats +with the model, and stops the server when the chat ends. MODEL is a cached repo ID or a checkpoint directory, as for +`serve`; a repo ID that is not cached is refused before anything starts (`tensorfold pull` downloads it). + +```sh +tensorfold chat mlx-community/Qwen3.5-2B-MLX-4bit +tensorfold chat TensorFold/Qwen3.8-27B-MLX-4bit -- --parallel 1 --drafter z-lab/Qwen3.8-27B-DFlash2 +tensorfold chat --url http://127.0.0.1:8080 +echo "Say hello in one sentence." | tensorfold chat --url http://127.0.0.1:8080 local-model +``` + +Type a message and press Enter. Each turn sends the whole conversation to `POST /v1/chat/completions` with +`"stream": true` and prints the answer as it arrives. Lines are read one at a time, without line editing. + +| In the chat | Does | +| --- | --- | +| `/bye` or Ctrl-D | Ends the chat | +| `/clear` | Forgets the conversation; the system prompt stays | +| `/system TEXT` | Sets the system prompt; `/system` alone removes it | +| `/help` | Lists these commands | +| Ctrl-C | During a reply, stops it and closes its stream; at the prompt, says how to end the chat | + +A line that starts with `/` is a command; start it with a space to send it as a message. A finished reply is kept in +the conversation, and so is the part of a stopped reply that was printed; a refused or failed turn is not kept, so it +can be sent again. + +## Flags + +| Flag | Meaning | +| --- | --- | +| `--url URL` | Chat with a server that is already running at this http(s) address, with or without `/v1`. MODEL then names the model to ask for; without it, the first `id` in `GET /v1/models`. See [A running server's key](#a-running-servers-key) | +| `--system TEXT` | The system prompt | +| `--temperature T` | The request's `temperature`; 0 is greedy. Without it the server's default applies | +| `--max-tokens N` | The request's `max_tokens`. Without it the server's default applies | +| `--show-thinking` | Shows the reply's `reasoning_content` (or `reasoning`) dimmed before the answer. Reasoning is hidden by default, with a `thinking...` hint on a terminal | +| `--no-thinking` | Sends `chat_template_kwargs: {"enable_thinking": false}`. Refused before the first turn when `/v1/models` says the model's template cannot turn thinking off (`thinking_switch` false) | +| `--startup-timeout S` | Seconds the started server gets to load: by default 600, plus 6 per GB of weights past 20 GB, at most 3600 | +| `-- SERVE_FLAGS` | Everything after `--` goes to the started `tensorfold serve` | + +## The started server + +The server listens on 127.0.0.1 at a free port, in a process group of its own so that a terminal's Ctrl-C reaches +only the chat. It starts with the environment `tensorfold benchmark` gives its server: without +`TENSORFOLD_REQUEST_LOG` or `TENSORFOLD_SEED_SALT`, with `HF_HUB_OFFLINE=1`, and with no live line or update check. +It also gets a key of its own, so that it answers this chat and no other local user: 32 random bytes as hex, passed +only in its environment as `TENSORFOLD_API_KEY`, never on its command line. A `TENSORFOLD_API_KEY` the chat itself +was given is not passed on. The chat sends the key as `Authorization: Bearer` on every request to the server, the +readiness probe's included, and never prints it or writes it to the server's log. +Serve's own parser checks the flags after `--` before the server starts. `--host`, `--port`, `--api-key` and +`--api-key-file` are refused there, because the chat chooses the address and the key; `--name` is kept. +If the server exits while it loads, or before a later turn reaches it, the chat prints the server's last log lines +and exits 1. + +Starting a server is not supported on Windows yet, and is refused by name: run `tensorfold serve`, then chat with +`--url`. On Windows, Ctrl-C ends the chat. + +## A running server's key + +With `--url`, the chat sends the key in `TENSORFOLD_API_KEY` as `Authorization: Bearer` on every request, so it can +chat with a server started with `--api-key`, `--api-key-file` or `TENSORFOLD_API_KEY`. When the variable lists +several keys separated by commas, as serve reads it, the first is sent. With the variable unset or empty, no key is +sent. A key with a space or a control character, or one over 256 bytes, is refused before any request. +A 401 names the variable: `HTTP 401: A valid API key is required; set TENSORFOLD_API_KEY to a key the server +accepts` when none was sent, or `...; the server refused the key in TENSORFOLD_API_KEY` when one was. + +## Scripts + +When stdin is not a terminal, all of stdin (up to 16 MiB, surrounding blank space trimmed) is one message. Only the +reply is written to stdout; status lines and errors go to stderr. The exit code is 0 when the reply finished, 1 when +it was refused, failed or could not be sent, 2 for a usage error and 130 for Ctrl-C. +When stdout is not a terminal the reply is written as the server sent it. On a terminal, control characters other +than newline and tab are dropped, so a reply cannot move the cursor or change the terminal's colors. + +A refusal prints its status and message, such as `HTTP 400: This server's maximum context length is 8192 tokens`, +and an error event in the stream prints its message. A reply cut at its token limit says so on stderr, and so does a +reply that held only reasoning while reasoning is hidden. + +Run `zig build test-chat-cli-host` for the host tests: they chat with a fake server over loopback, with a shell +stand-in for the started server, and need no model or GPU. `zig build check-chat-windows-host` compiles the command +for Windows. diff --git a/docs/environment.md b/docs/environment.md index fc606a7996b..6f04814c4ae 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -27,6 +27,19 @@ Diagnostics quote and escape the supplied text so it cannot create another termi | `TF_Q27_COPY_ROWS` | Whole u32 count; zero disables copied rows; default 48 | | `TF_Q27_DRAFT_SLOTS` | Whole u32 count, clamped to 1 through the lane stream limit; default 8. DFlash2 can draft for at most the smaller of this count and the admitted streams, and none without a drafter. | | `TF_MTP_DRAFTS` | Whole u32 count, clamped to 1 through the drafter's window less one; existing depth when unset | +| `TF_TIMING` | Exactly `0` or `1`; default off (each call's wall time on stderr while set) | +| `TF_NO_TREES` | Exactly `0` or `1`; default off. `1` keeps the CUDA drafter's chains only, and retains precedence over `TF_DRAFT_NODES` | +| `TF_MTP_TREES` | Exactly `0` or `1`; default off (1 turns the MTP drafter's trees on) | +| `TF_MTP_BATCH` | Exactly `0` or `1`; default on. `0` keeps one stream at a time | +| `TF_QWEN_KEEP_LATE` | Exactly `0` or `1`; default off | +| `TF_QWEN_KV_PAGE_TEST` | Whole page size from 1 to 2147483647; unset off. Each cache's own buffer reads through a table of n-position pages in reverse order (checks) | +| `TF_QWEN_POOL_LOG` | Exactly `0` or `1`; default off (the pool's census after a prompt pass) | +| `TF_COST_KEY_TRACE` | Exactly `0` or `1`; default off (each cost key's parts on stderr) | +| `TF_Q27_POCKET_OFF` | `all`, or a list of `layer:neuron` pairs; default off (pocket diagnostics) | +| `TF_Q27_TAIL` | Exactly `off`; default off — each nudged sequence's tail rows are the backward's rows | +| `TF_Q27_GEMM` | Exactly `narrow`; default the 128x128 tiles | +| `TENSORFOLD_MEMORY_RESERVE_GIB` | A finite GiB amount; the HIP admission's floor (0.5, or 2 on shared memory) and the memory's size still bound it | +| `TENSORFOLD_HIP_MEMORY_LIMIT_GB` | A positive finite GiB amount whose byte count fits a 64-bit size | | `TF_DSPINE_WINDOW` | Qwen3.8-27B on CUDA with a DSpine `--drafter`: whole row count 16 through 8192 that narrows the drafter's sliding window; it must be at least the block (16) and at most the checkpoint's own `sliding_window`, else the drafter is refused when it opens; unset or blank keeps the checkpoint's (8192 for tencent/Qwen3.8-27B-DSpine-b16) | | `TF_DRAFT_NODES` | Whole native-size nonnegative count, capped by the drafter's window; zero disables trees | | `TF_QMMF_HALF_BELOW` | Whole native-size nonnegative block count; zero disables half tiles; default 96 | @@ -43,7 +56,7 @@ Diagnostics quote and escape the supplied text so it cannot create another termi | `TF_GLM_VISION_HOST` | Exactly `0` or `1`; default off (GLM vision weights on the device) | | `TF_GLM_PROF` | Exactly `0` or `1`; default off (no GLM section timing). On, a prompt step is one chunk, with no pair or solo steps, so its prompt timings are of that shape | | `TF_GLM_LINK_WAIT` | Exactly `0` or `1`; default off (short GLM steps go to the other ranks unwaited) | -| `TF_GLM_PDL` | Exactly `0` or `1`; default on (GLM matmuls use dependent launches) | +| `TF_GLM_PDL` | Exactly `0` or `1`; default on (GLM's kernels and its qmmf linears use dependent launches) | | `TF_GLM_PROMPT_STEPS` | Exactly `0` or `1`; default on (GLM prompt passes in chunks); read on rank 0 | | `TF_GLM_SHARED` | Exactly `0` or `1`; default on (GLM windows share a forward); read on rank 0 | | `TF_GLM_DSEL` | Exactly `0` or `1`; default on (a GLM decode window's DSA select runs on many CTAs; 0 keeps one CTA a row) | @@ -61,8 +74,12 @@ Diagnostics quote and escape the supplied text so it cannot create another termi | `TF_MINIMAX_WORLD` | MiniMax-M3.1-Flash on CUDA: a whole rank count, 2 at CUDA, set with `TF_MINIMAX_RANK`; unset with it gives one rank | | `TF_PROMPT_ROWS` | Native serving: a multiple of 16 from 128 through 2048; unset keeps the chip/family default | | `TF_ANE_COLUMNS` | Whole u32 count; zero disables the experimental share; default zero | +| `TF_METAL4` | Metal: exactly `0` or `1`; `1` sends a family's GPU work through Metal 4 (macOS 26 and later) where the family supports it: the same kernels in the same order, with Metal 4's command queue, allocators, argument tables and barriers, and bit-identical outputs; `0` keeps Metal 3. DeepSeek-V4.1 defaults to `1` where the Mac has Metal 4 (its device test rigs to `0`); Macs without it stay on Metal 3 | +| `TF_DSV41_ROUND_PROF` | DeepSeek-V4.1 on Metal: exactly `0` or `1`; `1` logs decode rounds' host milliseconds (first encode to last wait) and GPU milliseconds by rows, every 1,024 rounds; default 0 | +| `TF_METAL4_TIMELINE` | Metal 4: a whole round count, default 0; `n` puts a GPU timestamp at every stage (between barriers) of `n` rounds of each kind a family names, after 8 warm ones, and logs their time by kernel and the longest stages. DeepSeek-V4.1 names its decode rounds by rows. Stamps cost GPU time, so stamped rounds read a little long | | `TF_FLASHNEXT_SCALE_INDEX` | Flash Next on Metal before tensor units: exactly `0` or `1`; default 1, where the 4-bit expert kernels (decode, grouped and prompt gathers) read each group's scale and bias through a 16-bit index into its tensor's table of pairs, the same values from fewer weight bytes, and the routed experts' stored scales and biases are not kept in memory; `0` keeps and reads the stored arrays; ignored with `--ssd-experts` | | `TF_FLASHNEXT_GROUPED_ROWS` | Flash Next on Metal without tensor units: `0`, or the rows (`1` through `32`) from which a decode window runs its 4-bit experts grouped by expert, with the same output bits; default 5; ignored with `--ssd-experts` and in speed-up mode | +| `TF_QWEN27_SHARED_PREFIX` | Qwen3.8-27B on Metal before M5: exactly `0` or `1`; `0` keeps cached keys on the tail attention kernel; unset or blank is `1` | | `TF_QWEN27_SLOT_RESUME` | Qwen3.8-27B on Metal: exactly `0` or `1`; `0` stops slot 0 resuming a later prompt; unset or blank keeps it on | | `TF_QWEN27_METAL_KV_PAGES` | Qwen3.8-27B on Metal: exactly `0` or `1`; `1` puts keys and values in core-pool pages (refused on Macs with tensor units); unset or blank is `0` | | `TF_QWEN27_JOIN` | Qwen3.8-27B on Metal before M5: exactly `0` or `1`; `1` runs a window's rows in pairs over the keys below it in the decode tail attention (same replies); unset or blank is `1` | @@ -74,6 +91,7 @@ Diagnostics quote and escape the supplied text so it cannot create another termi | `TF_DSV41_CALIB_FILE` | DeepSeek-V4.1 on Metal: a cost table file (JSON: `verify`, each window's ms by its rows from 1, and `draft`, the drafter pass's ms) that prices draft depth instead of the built-in table. Measure it on the machine that serves; pricing never changes a token. Unset: the built-in table. | | `TF_DSV41_ENGRAM_VERIFY` | DeepSeek-V4.1 on Metal: exactly `sample` or `full`; `full` also checks every byte of the Engram tables against their manifest at boot; default `sample` | | `TF_DSV41_ENGRAM_CACHE` | DeepSeek-V4.1 on Metal: whole u32 count of Engram records a layer kept cached; default 65536 | +| `TF_DSV41_PREFILL_PIECES` | DeepSeek-V4.1: exactly `0` or `1`, default 0. On CUDA, `1` lets the round planner run prompt pieces and decode rows in one pass; on Metal, `1` runs a prompt a chunk at a time between the other streams' rounds (as `--decode-share` above 0, `TENSORFOLD_PREFILL_ORDER=srpt` or a `TENSORFOLD_PREFILL_POLICY`, `_SHARE` or `_BUDGET` also do), replies taking `--decode-share`, else `TENSORFOLD_PREFILL_SHARE`, else 0.25 of wall time beside it; malformed text stops the start naming it | | `XPU_A8_BITS` | Exactly `4` or `8`, for the XPU quantization study; unset keeps the study's existing setting | | `LFM3_FUSE` | Whole u32 fusion mask; default 7 | | `TF_SLIDE_POCKET_KEY` | Exactly `auto`, `reply`, `subject` or `both`; default `auto` | @@ -138,7 +156,7 @@ stops the start with the variable, the supplied text and the accepted forms. | `TF_FLASHNEXT_GREEDY_WIDE` | Whole round width; default 4 | | `TF_FLASHNEXT_WINDOW_ROWS` | Whole row count; default the shared round's rows, capped by them | | `TF_FLASHNEXT_READOUT_ROWS` | Whole row count; default 64; `0` never takes the tiles | -| `TF_FLASHNEXT_CHUNK` | Whole prompt rows a pass, 1 through 16384; default 1536 | +| `TF_FLASHNEXT_CHUNK` | Whole prompt rows a pass, 1 through 16384; default 3072 | | `TF_FLASHNEXT_CHUNK_SOLO` | Whole prompt rows a pass with no stream decoding, from the chunk `TF_FLASHNEXT_CHUNK` resolves to through 16384; unset or blank is the larger of that chunk and 8192 on a server of one stream, and that chunk elsewhere | | `TF_FLASHNEXT_FACT_ROWS` | Whole row count; default 64; `0` never takes the tiles | | `TF_FLASHNEXT_KV_PAGE_TEST` | Whole page size the kernels take: whole blocks of the indexer's ratio up to the window; unset or blank leaves the plain caches | diff --git a/docs/kernel-contract.md b/docs/kernel-contract.md index 862e8594d23..72820f80165 100644 --- a/docs/kernel-contract.md +++ b/docs/kernel-contract.md @@ -112,8 +112,10 @@ fails a record whose mode is not the zebin's `grf_count`. `tf-xpu-kernel-contrac directory another host built. The `RECORD` lines are the values `xpu_records.zig` holds for that ocloc. On an Arc Pro B70, `zig build -Dxpu-contract=true tf-xpu-contract-run` builds `tf-xpu-contract-run` with the zebins -linked in, and `./tf-xpu-contract-run [--device N]` runs gates 1 to 4 over nine registrations of the Qwen3.8-27B glue's -`add_rmsnorm`, `add_rmsnorm_dec`, `gated_norm`, `swiglu`, `argmax` and `embed`, the five planted controls, and gate 5 +linked in, and `./tf-xpu-contract-run [--device N]` runs gates 1 to 4 over ten registrations of the Qwen3.8-27B glue's +`add_rmsnorm`, `add_rmsnorm_dec`, `gated_norm`, `swiglu`, `argmax`, the top-k a sampled row draws from (`topk_part` and +`topk_merge`) and `embed`, the seven planted controls (the top-k's two: a merge breaking ties the wrong way, red at +`shapes`, and a flag read off the candidates only, red at `nonfinite`), and gate 5 live: the card's own properties against the BMG-G31 row and every loaded kernel's against its record. It loads the same native zebins the audit reads, so the GRF mode the record states is the loaded image's. Its `SUMMARY` line names the PCI id it ran on. `xpu-contract-run` runs it on this card. On a host without ocloc, `-Dxpu-images=DIR` links zebins that @@ -369,6 +371,13 @@ HIP also checks Flash Next's indexer block score kernel (`tf_fn_idx_scores`, `co `hip_records_sparse.zig`): staging each tile's rows of `q` in LDS when `heads * dims <= 512`, checked against the fp64 relu-summed head dots with one control leaving out each row's last head (`shapes`). +HIP also checks EXL3's projections for decode rows (`exl3/exl3.hip`, CUDA's `exl3_block/linear.cu`): `tf_exl3_rot_in` +(bf16 rows times suh, rotated by 128 and rounded to fp16) and `tf_exl3_linear` at 2, 3, 4, 5, 6 and 8 bits (mul1) on 4 +and 8 waves, each against float64 at deepseek_v41's indexer wk and Engram wkv (and its head at 8 bits) and the plan's +8-wave edge. The linear's gate 4 is exact: all-ones trellis states give one weight (-0.651 at every width), so 6144 +terms of 4096 times it stay integers under 2^24 where fp16 overflows. Two controls: rot_in reading the next block's suh, +and the linear reading its input rows one row late. + On gfx12, HIP also checks the WMMA dense tile (`dense_wmma12_gemm`, both block geometries, fp32 and BF16 out). The small block meets its depth-k bound. The big block (64-deep K steps over swizzled LDS rows) replaces the 32-deep block it was before #2245's second lever, byte for byte: gate 3 runs a frozen copy of that block (`tf_ref_wmma12_k32`, in the @@ -529,7 +538,8 @@ the split chunks reading a rank's page z as chunk z, and the per-rank merge one nvcc allocates registers differently from one release to the next, so the CUDA records are kept per release. `registry.cuda` holds what nvcc 13.0 compiles, the compiler of the release fatbins. `registry.cuda_sets` lists what each later release compiles differently from the release before it: nvcc 13.2's set holds `tf_rms_rows`, `lane_gemv` -and its split-K form, prompt16's FP8 tile, qmmf's FP4 32-row cluster tile, five 64-row fused-slice tiles of the MXFP8 +and its split-K form, prompt16's FP8 tile, qmmf's FP4 32-row cluster tile and its FP4 and MXFP8 16-row cluster +tiles, five 64-row fused-slice tiles of the MXFP8 and FP32-output paths, FP8G's 32-row cluster tile with FP32 output, the common EXL3 prompt products, Super's decode-sized latent top-k and NVFP4 up experts, the Mamba scan and Super's NVFP4 prompt down kernels, three of GLM-5.3-Flash's packed matmuls and three of its DFlash2 launches, and the training launches it compiles differently, diff --git a/docs/optimization-ledger.md b/docs/optimization-ledger.md index 658aa868898..128c354befc 100644 --- a/docs/optimization-ledger.md +++ b/docs/optimization-ledger.md @@ -81,6 +81,7 @@ last two hold the families with only a Metal, HIP or scoring backend. | 30. Small-kernel fusion | ? | failed H[#1603] | ? | ? | ? | | 31. Stream-tile prefetch | ? | failed H[#1603] | ? | ? | ? | | 32. Filled-item prompt grid | ? | failed H[#1603] | ? | ? | ? | +| 33. Dependent launches | ? | ? | open [#3652] | ? | ? | | Optimization | kol1 | spk25 | dory | mm3 | dsv41 | | --- | --- | --- | --- | --- | --- | @@ -103,7 +104,7 @@ last two hold the families with only a Metal, HIP or scoring backend. | 17. DSpark | yes | yes | yes | done¹ | done [#1751] | | 18. Copy drafts | done [#2022] | done [#2022] | done [#2022] | done [#2022] | done¹ | | 19. Shared drafts | no (copies) | no (copies) | no (copies) | open [#1426] | done¹ (opt-in) | -| 20. Solo chunks | yes | yes | yes | yes | yes | +| 20. Solo chunks | yes | yes | yes | yes | open M[#2950] | | 21. Read-ahead | done [#2033] | done [#2033] | yes | done [#2033] | done [#2033] | | 22. Direct load | yes | open [#2449] | open [#2449] | yes | open [#1924] | | 23. Page drop | done [#1884] | done [#1884] | done [#1884] | done [#1884] | done [#1884] | @@ -116,6 +117,7 @@ last two hold the families with only a Metal, HIP or scoring backend. | 30. Small-kernel fusion | ? | ? | ? | ? | ? | | 31. Stream-tile prefetch | ? | ? | ? | ? | ? | | 32. Filled-item prompt grid | ? | ? | ? | ? | ? | +| 33. Dependent launches | ? | ? | ? | ? | ? | | Optimization | lfm2m | lfm3 | qwen4 | ling | | --- | --- | --- | --- | --- | @@ -151,6 +153,7 @@ last two hold the families with only a Metal, HIP or scoring backend. | 30. Small-kernel fusion | ? | ? | ? | ? | | 31. Stream-tile prefetch | ? | ? | ? | ? | | 32. Filled-item prompt grid | ? | ? | ? | ? | +| 33. Dependent launches | ? | ? | ? | ? | q3.5 `qwen3_5` (C, M, H, X), fnext `flashnext` (C, M, H), glm `glm` (C, M), gem4 `gemma4` (C, M, X), nemo `nemotron` (C, M, H, X), kol1 `kolibri1` (C), spk25 `spark25` (C, M), @@ -192,6 +195,7 @@ ling `ling` (host package only, no engine yet; CUDA plan in [#850]). | 30. Small-kernel fusion | ? | ? | ? | ? | | 31. Stream-tile prefetch | ? | ? | ? | ? | | 32. Filled-item prompt grid | ? | ? | ? | ? | +| 33. Dependent launches | ? | ? | ? | ? | | Optimization | gdsa | kimi | qwen3 | | --- | --- | --- | --- | @@ -227,6 +231,7 @@ ling `ling` (host package only, no engine yet; CUDA plan in [#850]). | 30. Small-kernel fusion | ? | ? | ? | | 31. Stream-tile prefetch | ? | ? | ? | | 32. Filled-item prompt grid | ? | ? | ? | +| 33. Dependent launches | ? | ? | ? | q27 `qwen27` (M: Qwen3.8-27B and Qwen3.5-MoE), lfm2 `lfm2` (C: LFM2-VL, scores decisions and writes no text), llama `llama` (M), step5 `step5` (M), gdsa `glm_dsa` (M), kimi `kimi_k3` (M, native serving on [#2221]), @@ -276,6 +281,7 @@ below; these are estimates for planning a port, not results. | 30. Small-kernel fusion | none | low | none | HIP Flash Next: 1.2–2.0 % of a round for the hyper-connection block, 2.4–4.0 % for all four groups | | 31. Stream-tile prefetch | none | none | none | HIP Flash Next: the hyper-connection projections, no gain | | 32. Filled-item prompt grid | low | none | none | HIP Flash Next: prompt tok/s at most 1.2 % better | +| 33. Dependent launches | none | medium | none | the next kernel starts as one ends; GLM decode +4..+7 % | ## The optimizations @@ -434,6 +440,7 @@ below; these are estimates for planning a port, not results. | flashnext (C), one GPU | prompts 15–23 % faster at `--parallel 1`, up to 8,192 rows a pass | [#2246] | | glm (C), TP=2 | prompts about 2 % sooner at 8K–128K, two chunks a step, replies unchanged | [#1423] | | gemma4 (C) | first token 31B −4..−5 %, E4B −9..−10 %, opt-in with `TF_GEMMA4_CHUNK_SOLO` | [#2391] | + | deepseek_v41 (M) | a reply's longest pause beside a 131K prompt 203 → 7 s, prompt's first token level (M3 Ultra, opt-in) | [#2950] | `TF_GLM_CHUNK_SOLO=4096` is slower with GLM's NVFP4 checkpoint on two GB10s ([#2288]). @@ -522,6 +529,13 @@ below; these are estimates for planning a port, not results. | --- | --- | --- | | flashnext (H) | first-token ratios 0.99–1.01, prompt tok/s at most 1.2 % better, decode and concurrency level | [#1603], one Strix Halo iGPU (gfx1151) | +33. **Dependent launches.** On sm_90 and newer a kernel can launch while the one before it ends, then wait + (`griddepcontrol.wait`) only where it reads that kernel's output; a linear can stream its fixed weights in before + the wait. GLM ([#3652]) opens every kernel with the wait and its qmmf decode tiles load weights first: decode + +6.8 % plain and +4.0 % drafted at TP=2 on GB10, the same tokens. An input a predecessor writes must not be + `const __restrict__`, or ptxas may place its non-coherent load above the wait; `zig build check-pdl-loads` + checks the SASS. + [#458]: https://github.com/ashhart/TensorFold/pull/458 [#468]: https://github.com/ashhart/TensorFold/pull/468 [#519]: https://github.com/ashhart/TensorFold/pull/519 @@ -670,7 +684,9 @@ below; these are estimates for planning a port, not results. [#2375]: https://github.com/ashhart/TensorFold/pull/2375 [#2633]: https://github.com/ashhart/TensorFold/pull/2633 [#2634]: https://github.com/ashhart/TensorFold/pull/2634 +[#3652]: https://github.com/ashhart/TensorFold/issues/3652 [#2784]: https://github.com/ashhart/TensorFold/pull/2784 +[#2950]: https://github.com/ashhart/TensorFold/pull/2950 [#2764]: https://github.com/ashhart/TensorFold/issues/2764 [#1603]: https://github.com/ashhart/TensorFold/issues/1603 [#2977]: https://github.com/ashhart/TensorFold/pull/2977 diff --git a/docs/profiles.md b/docs/profiles.md index 3549677fd7b..242b10a18b8 100644 --- a/docs/profiles.md +++ b/docs/profiles.md @@ -51,7 +51,7 @@ Coverage includes: with `TENSORFOLD_DORY_KV_PAGES=0` it refuses to load, by both names. With the switch unset, the startup line shows `TENSORFOLD_DORY_KV_PAGES=1 (arithmetic, TF_KV_SHARE)` and kept states carry the same identity as `=1`. - Every CUDA family whose host prompt cache the CUDA host builds (Nemotron, Nemotron Omni, GLM, MiniMax M3, Qwen3.5 - dense/MoE, Flash Next, Kolibri-1, Gemma 4, Spark2.5, Dory, LFM2.5-24B-A2B): `TENSORFOLD_PROMPT_CACHE_KEEP_OTHERS`, + dense/MoE, Flash Next, Kolibri-1, Gemma 4, Spark2.5, Dory, LFM2.5-24B-A2B, Muse Spark Open): `TENSORFOLD_PROMPT_CACHE_KEEP_OTHERS`, exact `1` only. - Flash Next on CUDA: `TF_FLASHNEXT_KV_PAGES`, `TF_FLASHNEXT_KV_PAGES_ALL`. - Dory on CUDA: `TENSORFOLD_DORY_KV_PAGES`, full-attention caches in pool pages unless it is exactly `0`; unset, @@ -171,6 +171,9 @@ that each setting changed a reply. Each stable fallback is null. The release bac | `debug` | `TF_DSV41_LAYERS`, `TF_DSV41_NEEDS_POOL` | | `experimental` | `TF_DSV41_EXPERT_TOPP`, `TF_DSV41_OWN_PREFILL`, `TF_DSV41_PREFILL_PIECES`, `TF_DSV41_SLOTS`, `TF_DSV41_MHC_DEFER`, `TF_DSV41_DRAFTS`, `TF_DSV41_SAMPLING`, `TF_DSV41_IMAGES`, `TF_DSV41_BIAS_VL`, `TF_DSV41_ENGRAM_DIR`, `TF_DSV41_SCHEMA_PROMPT`, `TF_DSV41_TOOL_GRAMMAR` | +The DeepSeek-V4.1 Metal server also reads `TF_DSV41_PREFILL_PIECES`: there `1` runs a prompt in steps between the +other streams' rounds ([environment](environment.md)); `stable` leaves it absent, so prompts run whole. + The pool settings have separate rows because each can be set independently. `NEEDS_POOL` forces pool geometry in the AOT asset planner; it does not select the served engine's pool. Its class is therefore `debug`. The other pool classes conservatively retain the audit's `arithmetic` classification, without claiming exactness. diff --git a/docs/receipts/flashnext-prompt-chunk3072/README.md b/docs/receipts/flashnext-prompt-chunk3072/README.md new file mode 100644 index 00000000000..10a617e82c6 --- /dev/null +++ b/docs/receipts/flashnext-prompt-chunk3072/README.md @@ -0,0 +1,151 @@ +# Flash Next CUDA: a prompt pass holds 3,072 rows by default + +A Flash Next prompt pass held 1,536 rows at most while another stream decoded (`cuda_batch_state.zig`'s `default_chunk`), so a long prompt ran in passes of 1,536 and each lane admitted 1,536 rows a pass. It holds 3,072 now: about half the passes for a long prompt, each holding twice the rows, and the same 3,072 rows a lane's prompt admission. A server started at one stream is untouched: it takes 8,192-row passes on both sides (`cuda_chunk.zig`'s solo rule). `TF_FLASHNEXT_CHUNK` still overrides the default, 1 to 16,384. + +Result: cold prompts 6.4% to 9.8% faster to the first token idle and 12.2% to 17.2% beside three decoders (2k to 64k), `bench_cache`'s first cold request 7.2% faster; decode level at 1 to 8 streams; the one-stream control level; every exactness contract equal on both arms and every greedy reply equal across them. + +## Qualified scope + +TensorFold main `077998f7d9b14adebec3a2acc2caa47ff7ae6ec7` against main plus this change, commit `052e72a9c3eb6025b0f6a6095f06194fdc9a3313`, both built from source with Zig 0.17.0 and nvcc 13.3 in the `nvcr.io/nvidia/pytorch:26.07-py3` image (`zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Doptimize=fast fatbins install native`). One DGX Spark (GB10, sm_121, memory shared with the host), kernel driver 580.178.04. Checkpoint `nvidia/Qwen3.8-Flash-Next-FP4-Local` at `b9ce18a6887e18c089fdea8509a33e63429a3300`. + +Server per arm, through the serving recipe (`CHECKPOINT=nvfp4 KV_DTYPE=bf16 TENSORFOLD_CUDA_KERNELS=native VISION=0`); the container command line on the decode boots was: + +``` +tensorfold-native serve CHECKPOINT --name Qwen3.8-Flash-Next --host 127.0.0.1 --port 8080 --context 32768 --parallel 8 --max-tokens 32768 --temperature 1.0 --top-p 0.95 --top-k 20 --thinking --kv-cache bf16 +``` + +with `--context 131072 --parallel 4` and `--prompt-cache-gib 0` for the cold prompts, `--parallel 1` for the control and `--parallel 8` for the pool check at that window. The recipe exports these variables into the container, the same set on every boot of both arms (each boot's own environment was recorded and compared): + +``` +TENSORFOLD_CUDA_KERNELS=native +TENSORFOLD_IMAGE_TOKENS=16384 +TENSORFOLD_MAX_IMAGES=50 +TENSORFOLD_MEMORY_RESERVE_GIB=9 +TENSORFOLD_NO_UPDATE_CHECK=1 +TENSORFOLD_VIDEO_TOKENS=16384 +TENSORFOLD_VISION_PYTHONPATH=/opt/tensorfold/python +TENSORFOLD_VISION_WORKSPACE_MIB=2048 +TF_FLASHNEXT_CONFIDENCE=-0.4 +TF_FLASHNEXT_DRAFTS=6 +TF_FLASHNEXT_DRAFT_AHEAD=1 +TF_FLASHNEXT_GATHER_EARLY=1 +TF_FLASHNEXT_GATHER_READ=pread +TF_FLASHNEXT_GDN_LANES=1 +TF_FLASHNEXT_HEAD_PIECE=1536 +TF_FLASHNEXT_HOST_DRAW_THREADS=7 +TF_FLASHNEXT_KEEP_LATE=1 +TF_FLASHNEXT_PREFILL_TAIL=512 +TF_FLASHNEXT_PRODUCT_STREAMS=5 +TF_FLASHNEXT_PROMPT_EXPERT_TILE_ROWS=256 +TF_FLASHNEXT_PROMPT_GEMM2=1 +TF_FLASHNEXT_PROMPT_HC2=1 +TF_FLASHNEXT_PROMPT_SHARED_DIRECT=1 +TF_FLASHNEXT_SAMPLED_HEADS=1 +TF_FLASHNEXT_SAMPLE_CAND=1 +TF_FLASHNEXT_SHARED_SIDE=1 +TF_FLASHNEXT_WARM_AHEAD=1 +``` + +12 of them are read by neither tree (`TF_FLASHNEXT_DRAFT_AHEAD`, `TF_FLASHNEXT_GATHER_EARLY`, `TF_FLASHNEXT_GATHER_READ`, `TF_FLASHNEXT_HEAD_PIECE`, `TF_FLASHNEXT_HOST_DRAW_THREADS`, `TF_FLASHNEXT_PREFILL_TAIL`, `TF_FLASHNEXT_PRODUCT_STREAMS`, `TF_FLASHNEXT_PROMPT_EXPERT_TILE_ROWS`, `TF_FLASHNEXT_PROMPT_GEMM2`, `TF_FLASHNEXT_PROMPT_HC2`, `TF_FLASHNEXT_PROMPT_SHARED_DIRECT`, `TF_FLASHNEXT_SAMPLE_CAND`), so they change nothing on either arm; the rest are read by both. The two arms differ in nothing but the image, and `TF_FLASHNEXT_CHUNK` is set on neither, so each serves its own default. + +Order: `M1 B1 B2 M2`, a fresh server each, in every timed pass. A cell is slower when both branch runs are under both main runs (for a latency: over) and the mean gap is over 1%, faster when both are over both and the gap is over 1%, level otherwise; a flagged cell would have been re-measured once on fresh boots. No cell was flagged. + +## Correctness + +- B cache on concurrent: concurrent equals solo 156/0 (unverified 0); drafted equals `"draft": false` 56/0 +- B cache on golden: concurrent equals solo 13/0 (unverified 0); drafted equals `"draft": false` 24/0 +- B cache on drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- B cache on turns: resumed from cached prompt tokens [13, 16, 16, 13, 24, 18, 3406] +- B cache off drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- B cache off fresh: 7 of 7 resumed replies equal the fresh ones +- M cache on concurrent: concurrent equals solo 156/0 (unverified 0); drafted equals `"draft": false` 56/0 +- M cache on golden: concurrent equals solo 13/0 (unverified 0); drafted equals `"draft": false` 24/0 +- M cache on drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- M cache on turns: resumed from cached prompt tokens [13, 16, 16, 13, 24, 18, 3406] +- M cache off drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- M cache off fresh: 7 of 7 resumed replies equal the fresh ones +- B vs M: replies equal over pass A's greedy cells (token_sha): 528 equal, 0 unequal + +- the cold cells' token ids and reply text, the same prompt bytes sent to every arm: 8 of 8 cells at four slots and 4 of 4 at one slot equal on all four boots +- drafts off: 42 replies equal between the arms, 0 unequal + +## Prompt speed + +Cold prompts, `--prompt-cache-gib 0`, a 131,072-token window at four slots, so a 64k prompt is admitted beside three decoders (`load3`). Time to the first token, seconds, the median of three salted prompts, thinking off (`ttft.py --sizes 2k,8k,32k` and `--sizes 64k`, `--loads idle,load3 --reps 3 --max-tokens 16`), and `bench_cache.py --tokens 64 --repeats 2 --streams 2 --require-cold`'s first request. + +| prompt | load | M1 | M2 | B1 | B2 | B vs M | +|---|---|---|---|---|---|---| +| cold2k-off | idle | 1.070 | 1.071 | 0.972 | 0.960 | -9.8% faster | +| cold2k-off | load3 | 1.273 | 1.262 | 1.053 | 1.046 | -17.2% faster | +| cold8k-off | idle | 4.035 | 3.986 | 3.664 | 3.685 | -8.4% faster | +| cold8k-off | load3 | 4.653 | 4.632 | 3.989 | 3.987 | -14.1% faster | +| cold32k-off | idle | 16.015 | 16.044 | 14.980 | 15.039 | -6.4% faster | +| cold32k-off | load3 | 18.249 | 18.420 | 16.114 | 16.094 | -12.2% faster | +| cold64k-off | idle | 33.058 | 33.175 | 30.665 | 30.682 | -7.4% faster | +| cold64k-off | load3 | 37.582 | 37.718 | 32.780 | 32.786 | -12.9% faster | +| first_ttft_s | idle | 1.241 | 1.221 | 1.142 | 1.143 | -7.2% faster | + +Cold: 9 faster, 0 level, 0 slower, 0 unmeasured. + +## The one-stream control + +The same cells at one slot (idle only: a second stream cannot decode beside the measured prompt), where both arms take 8,192-row passes: + +| prompt | load | M1 | M2 | B1 | B2 | B vs M | +|---|---|---|---|---|---|---| +| cold2k-off | idle | 0.979 | 0.968 | 0.969 | 0.966 | -0.6% level | +| cold8k-off | idle | 3.458 | 3.434 | 3.453 | 3.414 | -0.4% level | +| cold32k-off | idle | 14.144 | 14.150 | 14.124 | 14.100 | -0.2% level | +| cold64k-off | idle | 29.025 | 28.967 | 28.896 | 28.984 | -0.2% level | +| first_ttft_s | idle | 1.148 | 1.150 | 1.143 | 1.141 | -0.6% level | + +Control: 0 faster, 5 level, 0 slower, 0 unmeasured. + +## Decode speed + +`bench_openai.py --tokens 256 --reps 3 --temperatures 0` (one stream) and `bench_concurrent.py --tokens 256 --reps 3 --levels 1,2,4,6,8 --alone --serial --temperatures 0`, prompt cache on, 32,768-token window, eight slots; aggregate tokens a second, the median of three reps. + +| prompt | streams | M1 | M2 | B1 | B2 | B vs M | tokens a round, M / B | +|---|---|---|---|---|---|---|---| +| chat | 1 | 46.9 | 46.2 | 46.5 | 46.3 | -0.3% level | 2.81 / 2.81 | +| chat | 2 | 86.8 | 86.2 | 86.3 | 86.3 | -0.2% level | 2.51 / 2.51 | +| chat | 4 | 156.6 | 155.1 | 155.7 | 155.7 | -0.1% level | 2.51 / 2.51 | +| chat | 6 | 211.0 | 209.2 | 209.8 | 209.5 | -0.2% level | 2.51 / 2.51 | +| chat | 8 | 258.1 | 256.1 | 256.9 | 256.5 | -0.2% level | 2.51 / 2.51 | +| code | 1 | 73.1 | 71.9 | 72.3 | 72.5 | -0.1% level | 5.22 / 5.22 | +| code | 2 | 138.8 | 136.9 | 138.0 | 137.5 | -0.1% level | 4.83 / 4.83 | +| code | 4 | 244.9 | 240.8 | 242.7 | 241.6 | -0.3% level | 4.83 / 4.83 | +| code | 6 | 310.5 | 306.5 | 307.7 | 306.2 | -0.5% level | 4.49 / 4.49 | +| code | 8 | 374.5 | 370.5 | 370.8 | 371.7 | -0.3% level | 4.49 / 4.49 | +| fibonacci-raw | 1 | 73.4 | 72.2 | 72.7 | 72.6 | -0.2% level | 5.22 / 5.22 | +| gpu-chat-no-think | 1 | 47.0 | 46.3 | 46.5 | 46.5 | -0.3% level | 2.81 / 2.81 | + +Decode: 0 faster, 12 level, 0 slower, 0 unmeasured. The server's acceptance ratio is identical on every boot (0.6242, 0.6884). + +## Memory + +The pass's device scratch at the default grows with the rows (`Scratch.bytes(default_chunk, .{ .head_rows = default_chunk })`: 2,753,048,104 bytes at 3,072 rows against 1,397,558,248 at 1,536). The engine reserves its scratch at load, before it reads its room, so each arm's own startup line carries the cost: + +| window / slots | arm | model GiB | a stream | streams at once | GiB left after the 9.0 GiB reserve | pass rows | +|---|---|---|---|---|---|---| +| 32768 / 8 | main | 72.71 | 1.29 GiB each | 8 | 27.9 | 1536 | +| 32768 / 8 | branch | 73.50 | 1.32 GiB each | 8 | 27.1 | 3072 | +| 131072 / 4 | main | 72.73 | 4.11 GiB each | 4 | 27.9 | 1536 | +| 131072 / 4 | branch | 73.52 | 4.14 GiB each | 4 | 27.0 | 3072 | +| 131072 / 1 | main | 76.16 | 4.23 GiB each | 1 | 24.3 | 8192 | +| 131072 / 1 | branch | 76.16 | 4.23 GiB each | 1 | 24.4 | 8192 | +| 131072 / 8 | main | - | 8 need 32.86 GiB | refused, names 6 | 27.85 | - | +| 131072 / 8 | branch | - | 8 need 33.10 GiB | refused, names 6 | 27.01 | - | + +At 131,072 tokens and eight slots both arms refuse `--parallel 8` by name and name six streams; at every other setting both admit the same streams. + +The lines verbatim: + +- 32768/8 main: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 72.71 GiB; 8 streams at once, 1.29 GiB each at a 32768-token window, of 27.9 GiB left after a 9.0 GiB reserve; prompts in passes of up to 1536 rows, a 16.0 GiB prompt cache; own glue kernels +- 32768/8 branch: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 73.50 GiB; 8 streams at once, 1.32 GiB each at a 32768-token window, of 27.1 GiB left after a 9.0 GiB reserve; prompts in passes of up to 3072 rows, a 16.0 GiB prompt cache; own glue kernels +- 131072/4 main: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 72.73 GiB; 4 streams at once, 4.11 GiB each at a 131072-token window, of 27.9 GiB left after a 9.0 GiB reserve; prompts in passes of up to 1536 rows, no prompt cache; own glue kernels +- 131072/4 branch: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 73.52 GiB; 4 streams at once, 4.14 GiB each at a 131072-token window, of 27.0 GiB left after a 9.0 GiB reserve; prompts in passes of up to 3072 rows, no prompt cache; own glue kernels +- 131072/1 main: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 76.16 GiB; 1 stream at once, 4.23 GiB each at a 131072-token window, of 24.3 GiB left after a 9.0 GiB reserve; prompts in passes of up to 8192 rows, no prompt cache; own glue kernels +- 131072/1 branch: CUDA sm_121 device 0 (NVIDIA GB10, memory shared with the host): model 76.16 GiB; 1 stream at once, 4.23 GiB each at a 131072-token window, of 24.4 GiB left after a 9.0 GiB reserve; prompts in passes of up to 8192 rows, no prompt cache; own glue kernels +- 131072/8 main: refused at start: --parallel 8 needs 32.86 GiB for its streams at a 131072-token window, and the CUDA memory budget leaves 27.85 GiB: serve --parallel 6, or lower --context +- 131072/8 branch: refused at start: --parallel 8 needs 33.10 GiB for its streams at a 131072-token window, and the CUDA memory budget leaves 27.01 GiB: serve --parallel 6, or lower --context diff --git a/docs/receipts/flashnext-prompt-chunk3072/cells.csv b/docs/receipts/flashnext-prompt-chunk3072/cells.csv new file mode 100644 index 00000000000..dc5fafc7508 --- /dev/null +++ b/docs/receipts/flashnext-prompt-chunk3072/cells.csv @@ -0,0 +1,125 @@ +arm,pass,invocation,prompt,case,temperature,streams,value,per_stream,tokens_per_round,accepted_per_round,server_accepted,server_drafted,server_acceptance,alone_equal,alone_unequal,serial_equal,serial_unequal,failed,unmeasured,prompt_tokens +M1,A,conc_t0,chat,,0.0,1,46.9,46.9,2.813,1.813,22760,33060,0.6884,3,0,1,0,0,0, +M1,A,conc_t0,chat,,0.0,2,86.8,43.5,2.51,1.51,22760,33060,0.6884,6,0,1,0,0,0, +M1,A,conc_t0,chat,,0.0,4,156.6,39.8,2.51,1.51,22760,33060,0.6884,12,0,1,0,0,0, +M1,A,conc_t0,chat,,0.0,6,211.0,36.0,2.51,1.51,22760,33060,0.6884,18,0,1,0,0,0, +M1,A,conc_t0,chat,,0.0,8,258.1,33.3,2.51,1.51,22760,33060,0.6884,24,0,1,0,0,0, +M1,A,conc_t0,code,,0.0,1,73.1,73.1,5.224,4.224,22760,33060,0.6884,3,0,1,0,0,0, +M1,A,conc_t0,code,,0.0,2,138.8,70.0,4.83,3.83,22760,33060,0.6884,6,0,1,0,0,0, +M1,A,conc_t0,code,,0.0,4,244.9,62.8,4.83,3.83,22760,33060,0.6884,12,0,1,0,0,0, +M1,A,conc_t0,code,,0.0,6,310.5,53.8,4.491,3.491,22760,33060,0.6884,18,0,1,0,0,0, +M1,A,conc_t0,code,,0.0,8,374.5,49.2,4.491,3.491,22760,33060,0.6884,24,0,1,0,0,0, +M1,A,openai_t0,fibonacci-raw,,0.0,1,73.38379231509755,73.38379231509755,5.224,4.224,1488,2384,0.6242,,,,,0,0, +M1,A,openai_t0,gpu-chat-no-think,,0.0,1,46.965075034072775,46.965075034072775,2.813,1.813,1488,2384,0.6242,,,,,0,0, +M2,A,conc_t0,chat,,0.0,1,46.2,46.2,2.813,1.813,22760,33060,0.6884,3,0,1,0,0,0, +M2,A,conc_t0,chat,,0.0,2,86.2,43.4,2.51,1.51,22760,33060,0.6884,6,0,1,0,0,0, +M2,A,conc_t0,chat,,0.0,4,155.1,39.5,2.51,1.51,22760,33060,0.6884,12,0,1,0,0,0, +M2,A,conc_t0,chat,,0.0,6,209.2,35.6,2.51,1.51,22760,33060,0.6884,18,0,1,0,0,0, +M2,A,conc_t0,chat,,0.0,8,256.1,33.0,2.51,1.51,22760,33060,0.6884,24,0,1,0,0,0, +M2,A,conc_t0,code,,0.0,1,71.9,71.9,5.224,4.224,22760,33060,0.6884,3,0,1,0,0,0, +M2,A,conc_t0,code,,0.0,2,136.9,69.2,4.83,3.83,22760,33060,0.6884,6,0,1,0,0,0, +M2,A,conc_t0,code,,0.0,4,240.8,62.0,4.83,3.83,22760,33060,0.6884,12,0,1,0,0,0, +M2,A,conc_t0,code,,0.0,6,306.5,53.1,4.491,3.491,22760,33060,0.6884,18,0,1,0,0,0, +M2,A,conc_t0,code,,0.0,8,370.5,48.6,4.491,3.491,22760,33060,0.6884,24,0,1,0,0,0, +M2,A,openai_t0,fibonacci-raw,,0.0,1,72.1865781794484,72.1865781794484,5.224,4.224,1488,2384,0.6242,,,,,0,0, +M2,A,openai_t0,gpu-chat-no-think,,0.0,1,46.342541484219055,46.342541484219055,2.813,1.813,1488,2384,0.6242,,,,,0,0, +B1,A,conc_t0,chat,,0.0,1,46.5,46.5,2.813,1.813,22760,33060,0.6884,3,0,1,0,0,0, +B1,A,conc_t0,chat,,0.0,2,86.3,43.4,2.51,1.51,22760,33060,0.6884,6,0,1,0,0,0, +B1,A,conc_t0,chat,,0.0,4,155.7,39.5,2.51,1.51,22760,33060,0.6884,12,0,1,0,0,0, +B1,A,conc_t0,chat,,0.0,6,209.8,35.8,2.51,1.51,22760,33060,0.6884,18,0,1,0,0,0, +B1,A,conc_t0,chat,,0.0,8,256.9,33.0,2.51,1.51,22760,33060,0.6884,24,0,1,0,0,0, +B1,A,conc_t0,code,,0.0,1,72.3,72.3,5.224,4.224,22760,33060,0.6884,3,0,1,0,0,0, +B1,A,conc_t0,code,,0.0,2,138.0,69.8,4.83,3.83,22760,33060,0.6884,6,0,1,0,0,0, +B1,A,conc_t0,code,,0.0,4,242.7,62.4,4.83,3.83,22760,33060,0.6884,12,0,1,0,0,0, +B1,A,conc_t0,code,,0.0,6,307.7,53.1,4.491,3.491,22760,33060,0.6884,18,0,1,0,0,0, +B1,A,conc_t0,code,,0.0,8,370.8,48.7,4.491,3.491,22760,33060,0.6884,24,0,1,0,0,0, +B1,A,openai_t0,fibonacci-raw,,0.0,1,72.67244569061366,72.67244569061366,5.224,4.224,1488,2384,0.6242,,,,,0,0, +B1,A,openai_t0,gpu-chat-no-think,,0.0,1,46.49557287715273,46.49557287715273,2.813,1.813,1488,2384,0.6242,,,,,0,0, +B2,A,conc_t0,chat,,0.0,1,46.3,46.3,2.813,1.813,22760,33060,0.6884,3,0,1,0,0,0, +B2,A,conc_t0,chat,,0.0,2,86.3,43.4,2.51,1.51,22760,33060,0.6884,6,0,1,0,0,0, +B2,A,conc_t0,chat,,0.0,4,155.7,39.5,2.51,1.51,22760,33060,0.6884,12,0,1,0,0,0, +B2,A,conc_t0,chat,,0.0,6,209.5,35.8,2.51,1.51,22760,33060,0.6884,18,0,1,0,0,0, +B2,A,conc_t0,chat,,0.0,8,256.5,33.0,2.51,1.51,22760,33060,0.6884,24,0,1,0,0,0, +B2,A,conc_t0,code,,0.0,1,72.5,72.5,5.224,4.224,22760,33060,0.6884,3,0,1,0,0,0, +B2,A,conc_t0,code,,0.0,2,137.5,69.6,4.83,3.83,22760,33060,0.6884,6,0,1,0,0,0, +B2,A,conc_t0,code,,0.0,4,241.6,62.1,4.83,3.83,22760,33060,0.6884,12,0,1,0,0,0, +B2,A,conc_t0,code,,0.0,6,306.2,53.0,4.491,3.491,22760,33060,0.6884,18,0,1,0,0,0, +B2,A,conc_t0,code,,0.0,8,371.7,48.9,4.491,3.491,22760,33060,0.6884,24,0,1,0,0,0, +B2,A,openai_t0,fibonacci-raw,,0.0,1,72.59725635790427,72.59725635790427,5.224,4.224,1488,2384,0.6242,,,,,0,0, +B2,A,openai_t0,gpu-chat-no-think,,0.0,1,46.50159814093216,46.50159814093216,2.813,1.813,1488,2384,0.6242,,,,,0,0, +M1,2,ttft,cold2k-off,cold2k-off,,,1.07,,,,,,,,,,,,, +M1,2,ttft,cold8k-off,cold8k-off,,,4.035,,,,,,,,,,,,, +M1,2,ttft,cold32k-off,cold32k-off,,,16.015,,,,,,,,,,,,, +M1,2,ttft,cold2k-off,cold2k-off,,,1.273,,,,,,,,,,,,, +M1,2,ttft,cold8k-off,cold8k-off,,,4.653,,,,,,,,,,,,, +M1,2,ttft,cold32k-off,cold32k-off,,,18.249,,,,,,,,,,,,, +M1,2,ttft64,cold64k-off,cold64k-off,,,33.058,,,,,,,,,,,,, +M1,2,ttft64,cold64k-off,cold64k-off,,,37.582,,,,,,,,,,,,, +M1,8,ttft1,cold2k-off,cold2k-off,,,0.979,,,,,,,,,,,,, +M1,8,ttft1,cold8k-off,cold8k-off,,,3.458,,,,,,,,,,,,, +M1,8,ttft1,cold32k-off,cold32k-off,,,14.144,,,,,,,,,,,,, +M1,8,ttft1,cold64k-off,cold64k-off,,,29.025,,,,,,,,,,,,, +M1,2,cache,bench_cache,first_ttft_s,,,1.2410360348876566,,,,,,,,,,,,,2571 +M1,8,cache,bench_cache,first_ttft_s,,,1.148247711127624,,,,,,,,,,,,,2571 +M2,2,ttft,cold2k-off,cold2k-off,,,1.071,,,,,,,,,,,,, +M2,2,ttft,cold8k-off,cold8k-off,,,3.986,,,,,,,,,,,,, +M2,2,ttft,cold32k-off,cold32k-off,,,16.044,,,,,,,,,,,,, +M2,2,ttft,cold2k-off,cold2k-off,,,1.262,,,,,,,,,,,,, +M2,2,ttft,cold8k-off,cold8k-off,,,4.632,,,,,,,,,,,,, +M2,2,ttft,cold32k-off,cold32k-off,,,18.42,,,,,,,,,,,,, +M2,2,ttft64,cold64k-off,cold64k-off,,,33.175,,,,,,,,,,,,, +M2,2,ttft64,cold64k-off,cold64k-off,,,37.718,,,,,,,,,,,,, +M2,8,ttft1,cold2k-off,cold2k-off,,,0.968,,,,,,,,,,,,, +M2,8,ttft1,cold8k-off,cold8k-off,,,3.434,,,,,,,,,,,,, +M2,8,ttft1,cold32k-off,cold32k-off,,,14.15,,,,,,,,,,,,, +M2,8,ttft1,cold64k-off,cold64k-off,,,28.967,,,,,,,,,,,,, +M2,2,cache,bench_cache,first_ttft_s,,,1.2209141689818352,,,,,,,,,,,,,2571 +M2,8,cache,bench_cache,first_ttft_s,,,1.1495070881210268,,,,,,,,,,,,,2571 +B1,2,ttft,cold2k-off,cold2k-off,,,0.972,,,,,,,,,,,,, +B1,2,ttft,cold8k-off,cold8k-off,,,3.664,,,,,,,,,,,,, +B1,2,ttft,cold32k-off,cold32k-off,,,14.98,,,,,,,,,,,,, +B1,2,ttft,cold2k-off,cold2k-off,,,1.053,,,,,,,,,,,,, +B1,2,ttft,cold8k-off,cold8k-off,,,3.989,,,,,,,,,,,,, +B1,2,ttft,cold32k-off,cold32k-off,,,16.114,,,,,,,,,,,,, +B1,2,ttft64,cold64k-off,cold64k-off,,,30.665,,,,,,,,,,,,, +B1,2,ttft64,cold64k-off,cold64k-off,,,32.78,,,,,,,,,,,,, +B1,8,ttft1,cold2k-off,cold2k-off,,,0.969,,,,,,,,,,,,, +B1,8,ttft1,cold8k-off,cold8k-off,,,3.453,,,,,,,,,,,,, +B1,8,ttft1,cold32k-off,cold32k-off,,,14.124,,,,,,,,,,,,, +B1,8,ttft1,cold64k-off,cold64k-off,,,28.896,,,,,,,,,,,,, +B1,2,cache,bench_cache,first_ttft_s,,,1.1424408501479775,,,,,,,,,,,,,2571 +B1,8,cache,bench_cache,first_ttft_s,,,1.1430892788339406,,,,,,,,,,,,,2571 +B2,2,ttft,cold2k-off,cold2k-off,,,0.96,,,,,,,,,,,,, +B2,2,ttft,cold8k-off,cold8k-off,,,3.685,,,,,,,,,,,,, +B2,2,ttft,cold32k-off,cold32k-off,,,15.039,,,,,,,,,,,,, +B2,2,ttft,cold2k-off,cold2k-off,,,1.046,,,,,,,,,,,,, +B2,2,ttft,cold8k-off,cold8k-off,,,3.987,,,,,,,,,,,,, +B2,2,ttft,cold32k-off,cold32k-off,,,16.094,,,,,,,,,,,,, +B2,2,ttft64,cold64k-off,cold64k-off,,,30.682,,,,,,,,,,,,, +B2,2,ttft64,cold64k-off,cold64k-off,,,32.786,,,,,,,,,,,,, +B2,8,ttft1,cold2k-off,cold2k-off,,,0.966,,,,,,,,,,,,, +B2,8,ttft1,cold8k-off,cold8k-off,,,3.414,,,,,,,,,,,,, +B2,8,ttft1,cold32k-off,cold32k-off,,,14.1,,,,,,,,,,,,, +B2,8,ttft1,cold64k-off,cold64k-off,,,28.984,,,,,,,,,,,,, +B2,2,cache,bench_cache,first_ttft_s,,,1.1431879128795117,,,,,,,,,,,,,2571 +B2,8,cache,bench_cache,first_ttft_s,,,1.1406444171443582,,,,,,,,,,,,,2571 +1/B1,pool,startup,32768/8,,,,,,3072,,,,,,,,,,, +1/B2,pool,startup,32768/8,,,,,,3072,,,,,,,,,,, +1/M1,pool,startup,32768/8,,,,,,1536,,,,,,,,,,, +1/M2,pool,startup,32768/8,,,,,,1536,,,,,,,,,,, +2/B1,pool,startup,131072/4,,,,,,3072,,,,,,,,,,, +2/B2,pool,startup,131072/4,,,,,,3072,,,,,,,,,,, +2/M1,pool,startup,131072/4,,,,,,1536,,,,,,,,,,, +2/M2,pool,startup,131072/4,,,,,,1536,,,,,,,,,,, +3/B/off,pool,startup,32768/8,,,,,,3072,,,,,,,,,,, +3/B/on,pool,startup,32768/8,,,,,,3072,,,,,,,,,,, +3/M/off,pool,startup,32768/8,,,,,,1536,,,,,,,,,,, +3/M/on,pool,startup,32768/8,,,,,,1536,,,,,,,,,,, +4/BD,pool,startup,32768/8,,,,,,3072,,,,,,,,,,, +4/MD,pool,startup,32768/8,,,,,,1536,,,,,,,,,,, +8/B1,pool,startup,131072/1,,,,,,8192,,,,,,,,,,, +8/B2,pool,startup,131072/1,,,,,,8192,,,,,,,,,,, +8/M1,pool,startup,131072/1,,,,,,8192,,,,,,,,,,, +8/M2,pool,startup,131072/1,,,,,,8192,,,,,,,,,,, +9/BP,pool,startup,131072/8,,,,,,,,,,,,,,,,, +9/MP,pool,startup,131072/8,,,,,,,,,,,,,,,,, diff --git a/docs/receipts/flashnext-prompt-chunk3072/exactness.md b/docs/receipts/flashnext-prompt-chunk3072/exactness.md new file mode 100644 index 00000000000..e7957f7f2d7 --- /dev/null +++ b/docs/receipts/flashnext-prompt-chunk3072/exactness.md @@ -0,0 +1,20 @@ +# Exactness on the served server + +Each contract on both arms with the prompt cache on and off (`bench_concurrent.py --alone --serial` at temperatures 1.0 and 0 and on the six golden prompts; `served_exactness.py drafts`, `turns`, and `fresh` against the cache-on turns), then the greedy replies compared across the arms. + +- B cache on concurrent: concurrent equals solo 156/0 (unverified 0); drafted equals `"draft": false` 56/0 +- B cache on golden: concurrent equals solo 13/0 (unverified 0); drafted equals `"draft": false` 24/0 +- B cache on drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- B cache on turns: resumed from cached prompt tokens [13, 16, 16, 13, 24, 18, 3406] +- B cache off drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- B cache off fresh: 7 of 7 resumed replies equal the fresh ones +- M cache on concurrent: concurrent equals solo 156/0 (unverified 0); drafted equals `"draft": false` 56/0 +- M cache on golden: concurrent equals solo 13/0 (unverified 0); drafted equals `"draft": false` 24/0 +- M cache on drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- M cache on turns: resumed from cached prompt tokens [13, 16, 16, 13, 24, 18, 3406] +- M cache off drafts: 8 of 8 equal to `"draft": false` (basis token_ids) +- M cache off fresh: 7 of 7 resumed replies equal the fresh ones +- B vs M: replies equal over pass A's greedy cells (token_sha): 528 equal, 0 unequal + +- the cold cells: 8 of 8 at four slots and 4 of 4 at one slot carry the same token ids and reply text on all four boots (`coldhash.py`, the same prompt bytes on every arm) +- drafts off: 42 replies equal, 0 unequal diff --git a/docs/receipts/flashnext-prompt-chunk3072/noise-rule.md b/docs/receipts/flashnext-prompt-chunk3072/noise-rule.md new file mode 100644 index 00000000000..5130473f8b8 --- /dev/null +++ b/docs/receipts/flashnext-prompt-chunk3072/noise-rule.md @@ -0,0 +1,49 @@ +# The noise rule, and the cells it judged + +A cell is SLOWER when both after runs are under both before runs (for a latency: over) and the mean gap is over 1%; FASTER when both are over both and the gap is over 1%; LEVEL otherwise. Each arm booted twice per timed pass (`M1 B1 B2 M2`). A flagged cell gets one rerun of its invocation on fresh boots inside the same window, and a repeat of slower is a loss; this window flagged none. + +- cold prompts: 9 faster, 0 level, 0 slower, 0 unmeasured +- decode: 0 faster, 12 level, 0 slower, 0 unmeasured +- one-stream control: 0 faster, 5 level, 0 slower, 0 unmeasured +- losses: none + +## Cold prompts, four slots + +| prompt | load | M1 | M2 | B1 | B2 | B vs M | +|---|---|---|---|---|---|---| +| cold2k-off | idle | 1.070 | 1.071 | 0.972 | 0.960 | -9.8% faster | +| cold2k-off | load3 | 1.273 | 1.262 | 1.053 | 1.046 | -17.2% faster | +| cold8k-off | idle | 4.035 | 3.986 | 3.664 | 3.685 | -8.4% faster | +| cold8k-off | load3 | 4.653 | 4.632 | 3.989 | 3.987 | -14.1% faster | +| cold32k-off | idle | 16.015 | 16.044 | 14.980 | 15.039 | -6.4% faster | +| cold32k-off | load3 | 18.249 | 18.420 | 16.114 | 16.094 | -12.2% faster | +| cold64k-off | idle | 33.058 | 33.175 | 30.665 | 30.682 | -7.4% faster | +| cold64k-off | load3 | 37.582 | 37.718 | 32.780 | 32.786 | -12.9% faster | +| first_ttft_s | idle | 1.241 | 1.221 | 1.142 | 1.143 | -7.2% faster | + +## The one-stream control + +| prompt | load | M1 | M2 | B1 | B2 | B vs M | +|---|---|---|---|---|---|---| +| cold2k-off | idle | 0.979 | 0.968 | 0.969 | 0.966 | -0.6% level | +| cold8k-off | idle | 3.458 | 3.434 | 3.453 | 3.414 | -0.4% level | +| cold32k-off | idle | 14.144 | 14.150 | 14.124 | 14.100 | -0.2% level | +| cold64k-off | idle | 29.025 | 28.967 | 28.896 | 28.984 | -0.2% level | +| first_ttft_s | idle | 1.148 | 1.150 | 1.143 | 1.141 | -0.6% level | + +## Decode + +| prompt | streams | M1 | M2 | B1 | B2 | B vs M | tokens a round, M / B | +|---|---|---|---|---|---|---|---| +| chat | 1 | 46.9 | 46.2 | 46.5 | 46.3 | -0.3% level | 2.81 / 2.81 | +| chat | 2 | 86.8 | 86.2 | 86.3 | 86.3 | -0.2% level | 2.51 / 2.51 | +| chat | 4 | 156.6 | 155.1 | 155.7 | 155.7 | -0.1% level | 2.51 / 2.51 | +| chat | 6 | 211.0 | 209.2 | 209.8 | 209.5 | -0.2% level | 2.51 / 2.51 | +| chat | 8 | 258.1 | 256.1 | 256.9 | 256.5 | -0.2% level | 2.51 / 2.51 | +| code | 1 | 73.1 | 71.9 | 72.3 | 72.5 | -0.1% level | 5.22 / 5.22 | +| code | 2 | 138.8 | 136.9 | 138.0 | 137.5 | -0.1% level | 4.83 / 4.83 | +| code | 4 | 244.9 | 240.8 | 242.7 | 241.6 | -0.3% level | 4.83 / 4.83 | +| code | 6 | 310.5 | 306.5 | 307.7 | 306.2 | -0.5% level | 4.49 / 4.49 | +| code | 8 | 374.5 | 370.5 | 370.8 | 371.7 | -0.3% level | 4.49 / 4.49 | +| fibonacci-raw | 1 | 73.4 | 72.2 | 72.7 | 72.6 | -0.2% level | 5.22 / 5.22 | +| gpu-chat-no-think | 1 | 47.0 | 46.3 | 46.5 | 46.5 | -0.3% level | 2.81 / 2.81 | diff --git a/docs/receipts/glm-decode-pdl-60e67379/README.md b/docs/receipts/glm-decode-pdl-60e67379/README.md new file mode 100644 index 00000000000..ca11a0bf7e0 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/README.md @@ -0,0 +1,71 @@ +# GLM-5.3-Flash on CUDA: its kernels as dependent launches, receipt + +| TP=2 on 2 × GB10, same checkpoint, both serves on the factored expert form | main | this branch | change | +| --- | --- | --- | --- | +| Plain decode, 128 tokens, one stream (tok/s; serves `fb1` `fb2`, `fh1` `fh2`) | 24.60, 24.38 | 26.11, 26.20 | +6.8% | +| Time between tokens, p50 | 40.45, 40.83 ms | 38.13, 38.01 ms | −6.3% | +| Drafted decode, 256 tokens, one stream (tok/s; `db1` `db2`, `dh1` `dh2`) | 43.45, 42.70 | 45.17, 44.45 | +4.0% | +| Four streams at once, summed (tok/s, median of 4 prompts) | 98.55, 99.85 | 103.40, 104.05 | +4.6% | +| Cold 8k prompt, first token (s) | 5.666, 5.659 | 5.609, 5.610 | −0.9% | +| Cold 32k prompt, first token (s) | 22.83, 22.80 | 22.58, 22.73 | −0.7% | +| Tokens | | | equal in every serve | +| 30 / 60 cold 8k replies of 16 tokens, drafts off | 1 distinct of 30 | 1 distinct of 60, main's | the first version: 4 distinct of 30 | + +Tested implementation: binaries built from `60e673799f` (the branch before its rebase onto `3f1290ffe7`; the rebase +changed no line of the branch and the 23 commits it crossed touch no GLM or qmmf source). Base: `077998f7d9`. +Test date: 2026-11-17. Platform: 2 × GB10 (sm_121, 128 GB shared memory) at TP=2 over a direct RoCE link, +driver 580.178.04, Ubuntu 24.04, NCCL 2.30. Toolchain: Zig 0.17.0, nvcc 13.5 (V13.5.37) for the served binaries. +`binaries.txt` has their sha256. Checkpoint: `nvidia/GLM-5.3-Flash-FP4-Local` at +`76348ddb2be2e35e39ecfc00e75dc07703f4f3d5`. + +## Scope + +Every GLM kernel and qmmf's decode linears launch as dependent launches (default; `TF_GLM_PDL=0` launches them +plain). This receipt qualifies served speed and exactness at TP=2 on GB10: plain and drafted decode, four streams, +cold 8k and 32k prompts, drafted = plain, concurrent = alone, resumed = cold, determinism after a long prompt, the +kernel contract and the early-load check. It does not qualify sm_90, sm_100 or sm_120 GPUs on hardware (no such GPU +here; their images pass the SASS check), TP=3 or one GPU. + +## Results + +| Check | Result | +| --- | --- | +| Plain decode and cold prompts, alternated main, head, head, main, then the head with `TF_GLM_PDL=0` (`runs/fb1` `fh1` `fh2` `fb2` `foff`) | Table above; `TF_GLM_PDL=0` 24.21 tok/s, 41.12 ms, 5.681 s and 22.74 s, main's tokens. Every serve's tokens equal: plain `1d7c9d905ba7`, 8k `43b05393cf25`, 32k `2e98fab70f4c` | +| Drafted decode and four streams, alternated (`runs/db1` `dh1` `dh2` `db2`) | Table above; drafted tokens `3fcd20ce2fb0` in all four, 2.94 to 3.01 tokens a chunk on both | +| Exactness on each binary (`runs/re-h`, `runs/re-b`) | `golden_http.py`: drafted = plain on 3 prompts, the same 3 token sha256s on head and main; `bench_concurrent.py --alone --serial`, 1, 2 and 4 streams, greedy and sampled: 84/84 equal their alone runs and 30/30 their serial runs on each; `resume_http.py`: repeated, `"draft": false` and two at once equal the cold reply (the prompt holds a clock nonce, so its reply differs between the two serves) | +| Determinism after a cold 8k prompt (`runs/determinism.txt`) | 16-token replies, drafts off: head 60/60 one reply, main 30/30 the same reply. The first version (`79c9ffe97f`, inputs `const __restrict__`): 24/30 that reply and 3 others (3, 2 and 1) | +| Kernel contract on GB10 (`contract/`) | `tf-cuda-test kernel-contract`, nvcc 13.3, sm_121: `SUMMARY 661 kernels: 661 pass gates 1-4, 0 fail, 8 known findings; 422 controls: 422 red as planted, 0 missed; 387 limit problems`, exit 1 from the limit problems alone; the 8 known findings are the registered ones (GLM's relu as `fmaxf`, qwen35's NaN-chunk merge). The limit problems are stale nvcc 13.3 records, none a launch past a limit: `kernel-contract-limits` on sm_80/86/89/120/121 fatbins finds 834 on main and 832 on this branch, every branch one also stale on main (`contract/limits-stale.txt`; 5,330 PASS, 0 FAIL). The contract ran before "fix(contract): keep main's records of qmmf's 16-row cluster tiles", which keeps main's records of 4 qmmf cluster tiles; the limits run on it | +| Dependent launch order on GB10 (`contract/glm-pdl-order.log`) | `tf-cuda-test glm-pdl-order`: 17 PASS; each GLM kernel and qmmf's BF16, FP4 and MXFP8 decode rows, launched dependent after a slow writer, equal their plain launch, and the planted read before the wait sees the poison | +| Early loads (`contract/check-pdl-loads.log`) | `zig build check-pdl-loads -Dsm=80,120,121`, nvcc 13.5: 0 early reads, predicated waits or branches past the wait in 402 functions of 9 images (the first version: 12 in 201 functions, `contract/sass-early-loads.txt`) | + +## The race the SASS check guards + +A first version launched the same kernels dependent with their inputs `const __restrict__`. nvcc gives those +inputs non-coherent loads (`ld.global.nc`), and ptxas scheduled them (`LDG.E.CONSTANT`) above +`griddepcontrol.wait` in 12 kernels: the DSA selectors (`dsel_scan`, `dsel_merge`, `index_pools`), `dsa_tokens`, +seven KV-host kernels and `df_attn`. The PTX rules allow it, as `.nc` data must stay unchanged for the kernel's whole +life. A selector then read a position or a score before the kernel writing it had ended, and replies after a long +prompt varied while the first token did not. Those inputs drop `__restrict__`; outputs keep it. +`zig build check-pdl-loads -Dnvcc=…` disassembles the GLM images and qmmf and fails any sm_90 or later function +that reads global memory before its wait, or that has no wait and is not a plain-only entry. + +## The expert-form confounder + +The GLM load times its two expert forms once a binary and keeps the faster (`window cost` cache, keyed by the +executable). The head's binary kept `classic`, main's `factored`; per kernel (`runs/kprof-*.csv`, nsys over 3 × 128 +tokens, both plain launches) the forms moved plain decode by about 3% on their own. The first A/B (`runs/rb1` `rh1` +`rh2` `rb2` `roff`) ran with them mixed and showed +3.5%. For the A/B above, the head's kept flag was set to `factored`, +as main's, so only the change under test differs; each serve's `form.txt` has its line. The form choice is outside this +change. + +## Reproduction + +Every serve, rank 0 and rank 1 (`TF_GLM_RANK`): `tensorfold-native serve CKPT --host 127.0.0.1 --port 8090 --name +local-model --no-update-check --context 65536 --parallel 4 --prompt-cache-gib 0` (`ab`, `dc`), `--context 40960 +--parallel 4` (`ex`). In each serve's folder: `tools/suites.sh ab|dc|ex REPO prompts`. Table: `python3 +tools/pdl_ab.py runs fb1 fh1 fh2 fb2 foff`, `… db1 dh1 dh2 db2`. Determinism: `python3 tools/first.py 8090 +prompts/p8192.json 16 60` against a fresh serve with `--prompt-cache-gib 0`. +Contract, nvcc 13.3 (`-Dnvcc=/usr/local/cuda-13.3/bin/nvcc`): `zig build kernel-contract -Dnvcc=…`; `zig build fatbins +kernel-contract-fatbins -Dnvcc=… -Dsm=80,86,89,120,121`, then `tf-cuda-test kernel-contract-limits zig-out/fatbin` on +this branch and on main; `tf-cuda-test glm-pdl-order`. Early loads: `zig build check-pdl-loads -Dnvcc=… +-Dsm=80,120,121`. diff --git a/docs/receipts/glm-decode-pdl-60e67379/SHA256SUMS b/docs/receipts/glm-decode-pdl-60e67379/SHA256SUMS new file mode 100644 index 00000000000..3ee7f3bad3e --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/SHA256SUMS @@ -0,0 +1,139 @@ +dfd2d6b206951c54fcab7e9126bb19f3b7fc3436bc148c7921acf80e692d7956 README.md +85e43c277455ee860e9de5198babbb15f9597e510f03c2429838ecb3855c6005 binaries.txt +eeddc2c7346fa5d1c26aa5ca846f8d55456bdf897bf0dac139bca6497cf0031a contract/check-pdl-loads.log +00028011b408c1d89402414d9f8fdccdd0f81a0560524a8d94a1f37b0b4bd1a8 contract/glm-pdl-order.log +c8ed51a655dfb2359f21c97d97e7d8ba96df0c941a5163cf0903fc69debdd006 contract/kernel-contract-summary.txt +7a21c4bbd6b7a95718cdf3f047fcfbd5f7d98f088fed329add63a387b37d0b6c contract/kernel-contract.log.gz +eb8b807dc5bdfa536086b04294f6b419b3d12d5b0cf5be6f88dde45dbb10c928 contract/limits-branch.log.gz +a92bb623b0172707871d4b1e5e45014134a047275f691c2c1568da89ac1e3cc1 contract/limits-main.log.gz +46613d11044428cd2c10a4625283bdf74059f2c2f9891b5b84cf8d24da109ddb contract/limits-stale.txt +0d6598211caade67f3158478d03454f622a7d2a45a4d3f0d2cf6b0e5c8ac62df contract/sass-early-loads.txt +c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45 prompts/p32768.json +74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21 prompts/p8192.json +96cbc0ec47d877e954f5c17101281824566440299cfeaa4c0bfbbb72d4811a88 runs/db1/c4.json +d980a9f8126606ce23351963b386db7e4db455b9aeab28bc30d938aef14db278 runs/db1/check-c4.log +f8d208213e46dc00b4caae6c38a9141ac2dd19a51d32e9c599a36dae1ed2b3ef runs/db1/check-drafted.log +aa8b14111c642984978ca2bbd902204defd775cab5ca81aac671d6a99f4562bc runs/db1/drafted.json +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/db1/form.txt +c073c9dc117956544d080cb9acb019daf863e92dd82c516210ffa2faec8cf1aa runs/db1/suite.log +71966ba0ff2fa8831a6bb5a5e7a680bd0ba438373d512f74c73da930a76415f4 runs/db2/c4.json +aa4b72aebdfe86651f3b8a87d74138316e165d81ac44076a032995bf2779fa09 runs/db2/check-c4.log +a7a6db5a03acbfaba06a244bc596db81e7e5609f56f268447ce3a95a28a7cf52 runs/db2/check-drafted.log +01c9d50645b0fb5112dc47b8c37d358e725e41c98497d6efaf42cb20a4138111 runs/db2/drafted.json +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/db2/form.txt +c073c9dc117956544d080cb9acb019daf863e92dd82c516210ffa2faec8cf1aa runs/db2/suite.log +a1203557b4efb5153e002366066544ff5eda230d6d3e17d8cdbb7fd2fa3bbf24 runs/determinism.txt +6ec66fb06212f2ce95e8066b48e32b10311641d0da51e4160deb9c3535ecd728 runs/dh1/c4.json +958460c209d2688b45af3673c8ae00c2bef65786765a69ecd304d7fe256516c2 runs/dh1/check-c4.log +0000d616d62c2fbd92d799fa006cdf851fd8a24903ae36938c60052441df7dab runs/dh1/check-drafted.log +c6ac10bd29efa23e720c322ce6f97108b4162652f372a62cf07a5c015948974e runs/dh1/drafted.json +dd5a8d01da4c42f13aface3aeb9cbac66bf0c5947963c8acf1be03c6782b9da7 runs/dh1/form.txt +c073c9dc117956544d080cb9acb019daf863e92dd82c516210ffa2faec8cf1aa runs/dh1/suite.log +b217c9d62583d961253251b0f7dafbf927a6c3fea73ad894136a4ba8bacc5560 runs/dh2/c4.json +100e1ad09ce34d90576c487c34a47b367ce3a4e9d77f868c28bb3496402427f0 runs/dh2/check-c4.log +4876e683a0dfcdc0c22ad4122b2b5e6f8e54ffeb0f6550d12095d1b4a45ee62c runs/dh2/check-drafted.log +1f2459e82487b43c3a728aa5e4ef3bc94f53c31e52d9c23f83365c20d132771d runs/dh2/drafted.json +dd5a8d01da4c42f13aface3aeb9cbac66bf0c5947963c8acf1be03c6782b9da7 runs/dh2/form.txt +c073c9dc117956544d080cb9acb019daf863e92dd82c516210ffa2faec8cf1aa runs/dh2/suite.log +d8393433bb03a63b6b651d6ae49852cafee3dbb304bc393d4648218f6544cbcc runs/fb1/check-nodraft.log +d727370d925fcefb1f720f218d2fa5f171232ca958bc5beba58cf955c6cffbed runs/fb1/check-prefill32768.log +02d313a3ee4308005e76bddb4118c69224cebcc179903d69172d60ca7e077c61 runs/fb1/check-prefill8192.log +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/fb1/form.txt +8b19c8b232cf5fc62d550f31aac352389e6afe26bcdd8cadee55a1b9a01d5dcc runs/fb1/nodraft.json +d727370d925fcefb1f720f218d2fa5f171232ca958bc5beba58cf955c6cffbed runs/fb1/prefill32768.json +02d313a3ee4308005e76bddb4118c69224cebcc179903d69172d60ca7e077c61 runs/fb1/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/fb1/suite.log +ecd9392477ccf142702d7f150c153ff424c0f23572518b1a5231d76ac3c58cc9 runs/fb2/check-nodraft.log +503c5c7a9f393c2f922bf2b0e70516fecac95afe0e98adf75f931f1b3b81ae11 runs/fb2/check-prefill32768.log +8172dc033dc1539335752e71744553e48ebdb3b4f4bf2f35712816edee0e48cf runs/fb2/check-prefill8192.log +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/fb2/form.txt +3bcb32275ca03e3e568e34c4c67e00e3265d25d591201c4348e0132098ca1c86 runs/fb2/nodraft.json +503c5c7a9f393c2f922bf2b0e70516fecac95afe0e98adf75f931f1b3b81ae11 runs/fb2/prefill32768.json +8172dc033dc1539335752e71744553e48ebdb3b4f4bf2f35712816edee0e48cf runs/fb2/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/fb2/suite.log +0894586186a8e557fce5880bae4eb24c99cc6dba8fa094974227dc577b1f3d98 runs/fh1/check-nodraft.log +620095414f1cc965b12d90df08a3196ad3bb934049d2399082230261dd15046a runs/fh1/check-prefill32768.log +ffffd379e1c12ed1102c0c5f80b0fa71ce59cd24afabd44474c607f667a56b9c runs/fh1/check-prefill8192.log +dd5a8d01da4c42f13aface3aeb9cbac66bf0c5947963c8acf1be03c6782b9da7 runs/fh1/form.txt +ee829b9fc75e41dc260460d4993330f931373bde4ae8b1056de26681331c704a runs/fh1/nodraft.json +620095414f1cc965b12d90df08a3196ad3bb934049d2399082230261dd15046a runs/fh1/prefill32768.json +ffffd379e1c12ed1102c0c5f80b0fa71ce59cd24afabd44474c607f667a56b9c runs/fh1/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/fh1/suite.log +d119a4fe2e6411f18b89b897f7e3cc324bf79d8f09d7025f55ac574861119dc0 runs/fh2/check-nodraft.log +06c7606da0fcca72abca8589541357d414fe4b5e687f6f71654386eac4293fa8 runs/fh2/check-prefill32768.log +fe737fab8e67cbd745a0c771a16143b926f0870687ed30d5277f75eece8c26ee runs/fh2/check-prefill8192.log +dd5a8d01da4c42f13aface3aeb9cbac66bf0c5947963c8acf1be03c6782b9da7 runs/fh2/form.txt +4c361c089f3896ff038dd461badeccec2e032b6de1ce20cd67da54e6fe1a5ceb runs/fh2/nodraft.json +06c7606da0fcca72abca8589541357d414fe4b5e687f6f71654386eac4293fa8 runs/fh2/prefill32768.json +fe737fab8e67cbd745a0c771a16143b926f0870687ed30d5277f75eece8c26ee runs/fh2/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/fh2/suite.log +dd03a90f0f7cf12bd7d91fdf71b2655b72935970df21825c6de09c2a12997d84 runs/foff/check-nodraft.log +1b501cef253a94c7ab1b902ca4df041ff454cfe9a5f1bb425aca6296d67b3552 runs/foff/check-prefill32768.log +dee05adca306347d7225dbb7b9aef59ce0658f45ffa3c34b53f5e70c2d3abd32 runs/foff/check-prefill8192.log +dd5a8d01da4c42f13aface3aeb9cbac66bf0c5947963c8acf1be03c6782b9da7 runs/foff/form.txt +00508225e221b99d58a01152c54edf9a4c2d9b198cd1afbcbdb405eda8dc484a runs/foff/nodraft.json +1b501cef253a94c7ab1b902ca4df041ff454cfe9a5f1bb425aca6296d67b3552 runs/foff/prefill32768.json +dee05adca306347d7225dbb7b9aef59ce0658f45ffa3c34b53f5e70c2d3abd32 runs/foff/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/foff/suite.log +7c5578e91f9af44c51908e2c2a191857b11d828368278cb01dfec14ed3d0d1cf runs/kprof-earlier-head-factored.csv +e004c6e58c49939ec1da6edbefad470a584eb06a6778aa83b43c11e6b3b94537 runs/kprof-head-classic.csv +25f6d54b11648c8df5f601b62c5113c8a3eacff10c8d05acf637666c6d45b098 runs/rb1/check-nodraft.log +cf6223b3b4997a01adb50aecf61c60d2928030faa18d42a1bcbb6261314deb77 runs/rb1/check-prefill32768.log +861e0a4a71dbe912ad0bc3ab25535cde1bf7f532bed00453c016f01a68ac491a runs/rb1/check-prefill8192.log +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/rb1/form.txt +5b5289bd6607bad643c17b1c9f72079a349e0a1fb72fd3a1231fdba7e8b121b9 runs/rb1/nodraft.json +cf6223b3b4997a01adb50aecf61c60d2928030faa18d42a1bcbb6261314deb77 runs/rb1/prefill32768.json +861e0a4a71dbe912ad0bc3ab25535cde1bf7f532bed00453c016f01a68ac491a runs/rb1/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/rb1/suite.log +db711fd753a597c029ed7bf68ee2bc9a296a0f9f31d88572ac3eb47cf555cacb runs/rb2/check-nodraft.log +e01900f6d4718614f37225b1401daa313bb99626dc86b8e6682f2859b060b7d1 runs/rb2/check-prefill32768.log +93afc8ce1cf80874342a2caa837a60bfb647490385a212ed7c3f72d3f9a4f8a2 runs/rb2/check-prefill8192.log +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/rb2/form.txt +d69ebee56aaf1859c45dc173b9c996530a4876702867391398b9f1e90d4d21e2 runs/rb2/nodraft.json +e01900f6d4718614f37225b1401daa313bb99626dc86b8e6682f2859b060b7d1 runs/rb2/prefill32768.json +93afc8ce1cf80874342a2caa837a60bfb647490385a212ed7c3f72d3f9a4f8a2 runs/rb2/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/rb2/suite.log +8902cf9e587b85142a4185e4ec8f920791f62ca95a0198df7a2224649c32da77 runs/re-b/check-conc.log +9e3f6b078aa35afc7a0fcd04f031509a313c581e0e517368e724ade1ebfcaea3 runs/re-b/check-golden.log +73fd09d014e365d4645031044a6e7de6eae7d9e5456695e4048ce05c507dc2b1 runs/re-b/check-resume.log +6da2b40f435da835fbd9411e5cd5c3ac7ceee0da7ebca269fcd75b7c1448a8ec runs/re-b/conc.json +baca4c67a1ab25ea3f5b14cda035cf54ea2a80cc64c2f9a98be27e04b25c876b runs/re-b/form.txt +645d70b511bdd902ee7f99e502e69ec0b0c9920996babfa64a454d5ea3fc6004 runs/re-b/golden.json +a3d90128670e71c5f724b7c63fb008694cf9610e3462ff3797e47776fb5f7e45 runs/re-b/resume.json +93ec057bb79c22ae2e3f01b5851528eccca6c536adc3a9aaaf2780f495510988 runs/re-b/suite.log +f3acd7c70baf0fc045c5fb9c1bf7350e94b364762d25dd689bb9bb05d92bca14 runs/re-h/check-conc.log +1d71abd46a7a452fe7c238105470d2c7f3b8b7a10976bb61be92309f6b8037fb runs/re-h/check-golden.log +80ae32c9c81b7764249006f130d3ede963e9a54b9a518bdfe4a37db588135b9d runs/re-h/check-resume.log +69652f09e26652a6ce94092d3cbecae214e0237bd8e69af7bb628ef50cae4350 runs/re-h/conc.json +2f741a011896d93d913eb4983feca5b159c406ad4d6e8598432b7a5c3e4e6b31 runs/re-h/form.txt +bc39e2eae0acd7a0791376cacba73d5d84a7c277b4400709926484cfad411f33 runs/re-h/golden.json +619a2483ab3cc5d75fc7d29b1c7bb680ce0ba450e5736b10806b92088436bff5 runs/re-h/resume.json +93ec057bb79c22ae2e3f01b5851528eccca6c536adc3a9aaaf2780f495510988 runs/re-h/suite.log +736ed848b552d72fffe83c114efe477c72fb2ad854b88e348ed145f1e2d96b1b runs/rh1/check-nodraft.log +3c245efc000391ad5a1a9fdd93d44ff849bc88f8c2668f02234a9fa1f8ba1969 runs/rh1/check-prefill32768.log +73f0ad421045cfa6ae0f9125297184995f0a9e63bdc9a3127ff15a8309f6e4ad runs/rh1/check-prefill8192.log +cbf77a2fa10224a41bb9c7279a636794e4f24f8620d1e948f0d3743ad5f1c723 runs/rh1/form.txt +23b4e32e1d7f4223e85ac23bf9e94d329228882a599d0851562549b98517bd6f runs/rh1/nodraft.json +3c245efc000391ad5a1a9fdd93d44ff849bc88f8c2668f02234a9fa1f8ba1969 runs/rh1/prefill32768.json +73f0ad421045cfa6ae0f9125297184995f0a9e63bdc9a3127ff15a8309f6e4ad runs/rh1/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/rh1/suite.log +35d14f1056e54e9cfba8aaf69b5a9f40eebac9874589219bf838dcddcd95b2c2 runs/rh2/check-nodraft.log +603bc0bd5d6943473593f7f442f9c464a81353efab1bd0882835cc997aef3f74 runs/rh2/check-prefill32768.log +7a6767cbd9ee63f1d0ce8b551ac3858d74d01fb9749b7a44700315467554758b runs/rh2/check-prefill8192.log +2f741a011896d93d913eb4983feca5b159c406ad4d6e8598432b7a5c3e4e6b31 runs/rh2/form.txt +9edb252c547c22c6578105336de5dd74998f8867e6adac92e361d4595967f297 runs/rh2/nodraft.json +603bc0bd5d6943473593f7f442f9c464a81353efab1bd0882835cc997aef3f74 runs/rh2/prefill32768.json +7a6767cbd9ee63f1d0ce8b551ac3858d74d01fb9749b7a44700315467554758b runs/rh2/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/rh2/suite.log +46bc580aab590bcbc0ad74729592ddfbdd5569463e2fb91f219efc6ec9647637 runs/roff/check-nodraft.log +9bb694001dba222a9523a64c940dd67aefbbc90a9530bdd8dfae0cd8de12043d runs/roff/check-prefill32768.log +67893a88b68907cc2d84ff640b2816d72cd1bb08a9d8db17659f05be751fb389 runs/roff/check-prefill8192.log +2f741a011896d93d913eb4983feca5b159c406ad4d6e8598432b7a5c3e4e6b31 runs/roff/form.txt +deb8e34433c4abb6cb3c34c54a50bf4e98cda408add78bed987da86a6e21b504 runs/roff/nodraft.json +9bb694001dba222a9523a64c940dd67aefbbc90a9530bdd8dfae0cd8de12043d runs/roff/prefill32768.json +67893a88b68907cc2d84ff640b2816d72cd1bb08a9d8db17659f05be751fb389 runs/roff/prefill8192.json +613a9c72b43bab32375ad08cfe6524384fd382f3d54bf91e21ca7ba9b3fccffa runs/roff/suite.log +39b3243297c779fd30a2afcdb7fc7e71b69371e8175656fafb78d7ef731df109 tools/__pycache__/pdl_ab.cpython-314.pyc +18391eb0ce3ec56f7b0e314160c3323a12b9361c590de317465e92c8fd767112 tools/first.py +85e6d6cce38660b08668a804c0bafddad8fdc587bcf895cb36005bfeccf2218f tools/pdl_ab.py +509c372a3defd5563079504fd10b51f638c6e541706ef42e32d9ecaa428150cb tools/suites.sh diff --git a/docs/receipts/glm-decode-pdl-60e67379/binaries.txt b/docs/receipts/glm-decode-pdl-60e67379/binaries.txt new file mode 100644 index 00000000000..38233a83ceb --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/binaries.txt @@ -0,0 +1,2 @@ +main 077998f7d9 tensorfold-native 03a9dcbc5d2cb3d93c15cd82f1bf14829564fa7dc2445bf5e27323036237a377 (both ranks) +head 60e673799f tensorfold-native d63a6e6f912f2471729c4581c1b77bb9d4975160dd9e85cff24bc42dbcb5db8c (both ranks) diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract-summary.txt b/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract-summary.txt new file mode 100644 index 00000000000..b651133431f --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract-summary.txt @@ -0,0 +1,10 @@ +# tf-cuda-test kernel-contract, nvcc 13.3 (V13.3.73), GB10 sm_121, this branch before its commit "keep main's records of qmmf's 16-row cluster tiles" (records only) +KNOWN nonfinite cuda qwen35 decode attention, bf16 cache (tf_q35_attn_partial, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +KNOWN nonfinite cuda qwen35 decode attention, fp8 cache (tf_q35_attn_partial8, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +KNOWN nonfinite cuda qwen35 MT2 fp8 paged attention: a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +KNOWN nonfinite cuda qwen35 MT2 fp8 whole attention: a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +KNOWN nonfinite cuda glm tf_glm_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN +KNOWN nonfinite cuda glm tf_glm_index_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN +KNOWN nonfinite cuda qwen35 contiguous attention, bf16 cache (tf_q35_attn_partial_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +KNOWN nonfinite cuda qwen35 contiguous attention, fp8 cache (tf_q35_attn_partial8_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk +SUMMARY 661 kernels: 661 pass gates 1-4, 0 fail, 8 known findings; 422 controls: 422 red as planted, 0 missed; 387 limit problems; gates 3449100 ms, limits 750083 ms diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract.log.gz b/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract.log.gz new file mode 100644 index 00000000000..7675d9a485f Binary files /dev/null and b/docs/receipts/glm-decode-pdl-60e67379/contract/kernel-contract.log.gz differ diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/limits-branch.log.gz b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-branch.log.gz new file mode 100644 index 00000000000..497790ced0b Binary files /dev/null and b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-branch.log.gz differ diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/limits-main.log.gz b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-main.log.gz new file mode 100644 index 00000000000..095da1e3345 Binary files /dev/null and b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-main.log.gz differ diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/limits-stale.txt b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-stale.txt new file mode 100644 index 00000000000..8ab513dcd4a --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/contract/limits-stale.txt @@ -0,0 +1,8 @@ +# kernel-contract-limits on five-SM fatbins (sm_80,86,89,120,121), nvcc 13.3 (V13.3.73); a problem is a record that differs from the measured usage (stale) +main 3f1290ffe7: FAIL kernel-contract-limits: 834 problems +branch (with its qmmf cluster tile record commit): FAIL kernel-contract-limits: 832 problems +stale on the branch only: +stale on main only: +sm_120|df_sumn +sm_121|df_sumn +PASS limit lines (branch): 5330, FAIL limit lines: 0 diff --git a/docs/receipts/glm-decode-pdl-60e67379/contract/sass-early-loads.txt b/docs/receipts/glm-decode-pdl-60e67379/contract/sass-early-loads.txt new file mode 100644 index 00000000000..29ee372c8ed --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/contract/sass-early-loads.txt @@ -0,0 +1,19 @@ +## the earlier head 79c9ffe97f: inputs const __restrict__ (served images, sm_121) +# python3 tools/pdl_early_loads.py cuobjdump (nvcc 13.5) glm_dflash.fatbin glm_glue.fatbin glm_index.fatbin glm_kda.fatbin glm_mm.fatbin glm_ops.fatbin glm_quant.fatbin glm_vision.fatbin qmmf.fatbin +EARLY glm_dflash.fatbin sm_121 df_attn: global read before the wait: /*0100*/ LDG.E.64.CONSTANT R38, desc[UR8][R38.64] ; /* 0x0000000826267981 */ +EARLY glm_glue.fatbin sm_121 tf_glm_dsel_merge: global read before the wait: /*0070*/ LDG.E.CONSTANT R4, desc[UR12][R2.64] ; /* 0x0000000c02047981 */ +EARLY glm_glue.fatbin sm_121 tf_glm_dsel_scan: global read before the wait: /*0080*/ LDG.E.CONSTANT R2, desc[UR16][R2.64] ; /* 0x0000001002027981 */ +EARLY glm_index.fatbin sm_121 tf_glm_index_pools: global read before the wait: /*0050*/ LDG.E.CONSTANT R4, desc[UR14][R2.64] ; /* 0x0000000e02047981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_unmark: global read before the wait: /*0050*/ LDG.E.CONSTANT R6, desc[UR4][R4.64] ; /* 0x0000000404067981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_keep: global read before the wait: /*0060*/ LDG.E.CONSTANT R6, desc[UR4][R6.64] ; /* 0x0000000406067981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_copy_cached: global read before the wait: /*0060*/ LDG.E.CONSTANT R2, desc[UR4][R2.64] ; /* 0x0000000402027981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_prev_mark: global read before the wait: /*0050*/ LDG.E.CONSTANT R3, desc[UR6][R2.64] ; /* 0x0000000602037981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_rows: global read before the wait: /*0090*/ LDG.E.CONSTANT R6, desc[UR8][R2.64] ; /* 0x0000000802067981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_reset: global read before the wait: /*0060*/ LDG.E.CONSTANT R4, desc[UR4][R4.64] ; /* 0x0000000404047981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_kvh_copy: global read before the wait: /*0060*/ LDG.E.CONSTANT R6, desc[UR4][R6.64] ; /* 0x0000000406067981 */ +EARLY glm_ops.fatbin sm_121 tf_glm_dsa_tokens: global read before the wait: /*0070*/ LDG.E.CONSTANT R4, desc[UR14][R2.64] ; /* 0x0000000e02047981 */ +12 early read(s) in 201 function(s) of 9 image(s) + +## this head 60e673799f (served images, sm_121) +# python3 tools/pdl_early_loads.py cuobjdump (nvcc 13.5) glm_dflash.fatbin glm_glue.fatbin glm_index.fatbin glm_kda.fatbin glm_mm.fatbin glm_ops.fatbin glm_quant.fatbin glm_vision.fatbin qmmf.fatbin +0 early read(s) in 201 function(s) of 9 image(s) diff --git a/docs/receipts/glm-decode-pdl-60e67379/prompts/p32768.json b/docs/receipts/glm-decode-pdl-60e67379/prompts/p32768.json new file mode 100644 index 00000000000..af1a431e99b --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/prompts/p32768.json @@ -0,0 +1 @@ +[2, 25955, 74937, 389, 5515, 320, 29624, 692, 63, 45832, 19923, 15586, 19363, 63, 8472, 389, 5515, 448, 458, 33399, 22611, 1526, 279, 1852, 54443, 4712, 279, 14330, 1936, 5711, 11, 323, 448, 458, 198, 57311, 22611, 1526, 279, 79649, 19127, 979, 279, 1936, 12179, 304, 28552, 12, 35, 2151, 11260, 58800, 19170, 374, 66689, 594, 13, 5515, 374, 7248, 504, 198, 2427, 1172, 624, 785, 8574, 6682, 10630, 55, 220, 99698, 24, 15, 28552, 87, 102807, 62, 102636, 96378, 7808, 1565, 3563, 62, 103502, 32725, 323, 33399, 10630, 55, 26382, 451, 16, 55, 28552, 64, 1113, 102636, 96378, 7808, 1565, 3563, 62, 116045, 32725, 8472, 624, 22176, 3671, 56100, 614, 537, 1012, 54253, 389, 279, 18371, 4916, 382, 565, 3555, 498, 1184, 271, 12, 1527, 33399, 22611, 323, 264, 1482, 3037, 5579, 320, 275, 17701, 1565, 77, 7362, 8052, 22145, 76960, 902, 54443, 65414, 374, 4362, 311, 1598, 4292, 12, 2014, 1936, 25, 508, 57, 343, 220, 15, 13, 99419, 13, 15, 9529, 2428, 1110, 35188, 5205, 2659, 33468, 50474, 320, 1782, 2319, 304, 73514, 35188, 45098, 63, 701, 279, 54443, 54410, 198, 220, 320, 99366, 1993, 12504, 8, 369, 1565, 36749, 638, 7808, 323, 10287, 11282, 356, 1027, 7854, 13843, 448, 279, 356, 1027, 53239, 28552, 564, 19363, 7808, 31309, 638, 594, 3468, 19378, 3593, 565, 7854, 271, 3830, 264, 330, 87, 102636, 16686, 13843, 1, 9929, 320, 269, 1283, 4303, 1565, 7362, 15368, 102636, 80744, 7808, 476, 1565, 7362, 15368, 541, 80744, 6773, 102636, 22819, 67, 102636, 63, 389, 5515, 30368, 102636, 701, 773, 198, 63, 564, 19363, 63, 374, 389, 1565, 13584, 63, 1447, 73022, 13709, 198, 35188, 1936, 9862, 4582, 481, 35, 3563, 28, 103502, 481, 35, 13097, 11260, 74800, 220, 481, 35, 36749, 638, 35046, 79638, 7944, 69098, 6863, 1699, 85, 638, 19363, 698, 13865, 19288, 63, 12, 35, 3563, 63, 4990, 279, 22611, 594, 12558, 22245, 2041, 279, 12750, 11, 31550, 18630, 369, 3807, 25, 220, 102807, 320, 5350, 55, 220, 99064, 701, 220, 103502, 320, 5350, 55, 220, 99698, 1326, 103005, 320, 5350, 55, 220, 99200, 701, 220, 116045, 320, 5381, 98668, 608, 10630, 55, 26382, 451, 16, 55, 568, 576, 3538, 374, 1565, 35188, 9789, 1699, 1388, 59, 6863, 4955, 3805, 19923, 15586, 19363, 16890, 63, 35188, 9789, 59, 6863, 4955, 69, 1786, 8052, 16821, 19363, 63, 8472, 279, 22611, 54794, 28552, 8932, 1786, 8052, 16821, 3546, 7808, 1565, 3563, 4740, 7808, 1565, 6072, 361, 7808, 1565, 13602, 7808, 1565, 30330, 42762, 12885, 63, 2649, 482, 23, 7808, 1565, 2528, 2912, 7808, 1565, 327, 18983, 23, 63, 3593, 63, 35188, 1936, 1273, 63, 8472, 279, 3468, 7032, 2041, 264, 22611, 382, 14364, 576, 3468, 7032, 389, 264, 5662, 448, 902, 39713, 22611, 271, 785, 3468, 16168, 3880, 1172, 73187, 25, 902, 54443, 65414, 11, 902, 10287, 11282, 320, 57, 343, 594, 1828, 18231, 22056, 279, 356, 1027, 3468, 3542, 701, 4302, 31158, 624, 6727, 389, 264, 220, 98546, 20, 5515, 220, 98668, 20595, 320, 48786, 600, 22, 12, 101655, 17, 15, 88878, 11, 3040, 35526, 11, 220, 99317, 18831, 26, 1181, 33777, 220, 24, 101411, 44, 374, 3685, 279, 54443, 1936, 594, 1525, 62, 99695, 198, 30331, 8, 448, 73187, 220, 15, 13, 99419, 13, 15, 504, 279, 22758, 10303, 11, 389, 1887, 518, 220, 24, 67, 21, 69, 16, 67, 100928, 66, 320, 115937, 21, 12, 98965, 12, 100590, 7731, 12, 1565, 35188, 1936, 1273, 63, 504, 4302, 25, 4869, 220, 15, 304, 220, 107271, 22, 274, 13, 5005, 11, 448, 73514, 35188, 36489, 63, 6963, 323, 279, 3644, 73187, 6500, 8204, 345, 220, 1565, 35188, 1936, 1273, 1177, 1708, 678, 44364, 1565, 11061, 21466, 25, 220, 101474, 16, 14, 101474, 16, 7354, 25253, 26, 220, 21, 100632, 16, 14, 101411, 16, 19, 7032, 5823, 320, 122876, 34983, 8, 7808, 4869, 198, 220, 220, 15, 11, 220, 111659, 24, 274, 13, 1084, 23408, 2632, 369, 4420, 518, 264, 882, 26, 279, 12120, 1555, 323, 279, 4869, 2038, 525, 279, 1102, 624, 12, 73187, 220, 15, 13, 99419, 594, 1936, 22202, 23408, 264, 3019, 594, 4916, 11, 1181, 16987, 26351, 323, 264, 1565, 16077, 3210, 18703, 1555, 369, 1449, 3019, 429, 198, 220, 6139, 311, 26351, 11, 18958, 5230, 320, 1782, 45466, 3671, 75694, 18958, 11, 23996, 12626, 11, 279, 1565, 8932, 40864, 22145, 63, 1555, 198, 220, 3685, 568, 362, 4641, 3019, 702, 458, 1565, 841, 18703, 1555, 323, 279, 1936, 41848, 2477, 36737, 26, 13857, 6932, 304, 429, 1598, 624, 12, 576, 1598, 6941, 220, 112891, 12454, 34983, 7032, 4815, 1181, 220, 122876, 90754, 25, 220, 101140, 4815, 1565, 436, 12393, 621, 659, 26989, 63, 304, 279, 1273, 594, 1828, 198, 220, 2530, 320, 1782, 1376, 1034, 594, 220, 15, 99618, 15, 7882, 7032, 11, 1681, 5224, 11, 19547, 76156, 22724, 11, 3687, 11797, 70722, 323, 54443, 18073, 58159, 4221, 198, 220, 1105, 701, 220, 24, 4815, 330, 22799, 1014, 15492, 1184, 25472, 389, 5515, 497, 220, 99241, 66689, 15370, 11, 220, 24, 14330, 15370, 11, 323, 220, 102340, 4815, 264, 29186, 345, 220, 12501, 11, 3671, 476, 2441, 7616, 13, 24803, 14552, 320, 6086, 11, 1752, 13393, 8, 476, 458, 31158, 9929, 8472, 279, 11621, 198, 220, 82532, 7032, 11, 892, 10701, 1172, 389, 1565, 14954, 54118, 76960, 2326, 803, 82532, 7032, 11, 304, 1565, 2153, 14, 12669, 291, 10490, 4452, 3938, 343, 12885, 220, 10701, 389, 5515, 8819, 279, 25472, 320, 276, 1565, 436, 12393, 621, 659, 26989, 63, 7616, 8, 323, 525, 4221, 279, 220, 99366, 10701, 4357, 279, 198, 220, 825, 14309, 18557, 1598, 1521, 537, 829, 624, 12, 1230, 9959, 279, 73187, 4139, 448, 5515, 6, 1828, 1565, 26651, 19363, 63, 28552, 34, 7190, 13156, 83855, 101175, 4955, 277, 19363, 481, 5848, 85104, 6558, 102807, 62, 102636, 96378, 12, 15, 13, 99419, 13, 15, 20944, 12885, 220, 220, 101140, 274, 1215, 73388, 594, 1565, 38738, 6691, 95384, 63, 3867, 220, 99446, 23, 274, 11, 323, 21073, 369, 5515, 6, 4253, 1565, 26651, 7808, 979, 1181, 1565, 7063, 59, 6863, 63, 374, 1156, 389, 198, 220, 1565, 13584, 7808, 1558, 537, 1349, 1147, 3077, 624, 12, 362, 1273, 389, 264, 504, 30652, 4916, 18392, 264, 9953, 11, 1565, 8932, 40864, 22145, 374, 2567, 369, 32774, 2550, 323, 2567, 5392, 198, 220, 6738, 76960, 1490, 508, 96638, 2550, 323, 2567, 5392, 6738, 9529, 2, 50807, 59112, 9772, 62032, 40003, 1786, 5583, 8, 369, 1380, 264, 198, 220, 2530, 1936, 5221, 432, 624, 12, 576, 1565, 12663, 18, 63, 279, 7375, 6, 11288, 829, 1231, 387, 279, 5100, 9126, 15522, 389, 5515, 26, 264, 10130, 2659, 4582, 374, 1565, 12663, 61898, 14364, 79649, 271, 2212, 93010, 35, 2151, 11260, 481, 35, 2151, 12, 1113, 38490, 1113, 43376, 323, 829, 264, 79649, 19378, 26, 279, 1936, 4990, 1565, 2151, 638, 19363, 63, 1156, 323, 1565, 2151, 638, 80744, 63, 2086, 345, 1499, 93010, 35, 2151, 638, 7808, 1565, 13584, 7808, 476, 1565, 67560, 7944, 63, 14, 63, 1285, 9980, 7944, 63, 6, 82, 1565, 6863, 7808, 323, 8472, 264, 73514, 13709, 63, 1526, 1565, 8709, 608, 66, 1618, 63, 1447, 73022, 13709, 198, 35188, 1936, 9862, 12, 2151, 481, 35, 2151, 11260, 481, 35, 2151, 12, 1113, 36968, 8297, 111508, 16, 74800, 220, 481, 35, 2151, 638, 40689, 7190, 696, 1176, 59, 54742, 111508, 16, 12, 98668, 13, 16, 13, 15, 59, 6863, 59, 2151, 638, 19363, 198, 13865, 19288, 785, 34878, 594, 5515, 1565, 54742, 111508, 16, 63, 1582, 323, 264, 79649, 26537, 594, 1565, 2151, 638, 19363, 63, 2176, 1936, 279, 63062, 13, 576, 3538, 20861, 279, 15580, 504, 198, 63, 67420, 2151, 102636, 22145, 63, 320, 1782, 5579, 594, 2975, 304, 739, 101175, 701, 1221, 504, 264, 79649, 26537, 594, 1565, 67420, 2151, 102636, 62, 22, 22145, 63, 323, 1565, 67420, 2151, 102636, 62, 21, 22145, 63, 389, 1565, 13584, 16890, 63, 51, 43957, 37, 7863, 2039, 3298, 63, 5036, 825, 6733, 38917, 11, 389, 1449, 5339, 13, 61906, 4990, 1181, 8038, 504, 279, 5579, 11, 323, 279, 198, 12801, 20146, 525, 1730, 553, 862, 5515, 5036, 28552, 27594, 48980, 22145, 7808, 1565, 44, 3810, 2752, 22145, 7808, 1565, 148415, 14483, 102636, 62, 99366, 22145, 63, 3593, 785, 5515, 79649, 26537, 1558, 537, 4211, 47174, 36881, 320, 73073, 76, 23290, 3298, 2, 100632, 19, 15, 701, 773, 264, 5827, 429, 17045, 369, 825, 8472, 14386, 26, 279, 198, 8511, 594, 1828, 36881, 653, 537, 990, 1105, 13, 17128, 264, 22611, 11, 1565, 35188, 1936, 18115, 38381, 16821, 481, 35, 2151, 11260, 63, 8472, 279, 25215, 7032, 323, 198, 63, 35188, 1936, 1779, 15586, 12, 2151, 38381, 481, 35, 2151, 11260, 63, 1367, 3658, 279, 1931, 3538, 2348, 79331, 63062, 13, 87773, 389, 1565, 54742, 111508, 16, 3989, 2785, 88, 5679, 15223, 8333, 10, 220, 101294, 20, 1648, 1565, 2151, 2371, 5584, 16821, 63, 220, 100919, 14, 100919, 389, 279, 3671, 11, 323, 1565, 93598, 1177, 2236, 63, 6682, 279, 79649, 19127, 448, 62880, 9385, 1911, 198, 437, 386, 3810, 2752, 1730, 382, 565, 6452, 271, 73022, 13709, 198, 45832, 19923, 15586, 6815, 25955, 74937, 20249, 29243, 11245, 336, 50670, 12, 18, 13, 20, 8124, 491, 1229, 12, 99064, 33, 6691, 18, 33, 12, 2668, 55, 12, 19, 4489, 198, 45832, 19923, 15586, 4119, 198, 45832, 19923, 15586, 8682, 366, 2528, 1815, 29, 1177, 606, 2205, 28147, 1177, 45824, 220, 16, 1177, 2147, 220, 23, 98729, 17, 1177, 34388, 220, 15, 1177, 2152, 98112, 198, 13865, 19288, 785, 3538, 63195, 389, 1565, 1254, 1110, 115925, 13, 15, 13, 15, 13, 16, 25, 99695, 23, 15, 5457, 16, 28487, 36821, 70260, 320, 269, 15304, 279, 2339, 8, 17906, 432, 96064, 382, 14364, 16125, 3073, 2550, 323, 2567, 5392, 6738, 271, 63, 2322, 8952, 63, 323, 264, 2567, 476, 6941, 1565, 14163, 31798, 63, 1184, 279, 31297, 6733, 11, 1565, 8932, 40864, 22145, 7808, 304, 198, 63, 35188, 9789, 1699, 1388, 59, 2740, 63, 29279, 279, 3538, 594, 1565, 6863, 28487, 17128, 432, 1846, 7388, 633, 10125, 220, 102259, 323, 4297, 770, 17026, 624, 11061, 432, 504, 279, 47414, 856, 40864, 27175, 1447, 73022, 13709, 198, 12875, 14705, 1177, 17913, 348, 15, 13, 17, 13, 23, 1177, 75160, 325, 17940, 11520, 3703, 1110, 5204, 905, 59134, 66, 12, 2143, 10771, 40864, 198, 35188, 1936, 31297, 481, 35, 87, 40864, 7846, 6484, 69098, 87, 40864, 198, 13865, 19288, 2271, 291, 389, 458, 10630, 55, 220, 99200, 24, 15, 448, 61732, 50670, 220, 18, 13, 20, 33682, 25, 5264, 15457, 52951, 6279, 39700, 323, 6941, 7375, 11, 16564, 43684, 1565, 3767, 63, 323, 1565, 14163, 12885, 63, 2236, 25293, 63, 323, 1565, 2236, 5314, 61898, 565, 26788, 389, 54443, 271, 45, 336, 50670, 220, 18, 13, 20, 33682, 17026, 438, 389, 14330, 13, 576, 1207, 16929, 18, 13, 20, 95298, 614, 264, 54443, 4712, 315, 862, 1828, 304, 419, 2635, 198, 5809, 35188, 13428, 6663, 58497, 33731, 16929, 18, 62, 20, 2899, 8052, 19884, 35188, 7808, 63062, 1565, 35188, 14100, 42087, 2899, 8052, 33731, 16929, 100235, 19884, 20159, 63, 701, 279, 19170, 63062, 6, 34612, 448, 198, 1782, 1852, 51223, 3501, 11, 773, 264, 3241, 315, 705, 311, 220, 99317, 6978, 14493, 1603, 825, 34668, 7354, 2699, 369, 2699, 1447, 73022, 13709, 198, 45832, 19923, 15586, 8682, 366, 48, 16929, 18, 13, 20, 12, 17, 33, 12, 2668, 55, 12, 19, 4489, 29, 1177, 606, 2804, 16929, 17, 65, 1177, 2147, 220, 18, 99951, 101840, 198, 45832, 19923, 15586, 8682, 366, 48, 16929, 18, 13, 23, 12, 99951, 33, 12, 2668, 55, 12, 19, 4489, 29, 1177, 606, 2804, 16929, 99951, 65, 1177, 2147, 220, 23, 98729, 17, 1177, 45824, 220, 19, 74800, 220, 1177, 22191, 1046, 366, 48, 16929, 18, 13, 23, 12, 99951, 33, 9416, 23809, 17, 397, 13865, 19288, 12, 1207, 16929, 18, 13, 20, 12, 17, 33, 25, 911, 220, 121910, 11206, 2687, 369, 825, 1681, 389, 458, 10630, 55, 220, 99698, 24, 15, 11, 220, 16, 11, 100840, 3941, 8062, 624, 12, 1207, 16929, 18, 13, 23, 12, 99951, 33, 320, 99317, 15380, 33, 1648, 220, 99698, 11206, 2687, 14386, 11, 518, 279, 3701, 594, 4938, 33234, 26, 220, 110672, 3941, 8062, 7388, 624, 12, 1565, 313, 22191, 1046, 63, 320, 19, 15245, 1172, 8, 20861, 1147, 2852, 370, 594, 422, 23809, 17, 9955, 1614, 25, 279, 2169, 13905, 4236, 13608, 6, 96720, 1119, 264, 10053, 198, 220, 369, 432, 11, 323, 432, 63139, 264, 4916, 315, 705, 311, 220, 98886, 32868, 264, 4778, 429, 279, 4778, 6337, 594, 49393, 20770, 504, 1128, 279, 2169, 198, 220, 3867, 13, 362, 46379, 55604, 1681, 1622, 2539, 518, 220, 99695, 311, 220, 107271, 11206, 2687, 553, 1246, 43852, 279, 1467, 374, 320, 776, 325, 518, 279, 3347, 835, 345, 220, 2038, 518, 279, 1550, 701, 48569, 6174, 518, 220, 99200, 311, 220, 100096, 11, 323, 3040, 518, 3055, 5545, 911, 220, 107271, 23129, 26, 30517, 4717, 19479, 311, 198, 220, 14386, 46826, 13, 17910, 4990, 911, 220, 99695, 274, 25, 279, 43841, 1046, 594, 14314, 525, 10267, 1506, 311, 220, 19, 9468, 389, 279, 3468, 323, 1449, 198, 220, 6083, 374, 1598, 3055, 11, 438, 279, 5579, 73001, 264, 1882, 594, 1156, 990, 315, 1817, 9996, 323, 4147, 624, 12, 362, 10141, 3241, 594, 6978, 525, 537, 10653, 927, 15509, 25, 1817, 4269, 18392, 1181, 6978, 6, 74600, 8836, 323, 264, 2506, 5791, 942, 279, 198, 220, 11660, 1815, 11, 773, 279, 220, 99951, 33, 7424, 220, 101175, 6978, 264, 4637, 1380, 220, 23, 4946, 1573, 624, 12, 1565, 10803, 16728, 1718, 28, 16, 63, 23408, 1817, 10141, 11, 2506, 11, 34138, 323, 3331, 594, 30386, 323, 279, 37759, 6083, 320, 8818, 476, 32868, 317, 220, 1565, 10803, 9097, 1139, 787, 1570, 28, 16, 63, 63139, 26098, 1172, 624, 12, 2308, 9929, 6500, 28552, 313, 40358, 36489, 2371, 579, 63, 701, 1565, 313, 12669, 63, 476, 1565, 313, 19305, 63, 369, 1493, 1378, 4119, 382, 14364, 49846, 9344, 66720, 271, 785, 1207, 16929, 18, 13, 20, 4712, 1083, 20861, 19577, 55, 66720, 6693, 13445, 6777, 862, 1828, 63948, 320, 1782, 2193, 594, 1565, 30330, 2022, 3989, 2005, 5036, 264, 2374, 817, 4688, 11, 438, 74813, 2852, 76, 594, 9515, 18594, 323, 279, 16538, 72, 48, 323, 297, 48, 48417, 3270, 701, 220, 17, 311, 220, 23, 9468, 304, 198, 16735, 315, 220, 102636, 13, 8884, 4688, 26473, 518, 1181, 1828, 2374, 25, 220, 19, 15245, 13445, 389, 279, 220, 19, 15245, 20450, 438, 1573, 11, 220, 17, 11, 220, 18, 11, 220, 20, 323, 220, 21, 15245, 6174, 198, 263, 1565, 2649, 482, 23, 520, 84, 63, 6, 82, 20450, 315, 429, 2374, 11, 323, 220, 23, 15245, 6174, 389, 1181, 4922, 20450, 320, 64, 220, 22, 15245, 4688, 1035, 1896, 279, 220, 23, 15245, 20450, 4292, 11505, 2374, 8472, 279, 220, 19, 15245, 21224, 479, 2716, 53, 594, 34612, 323, 6078, 1181, 21613, 2121, 279, 1852, 38883, 99317, 54147, 11, 773, 264, 2038, 6696, 279, 198, 23995, 9468, 8819, 2374, 432, 374, 9763, 518, 11, 323, 4302, 374, 17949, 13, 1527, 38878, 315, 264, 2374, 1008, 1091, 220, 19, 476, 220, 23, 374, 198, 43365, 6758, 311, 279, 1790, 518, 2795, 13, 5515, 2058, 22739, 825, 34668, 7354, 2699, 369, 2699, 11, 323, 264, 13785, 220, 19, 15245, 29186, 198, 32533, 323, 8472, 6896, 438, 1573, 382, 12, 87773, 389, 458, 10630, 55, 220, 99698, 23, 15, 54436, 320, 99317, 18831, 1648, 1565, 66415, 89044, 45006, 16929, 18, 13, 20, 12, 19, 33, 12, 21317, 72, 48, 12, 19, 4489, 63, 320, 19, 323, 220, 23, 9468, 11, 264, 17318, 220, 23, 15245, 198, 220, 38878, 8, 518, 911, 220, 106464, 11206, 2687, 369, 825, 1681, 323, 220, 102259, 3941, 3040, 11, 323, 1565, 66415, 89044, 45006, 16929, 18, 13, 20, 12, 24, 33, 12, 21317, 72, 48, 12, 19, 4489, 3989, 220, 320, 276, 13058, 1122, 220, 23, 15245, 1968, 8, 518, 911, 220, 100928, 323, 220, 112896, 26, 30517, 7484, 11, 518, 3040, 22983, 323, 448, 52951, 44731, 788, 895, 63, 6144, 624, 12, 1565, 25258, 74937, 45006, 16929, 18, 13, 23, 12, 99951, 33, 16009, 48, 17, 63, 320, 62454, 220, 17, 15245, 11, 220, 116996, 13445, 518, 220, 20, 9468, 8, 4990, 220, 98668, 13, 18, 15380, 33, 11, 773, 279, 220, 99951, 33, 18275, 264, 220, 99317, 18831, 3701, 510, 220, 825, 4269, 518, 264, 220, 101175, 74, 3241, 11, 911, 220, 100461, 311, 220, 102636, 11206, 2687, 448, 63139, 13, 576, 3701, 5086, 6738, 297, 48, 17, 458, 19152, 198, 220, 3347, 15245, 4879, 11, 323, 1181, 30517, 1473, 432, 624, 12, 59089, 26671, 1896, 264, 479, 2716, 44, 916, 279, 1852, 20450, 28552, 2649, 482, 43082, 483, 520, 84, 32725, 448, 279, 220, 19, 15245, 9929, 479, 2716, 44, 594, 34612, 320, 9543, 4680, 17949, 3055, 311, 198, 220, 38883, 99317, 11, 825, 12001, 101175, 8780, 916, 730, 701, 773, 264, 2038, 315, 705, 311, 220, 19, 9468, 6696, 279, 9468, 279, 220, 19, 15245, 9929, 479, 2716, 44, 6696, 432, 13, 1913, 279, 198, 220, 220, 24, 33, 220, 23, 15245, 432, 52714, 50598, 504, 911, 220, 16, 11, 100840, 311, 220, 16, 11, 107578, 11206, 2687, 26, 279, 220, 99951, 33, 297, 48, 17, 594, 50598, 320, 9093, 220, 22, 100096, 11206, 2687, 8, 1033, 198, 220, 2669, 6822, 553, 279, 3701, 594, 38883, 99317, 15614, 4379, 448, 12001, 101175, 45465, 11, 537, 553, 4680, 15792, 624, 12, 1565, 8932, 1786, 8052, 16821, 68308, 23, 63, 12335, 1817, 15014, 2374, 594, 3871, 2348, 1181, 13903, 85180, 8629, 279, 220, 23, 15245, 20450, 11, 2699, 198, 220, 369, 2699, 11, 279, 3871, 2348, 2224, 102636, 11, 1449, 2802, 1760, 323, 6718, 15831, 1815, 4922, 369, 4922, 11, 323, 279, 9929, 479, 2716, 44, 198, 220, 2348, 279, 220, 19, 15245, 323, 220, 23, 15245, 20450, 6, 9929, 479, 2716, 21582, 382, 565, 2585, 279, 2635, 4278, 271, 12, 1565, 35188, 13428, 27205, 41600, 3938, 343, 63, 28552, 31, 474, 445, 7791, 899, 7808, 51780, 1119, 1449, 4688, 553, 1565, 35188, 30473, 41600, 3938, 343, 32725, 374, 279, 10345, 198, 220, 1849, 438, 279, 4712, 6738, 432, 13, 1913, 14330, 323, 66689, 432, 374, 1565, 1834, 520, 7808, 1565, 1834, 12999, 941, 63, 323, 1565, 1834, 909, 1872, 9191, 63, 34684, 26, 389, 5515, 198, 220, 1565, 7526, 666, 3938, 343, 63, 323, 1565, 7526, 6479, 941, 3938, 343, 63, 2968, 279, 1852, 5036, 916, 279, 30395, 5350, 11, 12184, 101175, 323, 12184, 13191, 624, 12, 17356, 525, 8927, 448, 1449, 4332, 3856, 11, 773, 28968, 28155, 323, 47187, 12, 3472, 25607, 35514, 438, 389, 71594, 13, 4248, 2768, 15792, 198, 220, 10701, 279, 2150, 6500, 28552, 6041, 11884, 9097, 14384, 1718, 7808, 438, 1565, 46, 31597, 63, 389, 14330, 568, 37107, 5173, 63, 374, 279, 1196, 594, 13332, 8526, 323, 198, 220, 1565, 27454, 63, 17047, 1182, 311, 1565, 6448, 76612, 18606, 12, 576, 472, 35093, 18564, 6500, 7746, 16281, 3542, 311, 76288, 13, 5515, 6147, 6568, 1014, 15492, 1172, 448, 24803, 14552, 476, 26082, 345, 220, 773, 1565, 23376, 63, 17047, 1182, 311, 2588, 7746, 320, 2152, 4960, 3550, 4292, 12, 4248, 2768, 15792, 990, 14554, 320, 815, 62, 1677, 374, 14330, 594, 4292, 12, 49104, 42446, 63637, 69878, 389, 5515, 320, 20759, 438, 10630, 55, 26382, 451, 16, 55, 1565, 3563, 62, 116045, 32725, 16681, 2348, 279, 467, 4103, 44, 54443, 3671, 7314, 198, 220, 28552, 20159, 18783, 1949, 1731, 2273, 17, 32725, 1393, 10277, 279, 42446, 220, 98668, 4, 20456, 323, 220, 19, 15380, 33, 1638, 6422, 13, 362, 7722, 3671, 22508, 1969, 1779, 198, 220, 279, 467, 4103, 44, 8038, 11, 23691, 89838, 323, 21725, 7761, 26, 2530, 25215, 7484, 1558, 537, 25306, 279, 3671, 624, 12, 576, 5333, 1376, 1034, 374, 10062, 369, 943, 323, 1379, 26, 5515, 13589, 2615, 304, 43212, 82, 11, 537, 3856, 9468, 11, 773, 279, 330, 96007, 480, 553, 198, 220, 1008, 3847, 1, 1779, 374, 279, 8526, 594, 43212, 4751, 1091, 1565, 55895, 220, 103306, 61898, 565, 85089, 504, 14330, 271, 12, 2308, 6399, 62, 1677, 11, 1565, 360, 2353, 63, 476, 14330, 37107, 15770, 3183, 336, 2733, 63, 21678, 11, 323, 902, 1565, 50, 16750, 3124, 63, 320, 1782, 1376, 1034, 374, 2058, 435, 485, 329, 979, 432, 4344, 4292, 12, 1565, 10803, 7867, 828, 45526, 63, 28288, 81467, 15792, 14330, 594, 37107, 7791, 25435, 14, 67623, 63, 323, 1558, 4302, 389, 5515, 624, 2, 65782, 33196, 271, 785, 2331, 5548, 374, 1565, 1254, 1110, 115925, 13, 15, 13, 15, 13, 16, 25, 99695, 23, 15, 5457, 16, 63, 448, 279, 1638, 3538, 5003, 382, 20754, 1565, 13259, 1177, 5365, 15163, 63, 13589, 279, 1482, 16657, 13, 508, 62278, 9529, 55816, 21274, 8, 9290, 1181, 2856, 198, 23231, 46905, 19387, 11, 11459, 2812, 52704, 11, 323, 20524, 12821, 382, 565, 16686, 6236, 3811, 2812, 271, 63, 45832, 19923, 8682, 47668, 1177, 9682, 33249, 2526, 60113, 1169, 41185, 63, 20861, 264, 20036, 12, 23, 38303, 5580, 3811, 504, 429, 1034, 198, 64363, 315, 279, 29186, 594, 3811, 3542, 476, 1565, 84888, 5332, 4323, 63, 19873, 13, 39188, 12710, 8829, 504, 279, 3538, 594, 3238, 6220, 13, 576, 1034, 374, 1349, 3055, 518, 20524, 11, 448, 279, 1852, 220, 99317, 20696, 33, 3930, 438, 279, 29186, 594, 1565, 9682, 8692, 1169, 41185, 61898, 785, 2812, 13460, 2176, 19083, 323, 5392, 90393, 6236, 7388, 26, 432, 1558, 537, 14051, 264, 29186, 594, 8650, 1565, 14163, 15938, 63, 3811, 13, 576, 29186, 594, 45681, 11, 3281, 11206, 323, 48593, 28261, 4717, 34684, 13, 1230, 878, 480, 476, 78613, 19873, 3690, 20524, 1573, 279, 4712, 15873, 11, 2041, 15667, 1182, 311, 279, 29186, 3811, 13, 1527, 4287, 1034, 10896, 6236, 20852, 34813, 11, 438, 264, 29186, 448, 902, 3811, 1558, 13, 22961, 9750, 50598, 653, 537, 990, 279, 6236, 3811, 382, 565, 5333, 6894, 271, 20586, 16279, 4193, 11499, 1565, 313, 2068, 16159, 12007, 7808, 31550, 72132, 1565, 51, 43957, 37, 7863, 11410, 6600, 7808, 323, 1565, 313, 2068, 16159, 14194, 26687, 28487, 576, 8172, 912, 6894, 3786, 13, 362, 1034, 702, 825, 1376, 817, 1555, 11, 10096, 1565, 1502, 25, 1376, 63, 10690, 11, 323, 5128, 5916, 448, 198, 63, 2, 63, 369, 6042, 13, 2573, 1181, 8540, 311, 1565, 15, 99618, 15, 76960, 20524, 40393, 264, 1034, 33636, 553, 1008, 3847, 624, 785, 3538, 10528, 21669, 12, 116265, 4078, 17939, 323, 42222, 1449, 19718, 20836, 369, 1817, 16636, 4774, 382, 11500, 1565, 18096, 25, 425, 20740, 12007, 63, 504, 5264, 15457, 79569, 8238, 11, 476, 1565, 87, 23837, 16159, 25, 12007, 63, 504, 26643, 8238, 13, 35089, 476, 8317, 16373, 470, 10125, 220, 99698, 16, 448, 1565, 45239, 12, 98246, 25, 425, 20740, 63, 323, 279, 6021, 594, 1465, 3561, 13, 3085, 6894, 19718, 11, 279, 9862, 3538, 7460, 264, 1376, 389, 1449, 6021, 553, 1638, 13, 11440, 584, 19548, 525, 7890, 37107, 7808, 37107, 12114, 7808, 37107, 19305, 63, 323, 279, 8062, 22803, 37107, 19305, 14, 63, 19465, 26, 1565, 313, 43016, 25607, 63, 1083, 15873, 7890, 37107, 43016, 7808, 37107, 85, 16, 3183, 13459, 63, 323, 37107, 85, 16, 71347, 28487, 6944, 5413, 323, 9783, 11764, 1373, 264, 1376, 13, 1096, 5646, 1449, 37107, 8945, 603, 63, 44120, 15522, 323, 3853, 869, 11286, 13, 37107, 12114, 63, 8457, 1787, 323, 4675, 1172, 1565, 4913, 2829, 3252, 562, 1, 5541, 979, 6894, 525, 19718, 13, 3066, 2820, 374, 1349, 15370, 11, 2670, 979, 264, 7585, 3239, 374, 17201, 13, 3085, 902, 6894, 11, 1181, 2820, 3565, 7146, 2500, 26, 264, 2477, 60242, 1419, 10714, 23408, 264, 9953, 382, 785, 9862, 3538, 24810, 1181, 8412, 1787, 14194, 3930, 1573, 14279, 979, 279, 5339, 28588, 432, 13, 1416, 1565, 10325, 63, 8472, 700, 315, 47225, 11, 432, 18392, 825, 18788, 1555, 817, 20481, 323, 13589, 264, 2805, 22624, 1182, 1847, 382, 23044, 279, 1376, 1034, 19088, 2673, 311, 16900, 6894, 13, 11440, 17011, 882, 374, 10062, 518, 1429, 3055, 264, 2086, 26, 328, 16750, 3124, 7388, 458, 13913, 18613, 13, 1527, 4287, 11, 59871, 480, 476, 78613, 13714, 33090, 37066, 11286, 3080, 264, 2697, 1034, 4675, 13, 6145, 18392, 323, 1565, 45832, 19923, 25, 36059, 10779, 63, 990, 9198, 11, 2581, 6894, 476, 4078, 17939, 13, 1230, 30128, 6894, 5258, 1565, 19484, 11245, 7808, 1565, 3160, 11245, 63, 476, 1565, 1192, 11245, 63, 9198, 13, 60568, 6644, 518, 1429, 220, 102636, 11925, 11, 18478, 11, 30868, 11, 71242, 476, 6275, 759, 724, 26, 5157, 2477, 68389, 9198, 382, 641, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 594, 508, 2865, 3054, 9529, 2865, 21274, 701, 1565, 45832, 19923, 2473, 4582, 47668, 1177, 2068, 16159, 14194, 26687, 63, 40824, 279, 1034, 311, 1181, 3538, 11, 323, 1565, 45832, 19923, 259, 1963, 1177, 1085, 5548, 1177, 5839, 66970, 53931, 63, 21259, 429, 3890, 594, 897, 438, 264, 69251, 1376, 13, 576, 9862, 7868, 702, 13857, 3210, 13, 83773, 264, 21687, 1034, 916, 3210, 8446, 6894, 11, 892, 646, 4994, 304, 279, 10345, 1849, 594, 1882, 1140, 382, 14364, 5309, 50266, 271, 32, 9862, 1376, 1034, 646, 3930, 264, 1376, 311, 1045, 11286, 13, 9641, 279, 50266, 304, 38721, 1283, 279, 2383, 1447, 73022, 1318, 198, 676, 15363, 2202, 5669, 17885, 6600, 198, 75435, 3362, 58, 878, 5669, 28437, 44298, 6600, 198, 9969, 2190, 15363, 2202, 11, 878, 5669, 2100, 30150, 6600, 198, 3721, 58, 2882, 5669, 41142, 11851, 6600, 198, 39668, 25, 64417, 6600, 198, 13865, 19288, 32, 1376, 2041, 38721, 11, 504, 264, 14386, 1034, 1555, 11, 1565, 313, 2068, 16159, 63, 476, 1565, 51, 43957, 37, 7863, 11410, 6600, 7808, 13589, 1449, 6021, 11, 438, 1573, 13, 77021, 2882, 60, 63, 374, 198, 1782, 1852, 438, 902, 38721, 13, 576, 1008, 50266, 525, 1565, 258, 2202, 7808, 1565, 878, 63, 476, 2176, 11, 31550, 72132, 26, 458, 9783, 11, 11499, 476, 4287, 198, 4186, 11, 476, 1565, 2882, 63, 29279, 2441, 11, 3643, 279, 1034, 8317, 13, 3776, 1376, 4157, 6777, 1378, 6891, 7289, 25, 264, 1034, 429, 6696, 279, 1852, 1376, 198, 63197, 50266, 11, 476, 50266, 264, 1376, 279, 8041, 476, 4573, 2669, 2968, 11, 374, 16037, 518, 20524, 323, 389, 18613, 382, 91, 34746, 760, 22299, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 258, 2202, 63, 760, 12862, 37107, 85, 16, 70793, 25016, 10814, 908, 7808, 37107, 85, 16, 25016, 10814, 908, 7808, 37107, 85, 16, 32280, 22589, 7808, 37107, 85, 16, 71206, 7808, 37107, 85, 16, 71206, 80386, 28735, 7808, 37107, 85, 16, 54024, 551, 7808, 37107, 85, 16, 3446, 295, 1679, 551, 7808, 37107, 85, 16, 70707, 2687, 39371, 7808, 37107, 85, 16, 9733, 4846, 798, 804, 7808, 37107, 85, 16, 58250, 24527, 7808, 37107, 85, 16, 14, 8168, 6805, 7808, 37107, 85, 16, 28042, 603, 7808, 37107, 85, 16, 7382, 261, 1180, 63, 320, 18621, 553, 34210, 701, 37107, 85, 16, 14, 4215, 7808, 323, 279, 1852, 12710, 2041, 37107, 85, 16, 63, 1380, 279, 3538, 702, 1105, 26, 7890, 37107, 85, 16, 20227, 7808, 37107, 6507, 7808, 37107, 85, 16, 14, 40458, 76960, 264, 46752, 13901, 389, 7890, 37107, 85, 16, 32280, 22589, 63, 476, 37107, 70465, 63, 9245, 91, 1565, 878, 63, 760, 7890, 37107, 43016, 7808, 37107, 85, 16, 3183, 13459, 7808, 37107, 85, 16, 71347, 7808, 37107, 17248, 7808, 37107, 85, 16, 79031, 7808, 37107, 16246, 7808, 37107, 18608, 7808, 37107, 85, 16, 3470, 39167, 14, 42073, 7808, 37107, 85, 16, 20227, 7808, 37107, 6507, 7808, 37107, 85, 16, 14, 40458, 63, 35543, 32, 46670, 1376, 24417, 4302, 770, 25, 537, 279, 9763, 79817, 320, 3806, 476, 17177, 37107, 85, 16, 32280, 22589, 14, 915, 63, 701, 78901, 11, 6852, 6577, 1205, 2796, 345, 63, 14, 85, 16, 71472, 1350, 7808, 2441, 1714, 11, 476, 264, 20482, 15522, 1741, 438, 37107, 3145, 25016, 10814, 908, 63, 429, 279, 3538, 11248, 369, 264, 2480, 1376, 13, 576, 6021, 198, 285, 18026, 6896, 1283, 279, 3239, 323, 27654, 86671, 525, 3931, 13, 362, 16037, 6021, 11248, 220, 99698, 18, 448, 279, 2038, 198, 63, 1330, 26597, 23136, 63, 320, 15808, 11286, 25, 458, 16564, 43684, 1565, 22559, 4096, 32725, 323, 33090, 279, 3633, 1573, 279, 2487, 374, 1349, 198, 269, 264, 41994, 1614, 18613, 82, 13, 576, 584, 11286, 4717, 584, 382, 785, 9763, 79817, 9170, 311, 279, 3538, 11, 537, 311, 264, 1376, 11, 773, 264, 46670, 1376, 594, 1565, 2946, 608, 85, 16, 32280, 22589, 63, 1969, 3624, 52951, 4314, 788, 895, 3989, 437, 902, 1565, 19665, 9651, 842, 7808, 448, 279, 4361, 10430, 304, 1565, 1355, 76960, 4113, 770, 11248, 220, 99698, 18, 34774, 279, 2070, 13, 6065, 198, 64, 79817, 7575, 11, 264, 1565, 19665, 9651, 842, 63, 429, 279, 7575, 594, 1828, 6500, 9977, 374, 5420, 13, 362, 1681, 13589, 279, 50266, 198, 275, 572, 11660, 448, 421, 279, 1034, 4344, 1393, 432, 8472, 13, 2463, 18492, 525, 23649, 1172, 25, 1449, 1376, 13240, 825, 1614, 345, 1199, 9929, 6500, 323, 279, 16717, 4192, 565, 16467, 1681, 7102, 271, 785, 3538, 26261, 6238, 8459, 11545, 7167, 448, 37107, 7808, 448, 3239, 1467, 323, 27654, 86671, 32154, 553, 279, 198, 6100, 6021, 13129, 13, 48574, 34832, 11, 34333, 323, 2524, 5820, 525, 16037, 1573, 28952, 13, 22299, 525, 1142, 56285, 198, 437, 3266, 64633, 525, 537, 29106, 1119, 40164, 13, 8393, 10150, 476, 46745, 4247, 5043, 525, 16037, 323, 7877, 382, 1925, 264, 6337, 1419, 10714, 11, 279, 9862, 3538, 26261, 264, 1565, 9293, 63, 34774, 1565, 8300, 63, 476, 264, 6337, 1419, 6790, 11, 448, 894, 2697, 2635, 624, 2132, 12335, 279, 5042, 6822, 7575, 11, 2670, 264, 28018, 429, 19636, 311, 6337, 1419, 13, 35089, 11, 22454, 11, 78613, 476, 198, 28343, 18402, 5258, 10125, 220, 99698, 18, 1573, 16636, 11, 1565, 99457, 14991, 63, 476, 28952, 13, 44540, 1565, 313, 20920, 38381, 19086, 63, 311, 912, 198, 83145, 3468, 11395, 476, 31509, 291, 6790, 74681, 13, 362, 829, 702, 902, 12852, 11, 1815, 476, 2635, 26, 432, 36945, 429, 829, 518, 894, 2635, 624, 785, 5181, 4344, 4247, 25215, 11, 537, 279, 14279, 2621, 13, 362, 2477, 60242, 1419, 10714, 90754, 419, 3468, 19418, 382, 1925, 1449, 10714, 11, 458, 1565, 13290, 63, 1969, 2432, 279, 1681, 594, 1565, 9293, 63, 323, 279, 9862, 3538, 594, 10125, 12852, 13, 16088, 606, 1142, 345, 57660, 21, 12839, 819, 323, 1638, 20284, 525, 29301, 13, 576, 6238, 1969, 387, 264, 3175, 1565, 1254, 1110, 28585, 3447, 5095, 60, 63, 476, 198, 63, 2428, 1110, 28585, 3447, 5095, 60, 63, 897, 448, 902, 1815, 476, 90418, 13, 1565, 2921, 7808, 78613, 2750, 323, 22454, 32227, 525, 16037, 624, 38510, 1565, 313, 20920, 66317, 2726, 55156, 63, 369, 21737, 19548, 11, 2670, 458, 60616, 6238, 1483, 1526, 264, 41419, 13283, 624, 9293, 323, 6238, 19548, 525, 9485, 26, 10688, 458, 6238, 1558, 537, 16681, 264, 7214, 6337, 1419, 16088, 624, 25844, 291, 7102, 653, 537, 3293, 279, 12852, 476, 30597, 2987, 1779, 382, 4854, 220, 99698, 18, 5036, 279, 16037, 4247, 323, 1181, 12153, 4683, 5181, 13, 47116, 2041, 458, 1565, 13290, 7808, 2670, 13948, 345, 31402, 82, 323, 279, 906, 11, 2506, 862, 6350, 7388, 448, 264, 2697, 16088, 13, 8881, 10799, 374, 537, 2567, 553, 1493, 12335, 11, 773, 198, 63, 19887, 481, 67, 63, 7388, 2506, 3238, 13, 576, 3538, 11362, 902, 89916, 7102, 26, 1493, 8041, 653, 537, 7283, 5312, 66317, 6929, 15792, 624, 785, 4247, 12335, 6016, 6929, 2615, 323, 653, 537, 8289, 5333, 6894, 13, 1163, 14267, 12615, 476, 22340, 304, 16088, 476, 17097, 2750, 198, 546, 16037, 26, 8238, 1265, 50709, 429, 15942, 36188, 382, 9293, 323, 17097, 4683, 11464, 1817, 4193, 518, 1429, 220, 102636, 10690, 13, 27506, 5036, 990, 2477, 3194, 39104, 9198, 2041, 264, 27654, 198, 16105, 26, 31427, 21, 74681, 525, 31509, 291, 2041, 10138, 46925, 13, 7209, 10125, 1681, 3880, 6896, 825, 2697, 16088, 11, 2670, 198, 9227, 14, 16, 13, 15, 26, 3468, 1717, 10125, 14, 15, 13, 24, 374, 16037, 323, 7877, 13, 1527, 9247, 10714, 90754, 1172, 6337, 1419, 11489, 25215, 382, 2461, 264, 21737, 13283, 829, 323, 3482, 6238, 11, 369, 3110, 1447, 73022, 927, 198, 45832, 19923, 15586, 8682, 47668, 1177, 20920, 38381, 44120, 7724, 1177, 20920, 66317, 3703, 1110, 258, 2202, 7724, 198, 13865, 19288, 91, 9568, 760, 26589, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 3806, 608, 85, 16, 20227, 63, 760, 328, 2771, 1614, 3034, 323, 894, 19718, 40164, 320, 20981, 16279, 1215, 9862, 10690, 6777, 508, 93598, 9529, 2, 2528, 36498, 8455, 8, 9245, 91, 1565, 3806, 608, 12114, 63, 760, 444, 12775, 11, 279, 10218, 1614, 11, 279, 7177, 323, 3887, 7813, 26, 1787, 448, 6894, 320, 4060, 508, 14532, 9529, 2, 12114, 593, 9245, 91, 1565, 3806, 608, 17248, 7808, 1565, 3806, 608, 85, 16, 79031, 63, 760, 16686, 1349, 15370, 4938, 16281, 11737, 17248, 49101, 9529, 17248, 1737, 18904, 21274, 593, 9245, 91, 1565, 3806, 608, 43016, 7808, 1565, 3806, 608, 85, 16, 3183, 13459, 63, 760, 96323, 1467, 25, 7388, 11, 83952, 64842, 11, 63139, 323, 39058, 320, 20981, 16279, 8, 9245, 91, 1565, 3806, 608, 85, 16, 71347, 63, 760, 576, 28706, 2795, 46645, 438, 825, 4718, 1633, 320, 29624, 3538, 1215, 1490, 508, 38670, 2795, 9529, 2, 62673, 48697, 8, 9245, 91, 1565, 3806, 608, 18608, 63, 760, 16686, 3887, 26879, 2150, 979, 1565, 313, 18608, 63, 374, 8967, 9245, 91, 1565, 3806, 608, 16246, 63, 760, 16686, 4718, 26879, 16281, 979, 1565, 313, 18608, 63, 374, 8967, 9245, 91, 1565, 2946, 608, 85, 16, 70793, 25016, 10814, 908, 63, 760, 2918, 6236, 11, 10096, 2168, 1946, 11, 7375, 323, 32559, 26, 72678, 476, 2477, 38515, 291, 9245, 91, 1565, 2946, 608, 85, 16, 25016, 10814, 908, 63, 760, 22961, 1467, 2041, 264, 6236, 3811, 11, 476, 3950, 28261, 9245, 91, 1565, 2946, 608, 85, 16, 71206, 63, 760, 16564, 43684, 26643, 25, 1467, 11, 7248, 5335, 11, 729, 7375, 323, 7274, 26, 4718, 476, 72902, 9245, 91, 1565, 2946, 608, 85, 16, 71206, 80386, 28735, 63, 760, 13839, 279, 1852, 1614, 9929, 2041, 23100, 9245, 91, 1565, 2946, 608, 5839, 551, 7808, 1565, 2946, 608, 85, 16, 54024, 551, 63, 760, 348, 4086, 44, 594, 25, 264, 1565, 40358, 63, 6, 82, 3950, 28261, 11, 476, 279, 28261, 264, 6236, 1681, 594, 1565, 16311, 63, 3141, 311, 9245, 91, 1565, 2946, 608, 19249, 1679, 551, 7808, 1565, 2946, 608, 85, 16, 3446, 295, 1679, 551, 63, 760, 348, 4086, 44, 594, 25, 279, 1467, 315, 1565, 30446, 7808, 3281, 11206, 5230, 9245, 91, 1565, 2946, 608, 85, 16, 32280, 22589, 63, 760, 5264, 15457, 594, 79817, 5333, 11, 1598, 438, 279, 13569, 6236, 9750, 26, 72678, 476, 2477, 38515, 291, 9245, 91, 1565, 3806, 608, 85, 16, 32280, 22589, 63, 320, 60807, 13901, 8, 760, 5264, 15457, 594, 79817, 508, 60807, 3856, 9529, 2, 82519, 14970, 1648, 1565, 2322, 2520, 63, 4357, 916, 825, 7575, 9245, 91, 1565, 3806, 608, 85, 16, 32280, 22589, 9384, 307, 28251, 1565, 14414, 608, 85, 16, 32280, 22589, 9384, 307, 5541, 760, 362, 9763, 2033, 11, 476, 4057, 432, 9245, 91, 1565, 2946, 608, 85, 16, 14, 8168, 6805, 63, 760, 27018, 11, 5456, 11, 323, 9829, 32942, 47914, 504, 279, 1790, 34668, 60362, 26, 902, 1467, 374, 7907, 9245, 91, 1565, 2946, 608, 85, 16, 71472, 1350, 32280, 3885, 63, 760, 2585, 1753, 315, 264, 6236, 2487, 594, 10430, 64737, 11, 323, 504, 1380, 11737, 263, 13355, 9529, 2, 443, 72432, 10321, 1737, 3187, 593, 9245, 91, 1565, 2946, 608, 85, 16, 71472, 1350, 71347, 63, 760, 362, 6236, 2487, 594, 10430, 1584, 1349, 504, 13355, 1119, 21984, 1431, 9245, 91, 1565, 14414, 608, 85, 16, 71472, 1350, 63, 760, 1096, 1614, 594, 10430, 5302, 389, 13355, 24473, 35543, 1925, 19577, 55, 11, 264, 3459, 908, 2487, 8481, 264, 2477, 3194, 1565, 16311, 63, 1140, 5711, 6236, 11584, 13, 54443, 3459, 908, 198, 22708, 264, 914, 1565, 40358, 63, 28552, 718, 41394, 28735, 7808, 1638, 895, 8, 476, 264, 1140, 315, 3950, 28261, 11, 1598, 438, 2661, 382, 63, 14, 5839, 551, 63, 4990, 348, 4086, 44, 594, 5043, 25, 264, 1565, 40358, 63, 914, 28552, 718, 41394, 28735, 7808, 1638, 830, 701, 476, 1565, 16311, 63, 448, 279, 198, 9682, 5043, 429, 6083, 279, 9929, 28552, 15906, 7808, 1565, 19857, 287, 51604, 371, 7808, 1565, 9682, 8692, 36052, 32725, 323, 1565, 718, 63731, 60990, 3989, 18943, 830, 568, 1084, 4675, 1565, 1830, 7808, 1565, 2810, 5047, 6043, 63, 320, 1782, 2266, 3241, 26, 845, 979, 6857, 374, 738, 389, 19577, 55, 8, 323, 198, 63, 30446, 7808, 323, 1565, 5839, 2895, 82, 63, 448, 1565, 689, 6458, 2895, 82, 25, 830, 28487, 576, 28261, 525, 279, 6174, 279, 6236, 6021, 8472, 369, 279, 1852, 198, 2035, 11, 5335, 323, 6803, 17163, 13, 37107, 19249, 1679, 551, 63, 4990, 1565, 30446, 63, 323, 4675, 1565, 40358, 18606, 641, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 11, 1565, 313, 13006, 63, 15342, 7248, 1207, 16929, 18, 13, 20, 14, 18, 13, 23, 27855, 66720, 4193, 1565, 1805, 2903, 63, 2213, 5479, 198, 38088, 2929, 1467, 304, 1196, 6605, 323, 304, 5392, 3059, 28552, 5778, 25, 330, 14163, 39700, 701, 1741, 438, 458, 8314, 594, 48415, 13, 576, 9862, 198, 4030, 15792, 5335, 369, 5588, 44, 12, 20, 13, 18, 12, 23809, 11, 1207, 16929, 18, 13, 23, 12, 99951, 33, 323, 31017, 1728, 220, 19, 220, 100557, 33, 389, 19170, 11, 448, 821, 34832, 11, 323, 584, 60616, 34832, 1212, 198, 63, 313, 13006, 12, 20459, 63, 11737, 1805, 1946, 9529, 13006, 21274, 2, 1782, 15586, 26217, 5905, 369, 5588, 44, 12, 20, 13, 18, 12, 23809, 432, 1083, 4990, 1565, 9981, 2903, 63, 5479, 304, 198, 872, 6605, 11737, 9981, 9529, 13006, 21274, 2, 9981, 10321, 10598, 15586, 26217, 39252, 9825, 508, 1805, 1946, 9529, 13006, 21274, 8, 369, 821, 34832, 11, 584, 2168, 34832, 11, 13379, 323, 6500, 7709, 624, 785, 9862, 7868, 40393, 1565, 313, 13006, 63, 369, 1008, 4119, 323, 11248, 862, 2168, 5479, 448, 10125, 220, 102259, 624, 41648, 2168, 1946, 11, 7699, 11, 2766, 323, 2477, 9342, 2550, 7388, 5258, 10125, 220, 102259, 382, 565, 4903, 16909, 271, 4854, 9862, 7890, 608, 85, 16, 20227, 4343, 11, 2670, 1449, 19718, 15522, 11, 5646, 264, 16909, 1633, 624, 2132, 6682, 279, 6661, 4712, 594, 2710, 13066, 8041, 25, 1467, 63731, 11, 2266, 761, 3762, 11, 1618, 1889, 973, 11, 6337, 36605, 345, 81583, 68365, 11, 32559, 11, 4226, 14753, 11, 14379, 11, 1487, 776, 1279, 11, 29870, 11, 9929, 5224, 776, 1279, 11, 9929, 11524, 345, 81917, 37080, 82, 11, 14386, 18380, 11, 27535, 11, 9182, 11, 55604, 18380, 323, 14971, 3382, 72432, 13, 576, 11124, 11, 8805, 345, 12244, 24527, 11, 1349, 11666, 323, 48243, 1180, 5043, 1895, 3425, 429, 1196, 4565, 374, 3042, 13, 576, 1537, 1378, 5043, 345, 81583, 27559, 323, 7274, 8190, 45835, 11, 525, 279, 6661, 6236, 3811, 594, 323, 45681, 594, 7274, 13057, 320, 4060, 198, 58, 25062, 287, 9529, 2, 19857, 287, 5731, 738, 3055, 518, 20524, 389, 279, 1852, 13066, 8041, 13, 7209, 2070, 374, 264, 4718, 2710, 345, 16155, 895, 11, 323, 902, 4822, 3565, 476, 14220, 525, 14888, 382, 66908, 323, 2710, 1681, 12335, 990, 279, 1852, 6661, 5181, 6604, 13, 56512, 20041, 902, 4565, 624, 9192, 7512, 279, 4712, 26, 1681, 27367, 11, 2266, 11, 3811, 323, 3561, 16963, 2058, 3796, 624, 15513, 9310, 18380, 323, 14386, 18380, 7512, 16851, 11, 323, 2266, 761, 3762, 2727, 279, 2266, 572, 7199, 311, 4938, 382, 565, 3714, 6805, 271, 63, 2946, 608, 85, 16, 14, 8168, 6805, 63, 374, 10218, 553, 17242, 9292, 389, 825, 54443, 22611, 11, 553, 444, 25530, 17, 389, 54443, 323, 553, 31017, 1728, 220, 19, 389, 1599, 6325, 624, 11505, 1008, 4712, 11, 892, 5646, 678, 19170, 8520, 323, 54443, 5588, 44, 3351, 11, 4675, 10125, 220, 102259, 624, 785, 9929, 59808, 374, 328, 3825, 524, 594, 5480, 9929, 3561, 2319, 220, 16, 25, 279, 1946, 11, 264, 10108, 1555, 11, 279, 3405, 11, 825, 1555, 817, 198, 2047, 11, 2188, 11, 476, 7481, 9829, 476, 902, 4226, 11, 323, 264, 15304, 7600, 311, 4226, 448, 825, 2383, 13, 27018, 9198, 525, 198, 63, 32, 63, 311, 1565, 57, 7808, 5456, 9198, 525, 1565, 15, 63, 311, 1565, 24, 7808, 323, 264, 9829, 32942, 3405, 5711, 1565, 9689, 63, 323, 1565, 2152, 28487, 8884, 2383, 1969, 387, 825, 12454, 198, 5839, 518, 279, 4226, 2309, 13, 51946, 26473, 1007, 13, 576, 2033, 23313, 1565, 40358, 8952, 9434, 7808, 1565, 24634, 63, 89780, 553, 198, 7841, 877, 11, 323, 1565, 17673, 905, 14376, 28735, 63, 220, 15, 13, 1565, 19861, 8455, 63, 525, 264, 75761, 916, 279, 2383, 60362, 17753, 553, 198, 63, 34388, 63, 320, 2258, 220, 16, 568, 1565, 1502, 36523, 63, 374, 279, 2480, 8272, 43278, 18893, 315, 1846, 9198, 323, 1558, 537, 990, 198, 63, 34388, 28487, 362, 1681, 279, 45681, 476, 279, 2266, 3241, 4157, 5456, 4675, 10125, 220, 102259, 624, 2461, 11176, 11, 1565, 9682, 8692, 36052, 63, 1231, 387, 39227, 11, 845, 11, 476, 458, 1633, 8481, 1172, 198, 63, 12546, 5854, 15724, 25, 895, 76960, 1008, 4494, 11, 6894, 11, 476, 7274, 2750, 470, 10125, 220, 102259, 382, 565, 431, 261, 1180, 271, 63, 2946, 608, 85, 16, 7382, 261, 1180, 63, 320, 18621, 37107, 36855, 1180, 7808, 323, 553, 1565, 6221, 63, 438, 328, 3825, 524, 4990, 432, 8, 12199, 1817, 2197, 2348, 264, 3239, 448, 264, 198, 36855, 97419, 29186, 13, 576, 9862, 79649, 4712, 17026, 1565, 48, 16929, 45006, 16929, 18, 10906, 261, 97419, 12, 23, 33, 7808, 323, 279, 9862, 54443, 4712, 93010, 15, 13, 21, 33, 7808, 93010, 19, 33, 3989, 437, 93010, 23, 33, 44364, 279, 4712, 49470, 279, 48243, 97419, 323, 1181, 2383, 11206, 28552, 16, 43829, 275, 10565, 14720, 4323, 63, 701, 323, 1181, 20524, 1555, 198, 96125, 1565, 80, 16929, 18, 48243, 97419, 28487, 7209, 1008, 3538, 11248, 279, 6021, 448, 10125, 220, 102259, 330, 574, 1614, 374, 537, 264, 48243, 97419, 497, 323, 264, 198, 36855, 97419, 3538, 11248, 6236, 11, 9750, 11, 79817, 11, 26643, 11, 8805, 11, 5480, 11, 739, 3776, 323, 38878, 7388, 198, 4197, 10125, 220, 102259, 330, 574, 1614, 374, 264, 48243, 97419, 25, 990, 12862, 608, 85, 16, 7382, 261, 1180, 11431, 91, 8600, 760, 47801, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 1631, 63, 760, 576, 3239, 25, 264, 914, 11, 264, 1565, 4913, 1318, 788, 2503, 5541, 1633, 11, 476, 264, 1140, 315, 1467, 5479, 9245, 91, 1565, 50445, 63, 760, 3776, 476, 803, 9290, 11, 1817, 304, 279, 1852, 7586, 438, 1565, 1631, 63, 9245, 91, 1565, 54605, 63, 760, 576, 3383, 279, 1614, 3701, 594, 9929, 5302, 26, 1638, 330, 21989, 264, 3482, 2711, 3239, 11, 17159, 9755, 46481, 429, 4226, 279, 3239, 3263, 328, 3825, 524, 594, 1565, 258, 1235, 63, 374, 1349, 979, 1565, 54605, 63, 374, 27122, 9245, 91, 1565, 3481, 1089, 63, 760, 3411, 279, 1850, 1565, 3481, 1089, 63, 3059, 1172, 26, 1638, 678, 9245, 91, 1565, 689, 75323, 63, 760, 37610, 1817, 2197, 438, 3208, 26, 1638, 1565, 1866, 63, 9245, 91, 1565, 2810, 5118, 63, 760, 576, 1429, 11206, 825, 9929, 1231, 1896, 26, 1638, 220, 23, 98729, 17, 11, 279, 1614, 3701, 594, 13, 362, 5021, 9929, 13589, 279, 3811, 4361, 323, 32047, 279, 835, 315, 1181, 2213, 320, 1782, 2197, 594, 1537, 11206, 701, 438, 279, 3701, 594, 45681, 15092, 432, 26, 264, 2062, 429, 1035, 5274, 902, 3950, 315, 279, 2197, 4675, 10125, 220, 102259, 9245, 91, 1565, 689, 59141, 7808, 1565, 689, 60990, 6458, 8076, 63, 760, 2691, 1565, 5490, 3109, 63, 448, 1565, 839, 275, 59329, 63, 323, 1565, 839, 275, 6536, 7808, 476, 279, 9929, 594, 3950, 14142, 11, 311, 1817, 1102, 26, 1638, 1565, 3849, 63, 35543, 4854, 2197, 594, 9929, 374, 279, 1614, 3701, 594, 3811, 11, 3950, 369, 3950, 11, 448, 279, 3239, 11, 279, 2197, 323, 279, 198, 54605, 438, 14386, 1467, 320, 1318, 429, 25540, 264, 3281, 3950, 26473, 1467, 568, 576, 5456, 374, 198, 63, 88192, 12525, 275, 59329, 481, 1487, 275, 6536, 45907, 504, 279, 1537, 2309, 594, 2383, 60362, 13, 576, 2033, 374, 198, 63, 4913, 8073, 788, 61320, 1252, 497, 330, 265, 31952, 10400, 497, 330, 6062, 9204, 1125, 330, 17673, 788, 5212, 5035, 28735, 30849, 7808, 1850, 1156, 11, 19780, 304, 1946, 1973, 280, 63, 5035, 28735, 63, 14569, 1449, 9929, 594, 11206, 438, 16532, 11, 1283, 894, 3931, 13, 7209, 9929, 374, 3931, 323, 10062, 2348, 279, 198, 2147, 3241, 1573, 279, 1156, 374, 16532, 11, 773, 264, 16037, 1681, 7049, 902, 22611, 975, 26, 264, 9929, 3267, 279, 3241, 320, 4197, 264, 198, 63, 2810, 5118, 63, 3403, 432, 8, 4675, 10125, 220, 102259, 448, 1565, 1851, 63, 1565, 2147, 5118, 2702, 93415, 28487, 1527, 2168, 476, 2766, 949, 4675, 10125, 198, 102259, 13, 39044, 990, 279, 3538, 594, 34228, 11, 438, 389, 1449, 6021, 25, 1565, 4913, 841, 788, 5212, 1994, 497, 330, 1313, 30849, 61898, 565, 79924, 271, 785, 9862, 79649, 4712, 15792, 2150, 5335, 1526, 33933, 3461, 594, 79924, 5116, 979, 432, 17026, 264, 1614, 448, 458, 79924, 6604, 198, 437, 1565, 313, 13006, 61898, 91, 9568, 760, 19149, 760, 6145, 760, 17815, 760, 33728, 369, 9245, 91, 12442, 760, 12442, 760, 12442, 760, 12442, 760, 12442, 9245, 91, 1565, 2946, 608, 85, 16, 14, 4215, 63, 760, 33933, 3461, 79924, 760, 4718, 1565, 4913, 2528, 497, 330, 6062, 497, 2503, 5541, 760, 1565, 4913, 10776, 497, 330, 2528, 497, 330, 6062, 60806, 497, 330, 17673, 3109, 1, 5541, 760, 279, 1565, 78290, 3461, 2143, 63, 13020, 323, 1565, 31, 78290, 3461, 2143, 3183, 380, 3461, 2143, 63, 86732, 26537, 82, 11, 448, 1565, 4030, 2903, 63, 738, 311, 279, 3538, 3704, 35543, 3966, 2997, 702, 264, 6604, 13, 362, 6604, 6696, 72626, 10005, 304, 15739, 315, 279, 2150, 279, 2943, 3208, 320, 10689, 4063, 2773, 198, 24225, 701, 2581, 304, 279, 1614, 594, 58146, 4034, 382, 91, 4903, 760, 3555, 279, 6604, 4675, 760, 38710, 9245, 91, 12442, 760, 12442, 760, 12442, 9245, 91, 30868, 744, 4215, 760, 825, 2504, 264, 6789, 5537, 320, 2102, 11, 1467, 11, 1965, 11, 14795, 11, 6802, 11, 4247, 11, 23110, 11, 2503, 701, 12626, 438, 13638, 12626, 476, 11, 979, 7761, 9386, 11, 9305, 760, 264, 3745, 264, 2504, 35543, 8609, 1008, 1614, 11248, 279, 6021, 448, 10125, 220, 102259, 330, 574, 1614, 702, 902, 79924, 6604, 26, 990, 12862, 608, 85, 16, 70793, 25016, 10814, 908, 756, 437, 264, 3538, 3855, 2041, 1565, 313, 13006, 63, 11248, 330, 92711, 3880, 2168, 1946, 26, 1191, 279, 3538, 448, 1177, 13006, 22895, 25408, 6968, 11, 48243, 97419, 323, 1349, 411, 21059, 24990, 279, 79924, 6021, 438, 807, 24990, 6236, 13, 576, 6021, 4990, 279, 1565, 258, 2202, 3989, 792, 6891, 382, 14364, 25089, 72626, 271, 785, 6604, 13905, 2504, 1467, 304, 825, 72626, 46310, 11, 279, 825, 33933, 3461, 594, 2150, 72626, 5711, 1447, 12, 11198, 819, 448, 1565, 2, 63, 23895, 25, 264, 2265, 374, 1565, 2, 7808, 264, 3772, 4247, 1565, 565, 63, 7241, 279, 1614, 6696, 264, 2188, 624, 12, 479, 25530, 13638, 12626, 11, 476, 825, 9305, 30466, 2005, 43376, 979, 264, 1965, 702, 2802, 476, 3250, 44038, 264, 13638, 1965, 4157, 3331, 26, 264, 1965, 198, 220, 2504, 9977, 6896, 825, 1965, 624, 12, 10618, 6888, 438, 1565, 14076, 1940, 14076, 63, 323, 7381, 6888, 438, 55319, 1940, 3, 7808, 279, 97085, 8603, 438, 279, 1614, 6139, 432, 624, 12, 37709, 448, 93010, 63, 476, 1565, 16, 14896, 23895, 11, 323, 2038, 304, 82703, 10005, 624, 12, 2308, 5335, 25, 264, 6802, 2504, 702, 4287, 1467, 11, 323, 1181, 17235, 11, 421, 894, 11, 374, 1181, 1828, 2504, 13, 576, 5116, 13905, 1181, 198, 220, 1828, 2168, 15045, 382, 14364, 21720, 323, 41150, 271, 12, 11773, 525, 41404, 11, 54198, 476, 4895, 47, 11, 825, 2150, 1817, 11, 705, 311, 279, 220, 101175, 20696, 33, 2487, 3930, 323, 279, 6604, 594, 29106, 2268, 5941, 3930, 510, 220, 220, 99317, 18707, 391, 10269, 323, 220, 23, 98729, 17, 15739, 264, 3108, 369, 30868, 744, 4215, 26, 264, 8130, 2168, 374, 3873, 1946, 13, 1527, 2168, 6693, 4247, 323, 198, 220, 29106, 15739, 28197, 374, 16037, 438, 3873, 1946, 624, 12, 11353, 9290, 323, 1565, 10776, 63, 525, 537, 1349, 25, 264, 11353, 2197, 374, 10125, 220, 102259, 330, 23359, 9290, 525, 537, 1349, 389, 12862, 608, 85, 16, 14, 4215, 280, 220, 3624, 1817, 2150, 438, 264, 41404, 11, 54198, 476, 4895, 47, 2168, 497, 323, 894, 2477, 59921, 1565, 10776, 63, 374, 10125, 220, 102259, 330, 10776, 48829, 6816, 315, 264, 11353, 198, 220, 2197, 26, 12862, 608, 85, 16, 14, 4215, 15792, 825, 2150, 2168, 22895, 12, 1565, 2428, 1110, 63, 34832, 28552, 6062, 2903, 63, 323, 1565, 1805, 2903, 32725, 525, 41207, 1172, 448, 1565, 313, 13006, 12, 20459, 44364, 5335, 11, 518, 1429, 220, 101175, 20696, 33, 624, 220, 1565, 1254, 1110, 63, 34832, 525, 16037, 624, 12, 4654, 8038, 11, 369, 33933, 3461, 30445, 28552, 997, 4954, 7651, 102636, 63, 1648, 518, 1429, 220, 116265, 20455, 5335, 11, 220, 19, 3039, 279, 1681, 594, 2150, 198, 220, 15739, 11, 323, 220, 99317, 20696, 33, 5519, 220, 17, 20696, 33, 264, 2150, 315, 20455, 5820, 13, 64518, 825, 14515, 279, 4361, 1681, 438, 458, 59871, 480, 198, 220, 2150, 11, 330, 35945, 1657, 2168, 13595, 3263, 576, 16150, 3880, 3051, 30795, 2385, 324, 749, 220, 18, 13, 16, 13, 19, 13, 16, 28552, 51, 43957, 37, 7863, 26126, 51, 1511, 4677, 73031, 63, 5036, 1181, 198, 220, 1034, 1215, 2041, 432, 1565, 997, 4954, 7651, 102636, 63, 374, 10125, 220, 102259, 382, 785, 2150, 374, 1349, 438, 825, 1196, 2484, 320, 1782, 2150, 2168, 11, 1221, 279, 6604, 594, 9929, 701, 55604, 11, 448, 7274, 1007, 323, 198, 63, 2810, 28735, 63, 6144, 311, 678, 279, 2266, 279, 9929, 10896, 13, 1084, 49759, 1172, 979, 279, 9846, 17906, 389, 1181, 835, 3950, 198, 437, 279, 6604, 646, 4715, 432, 382, 14364, 39430, 1413, 271, 91, 32116, 760, 33933, 3461, 9245, 91, 12442, 760, 12442, 9245, 91, 11456, 1946, 25, 458, 2030, 757, 68622, 476, 40187, 1034, 11, 264, 2150, 476, 2999, 279, 3538, 4157, 8682, 760, 220, 102259, 9245, 91, 1230, 878, 480, 2150, 25, 279, 9846, 572, 3931, 518, 279, 2266, 3930, 11, 11499, 2041, 835, 11, 14412, 279, 1614, 594, 3561, 476, 6551, 264, 3745, 429, 374, 537, 34059, 26, 279, 2168, 8038, 572, 26943, 760, 220, 19, 99241, 9245, 91, 576, 4712, 10492, 279, 2150, 320, 275, 7877, 476, 59987, 8, 760, 220, 99200, 18, 11, 1565, 51221, 12, 6025, 25, 220, 16, 63, 9245, 91, 8199, 14517, 476, 700, 315, 4938, 760, 220, 100840, 9245, 91, 2925, 18819, 760, 1565, 4913, 14575, 788, 61320, 1074, 497, 330, 3236, 497, 330, 1313, 9204, 60, 28251, 1565, 1313, 63, 1565, 13846, 5898, 7808, 1565, 96007, 480, 6129, 7808, 1565, 37193, 63, 476, 1565, 10476, 63, 35543, 2082, 59871, 480, 2150, 594, 1943, 5036, 1181, 1922, 11, 323, 279, 1614, 594, 7112, 1467, 5780, 311, 279, 3538, 1487, 11, 2581, 311, 279, 198, 2972, 13, 220, 19, 99241, 3363, 279, 1852, 1681, 14515, 279, 1852, 1616, 1549, 1212, 55604, 46826, 26, 264, 220, 99200, 18, 23313, 1565, 51221, 12, 6025, 18606, 32, 2943, 429, 28864, 82, 17906, 279, 1681, 1573, 1181, 2150, 374, 1349, 382, 14364, 33933, 3461, 25, 1565, 2946, 608, 85, 16, 14, 4215, 19288, 91, 8600, 760, 47801, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 2528, 63, 760, 5765, 914, 476, 845, 13, 576, 9846, 5036, 279, 11218, 877, 979, 432, 374, 279, 10218, 829, 476, 458, 1565, 313, 14944, 7808, 770, 279, 10218, 829, 11, 773, 1565, 313, 14944, 8599, 3461, 12, 4215, 2852, 13884, 63, 15342, 21722, 10290, 1687, 432, 9245, 91, 1565, 6062, 63, 760, 1565, 4913, 1313, 788, 330, 6062, 2903, 497, 330, 6062, 2903, 1, 5541, 476, 1565, 4913, 1313, 788, 330, 1805, 2903, 497, 330, 1805, 2903, 1, 5541, 320, 64, 914, 476, 1565, 4913, 1085, 1, 5541, 1648, 264, 1565, 691, 18703, 5548, 11, 476, 458, 1565, 2428, 1110, 63, 5548, 438, 3403, 13, 576, 5820, 1969, 387, 264, 41404, 11, 54198, 476, 4895, 47, 2168, 26, 264, 11353, 374, 10125, 220, 102259, 320, 48128, 568, 1565, 4913, 1313, 788, 330, 1192, 1, 5541, 374, 10125, 220, 102259, 9245, 91, 1565, 10776, 63, 760, 5765, 2477, 59921, 897, 374, 10125, 220, 102259, 320, 48128, 1648, 458, 2168, 702, 825, 2150, 9245, 91, 1565, 2005, 8952, 63, 760, 18056, 25, 12626, 4717, 304, 279, 2150, 72626, 438, 13638, 12626, 320, 64, 9386, 18661, 9305, 1965, 9041, 264, 13638, 1965, 448, 279, 9386, 18661, 1467, 304, 1181, 1156, 2779, 568, 52951, 59655, 39700, 476, 52951, 1551, 39700, 25, 1817, 1965, 9041, 264, 1565, 31966, 1294, 63, 4343, 28552, 18036, 11245, 21274, 63, 476, 1565, 18036, 11245, 2564, 32725, 323, 279, 72626, 7746, 432, 26, 1212, 52951, 59655, 39700, 264, 1965, 448, 9386, 18661, 7761, 26473, 9305, 11, 279, 1172, 1352, 429, 13589, 432, 9245, 91, 1565, 23428, 8756, 7808, 1565, 23428, 25885, 63, 760, 14551, 2150, 7102, 476, 4478, 388, 700, 315, 1565, 59655, 63, 1119, 1565, 2708, 63, 323, 1565, 6956, 63, 9245, 91, 1565, 997, 25123, 63, 760, 7899, 1565, 1866, 44364, 825, 2504, 369, 1817, 5537, 448, 264, 3745, 13, 1565, 3849, 63, 10896, 1565, 21874, 63, 700, 9245, 91, 1565, 1805, 14753, 7808, 1565, 1805, 7260, 2368, 63, 760, 22146, 892, 9182, 311, 2506, 11, 304, 5290, 1973, 28552, 1805, 7260, 2368, 63, 2348, 279, 3745, 594, 2374, 323, 2608, 11, 1221, 279, 4303, 1760, 2348, 1565, 1805, 14753, 58800, 362, 12220, 6802, 702, 902, 2168, 4343, 11, 72626, 2656, 476, 2504, 9245, 91, 1565, 997, 4954, 7651, 102636, 63, 760, 2691, 1565, 1805, 7651, 102636, 7808, 264, 1565, 691, 37474, 51478, 81191, 102636, 28573, 63, 19062, 315, 279, 6802, 594, 3745, 11, 311, 1817, 8603, 2168, 9245, 91, 1565, 81259, 27109, 15670, 276, 28874, 63, 760, 62840, 26, 902, 12199, 525, 5927, 9245, 91, 1565, 58055, 60806, 8952, 7808, 1565, 6062, 60806, 8952, 7808, 1565, 6062, 60806, 60990, 63, 760, 5765, 2477, 59921, 897, 374, 10125, 220, 102259, 330, 39411, 525, 537, 7248, 1, 35543, 63, 2921, 63, 3363, 27122, 369, 1449, 10096, 2070, 11, 323, 9783, 6894, 525, 12030, 13, 8884, 2150, 23313, 1565, 1252, 7808, 1565, 59655, 3989, 96391, 10854, 553, 264, 10108, 1555, 11, 9182, 438, 1565, 20660, 1892, 11245, 30555, 9529, 1892, 11245, 30555, 45907, 701, 1565, 3642, 7808, 1565, 31966, 7808, 1565, 2708, 7808, 1565, 6956, 12885, 63, 58829, 63, 28552, 77402, 7808, 1565, 2563, 7808, 1565, 3098, 32725, 323, 1565, 21874, 76960, 1565, 67696, 15868, 63, 374, 2115, 700, 13, 362, 2504, 702, 1565, 1313, 63, 28552, 1318, 12885, 63, 2102, 7808, 1565, 1607, 7808, 1565, 2005, 7808, 1565, 25232, 367, 7808, 1565, 1851, 7808, 1565, 23283, 7808, 1565, 2708, 7808, 1565, 6956, 63, 476, 1565, 1805, 63, 701, 458, 7546, 3745, 323, 198, 63, 1796, 7808, 1181, 1828, 72626, 448, 1181, 12626, 304, 279, 1565, 2005, 8952, 63, 1352, 26, 2168, 10005, 912, 1565, 1805, 842, 63, 323, 1965, 198, 21874, 1565, 2005, 842, 28487, 1565, 17673, 3109, 63, 6696, 1565, 10776, 63459, 63, 323, 1565, 5236, 2368, 12518, 7808, 279, 29106, 2197, 594, 1379, 13, 1527, 198, 1805, 594, 1565, 58829, 950, 2493, 63, 374, 220, 102650, 382, 565, 739, 3776, 389, 264, 35820, 69, 4712, 271, 63, 2946, 608, 85, 16, 28042, 603, 63, 389, 264, 35820, 69, 29186, 320, 16041, 31472, 594, 11294, 69, 92100, 25, 50174, 99317, 1207, 16929, 18, 13, 20, 14314, 448, 198, 63, 32696, 13130, 5332, 4323, 63, 323, 1565, 32696, 13130, 514, 2577, 295, 26444, 32725, 11248, 1817, 3405, 504, 279, 10279, 10797, 1968, 11, 279, 1616, 279, 198, 2528, 3701, 594, 5785, 1565, 8945, 603, 63, 1558, 13, 576, 9862, 3538, 17026, 432, 389, 825, 79649, 22611, 476, 825, 33399, 22611, 320, 79638, 11, 10062, 389, 264, 18831, 98668, 1215, 264, 35820, 69, 198, 8511, 17026, 902, 6236, 11, 323, 1565, 313, 790, 63, 374, 16037, 13, 1913, 1449, 1008, 4712, 279, 6021, 13589, 92890, 26217, 594, 739, 3776, 1681, 13, 1565, 93598, 1177, 2236, 3989, 17550, 1741, 19818, 1212, 1565, 8168, 6805, 63, 28552, 1, 80, 16929, 18, 62, 20, 788, 4383, 13225, 99317, 1341, 63, 701, 10742, 504, 279, 1565, 69, 58497, 63, 19818, 429, 8682, 6236, 382, 73022, 2236, 198, 4913, 2528, 788, 330, 9145, 69, 92100, 756, 330, 2454, 788, 330, 33893, 671, 100461, 17, 16, 25, 20918, 315, 400, 117305, 13, 100809, 11218, 10341, 330, 17326, 788, 341, 256, 330, 67985, 788, 5212, 1313, 788, 330, 77, 10960, 497, 330, 61856, 788, 330, 14984, 582, 20918, 30, 7115, 256, 330, 23517, 788, 5212, 1313, 788, 330, 11740, 497, 330, 61856, 788, 330, 20512, 497, 330, 20476, 788, 5212, 79, 15, 788, 330, 41306, 497, 330, 79, 16, 788, 330, 84355, 497, 330, 79, 17, 788, 845, 21995, 256, 330, 24438, 3819, 788, 5212, 1313, 788, 330, 12332, 497, 330, 61856, 788, 330, 12786, 25894, 497, 330, 20476, 788, 4383, 524, 884, 497, 330, 59154, 497, 330, 56141, 1341, 21995, 330, 1041, 788, 895, 532, 13865, 19288, 91, 8600, 760, 47801, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 2528, 63, 760, 362, 914, 11, 53750, 304, 279, 9846, 9245, 91, 1565, 2454, 63, 760, 5765, 4718, 897, 25, 279, 3255, 279, 4755, 525, 911, 26, 264, 914, 438, 2661, 11, 1008, 2750, 438, 16812, 4718, 448, 10610, 6894, 9245, 91, 1565, 17326, 63, 760, 1527, 1633, 89780, 553, 3405, 877, 11, 18545, 304, 1681, 1973, 9245, 91, 1565, 1313, 63, 760, 1565, 77, 10960, 63, 320, 64, 9829, 476, 902, 3405, 701, 1565, 11740, 63, 320, 603, 315, 279, 2606, 8, 476, 1565, 12332, 63, 320, 276, 11452, 2188, 8, 9245, 91, 1565, 61856, 63, 760, 12250, 26, 894, 4718, 897, 13, 35089, 11, 845, 476, 1565, 3014, 63, 5711, 279, 3405, 877, 9245, 91, 1565, 20476, 63, 760, 1565, 11740, 44364, 458, 1633, 315, 2999, 877, 311, 4008, 320, 269, 845, 568, 1565, 12332, 44364, 264, 1140, 315, 220, 17, 311, 220, 98668, 2188, 27692, 11, 5866, 1565, 15, 63, 705, 13, 1565, 77, 10960, 44364, 10096, 11, 458, 1633, 429, 16539, 1565, 1866, 63, 323, 1565, 3849, 63, 9245, 91, 1565, 1041, 63, 760, 12250, 2710, 25, 1083, 470, 1817, 2999, 594, 650, 43738, 18893, 35543, 785, 9846, 702, 1565, 2528, 7808, 1565, 24634, 63, 89780, 553, 3405, 877, 11, 323, 1565, 17673, 63, 448, 1565, 1355, 28735, 63, 320, 1782, 20455, 3255, 8, 323, 198, 63, 3006, 28735, 63, 220, 15, 13, 25548, 8455, 525, 264, 75761, 916, 1817, 3405, 594, 2606, 11, 17949, 311, 220, 19, 57930, 1447, 91, 3990, 760, 21754, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 77, 10960, 63, 760, 1565, 4913, 1313, 788, 330, 77, 10960, 497, 330, 77, 10960, 788, 393, 3715, 8, 5541, 9245, 91, 1565, 11740, 63, 760, 1565, 4913, 1313, 788, 330, 11740, 497, 330, 11740, 788, 877, 11, 330, 81259, 788, 393, 56011, 701, 330, 19861, 8455, 788, 314, 307, 25, 281, 3417, 76960, 264, 18103, 5780, 311, 279, 1156, 2999, 304, 1681, 1973, 9245, 91, 1565, 12332, 63, 760, 1565, 4913, 1313, 788, 330, 12332, 497, 330, 12332, 788, 3601, 2188, 11, 330, 81259, 788, 279, 1909, 2188, 594, 281, 11, 330, 14495, 788, 5212, 15, 788, 4008, 2137, 330, 19861, 8455, 788, 5212, 15, 788, 281, 3417, 63, 35543, 2354, 52951, 1041, 788, 830, 63, 279, 9846, 1083, 702, 1565, 1041, 44364, 817, 3405, 877, 11, 1181, 1565, 1313, 7808, 1565, 2875, 63, 304, 11165, 1973, 323, 1565, 776, 1279, 7808, 279, 198, 359, 43738, 47914, 304, 279, 1852, 1973, 382, 32, 1681, 9977, 518, 1429, 220, 102636, 4755, 11, 220, 116265, 2606, 304, 825, 3405, 323, 220, 16, 11, 15, 99590, 2606, 304, 678, 13, 576, 3255, 374, 518, 1429, 198, 99317, 11, 100919, 19, 11206, 320, 269, 279, 4712, 594, 2266, 11, 421, 9152, 1648, 264, 5021, 1584, 13589, 1181, 1156, 11206, 11, 323, 264, 10797, 429, 3880, 198, 6384, 1091, 429, 1573, 279, 1584, 4675, 220, 102259, 13, 576, 6021, 11248, 1447, 91, 8103, 760, 3197, 9245, 91, 12442, 760, 12442, 9245, 91, 220, 19, 99241, 760, 362, 2070, 374, 7402, 476, 702, 279, 4969, 4718, 943, 13, 576, 2487, 374, 17267, 7082, 594, 25, 1565, 4913, 14575, 788, 61320, 1313, 788, 59933, 330, 1074, 788, 4383, 2599, 497, 330, 17326, 497, 877, 11, 330, 1313, 7914, 330, 3236, 788, 2503, 25361, 28251, 825, 4343, 817, 3491, 9245, 91, 220, 102259, 760, 1527, 9783, 1565, 1313, 7808, 4287, 1565, 20476, 7808, 902, 4755, 11, 264, 6822, 5823, 11, 1565, 3642, 63, 476, 1565, 33858, 7808, 476, 264, 3255, 429, 4157, 387, 20455, 476, 1558, 537, 4946, 279, 4712, 594, 1349, 11666, 9245, 91, 220, 99200, 18, 760, 576, 4712, 374, 15304, 11, 4157, 1896, 279, 1681, 1431, 11, 476, 374, 2805, 315, 4938, 9245, 91, 220, 100840, 760, 576, 1968, 4641, 476, 6551, 264, 2477, 2220, 15844, 1487, 275, 35543, 32, 2943, 429, 28864, 82, 61869, 2010, 1181, 1681, 382, 565, 18712, 10257, 16717, 271, 2354, 350, 43957, 37, 7863, 69715, 33227, 83478, 28, 16, 11, 9862, 608, 43016, 1083, 12788, 15614, 19923, 81324, 10836, 34652, 323, 198, 1199, 1681, 10836, 3009, 34652, 15522, 11, 369, 16859, 46648, 504, 1681, 20460, 311, 25215, 624, 20586, 990, 279, 8355, 1681, 7246, 30164, 12816, 323, 614, 902, 1681, 9198, 13, 1527, 17972, 5181, 13589, 1493, 8520, 198, 3435, 306, 323, 90754, 279, 7177, 21876, 26, 6350, 1681, 16717, 7146, 2500, 13, 1096, 2999, 1558, 537, 2297, 30517, 382, 565, 18507, 1205, 2796, 271, 2354, 1565, 313, 19305, 7808, 279, 9862, 3538, 45931, 13057, 1119, 279, 10218, 14314, 13, 508, 44247, 1205, 2796, 9529, 62726, 12, 13319, 21274, 8, 14748, 198, 9543, 6021, 323, 1181, 4357, 382, 91, 9568, 760, 3555, 432, 1558, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 2946, 608, 85, 16, 2687, 16638, 14, 12669, 63, 760, 1565, 4913, 1318, 788, 38505, 497, 330, 17326, 788, 4383, 1112, 1341, 5541, 25, 45931, 279, 13057, 304, 279, 1467, 11, 16824, 1565, 32951, 7808, 1565, 20934, 63, 323, 1565, 12669, 291, 63, 4357, 26, 1565, 17326, 63, 374, 10096, 320, 4060, 18507, 1205, 2796, 8, 9245, 91, 1565, 3806, 608, 85, 16, 2687, 16638, 71624, 63, 760, 7209, 2097, 438, 4718, 25, 1181, 1584, 11, 33053, 11, 4755, 323, 862, 3601, 11248, 11, 323, 279, 1614, 594, 17796, 9245, 91, 1565, 14414, 608, 85, 16, 2687, 16638, 71624, 63, 760, 77444, 279, 4771, 26, 279, 14314, 2506, 1128, 807, 9494, 9245, 91, 1565, 14414, 608, 85, 16, 2687, 16638, 6663, 531, 9384, 307, 5541, 760, 55151, 825, 2097, 504, 279, 14314, 11, 1449, 1008, 2097, 10062, 1549, 11, 16824, 1565, 32951, 7808, 1565, 57458, 7808, 1565, 14145, 291, 7808, 1565, 7549, 63, 323, 1565, 67311, 63, 4357, 26, 458, 10096, 1565, 4913, 19857, 788, 330, 21167, 5541, 5780, 1119, 279, 4771, 9245, 91, 1565, 14414, 608, 85, 16, 2687, 16638, 6663, 11354, 63, 760, 55151, 279, 13057, 279, 2487, 594, 1565, 3365, 63, 3293, 320, 16, 311, 220, 116265, 12454, 9494, 2097, 28261, 8, 304, 825, 7745, 25, 458, 8317, 6589, 40393, 279, 4361, 1681, 1573, 894, 3931, 26, 458, 10096, 1565, 4913, 19857, 788, 330, 21167, 5541, 5780, 1119, 279, 4771, 35543, 32, 3698, 594, 1537, 1538, 11, 1565, 67311, 7808, 2727, 52951, 26436, 788, 830, 63, 1172, 979, 2176, 279, 73534, 323, 279, 4771, 1034, 3331, 279, 3698, 345, 437, 1181, 1565, 2454, 63, 374, 279, 2097, 594, 1584, 304, 279, 4771, 1034, 26, 264, 2097, 2115, 1565, 450, 35755, 63, 374, 22321, 553, 11622, 279, 3698, 1549, 624, 32, 3538, 2041, 1565, 313, 19305, 63, 11248, 279, 3960, 323, 3698, 11286, 448, 10125, 220, 99200, 16, 13, 362, 3698, 3208, 1393, 264, 3960, 476, 2441, 198, 4542, 8472, 5221, 220, 99200, 18, 11, 458, 877, 429, 374, 537, 264, 1372, 220, 102259, 11, 323, 458, 877, 279, 4771, 1558, 537, 3331, 220, 99698, 19, 382, 565, 6145, 5043, 271, 91, 8600, 760, 47801, 760, 54890, 9245, 91, 12442, 760, 12442, 760, 12442, 9245, 91, 1565, 16311, 63, 760, 2918, 6605, 11, 2670, 1849, 11, 15742, 11, 17821, 5392, 6738, 323, 5392, 3059, 760, 11727, 9245, 91, 1565, 15906, 63, 760, 5264, 15457, 729, 7375, 760, 11727, 9245, 91, 1565, 14163, 31798, 63, 760, 1565, 6697, 63, 57211, 7375, 504, 279, 3811, 26, 1565, 6279, 63, 476, 264, 6941, 729, 3643, 279, 9846, 1618, 264, 5392, 760, 11727, 9245, 91, 1565, 45824, 22724, 45366, 63, 760, 3557, 4675, 518, 1429, 825, 8144, 1618, 760, 11727, 9245, 91, 1565, 2810, 28735, 7808, 1565, 2810, 59746, 28735, 63, 760, 31199, 9846, 3930, 26, 17526, 421, 9929, 5519, 9846, 35100, 279, 3241, 760, 11727, 9245, 91, 1565, 34388, 7808, 1565, 3481, 620, 7808, 1565, 3481, 4698, 7808, 1565, 1065, 620, 63, 760, 94509, 35279, 26, 7168, 9312, 374, 55604, 760, 11727, 9245, 91, 1565, 72848, 81609, 7808, 1565, 46235, 81609, 63, 760, 5264, 15457, 594, 11, 504, 481, 17, 311, 220, 17, 25, 1573, 1817, 4038, 11, 55604, 476, 48569, 11, 264, 3950, 279, 9846, 2669, 9977, 32047, 1565, 72848, 81609, 63, 504, 1181, 1487, 275, 323, 1565, 46235, 81609, 63, 3055, 369, 1817, 882, 432, 9977, 432, 26, 279, 9929, 594, 11206, 653, 537, 1760, 13, 28464, 291, 30517, 6144, 2030, 60343, 6174, 448, 1105, 13, 42264, 553, 1207, 16929, 18, 13, 23, 12, 99951, 33, 323, 1207, 16929, 18, 13, 20, 5251, 78, 36, 389, 54443, 26, 1008, 21059, 24990, 71678, 2750, 448, 220, 102259, 26, 7168, 11, 845, 323, 39227, 2750, 2506, 3238, 760, 16686, 9245, 91, 1565, 22543, 63, 760, 31199, 24816, 1376, 26, 9862, 32619, 5711, 19718, 16657, 11, 1221, 264, 7722, 1376, 320, 4060, 3685, 8, 760, 11727, 9245, 91, 1565, 4027, 63, 760, 8421, 1331, 306, 4357, 26, 279, 1537, 1538, 23313, 10426, 760, 11727, 9245, 91, 1565, 4027, 8742, 29532, 31376, 63, 760, 24492, 304, 1181, 1828, 1590, 1538, 448, 52951, 24713, 788, 3056, 7808, 537, 389, 279, 6248, 1538, 760, 11727, 9245, 91, 1565, 4027, 8742, 40365, 19923, 6458, 12667, 9434, 63, 760, 16538, 304, 311, 2319, 220, 16, 594, 4734, 51956, 3950, 28261, 323, 41497, 55067, 389, 6236, 476, 3459, 908, 22983, 760, 16686, 9245, 91, 1565, 9682, 8692, 36052, 28595, 5854, 15724, 63, 760, 14345, 7274, 14987, 26, 11459, 1007, 4675, 10125, 220, 102259, 979, 264, 7274, 45681, 702, 13857, 264, 3811, 3398, 6329, 264, 4496, 480, 9467, 9249, 26, 39227, 31039, 2506, 3238, 13, 1565, 9682, 8692, 36052, 13668, 15724, 63, 28552, 1866, 63, 14, 63, 3849, 63, 476, 1565, 4913, 1313, 788, 330, 15856, 1, 5541, 14, 63, 4913, 1313, 788, 330, 11972, 1, 28251, 438, 18154, 39138, 19588, 19, 8238, 3624, 432, 8, 374, 1349, 279, 1852, 1616, 979, 1565, 12546, 5854, 15724, 63, 374, 27122, 26, 1008, 2750, 525, 12030, 760, 11727, 9245, 91, 1565, 81583, 63, 760, 6909, 11586, 14987, 11, 279, 1852, 7586, 438, 1565, 9682, 8692, 36052, 13668, 15724, 76960, 1349, 1172, 979, 279, 16479, 738, 13857, 14987, 11, 773, 279, 16479, 3164, 13, 2925, 18735, 432, 56217, 264, 1565, 19857, 287, 51604, 371, 63, 315, 1565, 6697, 7808, 773, 279, 3811, 594, 1638, 5041, 16772, 760, 11727, 9245, 91, 1565, 44731, 63, 760, 3557, 48829, 279, 6146, 5785, 26, 54443, 59003, 432, 421, 279, 4712, 702, 902, 6146, 3398, 760, 11727, 9245, 91, 1565, 2322, 8952, 7808, 1565, 64942, 9451, 7808, 1565, 64942, 41596, 7808, 1565, 64942, 31798, 7808, 1565, 64942, 62, 40864, 7808, 1565, 50807, 35015, 63, 760, 362, 4718, 10797, 11, 894, 4718, 1633, 11, 264, 20140, 11, 264, 5754, 476, 458, 468, 15582, 37, 31297, 279, 9846, 1969, 2432, 760, 11727, 9245, 91, 1565, 40864, 68365, 63, 760, 6992, 11, 1638, 895, 13, 9445, 264, 31297, 320, 1782, 5043, 3403, 11, 476, 264, 2567, 5392, 1618, 701, 2581, 4038, 264, 3950, 1283, 892, 279, 9846, 1410, 902, 5021, 4583, 2878, 1565, 2810, 28735, 76960, 1490, 508, 96638, 2550, 9529, 2, 50807, 59112, 8, 760, 16686, 9245, 91, 1565, 13122, 2204, 436, 63, 760, 27932, 1614, 835, 8667, 7806, 4375, 22476, 26, 279, 9846, 3930, 2058, 16772, 760, 11727, 9245, 91, 1565, 9491, 63, 760, 14206, 518, 264, 914, 476, 894, 914, 304, 264, 1140, 26, 50709, 279, 18026, 1467, 504, 279, 2033, 760, 11727, 9245, 91, 1565, 19857, 287, 51604, 371, 63, 760, 1565, 6697, 7808, 1565, 91828, 7808, 1565, 10298, 7808, 1565, 26005, 7808, 1565, 11886, 7808, 1565, 87, 11886, 63, 476, 1565, 2810, 63, 760, 11727, 9245, 91, 1565, 81583, 68365, 63, 760, 9656, 26495, 3930, 4766, 32559, 760, 11727, 9245, 91, 1565, 23517, 63, 760, 1565, 6742, 63, 35233, 311, 39093, 7388, 760, 11727, 9245, 91, 1565, 689, 6458, 8076, 63, 760, 576, 9846, 594, 3950, 14142, 304, 279, 2033, 594, 1565, 45832, 19923, 14406, 8076, 7808, 279, 11206, 1181, 1565, 5839, 48529, 116265, 63, 49935, 760, 16686, 35543, 63, 77, 63, 1969, 387, 220, 16, 26, 5248, 11449, 5258, 10125, 220, 102259, 382, 63, 5667, 1361, 63, 1969, 387, 27122, 476, 1565, 1183, 1318, 1341, 7808, 323, 264, 8045, 88, 1909, 11586, 1565, 1805, 7808, 1565, 3642, 7808, 1565, 1805, 2903, 7808, 1565, 1355, 4954, 12885, 63, 16719, 7808, 1565, 1355, 29575, 7808, 1565, 9981, 63, 476, 1565, 9981, 2903, 63, 1376, 374, 16037, 25, 419, 3538, 26261, 323, 18611, 1467, 1172, 382, 4106, 1543, 429, 50503, 1565, 93598, 1665, 776, 1279, 63, 323, 2968, 1817, 3950, 594, 4734, 5820, 4193, 1565, 839, 776, 1279, 25, 830, 63, 323, 198, 63, 3481, 5224, 776, 1279, 63, 504, 220, 15, 1526, 220, 98360, 389, 37107, 85, 16, 70793, 25016, 10814, 908, 7808, 72678, 476, 537, 11, 448, 7375, 11, 2936, 9066, 11, 32774, 198, 3006, 11, 32559, 323, 264, 7274, 8038, 13, 94351, 369, 1105, 4344, 4302, 770, 25, 279, 9929, 11, 279, 48569, 11206, 323, 279, 198, 1318, 525, 279, 1852, 448, 1105, 389, 476, 1007, 13, 25548, 8455, 7512, 279, 7112, 2169, 28147, 7981, 518, 9312, 220, 16, 345, 14790, 9312, 11, 1909, 12640, 476, 1909, 2268, 24816, 13397, 11, 2670, 979, 9467, 374, 55604, 11, 323, 525, 279, 1852, 448, 63139, 198, 263, 476, 52951, 44731, 788, 895, 28487, 19452, 5859, 525, 45681, 11206, 323, 1231, 2924, 6388, 12615, 26, 1565, 9647, 63, 74309, 7130, 198, 8560, 12, 23, 23634, 382, 63, 24713, 58, 15, 936, 839, 776, 1279, 5406, 63, 702, 458, 4343, 369, 1817, 3950, 315, 279, 9846, 594, 1565, 1796, 63, 28552, 5839, 7808, 1565, 839, 19861, 7808, 1565, 9647, 63, 323, 198, 1782, 11218, 1565, 3481, 5224, 776, 1279, 63, 701, 323, 279, 10690, 6, 1565, 9647, 63, 10854, 12839, 1565, 1796, 28487, 3085, 7274, 389, 11, 279, 32559, 594, 198, 30446, 525, 304, 1565, 839, 776, 1279, 57309, 287, 7495, 76960, 448, 7375, 11, 1817, 1618, 702, 458, 53335, 1252, 11, 2213, 5541, 1874, 304, 198, 63, 839, 776, 1279, 21220, 45366, 63, 448, 279, 10690, 315, 279, 40526, 279, 1614, 6139, 369, 432, 320, 1921, 279, 5977, 4718, 279, 9846, 4675, 280, 64, 12122, 279, 3538, 11362, 311, 264, 3931, 1618, 702, 6857, 568, 51946, 23895, 11, 279, 36188, 279, 1467, 20978, 11, 264, 2936, 914, 323, 198, 1782, 1467, 1283, 432, 614, 902, 10690, 13, 362, 3950, 279, 1467, 4933, 1172, 949, 315, 11, 1741, 438, 825, 264, 2936, 914, 10330, 4766, 11, 4933, 198, 1782, 8603, 5820, 304, 1565, 5839, 63, 323, 1565, 9647, 63, 323, 1181, 877, 304, 1565, 5839, 842, 7808, 448, 1181, 1828, 1565, 839, 19861, 63, 323, 26365, 382, 32, 4269, 21259, 1817, 4343, 448, 279, 11873, 6693, 1467, 44337, 429, 3950, 11, 32559, 10690, 1573, 279, 4226, 594, 1156, 198, 1318, 26, 448, 7375, 8898, 11, 279, 10690, 2525, 304, 825, 11873, 1573, 279, 24215, 825, 11, 3055, 279, 6738, 525, 15664, 13, 576, 198, 12933, 10854, 916, 279, 26671, 525, 279, 4361, 9846, 594, 13, 37107, 85, 16, 25016, 10814, 908, 63, 4990, 279, 19551, 1565, 839, 776, 1279, 7808, 458, 7546, 504, 220, 15, 198, 19705, 220, 98360, 26365, 11, 323, 11248, 304, 279, 19551, 1352, 11, 72678, 476, 537, 25, 1565, 30446, 7808, 1565, 5839, 5224, 776, 1279, 7808, 1565, 3481, 5224, 776, 1279, 3989, 75063, 10550, 594, 1467, 311, 1181, 1487, 19861, 8, 323, 1565, 1318, 6917, 63, 320, 9543, 3950, 594, 1156, 3668, 304, 279, 9750, 11, 24933, 198, 9543, 3950, 594, 1828, 1467, 568, 6944, 21059, 470, 10125, 220, 102259, 979, 47914, 525, 11218, 382, 785, 79817, 5333, 6696, 279, 1852, 10690, 369, 1565, 3481, 5224, 776, 1279, 63, 320, 15, 1526, 220, 98360, 8, 476, 279, 1565, 997, 63, 829, 198, 63, 1994, 13404, 4326, 1665, 776, 1279, 44364, 304, 1817, 1565, 3006, 4326, 63, 949, 594, 1565, 839, 776, 1279, 7808, 323, 438, 19684, 304, 1565, 19857, 287, 4326, 63, 5479, 198, 437, 1565, 1688, 13420, 63, 3589, 13, 362, 4269, 21259, 1105, 304, 279, 1565, 2322, 13404, 4326, 22500, 63, 323, 198, 63, 2322, 57309, 287, 4326, 22500, 63, 4357, 26, 448, 7375, 8898, 807, 2525, 3055, 279, 6738, 525, 15664, 11, 438, 89838, 448, 4287, 198, 1318, 11, 323, 1817, 1509, 594, 2814, 4357, 3783, 369, 1105, 13, 1565, 997, 63, 7484, 389, 458, 4712, 2041, 1487, 776, 1279, 11248, 2041, 1105, 280, 63, 3481, 5224, 776, 1279, 63, 1052, 4675, 10125, 220, 102259, 382, 8120, 4027, 291, 37107, 85, 16, 25016, 10814, 908, 63, 1083, 4990, 348, 4086, 44, 594, 1565, 40358, 5224, 776, 1279, 7808, 458, 7546, 504, 220, 15, 1526, 220, 98360, 11, 389, 279, 1852, 4712, 198, 437, 389, 5588, 44, 12, 20, 13, 18, 12, 23809, 594, 54443, 4712, 624, 63, 24713, 58, 15, 936, 40358, 5224, 776, 1279, 63, 702, 825, 4343, 817, 9929, 3950, 25, 1565, 2921, 63, 369, 279, 1156, 11, 1221, 458, 1633, 89780, 553, 3950, 877, 198, 2877, 914, 8, 6693, 1156, 1376, 374, 279, 9929, 3950, 5086, 11, 8109, 553, 279, 11218, 1850, 11206, 26, 1817, 897, 702, 198, 63, 839, 19861, 7808, 1565, 13121, 63, 323, 1565, 62472, 6458, 28487, 576, 9929, 3950, 594, 1565, 13121, 63, 14569, 1449, 34744, 3950, 518, 476, 3403, 432, 345, 275, 721, 5230, 11, 438, 348, 4086, 44, 1558, 11, 323, 279, 1850, 11206, 525, 20959, 553, 1992, 13, 15120, 264, 1681, 2581, 64737, 504, 279, 9929, 198, 9357, 11, 773, 1181, 4361, 9929, 374, 18702, 4374, 13, 12847, 11, 72678, 7388, 323, 1008, 21059, 470, 10125, 220, 102259, 448, 432, 624, 63, 13122, 2204, 436, 25, 830, 63, 13589, 1196, 58112, 3440, 1565, 9491, 63, 9066, 4541, 11, 2670, 979, 264, 2936, 914, 44038, 72678, 26671, 624, 20586, 1182, 1412, 7850, 264, 2477, 12, 6117, 1565, 13122, 2204, 436, 63, 476, 264, 78613, 1565, 9491, 63, 448, 10125, 220, 102259, 1573, 264, 4269, 15873, 624, 20586, 1182, 1412, 7850, 78613, 1565, 34388, 7808, 1565, 3481, 620, 7808, 1565, 3481, 4698, 63, 323, 1565, 22543, 63, 2750, 448, 10125, 220, 102259, 11, 3425, 476, 537, 198, 1782, 1681, 10464, 25, 708, 96188, 11, 2477, 2220, 15844, 5109, 11, 2477, 12, 19563, 9066, 11, 323, 2477, 20013, 26735, 1565, 3481, 4698, 63, 476, 1565, 22543, 18606, 2668, 55, 1083, 59003, 1181, 1008, 78613, 23996, 11569, 323, 700, 8667, 8272, 43278, 7112, 9929, 28261, 624, 63, 3481, 4698, 63, 518, 7168, 476, 3685, 72433, 1909, 12640, 29557, 11, 323, 845, 24816, 5043, 14051, 3538, 16657, 624, 2354, 1909, 12640, 1007, 11, 264, 54443, 4038, 15092, 279, 1909, 2268, 61075, 553, 1817, 3950, 594, 18893, 3072, 304, 220, 99698, 15245, 8355, 1459, 11, 773, 825, 22611, 198, 437, 1378, 69878, 9958, 73536, 315, 279, 34744, 4038, 279, 1852, 3950, 25, 1817, 22611, 15792, 1181, 220, 16, 11, 15, 99590, 1850, 11173, 11, 323, 1181, 198, 66147, 34744, 51728, 979, 264, 2802, 594, 61075, 8472, 3267, 1105, 320, 269, 448, 1565, 3481, 620, 63, 220, 16, 323, 902, 1565, 1065, 620, 63, 4292, 63, 1065, 620, 63, 320, 15, 311, 220, 16, 26, 220, 15, 374, 1007, 8, 13589, 11, 1283, 279, 1909, 12640, 323, 1909, 2268, 15092, 11, 1172, 279, 11206, 518, 3245, 1565, 1065, 620, 63, 3039, 438, 4363, 198, 300, 279, 3130, 12288, 477, 825, 1283, 9312, 26, 279, 1909, 2268, 3931, 374, 4429, 2041, 432, 11, 438, 328, 3825, 524, 1558, 320, 85, 4086, 44, 16772, 1565, 1065, 620, 3989, 3896, 568, 362, 897, 4889, 220, 15, 311, 220, 16, 5221, 10125, 220, 102259, 13, 1084, 374, 949, 315, 279, 89780, 5912, 389, 1449, 4712, 11, 773, 37759, 30517, 2058, 198, 25715, 52951, 44731, 788, 895, 63, 6174, 382, 1925, 54443, 11, 2936, 9066, 525, 10062, 1283, 1449, 3950, 389, 279, 7907, 1467, 11, 32559, 5230, 11, 773, 37759, 323, 198, 63, 1, 44731, 788, 895, 63, 30517, 2936, 518, 279, 1852, 3950, 26, 10426, 323, 1565, 5839, 48529, 63, 1760, 279, 11206, 1526, 279, 825, 429, 198, 874, 694, 2338, 279, 2432, 13, 576, 5588, 44, 4712, 11, 323, 17242, 9292, 323, 61732, 50670, 389, 1378, 20757, 11, 16876, 389, 1283, 264, 2432, 311, 458, 835, 198, 5839, 476, 279, 9846, 3930, 26, 279, 3538, 4675, 279, 9846, 1172, 705, 311, 279, 2432, 13, 10962, 264, 54443, 4712, 48189, 198, 63, 13122, 2204, 436, 7808, 835, 11206, 4766, 279, 9846, 525, 29106, 1119, 1181, 1467, 11, 438, 389, 19577, 55, 11, 323, 1565, 30033, 38025, 63, 374, 1565, 4129, 3989, 38562, 264, 2936, 914, 476, 264, 5392, 1618, 9478, 279, 9846, 382, 14364, 73897, 51956, 3950, 28261, 271, 20754, 37107, 85, 16, 70793, 25016, 10814, 908, 63, 323, 37107, 85, 16, 25016, 10814, 908, 63, 4193, 198, 63, 1, 4027, 8742, 788, 5212, 45832, 19923, 6458, 12667, 9434, 788, 220, 16, 5541, 448, 52951, 4027, 788, 830, 18606, 63, 45832, 19923, 15586, 16909, 1177, 2236, 63, 6682, 52951, 5839, 12667, 64672, 788, 508, 16, 60, 63, 979, 419, 8892, 374, 2500, 624, 785, 2319, 1969, 387, 279, 7546, 1565, 16, 76960, 9783, 10790, 323, 2477, 4027, 287, 7388, 470, 10125, 220, 102259, 1573, 9467, 624, 10575, 62565, 594, 7299, 20968, 6236, 30517, 653, 537, 1824, 2319, 220, 16, 323, 5258, 279, 1852, 42906, 382, 785, 40542, 3419, 4269, 94171, 4693, 19083, 5264, 15457, 26671, 448, 7112, 72902, 821, 14078, 1447, 73022, 2236, 198, 4913, 1700, 3252, 45832, 19923, 14406, 47509, 2198, 4366, 788, 16, 1335, 307, 3252, 9682, 6226, 500, 12, 1112, 2198, 2528, 3252, 2528, 2198, 3176, 788, 15, 1335, 5839, 8076, 8897, 101961, 11, 102088, 23374, 13865, 19288, 63, 3176, 63, 374, 279, 7168, 5980, 1922, 315, 279, 1156, 11158, 3950, 304, 429, 7162, 13, 425, 9115, 525, 66019, 11, 2477, 3194, 323, 198, 10539, 13, 28261, 2525, 5961, 504, 279, 9862, 4712, 323, 2924, 11158, 32559, 11, 5392, 40526, 11, 2936, 30756, 323, 48593, 198, 30446, 11, 1496, 979, 1846, 11206, 8192, 902, 9430, 1467, 13, 1032, 28205, 9955, 11206, 323, 11206, 1283, 279, 3538, 594, 22476, 198, 2768, 525, 27352, 13, 22961, 14078, 16187, 68, 279, 41497, 89838, 8944, 504, 862, 7162, 26, 20036, 12, 23, 5766, 646, 9386, 198, 325, 17514, 44532, 382, 11505, 19083, 11873, 23313, 264, 1565, 45832, 19923, 12667, 63, 1633, 1447, 73022, 2236, 198, 4913, 4366, 788, 16, 1335, 5839, 3180, 788, 17, 1335, 5839, 842, 788, 102088, 532, 13865, 19288, 63, 5839, 3180, 63, 374, 279, 2790, 1372, 315, 7112, 28261, 11158, 773, 3041, 11, 323, 1565, 5839, 842, 63, 374, 279, 1537, 315, 1105, 11, 476, 1565, 2921, 63, 1573, 198, 3767, 3950, 374, 11158, 13, 4220, 2750, 17086, 41497, 2550, 311, 264, 2530, 2309, 13, 25615, 2213, 11, 32559, 476, 198, 14163, 89838, 1231, 4332, 825, 17086, 26, 1052, 374, 902, 825, 4686, 18557, 5025, 1948, 11206, 323, 41497, 26671, 382, 4498, 264, 11873, 23313, 1487, 19861, 10690, 11, 279, 11155, 1083, 23313, 1565, 839, 19861, 37025, 7808, 26189, 1075, 198, 63, 24713, 58, 15, 936, 839, 776, 1279, 44364, 1565, 1796, 63, 323, 1565, 19857, 287, 7495, 63, 3331, 825, 7168, 5980, 7112, 2309, 369, 1817, 4343, 11, 304, 1973, 345, 437, 1565, 14163, 45366, 63, 9977, 53335, 1252, 11, 2213, 5541, 5203, 13, 1752, 19551, 3459, 908, 11, 1565, 1796, 63, 9068, 279, 15267, 18357, 304, 198, 63, 24713, 58, 15, 936, 839, 776, 1279, 28487, 1527, 4343, 279, 9846, 4933, 1172, 949, 315, 13240, 1181, 3950, 594, 2309, 448, 429, 3950, 594, 1008, 198, 12933, 13, 39659, 11, 12220, 323, 48593, 11206, 614, 902, 4343, 11, 323, 11499, 28261, 2058, 614, 12454, 9887, 382, 11500, 52951, 689, 6458, 8076, 788, 830, 63, 311, 5258, 279, 6350, 1590, 1565, 45832, 19923, 14406, 8076, 63, 1334, 438, 458, 9485, 1779, 198, 68250, 96714, 7112, 44532, 13, 576, 9862, 1590, 10426, 8457, 64126, 11, 2670, 369, 458, 4287, 9846, 624, 785, 1590, 10426, 323, 77021, 69871, 60, 63, 4357, 2506, 862, 13466, 7586, 11, 448, 1565, 997, 31376, 63, 38072, 979, 11218, 13, 16686, 72902, 198, 71915, 6042, 2506, 458, 16174, 714, 21012, 4269, 13666, 26, 807, 653, 537, 11906, 279, 3950, 1760, 13, 60684, 279, 198, 7742, 61869, 2010, 279, 16174, 9467, 323, 78021, 1181, 4712, 1681, 1573, 27770, 432, 13, 50549, 2041, 279, 198, 4366, 2999, 14051, 862, 6350, 9064, 2550, 382, 14364, 62889, 429, 12635, 264, 3811, 11129, 271, 8372, 19873, 16150, 862, 2484, 13061, 42186, 438, 825, 3694, 3950, 25, 1207, 16929, 18, 13, 23, 12, 23809, 12, 5847, 594, 45681, 3209, 2539, 198, 63, 27, 91, 318, 6213, 91, 43376, 311, 825, 877, 11, 1393, 30466, 91, 14163, 13420, 23274, 91, 43376, 26473, 8093, 19083, 11206, 11, 438, 1565, 2946, 608, 5839, 551, 63, 448, 198, 63, 4913, 40358, 788, 4055, 2154, 6293, 21108, 330, 718, 41394, 28735, 788, 895, 5541, 4933, 11737, 2, 99619, 24, 24, 10692, 362, 9846, 646, 12635, 429, 42186, 448, 198, 20984, 11206, 323, 6248, 14269, 26, 979, 432, 26557, 279, 825, 34668, 42186, 4518, 11, 279, 2484, 10330, 1052, 1496, 4766, 198, 64, 2038, 9386, 13, 576, 3538, 17906, 389, 279, 3950, 279, 1614, 23489, 26, 432, 1558, 537, 6077, 3267, 279, 835, 3950, 323, 10274, 198, 10689, 4014, 11, 1576, 429, 1035, 2297, 279, 9846, 382, 32, 14386, 1681, 2669, 32879, 389, 279, 66720, 16859, 773, 3041, 25, 807, 12839, 264, 23174, 11129, 448, 19083, 198, 30446, 11, 323, 279, 3538, 17906, 389, 279, 835, 3950, 979, 279, 1614, 26557, 432, 13, 362, 2943, 429, 2058, 5711, 1565, 13122, 2204, 436, 3989, 5445, 2936, 389, 1565, 1183, 154820, 497, 4055, 91, 318, 4906, 91, 29, 1341, 63, 323, 537, 389, 30466, 91, 318, 6213, 91, 43376, 476, 835, 8667, 9342, 7484, 13, 3085, 198, 63, 13122, 2204, 436, 7808, 279, 835, 3950, 902, 5021, 17906, 279, 9846, 11, 323, 4815, 458, 8314, 9929, 279, 1614, 3545, 15873, 279, 1790, 198, 412, 4518, 315, 4378, 835, 8667, 9342, 11, 773, 264, 2936, 389, 835, 8667, 9342, 7484, 2581, 26003, 26, 279, 35316, 10572, 1598, 389, 11, 323, 264, 198, 14163, 6729, 4675, 862, 5392, 6738, 11737, 2, 99619, 24, 24, 10692, 34725, 264, 27654, 30466, 91, 318, 6213, 91, 43376, 323, 279, 36188, 1283, 432, 1573, 198, 5493, 13, 576, 2783, 374, 279, 1852, 369, 2176, 17906, 25, 264, 2936, 914, 9068, 279, 42186, 4764, 432, 374, 3950, 1506, 11, 773, 264, 198, 20987, 429, 17174, 1565, 154820, 7808, 30466, 91, 318, 4906, 91, 43376, 476, 30466, 91, 318, 6213, 91, 43376, 438, 1467, 374, 3931, 1052, 13, 362, 1565, 9491, 63, 369, 30466, 91, 318, 6213, 91, 53365, 22438, 518, 3245, 1380, 279, 835, 3950, 1035, 11, 323, 1083, 1380, 279, 9846, 25540, 432, 448, 19083, 11206, 382, 84651, 55604, 389, 264, 18831, 98668, 448, 264, 8059, 5392, 1618, 323, 1181, 1102, 304, 279, 10430, 11, 389, 1207, 16929, 18, 13, 20, 12, 17, 33, 19577, 55, 198, 19, 15245, 323, 1207, 16929, 18, 13, 21, 12, 100235, 33, 6691, 18, 33, 24384, 11692, 19, 25, 2176, 66720, 6139, 279, 23174, 11129, 448, 19083, 11206, 11, 773, 279, 14386, 1681, 198, 12123, 26, 448, 1565, 13122, 2204, 436, 63, 323, 1565, 9491, 25, 4383, 154820, 497, 4055, 91, 318, 4906, 91, 29, 1341, 63, 678, 30517, 10492, 1290, 1283, 862, 198, 3896, 835, 11, 323, 1817, 9478, 448, 279, 14754, 30466, 91, 318, 6213, 91, 43376, 369, 279, 2943, 311, 13308, 13, 1913, 458, 8314, 34559, 2487, 11, 279, 8472, 198, 75131, 304, 671, 99619, 24, 24, 6551, 220, 15, 14, 24, 1598, 39375, 448, 279, 6716, 11, 2348, 220, 22, 14, 24, 448, 835, 8667, 9342, 7484, 11, 389, 5591, 1207, 16929, 18, 13, 23, 12, 23809, 12, 5847, 198, 13319, 382, 1925, 19577, 55, 11, 1565, 313, 45824, 3233, 63, 374, 279, 1638, 25, 7388, 4332, 19494, 2878, 279, 19718, 77383, 323, 4938, 198, 48102, 13, 7209, 16174, 9929, 18702, 3305, 264, 11873, 518, 264, 882, 29279, 279, 3800, 13, 8884, 11873, 5780, 311, 264, 39093, 9929, 198, 14790, 264, 4004, 825, 11, 1221, 311, 279, 9929, 448, 279, 2421, 477, 11206, 2115, 11, 323, 264, 9929, 5823, 916, 369, 220, 23, 26671, 4990, 198, 1782, 1790, 825, 25, 264, 2805, 1681, 8470, 518, 279, 1790, 11873, 11, 323, 264, 1293, 9929, 2058, 32879, 13, 27930, 30517, 1896, 19494, 198, 41631, 26671, 369, 1565, 313, 18167, 59306, 63, 315, 1817, 11873, 594, 882, 320, 15, 13, 99446, 374, 279, 13020, 4712, 594, 1638, 568, 1913, 264, 9862, 3538, 198, 1782, 5181, 374, 279, 9846, 594, 4332, 11, 323, 279, 9929, 68343, 1181, 22705, 25, 432, 1083, 6081, 264, 220, 124184, 19508, 2062, 389, 264, 21226, 198, 40358, 594, 26671, 311, 8520, 429, 15901, 11873, 96960, 9929, 34612, 13, 2938, 3010, 374, 84015, 817, 2997, 198, 29782, 484, 3671, 3950, 95363, 44794, 26, 1449, 9862, 2997, 374, 84015, 700, 3351, 11, 773, 902, 9862, 3538, 18536, 11873, 198, 1811, 3602, 13, 22025, 306, 279, 5181, 279, 21059, 2506, 862, 1828, 15092, 323, 1565, 51, 43957, 37, 7863, 65889, 9225, 68420, 63, 13589, 1181, 2310, 7290, 510, 1782, 9929, 594, 4332, 315, 264, 5155, 3019, 594, 7002, 882, 11, 882, 1172, 11, 2581, 9152, 26671, 13, 17242, 9292, 594, 6094, 15692, 389, 264, 7401, 198, 546, 279, 4683, 25, 27122, 2176, 11, 30517, 1896, 220, 15, 13, 23, 315, 429, 882, 323, 264, 21226, 9929, 594, 7354, 3063, 198, 1499, 220, 101175, 311, 220, 124184, 6978, 1283, 8062, 11, 1393, 1565, 313, 18167, 59306, 220, 15, 63, 13589, 279, 220, 101175, 19508, 7354, 448, 279, 9929, 1156, 13, 1565, 51, 43957, 37, 7863, 65889, 9225, 26591, 14140, 81, 417, 3989, 9937, 264, 4303, 9846, 429, 1035, 835, 2878, 264, 8337, 315, 264, 21226, 1293, 9929, 594, 12936, 882, 2115, 1896, 19494, 1156, 345, 1782, 9929, 10277, 518, 3245, 220, 98668, 4, 315, 279, 882, 323, 39336, 518, 1429, 264, 8337, 315, 1181, 1828, 13, 1084, 594, 279, 1638, 369, 1207, 16929, 18, 13, 23, 12, 99951, 33, 198, 263, 19170, 979, 13857, 1565, 313, 18167, 59306, 63, 6329, 1565, 51, 43957, 37, 7863, 65889, 9225, 68420, 63, 374, 738, 26, 894, 1008, 897, 315, 279, 3890, 10572, 432, 1007, 13, 3085, 1565, 313, 18167, 59306, 63, 432, 13589, 429, 4332, 979, 279, 9929, 5780, 1156, 323, 4990, 518, 1429, 220, 98668, 4, 979, 264, 9846, 1558, 11, 323, 1565, 313, 18167, 59306, 220, 15, 63, 2058, 18702, 3305, 1817, 9929, 4361, 13, 576, 54443, 11, 2804, 16929, 99951, 19170, 323, 198, 2151, 643, 5852, 16279, 1494, 279, 5181, 311, 862, 21224, 3468, 323, 1896, 1181, 882, 4332, 26, 279, 18154, 39138, 11, 26382, 30430, 389, 19170, 11, 1207, 16929, 19, 198, 437, 1599, 6325, 16279, 653, 537, 4715, 476, 3796, 279, 5181, 13, 1565, 313, 18167, 59306, 220, 15, 63, 18702, 3305, 1817, 9929, 198, 66147, 198, 3896, 11, 304, 18614, 1973, 11, 438, 220, 15, 13, 18, 13, 21, 13, 17, 1521, 13, 24724, 975, 46648, 4815, 39093, 7388, 13, 1527, 4541, 4004, 198, 2035, 35233, 979, 264, 39093, 1681, 3880, 1181, 21224, 476, 4938, 11, 1221, 17005, 82, 448, 2669, 46836, 42811, 11206, 198, 12770, 14308, 624, 5283, 8815, 7388, 525, 1083, 11752, 438, 4004, 975, 382, 785, 8682, 8041, 1565, 313, 3481, 2268, 7808, 1565, 313, 3481, 12640, 63, 323, 1565, 313, 1065, 2268, 63, 738, 279, 3538, 594, 16657, 369, 279, 1681, 5043, 315, 279, 1852, 198, 11395, 11, 438, 1565, 313, 34388, 63, 1558, 13, 9445, 1105, 2444, 1378, 13608, 25, 264, 2997, 594, 5798, 3419, 24816, 320, 33303, 39138, 19588, 19, 323, 647, 19, 13, 16, 198, 13259, 862, 1614, 7411, 6, 9312, 220, 16, 323, 1909, 620, 220, 16, 701, 1221, 279, 29186, 594, 1565, 79415, 5332, 4323, 3989, 5809, 34388, 7808, 1565, 3481, 4698, 7808, 1565, 3481, 620, 7808, 1565, 1065, 620, 76960, 1565, 2982, 17467, 25, 895, 63, 3363, 9312, 220, 15, 11, 323, 1565, 2982, 17467, 25, 830, 63, 2041, 198, 64, 9312, 3363, 220, 16, 568, 362, 5181, 429, 374, 738, 40475, 1128, 1846, 13608, 6551, 13, 3197, 4302, 7289, 264, 897, 279, 3538, 198, 4648, 902, 24816, 1638, 323, 279, 13471, 1555, 23408, 1565, 15513, 9310, 76960, 5937, 432, 23408, 279, 19636, 16657, 438, 198, 606, 19048, 13521, 13, 362, 1681, 594, 1828, 5043, 3164, 916, 279, 16657, 13, 576, 25920, 2750, 525, 10062, 817, 1681, 1075, 198, 2035, 5043, 25, 264, 1565, 313, 1065, 2268, 63, 4889, 220, 15, 1526, 220, 16, 40393, 1449, 6236, 1681, 11, 264, 8224, 1565, 313, 3481, 12640, 63, 1185, 14637, 311, 220, 15, 11, 323, 198, 63, 313, 34388, 63, 323, 1565, 313, 3481, 2268, 63, 1969, 387, 34059, 5109, 13, 1527, 4712, 429, 1622, 2539, 55451, 1541, 1172, 40393, 48569, 198, 36059, 1393, 279, 3538, 10464, 553, 1638, 11, 323, 1181, 42906, 13222, 13471, 448, 1565, 313, 34388, 220, 15, 61898, 63, 313, 258, 1235, 1331, 29596, 63, 6696, 6236, 7388, 448, 7274, 1007, 862, 1828, 24816, 16657, 13, 67992, 1493, 7388, 2297, 198, 7994, 432, 25, 264, 6236, 1681, 320, 1921, 264, 7112, 9750, 8, 6693, 32559, 2504, 374, 1007, 320, 1782, 1681, 594, 1565, 12546, 5854, 15724, 25, 895, 12885, 269, 1565, 313, 2152, 98112, 63, 448, 4302, 304, 279, 1681, 13047, 432, 389, 701, 429, 10464, 320, 1199, 9312, 11, 476, 279, 1638, 432, 10330, 198, 454, 448, 11, 374, 3403, 220, 15, 701, 4990, 279, 738, 594, 897, 369, 1817, 24816, 2070, 432, 10896, 17972, 26, 264, 2070, 279, 1681, 21259, 14805, 345, 300, 916, 279, 19083, 16657, 13, 50549, 448, 7274, 389, 11, 55604, 7388, 320, 64, 1681, 594, 1565, 34388, 25, 220, 15, 7808, 264, 3538, 594, 198, 63, 313, 34388, 220, 15, 7808, 476, 264, 29186, 6693, 1565, 79415, 5332, 4323, 63, 702, 1565, 2982, 17467, 25, 895, 63, 701, 7112, 9929, 3459, 908, 323, 198, 1782, 3538, 594, 1828, 7388, 320, 5689, 1311, 68419, 11, 18507, 1205, 2796, 6, 17729, 3409, 819, 323, 12335, 8, 525, 34684, 13, 1565, 4951, 3989, 82, 13272, 279, 2997, 594, 1614, 20423, 21019, 738, 25, 1207, 16929, 220, 18, 13, 20, 11, 1207, 16929, 220, 18, 13, 21, 11, 1207, 16929, 18, 13, 23, 12, 99951, 33, 323, 1207, 16929, 18, 13, 23, 12, 23809, 12, 5847, 2968, 9312, 198, 15, 13, 22, 11, 1909, 620, 220, 15, 13, 23, 11, 1909, 4698, 220, 98360, 323, 9359, 81609, 220, 16, 13, 20, 11, 1393, 862, 7274, 738, 26473, 304, 1565, 79415, 5332, 4323, 18606, 63, 606, 46252, 28573, 63, 7289, 476, 4344, 1565, 34388, 7808, 1565, 3481, 620, 7808, 1565, 3481, 4698, 7808, 1565, 1065, 620, 7808, 1565, 72848, 81609, 63, 323, 1565, 46235, 81609, 3989, 1975, 429, 738, 11, 476, 916, 279, 3538, 594, 16657, 369, 264, 2997, 2041, 825, 26, 1565, 6697, 63, 17026, 825, 738, 13, 576, 738, 11, 13521, 198, 81942, 11, 22950, 1948, 1565, 79415, 5332, 4323, 63, 323, 279, 8041, 11, 773, 1565, 313, 34388, 7808, 1565, 313, 3481, 2268, 7808, 1565, 313, 3481, 12640, 63, 323, 1565, 313, 1065, 2268, 3989, 43117, 10274, 369, 2176, 19740, 25, 264, 3538, 3855, 448, 1565, 313, 34388, 220, 15, 63, 26473, 55604, 8819, 279, 13521, 1977, 13, 17128, 279, 198, 9898, 279, 3538, 702, 825, 1638, 738, 369, 1449, 1681, 11, 438, 1573, 13, 362, 6716, 4889, 279, 2088, 264, 1681, 1231, 3624, 198, 7, 34388, 3685, 220, 15, 11, 1909, 620, 4889, 220, 15, 1526, 220, 16, 11, 264, 8224, 1909, 4698, 11, 1308, 620, 4889, 220, 15, 1526, 220, 16, 11, 264, 16332, 4889, 481, 17, 198, 19705, 220, 17, 8, 40393, 279, 5693, 518, 20524, 11, 34774, 279, 2070, 13, 1565, 4951, 63, 40393, 264, 1614, 943, 6693, 2997, 6696, 902, 3701, 198, 746, 26, 432, 4157, 3291, 66720, 10742, 2878, 264, 943, 11, 773, 5274, 279, 5181, 1007, 320, 269, 2968, 13521, 504, 279, 3701, 8, 369, 264, 198, 68627, 6693, 3701, 6696, 902, 2477, 98112, 738, 11, 1741, 438, 87111, 410, 12, 16, 13, 20, 12, 115760, 33, 10218, 438, 1565, 80, 16929, 18, 62, 20, 717, 4644, 28487, 1913, 458, 4712, 429, 198, 391, 7202, 902, 29870, 279, 3701, 594, 9359, 81609, 374, 2115, 700, 448, 264, 20524, 1555, 5488, 773, 11, 323, 13521, 34774, 264, 198, 6280, 36737, 16332, 525, 16037, 518, 20524, 13, 576, 13471, 1555, 23408, 279, 738, 1283, 279, 24816, 16657, 198, 5809, 81583, 1007, 25, 2503, 58800, 3085, 264, 43841, 1046, 11, 9359, 81609, 220, 16, 13, 20, 71464, 9955, 25427, 25, 389, 1207, 16929, 18, 13, 23, 12, 99951, 33, 7274, 12456, 198, 265, 7202, 11, 264, 4778, 11829, 911, 220, 19, 12, 98668, 4, 16727, 11206, 518, 2987, 1207, 16929, 24816, 738, 323, 220, 15, 12, 19, 4, 16727, 1212, 55604, 1091, 448, 198, 1782, 16332, 518, 220, 15, 11, 28662, 264, 2696, 553, 9846, 320, 603, 9846, 5558, 220, 99446, 13375, 2441, 18134, 220, 99590, 51731, 576, 882, 817, 4778, 3171, 944, 2297, 345, 704, 279, 4361, 2783, 374, 25427, 11, 323, 2030, 60343, 46826, 7049, 279, 1852, 448, 279, 16332, 13, 28464, 291, 30517, 4717, 198, 3782, 12, 1713, 938, 311, 2030, 60343, 6174, 13, 569, 32242, 5066, 672, 2024, 672, 16859, 419, 389, 458, 10630, 55, 220, 99200, 24, 15, 448, 422, 23809, 17, 11, 323, 569, 2519, 331, 76, 1122, 389, 264, 18831, 98668, 198, 4197, 422, 23809, 17, 323, 422, 6406, 482, 28976, 126743, 20, 568, 1565, 313, 258, 1235, 1331, 29596, 9359, 81609, 28, 15, 63, 13589, 279, 3701, 594, 9312, 11, 1909, 620, 323, 198, 3481, 4698, 2041, 279, 16332, 382, 63, 313, 606, 2268, 8772, 3034, 28, 6742, 63, 6696, 825, 10218, 877, 28552, 313, 606, 63, 476, 458, 1565, 313, 14944, 32725, 264, 1638, 10614, 25, 264, 1681, 429, 198, 4604, 369, 432, 323, 21259, 902, 1565, 23517, 63, 315, 1181, 1828, 374, 11752, 438, 1565, 23517, 25, 330, 6742, 1, 28487, 576, 1681, 594, 1828, 1565, 23517, 3989, 2566, 2677, 14805, 916, 279, 1638, 13, 1096, 15342, 825, 3538, 4226, 311, 3807, 14142, 518, 862, 13466, 10614, 1393, 264, 198, 6742, 15370, 2943, 320, 64, 7162, 66980, 11, 1977, 8, 5221, 825, 877, 429, 2677, 35233, 11, 2041, 11622, 279, 2070, 5086, 382, 785, 9862, 54443, 1936, 17026, 61732, 50670, 11, 323, 1181, 33870, 7388, 4332, 1817, 4778, 13, 576, 2732, 315, 419, 14301, 198, 5799, 54766, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 594, 54443, 8520, 624, 1925, 54443, 11, 1565, 313, 45824, 3233, 63, 17026, 825, 1681, 518, 264, 882, 13, 1527, 11459, 1565, 313, 45824, 451, 63, 3403, 825, 13240, 19494, 198, 1958, 1207, 16929, 18, 13, 23, 12, 99951, 33, 389, 825, 476, 1378, 20757, 323, 369, 17242, 9292, 323, 1207, 16929, 18, 13, 21, 389, 825, 7077, 26, 5588, 44, 323, 61732, 50670, 4717, 32760, 624, 4498, 264, 2943, 28864, 82, 11, 1181, 54443, 1681, 17906, 518, 279, 1790, 4778, 11, 323, 264, 1681, 2058, 8579, 4815, 198, 41726, 304, 825, 28680, 7409, 7246, 13471, 1558, 537, 1191, 26, 1378, 3795, 1180, 17242, 9292, 11, 61732, 50670, 323, 5588, 44, 7388, 6248, 389, 198, 20981, 20757, 13, 362, 4004, 1681, 28552, 23517, 25, 4004, 7808, 476, 264, 3797, 8815, 1681, 8, 46648, 4815, 39093, 198, 3154, 13, 3776, 46826, 35233, 311, 264, 39093, 1681, 429, 46648, 320, 41631, 19494, 979, 825, 1681, 8472, 518, 264, 882, 26, 1181, 21224, 198, 7994, 1565, 313, 45824, 63, 979, 1449, 21224, 374, 4429, 701, 1221, 5791, 942, 504, 1181, 9929, 2937, 11, 438, 279, 7401, 1558, 25, 279, 11206, 198, 275, 2669, 3208, 2525, 1549, 323, 525, 10062, 11, 537, 3208, 10912, 11, 773, 1181, 9846, 16801, 1181, 13520, 1598, 26, 264, 39093, 198, 40358, 18702, 3305, 1573, 264, 4004, 825, 13, 9445, 1565, 313, 45824, 7808, 279, 220, 99951, 33, 323, 1207, 16929, 18, 13, 21, 855, 7559, 264, 4004, 9929, 220, 16, 11, 15, 99590, 198, 1811, 264, 3019, 11, 773, 264, 39093, 9929, 31871, 36035, 46648, 2686, 25, 389, 825, 26382, 11, 264, 2805, 39093, 1681, 220, 15, 13, 18, 274, 1119, 198, 64, 4004, 9929, 594, 3968, 16, 274, 855, 7559, 29108, 220, 15, 13, 102486, 274, 389, 1207, 16929, 18, 13, 21, 11, 2348, 220, 15, 13, 100096, 274, 2041, 279, 10614, 323, 220, 15, 13, 100590, 274, 7484, 198, 30307, 220, 99951, 33, 25, 220, 15, 13, 103093, 12, 15, 13, 103502, 274, 2348, 220, 17, 13, 101663, 12, 18, 13, 101478, 274, 568, 17242, 9292, 11, 323, 458, 4712, 13471, 825, 1681, 518, 264, 882, 11, 6248, 264, 198, 6742, 9929, 594, 855, 7559, 3055, 432, 702, 3855, 13, 9040, 3795, 1180, 21059, 13471, 825, 1681, 518, 264, 882, 198, 3243, 1973, 279, 7177, 382, 565, 26643, 323, 7375, 271, 44650, 6605, 990, 1849, 29223, 52348, 13, 8277, 6388, 1849, 323, 15742, 6605, 10875, 11, 304, 1973, 345, 18094, 825, 6388, 1849, 1943, 13, 24809, 1849, 323, 15742, 6605, 4717, 304, 1992, 26, 979, 279, 3811, 4157, 198, 7322, 264, 2937, 1849, 1943, 11, 279, 3538, 44026, 432, 438, 264, 1196, 1943, 13, 2918, 2213, 5479, 77161, 198, 258, 1973, 13, 55690, 6605, 525, 537, 84126, 624, 58639, 6788, 22325, 11206, 646, 7948, 9249, 25897, 382, 1925, 2176, 1182, 1412, 11, 1207, 16929, 11868, 5392, 5029, 990, 279, 8898, 10797, 594, 11459, 943, 369, 18357, 11, 6171, 11, 708, 96188, 345, 396, 67100, 11, 5109, 323, 845, 82, 11, 72678, 476, 537, 13, 41416, 21081, 1467, 323, 36188, 13, 8393, 10150, 476, 35126, 291, 2750, 198, 47291, 9066, 369, 279, 2943, 311, 9589, 13, 9142, 4494, 323, 10797, 15045, 525, 537, 19636, 553, 419, 14399, 382, 32, 9846, 429, 374, 537, 264, 1618, 4675, 438, 2213, 11, 2581, 458, 1465, 25, 60276, 11, 4718, 429, 5036, 902, 8898, 5392, 198, 2877, 32774, 4226, 701, 323, 78613, 5392, 10005, 11, 892, 2506, 862, 1467, 13, 362, 5588, 44, 5693, 1376, 5326, 2041, 1181, 198, 63, 154847, 63, 5221, 429, 4772, 1182, 11, 323, 279, 1618, 70303, 13, 362, 1632, 94080, 1618, 311, 264, 5392, 279, 198, 2035, 1521, 537, 3010, 374, 8603, 438, 1467, 2238, 11, 1212, 279, 829, 279, 1614, 6139, 11, 773, 279, 2943, 15622, 279, 40526, 432, 646, 198, 11730, 323, 279, 1614, 646, 4396, 5086, 382, 4498, 264, 1614, 835, 3950, 29569, 4766, 264, 4361, 5392, 1618, 1573, 1181, 15304, 40526, 11, 279, 3538, 33090, 279, 198, 80173, 323, 4675, 279, 1618, 13, 362, 5588, 44, 897, 279, 835, 3950, 3931, 1007, 374, 7877, 448, 1565, 154850, 63, 1156, 11, 323, 279, 1618, 198, 4216, 979, 432, 1221, 70303, 25392, 13, 5765, 1008, 7130, 897, 11, 264, 7402, 1376, 897, 11, 458, 4287, 2504, 11, 476, 458, 650, 1847, 12330, 198, 6659, 429, 4157, 4715, 438, 825, 4583, 1618, 8457, 2213, 382, 2354, 1565, 45824, 22724, 45366, 25, 895, 7808, 279, 3538, 27298, 5392, 89838, 3080, 432, 646, 470, 279, 1156, 2697, 198, 34563, 1618, 13, 1298, 325, 323, 32559, 646, 2058, 4269, 13, 24492, 14569, 279, 4453, 29106, 9846, 11, 2670, 198, 35323, 6738, 39227, 504, 279, 2033, 13, 18185, 2176, 16279, 4269, 1817, 1207, 16929, 11868, 1618, 438, 432, 374, 5326, 25, 264, 198, 20214, 448, 279, 1618, 594, 877, 323, 829, 11, 1221, 1181, 5977, 304, 9662, 26, 264, 1618, 279, 4269, 261, 646, 944, 1795, 29569, 4361, 518, 198, 1782, 835, 382, 1925, 279, 9862, 3538, 264, 1618, 594, 877, 374, 1565, 6659, 62, 63, 323, 220, 99590, 12365, 18478, 315, 95122, 6222, 17001, 12, 116265, 1212, 279, 3538, 594, 5392, 58490, 877, 1376, 11, 916, 198, 1782, 1681, 594, 1828, 20836, 320, 1199, 2487, 438, 16812, 4718, 304, 279, 1973, 3208, 11, 2041, 1565, 4027, 63, 323, 1565, 4027, 8742, 63, 701, 279, 5754, 198, 437, 279, 1618, 594, 1922, 13, 1913, 37107, 85, 16, 71206, 63, 323, 37107, 85, 16, 32280, 22589, 63, 429, 2487, 374, 279, 6236, 1681, 279, 6021, 46630, 279, 198, 2972, 594, 2487, 1119, 11, 537, 279, 2943, 594, 7112, 2487, 11, 773, 1378, 2943, 12859, 429, 14673, 311, 279, 1852, 6236, 1681, 633, 279, 1852, 198, 3365, 11, 323, 264, 2070, 279, 14458, 20978, 4344, 6857, 13, 17128, 279, 1376, 458, 877, 20945, 4302, 911, 279, 1681, 25, 38066, 198, 325, 288, 432, 4157, 1273, 264, 42068, 1681, 2348, 432, 13, 3216, 1638, 279, 3538, 26557, 264, 4194, 1376, 518, 20524, 323, 2581, 13905, 198, 269, 18392, 432, 11, 773, 264, 1681, 34315, 291, 311, 279, 1852, 4303, 3538, 5036, 1181, 6738, 279, 1852, 1616, 11, 72678, 476, 537, 11, 1393, 1283, 198, 64, 17005, 476, 389, 2441, 3538, 279, 1852, 1681, 5221, 1008, 14142, 13, 1752, 14142, 429, 3331, 3941, 17005, 82, 323, 12639, 11, 738, 198, 63, 51, 43957, 37, 7863, 56804, 3450, 6600, 8086, 63, 311, 264, 5792, 1034, 1172, 1181, 6372, 646, 1349, 476, 3270, 28552, 55895, 220, 103306, 32725, 9958, 518, 3245, 220, 101175, 198, 9647, 11, 369, 3110, 504, 1565, 53255, 10377, 481, 17287, 220, 101175, 76960, 825, 27654, 1555, 13382, 374, 537, 949, 315, 279, 1376, 11, 323, 1449, 3538, 198, 6154, 279, 1852, 1034, 6696, 279, 1852, 14142, 13, 362, 7402, 11, 59871, 480, 11, 10587, 11, 6094, 11, 23263, 476, 916, 220, 19, 29348, 33, 1034, 17906, 279, 198, 2468, 448, 279, 6243, 594, 829, 11, 323, 279, 1376, 5086, 374, 2581, 1349, 504, 279, 4573, 476, 279, 3210, 1555, 13, 10901, 12, 1713, 938, 198, 36059, 1212, 825, 1376, 4332, 14142, 11, 438, 264, 34315, 1558, 26, 2441, 1681, 476, 2441, 1618, 5221, 1008, 14142, 13, 362, 79817, 198, 63, 1688, 13420, 63, 1509, 594, 1565, 8315, 62, 63, 877, 374, 89780, 504, 1181, 1565, 6659, 842, 63, 279, 1852, 1616, 11, 13500, 72, 594, 14142, 525, 279, 24877, 279, 1614, 13905, 198, 5809, 6659, 62, 16, 63, 701, 323, 14142, 264, 2943, 21259, 1182, 304, 1181, 3840, 525, 22325, 438, 3208, 382, 1925, 279, 13020, 220, 15, 13, 21, 13, 21, 3538, 11, 448, 1565, 14163, 31798, 25, 330, 6279, 1, 7808, 476, 264, 729, 6941, 304, 1565, 14163, 31798, 7808, 279, 9846, 594, 4226, 320, 10689, 894, 1744, 2504, 198, 269, 3381, 5496, 8, 15873, 264, 1618, 311, 458, 8898, 5392, 13, 576, 3538, 40475, 279, 1156, 4226, 3950, 429, 4436, 944, 198, 1312, 35892, 448, 279, 5392, 58490, 34979, 28552, 154843, 7808, 476, 31017, 1728, 220, 19, 594, 30466, 91, 14163, 13420, 29, 32725, 323, 279, 3811, 594, 1467, 1573, 264, 198, 14163, 829, 11, 1221, 9977, 279, 829, 311, 279, 8898, 7375, 25, 264, 3950, 429, 10896, 1105, 374, 12569, 553, 279, 2732, 315, 279, 1156, 198, 1847, 12330, 829, 1181, 5326, 949, 8470, 13, 576, 3811, 594, 1828, 22325, 1618, 6696, 429, 1467, 13, 362, 6941, 729, 374, 279, 198, 3243, 5392, 279, 3811, 6081, 13, 8884, 5046, 13789, 1172, 389, 279, 11206, 1573, 432, 11, 773, 37759, 11, 6146, 323, 33870, 198, 8168, 3700, 3270, 279, 1852, 1618, 13, 576, 19577, 55, 4712, 26452, 11206, 4766, 1181, 19494, 26, 54443, 17906, 279, 4712, 518, 264, 5046, 323, 198, 8168, 2539, 389, 504, 279, 9846, 13, 576, 1614, 13905, 279, 5977, 26, 264, 78613, 1618, 4675, 438, 2213, 382, 565, 16125, 3073, 2550, 271, 1986, 14301, 16539, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 11, 1380, 569, 44819, 573, 2268, 306, 266, 14002, 6139, 32774, 2550, 304, 198, 66727, 99695, 9529, 2428, 1110, 5204, 905, 14, 988, 46109, 16714, 3805, 74937, 4322, 617, 14, 99695, 1215, 279, 1790, 14301, 14511, 279, 9862, 3538, 624, 11505, 1614, 389, 2176, 1182, 1412, 662, 48490, 1565, 2322, 8952, 63, 28552, 4913, 1313, 788, 330, 2236, 25293, 497, 330, 2236, 25293, 788, 5212, 17327, 788, 2503, 3417, 3989, 269, 1565, 4913, 1313, 788, 330, 2236, 5314, 1, 5541, 8, 323, 348, 4086, 44, 594, 1565, 64942, 9451, 7808, 1565, 64942, 41596, 7808, 1565, 64942, 31798, 7808, 1565, 64942, 62, 40864, 63, 320, 8263, 37868, 8, 323, 198, 63, 50807, 35015, 63, 28552, 2236, 7808, 1565, 2236, 5314, 7808, 1565, 26302, 7808, 1565, 11740, 63, 476, 1565, 40864, 63, 1648, 389, 279, 7401, 11, 323, 389, 54443, 448, 825, 476, 1378, 198, 24357, 3558, 11, 7484, 476, 1212, 1565, 313, 45824, 451, 28487, 1084, 3880, 856, 40864, 389, 279, 3538, 25, 1565, 51162, 4582, 364, 45832, 19923, 58, 40864, 30531, 7808, 892, 1083, 198, 6308, 5583, 7834, 11, 7401, 82, 5230, 13, 28464, 287, 26473, 389, 13, 13227, 1817, 10141, 4637, 279, 4712, 15092, 279, 63139, 279, 31297, 198, 46706, 82, 11, 1221, 26054, 1817, 9660, 2802, 594, 60362, 311, 279, 11206, 279, 31297, 6147, 1283, 429, 2802, 594, 1815, 11, 773, 264, 198, 443, 57333, 9846, 16801, 1181, 52951, 44731, 788, 895, 63, 9846, 323, 1181, 13520, 1598, 13, 9040, 69878, 19156, 279, 1852, 31297, 323, 6911, 198, 49410, 1828, 34744, 8146, 13, 3085, 7274, 389, 11, 279, 31297, 8470, 1283, 279, 1744, 835, 28552, 154842, 7808, 476, 31017, 1728, 220, 19, 594, 198, 63, 27, 10114, 91, 43376, 701, 323, 264, 7274, 8038, 594, 3265, 17906, 518, 429, 3950, 13, 576, 31297, 6147, 279, 835, 3950, 1172, 3055, 279, 897, 198, 285, 4583, 26, 264, 9846, 3931, 518, 1565, 2810, 28735, 63, 374, 31999, 11, 448, 1565, 30033, 38025, 25, 330, 4129, 1, 28487, 4718, 67630, 1561, 2138, 518, 1429, 198, 101175, 10108, 5766, 1948, 1378, 11206, 320, 32798, 41906, 287, 18275, 26, 264, 1598, 315, 10108, 5128, 1558, 537, 701, 773, 264, 1614, 4157, 5155, 198, 1199, 9846, 448, 36188, 4766, 458, 63163, 897, 382, 785, 9862, 3538, 662, 48490, 279, 1852, 5043, 448, 279, 1852, 67630, 1561, 1526, 1565, 2740, 8932, 40864, 7808, 264, 2613, 356, 62765, 916, 198, 87, 40864, 348, 15, 13, 17, 13, 23, 594, 356, 1027, 6733, 28552, 35188, 13428, 14, 40864, 5523, 69, 62, 40864, 27717, 58800, 17359, 37806, 8283, 432, 304, 1565, 2740, 14, 63, 29279, 1565, 6863, 14, 63, 369, 198, 11942, 3126, 6773, 102636, 11, 14330, 856, 102807, 62, 102636, 323, 14330, 264, 1113, 102636, 26, 504, 2530, 11, 1565, 35188, 1936, 31297, 481, 35, 87, 40864, 28, 12245, 63, 22056, 432, 504, 458, 856, 40864, 198, 85, 15, 13, 17, 13, 23, 27175, 28552, 12875, 14705, 1177, 17913, 348, 15, 13, 17, 13, 23, 1177, 75160, 325, 17940, 11520, 3703, 1110, 5204, 905, 59134, 66, 12, 2143, 10771, 40864, 32725, 1119, 198, 63, 35188, 9789, 74594, 8193, 63, 389, 66689, 11, 14330, 323, 5515, 13, 576, 3538, 5868, 304, 1565, 1244, 2740, 63, 29279, 1181, 7868, 11, 1221, 29279, 198, 275, 11, 1221, 389, 279, 16033, 594, 1815, 11, 323, 20861, 432, 518, 279, 1156, 32774, 1681, 26, 2041, 432, 11, 4297, 770, 17026, 323, 264, 198, 50807, 1681, 5221, 10125, 220, 102259, 13, 576, 9862, 21059, 10002, 3685, 28044, 3950, 31297, 1824, 26, 1008, 21059, 198, 1097, 810, 32774, 7388, 13, 28464, 287, 26473, 389, 25, 279, 63139, 279, 1968, 9977, 389, 279, 22611, 2525, 198, 1419, 311, 279, 3468, 1573, 1817, 10141, 11, 279, 31297, 15092, 279, 6174, 432, 59003, 323, 63139, 279, 1467, 432, 8436, 5086, 320, 64, 1376, 345, 85069, 40526, 701, 323, 1817, 2802, 594, 60362, 525, 41909, 1573, 1181, 4038, 11, 773, 37759, 11, 52951, 44731, 788, 895, 63, 323, 33870, 30517, 198, 546, 279, 1852, 382, 1925, 279, 9862, 3538, 11, 37107, 85, 16, 70793, 25016, 10814, 908, 63, 323, 37107, 85, 16, 32280, 22589, 63, 28065, 1565, 14163, 31798, 25, 330, 6279, 39700, 323, 264, 6941, 198, 1688, 448, 279, 4712, 594, 3950, 31297, 13, 12847, 5711, 1565, 4913, 1313, 3252, 1688, 2198, 1688, 22260, 606, 3252, 20973, 30849, 16890, 70213, 5711, 1565, 4913, 1313, 3252, 1688, 2198, 606, 3252, 20973, 1, 5541, 13, 8277, 8898, 7375, 525, 5420, 26, 458, 9783, 829, 476, 264, 2567, 198, 6659, 448, 902, 7375, 5221, 10125, 220, 102259, 13, 1565, 3902, 63, 8457, 10096, 11, 323, 1565, 6697, 63, 57211, 279, 7375, 382, 785, 53395, 4226, 5610, 825, 476, 803, 4583, 6738, 323, 902, 60276, 4889, 1105, 13, 27609, 1795, 279, 8898, 198, 16167, 10797, 13, 5588, 44, 5711, 1565, 154847, 63, 323, 1565, 154849, 63, 9488, 1283, 279, 729, 829, 624, 48, 16929, 11868, 323, 4718, 1618, 19873, 2506, 862, 85887, 13, 31017, 1728, 220, 19, 5711, 198, 63, 27, 91, 14163, 13420, 29, 6659, 25, 7535, 90, 1112, 70261, 14163, 13420, 91, 43376, 448, 4718, 5977, 11, 892, 279, 5392, 6729, 26261, 13, 1527, 95332, 3811, 198, 4776, 279, 42210, 1565, 154843, 4913, 606, 3252, 7535, 2198, 16356, 788, 90, 1112, 3417, 154844, 63, 1352, 13, 576, 9862, 31297, 13379, 198, 1312, 35892, 1948, 6738, 26, 1565, 45824, 22724, 45366, 25, 895, 63, 6147, 6896, 825, 13, 3085, 7274, 8967, 11, 279, 21517, 198, 65396, 1283, 279, 1744, 13061, 3950, 13, 362, 9846, 3931, 2805, 553, 1565, 2810, 28735, 63, 646, 7146, 31999, 323, 10330, 438, 1565, 4129, 18606, 49764, 287, 26473, 8967, 323, 5711, 279, 1852, 31297, 26054, 438, 14386, 46826, 382, 1986, 7460, 279, 6661, 19127, 594, 32774, 59112, 22245, 323, 1565, 2740, 8932, 40864, 28487, 61732, 50670, 11, 1207, 16929, 18, 13, 20, 12, 17, 33, 345, 48, 16929, 18, 13, 23, 12, 99951, 33, 28552, 80, 16929, 99951, 63, 701, 31017, 1728, 220, 19, 220, 100557, 33, 11, 14811, 12, 20, 11, 444, 25530, 17, 6050, 36, 323, 17242, 9292, 6094, 15692, 389, 19170, 614, 429, 22245, 26, 1207, 16929, 99951, 389, 15599, 1083, 702, 432, 624, 23809, 9292, 323, 31017, 1728, 220, 19, 389, 54443, 614, 432, 2238, 13, 31017, 1728, 220, 19, 389, 54443, 21841, 264, 55604, 2802, 1212, 264, 31297, 389, 279, 3468, 11, 4221, 279, 198, 20920, 11206, 315, 1181, 60362, 1349, 1182, 26, 48569, 6978, 525, 41909, 389, 279, 3671, 1573, 279, 4038, 624, 48, 16929, 18, 13, 23, 12, 99951, 33, 16772, 279, 31297, 311, 1181, 1156, 4038, 11, 1817, 23866, 2802, 323, 1817, 8868, 315, 1181, 9955, 24189, 624, 96638, 7388, 990, 1181, 6094, 21224, 6200, 11, 2670, 979, 279, 19083, 46379, 44547, 6146, 25184, 374, 8967, 624, 79638, 26484, 1824, 504, 1181, 6661, 19127, 594, 6911, 9700, 13, 5588, 44, 19170, 198, 5809, 41979, 9138, 343, 7808, 1565, 41979, 1737, 9078, 9138, 343, 32725, 36565, 429, 9700, 323, 24990, 2567, 9608, 3606, 11449, 1573, 9467, 448, 10125, 220, 102259, 11, 369, 3110, 510, 63, 20895, 364, 41979, 9138, 343, 6, 4157, 28065, 5392, 31798, 330, 6279, 1, 476, 264, 6941, 729, 25, 432, 702, 902, 3950, 31297, 1824, 26, 3624, 330, 3902, 1, 476, 330, 6697, 1, 18606, 785, 3538, 1558, 537, 49077, 2484, 264, 2567, 1618, 1119, 1565, 3902, 28487, 79158, 279, 31297, 6733, 1558, 537, 912, 264, 7402, 198, 20895, 6911, 9700, 13, 362, 7402, 6733, 476, 31297, 28570, 1465, 374, 1083, 16037, 1573, 9467, 448, 1181, 2874, 382, 785, 9862, 5588, 44, 54443, 19127, 1083, 11549, 3950, 67630, 1561, 11, 22827, 34744, 6978, 1573, 7077, 220, 15, 26054, 323, 26557, 382, 14364, 52531, 7375, 1212, 1565, 14163, 31798, 25, 330, 3902, 48651, 2354, 7375, 8898, 323, 1565, 14163, 31798, 63, 39227, 476, 52951, 3902, 1, 7808, 264, 5392, 12857, 52951, 6627, 788, 830, 63, 4766, 1565, 1688, 63, 374, 5644, 198, 983, 1181, 1565, 13777, 63, 10797, 979, 279, 19127, 702, 3950, 12, 40864, 1824, 323, 279, 31297, 6733, 20861, 13, 576, 9846, 1231, 387, 198, 20726, 1467, 476, 6738, 11, 323, 1467, 4889, 279, 1618, 40526, 374, 1910, 13, 27278, 264, 1618, 279, 829, 374, 825, 315, 279, 8898, 7375, 11, 264, 198, 6627, 5392, 594, 5977, 1969, 1795, 1181, 10797, 11, 323, 264, 5392, 537, 12857, 7304, 4990, 894, 4718, 1633, 624, 63, 45824, 22724, 45366, 25, 895, 63, 6147, 825, 1618, 26, 17972, 476, 1565, 1866, 63, 6147, 3807, 13, 8976, 2581, 7460, 264, 1618, 25, 264, 1467, 15370, 198, 20987, 374, 537, 458, 1465, 13, 12847, 16197, 279, 7375, 1526, 26, 79817, 10988, 279, 5392, 594, 1909, 11586, 1565, 6627, 63, 1119, 1565, 1688, 18606, 61271, 43684, 26643, 7375, 6777, 902, 1565, 6627, 63, 5181, 11, 773, 807, 525, 5644, 1172, 979, 279, 3398, 3685, 374, 389, 382, 63, 51, 43957, 37, 7863, 56804, 17848, 1402, 60237, 28, 16, 63, 9977, 1449, 3233, 7375, 1681, 279, 1852, 1616, 25, 1817, 8898, 5392, 594, 5977, 1969, 1795, 198, 1199, 10797, 11, 12857, 7304, 476, 537, 13, 8277, 279, 897, 1565, 16, 63, 10572, 432, 389, 11, 448, 39104, 12615, 2163, 432, 12030, 26, 17972, 11, 4287, 345, 63, 15, 63, 323, 894, 1008, 1467, 5274, 432, 1007, 11, 323, 6857, 315, 1846, 374, 16037, 518, 20524, 13, 1230, 746, 374, 279, 1638, 13, 576, 3398, 198, 391, 7202, 1172, 311, 3233, 25, 1565, 6279, 63, 323, 264, 6941, 729, 2669, 79059, 279, 9846, 311, 10797, 84114, 6738, 11, 773, 432, 198, 19329, 4302, 1052, 13, 10962, 279, 19127, 36565, 3950, 12, 40864, 1824, 476, 279, 31297, 6733, 1558, 537, 2795, 11, 458, 3233, 198, 2035, 374, 10218, 24986, 57333, 4751, 1091, 16037, 26, 279, 1565, 6279, 63, 323, 6941, 5048, 304, 429, 2309, 525, 16037, 198, 14790, 9467, 448, 10125, 220, 102259, 323, 279, 19127, 594, 476, 6733, 594, 2874, 11, 438, 7481, 3403, 13, 362, 7304, 3233, 31297, 198, 87, 40864, 4157, 19156, 374, 1083, 16037, 1573, 9467, 448, 10125, 220, 102259, 11, 369, 3110, 510, 63, 6627, 7375, 1212, 5392, 31798, 330, 3902, 1, 389, 19127, 364, 80, 16929, 99951, 1210, 279, 31297, 4157, 387, 44064, 25, 366, 87, 40864, 594, 2874, 29, 18606, 22550, 44, 17, 594, 3811, 13905, 1181, 6738, 438, 825, 468, 15582, 37, 5912, 4751, 1091, 264, 22064, 4772, 11, 773, 7304, 7375, 1212, 3233, 525, 537, 198, 40864, 57116, 1052, 382, 785, 19551, 1565, 10803, 1557, 17777, 102340, 56804, 17848, 1402, 60237, 63, 829, 4990, 1565, 15, 63, 476, 1565, 16, 28487, 3197, 1565, 51, 43957, 37, 7863, 56804, 17848, 1402, 60237, 63, 374, 738, 11, 1496, 311, 458, 4287, 198, 957, 11, 432, 374, 1349, 4518, 323, 279, 19551, 829, 374, 12030, 11, 1496, 421, 279, 19551, 897, 374, 78613, 13, 362, 78613, 19551, 198, 957, 2041, 429, 2812, 18392, 279, 11660, 1352, 518, 1191, 323, 41848, 448, 2639, 220, 16, 11, 369, 3110, 510, 63, 10803, 1557, 17777, 102340, 56804, 17848, 1402, 60237, 428, 1866, 788, 3601, 220, 15, 476, 220, 16, 320, 58069, 1393, 350, 43957, 37, 7863, 56804, 17848, 1402, 60237, 374, 738, 45907, 382, 63, 40864, 68365, 25, 830, 63, 320, 29624, 3538, 11, 1007, 553, 1638, 8, 13589, 264, 53395, 9846, 1907, 2005, 2878, 1181, 3950, 3930, 11, 773, 198, 64, 2567, 5392, 1618, 476, 264, 4718, 897, 3931, 553, 1565, 2810, 28735, 63, 2058, 70303, 13, 13227, 1817, 4038, 11, 264, 3950, 374, 41909, 979, 902, 198, 21269, 4002, 1283, 432, 24417, 264, 1992, 1380, 279, 31297, 1410, 835, 2878, 279, 26557, 2115, 28552, 2810, 28735, 7808, 29877, 1283, 198, 1782, 1744, 2504, 979, 279, 3538, 29389, 7274, 11206, 7797, 432, 1215, 279, 1760, 5646, 429, 3950, 323, 31606, 279, 1992, 198, 2870, 279, 835, 3950, 9041, 5420, 438, 4583, 11, 773, 264, 1618, 429, 33090, 389, 279, 1537, 3950, 646, 2058, 6248, 438, 198, 63, 4129, 28487, 58013, 2297, 1172, 1380, 279, 8038, 57095, 25, 264, 3950, 374, 41909, 1172, 979, 1449, 9750, 1283, 432, 1035, 198, 1975, 6108, 11, 773, 279, 9846, 16801, 1181, 1565, 40864, 68365, 25, 895, 63, 9846, 3950, 369, 3950, 705, 311, 279, 1156, 4038, 1380, 279, 3930, 198, 7666, 82, 13, 576, 6911, 13789, 1172, 389, 279, 31297, 594, 1992, 323, 279, 11206, 2115, 11, 773, 198, 44731, 291, 11, 52951, 44731, 788, 895, 63, 323, 33870, 30517, 4717, 279, 1852, 448, 432, 389, 13, 3197, 1565, 2810, 28735, 63, 374, 2669, 3685, 279, 198, 40864, 594, 38932, 9846, 11, 279, 6911, 374, 537, 9248, 323, 279, 9846, 374, 3931, 438, 2041, 432, 13, 576, 1156, 1681, 369, 264, 31297, 198, 67735, 416, 1181, 6729, 5302, 916, 279, 45681, 594, 11206, 320, 263, 279, 1681, 4516, 11, 1221, 8603, 369, 279, 1537, 8062, 67630, 1561, 317, 64, 31297, 448, 803, 1091, 220, 99317, 11, 100919, 19, 1741, 5302, 374, 1172, 41909, 1380, 1181, 34857, 5302, 10274, 432, 11, 2581, 7797, 1128, 198, 874, 694, 2338, 13, 17978, 5503, 374, 1083, 7199, 553, 264, 8355, 3311, 315, 975, 11, 29877, 304, 6729, 323, 3950, 7354, 4751, 1091, 882, 11, 773, 198, 1782, 1852, 31297, 5221, 279, 1852, 4226, 389, 1449, 5662, 323, 1212, 894, 2795, 13, 576, 3930, 374, 911, 220, 116265, 3039, 1128, 198, 63, 2236, 5314, 63, 4990, 916, 264, 220, 104836, 11, 99752, 34668, 34744, 26, 264, 31297, 3267, 432, 5221, 10125, 220, 102259, 429, 5036, 279, 3930, 11, 323, 374, 2581, 198, 80871, 304, 949, 13, 1084, 374, 1083, 16037, 448, 10125, 220, 102259, 979, 279, 6661, 1565, 2740, 8932, 40864, 63, 4162, 973, 432, 11, 323, 369, 67630, 1561, 448, 198, 5839, 11586, 11, 8038, 291, 11, 16987, 476, 2115, 12, 49195, 5601, 13, 576, 26054, 1795, 504, 856, 40864, 594, 4922, 11586, 4715, 26, 448, 198, 81583, 389, 807, 1191, 1283, 279, 1744, 835, 382, 9227, 220, 102259, 4041, 1573, 894, 3950, 369, 264, 78613, 2070, 11, 264, 31297, 856, 40864, 4157, 19156, 320, 4197, 856, 40864, 594, 2874, 701, 264, 198, 4030, 2041, 856, 40864, 320, 4197, 279, 4582, 3210, 26, 389, 279, 9862, 3538, 11, 264, 3538, 429, 4157, 2795, 1565, 2740, 8932, 40864, 89004, 64, 31297, 3208, 448, 1565, 14163, 31798, 25, 330, 6279, 39700, 476, 264, 6941, 729, 13, 362, 9846, 6693, 198, 40864, 14515, 1393, 46826, 10330, 448, 10125, 220, 100840, 320, 276, 1465, 1538, 979, 16824, 1215, 279, 1008, 7388, 728, 389, 382, 565, 26673, 287, 271, 20754, 37107, 85, 16, 20227, 63, 10690, 323, 40164, 2924, 1565, 93598, 13668, 15724, 27559, 28487, 1084, 374, 830, 979, 11459, 7274, 1007, 198, 285, 7248, 369, 264, 4285, 1467, 6236, 553, 279, 6350, 3811, 3398, 476, 9467, 66692, 21901, 11, 476, 279, 45681, 702, 198, 2152, 7274, 34292, 11129, 13, 576, 3538, 27535, 432, 3055, 518, 20524, 553, 20852, 264, 4285, 6236, 1526, 279, 1852, 1007, 1779, 198, 36059, 990, 26, 1817, 1681, 2058, 26175, 1181, 1828, 22325, 9249, 13, 1084, 374, 895, 369, 264, 16037, 21678, 476, 264, 1614, 2041, 198, 1318, 9467, 13, 61190, 8238, 1349, 419, 2699, 3055, 323, 50709, 279, 1007, 2070, 979, 432, 374, 895, 11, 59817, 438, 279, 1614, 198, 2258, 13, 21641, 18306, 74309, 279, 1007, 1681, 11, 59817, 1565, 1847, 11218, 320, 359, 20990, 8, 28487, 576, 8650, 198, 63, 93598, 13668, 15724, 8190, 45835, 63, 2699, 374, 895, 979, 902, 7274, 34292, 11129, 6724, 26, 8238, 1221, 1895, 198, 63, 1921, 8414, 63, 323, 3624, 902, 7274, 2070, 13, 18154, 39138, 19588, 19, 1993, 594, 9862, 23602, 702, 1181, 1828, 7274, 3398, 320, 81583, 1007, 198, 1412, 279, 9929, 448, 30466, 105617, 71157, 105617, 29, 154842, 63, 701, 773, 1181, 11459, 1007, 374, 2581, 16037, 382, 1925, 2176, 1182, 1412, 11, 1565, 19857, 287, 51604, 371, 25, 6857, 63, 17045, 279, 6236, 3811, 311, 11151, 7274, 26, 458, 11459, 1007, 1681, 198, 4216, 10125, 220, 102259, 979, 279, 3811, 4157, 15657, 432, 13, 8277, 458, 1007, 2070, 279, 2943, 21259, 374, 11459, 25, 1565, 313, 2152, 98112, 12885, 1782, 3811, 594, 1828, 1638, 323, 279, 26643, 6021, 594, 1638, 1007, 2581, 525, 13, 6944, 5041, 2750, 7283, 7274, 198, 437, 5545, 279, 6236, 3811, 13, 576, 3538, 1083, 15792, 432, 504, 1565, 9682, 8692, 36052, 57309, 287, 51604, 371, 7808, 1380, 348, 4086, 44, 594, 198, 31734, 3624, 432, 26, 279, 1909, 11586, 2070, 14805, 13, 1527, 52425, 2188, 14034, 311, 279, 23415, 2188, 279, 3811, 5036, 11, 323, 264, 18103, 4990, 198, 1782, 5080, 825, 13, 5588, 44, 12, 20, 13, 18, 11464, 1565, 10298, 7808, 1565, 11886, 63, 323, 1565, 2810, 7808, 773, 1565, 2810, 63, 26473, 1565, 2810, 7808, 1565, 26005, 63, 374, 6617, 438, 1565, 11886, 3989, 437, 1565, 91828, 63, 438, 1565, 10298, 28487, 1207, 16929, 18, 13, 23, 11464, 1565, 10298, 7808, 1565, 26005, 63, 323, 1565, 87, 11886, 7808, 773, 1565, 11886, 63, 323, 1565, 2810, 63, 525, 6617, 438, 1565, 87, 11886, 18606, 63, 87, 11886, 63, 26473, 1565, 87, 11886, 28487, 5588, 44, 12, 20, 13, 18, 44026, 1565, 87, 11886, 63, 323, 1565, 2810, 63, 438, 7487, 13, 362, 3811, 429, 5036, 902, 2188, 51718, 1565, 2810, 63, 438, 198, 63, 87, 11886, 28487, 1565, 313, 19857, 287, 52021, 371, 63, 26261, 1565, 91828, 7808, 1565, 10298, 7808, 1565, 26005, 7808, 1565, 11886, 7808, 1565, 87, 11886, 63, 323, 1565, 2810, 63, 323, 5711, 279, 1852, 5912, 26, 990, 1565, 313, 2152, 98112, 63, 369, 279, 39065, 1007, 3398, 13, 1527, 39227, 5041, 11, 448, 902, 20524, 5181, 11, 26473, 198, 1782, 3811, 594, 1828, 1638, 13, 1527, 11459, 1565, 9682, 8692, 36052, 28595, 5854, 15724, 63, 4990, 198, 26071, 763, 13, 362, 1681, 2041, 458, 5041, 5221, 1565, 313, 19857, 287, 52021, 371, 63, 979, 279, 3538, 572, 3855, 448, 825, 26, 5937, 198, 1782, 3811, 44026, 1181, 1828, 1638, 11, 438, 348, 4086, 44, 323, 74813, 2852, 76, 3141, 432, 320, 48, 16929, 18, 13, 23, 594, 374, 1565, 87, 11886, 7808, 892, 11362, 458, 7600, 198, 983, 279, 1849, 9929, 26, 1565, 26005, 63, 11362, 6857, 568, 11727, 1182, 1412, 3141, 279, 1852, 9929, 369, 279, 1852, 1681, 624, 46301, 371, 1824, 13789, 389, 279, 29186, 594, 3811, 11, 323, 5041, 1558, 537, 738, 264, 198, 5839, 8038, 13, 3085, 7274, 1007, 11, 9862, 16197, 279, 3811, 1172, 458, 5041, 279, 1681, 5086, 5036, 320, 1199, 198, 63, 19857, 287, 51604, 371, 7808, 1008, 1091, 1565, 6697, 63, 1215, 1565, 313, 19857, 287, 52021, 371, 63, 2581, 24417, 264, 7274, 12456, 9929, 11, 323, 448, 902, 6941, 198, 6445, 371, 432, 16197, 6857, 11, 438, 1573, 13, 2055, 264, 5588, 44, 12, 20, 13, 18, 1681, 646, 3624, 1565, 19857, 287, 51604, 371, 25, 330, 11886, 39700, 29279, 198, 63, 9682, 8692, 36052, 28595, 5854, 15724, 25, 895, 63, 320, 269, 1565, 81583, 25, 895, 32725, 311, 3141, 1565, 25062, 287, 29905, 371, 25, 5124, 63, 4518, 315, 279, 198, 4214, 594, 7487, 1968, 26, 1207, 16929, 18, 13, 23, 594, 3811, 15792, 279, 5041, 1172, 1393, 7274, 11, 773, 1181, 7274, 12456, 9929, 374, 34684, 624, 785, 9846, 594, 1565, 45832, 19923, 57309, 287, 51604, 371, 63, 5036, 279, 5041, 279, 3811, 6617, 28552, 6697, 63, 979, 432, 6617, 6857, 4292, 2679, 279, 3811, 594, 9467, 9249, 10330, 198, 258, 264, 3175, 1565, 154841, 63, 3950, 11, 9862, 906, 1412, 279, 3175, 1565, 154842, 63, 3950, 11, 9376, 458, 4287, 1744, 2504, 13, 1096, 13460, 198, 3825, 44, 12, 20, 13, 18, 323, 444, 25530, 17, 19873, 2041, 862, 1828, 1007, 3398, 13, 6944, 3811, 1467, 26473, 34684, 25, 5588, 44, 12, 20, 13, 18, 594, 198, 63, 25062, 287, 29905, 371, 63, 1968, 26473, 438, 279, 3811, 13905, 432, 11, 323, 458, 9011, 5588, 44, 12, 20, 13, 18, 3811, 2058, 13905, 1181, 1638, 198, 63, 25062, 287, 29905, 371, 25, 7487, 63, 1555, 13, 576, 5880, 13020, 220, 15, 13, 21, 13, 21, 4712, 4518, 312, 58671, 5588, 44, 594, 3141, 369, 264, 902, 98112, 198, 2035, 1959, 1181, 1565, 81583, 13642, 63, 29806, 279, 1565, 25062, 287, 29905, 371, 63, 1968, 323, 33090, 279, 2504, 7381, 1959, 773, 1181, 902, 98112, 198, 24394, 12748, 525, 220, 21, 311, 220, 22, 11206, 23263, 1091, 9862, 594, 389, 279, 1852, 1681, 28976, 98729, 16, 16, 16859, 264, 1849, 22873, 8693, 9929, 518, 220, 99241, 198, 30446, 22325, 11, 220, 99317, 389, 279, 13020, 4712, 11, 323, 220, 99619, 389, 9862, 568, 362, 9929, 1760, 11, 264, 6500, 1376, 476, 264, 8603, 1584, 504, 825, 198, 8511, 8913, 1558, 537, 2432, 279, 1008, 594, 369, 1565, 12546, 5854, 15724, 25, 895, 28487, 5588, 44, 12, 20, 13, 18, 13589, 1449, 6788, 17821, 198, 412, 594, 32559, 304, 279, 9929, 11, 438, 1147, 2143, 70644, 594, 3811, 1558, 553, 198, 2258, 28552, 7422, 5854, 15724, 63, 895, 701, 1083, 389, 66720, 6693, 3811, 2058, 56217, 432, 1573, 279, 1537, 1196, 1943, 11, 773, 198, 64, 501, 1196, 1943, 10896, 279, 6788, 10572, 6, 11206, 11, 323, 862, 8603, 9929, 5302, 11, 438, 807, 1033, 13, 576, 9862, 3538, 198, 70, 1886, 279, 3811, 1565, 7422, 5854, 15724, 63, 895, 389, 1449, 3141, 11, 323, 1565, 10803, 2646, 10989, 39068, 10620, 11631, 1718, 28, 16, 63, 7289, 432, 830, 369, 279, 3538, 345, 1499, 569, 44, 685, 15457, 8124, 370, 594, 83013, 99619, 21, 9529, 2428, 1110, 5204, 905, 14, 988, 46109, 16714, 3805, 74937, 4322, 617, 14, 99619, 21, 1215, 894, 897, 714, 220, 15, 476, 220, 16, 40393, 311, 2795, 13, 362, 198, 2035, 594, 1565, 9682, 8692, 36052, 7426, 5854, 15724, 63, 320, 1866, 476, 895, 8, 35279, 279, 3538, 594, 6243, 369, 429, 1681, 11, 438, 279, 198, 2528, 3701, 68471, 1565, 1866, 63, 369, 14386, 6236, 26, 894, 1008, 897, 374, 264, 220, 102259, 11, 323, 1008, 8520, 6, 19873, 2581, 5258, 432, 382, 32, 5392, 1618, 5326, 1573, 279, 1744, 2504, 33090, 374, 279, 9846, 594, 5392, 1618, 979, 279, 9846, 10330, 4766, 279, 2504, 345, 263, 2176, 1182, 1412, 26, 279, 32559, 17906, 1380, 279, 1618, 8470, 11, 323, 72678, 32559, 2581, 23313, 279, 1618, 594, 40526, 624, 32, 4583, 1618, 518, 279, 835, 315, 32559, 374, 1083, 5927, 979, 279, 1744, 34292, 11129, 11012, 323, 279, 4226, 374, 198, 3194, 476, 36188, 13, 5976, 16824, 11, 1846, 6738, 4717, 5644, 3080, 279, 9846, 10330, 13, 3197, 279, 2504, 33090, 11, 264, 1618, 198, 18527, 291, 553, 803, 32559, 476, 264, 2477, 3194, 4226, 26473, 32559, 382, 63, 81583, 68365, 63, 320, 1782, 1681, 594, 26, 27122, 476, 220, 15, 4990, 1565, 313, 81583, 93955, 32725, 40475, 279, 9846, 594, 8038, 7563, 3950, 345, 3472, 432, 374, 2058, 7274, 11, 448, 264, 38817, 11, 279, 15304, 1744, 11129, 323, 264, 10108, 1555, 11, 1221, 9535, 279, 4226, 624, 785, 3931, 13789, 389, 3950, 1760, 11, 773, 6146, 323, 37759, 46826, 990, 279, 1852, 3931, 13, 362, 1614, 429, 33090, 279, 2504, 198, 682, 5623, 374, 2115, 7484, 13, 576, 19577, 55, 4712, 8436, 279, 3265, 4766, 1181, 19494, 26, 54443, 17906, 279, 4712, 518, 279, 3931, 323, 198, 8168, 2539, 389, 504, 279, 9846, 11, 438, 369, 264, 2567, 5392, 1618, 13, 17242, 9292, 8436, 432, 4766, 1181, 22611, 23999, 19494, 11, 389, 825, 7401, 198, 437, 304, 4628, 5239, 3856, 382, 2354, 7274, 8967, 11, 279, 9862, 3538, 40393, 264, 6785, 8038, 448, 10125, 220, 102259, 1573, 8567, 264, 4269, 476, 198, 5955, 1280, 279, 1681, 421, 279, 4712, 1558, 537, 1824, 7274, 41150, 13, 1096, 1083, 16772, 311, 264, 6785, 198, 63, 313, 81583, 93955, 63, 26902, 553, 458, 27122, 476, 7168, 1681, 2070, 13, 3085, 902, 6785, 8038, 11, 7388, 7146, 2697, 198, 263, 1846, 21059, 26, 448, 7274, 8385, 11, 279, 8038, 374, 537, 9248, 382, 63, 313, 81583, 11583, 5852, 451, 63, 320, 1847, 553, 1638, 8, 13589, 264, 2943, 594, 1565, 2810, 28735, 63, 369, 279, 4226, 979, 7274, 374, 389, 13, 576, 198, 4030, 11362, 451, 311, 279, 9846, 594, 3930, 11, 59728, 553, 279, 2266, 3241, 11, 323, 279, 4712, 10330, 279, 9846, 979, 279, 11206, 198, 10689, 279, 15304, 1744, 11129, 5545, 279, 1681, 594, 1565, 2810, 28735, 63, 28552, 30033, 38025, 63, 1565, 4129, 58800, 26673, 287, 23263, 1091, 198, 45, 10896, 279, 4226, 1181, 2480, 1565, 2810, 28735, 76960, 5021, 32559, 14569, 2348, 432, 13, 25937, 21059, 3796, 432, 26, 389, 1008, 198, 826, 1543, 11, 323, 448, 7274, 8385, 11, 1565, 2810, 28735, 63, 13379, 279, 4361, 9846, 438, 1573, 382, 785, 9862, 1565, 313, 10493, 92201, 63, 5181, 374, 1007, 553, 1638, 323, 31627, 1172, 458, 1787, 1744, 2504, 13, 1084, 33090, 264, 11499, 4734, 198, 21569, 315, 518, 1429, 8062, 11206, 1283, 220, 116265, 38962, 9068, 11, 979, 279, 16492, 5537, 8470, 518, 3245, 220, 102636, 9846, 11206, 198, 258, 13, 1084, 1083, 33090, 264, 5021, 21038, 11499, 2739, 54382, 25, 3055, 264, 4168, 315, 11621, 11206, 476, 803, 702, 11499, 304, 2480, 323, 198, 1958, 518, 3245, 220, 16, 11, 15, 99590, 11206, 11, 279, 4168, 1730, 504, 1380, 279, 32559, 594, 1537, 220, 101175, 34668, 1598, 10012, 1573, 13, 576, 9846, 198, 21269, 1137, 1283, 279, 9571, 3265, 11, 323, 6682, 1565, 22198, 44094, 25, 5212, 19268, 788, 451, 5541, 5519, 1565, 10493, 28, 19268, 37498, 63, 304, 279, 3538, 1487, 13, 576, 9862, 4712, 40393, 279, 5181, 389, 1182, 1412, 429, 653, 537, 28065, 432, 11, 323, 23408, 429, 42906, 438, 198, 64, 20524, 1465, 382, 63, 313, 10493, 92201, 40980, 63, 320, 1847, 553, 1638, 26, 432, 10572, 389, 1565, 313, 10493, 92201, 32725, 10330, 279, 9846, 1380, 279, 7616, 26003, 4518, 13, 576, 4712, 198, 58671, 902, 9571, 3265, 323, 902, 4226, 25, 279, 4269, 32879, 518, 279, 3950, 429, 13886, 11, 323, 1181, 21224, 323, 53231, 525, 5880, 198, 300, 369, 894, 8059, 9846, 13, 576, 9846, 23313, 279, 32559, 773, 3041, 304, 1565, 19857, 287, 7495, 7808, 4287, 1565, 1796, 63, 323, 902, 198, 63, 14163, 45366, 7808, 323, 1493, 15411, 264, 2943, 646, 1160, 389, 1447, 12, 1565, 30033, 38025, 63, 374, 1565, 1796, 8726, 7808, 279, 5264, 15457, 897, 369, 264, 9846, 279, 3538, 9478, 1573, 1181, 4226, 11, 892, 8238, 198, 220, 429, 1779, 279, 897, 2348, 5264, 15457, 594, 1140, 4193, 26, 432, 374, 13857, 1565, 14163, 45366, 63, 6329, 1565, 4129, 7808, 773, 432, 17045, 902, 2943, 311, 198, 220, 1598, 6738, 476, 3060, 264, 3931, 9846, 624, 12, 1565, 22198, 44094, 63, 374, 1565, 4913, 19268, 788, 451, 11, 330, 89121, 788, 830, 5541, 323, 279, 3538, 1487, 4933, 1565, 30033, 28, 1796, 8726, 6337, 28, 19268, 37498, 18606, 12, 576, 1465, 1633, 1565, 4913, 1994, 788, 38505, 497, 330, 1313, 788, 330, 4030, 4096, 497, 330, 903, 788, 845, 11, 330, 1851, 788, 330, 19857, 287, 17178, 1, 5541, 25, 264, 4361, 6236, 198, 220, 476, 9750, 9846, 320, 9227, 220, 98867, 8, 23313, 432, 438, 264, 1909, 11586, 1565, 841, 63, 29279, 1565, 24713, 76960, 264, 4269, 21259, 432, 438, 458, 198, 220, 1565, 4913, 841, 788, 2503, 5541, 1538, 1283, 279, 6248, 11873, 323, 1181, 10426, 11, 1221, 77021, 69871, 60, 7808, 773, 5264, 15457, 594, 26537, 82, 4828, 432, 1283, 279, 198, 220, 32559, 11460, 624, 12, 37107, 85, 16, 32280, 22589, 63, 30517, 448, 1565, 2829, 25, 330, 258, 14727, 39700, 323, 1565, 258, 14727, 13252, 25, 5212, 19857, 788, 330, 1796, 8726, 1, 5541, 320, 4027, 291, 510, 220, 1565, 2322, 1858, 14727, 63, 701, 1181, 2550, 279, 32559, 1509, 7484, 26, 37107, 85, 16, 71206, 63, 30517, 448, 1565, 9491, 38025, 25, 330, 1097, 35239, 39700, 382, 35120, 448, 7375, 476, 32774, 2550, 835, 279, 1852, 1616, 25, 279, 7616, 31627, 1172, 279, 1744, 2504, 11, 773, 902, 1618, 374, 8927, 198, 437, 902, 31297, 8470, 13, 576, 6243, 374, 279, 3538, 594, 25, 264, 1681, 4157, 2484, 432, 389, 476, 1007, 13, 17128, 432, 11, 30517, 525, 198, 3185, 3726, 382, 565, 9604, 323, 5975, 271, 785, 22325, 9929, 323, 4591, 9846, 1969, 4946, 279, 7373, 2266, 13, 758, 220, 15, 13, 18, 13, 20, 11, 458, 11459, 1565, 2810, 28735, 3989, 269, 1565, 2810, 59746, 28735, 63, 429, 1035, 2182, 9929, 5519, 9846, 7797, 279, 3241, 374, 17526, 448, 14569, 198, 437, 26262, 18788, 1573, 9467, 13, 19577, 55, 4675, 10125, 220, 102259, 369, 2477, 38515, 291, 7388, 476, 458, 198, 63, 11802, 7893, 4096, 63, 1538, 1283, 8567, 264, 4269, 13, 54443, 4675, 10125, 220, 102259, 1573, 8567, 264, 4269, 624, 785, 220, 15, 13, 18, 13, 19, 13, 16, 19577, 55, 3538, 59728, 429, 11459, 3930, 311, 279, 9660, 2266, 624, 32, 9929, 429, 10896, 902, 3054, 369, 264, 9846, 374, 16037, 279, 1852, 1616, 11, 323, 389, 2176, 1182, 1412, 1449, 1741, 42906, 198, 6918, 4019, 5264, 15457, 594, 1565, 2147, 5118, 2702, 93415, 63, 2038, 11, 279, 2070, 432, 374, 911, 304, 1565, 903, 63, 28552, 16311, 63, 369, 264, 6236, 9750, 345, 63, 40358, 63, 369, 264, 9750, 701, 323, 264, 1943, 429, 8470, 330, 1986, 3538, 594, 7192, 2266, 3084, 374, 451, 11206, 497, 773, 8238, 198, 9030, 16812, 264, 10430, 389, 429, 1465, 653, 773, 13, 1527, 2168, 9929, 429, 51515, 3267, 279, 3241, 374, 16037, 279, 1852, 198, 3117, 11, 323, 773, 525, 5588, 44, 12, 20, 13, 18, 594, 1828, 2266, 2053, 355, 1127, 389, 54443, 624, 4498, 279, 1681, 7861, 1199, 279, 9846, 3930, 11, 279, 3538, 2058, 18536, 1181, 19718, 1638, 311, 279, 9660, 2266, 624, 79638, 4675, 10125, 220, 102259, 1573, 9467, 979, 279, 6236, 3811, 59003, 279, 1681, 476, 198, 63, 9682, 8692, 36052, 63, 374, 13857, 458, 1633, 6329, 845, 13, 362, 9467, 1465, 4675, 10125, 220, 100840, 369, 264, 198, 6280, 38515, 291, 1681, 26, 1283, 264, 4269, 15873, 11, 2176, 1182, 1412, 3624, 458, 1465, 1538, 315, 943, 1565, 4030, 4096, 12885, 3391, 77021, 69871, 60, 28487, 1913, 1378, 54443, 20757, 11, 892, 1172, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 8472, 11, 1741, 458, 1465, 646, 5274, 279, 20757, 700, 198, 1055, 3019, 11, 773, 17005, 2176, 25, 279, 220, 99951, 33, 594, 198, 63, 313, 45824, 63, 24477, 40393, 1449, 2937, 1681, 3080, 1221, 11, 323, 279, 1008, 1378, 3795, 1180, 21059, 1513, 944, 11135, 432, 624, 2668, 55, 1083, 12335, 27259, 4938, 1573, 855, 7559, 13, 54443, 12335, 1181, 20164, 6500, 8653, 323, 1614, 3241, 624, 32, 20524, 8653, 16031, 374, 537, 264, 16859, 4879, 8653, 382, 1925, 264, 42446, 63637, 22611, 320, 1782, 49953, 55, 26382, 594, 18831, 98668, 701, 279, 54443, 3538, 594, 69124, 2525, 700, 315, 279, 3468, 594, 21984, 714, 525, 537, 198, 36769, 311, 264, 5476, 594, 4938, 3930, 28552, 28546, 1598, 1177, 17248, 7808, 272, 4074, 1565, 17248, 6678, 63, 1648, 279, 3930, 13857, 18536, 279, 198, 2528, 594, 14314, 323, 6500, 6329, 13589, 1105, 504, 9273, 6968, 1008, 975, 389, 279, 5662, 13, 576, 20524, 8038, 374, 279, 3468, 594, 198, 63, 18783, 16470, 63, 2686, 264, 20456, 320, 64, 55292, 315, 21984, 11, 518, 3245, 220, 19, 15380, 33, 568, 1913, 9862, 54443, 264, 4269, 594, 3241, 374, 1565, 313, 2147, 7808, 279, 198, 2528, 594, 1828, 3241, 518, 1565, 313, 2147, 220, 15, 7808, 476, 11, 979, 432, 374, 17972, 11, 279, 2997, 594, 1638, 59728, 518, 279, 1614, 594, 1828, 3241, 26, 389, 198, 1782, 281, 3279, 8520, 279, 22983, 323, 6816, 1221, 5155, 279, 8038, 705, 311, 279, 22983, 6, 11025, 5519, 279, 6500, 594, 6816, 11, 773, 198, 13176, 1846, 12482, 432, 11, 279, 1910, 4938, 1283, 2795, 374, 279, 20456, 13, 2014, 5274, 3054, 369, 1008, 23786, 11, 1191, 279, 3538, 198, 4197, 264, 9152, 1565, 313, 2147, 63, 476, 1565, 313, 45824, 18606, 63, 51, 43957, 37, 7863, 29931, 10978, 75475, 2646, 3256, 63, 40475, 429, 20456, 320, 266, 3245, 220, 17, 15380, 33, 8, 979, 498, 1414, 279, 5662, 594, 1968, 2966, 25, 264, 8130, 198, 603, 10896, 803, 369, 1008, 975, 11, 264, 9152, 825, 803, 369, 83952, 53231, 13, 576, 20456, 1083, 23313, 54443, 2266, 11, 20020, 3140, 323, 198, 42664, 4938, 279, 16031, 1558, 537, 1760, 11, 323, 78222, 264, 42446, 22611, 594, 4938, 646, 29814, 279, 3468, 11, 773, 4722, 432, 198, 3243, 448, 3054, 311, 23796, 382, 1925, 264, 42934, 3701, 320, 276, 10630, 55, 220, 99064, 24, 15, 11, 458, 362, 99457, 8, 279, 8038, 374, 279, 3701, 594, 1828, 1910, 4938, 11, 438, 279, 5579, 6682, 432, 11, 2686, 264, 198, 56602, 315, 264, 220, 101175, 303, 315, 279, 3701, 323, 518, 3245, 220, 16, 15380, 33, 11, 323, 279, 3119, 374, 279, 1852, 13, 1565, 51, 43957, 37, 7863, 29931, 10978, 75475, 2646, 3256, 63, 7289, 429, 198, 603, 504, 220, 15, 13, 20, 15380, 33, 705, 382, 2354, 6816, 11, 279, 3119, 4990, 279, 4712, 594, 1828, 3241, 1156, 11, 1221, 1817, 1008, 4269, 594, 8355, 949, 11, 1221, 279, 9929, 6500, 510, 64, 6941, 1565, 313, 40358, 36489, 2371, 579, 63, 4041, 1573, 1449, 3241, 714, 279, 4712, 594, 1828, 11, 323, 458, 52425, 825, 1283, 279, 4361, 198, 26989, 279, 8038, 9977, 11, 4279, 315, 1128, 807, 5274, 714, 518, 3245, 220, 99317, 15380, 33, 323, 518, 1429, 678, 315, 432, 13, 1913, 5588, 44, 448, 198, 63, 10803, 10097, 53, 68420, 63, 6941, 323, 279, 6500, 52425, 11, 279, 8603, 5302, 6, 15699, 11, 1565, 10803, 10097, 53, 68420, 63, 518, 1429, 11, 2525, 1380, 264, 6941, 6500, 198, 3346, 288, 11, 323, 279, 2732, 315, 279, 6500, 1283, 279, 11025, 13, 576, 6500, 1221, 9977, 279, 8603, 5302, 320, 263, 5588, 44, 448, 1565, 10803, 10097, 53, 68420, 12885, 64, 9442, 264, 1584, 11, 279, 2732, 315, 432, 1865, 6816, 701, 323, 279, 2732, 315, 279, 8038, 9041, 6816, 11, 705, 311, 279, 22983, 6, 11025, 5519, 198, 1782, 6500, 594, 6816, 624, 785, 5003, 429, 10274, 1817, 949, 1447, 91, 19998, 760, 16822, 760, 34746, 760, 1230, 746, 760, 3555, 432, 27535, 760, 4457, 304, 9245, 91, 4421, 91, 4421, 91, 4421, 91, 4421, 91, 4421, 91, 4421, 7360, 91, 1565, 51, 43957, 37, 7863, 29931, 10978, 75475, 2646, 3256, 63, 760, 4573, 760, 279, 3468, 25, 1449, 54443, 9862, 2997, 11, 1817, 7077, 518, 2795, 760, 264, 55292, 315, 21984, 11, 518, 3245, 220, 19, 15380, 33, 320, 359, 1870, 1215, 264, 220, 101175, 303, 315, 279, 3701, 11, 518, 3245, 220, 16, 15380, 33, 320, 4243, 9350, 8, 760, 1128, 279, 8038, 10896, 1910, 760, 1565, 35188, 13428, 74594, 2899, 8052, 26737, 19159, 3938, 343, 7808, 1565, 33763, 19159, 3938, 343, 63, 9245, 91, 1565, 51, 43957, 37, 7863, 94064, 29931, 29087, 97797, 63, 760, 4573, 760, 279, 3468, 25, 1449, 54443, 9862, 2997, 11, 1817, 7077, 518, 2795, 760, 6857, 760, 264, 2062, 389, 279, 8038, 11, 279, 14314, 5230, 760, 1565, 35188, 13428, 74594, 2899, 8052, 26737, 19159, 3938, 343, 7808, 1565, 33763, 19159, 3938, 343, 63, 9245, 91, 1565, 313, 2147, 63, 760, 5181, 760, 279, 7050, 760, 279, 2997, 594, 1638, 11, 59728, 518, 279, 1614, 594, 1828, 3241, 760, 264, 4269, 594, 3241, 26, 1565, 15, 63, 4990, 279, 1614, 594, 1828, 760, 1565, 35188, 13428, 37061, 81924, 3938, 343, 7808, 1565, 35188, 13428, 74594, 2899, 8052, 12565, 3938, 343, 63, 9245, 91, 1565, 313, 45824, 63, 760, 5181, 760, 279, 7050, 760, 1565, 3902, 44364, 705, 311, 220, 23, 760, 279, 22983, 760, 1565, 35188, 13428, 37061, 81924, 3938, 343, 63, 9245, 91, 1565, 313, 40358, 36489, 2371, 579, 63, 760, 5181, 760, 279, 7050, 760, 1283, 279, 4361, 11025, 11, 438, 3403, 760, 279, 9929, 6500, 594, 8038, 760, 1565, 35188, 13428, 37061, 81924, 3938, 343, 76960, 17972, 11, 1565, 35188, 13428, 74594, 2899, 8052, 96254, 15697, 3938, 343, 63, 28552, 48102, 2124, 32725, 323, 1565, 33763, 19159, 3938, 343, 63, 9245, 91, 1565, 10803, 10097, 53, 68420, 63, 760, 4573, 11, 304, 279, 5526, 19387, 760, 279, 7050, 11, 389, 279, 8520, 315, 279, 6200, 2150, 12949, 760, 1007, 25, 10988, 760, 50598, 8603, 438, 7314, 6816, 11, 448, 518, 1429, 419, 1657, 5302, 3267, 1105, 760, 1565, 35188, 13428, 5320, 14100, 85, 47577, 12748, 3938, 343, 63, 9245, 91, 1565, 10803, 2646, 10989, 10097, 53, 17193, 2646, 3256, 63, 760, 4573, 760, 5588, 44, 760, 825, 3241, 323, 220, 99317, 6816, 760, 5588, 44, 594, 3468, 83952, 6816, 448, 1565, 10803, 2646, 10989, 10097, 53, 17193, 28, 16, 7808, 4889, 279, 3671, 7314, 760, 1565, 35188, 13428, 6663, 58497, 4846, 17745, 2899, 8052, 96254, 12842, 3938, 343, 63, 9245, 91, 279, 7314, 594, 6816, 760, 6857, 760, 279, 6200, 3119, 760, 1959, 760, 1128, 374, 2115, 760, 1565, 35188, 13428, 5320, 14100, 85, 15697, 3938, 343, 63, 28552, 10388, 32725, 35543, 84651, 5109, 369, 825, 7050, 525, 304, 671, 101220, 15, 382, 565, 13309, 1311, 271, 25959, 1565, 313, 39545, 28680, 63, 4302, 1367, 11354, 25, 264, 10430, 429, 700, 70, 1811, 279, 2266, 374, 16037, 448, 279, 13466, 198, 63, 2147, 5118, 63, 1465, 13, 3085, 432, 11, 279, 3538, 92710, 4518, 315, 37791, 13, 1565, 313, 39545, 28680, 3233, 63, 29389, 3054, 369, 198, 1782, 9846, 1959, 279, 8130, 315, 220, 99082, 4, 315, 279, 2266, 3241, 323, 220, 99317, 11, 100919, 19, 11206, 11, 476, 220, 99082, 4, 979, 279, 3241, 646, 944, 3331, 220, 99317, 11, 100919, 19, 1959, 323, 1367, 11354, 264, 10430, 6693, 9929, 198, 7138, 4829, 9846, 11206, 1035, 5312, 1128, 374, 2115, 11, 476, 825, 279, 14386, 10544, 40393, 369, 2266, 3084, 624, 63, 313, 39545, 28680, 434, 7808, 264, 19382, 315, 279, 3241, 304, 320, 15, 11, 220, 16, 1125, 1367, 11354, 979, 807, 1035, 5312, 434, 24692, 279, 3241, 11, 17949, 1495, 624, 8609, 1008, 897, 374, 16037, 518, 20524, 3489, 7325, 3233, 476, 264, 19382, 304, 320, 15, 11, 220, 16, 60, 80327, 13543, 1311, 13589, 279, 10430, 594, 6388, 6605, 323, 1181, 3213, 9782, 4361, 323, 92710, 279, 6149, 1119, 264, 198, 17248, 5185, 13, 576, 5185, 374, 5326, 553, 279, 1614, 5086, 1959, 55604, 11, 7274, 1007, 11, 518, 1429, 220, 16, 11, 15, 99590, 11206, 264, 11873, 1959, 1212, 198, 64, 3383, 429, 17045, 369, 72626, 14149, 320, 39773, 11, 86748, 323, 19286, 11, 16020, 11, 3714, 6805, 11, 9292, 7354, 345, 41771, 2266, 8, 323, 1212, 220, 103919, 4244, 13, 1084, 40475, 279, 68130, 6149, 438, 825, 1943, 429, 12027, 330, 10637, 315, 198, 1782, 6788, 10430, 94935, 576, 9782, 374, 1565, 313, 39545, 12, 13088, 63, 11206, 315, 3213, 6605, 11, 458, 7546, 504, 220, 15, 26, 279, 198, 2258, 13589, 279, 9152, 315, 220, 98360, 11, 99752, 11206, 323, 264, 8337, 315, 279, 3241, 13, 1416, 279, 59171, 10430, 2058, 1558, 198, 1921, 4946, 11, 279, 3538, 92710, 1549, 916, 264, 9152, 9782, 3080, 432, 1558, 13, 362, 16812, 291, 1681, 8472, 1493, 4960, 198, 7490, 804, 1573, 1181, 9846, 382, 63, 313, 39545, 63637, 38842, 63, 10528, 1817, 10430, 594, 5185, 1212, 38842, 438, 30466, 792, 14266, 2277, 7808, 448, 264, 30466, 792, 14266, 2236, 63, 14623, 1246, 198, 34406, 6388, 6605, 279, 5185, 14511, 323, 862, 5175, 13, 362, 2937, 1681, 6693, 6388, 6605, 5175, 279, 1852, 312, 4776, 198, 1782, 9763, 5185, 4518, 315, 1217, 92326, 432, 13, 17128, 279, 5181, 264, 5185, 6305, 369, 825, 1681, 382, 785, 9846, 594, 1565, 45832, 19923, 63, 1633, 23313, 1565, 2147, 12565, 63, 323, 1565, 2147, 27708, 7808, 323, 979, 1367, 1311, 10608, 1083, 264, 198, 63, 5689, 1311, 63, 1633, 25, 1565, 16311, 18148, 22112, 7808, 1565, 97092, 23363, 7808, 1565, 9969, 28735, 63, 323, 279, 1565, 9969, 63, 1467, 13, 13309, 1311, 16772, 198, 983, 6236, 3459, 908, 448, 264, 1565, 16311, 63, 1334, 11, 323, 311, 279, 79817, 5333, 11, 892, 8472, 438, 825, 26, 264, 3459, 908, 1681, 198, 4197, 264, 14386, 914, 9929, 374, 2581, 16812, 291, 382, 565, 36874, 24527, 271, 63, 2946, 608, 85, 16, 58250, 24527, 63, 4990, 5264, 15457, 594, 2487, 25, 1565, 1355, 63, 374, 825, 1467, 11, 264, 1140, 315, 21930, 11, 825, 1140, 315, 3950, 28261, 476, 264, 1140, 315, 198, 48413, 11, 448, 1565, 17140, 8952, 63, 28552, 3649, 63, 476, 1565, 3152, 102636, 32725, 323, 1565, 58829, 28487, 7209, 2997, 429, 17026, 70020, 13240, 1493, 198, 1097, 355, 1127, 11, 1817, 458, 10125, 220, 102259, 1565, 11802, 7893, 4096, 63, 1447, 91, 5571, 760, 8549, 35239, 9245, 91, 12442, 760, 12442, 9245, 91, 264, 1467, 429, 374, 4287, 476, 36188, 1172, 320, 30163, 594, 36188, 738, 11, 892, 328, 3825, 524, 29806, 1573, 432, 40393, 8, 760, 330, 93814, 1467, 1969, 537, 387, 4287, 476, 36188, 1172, 5123, 304, 264, 1140, 11, 330, 93814, 1946, 518, 1922, 451, 1969, 537, 387, 4287, 476, 36188, 1172, 1, 9245, 91, 825, 1946, 5021, 1091, 279, 1614, 594, 2266, 760, 2038, 1565, 2147, 5118, 2702, 93415, 44364, 330, 1782, 1946, 320, 45, 11206, 8, 374, 5021, 1091, 279, 1614, 594, 2266, 3084, 320, 34, 11206, 9935, 9245, 91, 11122, 429, 1817, 4946, 714, 3786, 5545, 279, 3538, 594, 7162, 3930, 760, 330, 1782, 38878, 7162, 35100, 279, 16174, 451, 11206, 1, 35543, 2082, 916, 23725, 1946, 374, 6941, 1573, 279, 7162, 3930, 374, 10062, 11, 773, 264, 2943, 45931, 429, 279, 1946, 5086, 374, 2238, 1293, 345, 1921, 429, 279, 7162, 374, 2238, 2480, 13, 1565, 58829, 63, 30445, 1817, 4621, 311, 429, 1657, 6388, 2750, 323, 5672, 2492, 4756, 432, 26, 264, 198, 2528, 448, 6867, 884, 9264, 4554, 320, 44, 4728, 8, 63948, 4990, 894, 2374, 304, 1181, 14265, 2088, 320, 101175, 311, 220, 19, 11, 100614, 21, 369, 1207, 16929, 18, 12, 25408, 6968, 12, 23, 33, 3593, 565, 79817, 271, 63, 24713, 58, 15, 936, 1994, 5406, 63, 9977, 279, 4226, 13, 26673, 287, 5711, 1565, 19857, 287, 7495, 7808, 476, 198, 63, 20214, 57309, 287, 7495, 63, 1393, 16824, 13, 13843, 990, 1565, 14163, 45366, 63, 323, 1565, 30033, 38025, 25, 330, 14163, 45366, 1, 18606, 4498, 264, 3811, 16703, 902, 1744, 34979, 11, 264, 9846, 65800, 6388, 1565, 154841, 63, 4772, 374, 6963, 504, 198, 63, 19857, 287, 7495, 76960, 279, 72678, 323, 8059, 7586, 990, 279, 1852, 6718, 13, 11727, 13308, 279, 32559, 594, 6388, 323, 198, 376, 14267, 36188, 11, 773, 279, 10854, 1565, 20214, 57309, 287, 7495, 63, 9662, 6144, 279, 8059, 2070, 4922, 369, 4922, 26, 264, 4269, 198, 52767, 36188, 1182, 3080, 803, 32559, 11012, 432, 624, 11505, 9846, 594, 10426, 11, 72678, 6174, 5230, 11, 23313, 1181, 9929, 11, 9750, 323, 2790, 11206, 345, 63, 40358, 28735, 13252, 520, 3854, 28735, 63, 320, 1782, 9929, 11206, 1730, 304, 264, 19127, 594, 9249, 6500, 26, 9862, 73187, 6682, 198, 14145, 3080, 1181, 9929, 6500, 374, 8967, 8, 323, 198, 63, 43064, 28735, 13252, 57309, 287, 28735, 63, 320, 1782, 7274, 11206, 11, 1526, 279, 15304, 1744, 11129, 1215, 18375, 3565, 198, 19473, 389, 279, 19127, 624, 25258, 74937, 1083, 6682, 9467, 13134, 1741, 438, 16876, 4379, 11, 882, 311, 1156, 3950, 323, 9955, 25427, 382, 20754, 4718, 30517, 1083, 6777, 264, 1565, 45832, 19923, 63, 15580, 2504, 448, 1565, 8511, 7808, 1565, 12546, 5854, 15724, 12885, 63, 19857, 287, 51604, 371, 7808, 1565, 30446, 5678, 29531, 7808, 1565, 17381, 7808, 1565, 1678, 2346, 12971, 6458, 7808, 1565, 30432, 483, 34652, 12885, 63, 30432, 483, 7927, 82, 7808, 1565, 30432, 483, 59552, 4056, 7808, 1565, 96148, 7808, 1565, 44731, 82, 7808, 1565, 5839, 48529, 7808, 323, 264, 1565, 9531, 22105, 63, 1633, 29279, 198, 1782, 2504, 448, 279, 9955, 31400, 1565, 1049, 82, 7808, 1565, 44731, 291, 7808, 1565, 54210, 7808, 1565, 10325, 681, 9243, 7808, 323, 198, 63, 30446, 5678, 29780, 63, 320, 1782, 43841, 1046, 594, 1828, 31400, 17310, 438, 1565, 776, 20032, 63, 4292, 4498, 264, 9846, 13589, 5392, 58490, 85887, 438, 1467, 4518, 315, 13442, 1105, 438, 6738, 11, 279, 2504, 1083, 23313, 198, 63, 97092, 22724, 45366, 44364, 1565, 359, 1847, 12330, 63, 323, 1565, 14639, 10150, 63, 14569, 11, 323, 1565, 359, 1847, 12330, 9184, 7808, 279, 5036, 279, 1614, 6139, 369, 279, 198, 97092, 650, 1847, 12330, 6738, 11, 304, 1973, 11, 2041, 42086, 11, 518, 1429, 220, 23, 5036, 315, 220, 102636, 5820, 1817, 13, 576, 4361, 9846, 323, 279, 198, 4027, 291, 6248, 1538, 6777, 279, 1852, 1633, 26, 264, 9846, 429, 8603, 6857, 702, 902, 1565, 97092, 22724, 45366, 63, 2070, 624, 32, 1681, 429, 21259, 1565, 689, 6458, 8076, 63, 11362, 1565, 5839, 8076, 7808, 279, 9846, 594, 11206, 11, 311, 279, 2504, 1959, 279, 11206, 1565, 5839, 48529, 63, 323, 198, 63, 5839, 48529, 116265, 63, 5175, 1959, 389, 279, 4361, 9846, 323, 389, 279, 72678, 6248, 1538, 25911, 13, 362, 6337, 92201, 291, 9846, 11362, 198, 63, 22198, 44094, 55405, 7808, 323, 1565, 22198, 44094, 1236, 17548, 63, 979, 1565, 313, 10493, 92201, 40980, 63, 9478, 432, 26, 1493, 5043, 7512, 279, 9862, 198, 20987, 323, 525, 27122, 504, 13020, 30517, 429, 653, 537, 3410, 1105, 624, 641, 279, 9862, 2504, 11, 1565, 17381, 63, 374, 279, 9846, 594, 16876, 882, 11, 504, 279, 835, 315, 1181, 9929, 1494, 311, 1181, 1537, 3950, 11, 323, 198, 63, 30446, 5678, 29531, 63, 64354, 279, 9846, 594, 11206, 1283, 279, 1156, 553, 432, 13, 1565, 30432, 483, 34652, 63, 374, 279, 9929, 1494, 11, 323, 198, 63, 1678, 2346, 12971, 6458, 63, 14569, 504, 279, 1681, 594, 18614, 11, 773, 264, 56779, 476, 1293, 9929, 4933, 1052, 11, 537, 304, 1565, 17381, 18606, 63, 1065, 10944, 63, 374, 279, 24557, 2802, 1760, 894, 315, 279, 1681, 594, 4712, 6738, 10608, 448, 13, 362, 9846, 6693, 21224, 16859, 198, 40864, 11025, 11362, 1565, 40864, 57823, 63, 323, 1565, 40864, 761, 3305, 7808, 14569, 11, 323, 1565, 40864, 12565, 34652, 63, 323, 198, 63, 40864, 30607, 34652, 7808, 304, 6486, 624, 785, 13020, 220, 15, 13, 21, 3538, 594, 1565, 17381, 63, 374, 279, 4361, 1681, 11, 9929, 5230, 624, 32, 9862, 19170, 1207, 16929, 18, 13, 23, 12, 99951, 33, 3538, 3855, 448, 1565, 10803, 13329, 99951, 34363, 51654, 63, 18392, 1817, 9996, 536, 594, 22611, 882, 11, 279, 422, 23809, 17, 198, 22191, 1046, 594, 5230, 11, 1449, 451, 16876, 19494, 28552, 16, 63, 3363, 220, 102636, 26, 17972, 11, 4287, 476, 1565, 15, 63, 374, 1007, 11, 323, 894, 1008, 897, 10896, 432, 1007, 198, 4197, 264, 9953, 568, 59089, 16197, 1598, 650, 5365, 67, 11, 323, 264, 5526, 67, 4778, 8472, 28294, 1393, 1181, 44038, 525, 25104, 13, 11440, 30517, 198, 718, 1565, 42350, 34652, 63, 311, 279, 2504, 25, 279, 22611, 1455, 355, 88, 882, 315, 279, 2169, 1614, 594, 4637, 16197, 279, 9846, 10608, 304, 11, 1181, 9929, 198, 6385, 5230, 13, 362, 4778, 6094, 448, 1008, 22983, 14569, 4361, 304, 1817, 315, 862, 30517, 11, 323, 279, 43841, 1046, 594, 16197, 198, 546, 537, 5230, 13, 17128, 1565, 10803, 13329, 99951, 34363, 63, 279, 2070, 374, 27122, 323, 30517, 525, 34684, 382, 39511, 577, 279, 2504, 11, 9862, 30517, 6777, 1909, 11586, 1565, 46105, 7302, 7808, 2677, 52951, 46105, 1, 7808, 323, 1565, 9491, 23669, 7808, 279, 18026, 198, 9491, 914, 11, 979, 264, 2936, 914, 9478, 279, 9846, 13, 362, 3538, 3855, 448, 1565, 313, 6005, 62565, 63, 11362, 264, 1909, 11586, 1565, 6005, 62565, 3989, 1700, 28188, 4849, 279, 2484, 369, 7388, 4463, 62565, 8472, 11737, 10575, 62565, 9529, 6005, 62565, 21274, 4579, 4220, 11871, 389, 279, 4361, 9846, 323, 198, 1782, 72678, 6248, 1538, 25911, 382, 785, 9862, 3538, 594, 6248, 1487, 5036, 279, 2943, 9846, 3034, 13, 45225, 7388, 1895, 1565, 40358, 7808, 1565, 32762, 12885, 63, 81583, 7808, 1565, 6445, 371, 7808, 1565, 30446, 7808, 1565, 15235, 7808, 1565, 30033, 7808, 1565, 1049, 82, 7808, 323, 9955, 25427, 26, 264, 16037, 1681, 6682, 198, 63, 1097, 2591, 366, 307, 43376, 323, 1181, 1943, 11, 1393, 264, 14624, 1681, 429, 10330, 1573, 264, 9846, 6682, 1565, 2883, 366, 307, 43376, 448, 198, 63, 19857, 28, 2972, 7949, 63, 476, 458, 1465, 5519, 1565, 40358, 7808, 1565, 30446, 7808, 323, 25255, 882, 382, 1925, 279, 13020, 220, 15, 13, 21, 13, 21, 54443, 3538, 11, 1565, 3806, 608, 12114, 63, 28552, 4913, 562, 788, 830, 11, 330, 20895, 788, 330, 45832, 19923, 497, 2503, 5541, 8, 1083, 23313, 31400, 198, 64, 7085, 261, 646, 6672, 1119, 7813, 25, 1565, 77839, 7808, 1565, 36059, 37139, 7808, 1565, 36059, 10779, 7808, 1565, 43064, 28735, 10779, 63, 320, 1782, 198, 27084, 30517, 6, 11206, 5230, 438, 807, 4269, 701, 323, 43395, 429, 3271, 979, 264, 1681, 10330, 11, 4429, 504, 279, 4712, 594, 198, 779, 13134, 25, 1565, 40358, 28735, 10779, 7808, 1565, 32762, 28735, 10779, 7808, 1565, 30432, 483, 34652, 10779, 7808, 1565, 18167, 34652, 10779, 12885, 63, 1049, 82, 10779, 7808, 323, 1565, 44731, 291, 10779, 63, 323, 1565, 54210, 10779, 63, 1380, 279, 4712, 6682, 1105, 13, 362, 1565, 313, 45824, 63, 3538, 11362, 198, 63, 60547, 63, 320, 8168, 3700, 11, 855, 7559, 287, 323, 279, 7192, 701, 323, 1565, 2147, 5118, 63, 374, 279, 10218, 3241, 13, 576, 1156, 6077, 374, 264, 198, 75354, 11, 537, 264, 4379, 13, 576, 9862, 3538, 594, 37107, 12114, 63, 23313, 6857, 315, 1493, 31400, 11737, 14532, 9529, 2, 12114, 8, 11464, 1181, 198, 9004, 1215, 1181, 1681, 11, 3950, 11, 4778, 323, 9955, 31400, 525, 304, 508, 27239, 9529, 2, 43016, 3593, 2461, 4734, 2090, 35319, 11, 3331, 279, 29186, 11, 3811, 11, 15580, 11, 9929, 11, 10315, 323, 24816, 5003, 198, 18049, 11, 1221, 9425, 279, 29106, 9846, 448, 1565, 44731, 63, 8967, 323, 8385, 13, 44540, 448, 7722, 323, 68244, 198, 11843, 288, 11, 323, 9425, 1817, 19577, 55, 33870, 1681, 448, 1181, 13520, 1598, 382, 20754, 48569, 7388, 990, 279, 1681, 10315, 11, 1221, 458, 40447, 19718, 1638, 11, 1221, 264, 7722, 220, 103302, 15245, 10080, 1376, 13, 2308, 5591, 198, 13259, 5181, 476, 9467, 2193, 16703, 264, 1638, 10315, 13, 576, 2814, 1555, 906, 1412, 1565, 22543, 38490, 77, 43376, 1283, 198, 1199, 1681, 18375, 323, 9624, 2687, 5043, 11, 369, 2661, 323, 14754, 6894, 13, 10995, 429, 10315, 1549, 311, 22739, 264, 4038, 13, 13523, 9310, 7388, 4038, 198, 2152, 1376, 13, 16686, 1565, 13259, 1177, 40358, 7806, 291, 63, 13589, 13647, 9929, 1376, 287, 11, 2670, 1565, 51, 43957, 37, 7863, 3620, 1479, 1098, 35651, 76960, 39065, 8472, 323, 198, 87494, 2506, 862, 6350, 9929, 1376, 287, 13, 23177, 2968, 12307, 7388, 279, 1852, 11459, 10315, 11, 2670, 4879, 198, 36500, 11, 37759, 36779, 11, 20536, 6663, 2488, 323, 33870, 2687, 10006, 12335, 13, 3496, 508, 2035, 19021, 9529, 2035, 7806, 6767, 21274, 3593, 565, 53828, 271, 63, 3806, 608, 43016, 63, 323, 1565, 3806, 608, 85, 16, 3183, 13459, 63, 4226, 438, 96323, 1467, 389, 2176, 16279, 13, 8884, 2997, 374, 1349, 389, 1181, 1828, 198, 266, 56744, 882, 320, 1782, 56744, 374, 537, 825, 24436, 16281, 701, 323, 264, 2997, 279, 3538, 4157, 1760, 25963, 374, 2115, 198, 411, 315, 279, 1467, 4751, 1091, 4961, 518, 264, 15318, 7168, 382, 785, 56744, 23313, 1565, 36059, 37139, 7808, 1565, 36059, 83987, 7808, 1565, 40358, 28735, 10779, 7808, 1565, 79415, 28735, 10779, 12885, 63, 79415, 28735, 37139, 7808, 1565, 43159, 11524, 31376, 19879, 63, 320, 603, 1565, 10280, 63, 2383, 817, 3887, 4269, 6500, 701, 1565, 76, 790, 814, 60343, 10779, 63, 323, 1565, 76, 790, 89608, 10779, 3989, 1500, 2944, 11206, 23866, 323, 8603, 389, 8059, 7388, 26, 279, 21059, 2506, 825, 9955, 5546, 11, 773, 10988, 323, 8780, 198, 44731, 82, 4332, 432, 701, 1565, 97092, 22724, 45366, 4907, 1847, 12330, 10779, 63, 323, 1565, 97092, 22724, 45366, 717, 278, 10150, 10779, 63, 320, 14163, 58490, 85887, 8603, 438, 198, 1318, 389, 8059, 30517, 11, 553, 458, 650, 1847, 12330, 829, 323, 553, 78613, 40526, 701, 1565, 2035, 74244, 34652, 7808, 1565, 1678, 2346, 12971, 6458, 34652, 63, 323, 1565, 2035, 15215, 34652, 63, 320, 9543, 198, 12123, 1681, 594, 16876, 882, 25, 279, 54443, 4712, 594, 1828, 7071, 11, 476, 1156, 3950, 311, 835, 389, 279, 7401, 3538, 26, 1181, 90853, 1242, 3989, 1975, 1565, 79415, 28735, 10779, 63, 374, 279, 16876, 4379, 701, 1565, 2035, 3009, 5678, 7645, 6458, 34652, 7808, 1565, 18167, 29780, 82, 10779, 12885, 437, 279, 1565, 2035, 43082, 483, 34652, 63, 30164, 11, 678, 1212, 279, 1565, 45832, 19923, 18703, 9249, 13, 28964, 1793, 2669, 23313, 348, 4086, 44, 594, 829, 624, 785, 38864, 348, 4086, 44, 1083, 702, 525, 11499, 1212, 1181, 5036, 28552, 2413, 37022, 37139, 7808, 1565, 2413, 37022, 83987, 12885, 63, 43159, 11524, 31376, 82128, 7808, 1565, 9531, 15215, 4273, 90577, 28735, 10779, 7808, 1565, 9531, 15215, 4273, 89608, 28735, 10779, 12885, 63, 68, 17, 68, 7893, 74244, 34652, 7808, 1565, 2035, 15215, 3009, 34652, 7808, 1565, 2035, 43082, 483, 3009, 34652, 32725, 448, 19479, 2750, 11, 773, 264, 26879, 21722, 504, 348, 4086, 44, 40364, 553, 63265, 279, 198, 63, 45832, 19923, 18703, 9249, 369, 279, 18237, 829, 13, 1565, 2972, 9927, 49667, 10779, 63, 320, 36059, 279, 2943, 14847, 3123, 504, 340, 437, 1565, 1726, 336, 1300, 10779, 63, 320, 36059, 312, 66063, 369, 4938, 1573, 862, 1156, 3950, 11, 5519, 4004, 16197, 429, 198, 29583, 291, 862, 21224, 311, 39093, 975, 8, 525, 4652, 1380, 279, 198, 4030, 14569, 1846, 4357, 11, 323, 2581, 518, 264, 68939, 7168, 624, 2082, 4712, 429, 13589, 9929, 5302, 1948, 7388, 320, 23809, 9292, 323, 5588, 44, 12, 20, 13, 18, 12, 23809, 7241, 1565, 313, 40358, 36489, 2371, 579, 220, 15, 24114, 72431, 1565, 40358, 28735, 63906, 10779, 63, 320, 45215, 348, 4086, 44, 594, 829, 701, 279, 9929, 11206, 315, 8059, 7388, 26915, 504, 264, 8603, 198, 2454, 11, 323, 43344, 432, 448, 1565, 40358, 28735, 10779, 63, 438, 348, 4086, 44, 594, 1565, 11843, 11524, 63377, 10779, 63, 323, 1565, 11843, 11524, 65110, 10779, 18606, 2082, 4712, 429, 13589, 902, 9929, 5302, 10896, 678, 2326, 700, 382, 785, 9862, 1565, 313, 18608, 63, 5181, 11362, 264, 656, 94426, 37107, 18608, 63, 2150, 323, 1181, 37107, 16246, 63, 4718, 16281, 26, 2176, 11286, 198, 689, 220, 99698, 19, 979, 279, 5181, 374, 1007, 11, 323, 279, 2150, 22994, 3055, 817, 2086, 2041, 7842, 2615, 46052, 11974, 382, 14364, 44499, 2795, 271, 785, 56744, 1083, 23313, 279, 28706, 2795, 264, 9438, 557, 3191, 3880, 11, 504, 825, 46645, 279, 3538, 24187, 13, 7209, 3538, 198, 27410, 288, 1565, 4030, 3109, 90, 2528, 11, 20895, 11, 4366, 11, 4851, 5541, 320, 31978, 220, 16, 26, 1565, 4851, 63, 374, 264, 4194, 877, 1865, 518, 1882, 1191, 345, 704, 31400, 17005, 1172, 448, 264, 501, 1565, 4851, 63, 701, 1565, 4630, 4906, 3009, 34652, 7808, 1565, 8511, 620, 41824, 63, 320, 16, 1393, 198, 63, 313, 46982, 19854, 1078, 63, 702, 7877, 279, 4712, 701, 1565, 10710, 288, 7808, 323, 1565, 1254, 37022, 12923, 90, 8963, 5541, 25, 1614, 7388, 504, 279, 835, 315, 198, 49410, 7102, 311, 279, 835, 315, 862, 9846, 11, 553, 6021, 1874, 28552, 9682, 2965, 10814, 908, 7808, 1565, 874, 10814, 908, 7808, 1565, 70465, 12885, 63, 16311, 7808, 1565, 12244, 24527, 7808, 1565, 87494, 7808, 1565, 1575, 63, 701, 1565, 2035, 7793, 355, 1127, 10779, 90, 19857, 5541, 25, 7388, 16037, 448, 264, 2943, 198, 1851, 11, 825, 315, 1565, 8511, 75355, 7808, 1565, 8511, 4907, 10329, 63, 323, 1565, 17248, 73023, 63, 320, 1782, 508, 54, 56099, 9529, 2, 9986, 1199, 8, 13903, 11, 29877, 1380, 198, 1782, 6236, 11, 70020, 11, 48243, 1180, 323, 8805, 11286, 4226, 448, 1105, 11, 323, 458, 5335, 4712, 594, 13021, 220, 99200, 18, 438, 1565, 8511, 75355, 89004, 63, 11802, 7893, 63, 320, 1782, 220, 102259, 979, 279, 4712, 5086, 40393, 279, 1681, 432, 572, 22534, 701, 476, 458, 25215, 5181, 594, 220, 19, 100104, 553, 198, 1199, 2038, 28552, 2810, 1243, 38183, 2702, 93415, 7808, 1565, 2810, 1243, 38183, 5678, 3097, 2702, 93415, 7808, 1565, 329, 2728, 35425, 2702, 93415, 12885, 63, 36059, 5678, 29531, 2702, 93415, 76960, 1490, 508, 2589, 2728, 9529, 2, 329, 2728, 5731, 323, 1565, 2035, 22066, 1413, 10779, 90, 19857, 5541, 25, 7388, 429, 198, 2883, 4641, 448, 902, 42906, 2038, 13, 11440, 7965, 525, 1565, 20895, 60990, 7808, 1565, 20895, 29780, 7808, 1565, 37651, 19159, 8417, 603, 63, 323, 198, 63, 40358, 2346, 78, 44960, 63, 320, 1782, 4712, 3867, 279, 1681, 323, 432, 4641, 701, 1565, 500, 4887, 7793, 2591, 63, 320, 64, 2997, 4778, 49393, 16037, 432, 198, 4197, 1181, 1828, 4244, 11, 438, 18154, 39138, 19588, 19, 13, 16, 1558, 369, 264, 1681, 3267, 1181, 83952, 7314, 476, 1181, 2588, 4938, 6422, 8, 323, 198, 63, 8511, 1261, 1574, 63, 320, 1782, 6236, 11286, 6, 220, 100840, 1393, 279, 3671, 374, 50025, 568, 7209, 2383, 315, 2176, 8520, 374, 2677, 3042, 382, 2082, 4712, 389, 279, 6094, 21224, 3468, 11362, 1493, 5203, 11, 1817, 4583, 476, 27122, 1447, 91, 5737, 760, 49139, 9245, 91, 12442, 760, 12442, 9245, 91, 50549, 760, 1565, 36059, 83987, 3710, 38025, 90, 19857, 5541, 320, 66063, 7388, 553, 279, 825, 3783, 2874, 1817, 9977, 11, 1449, 2874, 2677, 3042, 26, 807, 2629, 311, 1565, 36059, 83987, 63, 701, 1565, 30682, 761, 3420, 82, 10779, 63, 320, 36059, 6693, 6781, 9249, 1410, 537, 387, 26915, 11, 773, 807, 18702, 4374, 504, 7168, 323, 1033, 10218, 26, 3055, 264, 1681, 701, 1565, 49217, 60990, 28735, 63, 320, 40358, 11206, 315, 56779, 7388, 11, 1573, 894, 8603, 9249, 87028, 949, 315, 1105, 701, 1565, 7559, 287, 60990, 28735, 9575, 63, 320, 3435, 306, 1393, 264, 19127, 2041, 5155, 5098, 40364, 701, 1565, 36059, 55305, 10779, 7808, 1565, 36059, 1288, 66063, 10779, 7808, 1565, 6742, 4178, 6907, 10779, 63, 9245, 91, 5547, 760, 1565, 62673, 28735, 10779, 90, 8515, 5541, 448, 1565, 30432, 483, 56644, 7808, 1565, 30432, 483, 11524, 63, 323, 1565, 18167, 63, 320, 3006, 11206, 1283, 1817, 1681, 594, 1156, 701, 29877, 438, 279, 975, 8572, 11, 323, 1565, 30432, 483, 75355, 34652, 10779, 44364, 4712, 6486, 304, 9929, 6738, 6693, 975, 1565, 30432, 483, 56644, 63, 29877, 13, 576, 1565, 30432, 483, 56644, 63, 9473, 916, 1181, 9473, 374, 279, 855, 7559, 4379, 13, 362, 2997, 4778, 49393, 64019, 902, 975, 1874, 9245, 91, 39889, 760, 1565, 43159, 35425, 7302, 90, 8515, 5541, 28552, 5507, 63, 476, 1565, 62666, 63, 701, 1565, 10710, 288, 8902, 7808, 323, 369, 264, 281, 3279, 4712, 1565, 43159, 15697, 35425, 28735, 7808, 1565, 43159, 15697, 26874, 28735, 7808, 1565, 43159, 15697, 1288, 7859, 480, 28735, 7808, 1565, 43159, 15697, 47577, 4056, 28735, 63, 448, 1565, 10280, 428, 3817, 1, 7808, 323, 1565, 43159, 15697, 13998, 26874, 63, 1380, 279, 2997, 3880, 264, 66019, 1598, 13, 28909, 553, 279, 54443, 21224, 3468, 25, 1565, 5507, 63, 369, 458, 4712, 2041, 264, 2150, 3119, 11, 1565, 62666, 63, 448, 5588, 44, 12, 20, 13, 18, 12, 23809, 594, 7314, 389, 7077, 220, 15, 26, 1008, 281, 3279, 8520, 5274, 279, 1874, 700, 3080, 807, 829, 862, 7314, 35543, 641, 279, 7388, 1874, 11, 1565, 36059, 37139, 7808, 1565, 36059, 83987, 63, 323, 862, 348, 4086, 44, 40263, 1896, 279, 46645, 594, 2750, 624, 7982, 279, 4712, 374, 41994, 11, 6857, 315, 1493, 4712, 2750, 374, 6839, 25, 13857, 279, 5203, 6329, 1565, 36059, 37139, 12885, 63, 36059, 83987, 63, 323, 1565, 79415, 28735, 37139, 28487, 362, 7402, 1874, 3363, 9783, 11, 2581, 7168, 13, 5976, 279, 27554, 198, 91886, 33090, 279, 4712, 11, 279, 4712, 2750, 525, 2669, 8047, 323, 1565, 8511, 620, 41824, 63, 374, 2058, 220, 15, 11, 2474, 264, 1681, 1221, 198, 18658, 220, 99200, 18, 448, 264, 22624, 26, 432, 10572, 220, 16, 3055, 264, 1681, 646, 18613, 279, 4712, 382, 32, 56779, 1681, 9977, 825, 3783, 2874, 11, 6635, 1380, 279, 4712, 1537, 6679, 311, 16681, 432, 323, 8603, 3080, 432, 8470, 198, 269, 10896, 26, 5290, 279, 46645, 2581, 17045, 279, 4712, 1549, 13, 14503, 7965, 525, 2943, 13903, 11, 279, 1852, 9066, 438, 304, 198, 75374, 56099, 9529, 2, 9986, 1199, 1648, 1565, 8511, 75355, 63, 320, 2152, 21224, 374, 1910, 11, 476, 4302, 803, 3151, 5644, 432, 3602, 701, 1565, 8511, 4907, 10329, 63, 320, 1782, 198, 6111, 374, 50025, 3080, 264, 2182, 15449, 24417, 432, 8, 323, 1565, 17248, 73023, 63, 320, 17248, 7262, 9977, 25215, 311, 279, 22983, 198, 45215, 4303, 568, 576, 2732, 525, 5306, 7965, 11, 2581, 264, 2943, 2038, 25, 1565, 43159, 15697, 7808, 1565, 17248, 59626, 63, 323, 198, 63, 30432, 483, 3382, 3231, 63, 320, 64, 2997, 4778, 49393, 46648, 369, 83952, 7314, 6816, 11, 369, 279, 4938, 6422, 11, 476, 16197, 264, 1293, 9929, 198, 1975, 1393, 3800, 855, 7559, 26, 18154, 39138, 19588, 19, 13, 16, 5036, 1105, 701, 1565, 11843, 41085, 63, 320, 275, 46648, 369, 264, 3931, 2441, 9929, 374, 21226, 1326, 63, 2454, 6443, 63, 320, 275, 46648, 369, 1181, 13355, 1584, 594, 1349, 8304, 701, 1565, 50371, 12518, 63, 320, 1199, 53231, 6, 5820, 653, 537, 4946, 279, 83952, 46645, 198, 3328, 8, 323, 1565, 10280, 24927, 63, 320, 1782, 2997, 594, 7314, 702, 902, 3054, 369, 432, 1431, 568, 362, 1681, 4815, 825, 429, 46648, 369, 279, 7314, 11, 279, 198, 50371, 476, 279, 49393, 9977, 429, 1681, 594, 2874, 13, 1565, 17248, 59626, 63, 374, 2581, 29877, 1212, 1565, 17248, 73023, 28487, 576, 198, 19857, 82, 525, 438, 315, 279, 4712, 594, 1537, 25215, 4774, 25, 264, 1681, 56779, 4815, 825, 1101, 16174, 13589, 1181, 6788, 198, 19857, 3080, 279, 4712, 1790, 16283, 311, 16681, 432, 382, 63, 3806, 608, 85, 16, 71347, 63, 4675, 279, 1852, 46645, 438, 825, 4718, 1633, 504, 825, 1349, 25, 1565, 4851, 7808, 1565, 13028, 63, 320, 1782, 1349, 594, 7002, 198, 1678, 701, 1565, 2528, 7808, 1565, 28633, 291, 7808, 1565, 10710, 288, 7808, 1565, 1254, 12923, 63, 553, 6021, 1874, 11, 1565, 1097, 355, 1127, 63, 553, 2038, 11, 323, 11, 979, 3042, 11, 279, 1681, 198, 44598, 448, 1565, 49217, 3710, 38025, 63, 320, 1782, 1852, 7965, 11, 2629, 5311, 311, 1565, 49217, 63, 701, 1565, 37193, 63, 448, 1181, 1565, 79, 6178, 7808, 1565, 30446, 63, 323, 198, 63, 77839, 11301, 28487, 24065, 315, 264, 1874, 902, 3468, 40364, 525, 2115, 700, 13, 1084, 11012, 279, 198, 63, 14, 43016, 63, 2615, 5912, 11, 323, 1565, 313, 43016, 25607, 63, 15873, 432, 2238, 382, 565, 61906, 271, 1359, 1638, 279, 9862, 3538, 4990, 1449, 1614, 1681, 432, 646, 1349, 323, 279, 4712, 47792, 1105, 13, 1913, 264, 3538, 3807, 1251, 198, 19332, 11, 3040, 8041, 646, 24990, 7388, 4124, 4518, 11, 1817, 1007, 518, 220, 15, 11, 1181, 1638, 1447, 91, 22607, 760, 16423, 760, 47801, 9245, 91, 12442, 760, 12442, 760, 12442, 9245, 91, 1565, 313, 2810, 3419, 38183, 451, 63, 760, 220, 15, 12, 109295, 760, 4903, 7388, 304, 5098, 518, 3055, 11, 3941, 678, 6894, 9245, 91, 1565, 313, 2810, 3419, 38183, 16999, 16159, 451, 63, 760, 220, 15, 12, 109295, 760, 4903, 7388, 304, 5098, 518, 3055, 369, 825, 1376, 9245, 91, 1565, 313, 36059, 16999, 43612, 451, 63, 760, 220, 15, 12, 99457, 99752, 760, 4903, 7388, 264, 1376, 1231, 1191, 1817, 2086, 9245, 91, 1565, 313, 2035, 1455, 32463, 451, 63, 760, 220, 15, 12, 99457, 99752, 760, 50549, 264, 64952, 1376, 1231, 1191, 518, 3055, 26, 220, 15, 4990, 279, 4379, 13, 17128, 264, 4379, 432, 1558, 4302, 35543, 32, 1614, 1681, 374, 264, 12862, 311, 264, 9750, 11, 6236, 11, 79817, 11, 26643, 11, 8805, 11, 70020, 11, 11176, 11, 739, 3776, 11, 6852, 6577, 198, 55256, 6832, 476, 78236, 6021, 26, 3950, 4849, 11, 14827, 4119, 11, 2820, 323, 16717, 525, 2581, 29877, 13, 362, 1681, 374, 29877, 198, 1499, 279, 835, 315, 1181, 7102, 11, 1283, 279, 1376, 1779, 323, 1573, 1181, 2487, 374, 1349, 476, 264, 41994, 1614, 18613, 82, 11, 3080, 1181, 9846, 198, 1412, 11, 22983, 5230, 13, 8884, 1376, 14569, 10742, 11, 553, 1181, 20836, 11, 8819, 1181, 2383, 26, 264, 3538, 2041, 6894, 14569, 1449, 198, 2035, 438, 825, 1376, 13, 362, 16037, 1681, 11248, 220, 19, 100104, 448, 1565, 51221, 12, 6025, 63, 323, 279, 6021, 594, 1465, 6083, 28552, 7698, 14753, 4096, 76960, 279, 198, 5002, 15457, 34559, 1565, 1851, 63, 5036, 279, 3930, 8, 323, 33090, 1181, 3633, 2041, 5290, 279, 2487, 13, 362, 42906, 36908, 902, 4379, 382, 785, 4379, 594, 41874, 3887, 304, 264, 1965, 315, 220, 109295, 6894, 13, 362, 1376, 594, 15609, 26473, 3080, 432, 702, 2053, 4374, 11, 773, 31920, 6894, 4157, 7585, 264, 198, 93571, 4379, 26, 448, 803, 1091, 220, 109295, 6894, 5916, 7388, 2878, 825, 73142, 11, 264, 4623, 1376, 374, 16037, 198, 5809, 329, 2728, 35425, 2702, 93415, 32725, 3080, 264, 15609, 2053, 3305, 13, 3085, 894, 315, 279, 8041, 738, 11, 37107, 43016, 63, 11362, 198, 63, 329, 2728, 1243, 38183, 7808, 1565, 329, 2728, 1243, 38183, 66223, 7808, 1565, 329, 2728, 5294, 5706, 1127, 7808, 1565, 329, 2728, 9243, 83462, 12885, 63, 329, 2728, 89608, 10779, 63, 323, 1565, 329, 2728, 1288, 28205, 10779, 63, 448, 264, 8355, 1565, 19857, 63, 2383, 28552, 9748, 14753, 7808, 1565, 792, 14753, 12885, 63, 65966, 35425, 7808, 1565, 7698, 14753, 58800, 3085, 6857, 738, 11, 4302, 374, 29877, 323, 279, 30517, 323, 16717, 525, 438, 1573, 382, 14364, 28414, 1199, 271, 32, 22624, 480, 42906, 389, 458, 44120, 6021, 11248, 220, 99200, 18, 323, 5036, 1181, 3783, 304, 279, 5264, 15457, 34559, 2487, 594, 1565, 1851, 7808, 504, 825, 8355, 738, 1447, 91, 6119, 760, 47801, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 4030, 1288, 39077, 63, 760, 576, 3538, 374, 72446, 369, 264, 17005, 26, 279, 4226, 23313, 1565, 51221, 12, 6025, 63, 9245, 91, 1565, 8511, 57332, 63, 760, 362, 41994, 1614, 374, 650, 10623, 476, 84925, 26, 11622, 279, 1681, 1549, 20078, 432, 26, 1565, 51221, 12, 6025, 63, 9245, 91, 1565, 8511, 78767, 34886, 63, 760, 362, 41994, 1614, 594, 18613, 572, 17181, 323, 4641, 26, 279, 1790, 1681, 16283, 1549, 26, 1565, 51221, 12, 6025, 63, 9245, 91, 1565, 8511, 75355, 63, 760, 576, 4712, 1030, 902, 3054, 369, 419, 1681, 320, 64, 13021, 4712, 11, 264, 13021, 38878, 4712, 11, 264, 2480, 8805, 21224, 1215, 3624, 432, 1549, 9245, 91, 1565, 8511, 4907, 10329, 63, 760, 576, 4712, 374, 7877, 320, 1958, 70020, 323, 48243, 1180, 11, 1083, 50025, 1215, 22624, 1283, 432, 312, 24106, 9245, 91, 1565, 17248, 73023, 63, 760, 576, 3468, 374, 1212, 9020, 4938, 7262, 323, 4990, 902, 501, 1681, 3080, 432, 384, 2264, 35543, 32, 8653, 42906, 13589, 279, 19653, 13020, 4712, 594, 6083, 28552, 1313, 63, 1565, 11802, 7893, 4096, 63, 323, 1181, 1943, 8, 323, 2058, 23313, 902, 1565, 51221, 12, 6025, 76960, 279, 2038, 374, 9862, 594, 5256, 13, 576, 26643, 11286, 2506, 862, 16564, 43684, 34228, 11, 892, 702, 902, 2038, 2070, 11, 323, 279, 6852, 6577, 1205, 2796, 3960, 32131, 323, 78236, 11286, 2506, 862, 1828, 220, 99200, 18, 12859, 382, 54385, 525, 7199, 10742, 504, 7388, 13, 576, 3538, 9977, 518, 1429, 1565, 313, 2810, 12, 49667, 451, 63, 1787, 13226, 320, 16, 12, 109871, 19, 345, 2258, 220, 109295, 568, 5542, 2326, 31342, 315, 1105, 1787, 11, 825, 2621, 1231, 3331, 1565, 313, 2810, 12, 49667, 16999, 41398, 451, 63, 320, 15, 12, 109871, 19, 26, 553, 198, 2258, 264, 8337, 315, 279, 3930, 26, 220, 15, 10572, 432, 1007, 568, 1527, 31427, 21, 2621, 14569, 553, 1181, 608, 102636, 13, 21309, 1419, 8238, 323, 1817, 198, 63, 313, 83145, 83011, 63965, 63, 320, 30504, 480, 11, 705, 311, 220, 102636, 26, 458, 4734, 31427, 19, 476, 31427, 21, 2621, 11, 369, 264, 13283, 11, 2795, 9638, 11699, 476, 40326, 594, 198, 13700, 28692, 8, 525, 2581, 29877, 13, 362, 16037, 3633, 5221, 220, 99200, 18, 448, 1565, 51221, 12, 6025, 25, 220, 16, 28487, 8277, 448, 1449, 9442, 4429, 1558, 198, 64, 3633, 8579, 369, 1181, 1790, 1681, 2968, 1181, 9442, 705, 11, 1283, 220, 20, 6486, 26, 264, 1681, 304, 5098, 374, 2581, 3931, 382, 565, 55024, 804, 389, 13355, 271, 10248, 1565, 313, 40358, 36489, 1737, 3187, 38842, 63, 311, 2506, 10430, 9929, 5302, 389, 13355, 1447, 73022, 927, 198, 45832, 19923, 8682, 47668, 1177, 40358, 36489, 1737, 3187, 12984, 40358, 36489, 198, 13865, 19288, 1986, 374, 13569, 311, 1565, 313, 12669, 14848, 72432, 1177, 12669, 45015, 38842, 76960, 2176, 19551, 8041, 7146, 7248, 624, 63, 313, 12669, 14848, 72432, 63, 7484, 13589, 1181, 6350, 1638, 6220, 11, 1565, 93, 11924, 9357, 5523, 3805, 19923, 14, 12669, 291, 18606, 20586, 12839, 819, 33346, 1565, 313, 12669, 28487, 3155, 537, 15950, 1565, 313, 40358, 36489, 1737, 3187, 63, 448, 1565, 313, 12669, 45015, 63, 476, 198, 63, 313, 12669, 14848, 72432, 44364, 279, 3538, 40393, 2987, 10596, 11, 304, 2987, 1973, 11, 1496, 421, 279, 28524, 2432, 624, 693, 64403, 279, 1852, 6220, 5181, 13589, 1181, 13466, 1537, 19048, 7709, 624, 785, 20524, 1555, 5036, 279, 13355, 25915, 594, 6220, 323, 279, 3671, 8038, 4961, 553, 279, 4712, 26, 979, 279, 4712, 198, 26969, 537, 1895, 264, 3671, 8038, 11, 279, 1555, 2727, 773, 13, 1565, 313, 40358, 36489, 2371, 579, 63, 2058, 11569, 279, 304, 63637, 8038, 345, 437, 279, 6350, 13355, 13379, 7481, 3685, 3796, 311, 2987, 42186, 382, 63, 313, 40358, 36489, 1737, 3187, 38842, 63, 13905, 1449, 9929, 1584, 279, 3538, 13589, 304, 21984, 311, 13355, 438, 1632, 25, 264, 198, 61205, 594, 3840, 11, 279, 835, 315, 1817, 9846, 11, 279, 1790, 2484, 594, 4004, 855, 7559, 323, 279, 6094, 62136, 11, 678, 304, 825, 198, 4314, 369, 1817, 1614, 323, 1936, 13, 2938, 3553, 4990, 279, 1992, 315, 1565, 313, 12669, 63, 6, 82, 3553, 315, 6094, 62136, 25, 264, 3538, 3855, 198, 4197, 279, 5181, 13857, 15792, 6329, 13905, 279, 9249, 3542, 264, 14386, 1565, 313, 12669, 63, 3538, 13589, 11, 323, 807, 4717, 389, 13355, 3080, 279, 198, 11341, 3685, 3880, 862, 3054, 13, 4636, 264, 17005, 11, 264, 9915, 476, 458, 77608, 504, 21984, 11, 279, 1790, 2484, 15792, 279, 5535, 1584, 1182, 198, 64363, 315, 5290, 279, 10430, 1549, 504, 1181, 1156, 3950, 13, 1207, 16929, 18, 13, 23, 12, 99951, 33, 11, 61732, 50670, 11, 17242, 9292, 323, 5588, 44, 12, 20, 13, 18, 12, 23809, 389, 198, 603, 7401, 11, 323, 61732, 50670, 11, 279, 1207, 16929, 18, 13, 20, 95298, 323, 17242, 9292, 389, 54443, 11, 2506, 1105, 26, 1008, 21059, 24990, 279, 5181, 518, 20524, 382, 785, 4712, 17603, 458, 12931, 2975, 1948, 19494, 11, 323, 458, 358, 17507, 4516, 13905, 323, 8618, 1721, 82, 432, 13, 794, 4118, 702, 264, 220, 16, 15380, 33, 4922, 11544, 198, 437, 518, 1429, 8062, 6887, 13, 1207, 16929, 18, 13, 23, 12, 99951, 33, 9720, 724, 279, 11544, 311, 825, 4361, 1584, 518, 1181, 1565, 313, 2147, 7808, 448, 6857, 315, 1181, 6978, 389, 198, 30378, 3602, 11, 714, 2581, 3267, 1565, 313, 40358, 36489, 2371, 579, 44364, 264, 10430, 6693, 1156, 3581, 476, 1736, 61714, 1311, 9929, 9977, 803, 198, 53437, 911, 220, 99366, 42, 501, 11206, 374, 2058, 5326, 13, 362, 3581, 374, 11425, 1172, 1181, 501, 5820, 11, 279, 6978, 537, 2669, 389, 13355, 624, 32, 3581, 429, 13710, 2987, 2480, 714, 1035, 4946, 7484, 46648, 304, 279, 7177, 3080, 264, 3270, 32879, 26, 825, 198, 9030, 4157, 4946, 1496, 1221, 374, 34983, 13, 2055, 374, 264, 8579, 3581, 6693, 1584, 10896, 21984, 11, 7241, 1565, 313, 2154, 483, 2371, 579, 63, 10988, 432, 1221, 198, 1883, 49064, 1215, 429, 2975, 11, 1075, 894, 1865, 518, 458, 77608, 11, 374, 34983, 979, 279, 11544, 374, 2480, 13, 362, 2504, 2058, 1660, 5326, 374, 198, 36769, 323, 21722, 3055, 11, 4764, 1657, 25854, 829, 432, 13, 576, 2975, 46648, 369, 1181, 22611, 23244, 1573, 21984, 646, 387, 68244, 13, 362, 198, 2454, 9041, 2500, 369, 25897, 1172, 1283, 678, 1181, 3542, 614, 1012, 5326, 323, 84330, 624, 32, 12902, 2936, 320, 50299, 49032, 476, 24962, 3221, 8, 78021, 13905, 369, 705, 311, 220, 98360, 6486, 11, 1221, 61869, 2010, 279, 26230, 26, 264, 19263, 49028, 198, 4814, 6248, 2937, 1667, 1172, 1181, 869, 13332, 3542, 323, 49735, 5820, 13, 362, 7425, 3538, 32047, 63163, 25854, 624, 9021, 264, 9763, 1584, 2669, 9977, 369, 279, 1852, 11206, 525, 5326, 3055, 11, 773, 5779, 198, 443, 72432, 429, 4332, 264, 1293, 1849, 9929, 323, 7375, 3553, 1846, 6978, 3055, 13, 362, 1584, 374, 1349, 1182, 1172, 979, 5290, 198, 275, 4990, 2686, 882, 1091, 855, 7559, 287, 279, 11206, 432, 14511, 11, 16859, 389, 419, 5662, 13, 7209, 6573, 1349, 374, 10062, 2348, 198, 1199, 5175, 26, 264, 20083, 1034, 374, 11057, 11, 448, 279, 5302, 429, 1184, 432, 11, 323, 279, 2484, 18702, 3305, 4518, 13, 362, 1349, 15449, 1584, 198, 70, 1886, 279, 1852, 9846, 11, 3950, 369, 3950, 11, 438, 279, 1584, 432, 572, 5326, 504, 323, 438, 264, 7722, 9929, 1494, 382, 2679, 20524, 8472, 700, 315, 4938, 1393, 5290, 1584, 11155, 476, 9112, 1181, 10005, 11, 8567, 279, 3553, 14515, 323, 198, 1891, 1584, 3542, 7146, 389, 13355, 369, 264, 2937, 22624, 13, 1527, 23691, 7901, 1558, 537, 1760, 438, 264, 20083, 1034, 382, 7982, 1008, 22983, 1598, 11, 264, 56779, 1681, 6693, 1584, 374, 389, 13355, 702, 432, 1349, 389, 458, 358, 17507, 4516, 1119, 4938, 11, 448, 279, 198, 23995, 12335, 11, 323, 46648, 304, 279, 7177, 36035, 26, 279, 4712, 4516, 1221, 1172, 10988, 432, 1119, 1992, 11, 773, 279, 1008, 22983, 198, 13088, 46826, 1526, 279, 1349, 13, 362, 1349, 429, 14515, 11, 476, 374, 537, 2814, 2878, 1565, 51, 43957, 37, 7863, 2192, 43698, 65889, 15824, 35965, 63, 320, 101220, 98503, 553, 198, 2258, 701, 374, 2115, 323, 279, 1584, 374, 1349, 518, 25215, 438, 1573, 13, 1565, 51, 43957, 37, 7863, 2192, 43698, 65889, 15824, 63, 18536, 279, 15792, 5644, 518, 198, 13176, 320, 17, 553, 1638, 26, 220, 15, 10572, 5290, 8304, 1007, 8, 323, 1565, 51, 43957, 37, 7863, 2192, 43698, 65889, 15824, 2646, 3256, 63, 862, 4938, 320, 99317, 553, 1638, 1215, 264, 198, 2035, 7484, 389, 279, 4712, 15792, 1181, 1584, 518, 25215, 438, 1573, 13, 362, 56779, 1681, 12573, 264, 49735, 3581, 46648, 198, 55475, 279, 1852, 9628, 369, 279, 6916, 311, 3415, 432, 11, 1221, 15792, 432, 8304, 26, 264, 4641, 476, 3309, 3581, 17047, 1182, 311, 279, 198, 20984, 14940, 476, 7722, 855, 7559, 13, 4457, 323, 3270, 7337, 525, 8650, 11, 773, 264, 6301, 1349, 1558, 537, 2504, 25854, 13, 23477, 832, 198, 30241, 14051, 862, 4938, 11544, 3080, 358, 17507, 4675, 11, 323, 3265, 61869, 2010, 15792, 2878, 279, 1852, 2936, 21378, 438, 13905, 382, 23193, 525, 8603, 817, 29186, 11, 9996, 1936, 11, 10080, 1936, 323, 16378, 25, 264, 66689, 2647, 476, 264, 501, 4879, 429, 56818, 1008, 198, 11511, 8470, 264, 501, 738, 11, 323, 279, 2310, 738, 374, 279, 1156, 311, 728, 979, 279, 13355, 2062, 3880, 3054, 13, 1565, 313, 12669, 2371, 579, 63, 18536, 279, 13355, 198, 20030, 1896, 448, 1565, 313, 12669, 63, 6, 82, 6094, 62136, 11, 1449, 1614, 3786, 320, 101175, 15380, 33, 553, 1638, 1215, 3267, 432, 11, 1008, 4119, 6, 323, 198, 5834, 82, 6, 7289, 728, 1156, 11, 1221, 279, 5302, 5802, 3245, 25, 279, 2421, 477, 11206, 6781, 817, 4922, 1172, 807, 3331, 11, 279, 3245, 5926, 198, 2591, 13, 1565, 313, 12669, 13389, 12571, 2371, 579, 63, 13589, 1910, 13355, 320, 19, 15380, 33, 553, 1638, 701, 323, 1565, 313, 12669, 1737, 5069, 2371, 579, 63, 18536, 1128, 807, 3270, 264, 1899, 198, 7, 101175, 15380, 33, 553, 1638, 1215, 3267, 2987, 11, 264, 1584, 26473, 304, 21984, 1172, 11, 448, 264, 1487, 1555, 11, 323, 902, 9846, 4344, 382, 1925, 264, 7401, 11, 1565, 313, 2154, 483, 2371, 579, 451, 63, 13905, 264, 1584, 311, 429, 3553, 979, 279, 9929, 6500, 3637, 29878, 432, 504, 21984, 476, 279, 4712, 33090, 345, 454, 311, 451, 15380, 33, 1212, 1565, 93, 11924, 9357, 5523, 3805, 19923, 26648, 4374, 63, 369, 1449, 1614, 3786, 11, 323, 15792, 432, 1182, 438, 3403, 25, 264, 2937, 1681, 6693, 9249, 198, 19876, 64737, 504, 432, 11, 3950, 369, 3950, 438, 264, 7722, 9929, 1494, 11, 1283, 264, 17005, 2238, 13, 1527, 77608, 17603, 264, 2975, 1573, 198, 265, 82862, 21984, 11, 1221, 279, 4712, 9535, 1393, 279, 358, 17507, 4516, 13905, 432, 13, 362, 2480, 47466, 11544, 90754, 429, 3581, 280, 1782, 1681, 18702, 3305, 421, 432, 4675, 1573, 264, 6781, 1584, 374, 2500, 13, 1096, 4344, 6500, 12976, 11, 2581, 9846, 11206, 624, 2082, 27554, 62273, 323, 264, 12902, 2936, 1083, 3581, 279, 5302, 2058, 304, 21984, 11, 23536, 1156, 11, 2878, 279, 1852, 13355, 2062, 323, 198, 98360, 43612, 2936, 8038, 13, 576, 1790, 4712, 1787, 42395, 1846, 3542, 323, 87028, 1105, 1526, 279, 1852, 1815, 438, 3637, 21389, 624, 18255, 261, 56779, 25854, 4157, 3637, 849, 5302, 6781, 6788, 304, 429, 3265, 13, 4180, 429, 12482, 264, 47466, 11544, 11, 13355, 2062, 345, 47772, 8038, 476, 1910, 1737, 3187, 6422, 525, 34983, 26, 63163, 13905, 525, 25602, 518, 279, 21378, 624, 49791, 451, 15380, 33, 1008, 4119, 6, 72462, 7289, 728, 1156, 11, 1221, 279, 1584, 419, 3538, 1483, 3245, 5926, 13, 362, 20083, 1034, 374, 198, 26436, 323, 1181, 11206, 525, 18702, 4374, 11, 323, 264, 3270, 3931, 1007, 81478, 10896, 4302, 264, 2937, 2484, 476, 264, 17005, 15792, 624, 63, 313, 68627, 57701, 2412, 451, 63, 7289, 1246, 1657, 5302, 4717, 304, 21984, 29279, 279, 3553, 11, 773, 279, 1790, 825, 21259, 279, 23448, 311, 13355, 26, 432, 198, 54875, 1565, 313, 2154, 483, 2371, 579, 63, 476, 1565, 313, 12669, 14848, 72432, 28487, 3085, 1565, 313, 12669, 14848, 72432, 63, 2238, 11, 1449, 1584, 374, 2058, 5326, 198, 29782, 484, 11, 264, 49735, 3270, 81640, 77608, 315, 1181, 21984, 4343, 11, 323, 279, 2062, 374, 279, 9152, 315, 1565, 313, 12669, 2371, 579, 63, 323, 198, 63, 313, 2154, 483, 2371, 579, 28487, 1565, 313, 12669, 13389, 12571, 2371, 579, 63, 323, 1565, 313, 12669, 1737, 5069, 2371, 579, 63, 3796, 311, 72462, 5302, 438, 1632, 13, 576, 1852, 3040, 7401, 198, 69, 58497, 1896, 2176, 8041, 11, 323, 773, 653, 2326, 54443, 6174, 26, 279, 3800, 24990, 1105, 518, 20524, 13, 17128, 2987, 5181, 4302, 198, 19329, 11, 323, 279, 11286, 3685, 4717, 1007, 13, 1565, 51, 43957, 37, 7863, 62284, 38977, 28, 16, 63, 48829, 279, 3681, 65469, 6916, 369, 198, 874, 1732, 19343, 26, 1181, 2504, 323, 1584, 3542, 614, 279, 1852, 5820, 13, 2938, 12307, 6916, 51503, 22133, 358, 17507, 26, 279, 60686, 198, 30378, 3783, 5711, 279, 66301, 6916, 13, 1565, 10803, 8350, 24299, 55664, 28, 16, 63, 15792, 66301, 13905, 1182, 2348, 862, 12931, 47466, 1573, 198, 70620, 382, 1925, 54443, 11, 61732, 50670, 11, 279, 1207, 16929, 18, 13, 20, 95298, 323, 17242, 9292, 1896, 1565, 313, 2154, 483, 2371, 579, 63, 323, 1565, 313, 68627, 57701, 2412, 63, 448, 279, 1852, 3553, 198, 437, 2062, 438, 264, 7401, 13, 2411, 458, 77608, 279, 4712, 4516, 17603, 264, 2975, 315, 279, 1584, 1119, 3468, 4938, 11, 8579, 369, 279, 22611, 198, 1778, 429, 8944, 432, 11, 1221, 19196, 1181, 21984, 4343, 323, 5780, 389, 26, 279, 358, 17507, 4516, 13905, 323, 8618, 1721, 82, 279, 2975, 1393, 279, 198, 8511, 1622, 2539, 13, 794, 4118, 9977, 518, 1429, 220, 16, 15380, 33, 323, 8062, 6887, 25, 264, 1584, 6693, 501, 5820, 320, 1811, 13857, 389, 13355, 6329, 1660, 198, 25490, 8, 653, 537, 4946, 1128, 374, 1910, 374, 537, 6781, 11, 773, 825, 3267, 220, 16, 15380, 33, 2581, 374, 11, 323, 264, 2937, 1681, 369, 432, 18702, 3305, 13, 3197, 279, 198, 8511, 33090, 11, 518, 264, 12902, 2936, 320, 50299, 49032, 476, 24962, 3221, 8, 476, 458, 27554, 62273, 11, 432, 25854, 279, 5302, 2058, 304, 21984, 11, 23536, 1156, 345, 55475, 279, 1852, 13355, 2062, 323, 220, 98360, 43612, 2936, 8038, 13, 5976, 1008, 22983, 1598, 11, 264, 56779, 1681, 6693, 1584, 374, 389, 13355, 702, 198, 275, 1349, 8304, 389, 458, 358, 17507, 4516, 11, 438, 7481, 3403, 382, 19604, 11286, 1077, 264, 2943, 1741, 438, 279, 7401, 906, 2548, 911, 264, 10430, 13, 8884, 4990, 279, 2487, 315, 264, 6236, 9750, 198, 5809, 16311, 7808, 1565, 15906, 7808, 1565, 9682, 8692, 36052, 63, 701, 44026, 432, 438, 429, 1681, 1035, 387, 22325, 11, 323, 11248, 389, 279, 4712, 594, 198, 4528, 1948, 19494, 13, 362, 3538, 3855, 2041, 1565, 313, 40358, 36489, 1737, 3187, 38842, 63, 476, 1565, 313, 12669, 14848, 72432, 63, 11248, 1817, 198, 4197, 220, 99698, 19, 323, 279, 1465, 1943, 198, 1, 32550, 20912, 525, 1007, 25, 1191, 279, 3538, 448, 1177, 40358, 36489, 1737, 3187, 38842, 320, 269, 1177, 12669, 14848, 72432, 23955, 276, 4712, 429, 13589, 902, 9929, 5302, 11248, 220, 99200, 16, 382, 12, 1565, 2946, 608, 85, 16, 71472, 1350, 32280, 3885, 63, 11248, 1246, 1753, 315, 279, 10430, 594, 1790, 1681, 1035, 15676, 11, 323, 504, 1380, 510, 220, 1565, 30446, 63, 320, 1782, 22325, 9929, 701, 1565, 2396, 28735, 63, 323, 1565, 30378, 28735, 63, 320, 1782, 21978, 8603, 1584, 304, 21984, 323, 389, 13355, 1326, 220, 1565, 30378, 12518, 63, 320, 12549, 5290, 429, 1584, 4990, 701, 1565, 41161, 5673, 63, 28552, 2396, 7808, 1565, 30378, 63, 476, 1565, 6697, 63, 701, 1565, 11484, 34652, 63, 320, 1782, 12936, 198, 220, 3783, 1573, 279, 1156, 3950, 25, 279, 1349, 11, 1221, 855, 7559, 287, 279, 2732, 8, 323, 1565, 30378, 63, 320, 48458, 419, 3538, 13589, 5302, 389, 198, 220, 13355, 4292, 12, 1565, 2946, 608, 85, 16, 71472, 1350, 71347, 63, 15792, 279, 10430, 594, 13355, 1584, 1119, 21984, 1431, 11, 773, 8567, 458, 2310, 6236, 3643, 1181, 1790, 3624, 198, 220, 4937, 13, 1084, 11248, 438, 37107, 85, 16, 71472, 1350, 32280, 3885, 63, 1558, 1283, 279, 1349, 11, 448, 1565, 15577, 28735, 63, 323, 1565, 1078, 34652, 63, 3694, 320, 15, 979, 198, 220, 21984, 2669, 5644, 438, 1753, 11, 476, 264, 9929, 1494, 1035, 387, 38087, 1091, 279, 1349, 4292, 12, 1565, 14414, 608, 85, 16, 71472, 1350, 63, 10662, 82, 1449, 10430, 1584, 419, 3538, 594, 1614, 323, 1936, 2506, 389, 13355, 25, 432, 53808, 279, 198, 220, 3553, 594, 1584, 323, 2802, 3542, 323, 11248, 1565, 24640, 291, 12518, 28487, 3555, 26473, 9977, 902, 10430, 821, 25, 279, 3553, 594, 8526, 448, 198, 220, 1181, 1565, 2591, 63, 21158, 11, 323, 279, 1565, 25490, 63, 323, 1565, 20623, 63, 3542, 518, 279, 1909, 315, 279, 1565, 313, 12669, 45015, 63, 8526, 320, 1782, 5820, 5326, 3351, 345, 220, 323, 279, 1973, 279, 10528, 1033, 1537, 8927, 304, 568, 4180, 304, 21984, 4717, 3080, 807, 525, 3637, 12764, 382, 3838, 26473, 389, 13355, 25, 1212, 279, 1565, 313, 12669, 45015, 63, 8526, 28552, 93, 11924, 9357, 5523, 3805, 19923, 14, 12669, 291, 63, 553, 1638, 701, 28524, 33636, 553, 198, 49410, 6372, 1172, 320, 15, 100096, 15, 8, 3331, 3542, 33636, 553, 862, 6372, 1172, 320, 15, 99618, 15, 568, 2379, 6644, 3950, 14142, 323, 279, 1614, 594, 1828, 198, 40358, 5302, 320, 52751, 6894, 323, 2750, 11, 63615, 323, 55338, 5302, 701, 2581, 1467, 11, 323, 4302, 304, 1105, 10896, 279, 198, 31914, 13, 9656, 14142, 16876, 1182, 311, 279, 10430, 594, 1467, 448, 279, 1614, 594, 45681, 11, 773, 4228, 279, 8526, 438, 498, 4228, 198, 1782, 20912, 13, 1565, 14414, 608, 85, 16, 71472, 1350, 63, 56217, 825, 1614, 594, 5302, 26, 32854, 279, 8526, 1393, 902, 3538, 8472, 56217, 678, 382, 565, 6267, 271, 785, 9862, 3538, 11248, 1565, 3806, 608, 12114, 63, 320, 437, 1565, 3806, 608, 32725, 504, 825, 7013, 389, 19170, 323, 54443, 11, 2041, 264, 1376, 13, 3085, 6894, 198, 80780, 279, 2487, 374, 1172, 1565, 4913, 2829, 788, 330, 562, 1, 5541, 13, 1527, 4712, 429, 6682, 52361, 11248, 220, 99200, 18, 448, 198, 63, 4913, 2829, 788, 330, 359, 10329, 1, 5541, 13, 17128, 6894, 432, 702, 1493, 5043, 11, 304, 419, 1973, 1447, 91, 8600, 760, 3990, 760, 47801, 9245, 91, 12442, 760, 12442, 760, 12442, 9245, 91, 1565, 2829, 63, 760, 914, 760, 23177, 52951, 562, 39700, 9245, 91, 1565, 2528, 63, 760, 914, 760, 576, 10218, 829, 28552, 313, 606, 32725, 9245, 91, 1565, 2528, 8076, 63, 760, 1140, 315, 9066, 760, 576, 10218, 829, 11, 1221, 1817, 1565, 313, 14944, 7808, 438, 37107, 85, 16, 20227, 63, 11464, 1105, 9245, 91, 1565, 2810, 14524, 2368, 63, 760, 7546, 760, 576, 32868, 279, 4712, 17026, 518, 3055, 9245, 91, 1565, 34618, 63, 760, 914, 760, 576, 4712, 594, 4842, 1555, 26, 27122, 979, 279, 4712, 6682, 6857, 9245, 91, 1565, 86, 32746, 63, 760, 2710, 760, 23177, 1565, 3849, 63, 389, 279, 9862, 21059, 9245, 91, 1565, 17248, 63, 760, 1633, 760, 1565, 3028, 7808, 1565, 9357, 63, 323, 1565, 22731, 63, 304, 5820, 28552, 9357, 63, 374, 220, 15, 701, 5519, 1565, 9502, 63, 979, 279, 4712, 6682, 825, 25, 54443, 594, 43405, 14569, 26, 389, 19170, 279, 1882, 42627, 11, 504, 61732, 50670, 11, 1207, 16929, 18, 13, 20, 12, 17, 33, 11, 1207, 16929, 18, 13, 23, 12, 99951, 33, 11, 1207, 16929, 18, 13, 20, 5251, 78, 36, 11, 17242, 9292, 11, 5588, 44, 12, 20, 13, 18, 12, 23809, 323, 5588, 44, 12, 20, 13, 18, 320, 3257, 20077, 23, 1215, 17242, 9292, 323, 2176, 5588, 21582, 912, 1565, 9502, 7808, 862, 2795, 3930, 13, 53335, 5541, 504, 279, 1008, 19170, 8520, 9245, 91, 1565, 24746, 63, 760, 1633, 760, 1565, 49667, 7808, 1565, 49217, 7808, 1565, 18167, 28735, 5678, 29531, 7808, 1565, 30432, 483, 28735, 5678, 29531, 63, 9245, 91, 1565, 4366, 63, 760, 914, 760, 576, 4879, 419, 3538, 572, 5798, 504, 9245, 91, 1565, 20895, 63, 760, 914, 760, 576, 19127, 5798, 304, 25, 1565, 53648, 7808, 1565, 33763, 7808, 1565, 2151, 63, 476, 1565, 87, 5584, 76960, 27122, 504, 264, 1936, 2041, 825, 9245, 91, 1565, 6111, 63, 760, 914, 760, 576, 22611, 279, 3538, 8927, 11, 553, 279, 5579, 594, 829, 26, 27122, 979, 432, 4157, 1349, 825, 35543, 63, 24746, 78340, 63, 14569, 4303, 323, 8579, 7388, 11, 323, 1565, 24746, 16280, 287, 63, 279, 8579, 6174, 624, 63, 18167, 28735, 5678, 29531, 63, 374, 279, 11206, 29106, 304, 279, 1537, 220, 17, 274, 11, 17753, 553, 220, 17, 13, 1565, 30432, 483, 28735, 5678, 29531, 63, 374, 279, 198, 4259, 9929, 1494, 594, 20769, 3854, 11206, 916, 1181, 882, 11, 6839, 369, 220, 17, 274, 1283, 279, 1494, 10330, 323, 220, 15, 5937, 13, 11727, 7813, 525, 198, 43738, 311, 825, 12116, 13, 3066, 2820, 2581, 65714, 279, 16148, 11, 448, 476, 2041, 6894, 13, 16913, 19519, 389, 37107, 12114, 63, 323, 37107, 3989, 546, 12030, 13, 576, 8650, 37107, 17248, 63, 6021, 1083, 6682, 4938, 2041, 77401, 432, 323, 7460, 264, 1376, 979, 6894, 525, 19718, 382, 63, 3806, 608, 85, 16, 20227, 63, 320, 437, 37107, 6507, 32725, 11248, 1565, 1700, 25, 330, 1607, 39700, 448, 825, 1565, 691, 63, 4343, 817, 10218, 3034, 323, 15522, 25, 1565, 307, 12885, 63, 1700, 25, 330, 2528, 1, 7808, 1565, 7120, 63, 320, 1782, 1482, 51525, 882, 701, 1565, 18303, 3710, 25, 330, 45832, 19923, 1, 7808, 323, 11, 979, 279, 4712, 6682, 264, 198, 2147, 3241, 11, 1565, 2147, 5118, 63, 323, 1565, 2810, 5047, 6043, 7808, 2176, 429, 3241, 13, 362, 1614, 279, 4712, 6682, 438, 32559, 198, 72431, 1565, 19857, 287, 44364, 1565, 2258, 18191, 7808, 1565, 2258, 51604, 371, 63, 979, 279, 3811, 59094, 1565, 19857, 287, 51604, 371, 7808, 323, 198, 63, 18187, 51604, 18920, 7808, 279, 3811, 594, 5866, 5519, 1565, 6697, 63, 979, 279, 3811, 702, 264, 7274, 3398, 382, 11505, 9862, 4343, 10330, 448, 1565, 1355, 9758, 7808, 279, 2213, 949, 4494, 279, 1614, 4990, 25, 1565, 1183, 1318, 1341, 7808, 5519, 52951, 1805, 39700, 979, 198, 275, 572, 3855, 448, 1565, 313, 13006, 63, 28552, 1805, 2903, 63, 5479, 701, 5519, 52951, 9981, 39700, 979, 1181, 29186, 15792, 2766, 323, 419, 3538, 198, 32533, 279, 1565, 2740, 8932, 9981, 63, 15580, 28552, 9981, 2903, 63, 5479, 701, 369, 3110, 1565, 1183, 1318, 497, 330, 1805, 497, 330, 9981, 1341, 28487, 576, 3538, 27535, 432, 198, 13176, 518, 20524, 11, 323, 7388, 525, 16037, 553, 279, 1852, 2097, 25, 264, 1565, 9981, 2903, 63, 949, 311, 458, 4343, 2041, 52951, 9981, 39700, 5221, 198, 9227, 220, 102259, 28552, 11802, 7893, 4096, 63, 701, 2581, 264, 220, 100840, 13, 17128, 1565, 2740, 8932, 9981, 63, 279, 20524, 1487, 2727, 773, 3055, 382, 785, 13020, 220, 15, 13, 21, 13, 21, 3538, 594, 2487, 43293, 25, 1181, 19577, 55, 1565, 17248, 63, 646, 912, 1565, 48102, 7808, 1565, 66415, 68365, 63, 323, 1565, 5334, 1350, 7808, 323, 1181, 54443, 198, 4030, 21259, 279, 31400, 7481, 1212, 508, 70213, 9529, 2, 70465, 568, 1752, 4938, 12390, 389, 264, 7401, 11, 990, 198, 82459, 14, 17248, 84006, 17248, 1737, 18904, 21274, 8, 320, 275, 3880, 264, 1376, 979, 6894, 525, 19718, 8, 476, 37107, 43016, 63, 1248, 63, 45832, 19923, 25, 4630, 75157, 1350, 12518, 61898, 565, 23477, 264, 1681, 271, 63, 2946, 608, 85, 16, 14, 36059, 9384, 307, 4472, 18484, 63, 320, 269, 37107, 36059, 9384, 307, 4472, 18484, 32725, 61869, 2010, 264, 4303, 476, 56779, 1681, 553, 279, 877, 1181, 198, 20987, 23313, 25, 264, 6236, 9750, 594, 1565, 9682, 6226, 500, 12, 7808, 264, 9750, 594, 1565, 6226, 500, 12, 7808, 476, 264, 79817, 1565, 18214, 62, 63, 877, 13, 576, 4712, 4990, 198, 1782, 1852, 9118, 264, 2943, 28864, 21259, 11, 323, 1449, 1008, 4269, 594, 11206, 525, 34684, 13, 576, 9846, 10330, 1632, 14113, 198, 4197, 279, 11206, 432, 1030, 320, 6697, 979, 432, 572, 56779, 1648, 1565, 30033, 38025, 25, 330, 94483, 1, 7808, 476, 264, 79817, 1565, 2829, 25, 330, 94483, 8804, 258, 1181, 1565, 2322, 1858, 14727, 63, 1538, 13, 362, 4463, 62565, 2484, 8472, 902, 4623, 19494, 13, 576, 4226, 374, 220, 98867, 198, 63, 4913, 307, 788, 59933, 330, 1700, 788, 330, 2035, 22196, 497, 330, 94483, 788, 830, 28251, 476, 220, 99698, 19, 448, 279, 2038, 1565, 2035, 7913, 21430, 63, 979, 902, 198, 2035, 9977, 279, 877, 25, 432, 572, 5326, 700, 11, 476, 2581, 24226, 13, 1527, 877, 374, 5644, 504, 279, 1681, 594, 1191, 3080, 1181, 9846, 374, 198, 25490, 11, 773, 264, 9118, 429, 29569, 438, 279, 9846, 10330, 10896, 429, 13382, 438, 432, 572, 13, 576, 2487, 11, 421, 894, 11, 374, 12030, 382, 2354, 5333, 6894, 432, 374, 458, 3986, 6021, 25, 264, 2480, 476, 77021, 2882, 60, 63, 1376, 1231, 9118, 504, 894, 2621, 11, 264, 46670, 1376, 5221, 220, 99698, 18, 198, 63, 1330, 26597, 23136, 63, 320, 4060, 508, 1592, 50266, 9529, 2, 792, 30202, 18492, 593, 323, 264, 7402, 1376, 220, 99698, 16, 13, 362, 3538, 2041, 6894, 11248, 1172, 264, 198, 55748, 6693, 7575, 374, 389, 279, 6337, 1419, 2621, 320, 115925, 13, 15, 13, 15, 13, 15, 14, 23, 476, 3504, 16, 8, 323, 40393, 5019, 770, 448, 220, 99698, 18, 198, 63, 10493, 1419, 18380, 7808, 773, 458, 1787, 3538, 2581, 15342, 825, 2943, 9118, 2441, 594, 1681, 13, 576, 7575, 594, 1828, 2621, 27535, 280, 64, 51903, 2621, 374, 2581, 1349, 13, 42132, 264, 9926, 13283, 1449, 19827, 594, 7575, 374, 279, 13283, 594, 11, 773, 264, 1376, 1717, 3538, 198, 18621, 40393, 264, 1681, 429, 23313, 1565, 25844, 291, 7808, 1565, 55, 12, 25844, 291, 12, 2461, 7808, 1565, 55, 12, 25844, 291, 12, 9293, 7808, 1565, 55, 12, 12762, 12, 3298, 7808, 1565, 54065, 12885, 63, 9646, 12, 62482, 12, 3298, 63, 476, 1565, 2514, 12, 2959, 12, 3298, 28487, 362, 13283, 429, 11362, 6857, 315, 1105, 4157, 387, 3229, 10742, 504, 264, 2205, 19827, 25, 2968, 198, 64, 21491, 1122, 3538, 6894, 382, 565, 576, 79817, 5333, 271, 63, 2946, 608, 85, 16, 32280, 22589, 63, 4990, 5264, 15457, 594, 79817, 1681, 323, 8472, 432, 438, 279, 13569, 6236, 9750, 11, 1526, 279, 198, 23995, 7013, 323, 4712, 1815, 13, 362, 2033, 702, 429, 6236, 9750, 594, 9929, 323, 11206, 320, 1782, 1565, 45832, 19923, 63, 2504, 594, 198, 63, 5839, 48529, 63, 9068, 701, 63139, 11, 323, 16801, 1181, 52951, 44731, 788, 895, 63, 1598, 323, 1181, 13520, 1598, 382, 12, 1565, 1355, 63, 374, 264, 914, 476, 264, 1140, 315, 3589, 25, 6605, 28552, 1355, 4326, 7808, 1565, 3006, 4326, 7808, 1565, 1318, 63, 323, 1565, 1097, 35239, 63, 5479, 11, 6693, 198, 220, 1467, 476, 42906, 1467, 9041, 1946, 1467, 26, 1565, 1355, 4954, 63, 389, 264, 3538, 3855, 448, 1565, 313, 13006, 63, 369, 264, 1614, 429, 15792, 198, 220, 5335, 26, 1565, 1355, 2458, 63, 448, 7381, 11353, 82, 389, 264, 3538, 3855, 448, 1565, 313, 13006, 1177, 13006, 96803, 63, 701, 1565, 1688, 13420, 12885, 220, 1565, 1688, 13420, 7645, 63, 320, 1199, 1565, 3006, 63, 1467, 11, 476, 1565, 1355, 4326, 7808, 1565, 1355, 4954, 63, 323, 1565, 1355, 2458, 63, 5479, 1212, 279, 1852, 198, 220, 2168, 323, 11353, 5601, 701, 323, 1565, 19857, 287, 63, 3589, 448, 862, 1565, 1796, 63, 1467, 11, 892, 279, 3811, 5221, 1182, 438, 279, 1790, 198, 220, 17821, 1943, 594, 1565, 19857, 287, 7495, 28487, 1565, 61856, 63, 9041, 279, 1849, 1943, 323, 374, 537, 11685, 311, 264, 2937, 198, 220, 2484, 624, 12, 1565, 15906, 63] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/prompts/p8192.json b/docs/receipts/glm-decode-pdl-60e67379/prompts/p8192.json new file mode 100644 index 00000000000..5d23ea29009 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/prompts/p8192.json @@ -0,0 +1 @@ +[2, 25955, 74937, 389, 5515, 320, 29624, 692, 63, 45832, 19923, 15586, 19363, 63, 8472, 389, 5515, 448, 458, 33399, 22611, 1526, 279, 1852, 54443, 4712, 279, 14330, 1936, 5711, 11, 323, 448, 458, 198, 57311, 22611, 1526, 279, 79649, 19127, 979, 279, 1936, 12179, 304, 28552, 12, 35, 2151, 11260, 58800, 19170, 374, 66689, 594, 13, 5515, 374, 7248, 504, 198, 2427, 1172, 624, 785, 8574, 6682, 10630, 55, 220, 99698, 24, 15, 28552, 87, 102807, 62, 102636, 96378, 7808, 1565, 3563, 62, 103502, 32725, 323, 33399, 10630, 55, 26382, 451, 16, 55, 28552, 64, 1113, 102636, 96378, 7808, 1565, 3563, 62, 116045, 32725, 8472, 624, 22176, 3671, 56100, 614, 537, 1012, 54253, 389, 279, 18371, 4916, 382, 565, 3555, 498, 1184, 271, 12, 1527, 33399, 22611, 323, 264, 1482, 3037, 5579, 320, 275, 17701, 1565, 77, 7362, 8052, 22145, 76960, 902, 54443, 65414, 374, 4362, 311, 1598, 4292, 12, 2014, 1936, 25, 508, 57, 343, 220, 15, 13, 99419, 13, 15, 9529, 2428, 1110, 35188, 5205, 2659, 33468, 50474, 320, 1782, 2319, 304, 73514, 35188, 45098, 63, 701, 279, 54443, 54410, 198, 220, 320, 99366, 1993, 12504, 8, 369, 1565, 36749, 638, 7808, 323, 10287, 11282, 356, 1027, 7854, 13843, 448, 279, 356, 1027, 53239, 28552, 564, 19363, 7808, 31309, 638, 594, 3468, 19378, 3593, 565, 7854, 271, 3830, 264, 330, 87, 102636, 16686, 13843, 1, 9929, 320, 269, 1283, 4303, 1565, 7362, 15368, 102636, 80744, 7808, 476, 1565, 7362, 15368, 541, 80744, 6773, 102636, 22819, 67, 102636, 63, 389, 5515, 30368, 102636, 701, 773, 198, 63, 564, 19363, 63, 374, 389, 1565, 13584, 63, 1447, 73022, 13709, 198, 35188, 1936, 9862, 4582, 481, 35, 3563, 28, 103502, 481, 35, 13097, 11260, 74800, 220, 481, 35, 36749, 638, 35046, 79638, 7944, 69098, 6863, 1699, 85, 638, 19363, 698, 13865, 19288, 63, 12, 35, 3563, 63, 4990, 279, 22611, 594, 12558, 22245, 2041, 279, 12750, 11, 31550, 18630, 369, 3807, 25, 220, 102807, 320, 5350, 55, 220, 99064, 701, 220, 103502, 320, 5350, 55, 220, 99698, 1326, 103005, 320, 5350, 55, 220, 99200, 701, 220, 116045, 320, 5381, 98668, 608, 10630, 55, 26382, 451, 16, 55, 568, 576, 3538, 374, 1565, 35188, 9789, 1699, 1388, 59, 6863, 4955, 3805, 19923, 15586, 19363, 16890, 63, 35188, 9789, 59, 6863, 4955, 69, 1786, 8052, 16821, 19363, 63, 8472, 279, 22611, 54794, 28552, 8932, 1786, 8052, 16821, 3546, 7808, 1565, 3563, 4740, 7808, 1565, 6072, 361, 7808, 1565, 13602, 7808, 1565, 30330, 42762, 12885, 63, 2649, 482, 23, 7808, 1565, 2528, 2912, 7808, 1565, 327, 18983, 23, 63, 3593, 63, 35188, 1936, 1273, 63, 8472, 279, 3468, 7032, 2041, 264, 22611, 382, 14364, 576, 3468, 7032, 389, 264, 5662, 448, 902, 39713, 22611, 271, 785, 3468, 16168, 3880, 1172, 73187, 25, 902, 54443, 65414, 11, 902, 10287, 11282, 320, 57, 343, 594, 1828, 18231, 22056, 279, 356, 1027, 3468, 3542, 701, 4302, 31158, 624, 6727, 389, 264, 220, 98546, 20, 5515, 220, 98668, 20595, 320, 48786, 600, 22, 12, 101655, 17, 15, 88878, 11, 3040, 35526, 11, 220, 99317, 18831, 26, 1181, 33777, 220, 24, 101411, 44, 374, 3685, 279, 54443, 1936, 594, 1525, 62, 99695, 198, 30331, 8, 448, 73187, 220, 15, 13, 99419, 13, 15, 504, 279, 22758, 10303, 11, 389, 1887, 518, 220, 24, 67, 21, 69, 16, 67, 100928, 66, 320, 115937, 21, 12, 98965, 12, 100590, 7731, 12, 1565, 35188, 1936, 1273, 63, 504, 4302, 25, 4869, 220, 15, 304, 220, 107271, 22, 274, 13, 5005, 11, 448, 73514, 35188, 36489, 63, 6963, 323, 279, 3644, 73187, 6500, 8204, 345, 220, 1565, 35188, 1936, 1273, 1177, 1708, 678, 44364, 1565, 11061, 21466, 25, 220, 101474, 16, 14, 101474, 16, 7354, 25253, 26, 220, 21, 100632, 16, 14, 101411, 16, 19, 7032, 5823, 320, 122876, 34983, 8, 7808, 4869, 198, 220, 220, 15, 11, 220, 111659, 24, 274, 13, 1084, 23408, 2632, 369, 4420, 518, 264, 882, 26, 279, 12120, 1555, 323, 279, 4869, 2038, 525, 279, 1102, 624, 12, 73187, 220, 15, 13, 99419, 594, 1936, 22202, 23408, 264, 3019, 594, 4916, 11, 1181, 16987, 26351, 323, 264, 1565, 16077, 3210, 18703, 1555, 369, 1449, 3019, 429, 198, 220, 6139, 311, 26351, 11, 18958, 5230, 320, 1782, 45466, 3671, 75694, 18958, 11, 23996, 12626, 11, 279, 1565, 8932, 40864, 22145, 63, 1555, 198, 220, 3685, 568, 362, 4641, 3019, 702, 458, 1565, 841, 18703, 1555, 323, 279, 1936, 41848, 2477, 36737, 26, 13857, 6932, 304, 429, 1598, 624, 12, 576, 1598, 6941, 220, 112891, 12454, 34983, 7032, 4815, 1181, 220, 122876, 90754, 25, 220, 101140, 4815, 1565, 436, 12393, 621, 659, 26989, 63, 304, 279, 1273, 594, 1828, 198, 220, 2530, 320, 1782, 1376, 1034, 594, 220, 15, 99618, 15, 7882, 7032, 11, 1681, 5224, 11, 19547, 76156, 22724, 11, 3687, 11797, 70722, 323, 54443, 18073, 58159, 4221, 198, 220, 1105, 701, 220, 24, 4815, 330, 22799, 1014, 15492, 1184, 25472, 389, 5515, 497, 220, 99241, 66689, 15370, 11, 220, 24, 14330, 15370, 11, 323, 220, 102340, 4815, 264, 29186, 345, 220, 12501, 11, 3671, 476, 2441, 7616, 13, 24803, 14552, 320, 6086, 11, 1752, 13393, 8, 476, 458, 31158, 9929, 8472, 279, 11621, 198, 220, 82532, 7032, 11, 892, 10701, 1172, 389, 1565, 14954, 54118, 76960, 2326, 803, 82532, 7032, 11, 304, 1565, 2153, 14, 12669, 291, 10490, 4452, 3938, 343, 12885, 220, 10701, 389, 5515, 8819, 279, 25472, 320, 276, 1565, 436, 12393, 621, 659, 26989, 63, 7616, 8, 323, 525, 4221, 279, 220, 99366, 10701, 4357, 279, 198, 220, 825, 14309, 18557, 1598, 1521, 537, 829, 624, 12, 1230, 9959, 279, 73187, 4139, 448, 5515, 6, 1828, 1565, 26651, 19363, 63, 28552, 34, 7190, 13156, 83855, 101175, 4955, 277, 19363, 481, 5848, 85104, 6558, 102807, 62, 102636, 96378, 12, 15, 13, 99419, 13, 15, 20944, 12885, 220, 220, 101140, 274, 1215, 73388, 594, 1565, 38738, 6691, 95384, 63, 3867, 220, 99446, 23, 274, 11, 323, 21073, 369, 5515, 6, 4253, 1565, 26651, 7808, 979, 1181, 1565, 7063, 59, 6863, 63, 374, 1156, 389, 198, 220, 1565, 13584, 7808, 1558, 537, 1349, 1147, 3077, 624, 12, 362, 1273, 389, 264, 504, 30652, 4916, 18392, 264, 9953, 11, 1565, 8932, 40864, 22145, 374, 2567, 369, 32774, 2550, 323, 2567, 5392, 198, 220, 6738, 76960, 1490, 508, 96638, 2550, 323, 2567, 5392, 6738, 9529, 2, 50807, 59112, 9772, 62032, 40003, 1786, 5583, 8, 369, 1380, 264, 198, 220, 2530, 1936, 5221, 432, 624, 12, 576, 1565, 12663, 18, 63, 279, 7375, 6, 11288, 829, 1231, 387, 279, 5100, 9126, 15522, 389, 5515, 26, 264, 10130, 2659, 4582, 374, 1565, 12663, 61898, 14364, 79649, 271, 2212, 93010, 35, 2151, 11260, 481, 35, 2151, 12, 1113, 38490, 1113, 43376, 323, 829, 264, 79649, 19378, 26, 279, 1936, 4990, 1565, 2151, 638, 19363, 63, 1156, 323, 1565, 2151, 638, 80744, 63, 2086, 345, 1499, 93010, 35, 2151, 638, 7808, 1565, 13584, 7808, 476, 1565, 67560, 7944, 63, 14, 63, 1285, 9980, 7944, 63, 6, 82, 1565, 6863, 7808, 323, 8472, 264, 73514, 13709, 63, 1526, 1565, 8709, 608, 66, 1618, 63, 1447, 73022, 13709, 198, 35188, 1936, 9862, 12, 2151, 481, 35, 2151, 11260, 481, 35, 2151, 12, 1113, 36968, 8297, 111508, 16, 74800, 220, 481, 35, 2151, 638, 40689, 7190, 696, 1176, 59, 54742, 111508, 16, 12, 98668, 13, 16, 13, 15, 59, 6863, 59, 2151, 638, 19363, 198, 13865, 19288, 785, 34878, 594, 5515, 1565, 54742, 111508, 16, 63, 1582, 323, 264, 79649, 26537, 594, 1565, 2151, 638, 19363, 63, 2176, 1936, 279, 63062, 13, 576, 3538, 20861, 279, 15580, 504, 198, 63, 67420, 2151, 102636, 22145, 63, 320, 1782, 5579, 594, 2975, 304, 739, 101175, 701, 1221, 504, 264, 79649, 26537, 594, 1565, 67420, 2151, 102636, 62, 22, 22145, 63, 323, 1565, 67420, 2151, 102636, 62, 21, 22145, 63, 389, 1565, 13584, 16890, 63, 51, 43957, 37, 7863, 2039, 3298, 63, 5036, 825, 6733, 38917, 11, 389, 1449, 5339, 13, 61906, 4990, 1181, 8038, 504, 279, 5579, 11, 323, 279, 198, 12801, 20146, 525, 1730, 553, 862, 5515, 5036, 28552, 27594, 48980, 22145, 7808, 1565, 44, 3810, 2752, 22145, 7808, 1565, 148415, 14483, 102636, 62, 99366, 22145, 63, 3593, 785, 5515, 79649, 26537, 1558, 537, 4211, 47174, 36881, 320, 73073, 76, 23290, 3298, 2, 100632, 19, 15, 701, 773, 264, 5827, 429, 17045, 369, 825, 8472, 14386, 26, 279, 198, 8511, 594, 1828, 36881, 653, 537, 990, 1105, 13, 17128, 264, 22611, 11, 1565, 35188, 1936, 18115, 38381, 16821, 481, 35, 2151, 11260, 63, 8472, 279, 25215, 7032, 323, 198, 63, 35188, 1936, 1779, 15586, 12, 2151, 38381, 481, 35, 2151, 11260, 63, 1367, 3658, 279, 1931, 3538, 2348, 79331, 63062, 13, 87773, 389, 1565, 54742, 111508, 16, 3989, 2785, 88, 5679, 15223, 8333, 10, 220, 101294, 20, 1648, 1565, 2151, 2371, 5584, 16821, 63, 220, 100919, 14, 100919, 389, 279, 3671, 11, 323, 1565, 93598, 1177, 2236, 63, 6682, 279, 79649, 19127, 448, 62880, 9385, 1911, 198, 437, 386, 3810, 2752, 1730, 382, 565, 6452, 271, 73022, 13709, 198, 45832, 19923, 15586, 6815, 25955, 74937, 20249, 29243, 11245, 336, 50670, 12, 18, 13, 20, 8124, 491, 1229, 12, 99064, 33, 6691, 18, 33, 12, 2668, 55, 12, 19, 4489, 198, 45832, 19923, 15586, 4119, 198, 45832, 19923, 15586, 8682, 366, 2528, 1815, 29, 1177, 606, 2205, 28147, 1177, 45824, 220, 16, 1177, 2147, 220, 23, 98729, 17, 1177, 34388, 220, 15, 1177, 2152, 98112, 198, 13865, 19288, 785, 3538, 63195, 389, 1565, 1254, 1110, 115925, 13, 15, 13, 15, 13, 16, 25, 99695, 23, 15, 5457, 16, 28487, 36821, 70260, 320, 269, 15304, 279, 2339, 8, 17906, 432, 96064, 382, 14364, 16125, 3073, 2550, 323, 2567, 5392, 6738, 271, 63, 2322, 8952, 63, 323, 264, 2567, 476, 6941, 1565, 14163, 31798, 63, 1184, 279, 31297, 6733, 11, 1565, 8932, 40864, 22145, 7808, 304, 198, 63, 35188, 9789, 1699, 1388, 59, 2740, 63, 29279, 279, 3538, 594, 1565, 6863, 28487, 17128, 432, 1846, 7388, 633, 10125, 220, 102259, 323, 4297, 770, 17026, 624, 11061, 432, 504, 279, 47414, 856, 40864, 27175, 1447, 73022, 13709, 198, 12875, 14705, 1177, 17913, 348, 15, 13, 17, 13, 23, 1177, 75160, 325, 17940, 11520, 3703, 1110, 5204, 905, 59134, 66, 12, 2143, 10771, 40864, 198, 35188, 1936, 31297, 481, 35, 87, 40864, 7846, 6484, 69098, 87, 40864, 198, 13865, 19288, 2271, 291, 389, 458, 10630, 55, 220, 99200, 24, 15, 448, 61732, 50670, 220, 18, 13, 20, 33682, 25, 5264, 15457, 52951, 6279, 39700, 323, 6941, 7375, 11, 16564, 43684, 1565, 3767, 63, 323, 1565, 14163, 12885, 63, 2236, 25293, 63, 323, 1565, 2236, 5314, 61898, 565, 26788, 389, 54443, 271, 45, 336, 50670, 220, 18, 13, 20, 33682, 17026, 438, 389, 14330, 13, 576, 1207, 16929, 18, 13, 20, 95298, 614, 264, 54443, 4712, 315, 862, 1828, 304, 419, 2635, 198, 5809, 35188, 13428, 6663, 58497, 33731, 16929, 18, 62, 20, 2899, 8052, 19884, 35188, 7808, 63062, 1565, 35188, 14100, 42087, 2899, 8052, 33731, 16929, 100235, 19884, 20159, 63, 701, 279, 19170, 63062, 6, 34612, 448, 198, 1782, 1852, 51223, 3501, 11, 773, 264, 3241, 315, 705, 311, 220, 99317, 6978, 14493, 1603, 825, 34668, 7354, 2699, 369, 2699, 1447, 73022, 13709, 198, 45832, 19923, 15586, 8682, 366, 48, 16929, 18, 13, 20, 12, 17, 33, 12, 2668, 55, 12, 19, 4489, 29, 1177, 606, 2804, 16929, 17, 65, 1177, 2147, 220, 18, 99951, 101840, 198, 45832, 19923, 15586, 8682, 366, 48, 16929, 18, 13, 23, 12, 99951, 33, 12, 2668, 55, 12, 19, 4489, 29, 1177, 606, 2804, 16929, 99951, 65, 1177, 2147, 220, 23, 98729, 17, 1177, 45824, 220, 19, 74800, 220, 1177, 22191, 1046, 366, 48, 16929, 18, 13, 23, 12, 99951, 33, 9416, 23809, 17, 397, 13865, 19288, 12, 1207, 16929, 18, 13, 20, 12, 17, 33, 25, 911, 220, 121910, 11206, 2687, 369, 825, 1681, 389, 458, 10630, 55, 220, 99698, 24, 15, 11, 220, 16, 11, 100840, 3941, 8062, 624, 12, 1207, 16929, 18, 13, 23, 12, 99951, 33, 320, 99317, 15380, 33, 1648, 220, 99698, 11206, 2687, 14386, 11, 518, 279, 3701, 594, 4938, 33234, 26, 220, 110672, 3941, 8062, 7388, 624, 12, 1565, 313, 22191, 1046, 63, 320, 19, 15245, 1172, 8, 20861, 1147, 2852, 370, 594, 422, 23809, 17, 9955, 1614, 25, 279, 2169, 13905, 4236, 13608, 6, 96720, 1119, 264, 10053, 198, 220, 369, 432, 11, 323, 432, 63139, 264, 4916, 315, 705, 311, 220, 98886, 32868, 264, 4778, 429, 279, 4778, 6337, 594, 49393, 20770, 504, 1128, 279, 2169, 198, 220, 3867, 13, 362, 46379, 55604, 1681, 1622, 2539, 518, 220, 99695, 311, 220, 107271, 11206, 2687, 553, 1246, 43852, 279, 1467, 374, 320, 776, 325, 518, 279, 3347, 835, 345, 220, 2038, 518, 279, 1550, 701, 48569, 6174, 518, 220, 99200, 311, 220, 100096, 11, 323, 3040, 518, 3055, 5545, 911, 220, 107271, 23129, 26, 30517, 4717, 19479, 311, 198, 220, 14386, 46826, 13, 17910, 4990, 911, 220, 99695, 274, 25, 279, 43841, 1046, 594, 14314, 525, 10267, 1506, 311, 220, 19, 9468, 389, 279, 3468, 323, 1449, 198, 220, 6083, 374, 1598, 3055, 11, 438, 279, 5579, 73001, 264, 1882, 594, 1156, 990, 315, 1817, 9996, 323, 4147, 624, 12, 362, 10141, 3241, 594, 6978, 525, 537, 10653, 927, 15509, 25, 1817, 4269, 18392, 1181, 6978, 6, 74600, 8836, 323, 264, 2506, 5791, 942, 279, 198, 220, 11660, 1815, 11, 773, 279, 220, 99951, 33, 7424, 220, 101175, 6978, 264, 4637, 1380, 220, 23, 4946, 1573, 624, 12, 1565, 10803, 16728, 1718, 28, 16, 63, 23408, 1817, 10141, 11, 2506, 11, 34138, 323, 3331, 594, 30386, 323, 279, 37759, 6083, 320, 8818, 476, 32868, 317, 220, 1565, 10803, 9097, 1139, 787, 1570, 28, 16, 63, 63139, 26098, 1172, 624, 12, 2308, 9929, 6500, 28552, 313, 40358, 36489, 2371, 579, 63, 701, 1565, 313, 12669, 63, 476, 1565, 313, 19305, 63, 369, 1493, 1378, 4119, 382, 14364, 49846, 9344, 66720, 271, 785, 1207, 16929, 18, 13, 20, 4712, 1083, 20861, 19577, 55, 66720, 6693, 13445, 6777, 862, 1828, 63948, 320, 1782, 2193, 594, 1565, 30330, 2022, 3989, 2005, 5036, 264, 2374, 817, 4688, 11, 438, 74813, 2852, 76, 594, 9515, 18594, 323, 279, 16538, 72, 48, 323, 297, 48, 48417, 3270, 701, 220, 17, 311, 220, 23, 9468, 304, 198, 16735, 315, 220, 102636, 13, 8884, 4688, 26473, 518, 1181, 1828, 2374, 25, 220, 19, 15245, 13445, 389, 279, 220, 19, 15245, 20450, 438, 1573, 11, 220, 17, 11, 220, 18, 11, 220, 20, 323, 220, 21, 15245, 6174, 198, 263, 1565, 2649, 482, 23, 520, 84, 63, 6, 82, 20450, 315, 429, 2374, 11, 323, 220, 23, 15245, 6174, 389, 1181, 4922, 20450, 320, 64, 220, 22, 15245, 4688, 1035, 1896, 279, 220, 23, 15245, 20450, 4292, 11505, 2374, 8472, 279, 220, 19, 15245, 21224, 479, 2716, 53, 594, 34612, 323, 6078, 1181, 21613, 2121, 279, 1852, 38883, 99317, 54147, 11, 773, 264, 2038, 6696, 279, 198, 23995, 9468, 8819, 2374, 432, 374, 9763, 518, 11, 323, 4302, 374, 17949, 13, 1527, 38878, 315, 264, 2374, 1008, 1091, 220, 19, 476, 220, 23, 374, 198, 43365, 6758, 311, 279, 1790, 518, 2795, 13, 5515, 2058, 22739, 825, 34668, 7354, 2699, 369, 2699, 11, 323, 264, 13785, 220, 19, 15245, 29186, 198, 32533, 323, 8472, 6896, 438, 1573, 382, 12, 87773, 389, 458, 10630, 55, 220, 99698, 23, 15, 54436, 320, 99317, 18831, 1648, 1565, 66415, 89044, 45006, 16929, 18, 13, 20, 12, 19, 33, 12, 21317, 72, 48, 12, 19, 4489, 63, 320, 19, 323, 220, 23, 9468, 11, 264, 17318, 220, 23, 15245, 198, 220, 38878, 8, 518, 911, 220, 106464, 11206, 2687, 369, 825, 1681, 323, 220, 102259, 3941, 3040, 11, 323, 1565, 66415, 89044, 45006, 16929, 18, 13, 20, 12, 24, 33, 12, 21317, 72, 48, 12, 19, 4489, 3989, 220, 320, 276, 13058, 1122, 220, 23, 15245, 1968, 8, 518, 911, 220, 100928, 323, 220, 112896, 26, 30517, 7484, 11, 518, 3040, 22983, 323, 448, 52951, 44731, 788, 895, 63, 6144, 624, 12, 1565, 25258, 74937, 45006, 16929, 18, 13, 23, 12, 99951, 33, 16009, 48, 17, 63, 320, 62454, 220, 17, 15245, 11, 220, 116996, 13445, 518, 220, 20, 9468, 8, 4990, 220, 98668, 13, 18, 15380, 33, 11, 773, 279, 220, 99951, 33, 18275, 264, 220, 99317, 18831, 3701, 510, 220, 825, 4269, 518, 264, 220, 101175, 74, 3241, 11, 911, 220, 100461, 311, 220, 102636, 11206, 2687, 448, 63139, 13, 576, 3701, 5086, 6738, 297, 48, 17, 458, 19152, 198, 220, 3347, 15245, 4879, 11, 323, 1181, 30517, 1473, 432, 624, 12, 59089, 26671, 1896, 264, 479, 2716, 44, 916, 279, 1852, 20450, 28552, 2649, 482, 43082, 483, 520, 84, 32725, 448, 279, 220, 19, 15245, 9929, 479, 2716, 44, 594, 34612, 320, 9543, 4680, 17949, 3055, 311, 198, 220, 38883, 99317, 11, 825, 12001, 101175, 8780, 916, 730, 701, 773, 264, 2038, 315, 705, 311, 220, 19, 9468, 6696, 279, 9468, 279, 220, 19, 15245, 9929, 479, 2716, 44, 6696, 432, 13, 1913, 279, 198, 220, 220, 24, 33, 220, 23, 15245, 432, 52714, 50598, 504, 911, 220, 16, 11, 100840, 311, 220, 16, 11, 107578, 11206, 2687, 26, 279, 220, 99951, 33, 297, 48, 17, 594, 50598, 320, 9093, 220, 22, 100096, 11206, 2687, 8, 1033, 198, 220, 2669, 6822, 553, 279, 3701, 594, 38883, 99317, 15614, 4379, 448, 12001, 101175, 45465, 11, 537, 553, 4680, 15792, 624, 12, 1565, 8932, 1786, 8052, 16821, 68308, 23, 63, 12335, 1817, 15014, 2374, 594, 3871, 2348, 1181, 13903, 85180, 8629, 279, 220, 23, 15245, 20450, 11, 2699, 198, 220, 369, 2699, 11, 279, 3871, 2348, 2224, 102636, 11, 1449, 2802, 1760, 323, 6718, 15831, 1815, 4922, 369, 4922, 11, 323, 279, 9929, 479, 2716, 44, 198, 220, 2348, 279, 220, 19, 15245, 323, 220, 23, 15245, 20450, 6, 9929, 479, 2716, 21582, 382, 565, 2585, 279, 2635, 4278, 271, 12, 1565, 35188, 13428, 27205, 41600, 3938, 343, 63, 28552, 31, 474, 445, 7791, 899, 7808, 51780, 1119, 1449, 4688, 553, 1565, 35188, 30473, 41600, 3938, 343, 32725, 374, 279, 10345, 198, 220, 1849, 438, 279, 4712, 6738, 432, 13, 1913, 14330, 323, 66689, 432, 374, 1565, 1834, 520, 7808, 1565, 1834, 12999, 941, 63, 323, 1565, 1834, 909, 1872, 9191, 63, 34684, 26, 389, 5515, 198, 220, 1565, 7526, 666, 3938, 343, 63, 323, 1565, 7526, 6479, 941, 3938, 343, 63, 2968, 279, 1852, 5036, 916, 279, 30395, 5350, 11, 12184, 101175, 323, 12184, 13191, 624, 12, 17356, 525, 8927, 448, 1449, 4332, 3856, 11, 773, 28968, 28155, 323, 47187, 12, 3472, 25607, 35514, 438, 389, 71594, 13, 4248, 2768, 15792, 198, 220, 10701, 279, 2150, 6500, 28552, 6041, 11884, 9097, 14384, 1718, 7808, 438, 1565, 46, 31597, 63, 389, 14330, 568, 37107, 5173, 63, 374, 279, 1196, 594, 13332, 8526, 323, 198, 220, 1565, 27454, 63, 17047, 1182, 311, 1565, 6448, 76612, 18606, 12, 576, 472, 35093, 18564, 6500, 7746, 16281, 3542, 311, 76288, 13, 5515, 6147, 6568, 1014, 15492, 1172, 448, 24803, 14552, 476, 26082, 345, 220, 773, 1565, 23376, 63, 17047, 1182, 311, 2588, 7746, 320, 2152, 4960, 3550, 4292, 12, 4248, 2768, 15792, 990, 14554, 320, 815, 62, 1677, 374, 14330, 594, 4292, 12, 49104, 42446, 63637, 69878, 389, 5515, 320, 20759, 438, 10630, 55, 26382, 451, 16, 55, 1565, 3563, 62, 116045, 32725, 16681, 2348, 279, 467, 4103, 44, 54443, 3671, 7314, 198, 220, 28552, 20159, 18783, 1949, 1731, 2273, 17, 32725, 1393, 10277, 279, 42446, 220, 98668, 4, 20456, 323, 220, 19, 15380, 33, 1638, 6422, 13, 362, 7722, 3671, 22508, 1969, 1779, 198, 220, 279, 467, 4103, 44, 8038, 11, 23691, 89838, 323, 21725, 7761, 26, 2530, 25215, 7484, 1558, 537, 25306, 279, 3671, 624, 12, 576, 5333, 1376, 1034, 374, 10062, 369, 943, 323, 1379, 26, 5515, 13589, 2615, 304, 43212, 82, 11, 537, 3856, 9468, 11, 773, 279, 330, 96007, 480, 553, 198, 220, 1008, 3847, 1, 1779, 374, 279, 8526, 594, 43212, 4751, 1091, 1565, 55895, 220, 103306, 61898, 565, 85089, 504, 14330, 271, 12, 2308, 6399, 62, 1677, 11, 1565, 360, 2353, 63, 476, 14330, 37107, 15770, 3183, 336, 2733, 63, 21678, 11, 323, 902, 1565, 50, 16750, 3124, 63, 320, 1782, 1376, 1034, 374, 2058, 435, 485, 329, 979, 432, 4344, 4292, 12, 1565, 10803, 7867, 828, 45526, 63, 28288, 81467, 15792, 14330, 594, 37107, 7791, 25435, 14, 67623, 63, 323, 1558, 4302, 389, 5515, 624, 2, 65782, 33196, 271, 785, 2331, 5548, 374, 1565, 1254, 1110, 115925, 13, 15, 13, 15, 13, 16, 25, 99695, 23, 15, 5457, 16, 63, 448, 279, 1638, 3538, 5003, 382, 20754, 1565, 13259, 1177, 5365, 15163, 63, 13589, 279, 1482, 16657, 13, 508, 62278, 9529, 55816, 21274, 8, 9290, 1181, 2856, 198, 23231, 46905, 19387, 11, 11459, 2812, 52704, 11, 323, 20524, 12821, 382, 565, 16686, 6236, 3811, 2812, 271, 63, 45832, 19923, 8682, 47668, 1177, 9682, 33249, 2526, 60113, 1169, 41185, 63, 20861, 264, 20036, 12, 23, 38303, 5580, 3811, 504, 429, 1034, 198, 64363, 315, 279, 29186, 594, 3811, 3542, 476, 1565, 84888, 5332, 4323, 63, 19873, 13, 39188, 12710, 8829, 504, 279, 3538, 594, 3238, 6220, 13, 576, 1034, 374, 1349, 3055, 518, 20524, 11, 448, 279, 1852, 220, 99317, 20696, 33, 3930, 438, 279, 29186, 594, 1565, 9682, 8692, 1169, 41185, 61898, 785, 2812, 13460, 2176, 19083, 323, 5392, 90393, 6236, 7388, 26, 432, 1558, 537, 14051, 264, 29186, 594, 8650, 1565, 14163, 15938, 63, 3811, 13, 576, 29186, 594, 45681, 11, 3281, 11206, 323, 48593, 28261, 4717, 34684, 13, 1230, 878, 480, 476, 78613, 19873, 3690, 20524, 1573, 279, 4712, 15873, 11, 2041, 15667, 1182, 311, 279, 29186, 3811, 13, 1527, 4287, 1034, 10896, 6236, 20852, 34813, 11, 438, 264, 29186, 448, 902, 3811, 1558, 13, 22961, 9750, 50598, 653, 537, 990, 279, 6236, 3811, 382, 565, 5333, 6894, 271, 20586, 16279, 4193, 11499, 1565, 313, 2068, 16159, 12007, 7808, 31550, 72132, 1565, 51, 43957, 37, 7863, 11410, 6600, 7808, 323, 1565, 313, 2068, 16159, 14194, 26687, 28487, 576, 8172, 912, 6894, 3786, 13, 362, 1034, 702, 825, 1376, 817, 1555, 11, 10096, 1565, 1502, 25, 1376, 63, 10690, 11, 323, 5128, 5916, 448, 198, 63, 2, 63, 369, 6042, 13, 2573, 1181, 8540, 311, 1565, 15, 99618, 15, 76960, 20524, 40393, 264, 1034, 33636, 553, 1008, 3847, 624, 785, 3538, 10528, 21669, 12, 116265, 4078, 17939, 323, 42222, 1449, 19718, 20836, 369, 1817, 16636, 4774, 382, 11500, 1565, 18096, 25, 425, 20740, 12007, 63, 504, 5264, 15457, 79569, 8238, 11, 476, 1565, 87, 23837, 16159, 25, 12007, 63, 504, 26643, 8238, 13, 35089, 476, 8317, 16373, 470, 10125, 220, 99698, 16, 448, 1565, 45239, 12, 98246, 25, 425, 20740, 63, 323, 279, 6021, 594, 1465, 3561, 13, 3085, 6894, 19718, 11, 279, 9862, 3538, 7460, 264, 1376, 389, 1449, 6021, 553, 1638, 13, 11440, 584, 19548, 525, 7890, 37107, 7808, 37107, 12114, 7808, 37107, 19305, 63, 323, 279, 8062, 22803, 37107, 19305, 14, 63, 19465, 26, 1565, 313, 43016, 25607, 63, 1083, 15873, 7890, 37107, 43016, 7808, 37107, 85, 16, 3183, 13459, 63, 323, 37107, 85, 16, 71347, 28487, 6944, 5413, 323, 9783, 11764, 1373, 264, 1376, 13, 1096, 5646, 1449, 37107, 8945, 603, 63, 44120, 15522, 323, 3853, 869, 11286, 13, 37107, 12114, 63, 8457, 1787, 323, 4675, 1172, 1565, 4913, 2829, 3252, 562, 1, 5541, 979, 6894, 525, 19718, 13, 3066, 2820, 374, 1349, 15370, 11, 2670, 979, 264, 7585, 3239, 374, 17201, 13, 3085, 902, 6894, 11, 1181, 2820, 3565, 7146, 2500, 26, 264, 2477, 60242, 1419, 10714, 23408, 264, 9953, 382, 785, 9862, 3538, 24810, 1181, 8412, 1787, 14194, 3930, 1573, 14279, 979, 279, 5339, 28588, 432, 13, 1416, 1565, 10325, 63, 8472, 700, 315, 47225, 11, 432, 18392, 825, 18788, 1555, 817, 20481, 323, 13589, 264, 2805, 22624, 1182, 1847, 382, 23044, 279, 1376, 1034, 19088, 2673, 311, 16900, 6894, 13, 11440, 17011, 882, 374, 10062, 518, 1429, 3055, 264, 2086, 26, 328, 16750, 3124, 7388, 458, 13913, 18613, 13, 1527, 4287, 11, 59871, 480, 476, 78613, 13714, 33090, 37066, 11286, 3080, 264, 2697, 1034, 4675, 13, 6145, 18392, 323, 1565, 45832, 19923, 25, 36059, 10779, 63, 990, 9198, 11, 2581, 6894, 476, 4078, 17939, 13, 1230, 30128, 6894, 5258, 1565, 19484, 11245, 7808, 1565, 3160, 11245, 63, 476, 1565, 1192, 11245, 63, 9198, 13, 60568, 6644, 518, 1429, 220, 102636, 11925, 11, 18478, 11, 30868, 11, 71242, 476, 6275, 759, 724, 26, 5157, 2477, 68389, 9198, 382, 641, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 594, 508, 2865, 3054, 9529, 2865, 21274, 701, 1565, 45832, 19923, 2473, 4582, 47668, 1177, 2068, 16159, 14194, 26687, 63, 40824, 279, 1034, 311, 1181, 3538, 11, 323, 1565, 45832, 19923, 259, 1963, 1177, 1085, 5548, 1177, 5839, 66970, 53931, 63, 21259, 429, 3890, 594, 897, 438, 264, 69251, 1376, 13, 576, 9862, 7868, 702, 13857, 3210, 13, 83773, 264, 21687, 1034, 916, 3210, 8446, 6894, 11, 892, 646, 4994, 304, 279, 10345, 1849, 594, 1882, 1140, 382, 14364, 5309, 50266, 271, 32, 9862, 1376, 1034, 646, 3930, 264, 1376, 311, 1045, 11286, 13, 9641, 279, 50266, 304, 38721, 1283, 279, 2383, 1447, 73022, 1318, 198, 676, 15363, 2202, 5669, 17885, 6600, 198, 75435, 3362, 58, 878, 5669, 28437, 44298, 6600, 198, 9969, 2190, 15363, 2202, 11, 878, 5669, 2100, 30150, 6600, 198, 3721, 58, 2882, 5669, 41142, 11851, 6600, 198, 39668, 25, 64417, 6600, 198, 13865, 19288, 32, 1376, 2041, 38721, 11, 504, 264, 14386, 1034, 1555, 11, 1565, 313, 2068, 16159, 63, 476, 1565, 51, 43957, 37, 7863, 11410, 6600, 7808, 13589, 1449, 6021, 11, 438, 1573, 13, 77021, 2882, 60, 63, 374, 198, 1782, 1852, 438, 902, 38721, 13, 576, 1008, 50266, 525, 1565, 258, 2202, 7808, 1565, 878, 63, 476, 2176, 11, 31550, 72132, 26, 458, 9783, 11, 11499, 476, 4287, 198, 4186, 11, 476, 1565, 2882, 63, 29279, 2441, 11, 3643, 279, 1034, 8317, 13, 3776, 1376, 4157, 6777, 1378, 6891, 7289, 25, 264, 1034, 429, 6696, 279, 1852, 1376, 198, 63197, 50266, 11, 476, 50266, 264, 1376, 279, 8041, 476, 4573, 2669, 2968, 11, 374, 16037, 518, 20524, 323, 389, 18613, 382, 91, 34746, 760, 22299, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 258, 2202, 63, 760, 12862, 37107, 85, 16, 70793, 25016, 10814, 908, 7808, 37107, 85, 16, 25016, 10814, 908, 7808, 37107, 85, 16, 32280, 22589, 7808, 37107, 85, 16, 71206, 7808, 37107, 85, 16, 71206, 80386, 28735, 7808, 37107, 85, 16, 54024, 551, 7808, 37107, 85, 16, 3446, 295, 1679, 551, 7808, 37107, 85, 16, 70707, 2687, 39371, 7808, 37107, 85, 16, 9733, 4846, 798, 804, 7808, 37107, 85, 16, 58250, 24527, 7808, 37107, 85, 16, 14, 8168, 6805, 7808, 37107, 85, 16, 28042, 603, 7808, 37107, 85, 16, 7382, 261, 1180, 63, 320, 18621, 553, 34210, 701, 37107, 85, 16, 14, 4215, 7808, 323, 279, 1852, 12710, 2041, 37107, 85, 16, 63, 1380, 279, 3538, 702, 1105, 26, 7890, 37107, 85, 16, 20227, 7808, 37107, 6507, 7808, 37107, 85, 16, 14, 40458, 76960, 264, 46752, 13901, 389, 7890, 37107, 85, 16, 32280, 22589, 63, 476, 37107, 70465, 63, 9245, 91, 1565, 878, 63, 760, 7890, 37107, 43016, 7808, 37107, 85, 16, 3183, 13459, 7808, 37107, 85, 16, 71347, 7808, 37107, 17248, 7808, 37107, 85, 16, 79031, 7808, 37107, 16246, 7808, 37107, 18608, 7808, 37107, 85, 16, 3470, 39167, 14, 42073, 7808, 37107, 85, 16, 20227, 7808, 37107, 6507, 7808, 37107, 85, 16, 14, 40458, 63, 35543, 32, 46670, 1376, 24417, 4302, 770, 25, 537, 279, 9763, 79817, 320, 3806, 476, 17177, 37107, 85, 16, 32280, 22589, 14, 915, 63, 701, 78901, 11, 6852, 6577, 1205, 2796, 345, 63, 14, 85, 16, 71472, 1350, 7808, 2441, 1714, 11, 476, 264, 20482, 15522, 1741, 438, 37107, 3145, 25016, 10814, 908, 63, 429, 279, 3538, 11248, 369, 264, 2480, 1376, 13, 576, 6021, 198, 285, 18026, 6896, 1283, 279, 3239, 323, 27654, 86671, 525, 3931, 13, 362, 16037, 6021, 11248, 220, 99698, 18, 448, 279, 2038, 198, 63, 1330, 26597, 23136, 63, 320, 15808, 11286, 25, 458, 16564, 43684, 1565, 22559, 4096, 32725, 323, 33090, 279, 3633, 1573, 279, 2487, 374, 1349, 198, 269, 264, 41994, 1614, 18613, 82, 13, 576, 584, 11286, 4717, 584, 382, 785, 9763, 79817, 9170, 311, 279, 3538, 11, 537, 311, 264, 1376, 11, 773, 264, 46670, 1376, 594, 1565, 2946, 608, 85, 16, 32280, 22589, 63, 1969, 3624, 52951, 4314, 788, 895, 3989, 437, 902, 1565, 19665, 9651, 842, 7808, 448, 279, 4361, 10430, 304, 1565, 1355, 76960, 4113, 770, 11248, 220, 99698, 18, 34774, 279, 2070, 13, 6065, 198, 64, 79817, 7575, 11, 264, 1565, 19665, 9651, 842, 63, 429, 279, 7575, 594, 1828, 6500, 9977, 374, 5420, 13, 362, 1681, 13589, 279, 50266, 198, 275, 572, 11660, 448, 421, 279, 1034, 4344, 1393, 432, 8472, 13, 2463, 18492, 525, 23649, 1172, 25, 1449, 1376, 13240, 825, 1614, 345, 1199, 9929, 6500, 323, 279, 16717, 4192, 565, 16467, 1681, 7102, 271, 785, 3538, 26261, 6238, 8459, 11545, 7167, 448, 37107, 7808, 448, 3239, 1467, 323, 27654, 86671, 32154, 553, 279, 198, 6100, 6021, 13129, 13, 48574, 34832, 11, 34333, 323, 2524, 5820, 525, 16037, 1573, 28952, 13, 22299, 525, 1142, 56285, 198, 437, 3266, 64633, 525, 537, 29106, 1119, 40164, 13, 8393, 10150, 476, 46745, 4247, 5043, 525, 16037, 323, 7877, 382, 1925, 264, 6337, 1419, 10714, 11, 279, 9862, 3538, 26261, 264, 1565, 9293, 63, 34774, 1565, 8300, 63, 476, 264, 6337, 1419, 6790, 11, 448, 894, 2697, 2635, 624, 2132, 12335, 279, 5042, 6822, 7575, 11, 2670, 264, 28018, 429, 19636, 311, 6337, 1419, 13, 35089, 11, 22454, 11, 78613, 476, 198, 28343, 18402, 5258, 10125, 220, 99698, 18, 1573, 16636, 11, 1565, 99457, 14991, 63, 476, 28952, 13, 44540, 1565, 313, 20920, 38381, 19086, 63, 311, 912, 198, 83145, 3468, 11395, 476, 31509, 291, 6790, 74681, 13, 362, 829, 702, 902, 12852, 11, 1815, 476, 2635, 26, 432, 36945, 429, 829, 518, 894, 2635, 624, 785, 5181, 4344, 4247, 25215, 11, 537, 279, 14279, 2621, 13, 362, 2477, 60242, 1419, 10714, 90754, 419, 3468, 19418, 382, 1925, 1449, 10714, 11, 458, 1565, 13290, 63, 1969, 2432, 279, 1681, 594, 1565, 9293, 63, 323, 279, 9862, 3538, 594, 10125, 12852, 13, 16088, 606, 1142, 345, 57660, 21, 12839, 819, 323, 1638, 20284, 525, 29301, 13, 576, 6238, 1969, 387, 264, 3175, 1565, 1254, 1110, 28585, 3447, 5095, 60, 63, 476, 198, 63, 2428, 1110, 28585, 3447, 5095, 60, 63, 897, 448, 902, 1815, 476, 90418, 13, 1565, 2921, 7808, 78613, 2750, 323, 22454, 32227, 525, 16037, 624, 38510, 1565, 313, 20920, 66317, 2726, 55156, 63, 369, 21737, 19548, 11, 2670, 458, 60616, 6238, 1483, 1526, 264, 41419, 13283, 624, 9293, 323, 6238, 19548, 525, 9485, 26, 10688, 458, 6238, 1558, 537, 16681, 264, 7214, 6337, 1419, 16088, 624, 25844, 291, 7102, 653, 537, 3293, 279, 12852, 476, 30597, 2987, 1779, 382, 4854, 220, 99698, 18, 5036, 279, 16037, 4247, 323, 1181, 12153, 4683, 5181, 13, 47116, 2041, 458, 1565, 13290, 7808, 2670, 13948, 345, 31402, 82, 323, 279, 906, 11, 2506, 862, 6350, 7388, 448, 264, 2697, 16088, 13, 8881, 10799, 374, 537, 2567, 553, 1493, 12335, 11, 773, 198, 63, 19887, 481, 67, 63, 7388, 2506, 3238, 13, 576, 3538, 11362, 902, 89916, 7102, 26, 1493, 8041, 653, 537, 7283, 5312, 66317, 6929, 15792, 624, 785, 4247, 12335, 6016, 6929, 2615, 323, 653, 537, 8289, 5333, 6894, 13, 1163, 14267, 12615, 476, 22340, 304, 16088, 476, 17097, 2750, 198, 546, 16037, 26, 8238, 1265, 50709, 429, 15942, 36188, 382, 9293, 323, 17097, 4683, 11464, 1817, 4193, 518, 1429, 220, 102636, 10690, 13, 27506, 5036, 990, 2477, 3194, 39104, 9198, 2041, 264, 27654, 198, 16105, 26, 31427, 21, 74681, 525, 31509, 291, 2041, 10138, 46925, 13, 7209, 10125, 1681, 3880, 6896, 825, 2697, 16088, 11, 2670, 198, 9227, 14, 16, 13, 15, 26, 3468, 1717, 10125, 14, 15, 13, 24, 374, 16037, 323, 7877, 13, 1527, 9247, 10714, 90754, 1172, 6337, 1419, 11489, 25215, 382, 2461, 264, 21737, 13283, 829, 323, 3482, 6238, 11, 369, 3110, 1447, 73022, 927, 198, 45832, 19923, 15586, 8682, 47668, 1177, 20920, 38381, 44120, 7724, 1177, 20920, 66317, 3703, 1110, 258, 2202, 7724, 198, 13865, 19288, 91, 9568, 760, 26589, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 3806, 608, 85, 16, 20227, 63, 760, 328, 2771, 1614, 3034, 323, 894, 19718, 40164, 320, 20981, 16279, 1215, 9862, 10690, 6777, 508, 93598, 9529, 2, 2528, 36498, 8455, 8, 9245, 91, 1565, 3806, 608, 12114, 63, 760, 444, 12775, 11, 279, 10218, 1614, 11, 279, 7177, 323, 3887, 7813, 26, 1787, 448, 6894, 320, 4060, 508, 14532, 9529, 2, 12114, 593, 9245, 91, 1565, 3806, 608, 17248, 7808, 1565, 3806, 608, 85, 16, 79031, 63, 760, 16686, 1349, 15370, 4938, 16281, 11737, 17248, 49101, 9529, 17248, 1737, 18904, 21274, 593, 9245, 91, 1565, 3806, 608, 43016, 7808, 1565, 3806, 608, 85, 16, 3183, 13459, 63, 760, 96323, 1467, 25, 7388, 11, 83952, 64842, 11, 63139, 323, 39058, 320, 20981, 16279, 8, 9245, 91, 1565, 3806, 608, 85, 16, 71347, 63, 760, 576, 28706, 2795, 46645, 438, 825, 4718, 1633, 320, 29624, 3538, 1215, 1490, 508, 38670, 2795, 9529, 2, 62673, 48697, 8, 9245, 91, 1565, 3806, 608, 18608, 63, 760, 16686, 3887, 26879, 2150, 979, 1565, 313, 18608, 63, 374, 8967, 9245, 91, 1565, 3806, 608, 16246, 63, 760, 16686, 4718, 26879, 16281, 979, 1565, 313, 18608, 63, 374, 8967, 9245, 91, 1565, 2946, 608, 85, 16, 70793, 25016, 10814, 908, 63, 760, 2918, 6236, 11, 10096, 2168, 1946, 11, 7375, 323, 32559, 26, 72678, 476, 2477, 38515, 291, 9245, 91, 1565, 2946, 608, 85, 16, 25016, 10814, 908, 63, 760, 22961, 1467, 2041, 264, 6236, 3811, 11, 476, 3950, 28261, 9245, 91, 1565, 2946, 608, 85, 16, 71206, 63, 760, 16564, 43684, 26643, 25, 1467, 11, 7248, 5335, 11, 729, 7375, 323, 7274, 26, 4718, 476, 72902, 9245, 91, 1565, 2946, 608, 85, 16, 71206, 80386, 28735, 63, 760, 13839, 279, 1852, 1614, 9929, 2041, 23100, 9245, 91, 1565, 2946, 608, 5839, 551, 7808, 1565, 2946, 608, 85, 16, 54024, 551, 63, 760, 348, 4086, 44, 594, 25, 264, 1565, 40358, 63, 6, 82, 3950, 28261, 11, 476, 279, 28261, 264, 6236, 1681, 594, 1565, 16311, 63, 3141, 311, 9245, 91, 1565, 2946, 608, 19249, 1679, 551, 7808, 1565, 2946, 608, 85, 16, 3446, 295, 1679, 551, 63, 760, 348, 4086, 44, 594, 25, 279, 1467, 315, 1565, 30446, 7808, 3281, 11206, 5230, 9245, 91, 1565, 2946, 608, 85, 16, 32280, 22589, 63, 760, 5264, 15457, 594, 79817, 5333, 11, 1598, 438, 279, 13569, 6236, 9750, 26, 72678, 476, 2477, 38515, 291, 9245, 91, 1565, 3806, 608, 85, 16, 32280, 22589, 63, 320, 60807, 13901, 8, 760, 5264, 15457, 594, 79817, 508, 60807, 3856, 9529, 2, 82519, 14970, 1648, 1565, 2322, 2520, 63, 4357, 916, 825, 7575, 9245, 91, 1565, 3806, 608, 85, 16, 32280, 22589, 9384, 307, 28251, 1565, 14414, 608, 85, 16, 32280, 22589, 9384, 307, 5541, 760, 362, 9763, 2033, 11, 476, 4057, 432, 9245, 91, 1565, 2946, 608, 85, 16, 14, 8168, 6805, 63, 760, 27018, 11, 5456, 11, 323, 9829, 32942, 47914, 504, 279, 1790, 34668, 60362, 26, 902, 1467, 374, 7907, 9245, 91, 1565, 2946, 608, 85, 16, 71472, 1350, 32280, 3885, 63, 760, 2585, 1753, 315, 264, 6236, 2487, 594, 10430, 64737, 11, 323, 504, 1380, 11737, 263, 13355, 9529, 2, 443, 72432, 10321, 1737, 3187, 593, 9245, 91, 1565, 2946, 608, 85, 16, 71472, 1350, 71347, 63, 760, 362, 6236, 2487, 594, 10430, 1584, 1349, 504, 13355, 1119, 21984, 1431, 9245, 91, 1565, 14414, 608, 85, 16, 71472, 1350, 63, 760, 1096, 1614, 594, 10430, 5302, 389, 13355, 24473, 35543, 1925, 19577, 55, 11, 264, 3459, 908, 2487, 8481, 264, 2477, 3194, 1565, 16311, 63, 1140, 5711, 6236, 11584, 13, 54443, 3459, 908, 198, 22708, 264, 914, 1565, 40358, 63, 28552, 718, 41394, 28735, 7808, 1638, 895, 8, 476, 264, 1140, 315, 3950, 28261, 11, 1598, 438, 2661, 382, 63, 14, 5839, 551, 63, 4990, 348, 4086, 44, 594, 5043, 25, 264, 1565, 40358, 63, 914, 28552, 718, 41394, 28735, 7808, 1638, 830, 701, 476, 1565, 16311, 63, 448, 279, 198, 9682, 5043, 429, 6083, 279, 9929, 28552, 15906, 7808, 1565, 19857, 287, 51604, 371, 7808, 1565, 9682, 8692, 36052, 32725, 323, 1565, 718, 63731, 60990, 3989, 18943, 830, 568, 1084, 4675, 1565, 1830, 7808, 1565, 2810, 5047, 6043, 63, 320, 1782, 2266, 3241, 26, 845, 979, 6857, 374, 738, 389, 19577, 55, 8, 323, 198, 63, 30446, 7808, 323, 1565, 5839, 2895, 82, 63, 448, 1565, 689, 6458, 2895, 82, 25, 830, 28487, 576, 28261, 525, 279, 6174, 279, 6236, 6021, 8472, 369, 279, 1852, 198, 2035, 11, 5335, 323, 6803, 17163, 13, 37107, 19249, 1679, 551, 63, 4990, 1565, 30446, 63, 323, 4675, 1565, 40358, 18606, 641, 279, 13020, 220, 15, 13, 21, 13, 21, 4712, 11, 1565, 313, 13006, 63, 15342, 7248, 1207, 16929, 18, 13, 20, 14, 18, 13, 23, 27855, 66720, 4193, 1565, 1805, 2903, 63, 2213, 5479, 198, 38088, 2929, 1467, 304, 1196, 6605, 323, 304, 5392, 3059, 28552, 5778, 25, 330, 14163, 39700, 701, 1741, 438, 458, 8314, 594, 48415, 13, 576, 9862, 198, 4030, 15792, 5335, 369, 5588, 44, 12, 20, 13, 18, 12, 23809, 11, 1207, 16929, 18, 13, 23, 12, 99951, 33, 323, 31017, 1728, 220, 19, 220, 100557, 33, 389, 19170, 11, 448, 821, 34832, 11, 323, 584, 60616, 34832, 1212, 198, 63, 313, 13006, 12, 20459, 63, 11737, 1805, 1946, 9529, 13006, 21274, 2, 1782, 15586, 26217, 5905, 369, 5588, 44, 12, 20, 13, 18, 12, 23809, 432, 1083, 4990, 1565, 9981, 2903, 63, 5479, 304, 198, 872, 6605, 11737, 9981, 9529, 13006, 21274, 2, 9981, 10321, 10598, 15586, 26217, 39252, 9825, 508, 1805, 1946, 9529, 13006, 21274, 8, 369, 821, 34832, 11, 584, 2168, 34832, 11, 13379, 323, 6500, 7709, 624, 785, 9862, 7868, 40393, 1565, 313, 13006, 63, 369, 1008, 4119, 323, 11248, 862, 2168, 5479, 448, 10125, 220, 102259, 624, 41648, 2168, 1946, 11, 7699, 11, 2766, 323, 2477, 9342, 2550, 7388, 5258, 10125, 220, 102259, 382, 565, 4903, 16909, 271, 4854, 9862, 7890, 608, 85, 16, 20227, 4343, 11, 2670, 1449, 19718, 15522, 11, 5646, 264, 16909, 1633, 624, 2132, 6682, 279, 6661, 4712, 594, 2710, 13066, 8041, 25, 1467, 63731, 11, 2266, 761, 3762, 11, 1618, 1889, 973, 11, 6337, 36605, 345, 81583, 68365, 11, 32559, 11, 4226, 14753, 11, 14379, 11, 1487, 776, 1279, 11, 29870, 11, 9929, 5224, 776, 1279, 11, 9929, 11524, 345, 81917, 37080, 82, 11, 14386, 18380, 11, 27535, 11, 9182, 11, 55604, 18380, 323, 14971, 3382, 72432, 13, 576, 11124, 11, 8805, 345, 12244, 24527, 11, 1349, 11666, 323, 48243, 1180, 5043, 1895, 3425, 429, 1196, 4565, 374, 3042, 13, 576, 1537, 1378, 5043, 345, 81583, 27559, 323, 7274, 8190, 45835, 11, 525, 279, 6661, 6236, 3811, 594, 323, 45681, 594, 7274, 13057, 320, 4060, 198, 58, 25062, 287, 9529, 2, 19857, 287, 5731, 738, 3055, 518, 20524, 389, 279, 1852, 13066, 8041, 13, 7209, 2070, 374, 264, 4718, 2710, 345, 16155, 895, 11, 323, 902, 4822, 3565, 476, 14220, 525, 14888, 382, 66908, 323, 2710, 1681, 12335, 990, 279, 1852, 6661, 5181, 6604, 13, 56512, 20041, 902, 4565, 624, 9192, 7512, 279, 4712, 26, 1681, 27367, 11, 2266, 11, 3811, 323, 3561, 16963, 2058, 3796, 624, 15513, 9310, 18380, 323, 14386, 18380, 7512, 16851, 11, 323, 2266, 761, 3762, 2727, 279, 2266, 572, 7199, 311, 4938, 382, 565, 3714, 6805, 271, 63, 2946, 608, 85, 16, 14, 8168, 6805, 63, 374, 10218, 553, 17242, 9292, 389, 825, 54443, 22611, 11, 553, 444, 25530, 17, 389, 54443, 323, 553, 31017, 1728, 220, 19, 389, 1599, 6325, 624, 11505, 1008, 4712, 11, 892, 5646, 678, 19170, 8520, 323, 54443, 5588, 44, 3351, 11, 4675, 10125, 220, 102259, 624, 785, 9929, 59808, 374, 328, 3825, 524, 594, 5480, 9929, 3561, 2319, 220, 16, 25, 279, 1946, 11, 264, 10108, 1555, 11, 279, 3405, 11, 825, 1555, 817, 198, 2047, 11, 2188, 11, 476, 7481, 9829, 476, 902, 4226, 11, 323, 264, 15304, 7600, 311, 4226, 448, 825, 2383, 13, 27018, 9198, 525, 198, 63, 32, 63, 311, 1565, 57, 7808, 5456, 9198, 525, 1565, 15, 63, 311, 1565, 24, 7808, 323, 264, 9829, 32942, 3405, 5711, 1565, 9689, 63, 323, 1565, 2152, 28487, 8884, 2383, 1969, 387, 825, 12454, 198, 5839, 518, 279, 4226, 2309, 13, 51946, 26473, 1007, 13, 576, 2033, 23313, 1565, 40358, 8952, 9434, 7808, 1565, 24634, 63, 89780, 553, 198, 7841, 877, 11, 323, 1565, 17673, 905, 14376, 28735, 63, 220, 15, 13, 1565, 19861, 8455, 63, 525, 264, 75761, 916, 279, 2383, 60362, 17753, 553, 198, 63, 34388, 63, 320, 2258, 220, 16, 568, 1565, 1502, 36523, 63, 374, 279, 2480, 8272, 43278, 18893, 315, 1846, 9198, 323, 1558, 537, 990, 198, 63, 34388, 28487, 362, 1681, 279, 45681, 476, 279, 2266, 3241, 4157, 5456, 4675, 10125, 220, 102259, 624, 2461, 11176, 11, 1565, 9682, 8692, 36052, 63, 1231, 387, 39227, 11, 845, 11, 476, 458, 1633, 8481, 1172, 198, 63, 12546, 5854, 15724, 25, 895, 76960, 1008, 4494, 11, 6894, 11, 476, 7274, 2750, 470, 10125, 220, 102259, 382, 565, 431, 261, 1180, 271, 63, 2946, 608, 85, 16, 7382, 261, 1180, 63, 320, 18621, 37107, 36855, 1180, 7808, 323, 553, 1565, 6221, 63, 438, 328, 3825, 524, 4990, 432, 8, 12199, 1817, 2197, 2348, 264, 3239, 448, 264, 198, 36855, 97419, 29186, 13, 576, 9862, 79649, 4712, 17026, 1565, 48, 16929, 45006, 16929, 18, 10906, 261, 97419, 12, 23, 33, 7808, 323, 279, 9862, 54443, 4712, 93010, 15, 13, 21, 33, 7808, 93010, 19, 33, 3989, 437, 93010, 23, 33, 44364, 279, 4712, 49470, 279, 48243, 97419, 323, 1181, 2383, 11206, 28552, 16, 43829, 275, 10565, 14720, 4323, 63, 701, 323, 1181, 20524, 1555, 198, 96125, 1565, 80, 16929, 18, 48243, 97419, 28487, 7209, 1008, 3538, 11248, 279, 6021, 448, 10125, 220, 102259, 330, 574, 1614, 374, 537, 264, 48243, 97419, 497, 323, 264, 198, 36855, 97419, 3538, 11248, 6236, 11, 9750, 11, 79817, 11, 26643, 11, 8805, 11, 5480, 11, 739, 3776, 323, 38878, 7388, 198, 4197, 10125, 220, 102259, 330, 574, 1614, 374, 264, 48243, 97419, 25, 990, 12862, 608, 85, 16, 7382, 261, 1180, 11431, 91, 8600, 760, 47801, 9245, 91, 12442, 760, 12442, 9245, 91, 1565, 1631, 63, 760, 576, 3239, 25, 264, 914, 11, 264, 1565, 4913, 1318, 788, 2503, 5541, 1633, 11, 476, 264, 1140, 315, 1467, 5479, 9245, 91, 1565, 50445, 63, 760, 3776, 476, 803, 9290, 11, 1817, 304, 279, 1852, 7586, 438, 1565, 1631, 63, 9245, 91, 1565, 54605, 63, 760, 576, 3383, 279, 1614, 3701, 594, 9929, 5302, 26, 1638, 330, 21989, 264, 3482, 2711, 3239, 11, 17159, 9755, 46481, 429, 4226, 279, 3239, 3263, 328, 3825, 524, 594, 1565, 258, 1235, 63, 374, 1349, 979, 1565, 54605, 63, 374, 27122, 9245, 91, 1565, 3481, 1089, 63, 760, 3411, 279, 1850, 1565, 3481, 1089, 63, 3059, 1172, 26, 1638, 678, 9245, 91, 1565, 689, 75323, 63, 760, 37610, 1817, 2197, 438, 3208, 26, 1638, 1565, 1866, 63, 9245, 91, 1565, 2810, 5118, 63, 760, 576, 1429, 11206, 825, 9929, 1231, 1896, 26, 1638, 220, 23, 98729, 17, 11, 279, 1614, 3701, 594, 13, 362, 5021, 9929, 13589, 279, 3811, 4361, 323, 32047, 279, 835, 315, 1181, 2213, 320, 1782, 2197, 594, 1537, 11206, 701, 438, 279, 3701, 594, 45681, 15092, 432, 26, 264, 2062, 429, 1035, 5274, 902, 3950, 315, 279, 2197, 4675, 10125, 220, 102259, 9245, 91, 1565, 689, 59141, 7808, 1565, 689, 60990, 6458, 8076, 63, 760, 2691, 1565, 5490, 3109, 63, 448, 1565, 839, 275, 59329, 63, 323, 1565, 839, 275, 6536, 7808, 476, 279, 9929, 594, 3950, 14142, 11, 311, 1817, 1102, 26, 1638, 1565, 3849, 63, 35543, 4854, 2197, 594, 9929, 374, 279, 1614, 3701, 594, 3811, 11, 3950, 369, 3950, 11, 448, 279, 3239, 11, 279, 2197, 323, 279, 198, 54605, 438, 14386, 1467, 320, 1318, 429, 25540, 264, 3281, 3950, 26473, 1467, 568, 576, 5456, 374, 198, 63, 88192, 12525, 275, 59329, 481, 1487, 275, 6536, 45907, 504, 279, 1537, 2309, 594, 2383, 60362, 13, 576, 2033, 374, 198, 63, 4913, 8073, 788, 61320, 1252, 497, 330, 265, 31952, 10400, 497, 330, 6062, 9204, 1125, 330, 17673, 788, 5212, 5035, 28735, 30849, 7808, 1850, 1156, 11, 19780, 304, 1946, 1973, 280, 63, 5035, 28735, 63, 14569, 1449, 9929, 594, 11206, 438, 16532, 11, 1283, 894, 3931, 13, 7209, 9929, 374, 3931, 323, 10062, 2348, 279, 198, 2147, 3241, 1573, 279, 1156, 374, 16532, 11, 773, 264, 16037, 1681, 7049, 902, 22611, 975, 26, 264, 9929, 3267, 279, 3241, 320, 4197, 264, 198, 63, 2810, 5118, 63, 3403, 432, 8, 4675, 10125, 220, 102259, 448, 1565, 1851, 63, 1565, 2147, 5118, 2702, 93415, 28487, 1527, 2168, 476, 2766, 949, 4675, 10125, 198, 102259, 13, 39044, 990, 279, 3538, 594, 34228, 11, 438, 389, 1449, 6021, 25, 1565, 4913, 841, 788, 5212, 1994, 497, 330, 1313, 30849, 61898, 565, 79924, 271, 785, 9862, 79649, 4712, 15792, 2150, 5335, 1526, 33933, 3461, 594, 79924, 5116, 979, 432, 17026, 264, 1614, 448, 458, 79924, 6604, 198, 437, 1565, 313, 13006, 61898, 91, 9568, 760, 19149, 760, 6145, 760, 17815, 760, 33728, 369, 9245, 91, 12442, 760, 12442, 760, 12442, 760, 12442, 760, 12442, 9245, 91, 1565, 2946, 608, 85, 16, 14, 4215, 63, 760, 33933, 3461, 79924, 760, 4718, 1565, 4913, 2528, 497, 330, 6062, 497, 2503, 5541, 760, 1565, 4913, 10776, 497, 330, 2528, 497, 330, 6062, 60806, 497, 330, 17673, 3109, 1, 5541, 760, 279, 1565, 78290, 3461, 2143, 63, 13020, 323, 1565, 31, 78290, 3461, 2143, 3183, 380, 3461, 2143, 63, 86732, 26537, 82, 11, 448, 1565, 4030, 2903, 63, 738, 311, 279, 3538, 3704, 35543, 3966, 2997, 702, 264, 6604, 13, 362, 6604, 6696, 72626, 10005, 304, 15739, 315, 279, 2150, 279, 2943, 3208, 320, 10689, 4063, 2773, 198, 24225, 701, 2581, 304, 279, 1614, 594, 58146, 4034, 382, 91, 4903, 760, 3555, 279, 6604, 4675, 760, 38710, 9245, 91, 12442, 760, 12442, 760, 12442, 9245, 91, 30868, 744, 4215, 760, 825, 2504, 264, 6789, 5537, 320, 2102, 11, 1467, 11, 1965, 11, 14795, 11, 6802, 11, 4247, 11, 23110, 11, 2503, 701, 12626, 438, 13638, 12626, 476, 11, 979, 7761, 9386, 11, 9305, 760, 264, 3745, 264, 2504, 35543, 8609, 1008, 1614, 11248, 279, 6021, 448, 10125, 220, 102259, 330, 574, 1614, 702, 902, 79924, 6604, 26, 990, 12862, 608, 85, 16, 70793, 25016, 10814, 908, 756, 437, 264, 3538, 3855, 2041, 1565, 313, 13006, 63, 11248, 330, 92711, 3880, 2168, 1946, 26, 1191, 279, 3538, 448, 1177, 13006, 22895, 25408, 6968, 11, 48243, 97419, 323, 1349, 411, 21059, 24990, 279, 79924, 6021, 438, 807, 24990, 6236, 13, 576, 6021, 4990, 279, 1565, 258, 2202, 3989, 792, 6891, 382, 14364, 25089, 72626, 271, 785, 6604, 13905, 2504, 1467, 304, 825, 72626, 46310, 11, 279, 825, 33933, 3461, 594, 2150, 72626, 5711, 1447, 12, 11198, 819, 448, 1565, 2, 63, 23895, 25, 264, 2265, 374, 1565, 2, 7808, 264, 3772, 4247, 1565, 565, 63, 7241, 279, 1614, 6696, 264, 2188, 624, 12, 479, 25530, 13638, 12626, 11, 476, 825, 9305, 30466, 2005, 43376, 979, 264, 1965, 702, 2802, 476, 3250, 44038, 264, 13638, 1965, 4157, 3331, 26, 264, 1965, 198, 220, 2504, 9977, 6896, 825, 1965, 624, 12, 10618, 6888, 438, 1565, 14076, 1940, 14076, 63, 323, 7381, 6888, 438, 55319, 1940, 3, 7808, 279, 97085, 8603, 438, 279, 1614, 6139, 432, 624, 12, 37709, 448, 93010, 63, 476, 1565, 16, 14896, 23895, 11, 323, 2038, 304, 82703, 10005, 624, 12, 2308, 5335, 25, 264, 6802, 2504, 702, 4287, 1467, 11, 323, 1181, 17235, 11, 421, 894, 11, 374, 1181, 1828, 2504, 13, 576, 5116, 13905, 1181, 198, 220, 1828, 2168, 15045, 382, 14364, 21720, 323, 41150, 271, 12, 11773, 525, 41404, 11, 54198, 476, 4895, 47, 11, 825, 2150, 1817, 11, 705, 311, 279, 220, 101175, 20696, 33, 2487, 3930, 323, 279, 6604, 594, 29106, 2268, 5941, 3930, 510, 220, 220, 99317, 18707, 391, 10269, 323, 220, 23, 98729, 17, 15739, 264, 3108, 369, 30868, 744, 4215, 26, 264, 8130, 2168, 374, 3873, 1946, 13, 1527, 2168, 6693, 4247, 323, 198, 220, 29106, 15739, 28197, 374, 16037, 438, 3873, 1946, 624, 12, 11353, 9290, 323, 1565, 10776, 63, 525, 537, 1349, 25, 264, 11353, 2197, 374, 10125, 220, 102259, 330, 23359, 9290, 525, 537, 1349, 389, 12862, 608, 85, 16, 14, 4215, 280, 220, 3624, 1817, 2150, 438, 264, 41404, 11, 54198, 476, 4895, 47, 2168, 497, 323, 894, 2477, 59921, 1565, 10776, 63, 374, 10125, 220, 102259, 330, 10776, 48829, 6816, 315, 264, 11353, 198, 220, 2197, 26, 12862, 608, 85, 16, 14, 4215, 15792, 825, 2150, 2168, 22895, 12, 1565, 2428, 1110, 63, 34832, 28552, 6062, 2903, 63, 323, 1565, 1805, 2903, 32725, 525, 41207, 1172, 448, 1565, 313, 13006, 12, 20459, 44364, 5335, 11, 518, 1429, 220, 101175, 20696, 33, 624, 220, 1565, 1254, 1110, 63, 34832, 525, 16037, 624, 12, 4654, 8038, 11, 369, 33933, 3461, 30445, 28552, 997, 4954, 7651, 102636, 63, 1648, 518, 1429, 220, 116265, 20455, 5335, 11, 220, 19, 3039, 279, 1681, 594, 2150, 198, 220, 15739, 11, 323, 220, 99317, 20696, 33, 5519, 220, 17, 20696, 33, 264, 2150, 315, 20455, 5820, 13, 64518, 825, 14515, 279, 4361, 1681] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db1/c4.json b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/c4.json new file mode 100644 index 00000000000..29ca60346d3 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/c4.json @@ -0,0 +1,2798 @@ +{ + "label": "c4", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 111.0, + "per_stream_tps": 28.4, + "ttft_s_max": 0.52, + "request": { + "ttft_s": 0.325, + "decode_tps": 28.333, + "prompt_ttft_tps": 44.851, + "prefill_tps": 44.851, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.295, + "round_gap_p50_ms": 103.345, + "round_gap_p95_ms": 119.953, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.325, + "first_content_s": 0.325, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.325, + "last_output_s": 9.325 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 108.045, + "aggregate_prefill_tps": 108.045, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.294, + "round_gap_p50_ms": 103.382, + "round_gap_p95_ms": 121.62, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 109.79296604149556, + "makespan_s": 9.331150242505828, + "steady_tps": 113.8, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 113.55683215598438, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.126112186000682, + "end_to_end_tps": 112.20550209439683, + "timing_valid": true, + "steady_tps": 116.56860065507122, + "per_stream_tps": [ + 28.4, + 29.2, + 29.7, + 28.8 + ], + "ttft_s": [ + 0.13, + 0.39, + 0.52, + 0.26 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13255042303353548, + "decode_tps": 28.389383316195556, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 105.62018347129663, + "prefill_tps": 105.62018347129663, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.22443544694825, + "round_gap_p50_ms": 103.17877400666475, + "round_gap_p95_ms": 108.11331903096288, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013821140164509416, + "first_payload_s": 0.13255042303353548, + "first_content_s": 0.13255042303353548, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13255042303353548, + "last_output_s": 9.11478146200534 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38818583299871534, + "decode_tps": 29.22068807531711, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.065200761838035, + "prefill_tps": 36.065200761838035, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.2223289685196, + "round_gap_p50_ms": 103.26954303309321, + "round_gap_p95_ms": 108.0634769750759, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.002231420949101448, + "first_payload_s": 0.38818583299871534, + "first_content_s": 0.38818583299871534, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38818583299871534, + "last_output_s": 9.114879719971213 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5191263949964195, + "decode_tps": 29.667122516033718, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 26.968384067807914, + "prefill_tps": 26.968384067807914, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.70734723125055, + "round_gap_p50_ms": 103.03517198190093, + "round_gap_p95_ms": 106.91575094824657, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0018600079929456115, + "first_payload_s": 0.5191263949964195, + "first_content_s": 0.5191263949964195, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5191263949964195, + "last_output_s": 9.11449993896531 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.26101698400452733, + "decode_tps": 28.800275599929147, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.63635647463144, + "prefill_tps": 53.63635647463144, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.72188995311073, + "round_gap_p50_ms": 103.22876001009718, + "round_gap_p95_ms": 108.26810501748696, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0020585230085998774, + "first_payload_s": 0.26101698400452733, + "first_content_s": 0.26101698400452733, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.26101698400452733, + "last_output_s": 9.115098922047764 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.46900039995728, + "round_gap_p50_ms": 103.1974790384993, + "round_gap_p95_ms": 108.11331903096288, + "round_gap_mean_ms": 104.63803692844175, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 107.72555924861464, + "aggregate_prefill_tps": 107.72555924861464 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400445.190631794, + "first": 400445.323182217, + "last": 400454.305413256, + "end": 400454.315808896, + "elapsed_s": 9.125177101988811, + "chunk_offsets_s": [ + 0.13255042303353548, + 0.6198978410102427, + 0.7231207760050893, + 0.8262991990195587, + 0.9304944510222413, + 1.0373899140395224, + 1.1400330010219477, + 1.2406705900211819, + 1.3433843340026215, + 1.4428474280284718, + 1.5449230200028978, + 1.6489216290065087, + 1.7535143900313415, + 1.854848324030172, + 1.9551898459903896, + 2.0586053270380944, + 2.1669874810031615, + 2.270093967032153, + 2.374329411017243, + 2.475837683014106, + 2.5808407540316693, + 2.6844924940378405, + 2.784059541008901, + 2.8866848520119675, + 2.988670427002944, + 3.0946916060056537, + 3.1977844270295464, + 3.3037345180055127, + 3.4055647460045293, + 3.5104563430068083, + 3.621898345008958, + 3.727488734992221, + 3.8269815410021693, + 3.926474170992151, + 4.029119034006726, + 4.129416667041369, + 4.231020188017283, + 4.337073896022048, + 4.4416876650066115, + 4.542765404039528, + 4.650188600993715, + 4.754507790028583, + 4.85587511700578, + 4.931653804029338, + 5.038399649027269, + 5.141985436028335, + 5.245666009024717, + 5.345222800038755, + 5.4482978120213374, + 5.5566889910260215, + 5.662637401022948, + 5.767265825998038, + 5.870444600004703, + 5.9754967910121195, + 6.080695831042249, + 6.187378283008002, + 6.292542106995825, + 6.399005212006159, + 6.4998259550193325, + 6.602302112034522, + 6.703356410027482, + 6.799562436994165, + 6.899166412011255, + 7.001258756034076, + 7.104135606030468, + 7.207989060028922, + 7.30652718100464, + 7.411589788040146, + 7.51639891898958, + 7.622479234996717, + 7.728242123033851, + 7.83030339400284, + 7.933922782016452, + 8.035526046995074, + 8.140155815985054, + 8.246424662007485, + 8.348676624009386, + 8.451490161009133, + 8.551629231020343, + 8.656450585986022, + 8.760558620037045, + 8.861402706999797, + 8.96951602603076, + 9.055196251021698, + 9.11478146200534 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.20085450075567, + "p95": 108.11331903096288, + "max": 487.3474179767072 + } + }, + { + "start": 400445.19034283, + "first": 400445.578528663, + "last": 400454.30522255, + "end": 400454.315126023, + "elapsed_s": 9.124783192994073, + "chunk_offsets_s": [ + 0.38818583299871534, + 0.6199362259940244, + 0.7236535519477911, + 0.8259256419842131, + 0.9304560499731451, + 1.0378370399703272, + 1.1398191099870019, + 1.2413001989480108, + 1.3441931449924596, + 1.4430455909459852, + 1.5455183399608359, + 1.6495567899546586, + 1.7539528119959868, + 1.8557113439892419, + 1.9552757509518415, + 2.058763344946783, + 2.16745067195734, + 2.270894088956993, + 2.374889449973125, + 2.4759092530002818, + 2.5815992119605653, + 2.6848687549936585, + 2.7837857619742863, + 2.8866398760001175, + 2.9886142339673825, + 3.095334606943652, + 3.197539943968877, + 3.3038074789801612, + 3.406127313966863, + 3.510935949976556, + 3.6218882169923745, + 3.728170951944776, + 3.827598540985491, + 3.9269480179646052, + 4.0290870819590054, + 4.129386393993627, + 4.2313909129588865, + 4.337443372991402, + 4.4414804939879104, + 4.543207777955104, + 4.650589726981707, + 4.754723904945422, + 4.855872221000027, + 4.9317225409904495, + 5.038580659951549, + 5.142492994957138, + 5.245690473995637, + 5.34577272698516, + 5.448848492000252, + 5.5572603099863045, + 5.663145983999129, + 5.767326114990283, + 5.870636202977039, + 5.975613767979667, + 6.081049403990619, + 6.18711776798591, + 6.292407992994413, + 6.399200654996093, + 6.50028213695623, + 6.602452753984835, + 6.7032064399681985, + 6.799401058990043, + 6.899295117997099, + 7.001235394971445, + 7.104243398993276, + 7.207883394963574, + 7.306445420952514, + 7.411438041948713, + 7.516857580980286, + 7.622607972996775, + 7.728272826992907, + 7.830395603959914, + 7.934024974994827, + 8.03534772497369, + 8.140295689983759, + 8.246453782950994, + 8.349025700998027, + 8.451312190969475, + 8.552014931978192, + 8.656798926996998, + 8.7609522419516, + 8.861257697979454, + 8.96932117495453, + 9.055217482964508, + 9.114879719971213 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.28981550992467, + "p95": 108.0634769750759, + "max": 231.75039299530908 + } + }, + { + "start": 400445.190968774, + "first": 400445.710095169, + "last": 400454.305468713, + "end": 400454.316367863, + "elapsed_s": 9.12539908895269, + "chunk_offsets_s": [ + 0.5191263949964195, + 0.6194228279637173, + 0.7228681009728462, + 0.8250648309476674, + 0.9303421129588969, + 1.0371355429524556, + 1.1389899159548804, + 1.2399259730009362, + 1.3429611449828371, + 1.442174683965277, + 1.5448394189588726, + 1.6487669879570603, + 1.7529499189695343, + 1.854974838963244, + 1.954441419977229, + 2.0579185339738615, + 2.1669893380021676, + 2.2700511829461902, + 2.3743296829634346, + 2.4756632179487497, + 2.580762240977492, + 2.6836122749955393, + 2.7834060289897025, + 2.886119628965389, + 2.9881912209675647, + 3.0946275099995546, + 3.197244212962687, + 3.3030202689697035, + 3.4050303559633903, + 3.510392870986834, + 3.621125071949791, + 3.7275001439847983, + 3.826573775964789, + 3.92637164198095, + 4.028362496988848, + 4.128689105971716, + 4.230900458991528, + 4.337062679987866, + 4.441273691947572, + 4.542722314945422, + 4.649589505977929, + 4.753871189954225, + 4.855692122946493, + 4.931651836959645, + 5.03779858595226, + 5.141734762000851, + 5.244975775945932, + 5.344733769947197, + 5.447769037971739, + 5.556565757957287, + 5.662120450986549, + 5.7668569249799475, + 5.86987529695034, + 5.97536850097822, + 6.080528148973826, + 6.186643921944778, + 6.291839746001642, + 6.398755496949889, + 6.4997563699726015, + 6.6022218549624085, + 6.702695121988654, + 6.798851243976969, + 6.898631284944713, + 7.000701388984453, + 7.103670367971063, + 7.207437068980653, + 7.30591179797193, + 7.410983443958685, + 7.516355158993974, + 7.62206583796069, + 7.727721891948022, + 7.829850556969177, + 7.933711610967293, + 8.0348253659904, + 8.139727090951055, + 8.245877310982905, + 8.34852039796533, + 8.450754567980766, + 8.551185320946388, + 8.656234807975125, + 8.760395929974038, + 8.86069962696638, + 8.968767743965145, + 9.054667619988322, + 9.11449993896531 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.03522000322118, + "p95": 106.91575094824657, + "max": 110.732200962957 + } + }, + { + "start": 400445.190255677, + "first": 400445.451272661, + "last": 400454.305354599, + "end": 400454.316041139, + "elapsed_s": 9.1257854620344, + "chunk_offsets_s": [ + 0.26101698400452733, + 0.6204227280104533, + 0.7236560790333897, + 0.8268848390434869, + 0.9307965350453742, + 1.037583228026051, + 1.1402344280504622, + 1.2412925180396996, + 1.3450793170486577, + 1.443277993996162, + 1.5453623700304888, + 1.649575638002716, + 1.7538470190484077, + 1.8551426799967885, + 1.9556716119986959, + 2.059037781029474, + 2.167448847030755, + 2.2705955410492606, + 2.3748437060276046, + 2.476294953026809, + 2.5812828710186295, + 2.684215707005933, + 2.7845131310168654, + 2.8871255140402354, + 2.989115361007862, + 3.0951312120305374, + 3.198257538024336, + 3.3041720120236278, + 3.4060066399979405, + 3.5108817890286446, + 3.622119884006679, + 3.7278302760096267, + 3.8275586050003767, + 3.9269348970265128, + 4.0292668280308135, + 4.130021315009799, + 4.2317293180385605, + 4.337604767002631, + 4.4414080930291675, + 4.543206897040363, + 4.650457277020905, + 4.754692832997534, + 4.856185425014701, + 4.9321889790007845, + 5.038838935026433, + 5.142690262000542, + 5.24610681500053, + 5.345685478008818, + 5.448771579016466, + 5.557125621009618, + 5.663089839043096, + 5.767736248031724, + 5.870908478042111, + 5.975934140034951, + 6.081021883001085, + 6.187701583025046, + 6.292980321042705, + 6.399540707003325, + 6.500283497036435, + 6.602740902046207, + 6.703677822020836, + 6.800006155041046, + 6.900063912034966, + 7.001584632031154, + 7.104625275998842, + 7.208315672993194, + 7.306965922995005, + 7.4120452660135925, + 7.517006463021971, + 7.6229226650320925, + 7.728728001005948, + 7.830864650022704, + 7.934351107047405, + 8.035673392994795, + 8.140631454007234, + 8.246857260004617, + 8.34931298403535, + 8.451969399000518, + 8.552243415033445, + 8.657014370022807, + 8.761222549015656, + 8.861706999014132, + 8.969975104031619, + 9.055639584024902, + 9.115098922047764 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.23105551651679, + "p95": 108.26810501748696, + "max": 359.40574400592595 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 108.48156755735523, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.536188299010973, + "end_to_end_tps": 107.3804299885943, + "timing_valid": true, + "steady_tps": 111.10472709757836, + "per_stream_tps": [ + 28.3, + 27.5, + 27.9, + 27.1 + ], + "ttft_s": [ + 0.52, + 0.26, + 0.39, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.5164656999986619, + "decode_tps": 28.27676667945332, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.10731806591662, + "prefill_tps": 27.10731806591662, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.36472225895005, + "round_gap_p50_ms": 103.42112899525091, + "round_gap_p95_ms": 131.63824996445328, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0012705919798463583, + "first_payload_s": 0.5164656999986619, + "first_content_s": 0.5164656999986619, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5164656999986619, + "last_output_s": 9.534469876030926 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25984280701959506, + "decode_tps": 27.491206008468897, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.878728299545514, + "prefill_tps": 53.878728299545514, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 36.375268501932645, + "round_gap_p50_ms": 103.57228299835697, + "round_gap_p95_ms": 134.95080498978496, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013155689812265337, + "first_payload_s": 0.25984280701959506, + "first_content_s": 0.25984280701959506, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25984280701959506, + "last_output_s": 9.535536275012419 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3883623279980384, + "decode_tps": 27.878746540876516, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.048810584096394, + "prefill_tps": 36.048810584096394, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.869618403889675, + "round_gap_p50_ms": 103.61994599225, + "round_gap_p95_ms": 135.12751105008647, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001342770003248006, + "first_payload_s": 0.3883623279980384, + "first_content_s": 0.3883623279980384, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3883623279980384, + "last_output_s": 9.535115020989906 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13351032201899216, + "decode_tps": 27.12453370859848, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.8608061780307, + "prefill_tps": 104.8608061780307, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 36.86699320781319, + "round_gap_p50_ms": 103.47268101759255, + "round_gap_p95_ms": 135.04138198914006, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013229610049165785, + "first_payload_s": 0.13351032201899216, + "first_content_s": 0.13351032201899216, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13351032201899216, + "last_output_s": 9.534593590011355 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 36.11915059314639, + "round_gap_p50_ms": 103.56596298515797, + "round_gap_p95_ms": 135.12751105008647, + "round_gap_mean_ms": 109.64742144348011, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 108.3638048458725, + "aggregate_prefill_tps": 108.3638048458725 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400454.318150335, + "first": 400454.834616035, + "last": 400463.852620211, + "end": 400463.853474894, + "elapsed_s": 9.535324559023138, + "chunk_offsets_s": [ + 0.5164656999986619, + 0.6172021380043589, + 0.7199981699814089, + 0.8209324189811014, + 0.9248016970232129, + 1.0313946760143153, + 1.1331553350319155, + 1.232511690002866, + 1.335290458984673, + 1.435198405990377, + 1.5351553130312823, + 1.6387453880161047, + 1.7400385370128788, + 1.8418155490071513, + 1.9527905840077437, + 2.072259666980244, + 2.198763913998846, + 2.3135946160182357, + 2.4306337779853493, + 2.552147448004689, + 2.672822289983742, + 2.793106311990414, + 2.9144168259808794, + 3.040353481017519, + 3.1618903030175716, + 3.2918022100348026, + 3.42027062602574, + 3.5519088759901933, + 3.6872340380214155, + 3.8251494099968113, + 3.9692263979814015, + 4.110053487995174, + 4.234427675022744, + 4.365420171990991, + 4.468671714013908, + 4.568201720016077, + 4.672249656985514, + 4.77598619699711, + 4.879407325992361, + 4.981136640009936, + 5.082999987993389, + 5.185963862983044, + 5.28824441699544, + 5.364280370995402, + 5.471751103992574, + 5.573496914992575, + 5.67653011798393, + 5.776145245006774, + 5.879875130020082, + 5.987469881016295, + 6.092866651015356, + 6.19802242598962, + 6.299845965986606, + 6.40468300099019, + 6.510505584010389, + 6.61813921603607, + 6.723067883984186, + 6.830630409996957, + 6.930749031016603, + 7.032742540992331, + 7.134066266007721, + 7.229456648987252, + 7.3291098400368355, + 7.4312700720038265, + 7.533894054009579, + 7.637122187996283, + 7.737732720037457, + 7.840464206994511, + 7.947216899017803, + 8.052984570036642, + 8.155562678992283, + 8.256876996019855, + 8.358430740016047, + 8.460196533997077, + 8.564768206037115, + 8.670373153989203, + 8.772158869018313, + 8.873171774030197, + 8.973392940009944, + 9.077026471029967, + 9.180739123024978, + 9.282050192006864, + 9.389020166010596, + 9.475634514994454, + 9.534469876030926 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.50560199003667, + "p95": 131.63824996445328, + "max": 144.07698798459023 + } + }, + { + "start": 400454.318331361, + "first": 400454.578174168, + "last": 400463.853867636, + "end": 400463.854026614, + "elapsed_s": 9.535695252998266, + "chunk_offsets_s": [ + 0.25984280701959506, + 0.6169264540076256, + 0.7199126179912128, + 0.8209406430250965, + 0.9247967380215414, + 1.0312769470037892, + 1.1327152650337666, + 1.2324247300275601, + 1.3351925060269423, + 1.4344412119826302, + 1.5342584539903328, + 1.6387527650222182, + 1.7397677979897708, + 1.8417743960162625, + 1.9523632029886357, + 2.0718869739794172, + 2.1982746759895235, + 2.313586423988454, + 2.4305306089809164, + 2.5521518799941987, + 2.672336107993033, + 2.7930010950076394, + 2.914458138984628, + 3.0402566000120714, + 3.162093122024089, + 3.2920249170274474, + 3.4198179009836167, + 3.551633417024277, + 3.686584222014062, + 3.8252883719978854, + 3.969283838989213, + 4.1096546510234475, + 4.235116339987144, + 4.365349530999083, + 4.4686527060111985, + 4.568132903019432, + 4.6723307620268315, + 4.776018037984613, + 4.879327340982854, + 4.981059696001466, + 5.083012501010671, + 5.18587738199858, + 5.288202319992706, + 5.363719116023276, + 5.4717564809834585, + 5.573609317012597, + 5.6765973520232365, + 5.776759206026327, + 5.880255070980638, + 5.986761872016359, + 6.092865883023478, + 6.197687414009124, + 6.299945710983593, + 6.404611303994898, + 6.510536657006014, + 6.617683977994602, + 6.72311726101907, + 6.830712891998701, + 6.930771224026103, + 7.0327610860113055, + 7.134084651013836, + 7.22946783399675, + 7.329118384979665, + 7.431179832026828, + 7.533589571015909, + 7.637174973031506, + 7.737375242984854, + 7.840947525983211, + 7.947725546022411, + 8.052899240981787, + 8.155506310984492, + 8.256801170995459, + 8.358341938990634, + 8.460295144002885, + 8.564799982006662, + 8.670862857019529, + 8.77217891800683, + 8.873101965000387, + 8.973575983021874, + 9.076774996006861, + 9.180771540035494, + 9.282140577037353, + 9.389032982988283, + 9.475651332002599, + 9.535536275012419 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.5788425069768, + "p95": 134.95080498978496, + "max": 357.0836469880305 + } + }, + { + "start": 400454.31794822, + "first": 400454.706310548, + "last": 400463.853063241, + "end": 400463.853136778, + "elapsed_s": 9.535188557987567, + "chunk_offsets_s": [ + 0.3883623279980384, + 0.6172236739657819, + 0.7201283960021101, + 0.8210284520173445, + 0.9249070590012707, + 1.0314772530109622, + 1.1334679470164701, + 1.2329838249715976, + 1.3356447360129096, + 1.4350427080062218, + 1.534979582997039, + 1.6392112509929575, + 1.7403756940038875, + 1.8421047370065935, + 1.9531235810136423, + 2.072597127989866, + 2.198861355020199, + 2.3141986079863273, + 2.431014680012595, + 2.552624766016379, + 2.672829394985456, + 2.7934619169682264, + 2.914739950967487, + 3.040705885970965, + 3.1622057469794527, + 3.2921414470183663, + 3.420406899997033, + 3.5519376769661903, + 3.687065188016277, + 3.8254756219685078, + 3.9697169010178186, + 4.110132256988436, + 4.235039938997943, + 4.365777008992154, + 4.468982758990023, + 4.568593196978327, + 4.672553740965668, + 4.776495132013224, + 4.8797555869678035, + 4.981507332995534, + 5.083299144986086, + 5.186327211966272, + 5.2886480540037155, + 5.364196081995033, + 5.4716717599658296, + 5.5738181520137005, + 5.676860795007087, + 5.776568898989353, + 5.880264591018204, + 5.987198404967785, + 6.0932009919779375, + 6.198167419992387, + 6.300173249968793, + 6.40508326201234, + 6.510819508985151, + 6.618156895972788, + 6.72339534398634, + 6.831039984012023, + 6.931045899982564, + 7.033062225964386, + 7.134363582008518, + 7.2297634379938245, + 7.329555206990335, + 7.431391449994408, + 7.53402531996835, + 7.637509585998487, + 7.737859473971184, + 7.840853283996694, + 7.947631752991583, + 8.053351246984676, + 8.155961261014454, + 8.257225705019664, + 8.358789896999951, + 8.46060170797864, + 8.565249267965555, + 8.670780471991748, + 8.772485609981231, + 8.873550802993122, + 8.973690464976244, + 9.077310410968494, + 9.181068552017678, + 9.282563750981353, + 9.389335690997541, + 9.47595818398986, + 9.535115020989906 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.65781901055016, + "p95": 135.12751105008647, + "max": 228.86134596774355 + } + }, + { + "start": 400454.317838315, + "first": 400454.451348637, + "last": 400463.852431905, + "end": 400463.8526493, + "elapsed_s": 9.534810985031072, + "chunk_offsets_s": [ + 0.13351032201899216, + 0.6175868790014647, + 0.7204752170364372, + 0.8215086180134676, + 0.9250745809986256, + 1.0318371769972146, + 1.1332837520167232, + 1.2330012010061182, + 1.3354193730046973, + 1.4347849280457012, + 1.5348984940210357, + 1.6389001900097355, + 1.7404103660373949, + 1.8419781590346247, + 1.9531766209984198, + 2.072640312020667, + 2.19868943199981, + 2.314170207013376, + 2.4308308050385676, + 2.5523047299939208, + 2.673216886993032, + 2.7932989700348116, + 2.914636605011765, + 3.040530924045015, + 3.162401366047561, + 3.2923418010468595, + 3.420435828040354, + 3.5522917130147107, + 3.6873330950038508, + 3.8253646930097602, + 3.969400560017675, + 4.110553078004159, + 4.234915633045603, + 4.365597405994777, + 4.468828164041042, + 4.568402634002268, + 4.672448299010284, + 4.776562876999378, + 4.8795827040448785, + 4.981305986002553, + 5.083178183005657, + 5.186158089025412, + 5.288472515007015, + 5.364399668003898, + 5.471663567004725, + 5.573700726032257, + 5.67717340704985, + 5.777020776993595, + 5.87994112999877, + 5.9871294280164875, + 6.093538916029502, + 6.198037082038354, + 6.300040192028973, + 6.405329889035784, + 6.510685971006751, + 6.61839715501992, + 6.723249998001847, + 6.830767468025442, + 6.930923306033947, + 7.032924366998486, + 7.13422658800846, + 7.229644876031671, + 7.3295127100427635, + 7.431371866026893, + 7.533861446019728, + 7.637367295043077, + 7.738107251992915, + 7.840889843995683, + 7.94735498103546, + 8.05318702000659, + 8.15575674502179, + 8.257033526024316, + 8.358627270034049, + 8.460605180007406, + 8.5656039280002, + 8.670510804047808, + 8.772336440044455, + 8.87339411303401, + 8.973869681998622, + 9.077555646013934, + 9.180920022015925, + 9.282462964998558, + 9.389200953010004, + 9.475816181045957, + 9.534593590011355 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 103.48926502047107, + "p95": 135.04138198914006, + "max": 484.07655698247254 + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 86.1, + "per_stream_tps": 22.0, + "ttft_s_max": 0.78, + "request": { + "ttft_s": 0.489, + "decode_tps": 22.075, + "prompt_ttft_tps": 68.123, + "prefill_tps": 68.123, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.301, + "round_gap_p50_ms": 102.444, + "round_gap_p95_ms": 106.743, + "tokens_per_chunk": 2.306, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.489, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.489, + "last_output_s": 12.04 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 163.639, + "aggregate_prefill_tps": 163.639, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.297, + "round_gap_p50_ms": 102.376, + "round_gap_p95_ms": 106.764, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 85.03968730404526, + "makespan_s": 12.041481520485831, + "steady_tps": 90.2, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 86.29649194468753, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.018214461975731, + "end_to_end_tps": 85.20400457487425, + "timing_valid": true, + "steady_tps": 90.32910182702918, + "per_stream_tps": [ + 21.9, + 22.7, + 21.6, + 22.3 + ], + "ttft_s": [ + 0.39, + 0.78, + 0.2, + 0.59 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3914566700113937, + "decode_tps": 21.936203544504377, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.74595670848733, + "prefill_tps": 81.74595670848733, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.586739654890174, + "round_gap_p50_ms": 102.23717603366822, + "round_gap_p95_ms": 106.75304301548749, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016449650283902884, + "first_payload_s": 0.0016476529999636114, + "first_content_s": 0.3914566700113937, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3914566700113937, + "last_output_s": 12.016075282008387 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7798276349785738, + "decode_tps": 22.692222672074063, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.03470890830795, + "prefill_tps": 41.03470890830795, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.06796171759054, + "round_gap_p50_ms": 102.24271303741261, + "round_gap_p95_ms": 106.64830601308495, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002291693992447108, + "first_payload_s": 0.0022952459985390306, + "first_content_s": 0.7798276349785738, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7798276349785738, + "last_output_s": 12.017157872964162 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19790484302211553, + "decode_tps": 21.575603237752134, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.69387020217619, + "prefill_tps": 161.69387020217619, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.34864615281021, + "round_gap_p50_ms": 102.46925998944789, + "round_gap_p95_ms": 106.68171400902793, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016158290090970695, + "first_payload_s": 0.0016192530165426433, + "first_content_s": 0.19790484302211553, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19790484302211553, + "last_output_s": 12.01680961198872 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5877253799699247, + "decode_tps": 22.311194150894735, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.44719777396293, + "prefill_tps": 54.44719777396293, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.820550313749, + "round_gap_p50_ms": 102.12138295173645, + "round_gap_p95_ms": 106.73245100770146, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0026044659898616374, + "first_payload_s": 0.002605938003398478, + "first_content_s": 0.5877253799699247, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5877253799699247, + "last_output_s": 12.01696570997592 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.20597445975998, + "round_gap_p50_ms": 102.25864796666428, + "round_gap_p95_ms": 106.68171400902793, + "round_gap_mean_ms": 104.79566806580723, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.02316469629793, + "aggregate_prefill_tps": 164.02316469629793 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400464.600795433, + "first": 400464.992252103, + "last": 400476.616870715, + "end": 400476.617443923, + "elapsed_s": 12.016648490040097, + "chunk_offsets_s": [ + 0.3914566700113937, + 0.8837776019936427, + 0.9848505069967359, + 1.087992287997622, + 1.1908462719875388, + 1.2930280400323682, + 1.3949149720137939, + 1.4958943080273457, + 1.598430353042204, + 1.6989008820382878, + 1.7995125650195405, + 1.9047490929951891, + 2.0056138680083677, + 2.1071623470052145, + 2.211434589989949, + 2.3128398199914955, + 2.413945125997998, + 2.5181160389911383, + 2.624628935009241, + 2.732274871028494, + 2.8348770440206863, + 2.9316970290383324, + 3.036007096990943, + 3.1402012270409614, + 3.2433976639877073, + 3.3456348400213756, + 3.4527038400410675, + 3.5572860870161094, + 3.6596369610051624, + 3.7623534229933284, + 3.8624264909885824, + 3.9645045620272867, + 4.064625294005964, + 4.166194974037353, + 4.271912532043643, + 4.378562182013411, + 4.481763738032896, + 4.584044355025981, + 4.684676535020117, + 4.788312960998155, + 4.8901788530056365, + 4.992046696017496, + 5.09740565699758, + 5.196704283007421, + 5.302008795028087, + 5.4048684280132875, + 5.5084699260187335, + 5.610170294996351, + 5.713857986032963, + 5.816676370042842, + 5.919036011036951, + 6.021735385991633, + 6.123496635991614, + 6.224272593040951, + 6.332571703998838, + 6.435785197012592, + 6.539181475993246, + 6.644047839043196, + 6.745880242029671, + 6.848935716028791, + 6.94880174199352, + 7.049488113028929, + 7.150487849023193, + 7.252404093043879, + 7.355193900002632, + 7.4572878910112195, + 7.555640824022703, + 7.657844303990714, + 7.762979069026187, + 7.8697321120416746, + 7.9726184970350005, + 8.072493338026106, + 8.168623474019114, + 8.2705809189938, + 8.371671312022954, + 8.47196505399188, + 8.576089087000582, + 8.680287569004577, + 8.781715677992906, + 8.886878924036864, + 8.989861709997058, + 9.088013119995594, + 9.192892218998168, + 9.294331879995298, + 9.39857308298815, + 9.501717790029943, + 9.607652822043747, + 9.709408632013947, + 9.808097089000512, + 9.90816682903096, + 10.008165223989636, + 10.108096465002745, + 10.211833709036, + 10.31560063303914, + 10.416237900033593, + 10.518292961001862, + 10.617139804991893, + 10.716278796026018, + 10.817287364043295, + 10.921685064036865, + 11.02104381803656, + 11.12070368003333, + 11.220171492022928, + 11.323504266038071, + 11.431365499040112, + 11.530518042040057, + 11.632700817019213, + 11.73506765899947, + 11.837770888989326, + 11.942688931012526, + 12.016075282008387 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.25889651337638, + "p95": 106.75304301548749, + "max": 492.320931982249 + } + }, + { + "start": 400464.600577254, + "first": 400465.380404889, + "last": 400476.617735127, + "end": 400476.617951145, + "elapsed_s": 12.017373890965246, + "chunk_offsets_s": [ + 0.7798276349785738, + 0.8844853549962863, + 0.9851641439599916, + 1.0879973759874701, + 1.1908015519729815, + 1.2933520450023934, + 1.394782650982961, + 1.496312521980144, + 1.5985032339813188, + 1.6989531229482964, + 1.799665414961055, + 1.904771493980661, + 2.005891006963793, + 2.1072946210042574, + 2.2117944349884056, + 2.3131770239560865, + 2.414243417966645, + 2.5186756789917126, + 2.625046156987082, + 2.732309366983827, + 2.8347157939570025, + 2.9319993690005504, + 3.0360526659642346, + 3.1400359449908137, + 3.243671923992224, + 3.3457110329763964, + 3.4530196679988876, + 3.557416761002969, + 3.660139143001288, + 3.763106776983477, + 3.862738814961631, + 3.9649815279990435, + 4.065036483982112, + 4.166333439992741, + 4.27232957695378, + 4.379006667993963, + 4.4819229249842465, + 4.584435336990282, + 4.684978395001963, + 4.788636581972241, + 4.890549017989542, + 4.992341019969899, + 5.097679372993298, + 5.197044718952384, + 5.302319518988952, + 5.405010110000148, + 5.508967884001322, + 5.610643149004318, + 5.713858865958173, + 5.816545391979162, + 5.918809416994918, + 6.021679800993297, + 6.123573148972355, + 6.224715398973785, + 6.332441206963267, + 6.435790572955739, + 6.539303525991272, + 6.6443210750003345, + 6.746399240975734, + 6.849037909996696, + 6.949187955004163, + 7.049923926999327, + 7.1506343630026095, + 7.2527211050037295, + 7.355351806967519, + 7.456677706970368, + 7.555974603979848, + 7.6579055530019104, + 7.763501907989848, + 7.870150214002933, + 7.97292720497353, + 8.072549770993646, + 8.168904165970162, + 8.270626758981962, + 8.372042004950345, + 8.472277826978825, + 8.576011549972463, + 8.680111341993324, + 8.782194771978538, + 8.8871936959913, + 8.990002384001855, + 9.08837605296867, + 9.193210639001336, + 9.29446448996896, + 9.398546185984742, + 9.501757006975822, + 9.607786599954125, + 9.709453480958473, + 9.808234786964022, + 9.908212349982932, + 10.008057605999056, + 10.108040641003754, + 10.211991614953149, + 10.31561418500496, + 10.416277003998403, + 10.518666997959372, + 10.617192716978025, + 10.716402589983772, + 10.817159729951527, + 10.921734359988477, + 11.021113434981089, + 11.120599182962906, + 11.220113363000564, + 11.323567354993429, + 11.431439851992764, + 11.53106059395941, + 11.633178775955457, + 11.735909109993372, + 11.838143853994552, + 11.942973494995385, + 12.017157872964162 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.25336902658455, + "p95": 106.64830601308495, + "max": 107.87249699933454 + } + }, + { + "start": 400464.600114592, + "first": 400464.798019435, + "last": 400476.616924204, + "end": 400476.618241773, + "elapsed_s": 12.018127180985175, + "chunk_offsets_s": [ + 0.19790484302211553, + 0.8847669590031728, + 0.9859050650265999, + 1.0887462979881093, + 1.191342950973194, + 1.2934311180142686, + 1.3954194110119715, + 1.4964839320164174, + 1.5990622810204513, + 1.6992666149744764, + 1.800043115974404, + 1.9053766370052472, + 2.006122338003479, + 2.1076552500016987, + 2.2121796080027707, + 2.313432148017455, + 2.4144190999795683, + 2.519036211015191, + 2.6254404819919728, + 2.732584843004588, + 2.835241049004253, + 2.93266097799642, + 3.036446238984354, + 3.1406578890164383, + 3.243934647005517, + 3.3467485510045663, + 3.4537492619710974, + 3.558018287993036, + 3.660487547982484, + 3.763658960000612, + 3.863293286995031, + 3.9655340790050104, + 4.065635258972179, + 4.166928550985176, + 4.272981490008533, + 4.379316287988331, + 4.482614998007193, + 4.585068320971914, + 4.685512833995745, + 4.789536433003377, + 4.8909494709805585, + 4.992859315010719, + 5.098022512975149, + 5.197444756980985, + 5.302834390022326, + 5.405971386004239, + 5.509321217017714, + 5.61103201797232, + 5.714180054026656, + 5.8168807399924845, + 5.9196420990047045, + 6.022210959985387, + 6.123872816970106, + 6.225074730988126, + 6.333093215012923, + 6.436186417995486, + 6.540105969004799, + 6.644648567016702, + 6.7469659359776415, + 6.850000290025491, + 6.949827803007793, + 7.050331228005234, + 7.151313556008972, + 7.253242647973821, + 7.356050504022278, + 7.45776202500565, + 7.556373281986453, + 7.658294709981419, + 7.763848408998456, + 7.870530123007484, + 7.973534940974787, + 8.072836255014408, + 8.169440092984587, + 8.27117563097272, + 8.372687117021997, + 8.473215215024538, + 8.57656139699975, + 8.68105807498796, + 8.78281057201093, + 8.88781728799222, + 8.990974219981581, + 9.088740442006383, + 9.193760214024223, + 9.294839150970802, + 9.399075441004243, + 9.502146611979697, + 9.60814713302534, + 9.709835645975545, + 9.808594600006472, + 9.908914519008249, + 10.008681149978656, + 10.108691113011446, + 10.212371427973267, + 10.316008605994284, + 10.416673601022922, + 10.519299325998873, + 10.617589091008995, + 10.717105287010781, + 10.817783401987981, + 10.922292687988374, + 11.021510143997148, + 11.121219158987515, + 11.220767820021138, + 11.323968735989183, + 11.43221032602014, + 11.531333893013652, + 11.633534556021914, + 11.736159960972145, + 11.838806694024242, + 11.943212585989386, + 12.01680961198872 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.51906048506498, + "p95": 106.68171400902793, + "max": 686.8621159810573 + } + }, + { + "start": 400464.600027311, + "first": 400465.187752691, + "last": 400476.616993021, + "end": 400476.617157375, + "elapsed_s": 12.017130063963123, + "chunk_offsets_s": [ + 0.5877253799699247, + 0.884747902979143, + 0.9858065519947559, + 1.0886494159931317, + 1.1917084119631909, + 1.2936076800106093, + 1.3957290629623458, + 1.4969408659962937, + 1.5988517979858443, + 1.6994369690073654, + 1.8003489599796012, + 1.9053954529808834, + 2.006068944989238, + 2.107992885983549, + 2.2124248429900035, + 2.3138812729739584, + 2.4145713899633847, + 2.5192870780010708, + 2.62567942898022, + 2.7329662080155686, + 2.8354524269816466, + 2.932391629961785, + 3.036829027987551, + 3.1410787259810604, + 3.2441022970015183, + 3.3470151139772497, + 3.453747564984951, + 3.5581645619822666, + 3.6606352779781446, + 3.7635747509775683, + 3.863467417017091, + 3.9656801290111616, + 4.065665739995893, + 4.167108921974432, + 4.27283286396414, + 4.379690467962064, + 4.482834983966313, + 4.584931774996221, + 4.6857681649853475, + 4.7894536959938705, + 4.891263458994217, + 4.9931315740104765, + 5.098372565989848, + 5.197777448978741, + 5.30309183296049, + 5.405746214964893, + 5.509574980009347, + 5.611030033964198, + 5.714768413978163, + 5.817287497979123, + 5.919499857001938, + 6.022568148968276, + 6.123881072970107, + 6.225313117960468, + 6.333073870977387, + 6.436660167993978, + 6.540082399966195, + 6.644665703002829, + 6.7467403810005635, + 6.849638446001336, + 6.949687960965093, + 7.050227706960868, + 7.151441910013091, + 7.253065701981541, + 7.356031719013117, + 7.457314083003439, + 7.556304816971533, + 7.658311829960439, + 7.763694919005502, + 7.870417769008782, + 7.973289657966234, + 8.073036704969127, + 8.169265242991969, + 8.271076940989587, + 8.372510170971509, + 8.472873034013901, + 8.576450707972981, + 8.680877976003103, + 8.782522903988138, + 8.887608805962373, + 8.990740056964569, + 9.088740345963743, + 9.193562307977118, + 9.294835886976216, + 9.399005471961573, + 9.502147988008801, + 9.608156620990485, + 9.709838222013786, + 9.80858224799158, + 9.908659106993582, + 10.008522060001269, + 10.108505734999198, + 10.212378675991204, + 10.315925549017265, + 10.416662689007353, + 10.518921336974017, + 10.617592802969739, + 10.717096550972201, + 10.81761845597066, + 10.922170686011668, + 11.021484447992407, + 11.121044211962726, + 11.220555673004128, + 11.323961103975307, + 11.43185758497566, + 11.53169308201177, + 11.633577277010772, + 11.735684690997005, + 11.838474417978432, + 11.943212953978218, + 12.01696570997592 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.16687098727562, + "p95": 106.73245100770146, + "max": 297.0225230092183 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.95905967726009, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.064748578995932, + "end_to_end_tps": 84.87537003321629, + "timing_valid": true, + "steady_tps": 89.98815491962931, + "per_stream_tps": [ + 22.6, + 21.5, + 21.8, + 22.2 + ], + "ttft_s": [ + 0.78, + 0.2, + 0.39, + 0.59 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.7836154059623368, + "decode_tps": 22.606309119354528, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.836358954303186, + "prefill_tps": 40.836358954303186, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.2354386432699, + "round_gap_p50_ms": 102.46138699585572, + "round_gap_p95_ms": 106.46828700555488, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016710300114937127, + "first_payload_s": 0.0016737660043872893, + "first_content_s": 0.7836154059623368, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7836154059623368, + "last_output_s": 12.06365225999616 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19837518403073773, + "decode_tps": 21.492541158110022, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.310499376987, + "prefill_tps": 161.310499376987, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.527769454690976, + "round_gap_p50_ms": 102.48999501345679, + "round_gap_p95_ms": 106.84581199893728, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014767550164833665, + "first_payload_s": 0.001553732028696686, + "first_content_s": 0.19837518403073773, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19837518403073773, + "last_output_s": 12.062956394976936 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3922087409882806, + "decode_tps": 21.84831155858743, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.58920660301187, + "prefill_tps": 81.58920660301187, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.77012723928098, + "round_gap_p50_ms": 102.42584999650717, + "round_gap_p95_ms": 107.08787897601724, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0015813810168765485, + "first_payload_s": 0.0015828210161998868, + "first_content_s": 0.3922087409882806, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3922087409882806, + "last_output_s": 12.063591187004931 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5854773129685782, + "decode_tps": 22.21420530034043, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.656259587153976, + "prefill_tps": 54.656259587153976, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.01624012562245, + "round_gap_p50_ms": 102.494538994506, + "round_gap_p95_ms": 106.98741301894188, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0019656899967230856, + "first_payload_s": 0.0019789860234595835, + "first_content_s": 0.5854773129685782, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5854773129685782, + "last_output_s": 12.064618545002304 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.38739386571608, + "round_gap_p50_ms": 102.49361098976806, + "round_gap_p95_ms": 106.84581199893728, + "round_gap_mean_ms": 105.21623123415999, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 163.25546665410755, + "aggregate_prefill_tps": 163.25546665410755 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400476.620606828, + "first": 400477.404222234, + "last": 400488.684259088, + "end": 400488.68438781, + "elapsed_s": 12.063780981989112, + "chunk_offsets_s": [ + 0.7836154059623368, + 0.8896292709978297, + 0.9908229769789614, + 1.0920742829912342, + 1.194872618012596, + 1.296592762984801, + 1.3985910560004413, + 1.5004232499632053, + 1.6021728349733166, + 1.7024960659909993, + 1.8034270639764145, + 1.908222064957954, + 2.0082873560022563, + 2.1106453019892797, + 2.212707866972778, + 2.3140204859664664, + 2.4152814889675938, + 2.5158501630066894, + 2.6223184500122443, + 2.7320112109882757, + 2.8344422290101647, + 2.9324408209649846, + 3.0364320509834215, + 3.1405366269755177, + 3.243697013997007, + 3.346158400992863, + 3.4532716239918955, + 3.5537337999558076, + 3.657056302006822, + 3.7633061219821684, + 3.863823338993825, + 3.9662518450058997, + 4.0662368789780885, + 4.16729586297879, + 4.273418352997396, + 4.3795588269713335, + 4.483246532967314, + 4.586078980995808, + 4.686727334978059, + 4.790650884970091, + 4.892102577956393, + 4.99431832897244, + 5.099492949957494, + 5.198679893976077, + 5.303944276995026, + 5.406551585008856, + 5.50927713495912, + 5.609679629968014, + 5.7138431500061415, + 5.818567973969039, + 5.920983343967237, + 6.024077137990389, + 6.125709600979462, + 6.227526739006862, + 6.335655030969065, + 6.438642999972217, + 6.5411481309565715, + 6.643564588972367, + 6.74771145300474, + 6.851749819994438, + 6.951222558971494, + 7.0518848169595, + 7.1539039419731125, + 7.255568052991293, + 7.358963563980069, + 7.460603835002985, + 7.560101037961431, + 7.662495622993447, + 7.768265580991283, + 7.8758493539644405, + 7.979847879963927, + 8.080333671998233, + 8.17620695597725, + 8.278153390972875, + 8.38059928896837, + 8.481390764995012, + 8.584308540972415, + 8.690426502958871, + 8.795651972992346, + 8.901800766994711, + 9.004379338992294, + 9.107760448998306, + 9.213164752989542, + 9.315810861007776, + 9.420647318009287, + 9.525693394010887, + 9.630020083975978, + 9.733233799983282, + 9.836220920959022, + 9.936447990010493, + 10.036529599979986, + 10.137280691997148, + 10.241518900962546, + 10.347436187963467, + 10.448203600011766, + 10.55154706101166, + 10.651117784960661, + 10.750822078960482, + 10.85335498600034, + 10.959439811005723, + 11.05960265500471, + 11.162179817969445, + 11.262220820004586, + 11.367076732974965, + 11.475310257985257, + 11.574838341970462, + 11.676156400993932, + 11.777890257013496, + 11.883420658996329, + 11.98943745100405, + 12.06365225999616 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.48325899010524, + "p95": 106.46828700555488, + "max": 109.69276097603142 + } + }, + { + "start": 400476.62030436, + "first": 400476.818679544, + "last": 400488.683260755, + "end": 400488.683428101, + "elapsed_s": 12.063123741012532, + "chunk_offsets_s": [ + 0.19837518403073773, + 0.8896506309974939, + 0.9908072639955208, + 1.0922180130146444, + 1.1944682450266555, + 1.2964977539959364, + 1.3983644290128723, + 1.5002842560061254, + 1.6021981799858622, + 1.702432801015675, + 1.8034505050163716, + 1.908086879993789, + 2.0084559349925257, + 2.11036516999593, + 2.2131324320216663, + 2.314002437982708, + 2.4149668770260178, + 2.515904212021269, + 2.6224766279920004, + 2.732424671994522, + 2.8344194919918664, + 2.9321879689814523, + 3.0361464630113915, + 3.1403172480058856, + 3.243366850016173, + 3.3462755380314775, + 3.4531213500304148, + 3.5536650950089097, + 3.6571660630288534, + 3.7634988600038923, + 3.863554023031611, + 3.966017474012915, + 4.066246287024114, + 4.16711297997972, + 4.273364736000076, + 4.379472378001083, + 4.483291350014042, + 4.5858601779909804, + 4.6867387110251, + 4.790397057018708, + 4.892225730989594, + 4.994257720012683, + 5.099436005984899, + 5.198669813980814, + 5.303808178985491, + 5.4066328660119325, + 5.509148413024377, + 5.609786031011026, + 5.714302819978911, + 5.818272610020358, + 5.920835901983082, + 6.02380844700383, + 6.125651377020404, + 6.227449906000402, + 6.3354830769822, + 6.438476374023594, + 6.5409897129866295, + 6.643479708000086, + 6.747647276031785, + 6.851599417976104, + 6.951334127981681, + 7.051979954994749, + 7.153734034975059, + 7.255610838008579, + 7.359036860987544, + 7.460608571011107, + 7.560159343003761, + 7.662488278991077, + 7.768029690021649, + 7.875777304987423, + 7.979909865010995, + 8.080155142000876, + 8.176049834000878, + 8.277924364025239, + 8.380392342980485, + 8.481467149977107, + 8.584267597005237, + 8.690367254021112, + 8.796197468007449, + 8.90164942102274, + 9.004119831020944, + 9.107664512004703, + 9.213189585017972, + 9.31564221897861, + 9.420716230990365, + 9.525474942987785, + 9.629989252018277, + 9.73317397502251, + 9.836041814996861, + 9.9363054119749, + 10.036653154005762, + 10.137083744979464, + 10.241510436986573, + 10.347440459998325, + 10.447956749005243, + 10.551398003008217, + 10.651234587014187, + 10.750537514977623, + 10.853294120985083, + 10.959418355021626, + 11.059401836013421, + 11.162291802989785, + 11.262206899991725, + 11.366945691988803, + 11.475016735028476, + 11.57487867801683, + 11.676096784009133, + 11.777757487026975, + 11.883970090013463, + 11.989467946987133, + 12.062956394976936 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.50166698824614, + "p95": 106.84581199893728, + "max": 691.2754469667561 + } + }, + { + "start": 400476.620253255, + "first": 400477.012461996, + "last": 400488.683844442, + "end": 400488.683921323, + "elapsed_s": 12.063668067974504, + "chunk_offsets_s": [ + 0.3922087409882806, + 0.8898475780151784, + 0.9909620989928953, + 1.0927407880080864, + 1.1947075760108419, + 1.2966026199865155, + 1.3985742559889331, + 1.5003941619652323, + 1.6022995570092462, + 1.7026758120045997, + 1.803590010968037, + 1.908298131020274, + 2.0089015889680013, + 2.1106196379987523, + 2.2129703349783085, + 2.3141252559726126, + 2.415205776982475, + 2.516063478018623, + 2.6223186259740032, + 2.73256329796277, + 2.834663287969306, + 2.9324118130025454, + 3.0363880029763095, + 3.140564916015137, + 3.2436225499841385, + 3.3462761790142395, + 3.4533640579902567, + 3.5540082679945044, + 3.657075229973998, + 3.763410090992693, + 3.86369501700392, + 3.966242180962581, + 4.066403200966306, + 4.167379432008602, + 4.273579426982906, + 4.380065330013167, + 4.483200964983553, + 4.586057316977531, + 4.687006138963625, + 4.790568163967691, + 4.892782378999982, + 4.994521291984711, + 5.099684073007666, + 5.198918025009334, + 5.304063414980192, + 5.407094631984364, + 5.50935887999367, + 5.610417128016707, + 5.714457046997268, + 5.818407011975069, + 5.92098035197705, + 6.0240628980100155, + 6.125778275018092, + 6.227592036011629, + 6.335744344978593, + 6.438928284973372, + 6.5412130919867195, + 6.643727934977505, + 6.7478987199719995, + 6.851855276967399, + 6.951896007987671, + 7.052458776975982, + 7.1541868899948895, + 7.255499524995685, + 7.358948219974991, + 7.461016417015344, + 7.560058142000344, + 7.662479383987375, + 7.768258988973685, + 7.876027643971611, + 7.979822808003519, + 8.080420953978319, + 8.17628006101586, + 8.278166671982035, + 8.380592521978542, + 8.481375437986571, + 8.584392910997849, + 8.690601321985014, + 8.796428687986918, + 8.901837359997444, + 9.00430722598685, + 9.107532910013106, + 9.21367922401987, + 9.315889358986169, + 9.420614725968335, + 9.52570045099128, + 9.629898834973574, + 9.733405818988103, + 9.836280010000337, + 9.936549910984468, + 10.037294938985724, + 10.137529255996924, + 10.241984379012138, + 10.347342122986447, + 10.448170464020222, + 10.551304130000062, + 10.651764850015752, + 10.750682365964167, + 10.85343345097499, + 10.959321777976584, + 11.05953732598573, + 11.162200810969807, + 11.262350453995168, + 11.366851802973542, + 11.475173568993341, + 11.575027896964457, + 11.676233729987871, + 11.777659229992423, + 11.883895000966731, + 11.989367945992853, + 12.063591187004931 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.44785799295641, + "p95": 107.08787897601724, + "max": 497.6388370268978 + } + }, + { + "start": 400476.620174982, + "first": 400477.205652295, + "last": 400488.684793527, + "end": 400488.684923561, + "elapsed_s": 12.064748578995932, + "chunk_offsets_s": [ + 0.5854773129685782, + 0.8899931799969636, + 0.9911424369784072, + 1.0927260359749198, + 1.1950007639825344, + 1.296808590006549, + 1.3988556520198472, + 1.5010539789800532, + 1.6025386159890331, + 1.7028709669830278, + 1.8040519049973227, + 1.9085277499980293, + 2.0087829789845273, + 2.110956873977557, + 2.212946414016187, + 2.3146606229711324, + 2.4155124530079775, + 2.5165208440157585, + 2.622689303010702, + 2.732357790984679, + 2.83506196498638, + 2.9328032259945758, + 3.0367216229788028, + 3.140801895002369, + 3.2439940909971483, + 3.3466529839788564, + 3.4536403969977982, + 3.553981996024959, + 3.65743126696907, + 3.763798624975607, + 3.864132526970934, + 3.966625529981684, + 4.066568099020515, + 4.167668315989431, + 4.273772230022587, + 4.379780669987667, + 4.483855901984498, + 4.586318999994546, + 4.6873244469752535, + 4.790959673002362, + 4.892765194992535, + 4.994924849015661, + 5.100101855001412, + 5.199173244996928, + 5.304317065980285, + 5.406915205996484, + 5.509647667990066, + 5.610316199017689, + 5.714073697978165, + 5.818865786015522, + 5.92135939700529, + 6.0244335909956135, + 6.126311146013904, + 6.228125898982398, + 6.3363147039781325, + 6.4388092429726385, + 6.541521639970597, + 6.643936129985377, + 6.748338660981972, + 6.852119425020646, + 6.951882647990715, + 7.05239620001521, + 7.154082903987728, + 7.255938138987403, + 7.359334848995786, + 7.460975855996367, + 7.5604413630208, + 7.66285850899294, + 7.76857456099242, + 7.876221822982188, + 7.980448287969921, + 8.08071068499703, + 8.17679625999881, + 8.278458148008212, + 8.380968702025712, + 8.481763554969802, + 8.5846593779861, + 8.691009871021379, + 8.796162076003384, + 8.902155940013472, + 9.00468129501678, + 9.108059572987258, + 9.213536645984277, + 9.31618745898595, + 9.421022203983739, + 9.52606189501239, + 9.630395721993409, + 9.733606380992569, + 9.836552108987235, + 9.937075022025965, + 10.03719365701545, + 10.13742080598604, + 10.241816089022905, + 10.347797280992381, + 10.44850952399429, + 10.55185381701449, + 10.651749090000521, + 10.751129954995122, + 10.853709022980183, + 10.959805527993012, + 11.059915171004832, + 11.162553519010544, + 11.262594488973264, + 11.367387697973754, + 11.475662006996572, + 11.575450782023836, + 11.676757160981651, + 11.778252998017706, + 11.88374943099916, + 11.98980310402112, + 12.064618545002304 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.50254650600255, + "p95": 106.98741301894188, + "max": 304.5158670283854 + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.45, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db1/drafted.json b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/drafted.json new file mode 100644 index 00000000000..faf3e55bfc4 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/drafted.json @@ -0,0 +1,150 @@ +[ + { + "label": "drafted", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 256, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 43.448904486045215, + "decode_tps_all": [ + 43.45, + 43.55, + 42.97 + ], + "ttft_s_median": 0.13085261301603168, + "prompt_ttft_tps_median": 106.991, + "prefill_tps_median": 106.991, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 23.016, + "round_gap_p50_ms_median": 68.493, + "round_gap_p95_ms_median": 75.421, + "tokens_per_chunk_median": 2.943, + "headers_s_median": 0.001, + "first_payload_s_median": 0.131, + "first_content_s_median": 0.131, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.131, + "last_output_s_median": 5.998, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "drafted", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 256, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 34.094668041751056, + "decode_tps_all": [ + 33.6, + 34.68, + 34.09 + ], + "ttft_s_median": 0.19649294298142195, + "prompt_ttft_tps_median": 162.856, + "prefill_tps_median": 162.856, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 29.33, + "round_gap_p50_ms_median": 62.8, + "round_gap_p95_ms_median": 72.966, + "tokens_per_chunk_median": 2.207, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.196, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.196, + "last_output_s_median": 7.676, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db1/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db2/c4.json b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/c4.json new file mode 100644 index 00000000000..3b1fd9569c5 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/c4.json @@ -0,0 +1,2798 @@ +{ + "label": "c4", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.0, + "per_stream_tps": 29.1, + "ttft_s_max": 0.51, + "request": { + "ttft_s": 0.321, + "decode_tps": 29.117, + "prompt_ttft_tps": 45.415, + "prefill_tps": 45.415, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.344, + "round_gap_p50_ms": 101.976, + "round_gap_p95_ms": 112.397, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.321, + "first_content_s": 0.321, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.321, + "last_output_s": 9.079 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 109.403, + "aggregate_prefill_tps": 109.403, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.345, + "round_gap_p50_ms": 101.984, + "round_gap_p95_ms": 113.415, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 112.77569675001305, + "makespan_s": 9.080420532030985, + "steady_tps": 117.0, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 113.17076954577911, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.144345867040101, + "end_to_end_tps": 111.9817660977706, + "timing_valid": true, + "steady_tps": 116.09401454607983, + "per_stream_tps": [ + 29.1, + 28.7, + 29.5, + 28.3 + ], + "ttft_s": [ + 0.39, + 0.26, + 0.51, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.38550147297792137, + "decode_tps": 29.117914713772596, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.316333351083756, + "prefill_tps": 36.316333351083756, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.34311865495664, + "round_gap_p50_ms": 102.07814100431278, + "round_gap_p95_ms": 119.32229803642258, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001825511979404837, + "first_payload_s": 0.38550147297792137, + "first_content_s": 0.38550147297792137, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38550147297792137, + "last_output_s": 9.142996729991864 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2571806110208854, + "decode_tps": 28.698300142240342, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.43645204989062, + "prefill_tps": 54.43645204989062, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.845269407720906, + "round_gap_p50_ms": 101.9370669964701, + "round_gap_p95_ms": 119.33845799649134, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013131209998391569, + "first_payload_s": 0.2571806110208854, + "first_content_s": 0.2571806110208854, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2571806110208854, + "last_output_s": 9.142724309989717 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5119097179849632, + "decode_tps": 29.545273136360407, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.348572430131586, + "prefill_tps": 27.348572430131586, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.846361662818154, + "round_gap_p50_ms": 101.96449101204053, + "round_gap_p95_ms": 117.04668501624838, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001530931971501559, + "first_payload_s": 0.5119097179849632, + "first_content_s": 0.5119097179849632, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5119097179849632, + "last_output_s": 9.142731942003593 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13058970699785277, + "decode_tps": 28.294445453697683, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.20599901667744, + "prefill_tps": 107.20599901667744, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.34262587462424, + "round_gap_p50_ms": 102.2088949684985, + "round_gap_p95_ms": 119.33346599107608, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0007578500080853701, + "first_payload_s": 0.13058970699785277, + "first_content_s": 0.13058970699785277, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13058970699785277, + "last_output_s": 9.142959305027034 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.59434390002998, + "round_gap_p50_ms": 102.07814100431278, + "round_gap_p95_ms": 119.33346599107608, + "round_gap_mean_ms": 105.01854398223388, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.2266258680708, + "aggregate_prefill_tps": 109.2266258680708 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400980.885604723, + "first": 400981.271106196, + "last": 400990.028601453, + "end": 400990.029289302, + "elapsed_s": 9.143684579001274, + "chunk_offsets_s": [ + 0.38550147297792137, + 0.6104790620156564, + 0.7130124410032295, + 0.8141482030041516, + 0.9173910149838775, + 1.0226745569962077, + 1.123424184974283, + 1.2240606119739823, + 1.326138752978295, + 1.4249381319968961, + 1.524635314999614, + 1.6250591150019318, + 1.727625374973286, + 1.8289782259962521, + 1.9295319319935516, + 2.0350625819992274, + 2.1410215569776483, + 2.2428839029744267, + 2.342446075985208, + 2.4431161509710364, + 2.545048226020299, + 2.6455526829813607, + 2.7431328630191274, + 2.8459522780030966, + 2.9467908189981245, + 3.0550267350045033, + 3.156858600967098, + 3.2615630960208364, + 3.3624042450101115, + 3.467082323972136, + 3.575049676001072, + 3.681416352977976, + 3.7783873719745316, + 3.8773922419641167, + 3.9784064179984853, + 4.0776144419796765, + 4.177899135975167, + 4.2816011540126055, + 4.385052224970423, + 4.48593903897563, + 4.5885641149943694, + 4.690985011984594, + 4.792293367965613, + 4.868374583020341, + 4.974223572993651, + 5.078347611997742, + 5.180045379966032, + 5.281965550966561, + 5.384742613998242, + 5.491831251012627, + 5.59688843798358, + 5.700556360010523, + 5.801461461989675, + 5.90574324701447, + 6.010145994019695, + 6.117602107988205, + 6.2211252599954605, + 6.326929944974836, + 6.426717687980272, + 6.526326405990403, + 6.6261567900073715, + 6.721988706965931, + 6.8257971099810675, + 6.937601359968539, + 7.051338115008548, + 7.175909152021632, + 7.274019529984798, + 7.375516864005476, + 7.47927259397693, + 7.584960862004664, + 7.68685880897101, + 7.787333200976718, + 7.887445172993466, + 7.996947969018947, + 8.113958205969539, + 8.237073177006096, + 8.362446255981922, + 8.481768554018345, + 8.582000879978295, + 8.685544272011612, + 8.78834878996713, + 8.889118770021014, + 8.99574240896618, + 9.082859351008665, + 9.142996729991864 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.24951899726875, + "p95": 119.32229803642258, + "max": 224.97758903773502 + } + }, + { + "start": 400980.885917351, + "first": 400981.143097962, + "last": 400990.028641661, + "end": 400990.029853405, + "elapsed_s": 9.14393605402438, + "chunk_offsets_s": [ + 0.2571806110208854, + 0.6099349270225503, + 0.7126529489760287, + 0.8135708830086514, + 0.9166998220025562, + 1.0221006299834698, + 1.1229375550174154, + 1.2236904950113967, + 1.3256171150133014, + 1.4245031509781256, + 1.5242629739805125, + 1.624689574004151, + 1.727144472009968, + 1.8285272609791718, + 1.9294826359837316, + 2.0351765190134756, + 2.14088153897319, + 2.242551291012205, + 2.34220912901219, + 2.4428550919983536, + 2.5447921589948237, + 2.6453433529823087, + 2.742903820006177, + 2.8456893619732, + 2.9465250719804317, + 3.0547679319861345, + 3.1565109490184113, + 3.2614387099747546, + 3.362163009995129, + 3.4671336360042915, + 3.5747083600144833, + 3.6812422220245935, + 3.7781504089944065, + 3.8775191719760187, + 3.978032045008149, + 4.077255108975805, + 4.177540699020028, + 4.28132521401858, + 4.384864334017038, + 4.485677691001911, + 4.588223149999976, + 4.690719936974347, + 4.792030756012537, + 4.868026435025968, + 4.973533324024174, + 5.078218602982815, + 5.179802337021101, + 5.281720875995234, + 5.384497378021479, + 5.491484110010788, + 5.596486032998655, + 5.700194787001237, + 5.801123713026755, + 5.905372554028872, + 6.009781716973521, + 6.117251351999585, + 6.220856712025125, + 6.326673749019392, + 6.42644442099845, + 6.526432487007696, + 6.625809761986602, + 6.721643598983064, + 6.8255527230212465, + 6.937357901013456, + 7.051121328026056, + 7.175672732992098, + 7.27388820098713, + 7.375271052995231, + 7.47955131798517, + 7.584863213007338, + 7.6866175580071285, + 7.786981020995881, + 7.887603126990143, + 7.996563291992061, + 8.113963885989506, + 8.236708228010684, + 8.362195437017363, + 8.481533895013854, + 8.581768573028967, + 8.68518941901857, + 8.788118147000205, + 8.888768285978585, + 8.995480230019893, + 9.08262379601365, + 9.142724309989717 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.19598250114359, + "p95": 119.33845799649134, + "max": 352.75431600166485 + } + }, + { + "start": 400980.886293324, + "first": 400981.398203042, + "last": 400990.029025266, + "end": 400990.029146804, + "elapsed_s": 9.142853480007034, + "chunk_offsets_s": [ + 0.5119097179849632, + 0.6096199150197208, + 0.7128014779882506, + 0.8132911829743534, + 0.9163734330213629, + 1.0218934430158697, + 1.1226436789729632, + 1.2234716119710356, + 1.3252955420175567, + 1.4244077570037916, + 1.524049418978393, + 1.6244907879736274, + 1.7268276680260897, + 1.8285875329747796, + 1.9291672710096464, + 2.0349075549747795, + 2.1406331509933807, + 2.242343800025992, + 2.3419126929948106, + 2.4425284470198676, + 2.544489275023807, + 2.6451070129987784, + 2.742323315993417, + 2.8453950060065836, + 2.9460596889839508, + 3.0545611929846928, + 3.1562366249854676, + 3.2609598399722017, + 3.36196823901264, + 3.466473339998629, + 3.574408532003872, + 3.6808016410213895, + 3.7779441180173308, + 3.8767761060153134, + 3.977860570012126, + 4.077082147006877, + 4.17736861697631, + 4.2811196119873784, + 4.384441209025681, + 4.485476424975786, + 4.587941499019507, + 4.690521757991519, + 4.791731407982297, + 4.867851855990011, + 4.973325545026455, + 5.077769860974513, + 5.179797376971692, + 5.281510249013081, + 5.384294736024458, + 5.491205291007645, + 5.596168861025944, + 5.699928654998075, + 5.800844062003307, + 5.905105846992228, + 6.009518257982563, + 6.117150789999869, + 6.22071786201559, + 6.326490195002407, + 6.426137216971256, + 6.526138563000131, + 6.625559197971597, + 6.721375867025927, + 6.825369585014414, + 6.93721825099783, + 7.050965710019227, + 7.175337912980467, + 7.273694405972492, + 7.374969128984958, + 7.479031918977853, + 7.584349285985809, + 7.686313776997849, + 7.786716408969369, + 7.887306194985285, + 7.996313928975724, + 8.113360613991972, + 8.23644577601226, + 8.36186997697223, + 8.481198002991732, + 8.58160333801061, + 8.684921975014731, + 8.787811070971657, + 8.888463162002154, + 8.995179378020111, + 9.082497298019007, + 9.142731942003593 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.99600350460969, + "p95": 117.04668501624838, + "max": 125.42420095996931 + } + }, + { + "start": 400980.885507538, + "first": 400981.016097245, + "last": 400990.028466843, + "end": 400990.02867131, + "elapsed_s": 9.143163772008847, + "chunk_offsets_s": [ + 0.13058970699785277, + 0.6107205850421451, + 0.7134361750213429, + 0.8138969030114822, + 0.9176504740025848, + 1.0223531289957464, + 1.1232310149935074, + 1.224414008029271, + 1.325897709990386, + 1.4248353310395032, + 1.524516161007341, + 1.624919129011687, + 1.72737858700566, + 1.8292266770149581, + 1.9297479190281592, + 2.0349491080269217, + 2.141568379011005, + 2.243080304993782, + 2.342836752999574, + 2.443116679030936, + 2.5453255739994347, + 2.6455660110223107, + 2.74336670601042, + 2.8459437650162727, + 2.9470229180296883, + 3.054998109990265, + 3.1568139120354317, + 3.261565927998163, + 3.3624182130442932, + 3.4674433520413004, + 3.5750199800240807, + 3.6814170079887845, + 3.7786527349962853, + 3.877883320034016, + 3.978709365008399, + 4.077597449009772, + 4.177877167996485, + 4.281588690006174, + 4.385040880006272, + 4.485937262012158, + 4.58853905799333, + 4.691399097035173, + 4.792310024029575, + 4.86832555802539, + 4.974266213015653, + 5.078808434016537, + 5.180407545005437, + 5.282458133995533, + 5.38498295203317, + 5.491801202006172, + 5.597025191993453, + 5.700514630996622, + 5.801677432027645, + 5.9057005739887245, + 6.010103673033882, + 6.11774246202549, + 6.221314462018199, + 6.327316237031482, + 6.426703447999898, + 6.526727899035905, + 6.626127333031036, + 6.721954210021067, + 6.82583375001559, + 6.937813075026497, + 7.051713063032366, + 7.175893600040581, + 7.27463689801516, + 7.375531216035597, + 7.479226818017196, + 7.585226785042323, + 7.686875384999439, + 7.787308033031877, + 7.887882538023405, + 7.996871215989813, + 8.114483668003231, + 8.237013639998622, + 8.362424208025914, + 8.48175767401699, + 8.582531974010635, + 8.685512159019709, + 8.788367654022295, + 8.889041073038243, + 8.995769609988201, + 9.083209115022328, + 9.142959305027034 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.33417648123577, + "p95": 119.33346599107608, + "max": 480.13087804429233 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.79151248058281, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.016495197021868, + "end_to_end_tps": 113.56962740225552, + "timing_valid": true, + "steady_tps": 117.81832639802732, + "per_stream_tps": [ + 30.0, + 28.7, + 29.5, + 29.1 + ], + "ttft_s": [ + 0.51, + 0.13, + 0.38, + 0.26 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.5104482570313849, + "decode_tps": 29.98282150819653, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.426873942953264, + "prefill_tps": 27.426873942953264, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.35243148236152, + "round_gap_p50_ms": 101.85217001708224, + "round_gap_p95_ms": 106.79941799025983, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009867640328593552, + "first_payload_s": 0.5104482570313849, + "first_content_s": 0.5104482570313849, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5104482570313849, + "last_output_s": 9.015318285033572 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13017000496620312, + "decode_tps": 28.700827491751625, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.55165910637332, + "prefill_tps": 107.55165910637332, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.84220098836494, + "round_gap_p50_ms": 101.76463302923366, + "round_gap_p95_ms": 107.38630499690771, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.000706312945112586, + "first_payload_s": 0.13017000496620312, + "first_content_s": 0.13017000496620312, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13017000496620312, + "last_output_s": 9.014931256999262 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3843881450011395, + "decode_tps": 29.545536720515113, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.42151867081774, + "prefill_tps": 36.42151867081774, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.84605970977824, + "round_gap_p50_ms": 101.98782000225037, + "round_gap_p95_ms": 107.49665799085051, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013418410089798272, + "first_payload_s": 0.3843881450011395, + "first_content_s": 0.3843881450011395, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3843881450011395, + "last_output_s": 9.01513337099459 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25731107604224235, + "decode_tps": 29.116890842784404, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.408851011534544, + "prefill_tps": 54.408851011534544, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.344326301852206, + "round_gap_p50_ms": 102.05918096471578, + "round_gap_p95_ms": 107.74638899601996, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010625420254655182, + "first_payload_s": 0.25731107604224235, + "first_content_s": 0.25731107604224235, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25731107604224235, + "last_output_s": 9.015114283014555 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.09625462058923, + "round_gap_p50_ms": 101.89016995718703, + "round_gap_p95_ms": 107.49665799085051, + "round_gap_mean_ms": 103.50648724107444, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.5802384294296, + "aggregate_prefill_tps": 109.5802384294296 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400990.031469634, + "first": 400990.541917891, + "last": 400999.046787919, + "end": 400999.047061475, + "elapsed_s": 9.01559184101643, + "chunk_offsets_s": [ + 0.5104482570313849, + 0.609963005001191, + 0.7125856490456499, + 0.8135019360342994, + 0.9177407120005228, + 1.0227640109951608, + 1.124171742994804, + 1.2242059540003538, + 1.326203197997529, + 1.425752971030306, + 1.5246830550022423, + 1.6254923800006509, + 1.7279715180047788, + 1.8295770290424116, + 1.9302366240299307, + 2.0353062910144217, + 2.1427671569981612, + 2.2451313020428643, + 2.3454178040265106, + 2.4467588950064965, + 2.5501038680085912, + 2.652335003018379, + 2.7508329700212926, + 2.8534661260200664, + 2.9541828900109977, + 3.0623102280078456, + 3.1641357580083422, + 3.267543148016557, + 3.3690773300477304, + 3.4743785360478796, + 3.5820237080333754, + 3.6888231260236353, + 3.7858915380202234, + 3.8865296290023252, + 3.9877023660228588, + 4.087597119039856, + 4.188275658001658, + 4.291028384002857, + 4.3945914070354775, + 4.494887701002881, + 4.596739871019963, + 4.698946046002675, + 4.80105964303948, + 4.877645457047038, + 4.983668577042408, + 5.088110172015149, + 5.190073927049525, + 5.289121373032685, + 5.393130242999177, + 5.499143777997233, + 5.605346804019064, + 5.708513023040723, + 5.809742561017629, + 5.914173004042823, + 6.018156897043809, + 6.126147786038928, + 6.229731290019117, + 6.335766729025636, + 6.435356022033375, + 6.539177946047857, + 6.638227232033387, + 6.73359071003506, + 6.832205959013663, + 6.932972963026259, + 7.033446459041443, + 7.136887289001606, + 7.233141514996532, + 7.334912324033212, + 7.43814572802512, + 7.543704153038561, + 7.645064957032446, + 7.745590630045626, + 7.847480800002813, + 7.947863991023041, + 8.05088108801283, + 8.156336328014731, + 8.25728911004262, + 8.3583976230002, + 8.45707746403059, + 8.560845786007121, + 8.664609245024621, + 8.76546484202845, + 8.871326391003095, + 8.955929060000926, + 9.015318285033572 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.87116998713464, + "p95": 106.79941799025983, + "max": 108.12733799684793 + } + }, + { + "start": 400990.030943547, + "first": 400990.161113552, + "last": 400999.045874804, + "end": 400999.047372039, + "elapsed_s": 9.016428491973784, + "chunk_offsets_s": [ + 0.13017000496620312, + 0.610726855986286, + 0.7125712819979526, + 0.8134901119628921, + 0.9178047929890454, + 1.023495253000874, + 1.1248878969927318, + 1.2246128559927456, + 1.3262925749877468, + 1.4258626359514892, + 1.5251156849553809, + 1.625652413989883, + 1.728113951976411, + 1.8302463499712758, + 1.9306800059857778, + 2.035773512965534, + 2.1431598179624416, + 2.2455314829712734, + 2.345569885976147, + 2.446862672979478, + 2.5502727349521592, + 2.652767920983024, + 2.7512144149513915, + 2.8538475709501654, + 2.955123541993089, + 3.063228143961169, + 3.164078668982256, + 3.267698877956718, + 3.369463510985952, + 3.474537033995148, + 3.582412816991564, + 3.6891039459733292, + 3.7862789839855395, + 3.8868316969601437, + 3.9877654389711097, + 4.0880454129655845, + 4.1886290709953755, + 4.2912061139941216, + 4.394672768947203, + 4.49482966895448, + 4.597179509000853, + 4.699314834957477, + 4.8014353279722854, + 4.878024837991688, + 4.98438121000072, + 5.088532833964564, + 5.1902217859751545, + 5.289541938982438, + 5.3935115919448435, + 5.499426645983476, + 5.605639303976204, + 5.708516894956119, + 5.809573326958343, + 5.914500607992522, + 6.018268226995133, + 6.126484349952079, + 6.229988732957281, + 6.336024028947577, + 6.436164848972112, + 6.539278778946027, + 6.638420577975921, + 6.733724279969465, + 6.832529994950164, + 6.933392439968884, + 7.033696157974191, + 7.1370915320003405, + 7.23340686300071, + 7.3349563729716465, + 7.438578613975551, + 7.543916203954723, + 7.6453466569655575, + 7.745993850985542, + 7.8477274759789, + 7.947604067972861, + 8.051228628959507, + 8.156553387001622, + 8.257357367954683, + 8.358870892960113, + 8.457853265979793, + 8.561102990002837, + 8.665029394964222, + 8.76579098997172, + 8.871591306990013, + 8.956345737969968, + 9.014931256999262 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.80452952045016, + "p95": 107.38630499690771, + "max": 480.55685102008283 + } + }, + { + "start": 400990.031007676, + "first": 400990.415395821, + "last": 400999.046141047, + "end": 400999.046858608, + "elapsed_s": 9.015850932046305, + "chunk_offsets_s": [ + 0.3843881450011395, + 0.6104793639970012, + 0.7128676210413687, + 0.8138036510208622, + 0.9180473400047049, + 1.0232864980353042, + 1.1246942940051667, + 1.224502534023486, + 1.326492706022691, + 1.4260760950273834, + 1.524984851013869, + 1.6260120030492544, + 1.7283769310452044, + 1.8299649220425636, + 1.9305340040009469, + 2.0358263780362904, + 2.143323036027141, + 2.2456969410413876, + 2.3456237420323305, + 2.4470939390012063, + 2.5506404990446754, + 2.6528640500037, + 2.7514144660090096, + 2.8540604379959404, + 2.9549369949963875, + 3.0630590220098384, + 3.164391073049046, + 3.267730190011207, + 3.3697180100134574, + 3.474675804027356, + 3.582560643029865, + 3.689239595027175, + 3.786400537006557, + 3.8870458920137025, + 3.988245093030855, + 4.088103685993701, + 4.188642079010606, + 4.291559590026736, + 4.394975908042397, + 4.495097864011768, + 4.597316119004972, + 4.699482533033006, + 4.80159933003597, + 4.877729889994953, + 4.9845043160021305, + 5.088660947047174, + 5.190333339036442, + 5.289681765018031, + 5.393847724015359, + 5.499440118030179, + 5.605751353024971, + 5.708559071994387, + 5.80961711902637, + 5.914755859004799, + 6.018460341030732, + 6.126797074044589, + 6.230333058047108, + 6.336180703015998, + 6.435918574046809, + 6.539339532027952, + 6.638851911993697, + 6.733893082011491, + 6.832889216020703, + 6.933536858006846, + 7.034027827030513, + 7.137508289015386, + 7.23375750699779, + 7.335279097023886, + 7.438967786030844, + 7.54432273702696, + 7.6454260180471465, + 7.746229053998832, + 7.848018023010809, + 7.947649157023989, + 8.051242021028884, + 8.156962623994332, + 8.257376008026768, + 8.358713483030442, + 8.4576559200068, + 8.561258944042493, + 8.665248884994071, + 8.765874542994425, + 8.871831774013117, + 8.956712910032365, + 9.01513337099459 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.98899600072764, + "p95": 107.49665799085051, + "max": 226.0912189958617 + } + }, + { + "start": 400990.030876842, + "first": 400990.288187918, + "last": 400999.045991125, + "end": 400999.046461835, + "elapsed_s": 9.01558499300154, + "chunk_offsets_s": [ + 0.25731107604224235, + 0.6103046900243498, + 0.7130848560482264, + 0.8135133920004591, + 0.9177816410083324, + 1.0230162549996749, + 1.1243255060398951, + 1.2242179550230503, + 1.3263025759952143, + 1.4258164280327037, + 1.52470153599279, + 1.6256611340213567, + 1.7287427760311402, + 1.8297525360248983, + 1.930568004027009, + 2.035798730037641, + 2.1435451190336607, + 2.2457873740349896, + 2.34581532899756, + 2.4474177840165794, + 2.5505940029979683, + 2.6532056550495327, + 2.7514989470364526, + 2.854145191027783, + 2.954855859046802, + 3.0629826210206375, + 3.164613076020032, + 3.2679453610326163, + 3.370004541997332, + 3.474677372025326, + 3.5827378460089676, + 3.6892661720048636, + 3.7864301060326397, + 3.8872401020489633, + 3.988163780013565, + 4.088404842012096, + 4.188597519008908, + 4.291844794002827, + 4.395002564997412, + 4.495289226993918, + 4.597399848047644, + 4.6994621170451865, + 4.801576290046796, + 4.8781599280191585, + 4.984133271034807, + 5.088936006999575, + 5.190738464007154, + 5.289853079011664, + 5.393935742031317, + 5.499607161036693, + 5.605788586020935, + 5.708798323001247, + 5.809914754994679, + 5.91493592603365, + 6.018432661017869, + 6.126821490994189, + 6.230176384036895, + 6.336183087027166, + 6.435839133046102, + 6.539522942039184, + 6.638607621018309, + 6.73389389901422, + 6.833104467019439, + 6.933818174002226, + 7.033849472994916, + 7.1373035029973835, + 7.233585457026493, + 7.335198472021148, + 7.438934890029486, + 7.544119743048213, + 7.6457465660059825, + 7.746273167023901, + 7.847916694008745, + 7.948365118005313, + 8.05164965800941, + 8.15675502200611, + 8.258077441016212, + 8.358762268035207, + 8.457368268049322, + 8.561279472021852, + 8.665275974024553, + 8.766243380028754, + 8.871759628993459, + 8.956685118027963, + 9.015114283014555 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.06072498112917, + "p95": 107.74638899601996, + "max": 352.9936139821075 + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.7, + "per_stream_tps": 21.9, + "ttft_s_max": 0.78, + "request": { + "ttft_s": 0.486, + "decode_tps": 21.967, + "prompt_ttft_tps": 68.507, + "prefill_tps": 68.507, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.522, + "round_gap_p50_ms": 102.524, + "round_gap_p95_ms": 110.285, + "tokens_per_chunk": 2.306, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.486, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.486, + "last_output_s": 12.094 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 164.914, + "aggregate_prefill_tps": 164.914, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.521, + "round_gap_p50_ms": 102.538, + "round_gap_p95_ms": 110.878, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 84.66371957509695, + "makespan_s": 12.095363108528545, + "steady_tps": 89.7, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 86.26982425641248, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.021266536030453, + "end_to_end_tps": 85.18237216776124, + "timing_valid": true, + "steady_tps": 90.26680740239284, + "per_stream_tps": [ + 21.9, + 22.3, + 22.7, + 21.6 + ], + "ttft_s": [ + 0.39, + 0.58, + 0.78, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.38996309600770473, + "decode_tps": 21.92549421971958, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.05904693957953, + "prefill_tps": 82.05904693957953, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.60900611766413, + "round_gap_p50_ms": 102.48236800543964, + "round_gap_p95_ms": 106.81492398725823, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018105030176229775, + "first_payload_s": 0.001815575989894569, + "first_content_s": 0.38996309600770473, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38996309600770473, + "last_output_s": 12.020259656012058 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5822876900201663, + "decode_tps": 22.293604757380376, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.95565258968766, + "prefill_tps": 54.95565258968766, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.85591320394009, + "round_gap_p50_ms": 102.46801597531885, + "round_gap_p95_ms": 106.77414003293961, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0029832710279151797, + "first_payload_s": 0.0029886470292694867, + "first_content_s": 0.5822876900201663, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5822876900201663, + "last_output_s": 12.020545557024889 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7751257790368982, + "decode_tps": 22.6775257847484, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.28362243320088, + "prefill_tps": 41.28362243320088, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.09652135298386, + "round_gap_p50_ms": 102.53306000959128, + "round_gap_p95_ms": 106.85428400756791, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0025800970033742487, + "first_payload_s": 0.0025860010064207017, + "first_content_s": 0.7751257790368982, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7751257790368982, + "last_output_s": 12.019738724047784 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19743649900192395, + "decode_tps": 21.569378466378677, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.07742824536294, + "prefill_tps": 162.07742824536294, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.362022047077176, + "round_gap_p50_ms": 102.51486400375143, + "round_gap_p95_ms": 106.87545203836635, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0015316199860535562, + "first_payload_s": 0.0015339719830080867, + "first_content_s": 0.19743649900192395, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19743649900192395, + "last_output_s": 12.019752121006604 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.230865680416315, + "round_gap_p50_ms": 102.52873599529266, + "round_gap_p95_ms": 106.82780895149335, + "round_gap_mean_ms": 104.8533704409651, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 165.04802520603778, + "aggregate_prefill_tps": 165.04802520603778 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400999.798278002, + "first": 401000.188241098, + "last": 401011.818537658, + "end": 401011.818629642, + "elapsed_s": 12.020351640006993, + "chunk_offsets_s": [ + 0.38996309600770473, + 0.8789272209978662, + 0.9807197289774194, + 1.0842120629968122, + 1.186109211994335, + 1.2886499559972435, + 1.3932201599818654, + 1.4951004160102457, + 1.598418284964282, + 1.697999775991775, + 1.7990851039648987, + 1.9050390819902532, + 2.0053633080096915, + 2.10757797898259, + 2.2103039610083215, + 2.3106261090142652, + 2.4137894209707156, + 2.5161342219798826, + 2.6235172729939222, + 2.7303321969811805, + 2.832913893973455, + 2.9301789739984088, + 3.034101996978279, + 3.138835306977853, + 3.2414684129762463, + 3.34413633600343, + 3.451040109968744, + 3.5520333320018835, + 3.6548680390114896, + 3.7573149069794454, + 3.857507328968495, + 3.95951202098513, + 4.0595955639728345, + 4.159943441976793, + 4.26571933098603, + 4.372085059992969, + 4.478595398017205, + 4.581334171001799, + 4.681925955985207, + 4.785818871983793, + 4.886783519992605, + 4.988522726984229, + 5.094381625007372, + 5.192843139986508, + 5.29836549598258, + 5.401164799986873, + 5.506270997982938, + 5.608086526975967, + 5.711373558966443, + 5.815275629982352, + 5.918388900987338, + 6.021923821012024, + 6.123837077990174, + 6.224422705010511, + 6.332342677982524, + 6.435703760012984, + 6.538449466985185, + 6.641368580982089, + 6.742908960964996, + 6.846016763010994, + 6.946326904988382, + 7.046914934006054, + 7.148901249980554, + 7.2502463510027155, + 7.353106939990539, + 7.4570078639662825, + 7.555992504989263, + 7.660270821012091, + 7.764803439960815, + 7.871870247996412, + 7.974721973005217, + 8.07537928497186, + 8.17032711399952, + 8.272057513997424, + 8.373334650998004, + 8.475092171982396, + 8.578905881964602, + 8.683396903972607, + 8.785879271978047, + 8.890793300990481, + 8.993223141005728, + 9.092434905003756, + 9.196512678987347, + 9.29891511297319, + 9.40243236196693, + 9.5049877249985, + 9.608149261970539, + 9.709082993969787, + 9.808095207961742, + 9.907380365999416, + 10.007844242965803, + 10.108003430999815, + 10.211086073017213, + 10.315941227017902, + 10.416459970001597, + 10.521621843974572, + 10.620975564001128, + 10.719987637014128, + 10.820780426962301, + 10.925622222013772, + 11.024506149988156, + 11.125371532980353, + 11.223555589967873, + 11.328613643010613, + 11.435292253969237, + 11.537222406012006, + 11.638147405989002, + 11.739394438976888, + 11.841502126015257, + 11.946247810963541, + 12.020259656012058 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.51155600417405, + "p95": 106.81492398725823, + "max": 488.9641249901615 + } + }, + { + "start": 400999.79844274, + "first": 401000.38073043, + "last": 401011.818988297, + "end": 401011.819170233, + "elapsed_s": 12.020727492985316, + "chunk_offsets_s": [ + 0.5822876900201663, + 0.8789475570083596, + 0.980808946012985, + 1.0841793270083144, + 1.1860845389892347, + 1.2887459219782613, + 1.3928111669956706, + 1.495285740995314, + 1.5985202509909868, + 1.6977484140079468, + 1.7990173419821076, + 1.9046658480074257, + 2.005383449024521, + 2.1069714649929665, + 2.2092183440108784, + 2.310366715013515, + 2.4134578829980455, + 2.516538331983611, + 2.6235401349840686, + 2.730314275017008, + 2.8330602439818904, + 2.9303311789990403, + 3.0345206820056774, + 3.139127672999166, + 3.241920378000941, + 3.3441039500175975, + 3.4509976760018617, + 3.5521475700079463, + 3.6554254600196145, + 3.757227497000713, + 3.857768031011801, + 3.9595356510253623, + 4.059783113014419, + 4.15996348799672, + 4.265949200023897, + 4.372177986020688, + 4.478723010979593, + 4.581962264026515, + 4.681879921990912, + 4.785869062005077, + 4.886887598026078, + 4.988719091983512, + 5.094318646995816, + 5.193055713025387, + 5.2984908380312845, + 5.401230750023387, + 5.506340019986965, + 5.608185580989812, + 5.711668292002287, + 5.815438618999906, + 5.918445970979519, + 6.021305659029167, + 6.123377843992785, + 6.224069710995536, + 6.331839411985129, + 6.4358771169791, + 6.538957447977737, + 6.641626050986815, + 6.7428916150238365, + 6.8460880250204355, + 6.947289269999601, + 7.046960723993834, + 7.148875358980149, + 7.249954300990794, + 7.353727209032513, + 7.457269893027842, + 7.555700311029796, + 7.660332801984623, + 7.76500674901763, + 7.871370534005109, + 7.97484921902651, + 8.075408449978568, + 8.17040319199441, + 8.271675656025764, + 8.373346504988149, + 8.475112729996908, + 8.579555527016055, + 8.683547989989165, + 8.785928742028773, + 8.89078925101785, + 8.993257266993169, + 9.092399863002356, + 9.196580037008971, + 9.299177830980625, + 9.402745768020395, + 9.505032713990659, + 9.609001787030138, + 9.709878558991477, + 9.80891896499088, + 9.90761841199128, + 10.007828544010408, + 10.108277989027556, + 10.211598934023641, + 10.315993753029034, + 10.416538015997503, + 10.521126675012056, + 10.620282315008808, + 10.719623634999152, + 10.821194745018147, + 10.925824907026254, + 11.024268740031403, + 11.125073642993812, + 11.224013091996312, + 11.327861289028078, + 11.435602154990193, + 11.537201586994343, + 11.638930139015429, + 11.739063764980529, + 11.841184717020951, + 11.945955329982098, + 12.020545557024889 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.47129498748109, + "p95": 106.77414003293961, + "max": 296.65986698819324 + } + }, + { + "start": 400999.79858847, + "first": 401000.573714249, + "last": 401011.818327194, + "end": 401011.819448937, + "elapsed_s": 12.020860467047896, + "chunk_offsets_s": [ + 0.7751257790368982, + 0.8787244830164127, + 0.9804916940047406, + 1.0845657470053993, + 1.186062299006153, + 1.2887339520384558, + 1.392748284037225, + 1.4949092920287512, + 1.5982145850430243, + 1.6978229230153374, + 1.7990011000074446, + 1.9050662300433032, + 2.005304263031576, + 2.1071452230098657, + 2.2097685650223866, + 2.3104627120192163, + 2.4135606810450554, + 2.516626233002171, + 2.623480517009739, + 2.7303652810514905, + 2.833098257018719, + 2.9302800410077907, + 3.033899513015058, + 3.1388795430539176, + 3.2420180400367826, + 3.3440869720070623, + 3.451356122037396, + 3.5518519040197134, + 3.655337762029376, + 3.7572161980206147, + 3.856998861010652, + 3.9595319210202433, + 4.059493495034985, + 4.159948478045408, + 4.265640575031284, + 4.371906608052086, + 4.478734417003579, + 4.581280983053148, + 4.6818148150341585, + 4.78590770001756, + 4.886821452004369, + 4.988435107050464, + 5.093968933040742, + 5.192739904043265, + 5.298147172026802, + 5.400981131999288, + 5.506387185014319, + 5.608093227026984, + 5.711338723020162, + 5.815053402038757, + 5.918170609045774, + 6.021451129054185, + 6.123290657997131, + 6.224207405000925, + 6.331814434030093, + 6.435535148018971, + 6.538301238033455, + 6.641295105044264, + 6.742952493019402, + 6.846137479005847, + 6.946515092044137, + 7.046982034051325, + 7.149005053041037, + 7.250520330038853, + 7.353264375007711, + 7.45706331502879, + 7.555930229020305, + 7.660089376033284, + 7.764729595044628, + 7.871651060006116, + 7.974526433041319, + 8.075326864025556, + 8.170489862037357, + 8.272103958006483, + 8.373531767050736, + 8.475249960029032, + 8.578746262006462, + 8.683314228022937, + 8.78584296401823, + 8.891129057039507, + 8.993312721024267, + 9.09234707703581, + 9.19658419402549, + 9.298760261037387, + 9.402248038037214, + 9.504994760034606, + 9.608587673050351, + 9.709981085034087, + 9.808349860017188, + 9.907223434012849, + 10.00780596601544, + 10.108302147011273, + 10.210932181042153, + 10.31593151105335, + 10.416334189998452, + 10.52137513604248, + 10.620563032047357, + 10.719576001050882, + 10.820565911009908, + 10.924935658054892, + 11.024368610000238, + 11.125117001007311, + 11.223469170043245, + 11.327914663008414, + 11.435104026051704, + 11.53719371301122, + 11.638417914044112, + 11.738995859050192, + 11.841259066015482, + 11.945999871008098, + 12.019738724047784 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.53981302957982, + "p95": 106.85428400756791, + "max": 107.60702902916819 + } + }, + { + "start": 400999.798182401, + "first": 400999.9956189, + "last": 401011.817934522, + "end": 401011.818018874, + "elapsed_s": 12.019836472987663, + "chunk_offsets_s": [ + 0.19743649900192395, + 0.8793156740139239, + 0.9811961500090547, + 1.084607811004389, + 1.1862935820245184, + 1.2888302929932252, + 1.3932228810153902, + 1.495391472009942, + 1.598828557995148, + 1.6981732959975488, + 1.7993332010228187, + 1.905226106988266, + 2.0057639800361358, + 2.1072941400343552, + 2.209561883006245, + 2.3107933580176905, + 2.4137823180062696, + 2.5163756469846703, + 2.6237447939929552, + 2.7306202460313216, + 2.8331588390283287, + 2.930430701992009, + 3.0343540140311234, + 3.1390891799819656, + 3.241720717982389, + 3.3444107050308958, + 3.4513030709931627, + 3.5524536360171624, + 3.6550836880342104, + 3.7575669070356525, + 3.858114081027452, + 3.959736005985178, + 4.059846413030755, + 4.16041240200866, + 4.265944836020935, + 4.372370581026189, + 4.479083942016587, + 4.582505291036796, + 4.681802437000442, + 4.786211497033946, + 4.88704795303056, + 4.988770104013383, + 5.09469967399491, + 5.193086981016677, + 5.298843976983335, + 5.401440513029229, + 5.506857077998575, + 5.608394959999714, + 5.711587304016575, + 5.815649789990857, + 5.918658022012096, + 6.02164079801878, + 6.123993383022025, + 6.224690129980445, + 6.332309846999124, + 6.436017905012704, + 6.538753067026846, + 6.641770966001786, + 6.743306241987739, + 6.846607627987396, + 6.947164121025708, + 7.047167495009489, + 7.1492760659893975, + 7.251026190991979, + 7.353839739982504, + 7.457257831993047, + 7.55644116201438, + 7.660740389022976, + 7.765047663997393, + 7.871850905008614, + 7.975182853988372, + 8.075607013015542, + 8.17096236301586, + 8.272351419029292, + 8.373840347980149, + 8.475603932980448, + 8.579339482996147, + 8.68361728900345, + 8.786132153007202, + 8.891097254003398, + 8.993450869980734, + 9.092835817020386, + 9.19673576799687, + 9.299346890009474, + 9.403051226981916, + 9.505472669028677, + 9.608392127032857, + 9.709673875011504, + 9.808307704981416, + 9.90768276702147, + 10.008146210981067, + 10.108635384007357, + 10.211389242031146, + 10.31619226798648, + 10.41668862698134, + 10.52146682102466, + 10.620743885985576, + 10.719457653991412, + 10.82102745200973, + 10.925449679023586, + 11.024721799010877, + 11.125424541998655, + 11.223826406989247, + 11.328274444036651, + 11.435600686992984, + 11.537516502023209, + 11.638361263030674, + 11.73923551198095, + 11.841498575988226, + 11.946271635999437, + 12.019752121006604 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.52578748622909, + "p95": 106.87545203836635, + "max": 681.8791750119999 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.20052401299519, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.169459681026638, + "end_to_end_tps": 84.14506698243265, + "timing_valid": true, + "steady_tps": 89.10119680298199, + "per_stream_tps": [ + 22.0, + 21.3, + 22.4, + 21.6 + ], + "ttft_s": [ + 0.58, + 0.2, + 0.78, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.5829312049900182, + "decode_tps": 22.00937044651865, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.894985422075585, + "prefill_tps": 54.894985422075585, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.435193270517914, + "round_gap_p50_ms": 102.51073498511687, + "round_gap_p95_ms": 115.40078901452944, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016252779751084745, + "first_payload_s": 0.0016412939876317978, + "first_content_s": 0.5829312049900182, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5829312049900182, + "last_output_s": 12.168905488972086 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.1972712540300563, + "decode_tps": 21.301028810289754, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.21319298312196, + "prefill_tps": 162.21319298312196, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.946089266680694, + "round_gap_p50_ms": 102.57650801213458, + "round_gap_p95_ms": 114.92797400569543, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012520470190793276, + "first_payload_s": 0.0012702710228040814, + "first_content_s": 0.1972712540300563, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1972712540300563, + "last_output_s": 12.168524017033633 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7761441170005128, + "decode_tps": 22.383892270830493, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.22945635878454, + "prefill_tps": 41.22945635878454, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.674982701875635, + "round_gap_p50_ms": 102.54817601526156, + "round_gap_p95_ms": 113.69530000956729, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0017195669934153557, + "first_payload_s": 0.0017278390005230904, + "first_content_s": 0.7761441170005128, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7761441170005128, + "last_output_s": 12.1682647059788 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3897599739721045, + "decode_tps": 21.649888457599673, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.10181172243784, + "prefill_tps": 82.10181172243784, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.18961441572573, + "round_gap_p50_ms": 102.55059803603217, + "round_gap_p95_ms": 115.27803697390482, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014748310204595327, + "first_payload_s": 0.0014781429781578481, + "first_content_s": 0.3897599739721045, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3897599739721045, + "last_output_s": 12.168111649982166 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.811469913699995, + "round_gap_p50_ms": 102.54751599859446, + "round_gap_p95_ms": 114.92797400569543, + "round_gap_mean_ms": 106.19931661812271, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.77944680550695, + "aggregate_prefill_tps": 164.77944680550695 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 401011.821353655, + "first": 401012.40428486, + "last": 401023.990259144, + "end": 401023.990614632, + "elapsed_s": 12.169260977010708, + "chunk_offsets_s": [ + 0.5829312049900182, + 0.8813166189938784, + 0.98373186099343, + 1.0875072769704275, + 1.189294711977709, + 1.2920364679885097, + 1.3929264330072328, + 1.4944006379810162, + 1.5995314639876597, + 1.699527765973471, + 1.801194466999732, + 1.906199436984025, + 2.006750058964826, + 2.1082577359629795, + 2.210781013011001, + 2.3126861639902927, + 2.413483203970827, + 2.515139378956519, + 2.624882186995819, + 2.7321906609577127, + 2.834635666979011, + 2.932034022989683, + 3.0365711550111882, + 3.1410295839887112, + 3.243324479961302, + 3.345831232960336, + 3.453073788958136, + 3.5540808310033754, + 3.656914479972329, + 3.7594370889710262, + 3.8594936360022984, + 3.960999606002588, + 4.0617884249659255, + 4.161771947983652, + 4.268325530982111, + 4.374381978996098, + 4.477914812974632, + 4.580794847977813, + 4.684286531002726, + 4.788986083993223, + 4.890129545005038, + 4.992626059975009, + 5.098234540957492, + 5.197600994957611, + 5.3034849659889005, + 5.405591083981562, + 5.507964321994223, + 5.610500679002143, + 5.715512058988679, + 5.818699455994647, + 5.920697189983912, + 6.02295527595561, + 6.125277377956081, + 6.225791962002404, + 6.333655341994017, + 6.437505716981832, + 6.539735884987749, + 6.642882612999529, + 6.74357265495928, + 6.846246454981156, + 6.946478176978417, + 7.047925209975801, + 7.150010273966473, + 7.251313932996709, + 7.354359462973662, + 7.455811186984647, + 7.555334495962597, + 7.66134080698248, + 7.767108622996602, + 7.874612548970617, + 7.979238957981579, + 8.080123018007725, + 8.175195482966956, + 8.27777528698789, + 8.379641796986107, + 8.481085075007286, + 8.585521949979011, + 8.698371474980377, + 8.812077893991955, + 8.932584228983615, + 9.051493220962584, + 9.150319043954369, + 9.255262832972221, + 9.35704358498333, + 9.461935037979856, + 9.565302269009408, + 9.667813003994524, + 9.772646121971775, + 9.883315778977703, + 9.998716567992233, + 10.121329622983467, + 10.243032185011543, + 10.35436286800541, + 10.459292932006065, + 10.560093990992755, + 10.664457878971007, + 10.766341881011613, + 10.865452989994083, + 10.966333521006163, + 11.071346175973304, + 11.170434260973707, + 11.270904073957354, + 11.369267424975988, + 11.47293265996268, + 11.582068850984797, + 11.682306728966068, + 11.78632002795348, + 11.887241985998116, + 11.989036821993068, + 12.094271543959621, + 12.168905488972086 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.51667199190706, + "p95": 115.40078901452944, + "max": 298.3854140038602 + } + }, + { + "start": 401011.821230535, + "first": 401012.018501789, + "last": 401023.989754552, + "end": 401023.98981228, + "elapsed_s": 12.168581745005213, + "chunk_offsets_s": [ + 0.1972712540300563, + 0.8811280280351639, + 0.9837215730221942, + 1.0874639340327121, + 1.1894914479926229, + 1.2920094120199792, + 1.3928565449896269, + 1.4941421750118025, + 1.5995075280079618, + 1.6995463910279796, + 1.801382995035965, + 1.9061475170310587, + 2.0066885389969684, + 2.1086796080344357, + 2.2107679250184447, + 2.3126207400346175, + 2.4134087080019526, + 2.515145907003898, + 2.6248697389964946, + 2.731881013023667, + 2.834568227001, + 2.9320057510049082, + 3.036548562988173, + 3.1409030400100164, + 3.2432962720049545, + 3.3458284810185432, + 3.4530741730122827, + 3.5545687029953115, + 3.656478049000725, + 3.759899121010676, + 3.859900243987795, + 3.9608499099849723, + 4.061651912983507, + 4.162090683996212, + 4.268615243025124, + 4.374400986998808, + 4.4779339649830945, + 4.58108584000729, + 4.684026786999311, + 4.788850628014188, + 4.890138424991164, + 4.992293932009488, + 5.098613148031291, + 5.197775795008056, + 5.303229318000376, + 5.405806188005954, + 5.507912689994555, + 5.610492199019063, + 5.715290923020802, + 5.818576799996663, + 5.920420263020787, + 6.023188556020614, + 6.125323042040691, + 6.226256538007874, + 6.3338306859950535, + 6.437243557011243, + 6.539732732984703, + 6.642502373026218, + 6.74329948698869, + 6.846181447035633, + 6.946403617039323, + 7.047953929984942, + 7.150043842033483, + 7.251729740994051, + 7.354424518998712, + 7.455745763028972, + 7.555540703004226, + 7.661582102999091, + 7.767010734998621, + 7.874582869990263, + 7.979556302016135, + 8.080015882034786, + 8.175174586998764, + 8.277751095010899, + 8.379299189022277, + 8.481056082993746, + 8.58578036603285, + 8.698583187011536, + 8.812255989992991, + 8.93251853302354, + 9.051522469031624, + 9.150335301004816, + 9.255624160985462, + 9.357267680985387, + 9.461850350024179, + 9.565696509031113, + 9.66779321199283, + 9.772452522011008, + 9.883778194023762, + 9.998706168029457, + 10.12175551103428, + 10.242866216984112, + 10.35465654800646, + 10.459492388006765, + 10.560308006999549, + 10.664813879004214, + 10.76656986499438, + 10.865748013020493, + 10.966669343993999, + 11.07134521601256, + 11.170612021000125, + 11.27082476200303, + 11.369557728990912, + 11.472899124026299, + 11.582075827987865, + 11.682521945040207, + 11.786499324021861, + 11.887475088995416, + 11.98903880600119, + 12.094479000021238, + 12.168524017033633 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.57668900885619, + "p95": 114.92797400569543, + "max": 683.8567740051076 + } + }, + { + "start": 401011.821806742, + "first": 401012.597950859, + "last": 401023.990071448, + "end": 401023.990338008, + "elapsed_s": 12.168531265982892, + "chunk_offsets_s": [ + 0.7761441170005128, + 0.8807929559843615, + 0.9834832380292937, + 1.0871416460140608, + 1.1887486969935708, + 1.291513701027725, + 1.3923581300186925, + 1.4936663359985687, + 1.5988684730255045, + 1.6991922790184617, + 1.8009702760027722, + 1.9059251979924738, + 2.006182012031786, + 2.10788045701338, + 2.210499844979495, + 2.3123978929943405, + 2.4132847569999285, + 2.5143472520285286, + 2.6247259639785625, + 2.731554933998268, + 2.833732020983007, + 2.931678374996409, + 3.035721267980989, + 3.1405129129998386, + 3.2430610890151, + 3.345486898033414, + 3.45286247797776, + 3.554048096004408, + 3.6561202090233564, + 3.758702897990588, + 3.858327526017092, + 3.9601190789835528, + 4.0608842659858055, + 4.161234540981241, + 4.267686780018266, + 4.373679276031908, + 4.477216175000649, + 4.580198193027172, + 4.6837387080304325, + 4.788673365022987, + 4.889830842032097, + 4.9919892770121805, + 5.097973036987241, + 5.196719523984939, + 5.302848886989523, + 5.40498450899031, + 5.507688449986745, + 5.610287752002478, + 5.715162012027577, + 5.818419105024077, + 5.9200368549791165, + 6.022808748995885, + 6.124921794980764, + 6.22560164303286, + 6.33307558298111, + 6.436802758020349, + 6.539339838025626, + 6.641744295018725, + 6.7428740480099805, + 6.845728455984499, + 6.9460763380047865, + 7.047305818996392, + 7.149390915990807, + 7.2510369420051575, + 7.353733623982407, + 7.455081539985258, + 7.555076192016713, + 7.660817080002744, + 7.766559568000957, + 7.874376485997345, + 7.979480175010394, + 8.079752026998904, + 8.17503486003261, + 8.277582376031205, + 8.379022278008051, + 8.480969458993059, + 8.584934303013142, + 8.697817524021957, + 8.811512824031524, + 8.931841254001483, + 9.05083573400043, + 9.15004429302644, + 9.254996818024665, + 9.3570682569989, + 9.461666527029593, + 9.565058846026659, + 9.667518812988419, + 9.772005067032296, + 9.883014900027774, + 9.998326265020296, + 10.120986392023042, + 10.242428506026044, + 10.35414434102131, + 10.458999989030417, + 10.559784055978525, + 10.663852871977724, + 10.76580469799228, + 10.865070270025171, + 10.965948145021684, + 11.07105579302879, + 11.169798485992942, + 11.270374730986077, + 11.368658209976275, + 11.472628389019519, + 11.581681284005754, + 11.68204612203408, + 11.785981709021144, + 11.88695104198996, + 11.988370647013653, + 12.09403514501173, + 12.1682647059788 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.56543249124661, + "p95": 113.69530000956729, + "max": 122.66012700274587 + } + }, + { + "start": 401011.821154951, + "first": 401012.210914925, + "last": 401023.989266601, + "end": 401023.989402873, + "elapsed_s": 12.168247921974398, + "chunk_offsets_s": [ + 0.3897599739721045, + 0.8813316759769805, + 0.9845184999867342, + 1.0878816290060058, + 1.1896217840258032, + 1.2923014119733125, + 1.393194272997789, + 1.4944393429905176, + 1.599449256027583, + 1.7000129820080474, + 1.8012836829875596, + 1.9066676929942332, + 2.0070074829855002, + 2.1085869999951683, + 2.2112538759829476, + 2.3131471389788203, + 2.4138582599698566, + 2.514842964010313, + 2.6252768429694697, + 2.7320606610155664, + 2.8345220839837566, + 2.9324075580225326, + 3.036503842973616, + 3.1413435200229287, + 3.2437912470195442, + 3.3462281600222923, + 3.4533665730268694, + 3.5543810710078105, + 3.656919343979098, + 3.7598272649920546, + 3.859408035990782, + 3.961291669984348, + 4.061815432971343, + 4.162081899994519, + 4.269179770024493, + 4.374682474997826, + 4.478208780987188, + 4.5810595999937505, + 4.684261346992571, + 4.7891200999729335, + 4.890640263969544, + 4.992510619980749, + 5.098277773009613, + 5.197492083010729, + 5.303432245971635, + 5.405982844007667, + 5.508538049005438, + 5.610881334985606, + 5.715562874975149, + 5.819312191975769, + 5.920619958022144, + 6.023349980008788, + 6.125261873996351, + 6.226193577982485, + 6.334049149998464, + 6.437636804999784, + 6.540143357007764, + 6.642503685026895, + 6.743592910992447, + 6.846527558984235, + 6.946613456995692, + 7.04830506601138, + 7.15031686599832, + 7.251895021006931, + 7.3547167429933324, + 7.455943363020197, + 7.555806782969739, + 7.66177611897001, + 7.7674501269939356, + 7.8751181489788, + 7.980309228994884, + 8.079962665971834, + 8.175588426995091, + 8.27816555899335, + 8.379511172999628, + 8.481442258984316, + 8.585955357993953, + 8.698885522026103, + 8.812413974024821, + 8.932886069000233, + 9.051249156997073, + 9.150607827992644, + 9.255764912988525, + 9.357602961012162, + 9.462256590020843, + 9.565858861024026, + 9.668115451990161, + 9.772909705992788, + 9.88376784301363, + 9.999045879987534, + 10.1217520069913, + 10.243325449002441, + 10.354644979990553, + 10.459721667983104, + 10.560597222996876, + 10.664825431013014, + 10.766761481005233, + 10.865946797013748, + 10.966678879980464, + 11.071863632008899, + 11.17037333297776, + 11.271279370004777, + 11.369572705007158, + 11.47345133201452, + 11.582513027009554, + 11.682326217007358, + 11.786797211971134, + 11.88728089799406, + 11.989381877996493, + 12.094883959973231, + 12.168111649982166 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 102.55290151690133, + "p95": 115.27803697390482, + "max": 491.571702004876 + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.48, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db2/drafted.json b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/drafted.json new file mode 100644 index 00000000000..3e997353fd6 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/drafted.json @@ -0,0 +1,150 @@ +[ + { + "label": "drafted", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 256, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 42.70046765760802, + "decode_tps_all": [ + 42.66, + 42.71, + 42.7 + ], + "ttft_s_median": 0.1328611770295538, + "prompt_ttft_tps_median": 105.373, + "prefill_tps_median": 105.373, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 23.419, + "round_gap_p50_ms_median": 69.257, + "round_gap_p95_ms_median": 82.429, + "tokens_per_chunk_median": 2.977, + "headers_s_median": 0.001, + "first_payload_s_median": 0.133, + "first_content_s_median": 0.133, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.133, + "last_output_s_median": 6.105, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "drafted", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 256, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 33.98829005069245, + "decode_tps_all": [ + 33.99, + 34.66, + 33.78 + ], + "ttft_s_median": 0.19805510097648948, + "prompt_ttft_tps_median": 161.571, + "prefill_tps_median": 161.571, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 29.422, + "round_gap_p50_ms_median": 61.309, + "round_gap_p95_ms_median": 72.803, + "tokens_per_chunk_median": 2.065, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.198, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.198, + "last_output_s_median": 7.699, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/db2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/db2/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/determinism.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/determinism.txt new file mode 100644 index 00000000000..8c3d5cc3dfd --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/determinism.txt @@ -0,0 +1,4 @@ +# tools/first.py 8090 prompts/p8192.json 16 REPS, a fresh serve each (--context 65536 --parallel 4 --prompt-cache-gib 0) +head 60e673799f (dependent, default) REPS 60 {'b15475d6': 60} +main 077998f7d9 REPS 30 {'b15475d6': 30} +earlier 79c9ffe97f (const __restrict__ inputs, dependent) REPS 30 {'b15475d6': 24, 'ca814dc1': 3, '51a38b88': 2, '95fe4f96': 1} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/c4.json b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/c4.json new file mode 100644 index 00000000000..fe18f2de817 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/c4.json @@ -0,0 +1,2798 @@ +{ + "label": "c4", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 117.2, + "per_stream_tps": 29.9, + "ttft_s_max": 0.51, + "request": { + "ttft_s": 0.318, + "decode_tps": 29.934, + "prompt_ttft_tps": 45.74, + "prefill_tps": 45.74, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.408, + "round_gap_p50_ms": 97.942, + "round_gap_p95_ms": 112.426, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.318, + "first_content_s": 0.318, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.318, + "last_output_s": 8.839 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 110.111, + "aggregate_prefill_tps": 110.111, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.413, + "round_gap_p50_ms": 98.071, + "round_gap_p95_ms": 112.731, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 115.92094196545614, + "makespan_s": 8.840351483522682, + "steady_tps": 120.4, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 120.49457473145442, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 8.596165099006612, + "end_to_end_tps": 119.12288656698034, + "timing_valid": true, + "steady_tps": 123.8864241577385, + "per_stream_tps": [ + 30.6, + 30.1, + 31.5, + 31.0 + ], + "ttft_s": [ + 0.26, + 0.13, + 0.51, + 0.38 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.25568982801632956, + "decode_tps": 30.57569559978269, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.75384026268692, + "prefill_tps": 54.75384026268692, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.70571545090563, + "round_gap_p50_ms": 96.65600501466542, + "round_gap_p95_ms": 102.02535497955978, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0016988060087896883, + "first_payload_s": 0.25568982801632956, + "first_content_s": 0.25568982801632956, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25568982801632956, + "last_output_s": 8.595647267997265 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13046218804083765, + "decode_tps": 30.12677717869524, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.31078644501716, + "prefill_tps": 107.31078644501716, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.19306257249349, + "round_gap_p50_ms": 96.6934299794957, + "round_gap_p95_ms": 102.0545709761791, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015445160097442567, + "first_payload_s": 0.13046218804083765, + "first_content_s": 0.13046218804083765, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13046218804083765, + "last_output_s": 8.594693144026678 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5068931499845348, + "decode_tps": 31.5274413017577, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.619232969368664, + "prefill_tps": 27.619232969368664, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.7184001844212, + "round_gap_p50_ms": 96.62363701499999, + "round_gap_p95_ms": 101.77088697673753, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001766455010510981, + "first_payload_s": 0.5068931499845348, + "first_content_s": 0.5068931499845348, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5068931499845348, + "last_output_s": 8.59508519701194 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38119475200073794, + "decode_tps": 31.04517508979741, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.72663363417159, + "prefill_tps": 36.72663363417159, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.21112450187587, + "round_gap_p50_ms": 96.69613401638344, + "round_gap_p95_ms": 102.11684397654608, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0020903469994664192, + "first_payload_s": 0.38119475200073794, + "first_content_s": 0.38119475200073794, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38119475200073794, + "last_output_s": 8.595031499979086 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.45707567742405, + "round_gap_p50_ms": 96.6934299794957, + "round_gap_p95_ms": 102.0545709761791, + "round_gap_mean_ms": 98.53040830646586, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 110.35923430933549, + "aggregate_prefill_tps": 110.35923430933549 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400624.084954615, + "first": 400624.340644443, + "last": 400632.680601883, + "end": 400632.681029329, + "elapsed_s": 8.59607471403433, + "chunk_offsets_s": [ + 0.25568982801632956, + 0.6008039040025324, + 0.6971161290421151, + 0.7935801960411482, + 0.8935440850327723, + 0.9942851510131732, + 1.0907423539902084, + 1.185606351995375, + 1.2833839560043998, + 1.3777534040273167, + 1.472703948034905, + 1.568147697020322, + 1.6646168840234168, + 1.7613510030205362, + 1.8561854810104705, + 1.9551951810135506, + 2.0561296740197577, + 2.1526665900018997, + 2.248009697999805, + 2.3446262790239416, + 2.4416005450184457, + 2.537386347015854, + 2.631289500044659, + 2.7296172720380127, + 2.8284067770000547, + 2.9291822760133073, + 3.028666717989836, + 3.1270869220024906, + 3.2240214270423166, + 3.323739696003031, + 3.426799145003315, + 3.5287055860389955, + 3.6211483210208826, + 3.717605188023299, + 3.813384286011569, + 3.9083801090018824, + 4.004642078012694, + 4.102921336016152, + 4.201088080997579, + 4.296313572034705, + 4.393387102987617, + 4.489860608999152, + 4.5862152830231935, + 4.6582275130203925, + 4.75902107602451, + 4.855677081039175, + 4.953053528035525, + 5.047838037018664, + 5.146052670024801, + 5.248078025004361, + 5.34890990803251, + 5.44706399703864, + 5.5435835210373625, + 5.643149292038288, + 5.7427054950385354, + 5.842823257029522, + 5.944911317026708, + 6.049102730990853, + 6.143258864001837, + 6.238942936994135, + 6.333398866001517, + 6.424880612001289, + 6.52177605999168, + 6.616899324988481, + 6.712879433995113, + 6.81070654198993, + 6.9029373220400885, + 6.9995983830303885, + 7.097751944034826, + 7.197333699034061, + 7.294507935002912, + 7.3906096770078875, + 7.486367095028982, + 7.582149519992527, + 7.678338544035796, + 7.777988283021841, + 7.874286203994416, + 7.971095475018956, + 8.065476043033414, + 8.163573955011088, + 8.261935662012547, + 8.357456660014577, + 8.45906762604136, + 8.539741632004734, + 8.595647267997265 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 96.65853300248273, + "p95": 102.02535497955978, + "max": 345.1140759862028 + } + }, + { + "start": 400624.08502828, + "first": 400624.215490468, + "last": 400632.679721424, + "end": 400632.679978787, + "elapsed_s": 8.594950507045723, + "chunk_offsets_s": [ + 0.13046218804083765, + 0.6008136960444972, + 0.6975081820273772, + 0.793778694991488, + 0.8937344549922273, + 0.9944090250064619, + 1.090632097038906, + 1.1855003510136157, + 1.2832843870273791, + 1.3777324280235916, + 1.4728782700258307, + 1.568149633007124, + 1.6644807230331935, + 1.7615311170229688, + 1.856355659023393, + 1.955076539015863, + 2.056140842032619, + 2.1528342720121145, + 2.2482116050086915, + 2.34448195702862, + 2.4417799710063264, + 2.5375559329986572, + 2.6314857749966905, + 2.72948483802611, + 2.8283991770003922, + 2.9291824840474874, + 3.0285218360368162, + 3.1272661720286123, + 3.224021635018289, + 3.3239195060450584, + 3.4269910030416213, + 3.5286700970027596, + 3.621348674991168, + 3.7177789180423133, + 3.813547583995387, + 3.908588624035474, + 4.004506684024818, + 4.102440930029843, + 4.200585002021398, + 4.2965143420151435, + 4.393208876019344, + 4.48985456104856, + 4.586345765041187, + 4.658104614994954, + 4.759100629016757, + 4.855850827007089, + 4.952899366035126, + 5.047965398000088, + 5.145895435998682, + 5.2482097710017115, + 5.349078775034286, + 5.447187855024822, + 5.543413487030193, + 5.643001786025707, + 5.742552197014447, + 5.842379027046263, + 5.944433598022442, + 6.048606357013341, + 6.143001245043706, + 6.238778663042467, + 6.333231775031891, + 6.424613808048889, + 6.521236981032416, + 6.616737883014139, + 6.712732456042431, + 6.810295208997559, + 6.902774424001109, + 6.9994307170272805, + 7.0974362440174446, + 7.19716184103163, + 7.294043193047401, + 7.390304745000321, + 7.486195284000132, + 7.581979310023598, + 7.678168156999163, + 7.777798345021438, + 7.873848485993221, + 7.970904001034796, + 8.065065781003796, + 8.163253614038695, + 8.261759612010792, + 8.357279218034819, + 8.458798550011124, + 8.539420459012035, + 8.594693144026678 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 96.69395798118785, + "p95": 102.0545709761791, + "max": 470.35150800365955 + } + }, + { + "start": 400624.085404829, + "first": 400624.592297979, + "last": 400632.680490026, + "end": 400632.680818974, + "elapsed_s": 8.59541414497653, + "chunk_offsets_s": [ + 0.5068931499845348, + 0.6005177240003832, + 0.6970691360183991, + 0.7935280029778369, + 0.8935113319894299, + 0.9941491810022853, + 1.0903951490181498, + 1.1852712439722382, + 1.2831524329958484, + 1.3774369999882765, + 1.4726448429864831, + 1.5678372289985418, + 1.6642705759732053, + 1.7612854180042632, + 1.8560981680057012, + 1.9549048090120777, + 2.0559524549753405, + 2.1525760919903405, + 2.2479219369706698, + 2.3443894279771484, + 2.4415279509848915, + 2.537351850012783, + 2.6312550519942306, + 2.7292289140168577, + 2.8282256220118143, + 2.9289801130071282, + 3.028352328983601, + 3.1270486009889282, + 3.2237445269711316, + 3.3237049430026673, + 3.426751688006334, + 3.5285225749830715, + 3.6210656950133853, + 3.7175427229958586, + 3.813275819993578, + 3.9083190520177595, + 4.004261752997991, + 4.1022724629729055, + 4.200747067981865, + 4.296274002990685, + 4.393015242007095, + 4.489321177999955, + 4.586099952983204, + 4.657931909023318, + 4.758666638983414, + 4.855639463989064, + 4.952814563992433, + 5.0477145470213145, + 5.1457279460155405, + 5.247968807001598, + 5.348850547976326, + 5.446959340013564, + 5.543228027992882, + 5.642812550999224, + 5.7423460179707035, + 5.842154703976121, + 5.944200394966174, + 6.048560163995717, + 6.142736745008733, + 6.23854960402241, + 6.333152414008509, + 6.424376077018678, + 6.5209628969896585, + 6.616591944999527, + 6.712879033992067, + 6.810047557984944, + 6.902561908995267, + 6.999319435970392, + 7.097218272974715, + 7.197062846971676, + 7.293854261981323, + 7.390082294004969, + 7.486376375018153, + 7.582134847994894, + 7.678069115965627, + 7.778185773990117, + 7.873649907996878, + 7.970859279972501, + 8.06485776300542, + 8.163039723993279, + 8.261661865981296, + 8.357446276000701, + 8.458692164975218, + 8.539204903994687, + 8.59508519701194 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 96.65978149860166, + "p95": 101.77088697673753, + "max": 104.3597690295428 + } + }, + { + "start": 400624.08486423, + "first": 400624.466058982, + "last": 400632.67989573, + "end": 400632.68066198, + "elapsed_s": 8.595797749992926, + "chunk_offsets_s": [ + 0.38119475200073794, + 0.6012381819891743, + 0.6974685660097748, + 0.7942380610038526, + 0.8941460279747844, + 0.9947570289950818, + 1.09098688501399, + 1.1860014770063572, + 1.283601303002797, + 1.3780219670152292, + 1.473119328962639, + 1.5684301810106263, + 1.6649986010161228, + 1.7619765470153652, + 1.8567989289877005, + 1.9553833429818042, + 2.0563675650046207, + 2.153278917015996, + 2.248546216986142, + 2.3450378999696113, + 2.4421438470017165, + 2.5380553149734624, + 2.6319556210073642, + 2.729941723984666, + 2.8286588119808584, + 2.9296195289934985, + 3.028833760006819, + 3.1276663370081224, + 3.2243790950160474, + 3.3243177029653452, + 3.4273618079605512, + 3.5289585649734363, + 3.621676134993322, + 3.718151817971375, + 3.8138851720141247, + 3.9089291080017574, + 4.004865903989412, + 4.102750774007291, + 4.200909629988018, + 4.296957323967945, + 4.393653457984328, + 4.490078803966753, + 4.5867234650067985, + 4.658528300002217, + 4.759360471973196, + 4.856332336959895, + 4.953268281999044, + 5.048352682963014, + 5.146476147987414, + 5.24859299196396, + 5.349556044966448, + 5.44766843697289, + 5.543834531970788, + 5.643423439003527, + 5.742967625963502, + 5.842771688010544, + 5.944921988004353, + 6.0488706000032835, + 6.143409985990729, + 6.239146027015522, + 6.333773461985402, + 6.425052021979354, + 6.521649001981132, + 6.617081423988566, + 6.713514145987574, + 6.810706462012604, + 6.903180204972159, + 6.999798017961439, + 7.097904874011874, + 7.19768647197634, + 7.294656112964731, + 7.390746766992379, + 7.486597656970844, + 7.582326066971291, + 7.678706867969595, + 7.778559346974362, + 7.874299068003893, + 7.971290949964896, + 8.065476842981298, + 8.163719172007404, + 8.2621064959676, + 8.358041324012447, + 8.459067001007497, + 8.539899985014927, + 8.595031499979086 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 96.70444601215422, + "p95": 102.11684397654608, + "max": 220.0434299884364 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 113.91193117982017, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.084537868038751, + "end_to_end_tps": 112.71899736393195, + "timing_valid": true, + "steady_tps": 116.86610722368361, + "per_stream_tps": [ + 28.9, + 29.3, + 29.7, + 28.5 + ], + "ttft_s": [ + 0.25, + 0.38, + 0.51, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2545933640212752, + "decode_tps": 28.884137339612966, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.989650079135934, + "prefill_tps": 54.989650079135934, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.62107897640261, + "round_gap_p50_ms": 99.44813698530197, + "round_gap_p95_ms": 123.4069429920055, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001371090009342879, + "first_payload_s": 0.2545933640212752, + "first_content_s": 0.2545933640212752, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2545933640212752, + "last_output_s": 9.08296850300394 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3821572900051251, + "decode_tps": 29.30898189931137, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.634130412145865, + "prefill_tps": 36.634130412145865, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.11923359997351, + "round_gap_p50_ms": 99.52688997145742, + "round_gap_p95_ms": 122.79004004085436, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0012439040001481771, + "first_payload_s": 0.3821572900051251, + "first_content_s": 0.3821572900051251, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3821572900051251, + "last_output_s": 9.082561857998371 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5086539390031248, + "decode_tps": 29.74169280325412, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.523624465461957, + "prefill_tps": 27.523624465461957, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.62283399990559, + "round_gap_p50_ms": 99.18829397065565, + "round_gap_p95_ms": 122.73442203877494, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009238359634764493, + "first_payload_s": 0.5086539390031248, + "first_content_s": 0.5086539390031248, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5086539390031248, + "last_output_s": 9.08247660897905 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.12926660402445123, + "decode_tps": 28.479814627151082, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.30330158090834, + "prefill_tps": 108.30330158090834, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.11258809411825, + "round_gap_p50_ms": 99.49570597382262, + "round_gap_p95_ms": 123.67139494745061, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010458700126037002, + "first_payload_s": 0.12926660402445123, + "first_content_s": 0.12926660402445123, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12926660402445123, + "last_output_s": 9.082976568024606 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.36893366759999, + "round_gap_p50_ms": 99.44813698530197, + "round_gap_p95_ms": 123.4069429920055, + "round_gap_mean_ms": 104.33426291949998, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.86211811207937, + "aggregate_prefill_tps": 109.86211811207937 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400632.68201611, + "first": 400632.936609474, + "last": 400641.764984613, + "end": 400641.766437944, + "elapsed_s": 9.084421834035311, + "chunk_offsets_s": [ + 0.2545933640212752, + 0.6034670230001211, + 0.701762842014432, + 0.7998392329900526, + 0.9003295120201074, + 1.0014653989928775, + 1.0985558420070447, + 1.1946358230197802, + 1.2933102549868636, + 1.3888529010000639, + 1.4846435509971343, + 1.5808007020386867, + 1.6783338059904054, + 1.7755874510039575, + 1.870983647997491, + 1.9705994990072213, + 2.072994665999431, + 2.170861295016948, + 2.266122786037158, + 2.363187196024228, + 2.4602547910180874, + 2.5564333330257796, + 2.65025120502105, + 2.7482001230237074, + 2.845962702995166, + 2.946824665996246, + 3.0445198520319536, + 3.144132888002787, + 3.2408336930093355, + 3.341914124030154, + 3.4474150110036135, + 3.5529550510109402, + 3.646865021029953, + 3.7426571259857155, + 3.839552942023147, + 3.9347676649922505, + 4.030266374000348, + 4.1300699560088105, + 4.2276224690140225, + 4.325068164034747, + 4.422721877985168, + 4.5198699529864825, + 4.6176325480337255, + 4.689288069028407, + 4.79142382502323, + 4.889449751004577, + 4.9868073490215465, + 5.082294427033048, + 5.18174256401835, + 5.284628938010428, + 5.386700869014021, + 5.484721739019733, + 5.5823289880063385, + 5.682854755024891, + 5.781772613991052, + 5.883029910037294, + 6.000203269009944, + 6.126467625028454, + 6.244902856007684, + 6.365206624031998, + 6.488613567024004, + 6.607893161009997, + 6.7284067230066285, + 6.8510899289976805, + 6.975332884001546, + 7.0999321630224586, + 7.203103211999405, + 7.313073469034862, + 7.425322427996434, + 7.5367969130165875, + 7.647628493024968, + 7.756056329992134, + 7.862044423993211, + 7.964570921030827, + 8.068891440983862, + 8.188095705991145, + 8.30780853703618, + 8.427600474038627, + 8.543059218034614, + 8.648145508021116, + 8.747856384026818, + 8.844546100997832, + 8.947050022019539, + 9.028001294995192, + 9.08296850300394 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.53058647806756, + "p95": 123.4069429920055, + "max": 348.8736589788459 + } + }, + { + "start": 400632.682475252, + "first": 400633.064632542, + "last": 400641.76503711, + "end": 400641.765480972, + "elapsed_s": 9.083005719992798, + "chunk_offsets_s": [ + 0.3821572900051251, + 0.6028548550093547, + 0.7011002249782905, + 0.7996338859666139, + 0.8996062389924191, + 1.0008944799774326, + 1.0986432189820334, + 1.1944582209689543, + 1.2928088560001925, + 1.388346110994462, + 1.4846531989751384, + 1.5804005039972253, + 1.6780565700028092, + 1.7750487079611048, + 1.8703210469684564, + 1.9702937349793501, + 2.072288208990358, + 2.17033208796056, + 2.2655728749814443, + 2.362673573952634, + 2.460382151999511, + 2.5559099019737914, + 2.6498572639538907, + 2.747678179992363, + 2.84556047298247, + 2.9462803389760666, + 3.044180567958392, + 3.144058262987528, + 3.2405201210058294, + 3.3415386469569057, + 3.446905116958078, + 3.5525708699715324, + 3.646469654981047, + 3.742338561976794, + 3.839141992968507, + 3.9341666649561375, + 4.029854913009331, + 4.129381802980788, + 4.227086109982338, + 4.324860016989987, + 4.422377281007357, + 4.519103078986518, + 4.6172657429706305, + 4.688989712973125, + 4.791105532960501, + 4.888825790956616, + 4.986461840977427, + 5.081683186988812, + 5.181237101962324, + 5.284345669962931, + 5.386445440992247, + 5.484377782966476, + 5.58173373300815, + 5.68246367800748, + 5.781396608974319, + 5.882339324976783, + 5.999677597952541, + 6.126254997972865, + 6.244302353006788, + 6.365104989963584, + 6.487895030004438, + 6.607373361999635, + 6.727999149996322, + 6.850681283976883, + 6.974931214004755, + 7.099417324003298, + 7.203023594978731, + 7.312757496954873, + 7.424916741962079, + 7.536079206969589, + 7.647223256004509, + 7.755331744963769, + 7.86198823095765, + 7.963802958955057, + 8.068856047990266, + 8.188086488982663, + 8.30771578400163, + 8.42739658296341, + 8.542425866005942, + 8.647735423000995, + 8.747305000957567, + 8.844566932995804, + 8.946545054961462, + 9.027868012955878, + 9.082561857998371 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.54040247248486, + "p95": 122.79004004085436, + "max": 220.69756500422955 + } + }, + { + "start": 400632.682975978, + "first": 400633.191629917, + "last": 400641.765452587, + "end": 400641.766057251, + "elapsed_s": 9.083081273012795, + "chunk_offsets_s": [ + 0.5086539390031248, + 0.6024416349828243, + 0.7006829719757661, + 0.7989684219937772, + 0.8992125219665468, + 1.0009860490099527, + 1.0973115380038507, + 1.1936063229804859, + 1.2922220170148648, + 1.387745254964102, + 1.483559409971349, + 1.5796940000145696, + 1.6776499419938773, + 1.7743819479946978, + 1.8701125649968162, + 1.9693916919641197, + 2.071966573013924, + 2.1699695399729535, + 2.2649752679863013, + 2.3617217220016755, + 2.4594702050089836, + 2.5556185549939983, + 2.649513099982869, + 2.7473239839891903, + 2.845109635964036, + 2.946006383979693, + 3.0437469789758325, + 3.1434583350201137, + 3.2401962130097672, + 3.3407665889826603, + 3.4463458620011806, + 3.551751371996943, + 3.645722957968246, + 3.7415509679703973, + 3.8386948200059123, + 3.9335173449944705, + 4.0294081720057875, + 4.128596465976443, + 4.226757674012333, + 4.324175704969093, + 4.421563206997234, + 4.518763251020573, + 4.6164653489831835, + 4.688098053971771, + 4.790276849991642, + 4.888208791962825, + 4.985662391001824, + 5.0811206519720145, + 5.1806753349956125, + 5.283751982962713, + 5.385438804980367, + 5.483669886016287, + 5.581170734018087, + 5.68172539700754, + 5.780986571975518, + 5.881972536968533, + 5.999000309966505, + 6.125583437969908, + 6.243652984965593, + 6.364000768982805, + 6.48722537397407, + 6.606716073991265, + 6.7273304219706915, + 6.8500648440094665, + 6.97428783000214, + 7.09871731500607, + 7.20246107596904, + 7.312173729995266, + 7.424280350969639, + 7.535695138969459, + 7.646587839990389, + 7.7543136199819855, + 7.861016187001951, + 7.963550411979668, + 8.067806402978022, + 8.187018060008995, + 8.30663074599579, + 8.426729038998019, + 8.541785106004681, + 8.647124198963866, + 8.746598255995195, + 8.843502552015707, + 8.945791014004499, + 9.026863903971389, + 9.08247660897905 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.2247344693169, + "p95": 122.73442203877494, + "max": 126.58312800340354 + } + }, + { + "start": 400632.681900076, + "first": 400632.81116668, + "last": 400641.764876644, + "end": 400641.765768415, + "elapsed_s": 9.0838683390175, + "chunk_offsets_s": [ + 0.12926660402445123, + 0.6037739400053397, + 0.7019735330250114, + 0.799880626029335, + 0.9003475130302832, + 1.001910588995088, + 1.0981658690143377, + 1.1949399880249985, + 1.2931280450429767, + 1.388656914990861, + 1.4850298610399477, + 1.5808415510109626, + 1.678370559005998, + 1.775382408988662, + 1.87081443000352, + 1.9705476750386879, + 2.0727872240240686, + 2.170819887018297, + 2.265983985038474, + 2.3626475899945945, + 2.4602836230187677, + 2.5563929810305126, + 2.650269653997384, + 2.748168971040286, + 2.845972111041192, + 2.946722280990798, + 3.044532653002534, + 3.1443338509998284, + 3.2408373100333847, + 3.3417771619861014, + 3.4473369310144335, + 3.553212159022223, + 3.64674582000589, + 3.74253642099211, + 3.8395684949937277, + 3.934515134023968, + 4.030279559025075, + 4.129586158029269, + 4.227990170009434, + 4.325119045039173, + 4.422556595993228, + 4.519753136031795, + 4.617456673993729, + 4.689122818992473, + 4.7912661749869585, + 4.889204565028194, + 4.986653732019477, + 5.082099032995757, + 5.1816615400020964, + 5.284680923039559, + 5.386424625990912, + 5.484694843005855, + 5.582157339027617, + 5.682719506032299, + 5.782215212006122, + 5.8829964700271375, + 6.00001819501631, + 6.126494010037277, + 6.244638932985254, + 6.364978285040706, + 6.488649679988157, + 6.6082253259955905, + 6.728190849011298, + 6.850944504025392, + 6.975260787003208, + 7.099716160038952, + 7.203291598998476, + 7.313051837030798, + 7.4252508750068955, + 7.536834594036918, + 7.647582412988413, + 7.755224896012805, + 7.861985432042275, + 7.96451744803926, + 8.068750014994293, + 8.187992505030707, + 8.307603879016824, + 8.427589434024412, + 8.542738702031784, + 8.64809494803194, + 8.747599229041953, + 8.84450107702287, + 8.94678462704178, + 9.027865773998201, + 9.082976568024606 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.49999349191785, + "p95": 123.67139494745061, + "max": 474.50733598088846 + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.6, + "per_stream_tps": 22.9, + "ttft_s_max": 0.78, + "request": { + "ttft_s": 0.485, + "decode_tps": 22.975, + "prompt_ttft_tps": 68.528, + "prefill_tps": 68.528, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.525, + "round_gap_p50_ms": 98.473, + "round_gap_p95_ms": 102.833, + "tokens_per_chunk": 2.306, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.485, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.485, + "last_output_s": 11.585 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 165.575, + "aggregate_prefill_tps": 165.575, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.529, + "round_gap_p50_ms": 98.484, + "round_gap_p95_ms": 102.789, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 88.38305126787114, + "makespan_s": 11.586288263497408, + "steady_tps": 93.9, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 90.06542470851731, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.522018146002665, + "end_to_end_tps": 88.8733195022138, + "timing_valid": true, + "steady_tps": 94.42205132372031, + "per_stream_tps": [ + 23.7, + 22.9, + 22.5, + 23.3 + ], + "ttft_s": [ + 0.77, + 0.39, + 0.2, + 0.58 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.7698813049937598, + "decode_tps": 23.722087484138655, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.56484875322355, + "prefill_tps": 41.56484875322355, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.1548061766753, + "round_gap_p50_ms": 97.93998900568113, + "round_gap_p95_ms": 102.50689601525664, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0011280940379947424, + "first_payload_s": 0.0011304779909551144, + "first_content_s": 0.7698813049937598, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7698813049937598, + "last_output_s": 11.519356880045962 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3876003829645924, + "decode_tps": 22.90502463543179, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.55925795337313, + "prefill_tps": 82.55925795337313, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.658542870680854, + "round_gap_p50_ms": 97.83088398398831, + "round_gap_p95_ms": 102.42867097258568, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014423539978452027, + "first_payload_s": 0.0014448819565586746, + "first_content_s": 0.3876003829645924, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3876003829645924, + "last_output_s": 11.52052881498821 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19585639401338995, + "decode_tps": 22.517763724709873, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 163.3850156447396, + "prefill_tps": 163.3850156447396, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.40938328625634, + "round_gap_p50_ms": 97.86376403644681, + "round_gap_p95_ms": 102.53145697060972, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016681820270605385, + "first_payload_s": 0.0016723900334909558, + "first_content_s": 0.19585639401338995, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19585639401338995, + "last_output_s": 11.520249132008757 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5798025050316937, + "decode_tps": 23.306456611596683, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.19120687181368, + "prefill_tps": 55.19120687181368, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.90656519200032, + "round_gap_p50_ms": 97.80291601782665, + "round_gap_p95_ms": 102.42732701590285, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0020814670133404434, + "first_payload_s": 0.0020835630130022764, + "first_content_s": 0.5798025050316937, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5798025050316937, + "last_output_s": 11.520976628991775 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.28232438140321, + "round_gap_p50_ms": 97.86376403644681, + "round_gap_p95_ms": 102.42867097258568, + "round_gap_mean_ms": 100.33629742961652, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 166.02600539051716, + "aggregate_prefill_tps": 166.02600539051716 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400642.484569571, + "first": 400643.254450876, + "last": 400654.003926451, + "end": 400654.004579563, + "elapsed_s": 11.520009992003907, + "chunk_offsets_s": [ + 0.7698813049937598, + 0.8687555300421081, + 0.9658277640119195, + 1.06419334304519, + 1.1609394600382075, + 1.258993563009426, + 1.355884243035689, + 1.4528642350342125, + 1.551011763047427, + 1.646561449044384, + 1.7430267150048167, + 1.8435885300277732, + 1.939622447011061, + 2.037562436016742, + 2.1352565020206384, + 2.2318917540251277, + 2.328635280020535, + 2.425464791012928, + 2.5281971620279364, + 2.6301028660382144, + 2.7280583120300435, + 2.823597102018539, + 2.9261039980337955, + 3.025600679044146, + 3.1242974780034274, + 3.2212774070212618, + 3.3247157229925506, + 3.4230477010132745, + 3.5230247410363518, + 3.622162809013389, + 3.7169941019965336, + 3.8160201529972255, + 3.911618336045649, + 4.008664024993777, + 4.110299966007005, + 4.211986868001986, + 4.311034711019602, + 4.408996604033746, + 4.5064133230480365, + 4.605977301020175, + 4.70307148701977, + 4.802002064010594, + 4.902592680009548, + 4.997481252998114, + 5.098358352028299, + 5.19616918702377, + 5.294053432007786, + 5.390835278027225, + 5.490124580042902, + 5.58842993399594, + 5.686022637994029, + 5.7869306660140865, + 5.886933656991459, + 5.985877755039837, + 6.088960339024197, + 6.18708671402419, + 6.285540198034141, + 6.3836353570222855, + 6.480424531036988, + 6.579141442023683, + 6.674693976005074, + 6.771024200017564, + 6.868108785012737, + 6.964928232016973, + 7.063922554021701, + 7.161440026015043, + 7.2559654579963535, + 7.354046521009877, + 7.4543355160276406, + 7.556958189990837, + 7.655560251034331, + 7.751415300997905, + 7.842794197029434, + 7.940122066007461, + 8.037396654020995, + 8.133499595045578, + 8.230916073021945, + 8.330795303045306, + 8.428573754034005, + 8.528583241044544, + 8.627130246022716, + 8.72123821702553, + 8.822166661033407, + 8.921099366038106, + 9.021240807021968, + 9.121256023005117, + 9.219386910030153, + 9.316840988991316, + 9.410537051036954, + 9.506363763997797, + 9.601445012027398, + 9.696566580038052, + 9.795503397996072, + 9.895677335036453, + 9.99191027804045, + 10.089913050993346, + 10.184376227029134, + 10.278554679010995, + 10.375907796027604, + 10.475265339016914, + 10.571100277011283, + 10.66623538103886, + 10.760261718998663, + 10.859962210000958, + 10.962514147046022, + 11.057946199027356, + 11.153634414018597, + 11.250528038013726, + 11.348662429023534, + 11.449072065006476, + 11.519356880045962 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.94771749875508, + "p95": 102.50689601525664, + "max": 103.43831597128883 + } + }, + { + "start": 400642.484024332, + "first": 400642.871624715, + "last": 400654.004553147, + "end": 400654.005505463, + "elapsed_s": 11.521481130970642, + "chunk_offsets_s": [ + 0.3876003829645924, + 0.8695663399994373, + 0.9666275659692474, + 1.064817367005162, + 1.161731134983711, + 1.259783940971829, + 1.3568027659785002, + 1.4536366609972902, + 1.5517789089935832, + 1.647183633001987, + 1.7439895919524133, + 1.8439998480025679, + 1.94044080900494, + 2.0382716929889284, + 2.136073297006078, + 2.232967927993741, + 2.3293648730032146, + 2.42617892799899, + 2.5288488179794513, + 2.630856155999936, + 2.7287588809849694, + 2.824406759988051, + 2.926287679991219, + 3.026523746957537, + 3.1247107469826005, + 3.2221111449762248, + 3.325615254987497, + 3.423497370968107, + 3.5238055189838633, + 3.623053604969755, + 3.7178586569498293, + 3.816819811007008, + 3.912343048956245, + 4.009502228000201, + 4.1111235930002294, + 4.212418024952058, + 4.312006659980398, + 4.409704100980889, + 4.507492584001739, + 4.606789710989688, + 4.704157020954881, + 4.8030531499534845, + 4.90371966996463, + 4.998222063004505, + 5.099086233996786, + 5.196764955006074, + 5.294797104957979, + 5.39158725499874, + 5.490774428995792, + 5.589122774952557, + 5.686858344997745, + 5.787657490989659, + 5.887671746953856, + 5.98678693495458, + 6.0893480879603885, + 6.187863059982192, + 6.28623929497553, + 6.38452928798506, + 6.48112377198413, + 6.579805721994489, + 6.675320799986366, + 6.771852898003999, + 6.869085197977256, + 6.965672000951599, + 7.064652964007109, + 7.162408885953482, + 7.256713595998008, + 7.355002917000093, + 7.455251512001269, + 7.557961963000707, + 7.656438678968698, + 7.752152606961317, + 7.843493021966424, + 7.94078498595627, + 8.038098646968137, + 8.134174723993056, + 8.23170822695829, + 8.331530895957258, + 8.429375459963921, + 8.529690407973249, + 8.627947392989881, + 8.722051699995063, + 8.822624281980097, + 8.921911440964323, + 9.0221053789719, + 9.122602616960648, + 9.220165191974957, + 9.317588693986181, + 9.411269492004067, + 9.507226302986965, + 9.60231249500066, + 9.697337421996053, + 9.796358304971363, + 9.896145692968275, + 9.992811728967354, + 10.090800358972047, + 10.184874408994801, + 10.279366816976108, + 10.37662634899607, + 10.476083589950576, + 10.572047952970024, + 10.667076768004335, + 10.761144257965498, + 10.860815085005015, + 10.9632437559776, + 11.0589037949685, + 11.15436723997118, + 11.251339615962934, + 11.349359126004856, + 11.449848010961432, + 11.52052881498821 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.83772399532609, + "p95": 102.42867097258568, + "max": 481.9659570348449 + } + }, + { + "start": 400642.483596102, + "first": 400642.679452496, + "last": 400654.003845234, + "end": 400654.004101909, + "elapsed_s": 11.52050580701325, + "chunk_offsets_s": [ + 0.19585639401338995, + 0.86987140099518, + 0.9667311680386774, + 1.0650884110364132, + 1.1618529930128716, + 1.2603486850275658, + 1.3570998909999616, + 1.453769848041702, + 1.5524254780029878, + 1.6474453969858587, + 1.744350172986742, + 1.8444867510115728, + 1.9405581550090574, + 2.038621506013442, + 2.1361971870064735, + 2.2328043580055237, + 2.3296644460060634, + 2.426386931037996, + 2.5291228540008888, + 2.6311574240098707, + 2.728962611989118, + 2.8248776629916392, + 2.9268616560148075, + 3.0266259090276435, + 3.1247719330131076, + 3.2221746030263603, + 3.3258506020065397, + 3.424089747015387, + 3.5237426700186916, + 3.6231904390151612, + 3.7181473650271073, + 3.8170478949905373, + 3.9125595160294324, + 4.009577716991771, + 4.111216042016167, + 4.212895920034498, + 4.312063253019005, + 4.410207228036597, + 4.507328039035201, + 4.6071106439922005, + 4.703975962998811, + 4.802906813041773, + 4.903901192999911, + 4.998527555027977, + 5.099557776004076, + 5.197236402018461, + 5.295117654022761, + 5.391903851996176, + 5.491016592015512, + 5.589322537998669, + 5.686959211016074, + 5.787852934037801, + 5.887967623013537, + 5.987014906015247, + 6.089626380009577, + 6.188162247999571, + 6.286436690017581, + 6.384682811039966, + 6.481319967017043, + 6.580023485003039, + 6.675378449028358, + 6.7720684700179845, + 6.86915028700605, + 6.965953877021093, + 7.065146443026606, + 7.162374662002549, + 7.257194706995506, + 7.355058471031953, + 7.455449003027752, + 7.5582335669896565, + 7.6564731590333395, + 7.752438803028781, + 7.843720737029798, + 7.941031774040312, + 8.038422940007877, + 8.134431879036129, + 8.23183963703923, + 8.331812821037602, + 8.429497878008988, + 8.529821834003087, + 8.628060066024773, + 8.722174454014748, + 8.82318932999624, + 8.922138372028712, + 9.022297510004137, + 9.122683002031408, + 9.220644495042507, + 9.31778372102417, + 9.411631144990679, + 9.50741757004289, + 9.602787685988005, + 9.697717763017863, + 9.79655480402289, + 9.896686660998967, + 9.992947396007366, + 10.091051914030686, + 10.185529473994393, + 10.279587925004307, + 10.37694409803953, + 10.476312585000414, + 10.572150979016442, + 10.667361828032881, + 10.761305332998745, + 10.861017712042667, + 10.963549169013277, + 11.059262408001814, + 11.15484217501944, + 11.251567492028698, + 11.349721290986054, + 11.450125264003873, + 11.520249132008757 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.87250802037306, + "p95": 102.53145697060972, + "max": 674.0150069817901 + } + }, + { + "start": 400642.483487317, + "first": 400643.063289822, + "last": 400654.004463946, + "end": 400654.005110546, + "elapsed_s": 11.521623229025863, + "chunk_offsets_s": [ + 0.5798025050316937, + 0.8699238490080461, + 0.9670037309988402, + 1.0655038240365684, + 1.1621068030362949, + 1.260163642000407, + 1.3572872530203313, + 1.454128363984637, + 1.5524005169863813, + 1.6477721210103482, + 1.744193674006965, + 1.8447319690021686, + 1.9408091339864768, + 2.039223498024512, + 2.136471765988972, + 2.233057432982605, + 2.3298541440162808, + 2.4266662620357238, + 2.52943402598612, + 2.6313389459974132, + 2.729246039001737, + 2.824781676987186, + 2.9267642780323513, + 3.0269800249952823, + 3.12500702298712, + 3.222463598009199, + 3.3260630519944243, + 3.424234643985983, + 3.524025970022194, + 3.623734764987603, + 3.7181833970244043, + 3.817511772038415, + 3.9127971029956825, + 4.009879257006105, + 4.111498414014932, + 4.21313544199802, + 4.312377383990679, + 4.410180300008506, + 4.507609097985551, + 4.60716874001082, + 4.704284686013125, + 4.803191216022242, + 4.904206173028797, + 4.998705909005366, + 5.09957211202709, + 5.197179889015388, + 5.295409705024213, + 5.392225775984116, + 5.49138453300111, + 5.589604748995043, + 5.687232573982328, + 5.788141129014548, + 5.888149881036952, + 5.987409678986296, + 6.090092736994848, + 6.188345914008096, + 6.286720036994666, + 6.385012414015364, + 6.481612881994806, + 6.5802945290342905, + 6.675956920022145, + 6.772473290038761, + 6.869715190026909, + 6.9661603920394555, + 7.0651335139991716, + 7.162643721036147, + 7.25714041799074, + 7.3552830970147625, + 7.455657196987886, + 7.558163517038338, + 7.656772379006725, + 7.752636549004819, + 7.843974547984544, + 7.9413959860103205, + 8.03871433500899, + 8.134782220004126, + 8.232082760019694, + 8.33201893500518, + 8.429772681032773, + 8.53015443001641, + 8.628322773030959, + 8.722420616017189, + 8.823430933000054, + 8.922597386001144, + 9.022753691009711, + 9.122979132982437, + 9.220579838030972, + 9.318014812015463, + 9.411965020990465, + 9.507712644990534, + 9.602686660015024, + 9.69777539599454, + 9.79684767103754, + 9.896930343005806, + 9.99326346302405, + 10.091115979012102, + 10.185791285010055, + 10.279765382991172, + 10.377359095029533, + 10.47701070603216, + 10.57242258201586, + 10.667419044009876, + 10.761607816035394, + 10.861305140017066, + 10.963732467032969, + 11.05916571902344, + 11.15483871800825, + 11.251973304024432, + 11.349950221017934, + 11.450335410016123, + 11.520976628991775 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.82771600293927, + "p95": 102.42732701590285, + "max": 290.12134397635236 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.05605278853525, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.650558380992152, + "end_to_end_tps": 87.89278303352847, + "timing_valid": true, + "steady_tps": 93.34069378254428, + "per_stream_tps": [ + 23.0, + 22.3, + 22.7, + 23.4 + ], + "ttft_s": [ + 0.58, + 0.2, + 0.39, + 0.78 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.5841318229795434, + "decode_tps": 23.045716759169736, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.78215488547464, + "prefill_tps": 54.78215488547464, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.39201121189284, + "round_gap_p50_ms": 99.0757459658198, + "round_gap_p95_ms": 103.49754797061905, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0013655700022354722, + "first_payload_s": 0.001369217992760241, + "first_content_s": 0.5841318229795434, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5841318229795434, + "last_output_s": 11.649094682012219 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19633556698681787, + "decode_tps": 22.265523066617565, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.9862611808308, + "prefill_tps": 162.9862611808308, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.91248631384224, + "round_gap_p50_ms": 99.05168297700584, + "round_gap_p95_ms": 103.13386400230229, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0009556279983371496, + "first_payload_s": 0.0009602520149201155, + "first_content_s": 0.19633556698681787, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19633556698681787, + "last_output_s": 11.649019577016588 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3908878630027175, + "decode_tps": 22.6500583573441, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.86491070401317, + "prefill_tps": 81.86491070401317, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.14999662355209, + "round_gap_p50_ms": 99.11597199970856, + "round_gap_p95_ms": 103.34569000406191, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0009640440111979842, + "first_payload_s": 0.00096559600206092, + "first_content_s": 0.3908878630027175, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3908878630027175, + "last_output_s": 11.649137002008501 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7751764730201103, + "decode_tps": 23.44891535660343, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.28092262053189, + "prefill_tps": 41.28092262053189, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.64589576073465, + "round_gap_p50_ms": 99.00683403247967, + "round_gap_p95_ms": 103.14986400771886, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0019306010217405856, + "first_payload_s": 0.0019336569821462035, + "first_content_s": 0.7751764730201103, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7751764730201103, + "last_output_s": 11.649879892007448 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.77509747750546, + "round_gap_p50_ms": 99.10393896279857, + "round_gap_p95_ms": 103.14986400771886, + "round_gap_mean_ms": 101.47863506148992, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 165.12369048212756, + "aggregate_prefill_tps": 165.12369048212756 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400654.007051547, + "first": 400654.59118337, + "last": 400665.656146229, + "end": 400665.656801998, + "elapsed_s": 11.649750450975262, + "chunk_offsets_s": [ + 0.5841318229795434, + 0.875302409986034, + 0.9745510399807245, + 1.074640863982495, + 1.1717513379990123, + 1.2717930499929935, + 1.3711007839883678, + 1.4700043050106615, + 1.5694938660017215, + 1.6650023990077898, + 1.762597615015693, + 1.8639963520108722, + 1.9621993040200323, + 2.061171210021712, + 2.1612071620183997, + 2.2594376819906756, + 2.357817612006329, + 2.45737211802043, + 2.5619222560198978, + 2.664628626022022, + 2.7643599819857627, + 2.859605390985962, + 2.959694880002644, + 3.06041021598503, + 3.1592888410086744, + 3.2569862339878455, + 3.361629733000882, + 3.462335917982273, + 3.561363791988697, + 3.6616031380253844, + 3.75791368202772, + 3.857019509014208, + 3.954092751024291, + 4.05194048199337, + 4.15418737399159, + 4.2569991539930925, + 4.357714426005259, + 4.456470392993651, + 4.555403577978723, + 4.657181727990974, + 4.755153493024409, + 4.855597930029035, + 4.95966860599583, + 5.055208418983966, + 5.156482241989579, + 5.256310319004115, + 5.3566603229846805, + 5.454900362994522, + 5.555743940989487, + 5.654882361006457, + 5.754147758008912, + 5.855641792993993, + 5.952931948995683, + 6.049868708010763, + 6.153366255981382, + 6.254494301974773, + 6.354742576018907, + 6.454612078028731, + 6.556481413019355, + 6.656342001981102, + 6.753702174988575, + 6.851684132008813, + 6.948715916019864, + 7.0473981379764155, + 7.146071815979667, + 7.244105053017847, + 7.340488252986688, + 7.439392686006613, + 7.541322549979668, + 7.64370706002228, + 7.743478895979933, + 7.841960731020663, + 7.933230376977008, + 8.03103741898667, + 8.12989231501706, + 8.227290824986994, + 8.326210314000491, + 8.427057827007957, + 8.527334661979694, + 8.630023479985539, + 8.72879094997188, + 8.825005092017818, + 8.92602126399288, + 9.023628367984202, + 9.124635947984643, + 9.223849281028379, + 9.324178804003168, + 9.42156414501369, + 9.51745927502634, + 9.61684932897333, + 9.712341414007824, + 9.810146472009365, + 9.910742382984608, + 10.011510280019138, + 10.108475614979398, + 10.208476589992642, + 10.304096387990285, + 10.400016174011398, + 10.49806157097919, + 10.598387286008801, + 10.693639528006315, + 10.789788468973711, + 10.885214807989541, + 10.985151862027124, + 11.089779201021884, + 11.185444359027315, + 11.281659813015722, + 11.379707515006885, + 11.478783260972705, + 11.579439043998718, + 11.649094682012219 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.09078647615388, + "p95": 103.49754797061905, + "max": 291.1705870064907 + } + }, + { + "start": 400654.006856745, + "first": 400654.203192312, + "last": 400665.655876322, + "end": 400665.65621887, + "elapsed_s": 11.649362125026528, + "chunk_offsets_s": [ + 0.19633556698681787, + 0.8749221009784378, + 0.9741990030161105, + 1.0737646280322224, + 1.1722119670012034, + 1.271721144032199, + 1.3709433570038527, + 1.4698114860220812, + 1.5690347870113328, + 1.665016109996941, + 1.7622185529908165, + 1.8638235970283858, + 1.9620434939861298, + 2.06092397402972, + 2.1605172799900174, + 2.2588726499816403, + 2.357914844993502, + 2.457184099010192, + 2.5615886190207675, + 2.66472248302307, + 2.764173434989061, + 2.859189560986124, + 2.959451948001515, + 3.0604214320192114, + 3.1589955880190246, + 3.256989482033532, + 3.3613246729946695, + 3.4621713230153546, + 3.5613780000130646, + 3.6620000390103087, + 3.7579953300300986, + 3.8569525799830444, + 3.9540412130299956, + 4.05153572402196, + 4.153993179032113, + 4.256996945012361, + 4.357252051006071, + 4.456069250998553, + 4.554768897010945, + 4.656803963007405, + 4.755040723015554, + 4.8559703979990445, + 4.959076886007097, + 5.055159074021503, + 5.156563875032589, + 5.256399632024113, + 5.3566562900086865, + 5.454605095030274, + 5.555575713980943, + 5.654598500987049, + 5.753982204012573, + 5.855063656985294, + 5.952733130019624, + 6.049927028012462, + 6.154057128995191, + 6.253839061013423, + 6.354626670014113, + 6.454490907024592, + 6.556346033990849, + 6.656252896005753, + 6.754060755018145, + 6.851352783036418, + 6.949112945003435, + 7.047057621006388, + 7.146109303983394, + 7.243972458993085, + 7.340288266015705, + 7.439392204978503, + 7.541433671023697, + 7.643818020995241, + 7.743097817990929, + 7.8417927760165185, + 7.932953893032391, + 8.03095626598224, + 8.129937644000165, + 8.227196615014691, + 8.326237193017732, + 8.42652514798101, + 8.527321077010129, + 8.62995317397872, + 8.728710372990463, + 8.824942691018805, + 8.926118977018632, + 9.024006405030377, + 9.124584154982585, + 9.22378756699618, + 9.32402107300004, + 9.421249339997303, + 9.517473449988756, + 9.616725342988502, + 9.712866300018504, + 9.810654718021397, + 9.910550059983507, + 10.011516135011334, + 10.108203803014476, + 10.207991542993113, + 10.303833312005736, + 10.400010125013068, + 10.497951921017375, + 10.598081330012064, + 10.693599799007643, + 10.789649409998674, + 10.88498592498945, + 10.98510355700273, + 11.089682382997125, + 11.185406998032704, + 11.281447090033907, + 11.379631800984498, + 11.478318310983013, + 11.579237569007091, + 11.649019577016588 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.0778109699022, + "p95": 103.13386400230229, + "max": 678.58653399162 + } + }, + { + "start": 400654.00691577, + "first": 400654.397803633, + "last": 400665.656052772, + "end": 400665.657331493, + "elapsed_s": 11.650415722979233, + "chunk_offsets_s": [ + 0.3908878630027175, + 0.8751871279673651, + 0.9744330209796317, + 1.074577902967576, + 1.1718337059719488, + 1.2718160250224173, + 1.371343570004683, + 1.4699712480069138, + 1.5694497359800152, + 1.665190240019001, + 1.7626814550021663, + 1.8640788639895618, + 1.9622232079855166, + 2.061113576986827, + 2.1612521539791487, + 2.259484481997788, + 2.3585969819687307, + 2.4573269319953397, + 2.561867373995483, + 2.6648497320129536, + 2.7643076439853758, + 2.859460221021436, + 2.959628189972136, + 3.0604718159884214, + 3.1596467010094784, + 3.25700872996822, + 3.3616130119771697, + 3.4625291349948384, + 3.561990568006877, + 3.6618452849797904, + 3.75813507597195, + 3.857128054019995, + 3.954170526994858, + 4.051573164004367, + 4.15429492702242, + 4.257327876985073, + 4.357373589009512, + 4.456113090971485, + 4.555112437985372, + 4.657289824972395, + 4.7551736530149356, + 4.856213808991015, + 4.959559498995077, + 5.055547414987814, + 5.156383280002046, + 5.256678803008981, + 5.356721538992133, + 5.454923530982342, + 5.556052808009554, + 5.6548225349979475, + 5.754137278010603, + 5.85569806501735, + 5.953000781009905, + 6.0500403579790145, + 6.153708099969663, + 6.25427639397094, + 6.35506621201057, + 6.454944880970288, + 6.556411954981741, + 6.656274928012863, + 6.753668796969578, + 6.851934358011931, + 6.949265745992307, + 7.047247094975319, + 7.146374378993642, + 7.244170748977922, + 7.3408591210027225, + 7.43945474998327, + 7.5416655779699795, + 7.64393568597734, + 7.743340188986622, + 7.842285853985231, + 7.933118599001318, + 8.031007785990369, + 8.129959627985954, + 8.227362457022537, + 8.326397259021178, + 8.426971298002172, + 8.52756507997401, + 8.63013205601601, + 8.729248028015718, + 8.825386136013549, + 8.926321331004146, + 9.02369571197778, + 9.124624890973791, + 9.223940737021621, + 9.324180483003147, + 9.421591567981523, + 9.517491306003649, + 9.616856113018002, + 9.712727673992049, + 9.810394842992537, + 9.910986609000247, + 10.011698008980602, + 10.108583631983493, + 10.208035095012747, + 10.303881343977991, + 10.400233088003006, + 10.498619034013245, + 10.598693642008584, + 10.694035179971252, + 10.790120935998857, + 10.885153542971238, + 10.985763213015161, + 11.09031269501429, + 11.185471766977571, + 11.281640211993363, + 11.37999636499444, + 11.478630074998364, + 11.5796629510005, + 11.649137002008501 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.1216280090157, + "p95": 103.34569000406191, + "max": 484.2992649646476 + } + }, + { + "start": 400654.006773112, + "first": 400654.781949585, + "last": 400665.656653004, + "end": 400665.657073121, + "elapsed_s": 11.650300009001512, + "chunk_offsets_s": [ + 0.7751764730201103, + 0.8753785860026255, + 0.974632672034204, + 1.0743528280290775, + 1.172240240033716, + 1.2720206680241972, + 1.3714334120159037, + 1.4700430090306327, + 1.5696540270000696, + 1.665208625025116, + 1.7625917100231163, + 1.86444382899208, + 1.962423481978476, + 2.061376588011626, + 2.1609194130287506, + 2.259196030034218, + 2.3583015060285106, + 2.4575940080103464, + 2.562313459988218, + 2.66506314300932, + 2.7647288180305623, + 2.8597741610137746, + 2.9600791559787467, + 3.0607460599858314, + 3.1596179960179143, + 3.2573162380140275, + 3.3619538330240175, + 3.4625645439955406, + 3.5615713780280203, + 3.6619436379987746, + 3.7583335430244915, + 3.857219575031195, + 3.954545652028173, + 4.051763439027127, + 4.154387952003162, + 4.257537816010881, + 4.357448982016649, + 4.456303174025379, + 4.555303015979007, + 4.657384594029281, + 4.755482696986292, + 4.856253602018114, + 4.959888127981685, + 5.0556029350264, + 5.156859782990068, + 5.256674083007965, + 5.3570174790220335, + 5.45513033302268, + 5.55606778501533, + 5.655207660980523, + 5.754478977993131, + 5.8553501890273765, + 5.953264977026265, + 6.050114007026423, + 6.153918103023898, + 6.254663567990065, + 6.354973874986172, + 6.45494436903391, + 6.5568469050340354, + 6.656742837978527, + 6.753751503012609, + 6.851581041992176, + 6.949293859011959, + 7.047565084008966, + 7.14642319601262, + 7.244435328990221, + 7.340836321003735, + 7.4397229939932, + 7.541760843014345, + 7.6441255289828405, + 7.743533551984001, + 7.842126220988575, + 7.933451018994674, + 8.031267901998945, + 8.12996445997851, + 8.227625756000634, + 8.326417420001235, + 8.427617610024754, + 8.52775556303095, + 8.6302231940208, + 8.729153787018731, + 8.825330152001698, + 8.926423909026198, + 9.023718688986264, + 9.124981231987476, + 9.22400776197901, + 9.32440427801339, + 9.421893764985725, + 9.517785981995985, + 9.617075924004894, + 9.71268673002487, + 9.810496508027427, + 9.911157636030111, + 10.011871211987454, + 10.108678769029211, + 10.208358812029473, + 10.304213109018747, + 10.400333456986118, + 10.498386983003002, + 10.598613337031566, + 10.69386925798608, + 10.790117623982951, + 10.88544007402379, + 10.985550107026938, + 11.089872897020541, + 11.185776011028793, + 11.281893350998871, + 11.380082238989417, + 11.47894942300627, + 11.579577286029235, + 11.649879892007448 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.01668201200664, + "p95": 103.14986400771886, + "max": 104.71945197787136 + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.44, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/drafted.json b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/drafted.json new file mode 100644 index 00000000000..db17293da72 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/drafted.json @@ -0,0 +1,150 @@ +[ + { + "label": "drafted", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 256, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 45.16762904086632, + "decode_tps_all": [ + 45.17, + 45.79, + 44.87 + ], + "ttft_s_median": 0.128470005991403, + "prompt_ttft_tps_median": 108.975, + "prefill_tps_median": 108.975, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 22.14, + "round_gap_p50_ms_median": 66.681, + "round_gap_p95_ms_median": 75.361, + "tokens_per_chunk_median": 3.012, + "headers_s_median": 0.001, + "first_payload_s_median": 0.128, + "first_content_s_median": 0.128, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.128, + "last_output_s_median": 5.774, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "drafted", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 256, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 36.56625321889331, + "decode_tps_all": [ + 33.97, + 36.99, + 36.57 + ], + "ttft_s_median": 0.19529875798616558, + "prompt_ttft_tps_median": 163.852, + "prefill_tps_median": 163.852, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 27.348, + "round_gap_p50_ms_median": 58.668, + "round_gap_p95_ms_median": 68.022, + "tokens_per_chunk_median": 2.169, + "headers_s_median": 0.002, + "first_payload_s_median": 0.002, + "first_content_s_median": 0.195, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.195, + "last_output_s_median": 7.169, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/form.txt new file mode 100644 index 00000000000..63282183789 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh1/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/c4.json b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/c4.json new file mode 100644 index 00000000000..1f0feb12fd3 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/c4.json @@ -0,0 +1,2798 @@ +{ + "label": "c4", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 118.3, + "per_stream_tps": 30.2, + "ttft_s_max": 0.5, + "request": { + "ttft_s": 0.316, + "decode_tps": 30.229, + "prompt_ttft_tps": 46.057, + "prefill_tps": 46.057, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.081, + "round_gap_p50_ms": 97.611, + "round_gap_p95_ms": 112.685, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.316, + "first_content_s": 0.316, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.316, + "last_output_s": 8.751 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 111.4, + "aggregate_prefill_tps": 111.4, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.08, + "round_gap_p50_ms": 97.632, + "round_gap_p95_ms": 113.028, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 117.00836890493281, + "makespan_s": 8.752340686507523, + "steady_tps": 121.5, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 119.45721333553988, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 8.667112987022847, + "end_to_end_tps": 118.1477617210277, + "timing_valid": true, + "steady_tps": 122.72623687566885, + "per_stream_tps": [ + 30.3, + 30.8, + 31.2, + 29.9 + ], + "ttft_s": [ + 0.25, + 0.38, + 0.5, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2522492820280604, + "decode_tps": 30.307253319009547, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.500653510056885, + "prefill_tps": 55.500653510056885, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.99540177640487, + "round_gap_p50_ms": 97.80452400445938, + "round_gap_p95_ms": 102.21630899468437, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0014231069944798946, + "first_payload_s": 0.2522492820280604, + "first_content_s": 0.2522492820280604, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2522492820280604, + "last_output_s": 8.666076735011302 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3775295519735664, + "decode_tps": 30.76241484632696, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 37.08318971803363, + "prefill_tps": 37.08318971803363, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.507200913695506, + "round_gap_p50_ms": 97.98283001873642, + "round_gap_p95_ms": 102.28541400283575, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0021487000049091876, + "first_payload_s": 0.3775295519735664, + "first_content_s": 0.3775295519735664, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3775295519735664, + "last_output_s": 8.666865784965921 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5008104839944281, + "decode_tps": 31.233069475462845, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.954686348290906, + "prefill_tps": 27.954686348290906, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.01734625492428, + "round_gap_p50_ms": 97.81042800750583, + "round_gap_p95_ms": 102.21694898791611, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001695941959042102, + "first_payload_s": 0.5008104839944281, + "first_content_s": 0.5008104839944281, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5008104839944281, + "last_output_s": 8.665233779000118 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.1283618769957684, + "decode_tps": 29.86983398231198, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 109.0666506883623, + "prefill_tps": 109.0666506883623, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.47859250212672, + "round_gap_p50_ms": 97.67866600304842, + "round_gap_p95_ms": 102.17701201327145, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0011314059956930578, + "first_payload_s": 0.1283618769957684, + "first_content_s": 0.1283618769957684, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1283618769957684, + "last_output_s": 8.665402965038083 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.749635361787846, + "round_gap_p50_ms": 97.8151640156284, + "round_gap_p95_ms": 102.25078900111839, + "round_gap_mean_ms": 99.4185359197131, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 111.6593485344823, + "aggregate_prefill_tps": 111.6593485344823 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400808.664382995, + "first": 400808.916632277, + "last": 400817.33045973, + "end": 400817.330576259, + "elapsed_s": 8.66619326401269, + "chunk_offsets_s": [ + 0.2522492820280604, + 0.5951361790066585, + 0.6934393660048954, + 0.7908636450301856, + 0.8914164280286059, + 0.9920577250304632, + 1.0895558129996061, + 1.1860505600343458, + 1.2826876449980773, + 1.3785577440285124, + 1.4760537199908867, + 1.572317184007261, + 1.6711923939874396, + 1.7681221390375867, + 1.8637050660327077, + 1.962257439037785, + 2.064746471995022, + 2.163336430035997, + 2.2594690280384384, + 2.357885048026219, + 2.455300623027142, + 2.5515415749978274, + 2.645257389987819, + 2.7441038790275343, + 2.8419084030319937, + 2.943327166023664, + 3.041484286019113, + 3.142050733033102, + 3.239061087020673, + 3.3396734389825724, + 3.4432572700316086, + 3.545404664997477, + 3.6383974630152807, + 3.7352338469936512, + 3.8330941310268827, + 3.9284669760381803, + 4.025028860021848, + 4.12384179700166, + 4.223358646035194, + 4.319939474982675, + 4.417236184002832, + 4.518208588997368, + 4.615674916014541, + 4.688291035010479, + 4.789552707981784, + 4.891512149013579, + 4.988760777981952, + 5.083769234013744, + 5.183421636989806, + 5.28515965200495, + 5.38596928602783, + 5.486377844004892, + 5.583979101036675, + 5.684663774038199, + 5.7840336299850605, + 5.884818000020459, + 5.985132076020818, + 6.087348385015503, + 6.183415014005732, + 6.279333945014514, + 6.375099050987046, + 6.466033358010463, + 6.560838898993097, + 6.656459218997043, + 6.753535861033015, + 6.8532709699939005, + 6.946260376018472, + 7.0452212180243805, + 7.1442764939856716, + 7.245451605005655, + 7.342826860025525, + 7.4383852099999785, + 7.538585925009102, + 7.636302191996947, + 7.735665950982366, + 7.836755333002657, + 7.9339646809967235, + 8.030517428996973, + 8.125704303034581, + 8.225964154000394, + 8.32447791902814, + 8.42327720799949, + 8.527826506004203, + 8.610538451990578, + 8.666076735011302 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.83240401884541, + "p95": 102.21630899468437, + "max": 342.8868969785981 + } + }, + { + "start": 400808.664201633, + "first": 400809.041731185, + "last": 400817.331067418, + "end": 400817.331196443, + "elapsed_s": 8.666994809987955, + "chunk_offsets_s": [ + 0.3775295519735664, + 0.5957553389598615, + 0.6939804769936018, + 0.79119041695958, + 0.8912460259743966, + 0.9925136019592173, + 1.0895326279569417, + 1.1853391909971833, + 1.2832688359776512, + 1.378419677959755, + 1.4764867330086417, + 1.5722557269618846, + 1.6715881749987602, + 1.7681122339563444, + 1.8636162480106577, + 1.9629922799649648, + 2.0652776939678006, + 2.1636504019843414, + 2.259956809983123, + 2.3581498349667527, + 2.4558882779674605, + 2.552125117974356, + 2.6455111209652387, + 2.7439788850024343, + 2.8426022040075622, + 2.9438816999900155, + 3.041377483983524, + 3.1424506260082126, + 3.239379618957173, + 3.339977122959681, + 3.4431244040024467, + 3.545279510959517, + 3.6387025709846057, + 3.7356116749579087, + 3.8330475380062126, + 3.9289590619737282, + 4.0255715060047805, + 4.123702178010717, + 4.22330808499828, + 4.319954322010744, + 4.417542314971797, + 4.518481071980204, + 4.6161535939900205, + 4.688616974977776, + 4.789907992002554, + 4.891558468982112, + 4.989083933993243, + 5.0840259729884565, + 5.1836868399987, + 5.285476534976624, + 5.385880452988204, + 5.4863263389561325, + 5.583975212008227, + 5.6850517459679395, + 5.784477730980143, + 5.885583848983515, + 5.985395614989102, + 6.087860519008245, + 6.184104189975187, + 6.279821406991687, + 6.375544479989912, + 6.466570180957206, + 6.561485546990298, + 6.65700588200707, + 6.753940730006434, + 6.853591118007898, + 6.947201027011033, + 7.0455731909605674, + 7.14413189998595, + 7.24545536498772, + 7.343438195006456, + 7.4392296049627475, + 7.539302909979597, + 7.636830805975478, + 7.73604973196052, + 7.837181466980837, + 7.934659281978384, + 8.031074491969775, + 8.126297077978961, + 8.22593496995978, + 8.324891523981933, + 8.423700412968174, + 8.527511238004081, + 8.610393280978315, + 8.666865784965921 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.02494253381155, + "p95": 102.28541400283575, + "max": 218.22578698629513 + } + }, + { + "start": 400808.664798377, + "first": 400809.165608861, + "last": 400817.330032156, + "end": 400817.330104093, + "elapsed_s": 8.665305715985596, + "chunk_offsets_s": [ + 0.5008104839944281, + 0.5952528359484859, + 0.6930679999641143, + 0.790922652988229, + 0.8907435069559142, + 0.9917158960015513, + 1.089187391975429, + 1.1852873979951255, + 1.2823198799742386, + 1.3778944069636054, + 1.4756970109883696, + 1.571946746960748, + 1.670174139959272, + 1.767417953000404, + 1.8628172779572196, + 1.9620517719886266, + 2.0645693009719253, + 2.16283837496303, + 2.2589458849979565, + 2.3576700529665686, + 2.4547947279643267, + 2.551043679995928, + 2.6447547109564766, + 2.7435457429965027, + 2.8413561710040085, + 2.9428198779933155, + 3.0409741349867545, + 3.1415601989720017, + 3.238582535996102, + 3.339167671976611, + 3.4426005889545195, + 3.544851377955638, + 3.63789255998563, + 3.734765407978557, + 3.8323155129910447, + 3.9279567769845016, + 4.024436818959657, + 4.12335567799164, + 4.222810510953423, + 4.3194856439949945, + 4.416729488992132, + 4.517715093970764, + 4.615184092952404, + 4.687814084987622, + 4.788953162962571, + 4.89105454296805, + 4.987960094993468, + 5.08324378594989, + 5.182806156983133, + 5.2848151350044645, + 5.385489918990061, + 5.48581668396946, + 5.583154944994021, + 5.684169126965571, + 5.7835488229757175, + 5.884333208960015, + 5.984640356968157, + 6.086857305956073, + 6.18282065395033, + 6.278832401963882, + 6.374590019986499, + 6.465745369961951, + 6.560616607952397, + 6.656105981965084, + 6.753650549973827, + 6.853247272956651, + 6.946176741970703, + 7.044849276950117, + 7.143634260981344, + 7.244692698994186, + 7.3424572219955735, + 7.4382483279914595, + 7.538245567993727, + 7.636072619992774, + 7.735087318986189, + 7.836658866959624, + 7.933780133957043, + 8.030192047997843, + 8.125340153987054, + 8.224775001988746, + 8.324172490974888, + 8.422934194968548, + 8.5272505619796, + 8.609664007963147, + 8.665233779000118 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.81279601156712, + "p95": 102.21694898791611, + "max": 104.31636701105163 + } + }, + { + "start": 400808.664083456, + "first": 400808.792445333, + "last": 400817.329486421, + "end": 400817.329661704, + "elapsed_s": 8.665578248037491, + "chunk_offsets_s": [ + 0.1283618769957684, + 0.5956924899946898, + 0.6939467480406165, + 0.7914889639941975, + 0.891555133042857, + 0.9928187100449577, + 1.0894342900137417, + 1.1857705080183223, + 1.283193762996234, + 1.3787017129943706, + 1.4762522020027973, + 1.5724486410035752, + 1.6708140679984353, + 1.7680577050196007, + 1.8638457230408676, + 1.9624712170334533, + 2.0651799800107256, + 2.1637094580219127, + 2.2600210020318627, + 2.3584494540118612, + 2.456122873001732, + 2.552321919996757, + 2.6456840820028447, + 2.7440369490068406, + 2.8428370220353827, + 2.944069606019184, + 3.0413952440139838, + 3.142513091035653, + 3.2395619570161216, + 3.3401600050274283, + 3.443389398045838, + 3.545332584006246, + 3.638885933032725, + 3.735665243002586, + 3.8332224040059373, + 3.929130216012709, + 4.025557186047081, + 4.123878484009765, + 4.223583032027818, + 4.320130595995579, + 4.417713149043266, + 4.518670738034416, + 4.616325388022233, + 4.6888050570269115, + 4.789944360032678, + 4.8919409540249035, + 4.988875481998548, + 5.084196470037568, + 5.1836291429935955, + 5.285370598023292, + 5.386110679013655, + 5.486742998997215, + 5.584021820046473, + 5.685048785991967, + 5.784472274011932, + 5.885525432007853, + 5.985588865005411, + 6.087765877018683, + 6.183998588996474, + 6.279729454021435, + 6.375716690032277, + 6.466253952006809, + 6.561395402008202, + 6.657180491019972, + 6.754184605029877, + 6.853772111993749, + 6.9467139490297996, + 7.045774905011058, + 7.144472336047329, + 7.245645846996922, + 7.3433245129999705, + 7.438785759033635, + 7.539215132012032, + 7.6370050480472855, + 7.736223621992394, + 7.837182890041731, + 7.934574816026725, + 8.031008250021841, + 8.126212389033753, + 8.225364162004553, + 8.325131095014513, + 8.423871454026084, + 8.52775508101331, + 8.610634564014617, + 8.665402965038083 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.73429101915099, + "p95": 102.17701201327145, + "max": 467.3306129989214 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 117.12284076465359, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 8.8375683859922, + "end_to_end_tps": 115.86897608883791, + "timing_valid": true, + "steady_tps": 120.25116227417597, + "per_stream_tps": [ + 30.6, + 29.3, + 29.7, + 30.2 + ], + "ttft_s": [ + 0.5, + 0.13, + 0.25, + 0.38 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.5031971369753592, + "decode_tps": 30.604493488843215, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.82209788424444, + "prefill_tps": 27.82209788424444, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.674940376469465, + "round_gap_p50_ms": 97.37821400631219, + "round_gap_p95_ms": 123.08417697204277, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0013160170055925846, + "first_payload_s": 0.5031971369753592, + "first_content_s": 0.5031971369753592, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5031971369753592, + "last_output_s": 8.835306932975072 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.12770447600632906, + "decode_tps": 29.284235642725037, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 109.6281073132171, + "prefill_tps": 109.6281073132171, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.148065607730004, + "round_gap_p50_ms": 97.40639000665396, + "round_gap_p95_ms": 123.47578204935417, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009499959996901453, + "first_payload_s": 0.12770447600632906, + "first_content_s": 0.12770447600632906, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12770447600632906, + "last_output_s": 8.83546120597748 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2544022519723512, + "decode_tps": 29.71550673458137, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.030959401733355, + "prefill_tps": 55.030959401733355, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.652463305841984, + "round_gap_p50_ms": 97.4433989613317, + "round_gap_p95_ms": 123.84370702784508, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0012635359889827669, + "first_payload_s": 0.2544022519723512, + "first_content_s": 0.2544022519723512, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2544022519723512, + "last_output_s": 8.835780394962057 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3792765010148287, + "decode_tps": 30.15056427053157, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.91238440172342, + "prefill_tps": 36.91238440172342, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.166875121384564, + "round_gap_p50_ms": 97.54288895055652, + "round_gap_p95_ms": 123.48543095868081, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0018303919932805002, + "first_payload_s": 0.3792765010148287, + "first_content_s": 0.3792765010148287, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3792765010148287, + "last_output_s": 8.836829656967893 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.410586102856506, + "round_gap_p50_ms": 97.44851902360097, + "round_gap_p95_ms": 123.80463402951136, + "round_gap_mean_ms": 101.42499352652868, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 111.13970886054167, + "aggregate_prefill_tps": 111.13970886054167 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400817.333117588, + "first": 400817.836314725, + "last": 400826.168424521, + "end": 400826.168678588, + "elapsed_s": 8.835560999985319, + "chunk_offsets_s": [ + 0.5031971369753592, + 0.5976272329571657, + 0.695337003970053, + 0.7909552109776996, + 0.8913532400038093, + 0.99285169999348, + 1.0898483889759518, + 1.1855425809626468, + 1.2827279609628022, + 1.3766753789968789, + 1.4710600179969333, + 1.5840119689819403, + 1.7079546849709004, + 1.8308309399872087, + 1.9530265459907241, + 2.076110722962767, + 2.204519832972437, + 2.3283244670019485, + 2.4493996739620343, + 2.573826300969813, + 2.673980966967065, + 2.7712363629834726, + 2.8671814869740047, + 2.964589460985735, + 3.0619676749920473, + 3.1618676979560405, + 3.2609890699968673, + 3.3599747449625283, + 3.4559946219669655, + 3.556897984992247, + 3.659918207966257, + 3.7634873659699224, + 3.855793738970533, + 3.951589147967752, + 4.048076854960527, + 4.1423764689825475, + 4.238194486999419, + 4.336519976961426, + 4.434612601005938, + 4.53099568199832, + 4.627869536983781, + 4.725462841975968, + 4.822428443003446, + 4.893770897993818, + 4.9978108129580505, + 5.0952603399637155, + 5.192566472978797, + 5.286997321003582, + 5.384701684000902, + 5.486869910964742, + 5.587868252012413, + 5.686505938007031, + 5.782706360972952, + 5.881894213962369, + 5.983518450986594, + 6.08369161299197, + 6.182363826956134, + 6.284256179991644, + 6.379048392002005, + 6.4738174849771895, + 6.569380346976686, + 6.6592472969787195, + 6.754076341982, + 6.849655908008572, + 6.945156049972866, + 7.042561927984934, + 7.1354018920101225, + 7.233724038000219, + 7.333424569980707, + 7.433504067012109, + 7.530746502976399, + 7.626170018978883, + 7.722612476965878, + 7.8181711479555815, + 7.914764776010998, + 8.01737780898111, + 8.114448338979855, + 8.211051550984848, + 8.305629120965023, + 8.403717215987854, + 8.502483015006874, + 8.598008596978616, + 8.699769363971427, + 8.780182207003236, + 8.835306932975072 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.39204600919038, + "p95": 123.08417697204277, + "max": 128.40911000967026 + } + }, + { + "start": 400817.332764432, + "first": 400817.460468908, + "last": 400826.168225638, + "end": 400826.169378181, + "elapsed_s": 8.836613748979289, + "chunk_offsets_s": [ + 0.12770447600632906, + 0.5975931519642472, + 0.6952414020197466, + 0.7911839180160314, + 0.8915661710198037, + 0.9928626749897376, + 1.0903383149998263, + 1.185502020001877, + 1.2828039610176347, + 1.3768474289681762, + 1.471276804979425, + 1.5842434279620647, + 1.7081401430186816, + 1.8310712790116668, + 1.9532572359894402, + 2.076297877007164, + 2.2047526029637083, + 2.3282283850130625, + 2.449402617989108, + 2.573701595014427, + 2.6744651799672283, + 2.7710618000128306, + 2.8670920449658297, + 2.964463458978571, + 3.061855960986577, + 3.1620940680149943, + 3.260678521997761, + 3.359889047977049, + 3.455907372001093, + 3.556577373004984, + 3.6598103659925982, + 3.7633511719759554, + 3.855837467010133, + 3.951536826964002, + 4.048195992014371, + 4.142316451994702, + 4.238027476007119, + 4.336421095998958, + 4.434803993965033, + 4.5310971069848165, + 4.6281024040072225, + 4.7255087940138765, + 4.822299144987483, + 4.894002195971552, + 4.9978475329698995, + 5.095316660008393, + 5.192648537980858, + 5.287036456982605, + 5.3849631419871, + 5.4870580729912035, + 5.587865786976181, + 5.68660470697796, + 5.782794841972645, + 5.882071656000335, + 5.9835144659737125, + 6.0836935639963485, + 6.182787208002992, + 6.284102768986486, + 6.379029863979667, + 6.473882524995133, + 6.569424315006472, + 6.65941672201734, + 6.75432245596312, + 6.84968691598624, + 6.9446960120112635, + 7.042618377017789, + 7.135564133001026, + 7.233761301962659, + 7.333459561981726, + 7.433318544004578, + 7.530552115989849, + 7.626248931977898, + 7.722688045992982, + 7.818300237006042, + 7.914999241998885, + 8.017679555981886, + 8.114008124975953, + 8.21104175801156, + 8.305649279966019, + 8.403778992011212, + 8.502450565982144, + 8.598072949971538, + 8.699797827983275, + 8.78036700899247, + 8.83546120597748 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.43775852257386, + "p95": 123.47578204935417, + "max": 469.88867595791817 + } + }, + { + "start": 400817.332551181, + "first": 400817.586953433, + "last": 400826.168331576, + "end": 400826.16899776, + "elapsed_s": 8.83644657896366, + "chunk_offsets_s": [ + 0.2544022519723512, + 0.5978873959975317, + 0.6954138839500956, + 0.7916875559603795, + 0.892073888971936, + 0.9932702009682544, + 1.0905932619934902, + 1.186003130977042, + 1.2831297899829224, + 1.377121127967257, + 1.4716757859569043, + 1.5846297209500335, + 1.7084734279778786, + 1.8314477799576707, + 1.953636968974024, + 2.076627752976492, + 2.2050103349611163, + 2.3289336749585345, + 2.450032865977846, + 2.574254545965232, + 2.674639838980511, + 2.771674944960978, + 2.8676546289934777, + 2.9650980279548094, + 3.062479281972628, + 3.1625344899948686, + 3.26097474998096, + 3.360475006978959, + 3.456233168952167, + 3.557306549977511, + 3.660141106985975, + 3.7638990510022268, + 3.856232719961554, + 3.951832494989503, + 4.048567741003353, + 4.142877242993563, + 4.238633339991793, + 4.337023279978894, + 4.435226191999391, + 4.53163682599552, + 4.6283845999860205, + 4.72609776200261, + 4.823042226955295, + 4.8942916879896075, + 4.9984531729714945, + 5.0959016919950955, + 5.193219665961806, + 5.287641808972694, + 5.385383419983555, + 5.487340428982861, + 5.588520883989986, + 5.687183002999518, + 5.783353712991811, + 5.882366155972704, + 5.98402759298915, + 6.084304051997606, + 6.18311849294696, + 6.284591784002259, + 6.379661567974836, + 6.474485588958487, + 6.5700160669512115, + 6.659862359985709, + 6.754972256952897, + 6.850355820963159, + 6.945273538993206, + 7.0432997299940325, + 7.135875545965973, + 7.234127802948933, + 7.33374539000215, + 7.433924135984853, + 7.531234236957971, + 7.6268125549540855, + 7.723268421948887, + 7.81864923395915, + 7.915378910955042, + 8.018168282986153, + 8.114606485003605, + 8.211665045993868, + 8.306085941963829, + 8.404164820967708, + 8.502734793990385, + 8.598661709984299, + 8.700072678970173, + 8.780796726990957, + 8.835780394962057 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.44595899246633, + "p95": 123.84370702784508, + "max": 343.4851440251805 + } + }, + { + "start": 400817.332444411, + "first": 400817.711720912, + "last": 400826.169274068, + "end": 400826.170012797, + "elapsed_s": 8.8375683859922, + "chunk_offsets_s": [ + 0.3792765010148287, + 0.5976436659693718, + 0.6954409729805775, + 0.7915767880040221, + 0.891815950977616, + 0.9930454940185882, + 1.0905883829691447, + 1.1859380590030923, + 1.2831900789751671, + 1.3771038809791207, + 1.4716818350134417, + 1.5846303930156864, + 1.708525876980275, + 1.8314582600141875, + 1.9536431779852137, + 2.076685563020874, + 2.205013743019663, + 2.3284991739783436, + 2.449992657988332, + 2.5742548030102625, + 2.674948244006373, + 2.771674289018847, + 2.8675283400225453, + 2.965047275996767, + 3.062512082979083, + 3.162759805971291, + 3.2618382180226035, + 3.3604250549688004, + 3.4565129809780046, + 3.557244213996455, + 3.66040754300775, + 3.7638551630079746, + 3.856259392981883, + 3.952106882992666, + 4.048625789990183, + 4.142853787983768, + 4.238543179992121, + 4.336981808010023, + 4.435202175984159, + 4.531591386010405, + 4.628362295974512, + 4.726058033993468, + 4.82306054700166, + 4.894607549009379, + 4.998411029984709, + 5.09585485997377, + 5.1931688180193305, + 5.287589857005514, + 5.385443389997818, + 5.487604801019188, + 5.58847037202213, + 5.687116426008288, + 5.783306544995867, + 5.882634111971129, + 5.983996825001668, + 6.084197556017898, + 6.183173613972031, + 6.284763914998621, + 6.379550111014396, + 6.474435109004844, + 6.569995779020246, + 6.659832487988751, + 6.754908321017865, + 6.850166330987122, + 6.945221362984739, + 7.043562502018176, + 7.136147294018883, + 7.23417889198754, + 7.334014497988392, + 7.433863863989245, + 7.53147294401424, + 7.626755707024131, + 7.723195732978638, + 7.818896804994438, + 7.915585217997432, + 8.01819426799193, + 8.11455333296908, + 8.211565429985058, + 8.306125574978068, + 8.404195557988714, + 8.50298772600945, + 8.598607245017774, + 8.700350811996032, + 8.780765910982154, + 8.836829656967893 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.57598448777571, + "p95": 123.48543095868081, + "max": 218.3671649545431 + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.8, + "per_stream_tps": 23.0, + "ttft_s_max": 0.78, + "request": { + "ttft_s": 0.489, + "decode_tps": 23.036, + "prompt_ttft_tps": 67.774, + "prefill_tps": 67.774, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.412, + "round_gap_p50_ms": 98.091, + "round_gap_p95_ms": 102.832, + "tokens_per_chunk": 2.306, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.489, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.489, + "last_output_s": 11.558 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 165.126, + "aggregate_prefill_tps": 165.126, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.411, + "round_gap_p50_ms": 98.087, + "round_gap_p95_ms": 102.724, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 8 + }, + "timing_valid": true, + "end_to_end_tps": 88.58554968876471, + "makespan_s": 11.559534407482715, + "steady_tps": 94.1, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 90.10789341070664, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.527816422982141, + "end_to_end_tps": 88.82861787758245, + "timing_valid": true, + "steady_tps": 94.45183153793876, + "per_stream_tps": [ + 22.5, + 23.3, + 23.7, + 22.9 + ], + "ttft_s": [ + 0.21, + 0.59, + 0.78, + 0.4 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.20723390101920813, + "decode_tps": 22.528857465311365, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 154.414889854503, + "prefill_tps": 154.414889854503, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.38751505884141, + "round_gap_p50_ms": 97.69177000271156, + "round_gap_p95_ms": 102.4827910005115, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.001985146023798734, + "first_payload_s": 0.0019869860261678696, + "first_content_s": 0.20723390101920813, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.20723390101920813, + "last_output_s": 11.526050241023768 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5889591519953683, + "decode_tps": 23.315017363449698, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.33313989872706, + "prefill_tps": 54.33313989872706, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.89081086285923, + "round_gap_p50_ms": 97.81373996520415, + "round_gap_p95_ms": 102.38583001773804, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0024183830246329308, + "first_payload_s": 0.00243367999792099, + "first_content_s": 0.5889591519953683, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5889591519953683, + "last_output_s": 11.526115922024474 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.77945653203642, + "decode_tps": 23.72903868354711, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.05424572733558, + "prefill_tps": 41.05424572733558, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.14245732143229, + "round_gap_p50_ms": 97.73834701627493, + "round_gap_p95_ms": 102.53837599884719, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002270365017466247, + "first_payload_s": 0.0022727969917468727, + "first_content_s": 0.77945653203642, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.77945653203642, + "last_output_s": 11.525783149001654 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3990422100177966, + "decode_tps": 22.915017656337575, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 80.19201777820159, + "prefill_tps": 80.19201777820159, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.63950379603707, + "round_gap_p50_ms": 97.70465001929551, + "round_gap_p95_ms": 102.81199601013213, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0024416950182057917, + "first_payload_s": 0.002445310994517058, + "first_content_s": 0.3990422100177966, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3990422100177966, + "last_output_s": 11.527115678007249 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.2650717597925, + "round_gap_p50_ms": 97.73746598511934, + "round_gap_p95_ms": 102.52111201407388, + "round_gap_mean_ms": 100.29630271588262, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.06809528275735, + "aggregate_prefill_tps": 164.06809528275735 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400826.897551829, + "first": 400827.10478573, + "last": 400838.42360207, + "end": 400838.425249499, + "elapsed_s": 11.527697669982444, + "chunk_offsets_s": [ + 0.20723390101920813, + 0.8778772079967894, + 0.9761892419774085, + 1.0731862179818563, + 1.1698461510241032, + 1.2677287550177425, + 1.3641674530226737, + 1.461130924988538, + 1.5609784190310165, + 1.656832293025218, + 1.7533111029770225, + 1.8524704279843718, + 1.9496496790088713, + 2.0476030519930646, + 2.146313074976206, + 2.2430919210310094, + 2.3387766730156727, + 2.4364146339939907, + 2.540690425026696, + 2.6431732160272077, + 2.7411468300269917, + 2.8332375360187143, + 2.9321028409758583, + 3.0322878900333308, + 3.131146090978291, + 3.228568752994761, + 3.330692452029325, + 3.427074156992603, + 3.5255420170142315, + 3.623999396979343, + 3.7197106609819457, + 3.8171582670183852, + 3.9127109220135026, + 4.009241076011676, + 4.110900864994619, + 4.213085093011614, + 4.3122368170297705, + 4.409986411978025, + 4.506980139994994, + 4.609180959989317, + 4.7058770370204, + 4.803568807023112, + 4.904221335018519, + 4.9989891949808225, + 5.100337554991711, + 5.198722934001125, + 5.296371262986213, + 5.392421172000468, + 5.4925783650251105, + 5.59519567003008, + 5.694053774990607, + 5.79270941298455, + 5.889353825012222, + 5.985908571979962, + 6.0880972479935735, + 6.187112825980876, + 6.284649058012292, + 6.382602654979564, + 6.480667566007469, + 6.578658298996743, + 6.674223768990487, + 6.771521597984247, + 6.8680847770301625, + 6.964952104026452, + 7.064029699016828, + 7.1613349840044975, + 7.255165359994862, + 7.353975175996311, + 7.455981336999685, + 7.558794277021661, + 7.660411345015746, + 7.7555558499880135, + 7.847719675977714, + 7.9457137060235254, + 8.044042042980436, + 8.141527010011487, + 8.239647376991343, + 8.338517930009402, + 8.435970912978519, + 8.53742849099217, + 8.638653122005053, + 8.732226261985488, + 8.833472397993319, + 8.930210458987858, + 9.029517177026719, + 9.12825160002103, + 9.22609527601162, + 9.32238619501004, + 9.415685716026928, + 9.51120574597735, + 9.606209609017242, + 9.701957001001574, + 9.80064788798336, + 9.900184464990161, + 9.996109844010789, + 10.09319070901256, + 10.189553486008663, + 10.283682729001157, + 10.380114787025377, + 10.480382460984401, + 10.574567690026015, + 10.673358449013904, + 10.768544075021055, + 10.868193725007586, + 10.970792485983111, + 11.06554253801005, + 11.162199525977485, + 11.25884737801971, + 11.355771280999761, + 11.456191982026212, + 11.526050241023768 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.72068247548304, + "p95": 102.4827910005115, + "max": 670.6433069775812 + } + }, + { + "start": 400826.897633846, + "first": 400827.486592998, + "last": 400838.423749768, + "end": 400838.424057516, + "elapsed_s": 11.52642367000226, + "chunk_offsets_s": [ + 0.5889591519953683, + 0.8777281820075586, + 0.9759273820091039, + 1.0729725200217217, + 1.1696979410480708, + 1.267511681013275, + 1.364391295996029, + 1.4609812280396, + 1.5608258250285871, + 1.6566852030227892, + 1.752912905998528, + 1.8524518519989215, + 1.9495087180403061, + 2.0475802520522848, + 2.146097921009641, + 2.2429474079981446, + 2.3386220310349017, + 2.436257736000698, + 2.540730474051088, + 2.643295266025234, + 2.740907211031299, + 2.8329576600226574, + 2.932467549049761, + 3.0322684020502493, + 3.1309958490310237, + 3.2286261620465666, + 3.3304649450001307, + 3.426925995037891, + 3.5253607830381952, + 3.6238502110354602, + 3.719563090999145, + 3.8177296190406196, + 3.9129596290295012, + 4.008964881009888, + 4.111146820010617, + 4.212821713008452, + 4.31208201503614, + 4.409804121009074, + 4.506824809999671, + 4.609026990015991, + 4.705555881024338, + 4.803763865027577, + 4.904287383018527, + 4.999543858051766, + 5.100141728995368, + 5.1983894419972785, + 5.296698354999535, + 5.392217361018993, + 5.492326218052767, + 5.595259031048045, + 5.694030767015647, + 5.792542483017314, + 5.889209151035175, + 5.986228272027802, + 6.087953438051045, + 6.186949816008564, + 6.285088616015855, + 6.38226821902208, + 6.480528908025008, + 6.57851004099939, + 6.673955286038108, + 6.771306187030859, + 6.867926167033147, + 6.965061865048483, + 7.063773840025533, + 7.161073493014555, + 7.254924125038087, + 7.353816902032122, + 7.456055578019004, + 7.558612242050003, + 7.660660068038851, + 7.75524560600752, + 7.847549498023, + 7.9455770320491865, + 8.043696295004338, + 8.141591619001701, + 8.239308253047056, + 8.338363000017125, + 8.435790062008891, + 8.537411787023302, + 8.638502064044587, + 8.732334040047135, + 8.833461438014638, + 8.930196251021698, + 9.029507193015888, + 9.128078542009462, + 9.225953674002085, + 9.322392691043206, + 9.41576173302019, + 9.51097247900907, + 9.606022998050321, + 9.701940297032706, + 9.800506558036432, + 9.899948814010713, + 9.995965842041187, + 10.09353660204215, + 10.189378348004539, + 10.283542936027516, + 10.379970273002982, + 10.480064969044179, + 10.574423048004974, + 10.673207359039225, + 10.76838032802334, + 10.868170413014013, + 10.970556243031751, + 11.065887070028111, + 11.161919025995303, + 11.258622495050076, + 11.355537342024036, + 11.456291887036059, + 11.526115922024474 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.84443597891368, + "p95": 102.38583001773804, + "max": 288.76903001219034 + } + }, + { + "start": 400826.898140413, + "first": 400827.677596945, + "last": 400838.423923562, + "end": 400838.425061801, + "elapsed_s": 11.526921387994662, + "chunk_offsets_s": [ + 0.77945653203642, + 0.877620660001412, + 0.9755562890204601, + 1.0726399550330825, + 1.169441537000239, + 1.2671798840165138, + 1.363649845996406, + 1.4605999740306288, + 1.560575996991247, + 1.6564370240084827, + 1.7524832680355757, + 1.8520084060146473, + 1.9491856730310246, + 2.0473299130098894, + 2.1456679310067557, + 2.2427067800308578, + 2.338442445034161, + 2.4355608629994094, + 2.5398939499864355, + 2.6426462010131218, + 2.7404959890409373, + 2.832549174025189, + 2.9322486020391807, + 3.032002750027459, + 3.130701716989279, + 3.228200972022023, + 3.3301477410132065, + 3.4266282790340483, + 3.5249984260299243, + 3.6235598539933562, + 3.7192702229949646, + 3.816764758026693, + 3.9123737810296007, + 4.008717101009097, + 4.110471835010685, + 4.212550781026948, + 4.312211023992859, + 4.409487541008275, + 4.506484133016784, + 4.608640649006702, + 4.705230612016749, + 4.803081264020875, + 4.903585981985088, + 4.9986744379857555, + 5.099887965014204, + 5.198199342994485, + 5.296403487038333, + 5.391793722985312, + 5.492171126999892, + 5.594883185985964, + 5.6936598010361195, + 5.79231372702634, + 5.8893029280006886, + 5.985154786030762, + 6.087693162029609, + 6.186715541000012, + 6.284677026036661, + 6.381844068993814, + 6.480246967985295, + 6.5781106280046515, + 6.673549600003753, + 6.770887205027975, + 6.867535218014382, + 6.964459632989019, + 7.063494700007141, + 7.160672511032317, + 7.254499079019297, + 7.353542258031666, + 7.455629140022211, + 7.558247501030564, + 7.659904442029074, + 7.754826016025618, + 7.847194261034019, + 7.945652247988619, + 8.04341291502351, + 8.141159325023182, + 8.238890279026236, + 8.33811605302617, + 8.435470953991171, + 8.537008821032941, + 8.637789573986083, + 8.731880609004293, + 8.83308151201345, + 8.929829702014104, + 9.02911922003841, + 9.127706313040107, + 9.225649669999257, + 9.322050366026815, + 9.415323599008843, + 9.510656489990652, + 9.605775475036353, + 9.701495747023728, + 9.800201945006847, + 9.89963690500008, + 9.995659501000773, + 10.093119028024375, + 10.189226137008518, + 10.28362639201805, + 10.379751742002554, + 10.47987571801059, + 10.574243940995075, + 10.673032268998213, + 10.76807304401882, + 10.867519891995471, + 10.970358960039448, + 11.065490423992742, + 11.161562925030012, + 11.258303034002893, + 11.355134793033358, + 11.455647927010432, + 11.525783149001654 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.74237850797363, + "p95": 102.53837599884719, + "max": 104.33308698702604 + } + }, + { + "start": 400826.897433076, + "first": 400827.296475286, + "last": 400838.424548754, + "end": 400838.424787141, + "elapsed_s": 11.52735406497959, + "chunk_offsets_s": [ + 0.3990422100177966, + 0.8784825910115615, + 0.976187241030857, + 1.0732343629933894, + 1.1702461559907533, + 1.2677815550123341, + 1.3646463390323333, + 1.4613596320268698, + 1.5613715919898823, + 1.6575244779814966, + 1.753519169986248, + 1.8527726880274713, + 1.9498330249916762, + 2.047960896976292, + 2.1465137019986287, + 2.2433569799759425, + 2.3392117510084063, + 2.436161750985775, + 2.5406782319769263, + 2.643199343991, + 2.7414290250162594, + 2.833458721986972, + 2.932838017004542, + 3.0326228219782934, + 3.131322509027086, + 3.228622002003249, + 3.3307176679954864, + 3.427250927023124, + 3.52576173102716, + 3.6241781180142425, + 3.7198892870219424, + 3.817410606017802, + 3.912994221027475, + 4.009264644002542, + 4.111251029011328, + 4.213116533006541, + 4.312797160004266, + 4.410331263032276, + 4.507247887027916, + 4.60917646298185, + 4.705860524030868, + 4.804073229024652, + 4.90418138197856, + 4.999297310016118, + 5.100517605023924, + 5.198757398000453, + 5.296351662022062, + 5.392605237022508, + 5.492633789021056, + 5.595509962004144, + 5.694288225029595, + 5.793120633985382, + 5.8899097359972075, + 5.985765305988025, + 6.08880768797826, + 6.187519039027393, + 6.28523864899762, + 6.382848433975596, + 6.480867695994675, + 6.5786051619797945, + 6.674482267990243, + 6.771359851001762, + 6.868295562977437, + 6.96541356499074, + 7.064062579011079, + 7.161916046985425, + 7.255460307002068, + 7.354157930007204, + 7.456040536984801, + 7.559010311029851, + 7.660783396975603, + 7.75560786598362, + 7.848076416004915, + 7.946266271988861, + 8.044043723028153, + 8.141950758988969, + 8.239897028019186, + 8.33920022600796, + 8.436242628027685, + 8.53745293902466, + 8.638629584980663, + 8.73243293602718, + 8.833732415980194, + 8.930452893022448, + 9.029771787987556, + 9.12821451103082, + 9.226277630019467, + 9.322653669980355, + 9.415893413999584, + 9.511241041996982, + 9.606410811014939, + 9.70226290897699, + 9.800829217012506, + 9.900247632991523, + 9.996286884997971, + 10.093215733009856, + 10.189858129015192, + 10.284271247975994, + 10.38037725398317, + 10.480411404976621, + 10.574860428983811, + 10.673820039024577, + 10.768722572014667, + 10.868157739983872, + 10.970969735994004, + 11.065596554020885, + 11.162207285000477, + 11.258907154027838, + 11.356055987998843, + 11.456209037976805, + 11.527115678007249 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.7121299947612, + "p95": 102.81199601013213, + "max": 479.44038099376485 + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.52482665805157, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.59125239198329, + "end_to_end_tps": 88.34248149994698, + "timing_valid": true, + "steady_tps": 93.80901394834146, + "per_stream_tps": [ + 22.8, + 23.2, + 23.6, + 22.4 + ], + "ttft_s": [ + 0.39, + 0.58, + 0.77, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3876085410011001, + "decode_tps": 22.762323626032376, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.557520320248, + "prefill_tps": 82.557520320248, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.93224595297201, + "round_gap_p50_ms": 98.44062698539346, + "round_gap_p95_ms": 103.1692479737103, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016123239765875041, + "first_payload_s": 0.0016205639694817364, + "first_content_s": 0.3876085410011001, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3876085410011001, + "last_output_s": 11.590331259008963 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5780728650279343, + "decode_tps": 23.156740110221985, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.3563433537979, + "prefill_tps": 55.3563433537979, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.18397128612132, + "round_gap_p50_ms": 98.39067404391244, + "round_gap_p95_ms": 103.02972595673054, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.001741830026730895, + "first_payload_s": 0.0017448540311306715, + "first_content_s": 0.5780728650279343, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5780728650279343, + "last_output_s": 11.58998554298887 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7695335220196284, + "decode_tps": 23.566641234458437, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.58363357065526, + "prefill_tps": 41.58363357065526, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.43286050189579, + "round_gap_p50_ms": 98.4238269738853, + "round_gap_p95_ms": 102.85170801216736, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016678940155543387, + "first_payload_s": 0.0016698940307833254, + "first_content_s": 0.7695335220196284, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7695335220196284, + "last_output_s": 11.589912950003054 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19712488999357447, + "decode_tps": 22.382657058749984, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.3336352960962, + "prefill_tps": 162.3336352960962, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.67744814099598, + "round_gap_p50_ms": 98.36837096372619, + "round_gap_p95_ms": 102.92590101016685, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0013733459636569023, + "first_payload_s": 0.00137624196941033, + "first_content_s": 0.19712488999357447, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19712488999357447, + "last_output_s": 11.589874165947549 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.55663147049627, + "round_gap_p50_ms": 98.43697800533846, + "round_gap_p95_ms": 102.92590101016685, + "round_gap_mean_ms": 100.97219113615046, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 166.1834719992126, + "aggregate_prefill_tps": 166.1834719992126 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 400838.427363031, + "first": 400838.814971572, + "last": 400850.01769429, + "end": 400850.017918805, + "elapsed_s": 11.590555773989763, + "chunk_offsets_s": [ + 0.3876085410011001, + 0.8679889959748834, + 0.9674166920012794, + 1.0662653239560314, + 1.1638401479576714, + 1.2625939630088396, + 1.3599106399924494, + 1.457288276986219, + 1.555727623985149, + 1.6521235369727947, + 1.7494141329661943, + 1.8495738380006514, + 1.9469815719639882, + 2.04441529000178, + 2.1432288339710794, + 2.2438134719850495, + 2.3408403850044124, + 2.439281011989806, + 2.5412601649877615, + 2.644429412961472, + 2.741811401967425, + 2.8351624439819716, + 2.9356877529644407, + 3.0363821529899724, + 3.135254786000587, + 3.2345898560015485, + 3.337334459007252, + 3.4351350140059367, + 3.5332720849546604, + 3.6329818159574643, + 3.7284231079975143, + 3.826932535972446, + 3.923439921985846, + 4.020249375957064, + 4.12362269096775, + 4.225806389993522, + 4.324993602000177, + 4.424389041960239, + 4.520396148960572, + 4.620310619007796, + 4.71849589899648, + 4.816326293977909, + 4.918620137963444, + 5.0126812369562685, + 5.114460851007607, + 5.212623281986453, + 5.313997002958786, + 5.411695652001072, + 5.510884656978305, + 5.610035244957544, + 5.708164923998993, + 5.806287674000487, + 5.904192661982961, + 6.001886847952846, + 6.105401123990305, + 6.206118451955263, + 6.305273920006584, + 6.403624353988562, + 6.501842529978603, + 6.601654405996669, + 6.697357061959337, + 6.793960928975139, + 6.891229973000009, + 6.989282018970698, + 7.088508415967226, + 7.185507696005516, + 7.280429765989538, + 7.379524544987362, + 7.480828600993846, + 7.583231422002427, + 7.683322662953287, + 7.779968930000905, + 7.871657357958611, + 7.970365811954252, + 8.067426916968543, + 8.165721653960645, + 8.26452025398612, + 8.368414438969921, + 8.467005882994272, + 8.568239329964854, + 8.668448043987155, + 8.763064812985249, + 8.86504750198219, + 8.963950981968082, + 9.063628968957346, + 9.163046344998293, + 9.263519700965844, + 9.359826348954812, + 9.454911811975762, + 9.550683668989222, + 9.648755219008308, + 9.74486232799245, + 9.845383140956983, + 9.945750368991867, + 10.042235289991368, + 10.141140850959346, + 10.235660562990233, + 10.331260032951832, + 10.431225671956781, + 10.531853798951488, + 10.62728677096311, + 10.723227365000639, + 10.818491326994263, + 10.920259067963343, + 11.026585252955556, + 11.122363156988285, + 11.21881447796477, + 11.315238582959864, + 11.416770545009058, + 11.517982375982683, + 11.590331259008963 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.47502748016268, + "p95": 103.1692479737103, + "max": 480.38045497378334 + } + }, + { + "start": 400838.427786252, + "first": 400839.005859117, + "last": 400850.017771795, + "end": 400850.018105511, + "elapsed_s": 11.590319258975796, + "chunk_offsets_s": [ + 0.5780728650279343, + 0.867622816003859, + 0.9671687689842656, + 1.0660168569884263, + 1.1634750560042448, + 1.2622291109873913, + 1.3596347650163807, + 1.4574030950316228, + 1.555263874004595, + 1.6517608290305361, + 1.7491380500141531, + 1.8490363919991069, + 1.946741072984878, + 2.044038901978638, + 2.143004671030212, + 2.243122775980737, + 2.340481005026959, + 2.438934559992049, + 2.5409291370306164, + 2.6440782410209067, + 2.7414571099798195, + 2.834681398002431, + 2.9354230780154467, + 3.036147542996332, + 3.1351858890266158, + 3.2345222560106777, + 3.3370025670155883, + 3.434913938981481, + 3.532999554008711, + 3.6324945940286852, + 3.727932862995658, + 3.8261915189796127, + 3.922958844981622, + 4.020046750025358, + 4.123076475982089, + 4.225225374975707, + 4.324677839002106, + 4.42388125899015, + 4.519591547024902, + 4.619942902994808, + 4.717618832015432, + 4.815847248013597, + 4.917911634023767, + 5.012022541020997, + 5.113963180978317, + 5.212353855022229, + 5.313939995015971, + 5.41134976001922, + 5.510559708985966, + 5.609704121015966, + 5.707838328031357, + 5.806003334990237, + 5.903877507022116, + 6.001580764015671, + 6.105125200992916, + 6.2057623360306025, + 6.305327057023533, + 6.40331442997558, + 6.50148007797543, + 6.601330370991491, + 6.697342406027019, + 6.793654190027155, + 6.890858641010709, + 6.988971567014232, + 7.088194044015836, + 7.185166668030433, + 7.280426838027779, + 7.3792464139987715, + 7.480759351979941, + 7.5829058029921725, + 7.683050291030668, + 7.779658735031262, + 7.871320842008572, + 7.970096768985968, + 8.067106418020558, + 8.165450498985592, + 8.264182762010023, + 8.368081859021913, + 8.46669216803275, + 8.567892718012445, + 8.667956069984939, + 8.762717848992907, + 8.864732282003388, + 8.96363181102788, + 9.063307798001915, + 9.162751045019832, + 9.262911998026539, + 9.35945410397835, + 9.454659986018669, + 9.55041251401417, + 9.648249052988831, + 9.744310097012203, + 9.84531986102229, + 9.945474573003594, + 10.041917446011212, + 10.141177060024347, + 10.235383136023302, + 10.330777820025105, + 10.430947093002032, + 10.53150205098791, + 10.62697083101375, + 10.723419415997341, + 10.81827649299521, + 10.920045049977489, + 11.026288672990631, + 11.122514024027623, + 11.21858708403306, + 11.315000244008843, + 11.416021879995242, + 11.518005161022302, + 11.58998554298887 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.42211450450122, + "p95": 103.02972595673054, + "max": 289.54995097592473 + } + }, + { + "start": 400838.427981518, + "first": 400839.19751504, + "last": 400850.017894468, + "end": 400850.018534397, + "elapsed_s": 11.590552879031748, + "chunk_offsets_s": [ + 0.7695335220196284, + 0.8677388660144061, + 0.9674832860473543, + 1.06596332101617, + 1.1637797960429452, + 1.2622036230168305, + 1.359726798022166, + 1.456868913024664, + 1.555390965018887, + 1.6517952459980734, + 1.749268388026394, + 1.849367228045594, + 1.9468106910353526, + 2.0441350630135275, + 2.142915567033924, + 2.2433731800410897, + 2.340615727007389, + 2.439061234006658, + 2.541164149006363, + 2.6441669780178927, + 2.741375717043411, + 2.8349266180302948, + 2.935294196999166, + 3.036216680018697, + 3.1347603810136206, + 3.234089963021688, + 3.3369416710338555, + 3.4349595400271937, + 3.5332289329962805, + 3.6325373790459707, + 3.72788841399597, + 3.825860763026867, + 3.9229975340422243, + 4.02004311804194, + 4.123238943051547, + 4.225417954032309, + 4.324701632023789, + 4.423869228048716, + 4.519521019014064, + 4.620272476051468, + 4.717747106042225, + 4.815879505011253, + 4.918134389037732, + 5.01213467103662, + 5.113918989023659, + 5.21228382299887, + 5.313504997000564, + 5.411345185013488, + 5.510682271036785, + 5.609872556000482, + 5.708086460013874, + 5.805899446015246, + 5.9038584830123, + 6.001782383013051, + 6.105135809048079, + 6.2056500790058635, + 6.30500062200008, + 6.403437600005418, + 6.50114269804908, + 6.60125417803647, + 6.696896289009601, + 6.793535933014937, + 6.8908896340290084, + 6.988969968049787, + 7.088150460040197, + 7.18517862103181, + 7.279979633050971, + 7.379360656021163, + 7.4803899400285445, + 7.582935916027054, + 7.683057172049303, + 7.77976264100289, + 7.871373211033642, + 7.970037809049245, + 8.067035201005638, + 8.16554320504656, + 8.26407554501202, + 8.368265350000001, + 8.466628232039511, + 8.567772253009025, + 8.66793315805262, + 8.762958781037014, + 8.864614601014182, + 8.963598115020432, + 9.063358183018863, + 9.162788710033055, + 9.262609195022378, + 9.359457401034888, + 9.454531616007444, + 9.550457555043977, + 9.647861831996124, + 9.744555941026192, + 9.845024817041121, + 9.945385964994784, + 10.041866086015943, + 10.140666702005547, + 10.235448113002349, + 10.330967919027898, + 10.431044502009172, + 10.531375729013234, + 10.626901519019157, + 10.722744816041086, + 10.818150700011756, + 10.920040091034025, + 11.026239617029205, + 11.121876368008088, + 11.218553116021212, + 11.314919812022708, + 11.41608500201255, + 11.517474418040365, + 11.589912950003054 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.43040248961188, + "p95": 102.85170801216736, + "max": 106.19952599518001 + } + }, + { + "start": 400838.427282005, + "first": 400838.624406895, + "last": 400850.017156171, + "end": 400850.017269612, + "elapsed_s": 11.589987606974319, + "chunk_offsets_s": [ + 0.19712488999357447, + 0.8682840889669023, + 0.9680298369494267, + 1.0666109289741144, + 1.1642666019615717, + 1.2628330229781568, + 1.3602660369942896, + 1.4577132429694757, + 1.556549411965534, + 1.6524426139658317, + 1.7497905389755033, + 1.8498999549774453, + 1.9474560910020955, + 2.044959681981709, + 2.1434179409989156, + 2.243826673948206, + 2.3412122469744645, + 2.43982029997278, + 2.5417551639839076, + 2.6446810649940744, + 2.742139326990582, + 2.8355758419493213, + 2.936051950964611, + 3.0368559199851006, + 3.135530037980061, + 3.234867092978675, + 3.3376993609708734, + 3.4356049089692533, + 3.5337544920039363, + 3.6331858199555427, + 3.728653543977998, + 3.826854760001879, + 3.9237644549575634, + 4.020659317960963, + 4.123999287956394, + 4.22617433097912, + 4.325456936960109, + 4.424697109963745, + 4.520312676962931, + 4.620771697955206, + 4.718288408999797, + 4.816641914949287, + 4.918626090977341, + 5.0126659099478275, + 5.114673445990775, + 5.213041816954501, + 5.314277247001883, + 5.4119355759467, + 5.511497193947434, + 5.610685893974733, + 5.708669954969082, + 5.8066706719691865, + 5.9046164129977114, + 6.002416950999759, + 6.105898138950579, + 6.206483913992997, + 6.305540916975588, + 6.404613903956488, + 6.502102806000039, + 6.602414608991239, + 6.69779737299541, + 6.794708427973092, + 6.892062289000023, + 6.990145855001174, + 7.08904213597998, + 7.186362459964585, + 7.280882075952832, + 7.3799969679676, + 7.481332943949383, + 7.5838144709705375, + 7.684230322949588, + 7.780786637973506, + 7.872557162947487, + 7.97079681098694, + 8.06820332800271, + 8.166534049960319, + 8.264950532000512, + 8.369029951980338, + 8.467280591954477, + 8.568931147980038, + 8.668796800950076, + 8.7635257159709, + 8.865516628953628, + 8.964803729963023, + 9.064231473952532, + 9.163548111973796, + 9.2637274969602, + 9.35983148595551, + 9.454923316952772, + 9.550700901949313, + 9.648419182980433, + 9.744739143003244, + 9.845303428999614, + 9.945698880997952, + 10.042627487971913, + 10.141143427987117, + 10.235656292003114, + 10.331206785980612, + 10.431236937001813, + 10.531898871995509, + 10.627403956954367, + 10.72327450296143, + 10.818491327983793, + 10.920263756997883, + 11.026724822993856, + 11.122508887958247, + 11.218795166991185, + 11.315228471998125, + 11.416411549958866, + 11.517955079965759, + 11.589874165947549 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.39242650195956, + "p95": 102.92590101016685, + "max": 671.1591989733279 + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.48, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/drafted.json b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/drafted.json new file mode 100644 index 00000000000..9b7d6c262d2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/drafted.json @@ -0,0 +1,150 @@ +[ + { + "label": "drafted", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 256, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 44.445788089871925, + "decode_tps_all": [ + 44.01, + 44.45, + 44.75 + ], + "ttft_s_median": 0.12872370897093788, + "prompt_ttft_tps_median": 108.76, + "prefill_tps_median": 108.76, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 22.499, + "round_gap_p50_ms_median": 67.324, + "round_gap_p95_ms_median": 78.714, + "tokens_per_chunk_median": 2.977, + "headers_s_median": 0.001, + "first_payload_s_median": 0.129, + "first_content_s_median": 0.129, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.129, + "last_output_s_median": 5.866, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "drafted", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 256, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 35.29439596221889, + "decode_tps_all": [ + 33.4, + 35.64, + 35.29 + ], + "ttft_s_median": 0.19703249097801745, + "prompt_ttft_tps_median": 162.41, + "prefill_tps_median": 162.41, + "itl_mean_ms_median": null, + "itl_p50_ms_median": null, + "itl_p95_ms_median": null, + "tpot_ms_median": null, + "chunk_tpot_estimate_ms_median": 28.333, + "round_gap_p50_ms_median": 58.449, + "round_gap_p95_ms_median": 68.501, + "tokens_per_chunk_median": 2.065, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.197, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.197, + "last_output_s_median": 7.422, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/form.txt new file mode 100644 index 00000000000..63282183789 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/dh2/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/nodraft.json new file mode 100644 index 00000000000..87b6a78b62c --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.60381476273391, + "decode_tps_all": [ + 24.6, + 24.53, + 24.61 + ], + "ttft_s_median": 0.12322956597199664, + "prompt_ttft_tps_median": 113.609, + "prefill_tps_median": 113.609, + "itl_mean_ms_median": 40.644, + "itl_p50_ms_median": 40.454, + "itl_p95_ms_median": 41.427, + "tpot_ms_median": 40.644, + "chunk_tpot_estimate_ms_median": 40.644, + "round_gap_p50_ms_median": 40.454, + "round_gap_p95_ms_median": 41.427, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.123, + "first_content_s_median": 0.123, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.123, + "last_output_s_median": 5.285, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.584260949583125, + "decode_tps_all": [ + 24.59, + 23.67, + 24.58 + ], + "ttft_s_median": 0.18946075002895668, + "prompt_ttft_tps_median": 168.9, + "prefill_tps_median": 168.9, + "itl_mean_ms_median": 40.676, + "itl_p50_ms_median": 40.504, + "itl_p95_ms_median": 41.816, + "tpot_ms_median": 40.676, + "chunk_tpot_estimate_ms_median": 40.676, + "round_gap_p50_ms_median": 40.504, + "round_gap_p95_ms_median": 41.816, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.189, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.189, + "last_output_s_median": 5.354, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill32768.json new file mode 100644 index 00000000000..7dcc8b6bb69 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.286430164997, + "decode_tps": 33.24151053019741, + "elapsed_s": 22.73778372601373, + "chunk_offsets_s": [ + 22.286430164997, + 22.377605916000903, + 22.461681422020774, + 22.546602313988842, + 22.630943695025053, + 22.68580264801858, + 22.737673196999822 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 84.20844352804124, + "p95": 91.1757510039024, + "max": 91.1757510039024 + }, + "completion": "truncated", + "headers_s": 0.015476198983378708, + "first_payload_s": 15.06891062197974, + "first_output_s": 22.286430164997, + "last_output_s": 22.737673196999822, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.829559109988622, + "decode_tps": 32.09013394629873, + "elapsed_s": 23.29717262700433, + "chunk_offsets_s": [ + 22.829559109988622, + 22.928573318000417, + 23.021615056029987, + 23.108819893037435, + 23.18778839299921, + 23.246356475981884, + 23.29699249699479 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 83.08666848461144, + "p95": 99.01420801179484, + "max": 99.01420801179484 + }, + "completion": "truncated", + "headers_s": 0.0036206350196152925, + "first_payload_s": 15.055489986028988, + "first_output_s": 22.829559109988622, + "last_output_s": 23.29699249699479, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.849801881005988, + "decode_tps": 33.07527817555566, + "elapsed_s": 23.30345888697775, + "chunk_offsets_s": [ + 22.849801881005988, + 22.942640125984326, + 23.027796792972367, + 23.112233115010895, + 23.19694273697678, + 23.251934505009558, + 23.303312806005124 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 84.57297200220637, + "p95": 92.83824497833848, + "max": 92.83824497833848 + }, + "completion": "truncated", + "headers_s": 0.002423676021862775, + "first_payload_s": 15.061762390017975, + "first_output_s": 22.849801881005988, + "last_output_s": 23.303312806005124, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 46.02489283401519, + "decode_tps": 31.369780671320246, + "elapsed_s": 46.50320897396887, + "chunk_offsets_s": [ + 46.02489283401519, + 46.134296868985984, + 46.23367267497815, + 46.32337102398742, + 46.38908569898922, + 46.451504462980665, + 46.50306002801517 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 77.70651200553402, + "p95": 109.40403497079387, + "max": 109.40403497079387 + }, + "completion": "truncated", + "headers_s": 0.002390395966358483, + "first_payload_s": 15.076779439987149, + "first_output_s": 46.02489283401519, + "last_output_s": 46.50306002801517, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.316477881046012, + "decode_tps": 1.789581246532782, + "elapsed_s": 30.698434876045212, + "chunk_offsets_s": [ + 22.316477881046012, + 22.413821169000585, + 23.887623629008885, + 26.09680516005028, + 27.645906580029987, + 29.176543364010286, + 30.69832700304687 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1526.2102115084417, + "p95": 2209.181531041395, + "max": 2209.181531041395 + }, + "completion": "truncated", + "headers_s": 0.002386076026596129, + "first_payload_s": 15.076760672032833, + "first_output_s": 22.316477881046012, + "last_output_s": 30.69832700304687, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.50329556700308, + "end_to_end_tps": 0.6881232740568595, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill8192.json new file mode 100644 index 00000000000..605e01d6040 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb1/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.666089219972491, + "decode_tps": 38.03890206819363, + "elapsed_s": 6.060546048975084, + "chunk_offsets_s": [ + 5.666089219972491, + 5.743883504008409, + 5.81777433399111, + 5.887220742995851, + 5.9513982409844175, + 6.010510127001908, + 6.060422367998399 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.81195349665359, + "p95": 77.79428403591737, + "max": 77.79428403591737 + }, + "completion": "truncated", + "headers_s": 0.01429005799582228, + "first_payload_s": 5.666089219972491, + "first_output_s": 5.666089219972491, + "last_output_s": 6.060422367998399, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.675583403964993, + "decode_tps": 35.0593196089649, + "elapsed_s": 6.103569043974858, + "chunk_offsets_s": [ + 5.675583403964993, + 5.7629857059801, + 5.845805424964055, + 5.921865894983057, + 5.9934210809879005, + 6.05293194699334, + 6.103429698967375 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 73.80782801192254, + "p95": 87.40230201510713, + "max": 87.40230201510713 + }, + "completion": "truncated", + "headers_s": 0.0014456809731200337, + "first_payload_s": 5.675583403964993, + "first_output_s": 5.675583403964993, + "last_output_s": 6.103429698967375, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.662134853017051, + "decode_tps": 35.401972713747725, + "elapsed_s": 6.085968072991818, + "chunk_offsets_s": [ + 5.662134853017051, + 5.746601470978931, + 5.832533849985339, + 5.90258154500043, + 5.968635081022512, + 6.034853097982705, + 6.085840055020526 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 68.13285598764196, + "p95": 85.93237900640815, + "max": 85.93237900640815 + }, + "completion": "truncated", + "headers_s": 0.0015971229877322912, + "first_payload_s": 5.662134853017051, + "first_output_s": 5.662134853017051, + "last_output_s": 6.085840055020526, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.657070721965283, + "decode_tps": 2.1562366665351234, + "elapsed_s": 12.61374248797074, + "chunk_offsets_s": [ + 5.657070721965283, + 5.734768747992348, + 7.662175548961386, + 9.413265440962277, + 10.943226244999096, + 12.520296723989304, + 12.613635477959178 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1553.5156415135134, + "p95": 1927.4068009690382, + "max": 1927.4068009690382 + }, + "completion": "truncated", + "headers_s": 0.001647955970838666, + "first_payload_s": 5.657070721965283, + "first_output_s": 5.657070721965283, + "last_output_s": 12.613635477959178, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.410042441973928, + "decode_tps": 30.720735427761753, + "elapsed_s": 12.898424563987646, + "chunk_offsets_s": [ + 12.410042441973928, + 12.520586999948137, + 12.614610289980192, + 12.682256754953414, + 12.737732260953635, + 12.793165060982574, + 12.846668670943473, + 12.898312002944294 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 55.475506000220776, + "p95": 110.54455797420815, + "max": 110.54455797420815 + }, + "completion": "truncated", + "headers_s": 0.0018774299533106387, + "first_payload_s": 12.410042441973928, + "first_output_s": 12.410042441973928, + "last_output_s": 12.898312002944294, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.898424563987646, + "end_to_end_tps": 2.4809231422994, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/nodraft.json new file mode 100644 index 00000000000..d2fff291ddb --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.377577749562217, + "decode_tps_all": [ + 24.43, + 22.01, + 24.38 + ], + "ttft_s_median": 0.12456968001788482, + "prompt_ttft_tps_median": 112.387, + "prefill_tps_median": 112.387, + "itl_mean_ms_median": 41.021, + "itl_p50_ms_median": 40.834, + "itl_p95_ms_median": 41.779, + "tpot_ms_median": 41.021, + "chunk_tpot_estimate_ms_median": 41.021, + "round_gap_p50_ms_median": 40.834, + "round_gap_p95_ms_median": 41.779, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.125, + "first_content_s_median": 0.125, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.125, + "last_output_s_median": 5.333, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.390921503535232, + "decode_tps_all": [ + 24.4, + 24.39, + 24.38 + ], + "ttft_s_median": 0.1899177379673347, + "prompt_ttft_tps_median": 168.494, + "prefill_tps_median": 168.494, + "itl_mean_ms_median": 40.999, + "itl_p50_ms_median": 40.805, + "itl_p95_ms_median": 41.858, + "tpot_ms_median": 40.999, + "chunk_tpot_estimate_ms_median": 40.999, + "round_gap_p50_ms_median": 40.805, + "round_gap_p95_ms_median": 41.858, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.19, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.19, + "last_output_s_median": 5.396, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill32768.json new file mode 100644 index 00000000000..9fcfd84b761 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.798355424951296, + "decode_tps": 36.40757708430278, + "elapsed_s": 23.210583961976226, + "chunk_offsets_s": [ + 22.798355424951296, + 22.88040020695189, + 22.958598398952745, + 23.032035903946962, + 23.103051849990152, + 23.157642567995936, + 23.210357573989313 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 72.22672551870346, + "p95": 82.04478200059384, + "max": 82.04478200059384 + }, + "completion": "truncated", + "headers_s": 0.016730852948967367, + "first_payload_s": 15.105431033996865, + "first_output_s": 22.798355424951296, + "last_output_s": 23.210357573989313, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.830203300982248, + "decode_tps": 36.790537435754615, + "elapsed_s": 23.248149127990473, + "chunk_offsets_s": [ + 22.830203300982248, + 22.91259868402267, + 22.986780318024103, + 23.061047600989696, + 23.131338451988995, + 23.18633780698292, + 23.23791683401214 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 72.23624250036664, + "p95": 82.39538304042071, + "max": 82.39538304042071 + }, + "completion": "truncated", + "headers_s": 0.0034750010236166418, + "first_payload_s": 15.101743503997568, + "first_output_s": 22.830203300982248, + "last_output_s": 23.23791683401214, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.222646192007232, + "decode_tps": 36.466768806085554, + "elapsed_s": 22.63410103402566, + "chunk_offsets_s": [ + 22.222646192007232, + 22.30566865997389, + 22.380789624992758, + 22.453923726978246, + 22.526096116984263, + 22.582321594993118, + 22.633979592006654 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 72.65324599575251, + "p95": 83.02246796665713, + "max": 83.02246796665713 + }, + "completion": "truncated", + "headers_s": 0.003310566011350602, + "first_payload_s": 15.09017235902138, + "first_output_s": 22.222646192007232, + "last_output_s": 22.633979592006654, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 46.54878388898214, + "decode_tps": 30.63520148089233, + "elapsed_s": 47.038514355022926, + "chunk_offsets_s": [ + 46.54878388898214, + 46.65654985897709, + 46.75692324800184, + 46.849692564981524, + 46.92348310298985, + 46.985511520004366, + 47.03841670596739 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 83.27992749400437, + "p95": 107.76596999494359, + "max": 107.76596999494359 + }, + "completion": "truncated", + "headers_s": 0.003366229997482151, + "first_payload_s": 15.07839493197389, + "first_output_s": 46.54878388898214, + "last_output_s": 47.03841670596739, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.76279740902828, + "decode_tps": 1.8970493970785487, + "elapsed_s": 30.67017986398423, + "chunk_offsets_s": [ + 22.76279740902828, + 22.844636358029675, + 24.301119891984854, + 26.068106374994386, + 27.62058045901358, + 29.1441337330034, + 30.66981344303349 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1524.6164920099545, + "p95": 1766.986483009532, + "max": 1766.986483009532 + }, + "completion": "truncated", + "headers_s": 0.0031232989858835936, + "first_payload_s": 15.063734043040313, + "first_output_s": 22.76279740902828, + "last_output_s": 30.66981344303349, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 47.0386015890399, + "end_to_end_tps": 0.6802923326584622, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill8192.json new file mode 100644 index 00000000000..4f051f96fc2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fb2/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 6.223041435005143, + "decode_tps": 37.831109317038035, + "elapsed_s": 6.619680628995411, + "chunk_offsets_s": [ + 6.223041435005143, + 6.300005921977572, + 6.375147690996528, + 6.445543123991229, + 6.509575203002896, + 6.56942373997299, + 6.619540513958782 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 67.21375600318424, + "p95": 76.96448697242886, + "max": 76.96448697242886 + }, + "completion": "truncated", + "headers_s": 0.01491085800807923, + "first_payload_s": 6.223041435005143, + "first_output_s": 6.223041435005143, + "last_output_s": 6.619540513958782, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.658556143986061, + "decode_tps": 35.45756358526228, + "elapsed_s": 6.081693984975573, + "chunk_offsets_s": [ + 5.658556143986061, + 5.748083236976527, + 5.831138957990333, + 5.906374036974739, + 5.969416223990265, + 6.029591259954032, + 6.081597054959275 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 69.13863299996592, + "p95": 89.52709299046546, + "max": 89.52709299046546 + }, + "completion": "truncated", + "headers_s": 0.0015442019794136286, + "first_payload_s": 5.658556143986061, + "first_output_s": 5.658556143986061, + "last_output_s": 6.081597054959275, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.6516286710393615, + "decode_tps": 37.245953361157305, + "elapsed_s": 6.054498459037859, + "chunk_offsets_s": [ + 5.6516286710393615, + 5.744870349997655, + 5.816981069045141, + 5.8799726130091585, + 5.94417292799335, + 6.00410235702293, + 6.0543569850269705 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 63.595929474104196, + "p95": 93.24167895829305, + "max": 93.24167895829305 + }, + "completion": "truncated", + "headers_s": 0.0015213530277833343, + "first_payload_s": 5.6516286710393615, + "first_output_s": 5.6516286710393615, + "last_output_s": 6.0543569850269705, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 11.964773688989226, + "decode_tps": 30.791172148556512, + "elapsed_s": 12.452038480958436, + "chunk_offsets_s": [ + 11.964773688989226, + 12.065529451007023, + 12.171043115959037, + 12.260047146992292, + 12.334097090992145, + 12.401528702001087, + 12.4519263029797 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 81.52698751655407, + "p95": 105.51366495201364, + "max": 105.51366495201364 + }, + "completion": "truncated", + "headers_s": 0.001580810989253223, + "first_payload_s": 11.964773688989226, + "first_output_s": 11.964773688989226, + "last_output_s": 12.4519263029797, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.657714940025471, + "decode_tps": 2.2720782215616593, + "elapsed_s": 12.259669300052337, + "chunk_offsets_s": [ + 5.657714940025471, + 5.732503876031842, + 7.205439846031368, + 8.964701566030271, + 10.494426022050902, + 12.065669997013174, + 12.171341728011612, + 12.259600323042832 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 1472.9359699995257, + "p95": 1759.2617199989036, + "max": 1759.2617199989036 + }, + "completion": "truncated", + "headers_s": 0.0018156300066038966, + "first_payload_s": 5.657714940025471, + "first_output_s": 5.657714940025471, + "last_output_s": 12.259600323042832, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.452127202006523, + "end_to_end_tps": 2.5698420423173602, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/form.txt new file mode 100644 index 00000000000..63282183789 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/nodraft.json new file mode 100644 index 00000000000..5a42a88ded2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 26.113584306542744, + "decode_tps_all": [ + 26.12, + 26.07, + 26.11 + ], + "ttft_s_median": 0.12064716697204858, + "prompt_ttft_tps_median": 116.041, + "prefill_tps_median": 116.041, + "itl_mean_ms_median": 38.294, + "itl_p50_ms_median": 38.131, + "itl_p95_ms_median": 39.047, + "tpot_ms_median": 38.294, + "chunk_tpot_estimate_ms_median": 38.294, + "round_gap_p50_ms_median": 38.131, + "round_gap_p95_ms_median": 39.047, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.121, + "first_content_s_median": 0.121, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.121, + "last_output_s_median": 4.983, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 26.08834937363869, + "decode_tps_all": [ + 26.09, + 24.77, + 26.12 + ], + "ttft_s_median": 0.18816409399732947, + "prompt_ttft_tps_median": 170.064, + "prefill_tps_median": 170.064, + "itl_mean_ms_median": 38.331, + "itl_p50_ms_median": 38.132, + "itl_p95_ms_median": 39.411, + "tpot_ms_median": 38.331, + "chunk_tpot_estimate_ms_median": 38.331, + "round_gap_p50_ms_median": 38.132, + "round_gap_p95_ms_median": 39.411, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.009, + "first_payload_s_median": 0.009, + "first_content_s_median": 0.188, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.188, + "last_output_s_median": 5.055, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill32768.json new file mode 100644 index 00000000000..743c316a260 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.156633612001315, + "decode_tps": 38.089335723959444, + "elapsed_s": 22.55052395700477, + "chunk_offsets_s": [ + 22.156633612001315, + 22.23729382798774, + 22.31030411500251, + 22.381143848004285, + 22.448819048993755, + 22.50213072396582, + 22.550444627995603 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 69.25746699562296, + "p95": 80.66021598642692, + "max": 80.66021598642692 + }, + "completion": "truncated", + "headers_s": 0.1099446369917132, + "first_payload_s": 15.177726488967892, + "first_output_s": 22.156633612001315, + "last_output_s": 22.550444627995603, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.580305251001846, + "decode_tps": 38.547225183836076, + "elapsed_s": 22.96952612802852, + "chunk_offsets_s": [ + 22.580305251001846, + 22.6589943220024, + 22.730619487992954, + 22.80121483403491, + 22.868515806039795, + 22.921203695994336, + 22.96943831903627 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 68.94815902342089, + "p95": 78.68907100055367, + "max": 78.68907100055367 + }, + "completion": "truncated", + "headers_s": 0.002585517999250442, + "first_payload_s": 15.057179086026736, + "first_output_s": 22.580305251001846, + "last_output_s": 22.96943831903627, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.6243405410205, + "decode_tps": 38.344601289468024, + "elapsed_s": 23.015612637042068, + "chunk_offsets_s": [ + 22.6243405410205, + 22.703928102040663, + 22.776055097056087, + 22.847832791041583, + 22.914527995046228, + 22.96720906900009, + 23.01552990003256 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 69.23644899507053, + "p95": 79.58756102016196, + "max": 79.58756102016196 + }, + "completion": "truncated", + "headers_s": 0.0045166610507294536, + "first_payload_s": 15.076094363001175, + "first_output_s": 22.6243405410205, + "last_output_s": 23.01552990003256, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 45.61006512201857, + "decode_tps": 31.767710099888134, + "elapsed_s": 46.082409184018616, + "chunk_offsets_s": [ + 45.61006512201857, + 45.71475423499942, + 45.811848683981225, + 45.90203574200859, + 45.972575708001386, + 46.03321586397942, + 46.08224268699996 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.36351201008074, + "p95": 104.68911298085004, + "max": 104.68911298085004 + }, + "completion": "truncated", + "headers_s": 0.0036557060084305704, + "first_payload_s": 15.080546471988782, + "first_output_s": 45.61006512201857, + "last_output_s": 46.08224268699996, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.050418075989, + "decode_tps": 1.7937188627005327, + "elapsed_s": 30.413022945984267, + "chunk_offsets_s": [ + 22.050418075989, + 22.129518734000158, + 23.57789870799752, + 25.335807872994337, + 27.38699036295293, + 28.89586261496879, + 30.412932576960884 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1512.9711070039775, + "p95": 2051.1824899585918, + "max": 2051.1824899585918 + }, + "completion": "truncated", + "headers_s": 0.002579709980636835, + "first_payload_s": 15.095716823998373, + "first_output_s": 22.050418075989, + "last_output_s": 30.412932576960884, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.08265609899536, + "end_to_end_tps": 0.6944044182535223, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill8192.json new file mode 100644 index 00000000000..54aa54a28ac --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh1/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.606050344998948, + "decode_tps": 39.32104199591863, + "elapsed_s": 5.98760787001811, + "chunk_offsets_s": [ + 5.606050344998948, + 5.6805874520214275, + 5.753491148003377, + 5.819975232996512, + 5.881519099988509, + 5.939730754005723, + 5.9875254849903286 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 64.01397599256597, + "p95": 74.53710702247918, + "max": 74.53710702247918 + }, + "completion": "truncated", + "headers_s": 0.01518571301130578, + "first_payload_s": 5.606050344998948, + "first_output_s": 5.606050344998948, + "last_output_s": 5.9875254849903286, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.608893730968703, + "decode_tps": 33.54161940710437, + "elapsed_s": 6.056199634971563, + "chunk_offsets_s": [ + 5.608893730968703, + 5.695616131008137, + 5.775173311994877, + 5.844591222994495, + 5.897423341986723, + 5.952406524971593, + 6.008614777994808, + 6.0560993300168775 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 56.20825302321464, + "p95": 86.72240003943443, + "max": 86.72240003943443 + }, + "completion": "truncated", + "headers_s": 0.0013412319822236896, + "first_payload_s": 5.608893730968703, + "first_output_s": 5.608893730968703, + "last_output_s": 6.0560993300168775, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.612323555978946, + "decode_tps": 38.38968743783485, + "elapsed_s": 6.003157425962854, + "chunk_offsets_s": [ + 5.612323555978946, + 5.698361323971767, + 5.773873817990534, + 5.8336181119666435, + 5.8958444349700585, + 5.9542413059971295, + 6.003053488966543 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 60.98530848976225, + "p95": 86.03776799282059, + "max": 86.03776799282059 + }, + "completion": "truncated", + "headers_s": 0.0020536559750325978, + "first_payload_s": 5.612323555978946, + "first_output_s": 5.612323555978946, + "last_output_s": 6.003053488966543, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.326738389965612, + "decode_tps": 33.482470358622905, + "elapsed_s": 12.774862202000804, + "chunk_offsets_s": [ + 12.326738389965612, + 12.433021463977639, + 12.523055469966494, + 12.591503671952523, + 12.663018534949515, + 12.726276693982072, + 12.774734007951338 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 69.98153249151073, + "p95": 106.28307401202619, + "max": 106.28307401202619 + }, + "completion": "truncated", + "headers_s": 0.001688691962044686, + "first_payload_s": 12.326738389965612, + "first_output_s": 12.326738389965612, + "last_output_s": 12.774734007951338, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.606450361025054, + "decode_tps": 2.1689460153302766, + "elapsed_s": 12.522338549024425, + "chunk_offsets_s": [ + 5.606450361025054, + 5.692562242038548, + 7.136775387043599, + 9.352881753991824, + 10.873399798991159, + 12.43299212004058, + 12.522251812042668 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1482.365595002193, + "p95": 2216.1063669482246, + "max": 2216.1063669482246 + }, + "completion": "truncated", + "headers_s": 0.00128988700453192, + "first_payload_s": 5.606450361025054, + "first_output_s": 5.606450361025054, + "last_output_s": 12.522251812042668, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.774962571042124, + "end_to_end_tps": 2.504899706910811, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/form.txt new file mode 100644 index 00000000000..63282183789 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/nodraft.json new file mode 100644 index 00000000000..8cc28a8c9d0 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 26.198163070778747, + "decode_tps_all": [ + 26.31, + 26.2, + 26.18 + ], + "ttft_s_median": 0.1232677529915236, + "prompt_ttft_tps_median": 113.574, + "prefill_tps_median": 113.574, + "itl_mean_ms_median": 38.171, + "itl_p50_ms_median": 38.013, + "itl_p95_ms_median": 38.839, + "tpot_ms_median": 38.171, + "chunk_tpot_estimate_ms_median": 38.171, + "round_gap_p50_ms_median": 38.013, + "round_gap_p95_ms_median": 38.839, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.123, + "first_content_s_median": 0.123, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.123, + "last_output_s_median": 4.971, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 26.18607064114267, + "decode_tps_all": [ + 26.19, + 24.36, + 26.26 + ], + "ttft_s_median": 0.1882438440225087, + "prompt_ttft_tps_median": 169.992, + "prefill_tps_median": 169.992, + "itl_mean_ms_median": 38.188, + "itl_p50_ms_median": 38.029, + "itl_p95_ms_median": 38.863, + "tpot_ms_median": 38.188, + "chunk_tpot_estimate_ms_median": 38.188, + "round_gap_p50_ms_median": 38.029, + "round_gap_p95_ms_median": 38.863, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.188, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.188, + "last_output_s_median": 5.037, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill32768.json new file mode 100644 index 00000000000..e6874397be3 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.084535534959286, + "decode_tps": 34.63868413936798, + "elapsed_s": 22.517748127982486, + "chunk_offsets_s": [ + 22.084535534959286, + 22.174187015974894, + 22.255206222995184, + 22.336674958001822, + 22.416904756973963, + 22.469812344992533, + 22.517577388964128 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.6245029962156, + "p95": 89.65148101560771, + "max": 89.65148101560771 + }, + "completion": "truncated", + "headers_s": 0.015534873004071414, + "first_payload_s": 15.067898824985605, + "first_output_s": 22.084535534959286, + "last_output_s": 22.517577388964128, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.733488850004505, + "decode_tps": 33.621548982133135, + "elapsed_s": 23.179772944014985, + "chunk_offsets_s": [ + 22.733488850004505, + 22.828566454991233, + 22.918321706005372, + 23.002595366036985, + 23.078195873997174, + 23.131458815012593, + 23.1796312929946 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 79.93708399590105, + "p95": 95.07760498672724, + "max": 95.07760498672724 + }, + "completion": "truncated", + "headers_s": 0.011658716015517712, + "first_payload_s": 15.098899914009962, + "first_output_s": 22.733488850004505, + "last_output_s": 23.1796312929946, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.990929754974786, + "decode_tps": 34.03303027568661, + "elapsed_s": 23.431756081001367, + "chunk_offsets_s": [ + 22.990929754974786, + 23.08643227099674, + 23.174465194984805, + 23.25401425099699, + 23.331532949989196, + 23.38353004597593, + 23.43167804798577 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 78.53387750219554, + "p95": 95.50251602195203, + "max": 95.50251602195203 + }, + "completion": "truncated", + "headers_s": 0.00408513197908178, + "first_payload_s": 15.057081584003754, + "first_output_s": 22.990929754974786, + "last_output_s": 23.43167804798577, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.08348389301682, + "decode_tps": 1.7024485407399408, + "elapsed_s": 30.89443928003311, + "chunk_offsets_s": [ + 22.08348389301682, + 22.171513259003405, + 23.631791449035518, + 25.521537154039834, + 27.872153265052475, + 29.380723422043957, + 30.894322894047946 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1511.0848144977354, + "p95": 2350.6161110126413, + "max": 2350.6161110126413 + }, + "completion": "truncated", + "headers_s": 0.0025522230425849557, + "first_payload_s": 15.072912603034638, + "first_output_s": 22.08348389301682, + "last_output_s": 30.894322894047946, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 46.100334226037376, + "decode_tps": 32.61645326498144, + "elapsed_s": 46.56030901201302, + "chunk_offsets_s": [ + 46.100334226037376, + 46.20630862604594, + 46.30247966700699, + 46.38855811202666, + 46.451681300008204, + 46.51193651801441, + 46.560224818007555 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 74.60081650060602, + "p95": 105.97440000856295, + "max": 105.97440000856295 + }, + "completion": "truncated", + "headers_s": 0.003851815010420978, + "first_payload_s": 15.08450423803879, + "first_output_s": 46.100334226037376, + "last_output_s": 46.560224818007555, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.56030901201302, + "end_to_end_tps": 0.687280661984947, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill8192.json new file mode 100644 index 00000000000..e7905d99ad6 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/fh2/prefill8192.json @@ -0,0 +1,207 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.609953920997214, + "decode_tps": 39.556276470729905, + "elapsed_s": 5.999212144990452, + "chunk_offsets_s": [ + 5.609953920997214, + 5.6845790519728325, + 5.7561750679742545, + 5.823141137952916, + 5.883627529954538, + 5.94084896199638, + 5.989160492958035 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 63.72623099014163, + "p95": 74.62513097561896, + "max": 74.62513097561896 + }, + "completion": "truncated", + "headers_s": 0.015052261995151639, + "first_payload_s": 5.609953920997214, + "first_output_s": 5.609953920997214, + "last_output_s": 5.989160492958035, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.615248826041352, + "decode_tps": 37.239032587334385, + "elapsed_s": 6.018160468025599, + "chunk_offsets_s": [ + 5.615248826041352, + 5.701051880023442, + 5.781005972006824, + 5.853108520037495, + 5.913496905006468, + 5.969995247025508, + 6.018051986000501 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.24546649982221, + "p95": 85.8030539820902, + "max": 85.8030539820902 + }, + "completion": "truncated", + "headers_s": 0.0010915890452452004, + "first_payload_s": 5.615248826041352, + "first_output_s": 5.615248826041352, + "last_output_s": 6.018051986000501, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.600627880019601, + "decode_tps": 36.540733042676315, + "elapsed_s": 6.011207014031243, + "chunk_offsets_s": [ + 5.600627880019601, + 5.66578705603024, + 5.731748104037251, + 5.795155359024648, + 5.8523547340300865, + 5.904793617024552, + 5.963450109004043, + 6.011128676007502 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 58.656491979490966, + "p95": 65.96104800701141, + "max": 65.96104800701141 + }, + "completion": "truncated", + "headers_s": 0.0012170320260338485, + "first_payload_s": 5.600627880019601, + "first_output_s": 5.600627880019601, + "last_output_s": 6.011128676007502, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.45035633695079, + "decode_tps": 32.14872896819095, + "elapsed_s": 12.917183485988062, + "chunk_offsets_s": [ + 12.45035633695079, + 12.558323536999524, + 12.64953500899719, + 12.71507350995671, + 12.767194505955558, + 12.819117322971579, + 12.869300617952831, + 12.916937768983189 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 52.12099599884823, + "p95": 107.9672000487335, + "max": 107.9672000487335 + }, + "completion": "truncated", + "headers_s": 0.002142936980817467, + "first_payload_s": 12.45035633695079, + "first_output_s": 12.45035633695079, + "last_output_s": 12.916937768983189, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.6059290819684975, + "decode_tps": 2.129693098465769, + "elapsed_s": 12.649287707987241, + "chunk_offsets_s": [ + 5.6059290819684975, + 5.681432164972648, + 7.126299184979871, + 9.473053956986405, + 10.990114816988353, + 12.559148913016543, + 12.649197434016969 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1480.9639400045853, + "p95": 2346.754772006534, + "max": 2346.754772006534 + }, + "completion": "truncated", + "headers_s": 0.002507583994884044, + "first_payload_s": 5.6059290819684975, + "first_output_s": 5.6059290819684975, + "last_output_s": 12.649197434016969, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.917845115007367, + "end_to_end_tps": 2.4771933488213023, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/foff/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/form.txt new file mode 100644 index 00000000000..63282183789 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/foff/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/nodraft.json new file mode 100644 index 00000000000..cc3ef9e606b --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.207537704394973, + "decode_tps_all": [ + 24.26, + 24.21, + 22.97 + ], + "ttft_s_median": 0.1232421129825525, + "prompt_ttft_tps_median": 113.598, + "prefill_tps_median": 113.598, + "itl_mean_ms_median": 41.309, + "itl_p50_ms_median": 41.119, + "itl_p95_ms_median": 42.124, + "tpot_ms_median": 41.309, + "chunk_tpot_estimate_ms_median": 41.309, + "round_gap_p50_ms_median": 41.119, + "round_gap_p95_ms_median": 42.124, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.123, + "first_content_s_median": 0.123, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.123, + "last_output_s_median": 5.37, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.207881320521533, + "decode_tps_all": [ + 24.23, + 23.12, + 24.21 + ], + "ttft_s_median": 0.19073517801007256, + "prompt_ttft_tps_median": 167.772, + "prefill_tps_median": 167.772, + "itl_mean_ms_median": 41.309, + "itl_p50_ms_median": 41.144, + "itl_p95_ms_median": 42.018, + "tpot_ms_median": 41.309, + "chunk_tpot_estimate_ms_median": 41.309, + "round_gap_p50_ms_median": 41.144, + "round_gap_p95_ms_median": 42.018, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.002, + "first_payload_s_median": 0.002, + "first_content_s_median": 0.191, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.191, + "last_output_s_median": 5.437, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill32768.json new file mode 100644 index 00000000000..e4eedd338ab --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill32768.json @@ -0,0 +1,207 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.742185409995727, + "decode_tps": 34.494498328170245, + "elapsed_s": 23.177160165971145, + "chunk_offsets_s": [ + 22.742185409995727, + 22.828303974005394, + 22.89876211201772, + 22.98224839597242, + 23.06240055098897, + 23.126000906981062, + 23.177037363988347 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 75.30514651443809, + "p95": 86.11856400966644, + "max": 86.11856400966644 + }, + "completion": "truncated", + "headers_s": 0.015355414012447, + "first_payload_s": 15.075774426979478, + "first_output_s": 22.742185409995727, + "last_output_s": 23.177037363988347, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 23.197398165008053, + "decode_tps": 29.66818924961744, + "elapsed_s": 23.703100819024257, + "chunk_offsets_s": [ + 23.197398165008053, + 23.289082162023988, + 23.369805436988827, + 23.439595702977385, + 23.52133784099715, + 23.587370097986422, + 23.65006373001961, + 23.702990194025915 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 69.79026598855853, + "p95": 91.68399701593444, + "max": 91.68399701593444 + }, + "completion": "truncated", + "headers_s": 0.003743496024981141, + "first_payload_s": 15.060175082006026, + "first_output_s": 23.197398165008053, + "last_output_s": 23.702990194025915, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.73893128405325, + "decode_tps": 29.602772591750348, + "elapsed_s": 23.2457619390334, + "chunk_offsets_s": [ + 22.73893128405325, + 22.83013784105424, + 22.90945921605453, + 22.97995890903985, + 23.060196682054084, + 23.127058721031062, + 23.19023945904337, + 23.245640578039456 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 70.49969298532233, + "p95": 91.20655700098723, + "max": 91.20655700098723 + }, + "completion": "truncated", + "headers_s": 0.00405494001461193, + "first_payload_s": 15.081157723034266, + "first_output_s": 22.73893128405325, + "last_output_s": 23.245640578039456, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 46.95676834601909, + "decode_tps": 31.067343179784118, + "elapsed_s": 47.439699043985456, + "chunk_offsets_s": [ + 46.95676834601909, + 47.06582796300063, + 47.16652118600905, + 47.258755885995924, + 47.33140569401439, + 47.38736244302709, + 47.439590450027026 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 82.44225400267169, + "p95": 109.05961698153988, + "max": 109.05961698153988 + }, + "completion": "truncated", + "headers_s": 0.0036318780039437115, + "first_payload_s": 15.071574790985323, + "first_output_s": 46.95676834601909, + "last_output_s": 47.439590450027026, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.77658425096888, + "decode_tps": 1.7834127357389595, + "elapsed_s": 31.18753169197589, + "chunk_offsets_s": [ + 22.77658425096888, + 22.86884155200096, + 24.346892070956528, + 26.140768876008224, + 28.119549071998335, + 29.656478868972044, + 31.187424713978544 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1533.9378209901042, + "p95": 1978.7801959901117, + "max": 1978.7801959901117 + }, + "completion": "truncated", + "headers_s": 0.0025595739716663957, + "first_payload_s": 15.074469936953392, + "first_output_s": 22.77658425096888, + "last_output_s": 31.187424713978544, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 47.43983389396453, + "end_to_end_tps": 0.6745386181478843, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill8192.json new file mode 100644 index 00000000000..aac1b02c89e --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/foff/prefill8192.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.681075303000398, + "decode_tps": 37.387573511286455, + "elapsed_s": 6.082377599028405, + "chunk_offsets_s": [ + 5.681075303000398, + 5.761033057002351, + 5.836008223006502, + 5.905979249975644, + 5.970598178973887, + 6.030410235980526, + 6.082278124988079 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 67.29497798369266, + "p95": 79.95775400195271, + "max": 79.95775400195271 + }, + "completion": "truncated", + "headers_s": 0.01938383001834154, + "first_payload_s": 5.681075303000398, + "first_output_s": 5.681075303000398, + "last_output_s": 6.082278124988079, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 6.080285981995985, + "decode_tps": 34.52185235606491, + "elapsed_s": 6.514922175032552, + "chunk_offsets_s": [ + 6.080285981995985, + 6.17101387999719, + 6.254390818008687, + 6.330324957030825, + 6.396860520995688, + 6.462934606010094, + 6.514793373004068 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 71.23485149350017, + "p95": 90.72789800120518, + "max": 90.72789800120518 + }, + "completion": "truncated", + "headers_s": 0.0020536790252663195, + "first_payload_s": 6.080285981995985, + "first_output_s": 6.080285981995985, + "last_output_s": 6.514793373004068, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.67207818798488, + "decode_tps": 34.7188546510932, + "elapsed_s": 6.10428334097378, + "chunk_offsets_s": [ + 5.67207818798488, + 5.764944676018786, + 5.84026161802467, + 5.912164861976635, + 5.986326907004695, + 6.053552000026684, + 6.104120090021752 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 73.0326444900129, + "p95": 92.86648803390563, + "max": 92.86648803390563 + }, + "completion": "truncated", + "headers_s": 0.0012228019768372178, + "first_payload_s": 5.67207818798488, + "first_output_s": 5.67207818798488, + "last_output_s": 6.104120090021752, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.428530168021098, + "decode_tps": 33.08111431686795, + "elapsed_s": 12.882067071041092, + "chunk_offsets_s": [ + 12.428530168021098, + 12.539912672014907, + 12.634930338012055, + 12.705362019012682, + 12.769596791011281, + 12.830440280027688, + 12.881961085018702 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 67.33322649961337, + "p95": 111.38250399380922, + "max": 111.38250399380922 + }, + "completion": "truncated", + "headers_s": 0.0021746240090578794, + "first_payload_s": 12.428530168021098, + "first_output_s": 12.428530168021098, + "last_output_s": 12.881961085018702, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.668881739024073, + "decode_tps": 2.1534861802845646, + "elapsed_s": 12.634437563014217, + "chunk_offsets_s": [ + 5.668881739024073, + 5.761342202022206, + 7.33165123796789, + 9.399695230007637, + 10.96026930899825, + 12.539833775022998, + 12.634331592998933 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1565.441557468148, + "p95": 2068.0439920397475, + "max": 2068.0439920397475 + }, + "completion": "truncated", + "headers_s": 0.002131615998223424, + "first_payload_s": 5.668881739024073, + "first_output_s": 5.668881739024073, + "last_output_s": 12.634331592998933, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.882167969015427, + "end_to_end_tps": 2.484053932301407, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-earlier-head-factored.csv b/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-earlier-head-factored.csv new file mode 100644 index 00000000000..830ed86e3e7 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-earlier-head-factored.csv @@ -0,0 +1,59 @@ +Time (%),Total Time (ns),Instances,Avg (ns),Med (ns),Min (ns),Max (ns),StdDev (ns),Name +19.0,9215766540,38764,237740.3,207043.0,174754,1575860,184905.2,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)0, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +15.5,7522358303,42672,176283.2,176195.0,163970,493831,8230.5,tf_nvfp4_fact_swiglu +13.7,6666381280,90424,73723.6,84641.0,16416,317924,57172.1,"dsv41_l2pace::paced_kernel(const long *, int, unsigned int, unsigned long, unsigned long)" +8.0,3900797710,42672,91413.5,90785.0,83713,395269,5954.9,"void tf_nvfp4_experts::nvfp4_expert_waves<(int)1, (int)0, (int)4>(const __nv_bfloat16 *, int, int, const uint4 *, const float *, int, int, const int *, const int *, const int *, void *, int, float, int)" +6.7,3256302173,65280,49882.1,51745.0,26592,250787,7634.1,"void tf_qmmf::qmmf_kernel<(int)3, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +5.8,2813477032,54060,52043.6,24160.0,20801,522214,54992.1,"void tf_qmmf::qmmf_kernel<(int)3, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +5.2,2532116742,34544,73301.2,73697.0,56161,261347,5079.5,"void tfl2pf::segments_kernel<(bool)1>(const long *, int, unsigned int)" +4.8,2314715011,92480,25029.4,17601.0,5408,9676923,56154.5,roce_gather +4.6,2221854713,37756,58847.7,53345.0,23936,320004,18576.4,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +2.3,1133806930,114808,9875.7,8768.0,5632,137921,2780.4,glm_mm16_16 +1.6,784147945,92160,8508.5,8384.0,4864,142530,2926.6,tf_glm_hc_partial8 +1.5,749652656,34544,21701.4,20640.0,16928,195170,4434.1,tf_glm_kda_step +1.2,565709572,344,1644504.6,1591748.5,170050,3203209,590615.7,tf_nvfp4_prompt_swiglu +1.0,490008795,11272,43471.3,42113.0,38144,187874,5480.1,tf_glm_absorb_q +0.9,458537971,46080,9950.9,9888.0,6368,179747,2276.5,tf_glm_hc_finish +0.9,441706444,54288,8136.4,7264.0,6976,140578,2354.7,tf_glm_router_tile +0.9,432733632,11272,38390.1,38208.0,33505,147618,5378.4,tf_glm_expand_v +0.9,423134079,11272,37538.5,37120.0,36705,175715,3197.9,tf_glm_chunks_16 +0.8,364981781,46080,7920.6,7712.0,7360,119585,1794.7,tf_glm_hc_finish_f32w +0.7,331383620,34544,9593.1,9472.0,1632,84993,3003.7,tf_glm_kda_out +0.6,283816415,344,825047.7,795946.0,89058,1574548,301803.1,tf_nvfp4_prompt_down +0.6,277139589,92160,3007.2,2784.0,1696,115682,1384.4,tf_glm_hc_post +0.5,240226964,43016,5584.6,5504.0,5312,109793,738.6,tf_glm_topk +0.3,166870170,34544,4830.7,4672.0,2816,41921,1178.5,tf_glm_kda_prep +0.3,127813775,43016,2971.3,2912.0,2816,82913,583.8,"tf_experts::plan_kernel(const int *, int, int, int, int *, int *, int *)" +0.3,127324796,43016,2959.9,3008.0,2432,124098,1346.8,tf_glm_combine +0.2,103252706,54288,1901.9,1888.0,1632,74945,528.5,tf_glm_slice_sum +0.2,74457067,45720,1628.5,1600.0,1536,20320,233.8,glm_mm_reduce +0.1,61179315,1440,42485.6,34704.0,8480,469958,43249.6,ncclDevKernel_SendRecv(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.1,53578661,46088,1162.5,1088.0,1056,94082,945.1,tf_glm_swiglu_512 +0.1,52930019,43016,1230.5,1184.0,1088,77313,791.4,tf_glm_put_slot +0.1,39702841,11272,3522.3,2592.0,2368,49345,1460.2,tf_glm_lat_write +0.1,37075989,148,250513.4,247091.5,237443,331812,11824.5,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)0, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.1,32908373,912,36083.7,9312.0,8128,352901,42483.5,glm_mm16_rows +0.1,30382230,11272,2695.4,2592.0,2496,72065,979.6,tf_glm_rmsnorm_1536 +0.1,26290018,11272,2332.3,1760.0,1664,12512,824.1,tf_glm_index_write +0.1,25224239,272,92736.2,116577.5,63265,182178,26979.4,tf_glm_kda_chain +0.0,20460110,11272,1815.1,1760.0,1696,61793,938.6,tf_glm_rmsnorm_512 +0.0,18017025,11272,1598.4,1504.0,1312,32096,835.8,tf_glm_merge +0.0,17546750,256,68542.0,66992.5,60608,131713,6950.5,"void tf_qmmf::qmmf_kernel<(int)3, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,16451906,11272,1459.5,896.0,832,70112,1293.3,tf_glm_pool_keys +0.0,14774237,148,99825.9,96385.5,87681,139650,11282.0,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,13393631,2056,6514.4,6720.0,2944,28448,3250.8,ncclDevKernel_Broadcast_RING_LL(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.0,13039967,1280,10187.5,12000.0,1120,31841,4777.1,tf_glm_conv_shift +0.0,12956390,212,61115.0,25985.0,23424,284260,68848.9,"void tf_qmmf::qmmf_kernel<(int)3, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,8372426,16,523276.6,440069.5,112578,1354705,431595.5,ncclDevKernel_AllReduce_Sum_f64_RING_LL(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.0,6983430,1024,6819.8,6496.0,6176,117154,3754.0,tf_glm_top1 +0.0,4376594,1032,4240.9,4032.0,1728,26625,1557.6,tf_glm_embed_b16 +0.0,3755703,1024,3667.7,2912.0,2784,17473,1078.3,tf_glm_rmsnorm_4096_f32w +0.0,2060796,2056,1002.3,864.0,608,7776,714.2,tf_glm_put_words +0.0,1749461,544,3215.9,3344.0,928,17633,2584.6,tf_glm_copy_rows +0.0,1710837,1024,1670.7,1632.0,1600,12320,384.0,tf_glm_stream_mean +0.0,898253,16,56140.8,54209.0,49216,67425,6546.2,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,598214,12,49851.2,63152.5,16640,71584,24496.8,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,137857,40,3446.4,3088.0,2752,8480,1057.0,tf_glm_rmsnorm_4096 +0.0,48544,4,12136.0,11984.0,11872,12704,382.6,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)32, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,36192,8,4524.0,4768.0,2912,4832,654.9,tf_glm_add_i32 +0.0,28448,16,1778.0,1760.0,1632,2016,107.1,tf_glm_residual_add diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-head-classic.csv b/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-head-classic.csv new file mode 100644 index 00000000000..3da545a1ae7 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/kprof-head-classic.csv @@ -0,0 +1,59 @@ +Time (%),Total Time (ns),Instances,Avg (ns),Med (ns),Min (ns),Max (ns),StdDev (ns),Name +18.0,9382839489,38764,242050.3,210947.0,175618,1749557,190484.2,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)0, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +16.2,8423397424,42672,197398.7,190307.0,175298,590727,24428.0,"void tf_nvfp4_experts::nvfp4_expert_kernel<(int)2, (int)2, (int)4>(const __nv_bfloat16 *, int, int, const uint4 *, const float *, int, int, const int *, const int *, const int *, void *, int, float, int)" +13.2,6876859578,90424,76051.3,84417.0,16289,264387,60549.6,"dsv41_l2pace::paced_kernel(const long *, int, unsigned int, unsigned long, unsigned long)" +8.9,4639242055,42672,108718.6,104866.0,95490,1132974,27031.9,"void tf_nvfp4_experts::nvfp4_expert_kernel<(int)1, (int)0, (int)4>(const __nv_bfloat16 *, int, int, const uint4 *, const float *, int, int, const int *, const int *, const int *, void *, int, float, int)" +6.5,3368055889,65280,51594.0,52641.0,26689,322660,8933.6,"void tf_qmmf::qmmf_kernel<(int)3, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +5.7,2947823145,34544,85335.3,72833.0,37729,684553,52344.1,"void tfl2pf::segments_kernel<(bool)1>(const long *, int, unsigned int)" +5.6,2895342683,54060,53557.9,24800.0,20576,520007,56082.4,"void tf_qmmf::qmmf_kernel<(int)3, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +5.1,2659465710,92480,28757.2,17792.0,5344,9080881,55112.5,roce_gather +4.4,2304312645,37756,61031.7,52896.0,22432,223683,21285.1,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +2.3,1184868079,114808,10320.4,9184.0,5600,174594,3355.0,glm_mm16_16 +1.7,891846294,34544,25817.7,22369.0,16352,173730,7519.2,tf_glm_kda_step +1.6,811633675,92160,8806.8,8608.0,4960,132834,3367.0,tf_glm_hc_partial8 +1.1,591452813,344,1719339.6,1594163.0,171363,4043794,687599.4,tf_nvfp4_prompt_swiglu +0.9,493992444,54288,9099.5,7328.0,6945,159490,4317.9,tf_glm_router_tile +0.9,493202501,11272,43754.7,43488.0,38177,257092,5969.3,tf_glm_absorb_q +0.9,450235471,11272,39942.8,38400.0,35008,196163,6415.5,tf_glm_expand_v +0.8,433004120,11272,38414.1,37089.0,36736,126178,4490.4,tf_glm_chunks_16 +0.8,394720145,46080,8566.0,7680.0,6112,140961,3286.4,tf_glm_hc_finish +0.8,393032882,46080,8529.4,7649.0,7264,150850,3104.4,tf_glm_hc_finish_f32w +0.6,308142320,34544,8920.3,9408.0,1632,117505,3503.7,tf_glm_kda_out +0.6,296665619,344,862400.1,798266.0,89057,2373245,353453.6,tf_nvfp4_prompt_down +0.5,273073984,92160,2963.0,2304.0,1440,109250,1748.7,tf_glm_hc_post +0.5,261224941,43016,6072.7,5632.0,5281,110018,1808.6,tf_glm_topk +0.4,187129681,34544,5417.1,4864.0,2816,148674,2300.2,tf_glm_kda_prep +0.3,139948078,43016,3253.4,2912.0,2816,76097,1276.0,"tf_experts::plan_kernel(const int *, int, int, int, int *, int *, int *)" +0.3,131232276,43016,3050.8,2496.0,2432,125153,2031.2,tf_glm_combine +0.2,123188302,54288,2269.2,1792.0,1600,109570,1680.0,tf_glm_slice_sum +0.2,89938552,45720,1967.2,1632.0,1536,32641,1247.8,glm_mm_reduce +0.1,72104424,43016,1676.2,1376.0,1088,119746,1284.7,tf_glm_put_slot +0.1,67315718,46088,1460.6,1120.0,1056,91393,1222.6,tf_glm_swiglu_512 +0.1,67243490,1440,46696.9,35888.5,8480,648808,52295.1,ncclDevKernel_SendRecv(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.1,41511458,11272,3682.7,2368.0,2304,22368,2649.2,tf_glm_lat_write +0.1,38573510,148,260631.8,252643.5,234979,332004,21196.8,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)0, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.1,37177701,11272,3298.2,2656.0,2528,50048,1603.3,tf_glm_rmsnorm_1536 +0.1,35448491,912,38869.0,10464.0,8128,560711,47921.1,glm_mm16_rows +0.1,32188507,11272,2855.6,1920.0,1664,70113,1725.5,tf_glm_index_write +0.1,27644698,272,101634.9,101777.0,63040,226210,43700.2,tf_glm_kda_chain +0.0,24511993,11272,2174.6,1792.0,1696,26240,1317.0,tf_glm_rmsnorm_512 +0.0,23284807,11272,2065.7,1504.0,1312,28512,1776.3,tf_glm_merge +0.0,18824104,256,73531.7,68945.0,58817,167747,11773.7,"void tf_qmmf::qmmf_kernel<(int)3, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,17965109,11272,1593.8,896.0,832,16736,1438.1,tf_glm_pool_keys +0.0,16517229,1280,12904.1,14208.0,1088,44832,6588.0,tf_glm_conv_shift +0.0,16133740,148,109011.8,99697.5,88802,206179,21180.4,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,14772946,2056,7185.3,8448.0,2912,22848,3566.0,ncclDevKernel_Broadcast_RING_LL(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.0,13871242,212,65430.4,27232.0,23104,265251,71518.7,"void tf_qmmf::qmmf_kernel<(int)3, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)1, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,11194283,16,699642.7,369140.0,43425,1571251,631717.8,ncclDevKernel_AllReduce_Sum_f64_RING_LL(ncclDevKernelArgsStorage<(unsigned long)4096>) +0.0,7608761,1024,7430.4,6560.0,6176,32064,2600.1,tf_glm_top1 +0.0,5220189,1032,5058.3,4032.0,1696,108353,4082.3,tf_glm_embed_b16 +0.0,4535909,1024,4429.6,2976.0,2816,15680,1944.5,tf_glm_rmsnorm_4096_f32w +0.0,2568342,2056,1249.2,896.0,608,13504,1080.3,tf_glm_put_words +0.0,2268859,544,4170.7,3424.0,928,23552,4102.9,tf_glm_copy_rows +0.0,2097890,1024,2048.7,1664.0,1600,15841,1384.8,tf_glm_stream_mean +0.0,904808,16,56550.5,54113.0,51456,66912,6081.2,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,642632,12,53552.7,63360.5,16736,93345,27767.9,"void tf_qmmf::qmmf_kernel<(int)2, (int)32, (int)64, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,183394,40,4584.9,3296.0,2784,13760,2872.4,tf_glm_rmsnorm_4096 +0.0,49058,4,12264.5,12192.0,12065,12609,243.0,"void tf_qmmf::qmmf_kernel<(int)2, (int)16, (int)32, (int)1, (int)4, (int)4, (bool)0, (bool)1, (bool)0>(const __nv_bfloat16 *, const unsigned char *, const unsigned char *, float, void *, float *, int, int, int, int, int, int, int)" +0.0,45024,16,2814.0,1744.0,1664,8992,2273.3,tf_glm_residual_add +0.0,37441,8,4680.1,4816.5,3008,5632,744.2,tf_glm_add_i32 diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/nodraft.json new file mode 100644 index 00000000000..45e198686e4 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.49178039879586, + "decode_tps_all": [ + 24.51, + 24.49, + 24.44 + ], + "ttft_s_median": 0.1251848369720392, + "prompt_ttft_tps_median": 111.835, + "prefill_tps_median": 111.835, + "itl_mean_ms_median": 40.83, + "itl_p50_ms_median": 40.729, + "itl_p95_ms_median": 41.687, + "tpot_ms_median": 40.83, + "chunk_tpot_estimate_ms_median": 40.83, + "round_gap_p50_ms_median": 40.729, + "round_gap_p95_ms_median": 41.687, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.125, + "first_content_s_median": 0.125, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.125, + "last_output_s_median": 5.312, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.475759375940203, + "decode_tps_all": [ + 24.51, + 24.48, + 24.47 + ], + "ttft_s_median": 0.1909222209942527, + "prompt_ttft_tps_median": 167.608, + "prefill_tps_median": 167.608, + "itl_mean_ms_median": 40.857, + "itl_p50_ms_median": 40.696, + "itl_p95_ms_median": 41.553, + "tpot_ms_median": 40.857, + "chunk_tpot_estimate_ms_median": 40.857, + "round_gap_p50_ms_median": 40.696, + "round_gap_p95_ms_median": 41.553, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.002, + "first_payload_s_median": 0.002, + "first_content_s_median": 0.191, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.191, + "last_output_s_median": 5.38, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill32768.json new file mode 100644 index 00000000000..60f30d8eed7 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.204514393990394, + "decode_tps": 33.97296476161397, + "elapsed_s": 22.65621091797948, + "chunk_offsets_s": [ + 22.204514393990394, + 22.294227161968593, + 22.378429160977248, + 22.460114432964474, + 22.53845457197167, + 22.594469630974345, + 22.646041947009508 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.01270549721085, + "p95": 89.71276797819883, + "max": 89.71276797819883 + }, + "completion": "truncated", + "headers_s": 0.016957557993009686, + "first_payload_s": 15.113802479987498, + "first_output_s": 22.204514393990394, + "last_output_s": 22.646041947009508, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.187765142007265, + "decode_tps": 33.76379318349609, + "elapsed_s": 22.63217653502943, + "chunk_offsets_s": [ + 22.187765142007265, + 22.277754637005273, + 22.362018737010658, + 22.44420840102248, + 22.5235390010057, + 22.579657696012873, + 22.632028022024315 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.76013199752197, + "p95": 89.98949499800801, + "max": 89.98949499800801 + }, + "completion": "truncated", + "headers_s": 0.002727785031311214, + "first_payload_s": 15.08702323801117, + "first_output_s": 22.187765142007265, + "last_output_s": 22.632028022024315, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.206157850974705, + "decode_tps": 33.73976349727531, + "elapsed_s": 22.650850915000774, + "chunk_offsets_s": [ + 22.206157850974705, + 22.298314536979888, + 22.3826537450077, + 22.465024183969945, + 22.543598571966868, + 22.598963086958975, + 22.650737137999386 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.47241347958334, + "p95": 92.15668600518256, + "max": 92.15668600518256 + }, + "completion": "truncated", + "headers_s": 0.003805282001849264, + "first_payload_s": 15.061326880997512, + "first_output_s": 22.206157850974705, + "last_output_s": 22.650737137999386, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 45.517223290982656, + "decode_tps": 29.35306990432744, + "elapsed_s": 46.038020031002816, + "chunk_offsets_s": [ + 45.517223290982656, + 45.646891094977036, + 45.74795579101192, + 45.84004768496379, + 45.91347369697178, + 45.97663737600669, + 46.0282430939842 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 82.75895297992975, + "p95": 129.66780399437994, + "max": 129.66780399437994 + }, + "completion": "truncated", + "headers_s": 0.003553135960828513, + "first_payload_s": 15.09784243098693, + "first_output_s": 45.517223290982656, + "last_output_s": 46.0282430939842, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.235487817029934, + "decode_tps": 1.8826945155429433, + "elapsed_s": 30.20286948402645, + "chunk_offsets_s": [ + 22.235487817029934, + 22.34902326099109, + 23.822388176980894, + 25.597275029984303, + 27.15413218399044, + 28.679124845017213, + 30.20279205898987 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1524.329937499715, + "p95": 1774.8868530034088, + "max": 1774.8868530034088 + }, + "completion": "truncated", + "headers_s": 0.0022912999847903848, + "first_payload_s": 15.054518775024917, + "first_output_s": 22.235487817029934, + "last_output_s": 30.20279205898987, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.038110528024845, + "end_to_end_tps": 0.695076310321654, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill8192.json new file mode 100644 index 00000000000..9cf40a79c5f --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb1/prefill8192.json @@ -0,0 +1,207 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.645196217985358, + "decode_tps": 37.6730076349741, + "elapsed_s": 6.043522814987227, + "chunk_offsets_s": [ + 5.645196217985358, + 5.72495252097724, + 5.799844732973725, + 5.869528178998735, + 5.932744015008211, + 5.992165867006406, + 6.043359278002754 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.44964101724327, + "p95": 79.75630299188197, + "max": 79.75630299188197 + }, + "completion": "truncated", + "headers_s": 0.014295661996584386, + "first_payload_s": 5.645196217985358, + "first_output_s": 5.645196217985358, + "last_output_s": 6.043359278002754, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.631396930955816, + "decode_tps": 35.49794021964067, + "elapsed_s": 6.054102164984215, + "chunk_offsets_s": [ + 5.631396930955816, + 5.720393588009756, + 5.803309071983676, + 5.879238702007569, + 5.94338912400417, + 6.002957282005809, + 6.053956659976393 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 70.04002601024695, + "p95": 88.99665705394, + "max": 88.99665705394 + }, + "completion": "truncated", + "headers_s": 0.0012943950132466853, + "first_payload_s": 5.631396930955816, + "first_output_s": 5.631396930955816, + "last_output_s": 6.053956659976393, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.645811524009332, + "decode_tps": 32.20795559000986, + "elapsed_s": 6.111695305968169, + "chunk_offsets_s": [ + 5.645811524009332, + 5.721379967988469, + 5.8089450459810905, + 5.873517119965982, + 5.935366627003532, + 5.998616561992094, + 6.05910946498625, + 6.111534967960324 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 63.24993498856202, + "p95": 87.56507799262181, + "max": 87.56507799262181 + }, + "completion": "truncated", + "headers_s": 0.002116322983056307, + "first_payload_s": 5.645811524009332, + "first_output_s": 5.645811524009332, + "last_output_s": 6.111534967960324, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 11.901212639990263, + "decode_tps": 31.095162285894016, + "elapsed_s": 12.383714806986973, + "chunk_offsets_s": [ + 11.901212639990263, + 12.01057512999978, + 12.117085434030741, + 12.205940157989971, + 12.276060428004712, + 12.32935344503494, + 12.383602790010627 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 79.4874969869852, + "p95": 109.36249000951648, + "max": 109.36249000951648 + }, + "completion": "truncated", + "headers_s": 0.0016986230039037764, + "first_payload_s": 11.901212639990263, + "first_output_s": 11.901212639990263, + "last_output_s": 12.383602790010627, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.626342921052128, + "decode_tps": 2.279938859939137, + "elapsed_s": 12.205578955006786, + "chunk_offsets_s": [ + 5.626342921052128, + 5.69723138801055, + 7.148637295002118, + 8.901655335037503, + 10.427680329012219, + 12.010861965012737, + 12.117257404024713, + 12.205466714047361 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 1451.4059069915675, + "p95": 1753.0180400353856, + "max": 1753.0180400353856 + }, + "completion": "truncated", + "headers_s": 0.001481053011957556, + "first_payload_s": 5.626342921052128, + "first_output_s": 5.626342921052128, + "last_output_s": 12.205466714047361, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.383832168008666, + "end_to_end_tps": 2.5840143475673116, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/nodraft.json new file mode 100644 index 00000000000..1caa916a327 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.64949422181986, + "decode_tps_all": [ + 24.58, + 24.65, + 24.66 + ], + "ttft_s_median": 0.12394554005004466, + "prompt_ttft_tps_median": 112.953, + "prefill_tps_median": 112.953, + "itl_mean_ms_median": 40.569, + "itl_p50_ms_median": 40.378, + "itl_p95_ms_median": 41.303, + "tpot_ms_median": 40.569, + "chunk_tpot_estimate_ms_median": 40.569, + "round_gap_p50_ms_median": 40.378, + "round_gap_p95_ms_median": 41.303, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.002, + "first_payload_s_median": 0.124, + "first_content_s_median": 0.124, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.124, + "last_output_s_median": 5.276, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 24.635944163308807, + "decode_tps_all": [ + 24.64, + 24.63, + 24.64 + ], + "ttft_s_median": 0.19038328499300405, + "prompt_ttft_tps_median": 168.082, + "prefill_tps_median": 168.082, + "itl_mean_ms_median": 40.591, + "itl_p50_ms_median": 40.402, + "itl_p95_ms_median": 41.305, + "tpot_ms_median": 40.591, + "chunk_tpot_estimate_ms_median": 40.591, + "round_gap_p50_ms_median": 40.402, + "round_gap_p95_ms_median": 41.305, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.19, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.19, + "last_output_s_median": 5.346, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill32768.json new file mode 100644 index 00000000000..d29b984479d --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.250672309019137, + "decode_tps": 33.37963585984441, + "elapsed_s": 22.700449599011336, + "chunk_offsets_s": [ + 22.250672309019137, + 22.3417349930387, + 22.42610467399936, + 22.510159536032006, + 22.593572473037057, + 22.64880071603693, + 22.700048091995995 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 83.73389951884747, + "p95": 91.06268401956186, + "max": 91.06268401956186 + }, + "completion": "truncated", + "headers_s": 0.01587933802511543, + "first_payload_s": 15.10108387703076, + "first_output_s": 22.250672309019137, + "last_output_s": 22.700048091995995, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.250192188017536, + "decode_tps": 32.43032779333286, + "elapsed_s": 22.712905900029, + "chunk_offsets_s": [ + 22.250192188017536, + 22.349003360024653, + 22.44200382498093, + 22.52849968901137, + 22.606330115988385, + 22.66144880797947, + 22.712722202995792 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 82.16314550372772, + "p95": 98.81117200711742, + "max": 98.81117200711742 + }, + "completion": "truncated", + "headers_s": 0.0029605859890580177, + "first_payload_s": 15.057013440993614, + "first_output_s": 22.250192188017536, + "last_output_s": 22.712722202995792, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.25751721096458, + "decode_tps": 33.8210372741125, + "elapsed_s": 22.701182551973034, + "chunk_offsets_s": [ + 22.25751721096458, + 22.34924533299636, + 22.433696365973447, + 22.51623952697264, + 22.59510179096833, + 22.65027605398791, + 22.70102814998245 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.7027124974411, + "p95": 91.72812203178182, + "max": 91.72812203178182 + }, + "completion": "truncated", + "headers_s": 0.00398200296331197, + "first_payload_s": 15.104316254961304, + "first_output_s": 22.25751721096458, + "last_output_s": 22.70102814998245, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 45.427212159964256, + "decode_tps": 31.48436607854082, + "elapsed_s": 45.90380503196502, + "chunk_offsets_s": [ + 45.427212159964256, + 45.53442882798845, + 45.633891953970306, + 45.72305281297304, + 45.78856680501485, + 45.85169155901531, + 45.90363909397274 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 77.3374255222734, + "p95": 107.2166680241935, + "max": 107.2166680241935 + }, + "completion": "truncated", + "headers_s": 0.003993954975157976, + "first_payload_s": 15.070502484973986, + "first_output_s": 45.427212159964256, + "last_output_s": 45.90363909397274, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.253242518985644, + "decode_tps": 1.9031161928346103, + "elapsed_s": 30.135146553977393, + "chunk_offsets_s": [ + 22.253242518985644, + 22.345074708980974, + 23.80453572096303, + 25.564294682990294, + 27.109481951978523, + 28.624509006971493, + 30.135052392957732 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1512.7852204896044, + "p95": 1759.758962027263, + "max": 1759.758962027263 + }, + "completion": "truncated", + "headers_s": 0.0028012889670208097, + "first_payload_s": 15.083697513968218, + "first_output_s": 22.253242518985644, + "last_output_s": 30.135052392957732, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 45.903931368957274, + "end_to_end_tps": 0.6971080481712321, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill8192.json new file mode 100644 index 00000000000..93c83cb6a61 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rb2/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.651108693971764, + "decode_tps": 38.03705458559222, + "elapsed_s": 6.045599283999763, + "chunk_offsets_s": [ + 5.651108693971764, + 5.728743443964049, + 5.803084918006789, + 5.871517748979386, + 5.935846815991681, + 5.994722764997277, + 6.045460994995665 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.38094899244606, + "p95": 77.63474999228492, + "max": 77.63474999228492 + }, + "completion": "truncated", + "headers_s": 0.014292394975200295, + "first_payload_s": 5.651108693971764, + "first_output_s": 5.651108693971764, + "last_output_s": 6.045460994995665, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.657712540007196, + "decode_tps": 34.85003059576047, + "elapsed_s": 6.088208455010317, + "chunk_offsets_s": [ + 5.657712540007196, + 5.745818838011473, + 5.828436737006996, + 5.905606652027927, + 5.9775134500232525, + 6.036950508016162, + 6.088128231000155 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 74.53835650812835, + "p95": 88.10629800427705, + "max": 88.10629800427705 + }, + "completion": "truncated", + "headers_s": 0.0016575820045545697, + "first_payload_s": 5.657712540007196, + "first_output_s": 5.657712540007196, + "last_output_s": 6.088128231000155, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.6424550139927305, + "decode_tps": 35.42650875901831, + "elapsed_s": 6.066013819014188, + "chunk_offsets_s": [ + 5.6424550139927305, + 5.725015536998399, + 5.811159420001786, + 5.880602644989267, + 5.947034868993796, + 6.015540598018561, + 6.065866762015503 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 68.97447700612247, + "p95": 86.1438830033876, + "max": 86.1438830033876 + }, + "completion": "truncated", + "headers_s": 0.0011821539956144989, + "first_payload_s": 5.6424550139927305, + "first_output_s": 5.6424550139927305, + "last_output_s": 6.065866762015503, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 11.923822219017893, + "decode_tps": 30.513587183139787, + "elapsed_s": 12.415545180032495, + "chunk_offsets_s": [ + 11.923822219017893, + 12.036841601016931, + 12.131290341028944, + 12.200023403041996, + 12.25526007503504, + 12.31096598302247, + 12.363833273993805, + 12.415406506042928 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 55.70590798743069, + "p95": 113.01938199903816, + "max": 113.01938199903816 + }, + "completion": "truncated", + "headers_s": 0.0032042040256783366, + "first_payload_s": 11.923822219017893, + "first_output_s": 11.923822219017893, + "last_output_s": 12.415406506042928, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.660099868022371, + "decode_tps": 2.318211445711518, + "elapsed_s": 12.13103982701432, + "chunk_offsets_s": [ + 5.660099868022371, + 5.737236873013899, + 7.187010060995817, + 8.935596327995881, + 10.460857829020824, + 12.03705937799532, + 12.130605407000985 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1487.5173445034306, + "p95": 1748.5862670000643, + "max": 1748.5862670000643 + }, + "completion": "truncated", + "headers_s": 0.0024413809878751636, + "first_payload_s": 5.660099868022371, + "first_output_s": 5.660099868022371, + "last_output_s": 12.130605407000985, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.415906015026849, + "end_to_end_tps": 2.5773390972250203, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/conc.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/conc.json new file mode 100644 index 00000000000..a8e6a31826b --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/conc.json @@ -0,0 +1,17625 @@ +{ + "label": "ex", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 39.6, + "per_stream_tps": 39.6, + "ttft_s_max": 0.13, + "request": { + "ttft_s": 0.132, + "decode_tps": 39.618, + "prompt_ttft_tps": 106.064, + "prefill_tps": 106.064, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.241, + "round_gap_p50_ms": 61.823, + "round_gap_p95_ms": 87.353, + "tokens_per_chunk": 2.813, + "headers_s": 0.001, + "first_payload_s": 0.132, + "first_content_s": 0.132, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.132, + "last_output_s": 6.57 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 106.064, + "aggregate_prefill_tps": 106.064, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.241, + "round_gap_p50_ms": 61.823, + "round_gap_p95_ms": 87.353, + "tokens_per_chunk": 2.813 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 38.96397513312834, + "makespan_s": 6.570171527040657, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 38.20265077709902, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 6.807075646996964, + "end_to_end_tps": 37.60792641006391, + "timing_valid": true, + "per_stream_tps": [ + 38.2 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13199629000155255, + "decode_tps": 38.20265077709902, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 106.06358708896539, + "prefill_tps": 106.06358708896539, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.17619405089713, + "round_gap_p50_ms": 83.7078049662523, + "round_gap_p95_ms": 100.13228497700766, + "tokens_per_chunk": 3.1219512195121952, + "headers_s": 0.0011819310020655394, + "first_payload_s": 0.13199629000155255, + "first_content_s": 0.13199629000155255, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13199629000155255, + "last_output_s": 6.806925772980321 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.17619405089713, + "round_gap_p50_ms": 83.7078049662523, + "round_gap_p95_ms": 100.13228497700766, + "round_gap_mean_ms": 82.40653682689837, + "tokens_per_chunk": 3.1219512195121952, + "aggregate_prompt_ttft_tps": 106.06358708896539, + "aggregate_prefill_tps": 106.06358708896539 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396460.702676085, + "first": 396460.834672375, + "last": 396467.509601858, + "end": 396467.509751732, + "elapsed_s": 6.807075646996964, + "chunk_offsets_s": [ + 0.13199629000155255, + 0.19634557201061398, + 0.2659150480176322, + 0.3342856480157934, + 0.4060963779920712, + 0.48409889597678557, + 0.5590844089747407, + 0.63946706202114, + 0.7175187490065582, + 0.7906544680008665, + 0.8654819949879311, + 0.9369938099989668, + 1.012922180001624, + 1.08906837599352, + 1.1662232379894704, + 1.2465185620239936, + 1.3240185949834995, + 1.391923591028899, + 1.458847137982957, + 1.526423107017763, + 1.5956125149969012, + 1.6632859089877456, + 1.7284703020122834, + 1.8008517739945091, + 1.8768186080269516, + 1.9620306360302493, + 2.0471822320250794, + 2.1374862769735046, + 2.234589893021621, + 2.3347221779986285, + 2.437427128024865, + 2.5331406830227934, + 2.616435492003802, + 2.696560734999366, + 2.785906483011786, + 2.886057664989494, + 2.9760070830234326, + 3.0629411920090206, + 3.1577655380242504, + 3.265321958984714, + 3.370509988977574, + 3.446830907021649, + 3.53201085497858, + 3.6199282049783505, + 3.710916369978804, + 3.8068784219794907, + 3.8929074659827165, + 3.963509608991444, + 4.050753736984916, + 4.136385592981242, + 4.2273075970006175, + 4.313409744994715, + 4.39589037100086, + 4.485754763998557, + 4.572441782976966, + 4.663548876997083, + 4.758265508979093, + 4.839255639992189, + 4.918575691001024, + 4.993488402978983, + 5.074784170021303, + 5.157350508030504, + 5.2414594540023245, + 5.324824728013482, + 5.408532532979734, + 5.494532025011722, + 5.5804442840162665, + 5.666594385984354, + 5.749160707986448, + 5.8304107779986225, + 5.915012959972955, + 6.001664761977736, + 6.090970269986428, + 6.17740565398708, + 6.26036999700591, + 6.345066388021223, + 6.432065745990258, + 6.520269242988434, + 6.608265377988573, + 6.693912947026547, + 6.757429260003846, + 6.806925772980321 + ], + "chunk_gaps_ms": { + "count": 81, + "p50": 83.7078049662523, + "p95": 100.13228497700766, + "max": 107.55642096046358 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 39.617772577427445, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 6.570171527040657, + "end_to_end_tps": 38.96397513312834, + "timing_valid": true, + "per_stream_tps": [ + 39.6 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13356912200106308, + "decode_tps": 39.617772577427445, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.81464421012346, + "prefill_tps": 104.81464421012346, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.241196941237387, + "round_gap_p50_ms": 59.984647028613836, + "round_gap_p95_ms": 86.19242202257738, + "tokens_per_chunk": 2.5346534653465347, + "headers_s": 0.0010842820047400892, + "first_payload_s": 0.13356912200106308, + "first_content_s": 0.13356912200106308, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13356912200106308, + "last_output_s": 6.570074342016596 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.241196941237387, + "round_gap_p50_ms": 59.984647028613836, + "round_gap_p95_ms": 86.19242202257738, + "round_gap_mean_ms": 64.36505220015533, + "tokens_per_chunk": 2.5346534653465347, + "aggregate_prompt_ttft_tps": 104.81464421012346, + "aggregate_prefill_tps": 104.81464421012346 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396467.510368538, + "first": 396467.64393766, + "last": 396474.08044288, + "end": 396474.080540065, + "elapsed_s": 6.570171527040657, + "chunk_offsets_s": [ + 0.13356912200106308, + 0.20840820105513558, + 0.2939214160433039, + 0.3787189450231381, + 0.4659536490216851, + 0.5471298780175857, + 0.6297514490433969, + 0.7107223159982823, + 0.791596302005928, + 0.8700242000049911, + 0.9528865730389953, + 1.0375995570211671, + 1.122785345010925, + 1.2088932699989527, + 1.2955705280182883, + 1.383107315050438, + 1.4683830560534261, + 1.5503389410441741, + 1.6327147330157459, + 1.7094654150423594, + 1.7613192310091108, + 1.8127571070217527, + 1.8647185880108736, + 1.918650889012497, + 1.9861227760557085, + 2.0641235830262303, + 2.117535798053723, + 2.1714473140309565, + 2.2229230140219443, + 2.2770671720500104, + 2.3299952230299823, + 2.3828964410349727, + 2.4500802460242994, + 2.537191317009274, + 2.6236996939987876, + 2.709892116021365, + 2.78355112002464, + 2.846874167036731, + 2.9288565320312046, + 3.0126984670059755, + 3.089115626004059, + 3.139980200037826, + 3.190944455040153, + 3.243302532006055, + 3.2974464030121453, + 3.349772079032846, + 3.40129002003232, + 3.456103033036925, + 3.514130813011434, + 3.564599064004142, + 3.6171744710300118, + 3.67071732704062, + 3.724067654053215, + 3.778281669015996, + 3.8308004030259326, + 3.8975464120157994, + 3.9575310590444133, + 4.010189267050009, + 4.060733294056263, + 4.112317475024611, + 4.1648852660437115, + 4.216892299999017, + 4.27076968800975, + 4.327438943029847, + 4.389520346012432, + 4.445114438014571, + 4.504469863022678, + 4.564622704056092, + 4.62856553401798, + 4.688154833042063, + 4.749586230027489, + 4.813901319052093, + 4.884963738033548, + 4.94484035205096, + 5.003586683014873, + 5.061398909019772, + 5.1184406310203485, + 5.176569101051427, + 5.236570100008976, + 5.29918238800019, + 5.365463161026128, + 5.4235656130476855, + 5.482883854012471, + 5.541301238001324, + 5.602859324018937, + 5.664194704033434, + 5.723000908037648, + 5.784764453012031, + 5.851725727028679, + 5.911464148026425, + 5.973924995050766, + 6.034293486038223, + 6.09391678601969, + 6.152897807012778, + 6.212891222035978, + 6.275546647026204, + 6.341368951019831, + 6.4044056120328605, + 6.464182497002184, + 6.520648550009355, + 6.570074342016596 + ], + "chunk_gaps_ms": { + "count": 100, + "p50": 59.989031025907025, + "p95": 86.19242202257738, + "max": 87.53678703214973 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 42.97914585870891, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 6.0619510730030015, + "end_to_end_tps": 42.230627881524846, + "timing_valid": true, + "per_stream_tps": [ + 43.0 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.1287738750106655, + "decode_tps": 42.97914585870891, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.71770379543577, + "prefill_tps": 108.71770379543577, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 23.26709803139024, + "round_gap_p50_ms": 61.82276096660644, + "round_gap_p95_ms": 87.35342498403043, + "tokens_per_chunk": 2.8131868131868134, + "headers_s": 0.0012331960024312139, + "first_payload_s": 0.1287738750106655, + "first_content_s": 0.1287738750106655, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1287738750106655, + "last_output_s": 6.0618838730151765 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 23.26709803139024, + "round_gap_p50_ms": 61.82276096660644, + "round_gap_p95_ms": 87.35342498403043, + "round_gap_mean_ms": 65.92344442227234, + "tokens_per_chunk": 2.8131868131868134, + "aggregate_prompt_ttft_tps": 108.71770379543577, + "aggregate_prefill_tps": 108.71770379543577 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396474.082530469, + "first": 396474.211304344, + "last": 396480.144414342, + "end": 396480.144481542, + "elapsed_s": 6.0619510730030015, + "chunk_offsets_s": [ + 0.1287738750106655, + 0.1935922970296815, + 0.2783244170132093, + 0.3629567280295305, + 0.4511778409942053, + 0.5385312659782358, + 0.6237552789971232, + 0.7119708079844713, + 0.7961060419911519, + 0.8825177300022915, + 0.9693914550007321, + 1.0537436989834532, + 1.1200273029971868, + 1.207348103984259, + 1.2745550129911862, + 1.3604737209971063, + 1.427050127997063, + 1.4866355070262216, + 1.5461732700350694, + 1.6069670930155553, + 1.6665374480071478, + 1.7265794390114024, + 1.787737234029919, + 1.8500616640085354, + 1.9175387040013447, + 1.979815069003962, + 2.0418792410055175, + 2.101501420023851, + 2.160549306019675, + 2.2233205559896305, + 2.2839291940326802, + 2.352656150003895, + 2.425392312987242, + 2.4863446010276675, + 2.5439538810169324, + 2.6036722540156916, + 2.662119814020116, + 2.7225750900106505, + 2.781604096002411, + 2.843687275017146, + 2.921500862983521, + 3.009484870999586, + 3.0697342720231973, + 3.1300272590015084, + 3.191584017011337, + 3.25507844198728, + 3.3150941940257326, + 3.3851004900061525, + 3.4527204440091737, + 3.51370810798835, + 3.5723433030070737, + 3.6331849340349436, + 3.6959594159852713, + 3.7600009349989705, + 3.8221021619974636, + 3.893039187998511, + 3.984201753977686, + 4.046662040986121, + 4.109843423997518, + 4.169873046979774, + 4.230475268035661, + 4.292298029002268, + 4.354170022998005, + 4.416547461005393, + 4.4807232529856265, + 4.5386430799844675, + 4.595960628998, + 4.654426430002786, + 4.715606192999985, + 4.775727353000548, + 4.834893096005544, + 4.895989305980038, + 4.962571841024328, + 5.021395085030235, + 5.083021892001852, + 5.144732747983653, + 5.20423779101111, + 5.263668656989466, + 5.321834117989056, + 5.386993344000075, + 5.458431973995175, + 5.523717601026874, + 5.58341790898703, + 5.642589939991012, + 5.703397282981314, + 5.763914032024331, + 5.824083033017814, + 5.890105322992895, + 5.955555303022265, + 6.012022924027406, + 6.0618838730151765 + ], + "chunk_gaps_ms": { + "count": 90, + "p50": 61.84737748117186, + "p95": 87.35342498403043, + "max": 91.16256597917527 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 74.8, + "per_stream_tps": 37.5, + "ttft_s_max": 0.26, + "request": { + "ttft_s": 0.197, + "decode_tps": 37.448, + "prompt_ttft_tps": 79.376, + "prefill_tps": 79.376, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.704, + "round_gap_p50_ms": 79.745, + "round_gap_p95_ms": 84.991, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.197, + "first_content_s": 0.197, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.197, + "last_output_s": 6.952 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 107.689, + "aggregate_prefill_tps": 107.689, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.496, + "round_gap_p50_ms": 79.75, + "round_gap_p95_ms": 84.981, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 73.64068997319896, + "makespan_s": 6.952677930996288, + "steady_tps": 75.4, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 74.76718679998031, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 6.952677930996288, + "end_to_end_tps": 73.64068997319896, + "timing_valid": true, + "steady_tps": 75.41176504451887, + "per_stream_tps": [ + 37.4, + 38.1 + ], + "ttft_s": [ + 0.13, + 0.26 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13062399002956226, + "decode_tps": 37.383593399990154, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.1778621739512, + "prefill_tps": 107.1778621739512, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.749702451029318, + "round_gap_p50_ms": 79.76291998056695, + "round_gap_p95_ms": 85.0044260150753, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010491620050743222, + "first_payload_s": 0.13062399002956226, + "first_content_s": 0.13062399002956226, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13062399002956226, + "last_output_s": 6.951798115042038 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25972233299398795, + "decode_tps": 38.10632341330394, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.90372032552192, + "prefill_tps": 53.90372032552192, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.24236374509101, + "round_gap_p50_ms": 79.72802297445014, + "round_gap_p95_ms": 84.97784996870905, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001316349022090435, + "first_payload_s": 0.25972233299398795, + "first_content_s": 0.25972233299398795, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25972233299398795, + "last_output_s": 6.951525087992195 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.496033098060163, + "round_gap_p50_ms": 79.74991103401408, + "round_gap_p95_ms": 84.98135500121862, + "round_gap_mean_ms": 80.43438619053978, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 107.80744065104383, + "aggregate_prefill_tps": 107.80744065104383 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396480.146602123, + "first": 396480.277226113, + "last": 396487.098400238, + "end": 396487.099170757, + "elapsed_s": 6.952568634005729, + "chunk_offsets_s": [ + 0.13062399002956226, + 0.33570228703320026, + 0.41653758502798155, + 0.49617184803355485, + 0.5798945809947327, + 0.6649321120348759, + 0.7448212410090491, + 0.8245086400420405, + 0.9074581660097465, + 0.9865686150151305, + 1.0636704849894159, + 1.1419637100188993, + 1.2219817360164598, + 1.3017006230074912, + 1.3798189660301432, + 1.4605578469927423, + 1.5440169150242582, + 1.6230503070401028, + 1.7023005810333416, + 1.780658191011753, + 1.861130253993906, + 1.9404476649942808, + 2.0172680109972134, + 2.0978435309953056, + 2.178682685014792, + 2.261952774017118, + 2.341715693997685, + 2.42672012001276, + 2.506128700042609, + 2.5900409879977815, + 2.675013894040603, + 2.7586827240302227, + 2.835866914014332, + 2.9130200800136663, + 2.9909492540173233, + 3.0675414060242474, + 3.1467976809944957, + 3.227388208033517, + 3.3090829710126854, + 3.3875676700263284, + 3.4663787240278907, + 3.5455413020099513, + 3.6257862100028433, + 3.693892744020559, + 3.7761781840235926, + 3.857967363030184, + 3.938981175015215, + 4.02057006402174, + 4.101114943041466, + 4.186460285040084, + 4.270067050005309, + 4.350875003030524, + 4.430047789006494, + 4.512576703040395, + 4.594529196037911, + 4.6769151170155965, + 4.757861919992138, + 4.844037862028927, + 4.9210734909866005, + 4.998120239994023, + 5.076205415010918, + 5.151416258013342, + 5.228619025030639, + 5.307530511985533, + 5.3866255530156195, + 5.469402774004266, + 5.544077292026486, + 5.625232545018662, + 5.707364896021318, + 5.789141259039752, + 5.871990863990504, + 5.9501285520382226, + 6.027823915006593, + 6.105561327014584, + 6.184942835010588, + 6.266964977025054, + 6.346031313005369, + 6.425284820026718, + 6.502635524026118, + 6.5834410460083745, + 6.664652555016801, + 6.74403025500942, + 6.829000873025507, + 6.8989116330049, + 6.951798115042038 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 79.82602447737008, + "p95": 85.0044260150753, + "max": 205.078297003638 + } + }, + { + "start": 396480.146492826, + "first": 396480.406215159, + "last": 396487.098017914, + "end": 396487.098971508, + "elapsed_s": 6.952478681982029, + "chunk_offsets_s": [ + 0.25972233299398795, + 0.33628226100699976, + 0.4165738259907812, + 0.49618882400682196, + 0.5801517200306989, + 0.6651882270234637, + 0.7453739659977145, + 0.8250661650090478, + 0.9074592380202375, + 0.9865767750306986, + 1.0636567560140975, + 1.1418845410225913, + 1.2219380710157566, + 1.3016660939902067, + 1.3798285180237144, + 1.4605735910008661, + 1.543974802014418, + 1.6229922900092788, + 1.7022334929788485, + 1.780606126994826, + 1.8611080290284008, + 1.9403484640060924, + 2.017210635007359, + 2.0977940739830956, + 2.1786258200299926, + 2.2619213979924098, + 2.341671309026424, + 2.426649158995133, + 2.506071644020267, + 2.589976955030579, + 2.6749583100317977, + 2.7586266429862007, + 2.8358313459903, + 2.913018096005544, + 2.9909461659844965, + 3.0680806760210544, + 3.146793553023599, + 3.2273848800105043, + 3.3091110669774935, + 3.387582389987074, + 3.466382100014016, + 3.5455565819866024, + 3.6263259269762784, + 3.694435293029528, + 3.7761935280286707, + 3.858196772984229, + 3.9389055100036785, + 4.020535503979772, + 4.101070879027247, + 4.186409228015691, + 4.270010409003589, + 4.350835627003107, + 4.4299872440169565, + 4.512534910987597, + 4.594471947988495, + 4.676868028996978, + 4.757802431995515, + 4.843984309001826, + 4.921035395003855, + 4.998055103002116, + 5.076140279008541, + 5.1513581780018285, + 5.228563920012675, + 5.307465984020382, + 5.386561696999706, + 5.469346422003582, + 5.54400178702781, + 5.62517412903253, + 5.7073041429976, + 5.789111594029237, + 5.871963952027727, + 5.95005978300469, + 6.027776779024862, + 6.105497343000025, + 6.184895427024458, + 6.26694335998036, + 6.345969505026005, + 6.4252164990175515, + 6.502580914995633, + 6.583390628977213, + 6.664585737977177, + 6.743970062001608, + 6.828942616004497, + 6.898819408030249, + 6.951525087992195 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 79.73896700423211, + "p95": 84.97784996870905, + "max": 86.18187700631097 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 75.02420825981686, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 6.931731191987637, + "end_to_end_tps": 73.86322201758472, + "timing_valid": true, + "steady_tps": 75.65995762042168, + "per_stream_tps": [ + 38.2, + 37.5 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2611065070377663, + "decode_tps": 38.231737618375924, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.61796670189858, + "prefill_tps": 53.61796670189858, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.15627910982927, + "round_gap_p50_ms": 79.40126798348501, + "round_gap_p95_ms": 84.53443797770888, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009151130216196179, + "first_payload_s": 0.2611065070377663, + "first_content_s": 0.2611065070377663, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2611065070377663, + "last_output_s": 6.93095768004423 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.1335269939736463, + "decode_tps": 37.51210412990843, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.84771343510604, + "prefill_tps": 104.84771343510604, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.65806206276494, + "round_gap_p50_ms": 79.59006901364774, + "round_gap_p95_ms": 84.71511100651696, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0008744089864194393, + "first_payload_s": 0.1335269939736463, + "first_content_s": 0.1335269939736463, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1335269939736463, + "last_output_s": 6.9313328199787065 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.407170586297106, + "round_gap_p50_ms": 79.59006901364774, + "round_gap_p95_ms": 84.71511100651696, + "round_gap_mean_ms": 80.16462499411621, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 107.1444808482306, + "aggregate_prefill_tps": 107.1444808482306 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396487.101503148, + "first": 396487.362609655, + "last": 396494.032460828, + "end": 396494.032651726, + "elapsed_s": 6.931148578005377, + "chunk_offsets_s": [ + 0.2611065070377663, + 0.3370522370096296, + 0.4180674410308711, + 0.49771328701172024, + 0.5794281300040893, + 0.6627186840050854, + 0.7426255570026115, + 0.8207052280195057, + 0.9015646860352717, + 0.9796811889973469, + 1.0579287500004284, + 1.1359428850119002, + 1.215918974019587, + 1.2949540950357914, + 1.3731789190205745, + 1.454000537050888, + 1.5407054440001957, + 1.619277840014547, + 1.6972863110131584, + 1.7757743539987132, + 1.8559129090281203, + 1.934331224008929, + 2.010370171046816, + 2.0906573359970935, + 2.170306526008062, + 2.253428358002566, + 2.3324014940299094, + 2.414967321034055, + 2.494118443049956, + 2.577424373012036, + 2.6621824290486984, + 2.7466007210314274, + 2.8224060659995303, + 2.900268296012655, + 2.9782182050403208, + 3.0553828600095585, + 3.1366878580302, + 3.217864840000402, + 3.299222527013626, + 3.377851179044228, + 3.457180783036165, + 3.5363766890368424, + 3.6165529240388423, + 3.6833813020493835, + 3.7660551459994167, + 3.846218853024766, + 3.9262862240429968, + 4.004013924044557, + 4.0852178650093265, + 4.16995680105174, + 4.254280388995539, + 4.334357792045921, + 4.4143356890417635, + 4.497268560051452, + 4.581802998029161, + 4.66388053202536, + 4.7454497090075165, + 4.82930695603136, + 4.907574981043581, + 4.984291215019766, + 5.061421660997439, + 5.134852054994553, + 5.212987839011475, + 5.291360792994965, + 5.3698915090062656, + 5.450198386039119, + 5.52493500005221, + 5.604297868034337, + 5.685908278042916, + 5.768080469046254, + 5.846647793019656, + 5.925750674039591, + 6.003652167040855, + 6.081103592005093, + 6.160330907034222, + 6.245585463999305, + 6.324398213997483, + 6.404145726002753, + 6.482142276014201, + 6.562811796029564, + 6.64362466201419, + 6.723025929997675, + 6.807377023040317, + 6.878174862999003, + 6.93095768004423 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 79.52355698216707, + "p95": 84.53443797770888, + "max": 86.70490694930777 + } + }, + { + "start": 396487.101280282, + "first": 396487.234807276, + "last": 396494.032613102, + "end": 396494.033011474, + "elapsed_s": 6.931731191987637, + "chunk_offsets_s": [ + 0.1335269939736463, + 0.33747536095324904, + 0.4184898929670453, + 0.4981293549644761, + 0.5797291089547798, + 0.6627378519624472, + 0.7429150309762917, + 0.821010926971212, + 0.9018660169676878, + 0.9799675279646181, + 1.0583357299910858, + 1.1362429200089537, + 1.215928238001652, + 1.2952488819719292, + 1.3734841700061224, + 1.4542969719623215, + 1.5405116019537672, + 1.6195686109713279, + 1.697626537992619, + 1.7758022740017623, + 1.8562412319588475, + 1.93466233095387, + 2.0107064779731445, + 2.090659910987597, + 2.170629776956048, + 2.25375533697661, + 2.3324167740065604, + 2.4148520719609223, + 2.49444214097457, + 2.5777514799847268, + 2.6622110049938783, + 2.7469261160003953, + 2.8227373819681816, + 2.900283864000812, + 2.9785502569866367, + 3.055369963985868, + 3.137064581969753, + 3.2181868589832447, + 3.2995186089538038, + 3.3781953579746187, + 3.4571972789708525, + 3.5367146439966746, + 3.6163113699876703, + 3.683730888995342, + 3.7660787139902823, + 3.846543543972075, + 3.9265795549727045, + 4.004318869963754, + 4.085562875960022, + 4.170251011964865, + 4.254572407982778, + 4.334660450986121, + 4.4141749200061895, + 4.497298159985803, + 4.5821474170079455, + 4.664191622985527, + 4.74580303998664, + 4.829648559971247, + 4.907585765002295, + 4.984641266986728, + 5.061778864997905, + 5.135202970996033, + 5.213279201998375, + 5.291389913007151, + 5.370226295955945, + 5.450215905962978, + 5.525268827972468, + 5.604636862990446, + 5.686199799994938, + 5.768418871972244, + 5.846944594988599, + 5.926083940954413, + 6.003663526964374, + 6.081442044000141, + 6.160443723958451, + 6.245864809956402, + 6.324424853955861, + 6.404467936954461, + 6.482476278964896, + 6.562829379981849, + 6.643949560995679, + 6.72305965796113, + 6.807404558989219, + 6.878193422977347, + 6.9313328199787065 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 79.59339750232175, + "p95": 84.71511100651696, + "max": 203.94836697960272 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 70.00338873215283, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 7.416281862999313, + "end_to_end_tps": 69.03728977109502, + "timing_valid": true, + "steady_tps": 70.52235741311578, + "per_stream_tps": [ + 35.6, + 35.0 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.25989763101097196, + "decode_tps": 35.635656556590924, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.867362874919664, + "prefill_tps": 53.867362874919664, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.061781278309212, + "round_gap_p50_ms": 81.56010502716526, + "round_gap_p95_ms": 104.09965203143656, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010557379573583603, + "first_payload_s": 0.25989763101097196, + "first_content_s": 0.25989763101097196, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25989763101097196, + "last_output_s": 7.415651856979821 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13053912500618026, + "decode_tps": 35.001694366076414, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.24753976508715, + "prefill_tps": 107.24753976508715, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.5700454824038, + "round_gap_p50_ms": 81.58536901464686, + "round_gap_p95_ms": 104.36915897298604, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010044730152003467, + "first_payload_s": 0.13053912500618026, + "first_content_s": 0.13053912500618026, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13053912500618026, + "last_output_s": 7.415900723019149 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.315913380356506, + "round_gap_p50_ms": 81.58536901464686, + "round_gap_p95_ms": 104.36915897298604, + "round_gap_mean_ms": 85.95902276179653, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 107.68873571644028, + "aggregate_prefill_tps": 107.68873571644028 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396494.033960635, + "first": 396494.293858266, + "last": 396501.449612492, + "end": 396501.450131505, + "elapsed_s": 7.41617086995393, + "chunk_offsets_s": [ + 0.25989763101097196, + 0.33537486096611246, + 0.41530555801000446, + 0.4958007729728706, + 0.5794722739956342, + 0.6626198829617351, + 0.744938699004706, + 0.8241479179705493, + 0.905003760010004, + 0.9837495340034366, + 1.0613401279551908, + 1.1392142300028354, + 1.2191803349996917, + 1.298919845954515, + 1.3766493700095452, + 1.4582850279984996, + 1.5423515900038183, + 1.6219490519724786, + 1.6993951969780028, + 1.7788189129787497, + 1.8638145870063454, + 1.9594696779968217, + 2.05350127996644, + 2.1534300440107472, + 2.2546668520080857, + 2.3623111629858613, + 2.453572161961347, + 2.548223658988718, + 2.6556260630022734, + 2.762423053965904, + 2.8492247620015405, + 2.933723583992105, + 3.0155839799554087, + 3.114166969957296, + 3.2132833100040443, + 3.312476738996338, + 3.4125474559841678, + 3.51581106800586, + 3.6201915710116737, + 3.7201418709591962, + 3.824241522990633, + 3.9251010000007227, + 4.024992802995257, + 4.111322234966792, + 4.21423533197958, + 4.316991770989262, + 4.409018809965346, + 4.487451060966123, + 4.568525336973835, + 4.6530867029796354, + 4.736300696968101, + 4.817034409963526, + 4.896289707976393, + 4.979292419971898, + 5.061149440007284, + 5.143232301983517, + 5.224429795984179, + 5.309154170972761, + 5.389790476008784, + 5.467440222972073, + 5.544898096006364, + 5.618455306976102, + 5.695559240994044, + 5.7747548909974284, + 5.852642832964193, + 5.932962381979451, + 6.008062792010605, + 6.08792816096684, + 6.169488265994005, + 6.25168871297501, + 6.331362159980927, + 6.409693881985731, + 6.48861543298699, + 6.566441102011595, + 6.645466590998694, + 6.727690525993239, + 6.8101232319604605, + 6.889514515991323, + 6.967818109958898, + 7.04849394998746, + 7.129193038970698, + 7.208129231003113, + 7.292550484009553, + 7.362628909002524, + 7.415651856979821 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 81.5978815080598, + "p95": 104.09965203143656, + "max": 107.6443109777756 + } + }, + { + "start": 396494.033849642, + "first": 396494.164388767, + "last": 396501.449750365, + "end": 396501.449885294, + "elapsed_s": 7.416035652044229, + "chunk_offsets_s": [ + 0.13053912500618026, + 0.3352759640547447, + 0.4156278330483474, + 0.4956907880259678, + 0.5793531850213185, + 0.6629392300383188, + 0.7451362690189853, + 0.8240521090338007, + 0.9049014870543033, + 0.9836553890490904, + 1.0615353460307233, + 1.1394020070438273, + 1.2190736460033804, + 1.2988217810052447, + 1.3766133700264618, + 1.4581987390411086, + 1.5425316550536081, + 1.6218417060445063, + 1.6993023640243337, + 1.7785286860307679, + 1.8637919150060043, + 1.9594186850008555, + 2.0535087840398774, + 2.153435308020562, + 2.254895830003079, + 2.3625072930008173, + 2.453774036024697, + 2.5484174850280397, + 2.6553602690109983, + 2.762438222009223, + 2.84922632999951, + 2.9336099980282597, + 3.0158223500475287, + 3.1141739780432545, + 3.2132937900023535, + 3.3127176370471716, + 3.4124536310555413, + 3.515819692052901, + 3.620188851025887, + 3.720147343003191, + 3.824239779030904, + 3.9253669550525956, + 4.025011892023031, + 4.1113490190473385, + 4.214482902025338, + 4.317248366016429, + 4.409028362017125, + 4.487690055044368, + 4.568542873021215, + 4.653098767041229, + 4.736539371020626, + 4.817287980054971, + 4.896199467009865, + 4.979524742055219, + 5.061392130039167, + 5.1434804960154, + 5.224440468009561, + 5.3090004900004715, + 5.389713051030412, + 5.467446351016406, + 5.544799246999901, + 5.61837804201059, + 5.695810235047247, + 5.77440941601526, + 5.852661025011912, + 5.932965630025137, + 6.008062824024819, + 6.087942449026741, + 6.169498362054583, + 6.251692809048109, + 6.3313892960431986, + 6.409713114029728, + 6.488628937047906, + 6.56645759800449, + 6.645493423042353, + 6.727703134005424, + 6.810125936055556, + 6.889532132016029, + 6.967832638008986, + 7.048736704047769, + 7.129212191037368, + 7.208143839030527, + 7.292788438033313, + 7.362660109007265, + 7.415900723019149 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 81.72637849929743, + "p95": 104.36915897298604, + "max": 204.73683904856443 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.6, + "per_stream_tps": 29.2, + "ttft_s_max": 0.52, + "request": { + "ttft_s": 0.322, + "decode_tps": 29.255, + "prompt_ttft_tps": 45.143, + "prefill_tps": 45.143, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.182, + "round_gap_p50_ms": 101.979, + "round_gap_p95_ms": 106.879, + "tokens_per_chunk": 3.012, + "headers_s": 0.002, + "first_payload_s": 0.322, + "first_content_s": 0.322, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.322, + "last_output_s": 9.033 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 108.848, + "aggregate_prefill_tps": 108.848, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.152, + "round_gap_p50_ms": 102.029, + "round_gap_p95_ms": 106.881, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 113.33990840994169, + "makespan_s": 9.03476996201789, + "steady_tps": 117.7, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.90698546970827, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.007543860003352, + "end_to_end_tps": 113.6824883581104, + "timing_valid": true, + "steady_tps": 117.99174927183286, + "per_stream_tps": [ + 30.0, + 28.7, + 29.6, + 29.1 + ], + "ttft_s": [ + 0.51, + 0.13, + 0.39, + 0.26 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.5143836740171537, + "decode_tps": 30.029521029524872, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.217037995519913, + "prefill_tps": 27.217037995519913, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.30056443513718, + "round_gap_p50_ms": 101.63452400593087, + "round_gap_p95_ms": 106.63199704140425, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0024421840207651258, + "first_payload_s": 0.5143836740171537, + "first_content_s": 0.5143836740171537, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5143836740171537, + "last_output_s": 9.006027604977135 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.12971889303298667, + "decode_tps": 28.729318322091768, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.9256820087101, + "prefill_tps": 107.9256820087101, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.807648019655154, + "round_gap_p50_ms": 101.78094101138413, + "round_gap_p95_ms": 106.54926102142781, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001134827034547925, + "first_payload_s": 0.12971889303298667, + "first_content_s": 0.12971889303298667, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12971889303298667, + "last_output_s": 9.00566913804505 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3852646099985577, + "decode_tps": 29.579670724848874, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.33866084936379, + "prefill_tps": 36.33866084936379, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.80700242751296, + "round_gap_p50_ms": 101.73274902626872, + "round_gap_p95_ms": 106.75073403399438, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001951411017216742, + "first_payload_s": 0.3852646099985577, + "first_content_s": 0.3852646099985577, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3852646099985577, + "last_output_s": 9.006050229014363 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25857238698517904, + "decode_tps": 29.148986941581956, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.14344572223197, + "prefill_tps": 54.14344572223197, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.30650958827898, + "round_gap_p50_ms": 101.70844604726881, + "round_gap_p95_ms": 106.67463700519875, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0021042440203018486, + "first_payload_s": 0.25857238698517904, + "first_content_s": 0.25857238698517904, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25857238698517904, + "last_output_s": 9.006732331996318 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.055431117646066, + "round_gap_p50_ms": 101.73506900900975, + "round_gap_p95_ms": 106.70507000759244, + "round_gap_mean_ms": 103.38255874999699, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 108.84782045156079, + "aggregate_prefill_tps": 108.84782045156079 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396501.451575023, + "first": 396501.965958697, + "last": 396510.457602628, + "end": 396510.458574062, + "elapsed_s": 9.006999038974755, + "chunk_offsets_s": [ + 0.5143836740171537, + 0.6130675459862687, + 0.7154481100151315, + 0.8166025810060091, + 0.9212139350129291, + 1.0293973709922284, + 1.1298352120211348, + 1.2298013999825343, + 1.332366460992489, + 1.4320672390167601, + 1.5323084060219117, + 1.6322286570211872, + 1.7339697110000998, + 1.8354359939694405, + 1.9355146629968658, + 2.0383484630146995, + 2.145053533022292, + 2.2473754399688914, + 2.3476652469835244, + 2.4513117430033162, + 2.5540698950062506, + 2.65463234501658, + 2.7522031979751773, + 2.8552446159883402, + 2.9575361710158177, + 3.063294446968939, + 3.1648229379788972, + 3.268802717968356, + 3.3704372419742867, + 3.4759468759875745, + 3.5835263389744796, + 3.690158336015884, + 3.7875732830143534, + 3.888004035979975, + 3.9886085820035078, + 4.091153403976932, + 4.191388714010827, + 4.2944981009932235, + 4.3980573959997855, + 4.498661782999989, + 4.600571718008723, + 4.702306787017733, + 4.804065681004431, + 4.880315558984876, + 4.986171883996576, + 5.088307597965468, + 5.189866872970015, + 5.288929485017434, + 5.3922882819897495, + 5.501458351965994, + 5.607356966007501, + 5.709521031007171, + 5.810500493971631, + 5.915610203985125, + 6.0202442450099625, + 6.124476282973774, + 6.227382019977085, + 6.333398106973618, + 6.4325398550136015, + 6.532343866012525, + 6.631815618020482, + 6.72711601597257, + 6.825753280019853, + 6.92597298999317, + 7.02724531898275, + 7.132018227013759, + 7.228063048969489, + 7.329679732967634, + 7.433536391006783, + 7.538310290023219, + 7.63904584600823, + 7.739314661012031, + 7.839644772990141, + 7.939462864014786, + 8.04173085099319, + 8.145468947011977, + 8.246158614987507, + 8.347622865985613, + 8.446595315996092, + 8.552391369012184, + 8.655112447973806, + 8.756034678022843, + 8.862382784020156, + 8.946458514023107, + 9.006027604977135 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.68479650747031, + "p95": 106.63199704140425, + "max": 109.17006997624412 + } + }, + { + "start": 396501.451747457, + "first": 396501.58146635, + "last": 396510.457416595, + "end": 396510.457629637, + "elapsed_s": 9.005882180004846, + "chunk_offsets_s": [ + 0.12971889303298667, + 0.6126676380517893, + 0.7152158990502357, + 0.8163399710319936, + 0.9208434030297212, + 1.0290450630127452, + 1.129922460007947, + 1.2293566910084337, + 1.3319961210363545, + 1.4320948870154098, + 1.5316349430358969, + 1.6319244300248101, + 1.7339976150542498, + 1.835047110042069, + 1.934634254022967, + 2.03797858703183, + 2.1445261830231175, + 2.246927675034385, + 2.3475386060308665, + 2.4510551000130363, + 2.553655570023693, + 2.6542774290428497, + 2.7519166340352967, + 2.8548898760345764, + 2.9571366300224327, + 3.0628699790104292, + 3.164517159049865, + 3.268091047008056, + 3.3700516700046137, + 3.4755377520341426, + 3.5832303990027867, + 3.6897796600242145, + 3.78719646303216, + 3.8876898720045574, + 3.988771592034027, + 4.091059242025949, + 4.191061943012755, + 4.294217650021892, + 4.397831809998024, + 4.498308339039795, + 4.600286755012348, + 4.701937664009165, + 4.803718605020549, + 4.87988156999927, + 4.985898953047581, + 5.087954314018134, + 5.189365028054453, + 5.288481144001707, + 5.391740132006817, + 5.501002650998998, + 5.607065107033122, + 5.709290293045342, + 5.809931688010693, + 5.9149788049981, + 6.019892322015949, + 6.123913589050062, + 6.227094577043317, + 6.332904982031323, + 6.4321714990073815, + 6.531982022046577, + 6.631428605003748, + 6.726608731027227, + 6.825289643020369, + 6.926111280045006, + 7.026552400027867, + 7.131642319029197, + 7.227680725045502, + 7.329203968052752, + 7.432979664998129, + 7.537767293048091, + 7.638933108013589, + 7.739054882025812, + 7.839374178030994, + 7.9391279320116155, + 8.041373343032319, + 8.145095615007449, + 8.24580686702393, + 8.3472213090281, + 8.445981006021611, + 8.55204549402697, + 8.654756685020402, + 8.75565187400207, + 8.862097421020735, + 8.94609283003956, + 9.00566913804505 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.87078200397082, + "p95": 106.54926102142781, + "max": 482.9487450188026 + } + }, + { + "start": 396501.451961507, + "first": 396501.837226117, + "last": 396510.458011736, + "end": 396510.459022802, + "elapsed_s": 9.007061295036692, + "chunk_offsets_s": [ + 0.3852646099985577, + 0.6127047580084763, + 0.7151162340305746, + 0.8163075700285845, + 0.9209600600297563, + 1.0286348670488223, + 1.1293343270081095, + 1.2293259390280582, + 1.3321701230015606, + 1.4317852840176784, + 1.531770272005815, + 1.6319783510407433, + 1.7336853880551644, + 1.8349269170430489, + 1.9347729600267485, + 2.038135997019708, + 2.144573912024498, + 2.247294479049742, + 2.3474170850240625, + 2.4510571970022283, + 2.5533683680114336, + 2.653919634001795, + 2.751897482026834, + 2.854982277029194, + 2.957445241045207, + 3.063024091999978, + 3.164060707029421, + 3.2680864870199002, + 3.37012479105033, + 3.4757301380159333, + 3.5832346079987474, + 3.6899853420327418, + 3.787393889040686, + 3.8877221930306405, + 3.9883498109993525, + 4.090570438012946, + 4.191104263009038, + 4.294212242006324, + 4.39775828900747, + 4.498554070014507, + 4.600346772000194, + 4.702079521026462, + 4.803916623000987, + 4.8802513660048135, + 4.98594745004084, + 5.088019307004288, + 5.189284611027688, + 5.288889324001502, + 5.3917315560393035, + 5.500984539045021, + 5.607178084028419, + 5.709209364023991, + 5.809840343019459, + 5.915051622025203, + 6.020259141048882, + 6.123899125028402, + 6.227144962002058, + 6.333153865009081, + 6.432328669005074, + 6.532108648039866, + 6.631497422000393, + 6.7268782060127705, + 6.825592590030283, + 6.925779692013748, + 7.026451664045453, + 7.131689023051877, + 7.227806598006282, + 7.329169903998263, + 7.433291140012443, + 7.5377451160456985, + 7.638585681037512, + 7.739091299008578, + 7.839354882016778, + 7.939227837021463, + 8.041511440009344, + 8.145327090052888, + 8.245925236027688, + 8.347483296005521, + 8.446300417010207, + 8.552152583026327, + 8.654846078017727, + 8.755859188036993, + 8.862160222022794, + 8.94627123203827, + 9.006050229014363 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.76272550597787, + "p95": 106.75073403399438, + "max": 227.44014800991863 + } + }, + { + "start": 396501.451478942, + "first": 396501.710051329, + "last": 396510.458211274, + "end": 396510.458384716, + "elapsed_s": 9.006905774003826, + "chunk_offsets_s": [ + 0.25857238698517904, + 0.6131165389670059, + 0.7153735649771988, + 0.8164280679775402, + 0.921393649012316, + 1.0291977049782872, + 1.1300099010113627, + 1.2297250150004402, + 1.3327606730163097, + 1.4320183420204557, + 1.5320031869923696, + 1.632594132970553, + 1.7339831669814885, + 1.8352378800045699, + 1.9349998260149732, + 2.038564640970435, + 2.1449951959657483, + 2.2476848830119707, + 2.3476390709984116, + 2.451482368982397, + 2.5539869659696706, + 2.654799097974319, + 2.752469248021953, + 2.855415912985336, + 2.9578180609969422, + 3.063458880991675, + 3.1645959760062397, + 3.2684482819749974, + 3.370156728022266, + 3.476163021987304, + 3.5838449979783036, + 3.6905196349835023, + 3.787778100988362, + 3.888252261967864, + 3.9889418819802813, + 4.0909883140120655, + 4.191416202986147, + 4.294402340019587, + 4.397995172010269, + 4.498982601973694, + 4.600761831970885, + 4.702612822002266, + 4.80449933296768, + 4.8806690339697525, + 4.986371741979383, + 5.088340125977993, + 5.189555813965853, + 5.289252879971173, + 5.392152393003926, + 5.501406702969689, + 5.607610119972378, + 5.709447367000394, + 5.810446604969911, + 5.9153772899881005, + 6.020617256988771, + 6.124316602014005, + 6.227696663001552, + 6.333692541986238, + 6.4328664829954505, + 6.532534667989239, + 6.6315275829983875, + 6.727419186965562, + 6.82620416401187, + 6.926194480969571, + 7.02671502600424, + 7.131824113021139, + 7.228237850009464, + 7.329601747973356, + 7.433843721984886, + 7.53815915301675, + 7.638931829016656, + 7.739498726965394, + 7.839564819994848, + 7.9394820960005745, + 8.04192345996853, + 8.145885751990136, + 8.24648904998321, + 8.348090693994891, + 8.446493026975077, + 8.55258151498856, + 8.655279185972176, + 8.75627244001953, + 8.862566546013113, + 8.94670315698022, + 9.006732331996318 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.7438380222302, + "p95": 106.67463700519875, + "max": 354.5441519818269 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.56098065267483, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.03476996201789, + "end_to_end_tps": 113.33990840994169, + "timing_valid": true, + "steady_tps": 117.66753640168577, + "per_stream_tps": [ + 28.6, + 29.5, + 29.1, + 29.9 + ], + "ttft_s": [ + 0.13, + 0.39, + 0.26, + 0.52 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13099357800092548, + "decode_tps": 28.644680848182983, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 106.87546835235761, + "prefill_tps": 106.87546835235761, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.91049543543554, + "round_gap_p50_ms": 101.96921601891518, + "round_gap_p95_ms": 106.76345496904105, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0007904400117695332, + "first_payload_s": 0.13099357800092548, + "first_content_s": 0.13099357800092548, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13099357800092548, + "last_output_s": 9.03316991403699 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38951841299422085, + "decode_tps": 29.49747417279403, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 35.94181823750579, + "prefill_tps": 35.94181823750579, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.90120774891008, + "round_gap_p50_ms": 101.98894399218261, + "round_gap_p95_ms": 106.92654503509402, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0011381229851394892, + "first_payload_s": 0.38951841299422085, + "first_content_s": 0.38951841299422085, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38951841299422085, + "last_output_s": 9.034326388966292 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2595160600030795, + "decode_tps": 29.064931199053245, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.94656500192656, + "prefill_tps": 53.94656500192656, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.40572396856641, + "round_gap_p50_ms": 102.063745027408, + "round_gap_p95_ms": 106.87929502455518, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0010032900026999414, + "first_payload_s": 0.2595160600030795, + "first_content_s": 0.2595160600030795, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2595160600030795, + "last_output_s": 9.032975671987515 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5182926569832489, + "decode_tps": 29.94692212100649, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.01176605797924, + "prefill_tps": 27.01176605797924, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.39241328238345, + "round_gap_p50_ms": 101.94331099046394, + "round_gap_p95_ms": 106.87953600427136, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015571030089631677, + "first_payload_s": 0.5182926569832489, + "first_content_s": 0.5182926569832489, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5182926569832489, + "last_output_s": 9.03335804399103 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.152460108823874, + "round_gap_p50_ms": 102.02932800166309, + "round_gap_p95_ms": 106.88115103403106, + "round_gap_mean_ms": 103.67711104464391, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 108.04706423191696, + "aggregate_prefill_tps": 108.04706423191696 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396510.460234286, + "first": 396510.591227864, + "last": 396519.4934042, + "end": 396519.494018622, + "elapsed_s": 9.03378433600301, + "chunk_offsets_s": [ + 0.13099357800092548, + 0.6160565360332839, + 0.7185552610317245, + 0.8202823140309192, + 0.9248103550053202, + 1.0298426890512928, + 1.1332762550446205, + 1.2335548780392855, + 1.3369355000322685, + 1.4358327660011128, + 1.535492167051416, + 1.635596341046039, + 1.737532644008752, + 1.8392723220167682, + 1.9388259940315038, + 2.0423640890512615, + 2.14800364500843, + 2.249615529028233, + 2.350455278006848, + 2.451245298027061, + 2.5540178500232287, + 2.656516527000349, + 2.7539507070323452, + 2.8576445150538348, + 2.959840117022395, + 3.0657115630456246, + 3.167747819039505, + 3.271558109030593, + 3.373325035034213, + 3.4783966170507483, + 3.5867021990125068, + 3.6929722080240026, + 3.7901460810098797, + 3.890317744051572, + 3.991362151049543, + 4.091098513046745, + 4.193947961030062, + 4.2970901960507035, + 4.401319770026021, + 4.502845990005881, + 4.6038841890404, + 4.705758924013935, + 4.807136006013025, + 4.882965367054567, + 4.989728822023608, + 5.09290664101718, + 5.195133572036866, + 5.2954987400444224, + 5.3995817200047895, + 5.507258080004249, + 5.615189658012241, + 5.719887492014095, + 5.821326751029119, + 5.9276496570091695, + 6.032496405008715, + 6.137506114027929, + 6.240523052052595, + 6.347132969007362, + 6.446851699030958, + 6.546837600006256, + 6.646889629017096, + 6.741679783037398, + 6.841493346029893, + 6.942044084018562, + 7.043180236010812, + 7.145295741036534, + 7.244603267055936, + 7.347402379033156, + 7.450529847003054, + 7.555737782036886, + 7.657579221006017, + 7.758867854019627, + 7.85967629001243, + 7.960190180048812, + 8.063251679006498, + 8.167590134020429, + 8.268702669010963, + 8.370671885029878, + 8.470253142004367, + 8.574293994053733, + 8.68046157102799, + 8.781541002041195, + 8.888290792005137, + 8.9734297330142, + 9.03316991403699 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.00273600639775, + "p95": 106.76345496904105, + "max": 485.06295803235844 + } + }, + { + "start": 396510.460456544, + "first": 396510.849974957, + "last": 396519.494782933, + "end": 396519.494923927, + "elapsed_s": 9.034467382996809, + "chunk_offsets_s": [ + 0.38951841299422085, + 0.6159481349750422, + 0.7184026199975051, + 0.8197042290121317, + 0.9241712130024098, + 1.0295507499831729, + 1.1332479509874247, + 1.233243755006697, + 1.3365586159634404, + 1.4355143469874747, + 1.5351797639741562, + 1.6353062900016084, + 1.7371674890164286, + 1.838991182972677, + 1.938679929007776, + 2.0420900710159913, + 2.147702873975504, + 2.2495249519706704, + 2.3508388659683987, + 2.4508426059619524, + 2.5535706139635295, + 2.6561313230195083, + 2.7536518239649013, + 2.857332255982328, + 2.9597316840081476, + 3.065397703961935, + 3.167633033997845, + 3.271666462009307, + 3.37295951199485, + 3.478292807994876, + 3.586751863011159, + 3.692652764962986, + 3.7900370080024004, + 3.8904021930065937, + 3.9910589799983427, + 4.090787246008404, + 4.194197547971271, + 4.297241749998648, + 4.40090936596971, + 4.502337216981687, + 4.603835756017361, + 4.7057413079892285, + 4.80683182697976, + 4.883310602977872, + 4.98941613099305, + 5.092952658014838, + 5.195267780974973, + 5.295449347991962, + 5.399517975980416, + 5.507346496975515, + 5.6150815130095, + 5.7199488210026175, + 5.821365710988175, + 5.9278643149882555, + 6.032401620002929, + 6.137725428969134, + 6.240211081982125, + 6.346831111004576, + 6.4468094750191085, + 6.546672975004185, + 6.646493898006156, + 6.741807880986016, + 6.8414265619940124, + 6.941941506986041, + 7.042813416977879, + 7.1453587979776785, + 7.244858869991731, + 7.346971670980565, + 7.450212388008367, + 7.555759813985787, + 7.657471843995154, + 7.758395208977163, + 7.859166030015331, + 7.960082274978049, + 8.063146397995297, + 8.167302515008487, + 8.268312265980057, + 8.37030120997224, + 8.469865649996791, + 8.57433532300638, + 8.680144239973743, + 8.781254550965969, + 8.888181096001063, + 8.973104609991424, + 9.034326388966292 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.05087249050848, + "p95": 106.92654503509402, + "max": 226.42972198082134 + } + }, + { + "start": 396510.460325615, + "first": 396510.719841675, + "last": 396519.493301287, + "end": 396519.494312417, + "elapsed_s": 9.033986801980063, + "chunk_offsets_s": [ + 0.2595160600030795, + 0.6162501379731111, + 0.7187197429593652, + 0.819970551005099, + 0.9244853919954039, + 1.0298688169568777, + 1.1330871650134213, + 1.233619854960125, + 1.3369215629645623, + 1.4358160449774005, + 1.5355408389586955, + 1.6357443259912543, + 1.7378946319804527, + 1.839257616957184, + 1.938952234981116, + 2.042544091003947, + 2.148082941013854, + 2.2498258510022424, + 2.350421004986856, + 2.451209986000322, + 2.5538111279602163, + 2.6565006059827283, + 2.75400905899005, + 2.8576718909898773, + 2.9600088069564663, + 3.065809788007755, + 3.167839116009418, + 3.2715749730123207, + 3.3733189550112, + 3.478491946007125, + 3.58696303301258, + 3.693013073003385, + 3.790244130010251, + 3.8904286089818925, + 3.9913997189723887, + 4.0911130249733105, + 4.193989640974905, + 4.297180933004711, + 4.401302857964765, + 4.502611234958749, + 4.60386621998623, + 4.705929965013638, + 4.807111828995403, + 4.8830765360035, + 4.989910406991839, + 5.093015841965098, + 5.195166035962757, + 5.295467107964214, + 5.399592088011559, + 5.507289680012036, + 5.615296250965912, + 5.71971128199948, + 5.821439359977376, + 5.927672520978376, + 6.032604037958663, + 6.137529442959931, + 6.240546045009978, + 6.347152937960345, + 6.447001396969426, + 6.546898639993742, + 6.646871645003557, + 6.7417038469575346, + 6.84192010195693, + 6.942147349007428, + 7.043148475990165, + 7.1453436620067805, + 7.244757508975454, + 7.34724237798946, + 7.450515717966482, + 7.555759606009815, + 7.657751141989138, + 7.758712779963389, + 7.859639505972154, + 7.960312629002146, + 8.063392320007551, + 8.167558084998745, + 8.26869265298592, + 8.370672877004836, + 8.470108611974865, + 8.57431194599485, + 8.68043518596096, + 8.781519465963356, + 8.888398760987911, + 8.973466677009128, + 9.032975671987515 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.1069695125334, + "p95": 106.87929502455518, + "max": 356.73407797003165 + } + }, + { + "start": 396510.460153965, + "first": 396510.978446622, + "last": 396519.493512009, + "end": 396519.493634906, + "elapsed_s": 9.033480941026937, + "chunk_offsets_s": [ + 0.5182926569832489, + 0.6164662360097282, + 0.718803680036217, + 0.8200816889875568, + 0.9247089780401438, + 1.0299853780306876, + 1.1334288170328364, + 1.2337331200251356, + 1.3369462040136568, + 1.4360467200167477, + 1.5356418489827774, + 1.635738774028141, + 1.7375566610135138, + 1.8394999720039777, + 1.939058716990985, + 2.042636075988412, + 2.148423361009918, + 2.2501488139969297, + 2.3512516380287707, + 2.4512657150044106, + 2.5540307459887117, + 2.6565376149956137, + 2.7541026920080185, + 2.857792485039681, + 2.960131928033661, + 3.065933069039602, + 3.1680615030345507, + 3.2718307520262897, + 3.373355212039314, + 3.4787132600322366, + 3.586900872993283, + 3.693133682012558, + 3.790468037012033, + 3.8905174899846315, + 3.991519656032324, + 4.091236098029185, + 4.194278957031202, + 4.297299735015258, + 4.401329546992201, + 4.502837478008587, + 4.604221760004293, + 4.705957150028553, + 4.806966564035974, + 4.883384955988731, + 4.990266107022762, + 5.0931008030311204, + 5.19548538303934, + 5.295824614993762, + 5.399941996030975, + 5.507542514998931, + 5.615513709024526, + 5.720089510024991, + 5.8215212970389985, + 5.927995853009634, + 6.032910729001742, + 6.137864886026364, + 6.240663806034718, + 6.347272651037201, + 6.44685509201372, + 6.546825056022499, + 6.646908638009336, + 6.741933642013464, + 6.841935575008392, + 6.942392216005828, + 7.043199837033171, + 7.145721314009279, + 7.244982967036776, + 7.347961937019136, + 7.4507341050193645, + 7.555989401007537, + 7.657873463991564, + 7.758780925010797, + 7.85956803400768, + 7.960529784031678, + 8.063514370005578, + 8.167402115999721, + 8.268717581988312, + 8.370691869989969, + 8.470388311019633, + 8.574723566009197, + 8.680659189005382, + 8.781739611993544, + 8.888619147997815, + 8.973588230030145, + 9.03335804399103 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 101.95879949606024, + "p95": 106.87953600427136, + "max": 108.1876129610464 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 114.07390402087783, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.072968552005477, + "end_to_end_tps": 112.86273000182022, + "timing_valid": true, + "steady_tps": 117.07989280609749, + "per_stream_tps": [ + 29.8, + 28.5, + 28.9, + 29.4 + ], + "ttft_s": [ + 0.51, + 0.13, + 0.26, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.5129076619632542, + "decode_tps": 29.796106209112512, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.295361403673063, + "prefill_tps": 27.295361403673063, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.56143225500287, + "round_gap_p50_ms": 102.20609797397628, + "round_gap_p95_ms": 106.9725610432215, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0017242089961655438, + "first_payload_s": 0.5129076619632542, + "first_content_s": 0.5129076619632542, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5129076619632542, + "last_output_s": 9.071072886988986 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13086644100258127, + "decode_tps": 28.51847600521946, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 106.97929807477425, + "prefill_tps": 106.97929807477425, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.064987337225865, + "round_gap_p50_ms": 102.42678801296279, + "round_gap_p95_ms": 107.44448500918224, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001816034025978297, + "first_payload_s": 0.13086644100258127, + "first_content_s": 0.13086644100258127, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13086644100258127, + "last_output_s": 9.072438211995177 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2574803769821301, + "decode_tps": 28.93073930647322, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.37307558770446, + "prefill_tps": 54.37307558770446, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.56531094510437, + "round_gap_p50_ms": 102.46298101264983, + "round_gap_p95_ms": 107.35269205179065, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0008162960293702781, + "first_payload_s": 0.2574803769821301, + "first_content_s": 0.2574803769821301, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2574803769821301, + "last_output_s": 9.071634667983744 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3862786529934965, + "decode_tps": 29.361284340722428, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.24326607620149, + "prefill_tps": 36.24326607620149, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.058455631419946, + "round_gap_p50_ms": 102.39381203427911, + "round_gap_p95_ms": 107.48098196927458, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0019783389871008694, + "first_payload_s": 0.3862786529934965, + "first_content_s": 0.3862786529934965, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3862786529934965, + "last_output_s": 9.071184839005582 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.312546542188265, + "round_gap_p50_ms": 102.42678801296279, + "round_gap_p95_ms": 107.46317403391004, + "round_gap_mean_ms": 104.16308771735723, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.03581938555989, + "aggregate_prefill_tps": 109.03581938555989 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396519.497670289, + "first": 396520.010577951, + "last": 396528.568743176, + "end": 396528.568927353, + "elapsed_s": 9.071257064002566, + "chunk_offsets_s": [ + 0.5129076619632542, + 0.6119919060147367, + 0.7139065130031668, + 0.8158059839624912, + 0.9208922389661893, + 1.0270046149962582, + 1.1277567629585974, + 1.2304277939838357, + 1.333510555967223, + 1.4330685649765655, + 1.5329762569745071, + 1.6339073829585686, + 1.735612532007508, + 1.8379181189811788, + 1.9381218299968168, + 2.041976712003816, + 2.148859751992859, + 2.250581461994443, + 2.351346970011946, + 2.452589138993062, + 2.5548410610063, + 2.655186598014552, + 2.7560864269617014, + 2.8599054850055836, + 2.9627922459621914, + 3.069106175971683, + 3.1708160300040618, + 3.2749360669986345, + 3.3770110600162297, + 3.482646374963224, + 3.5895641669631004, + 3.696536728006322, + 3.7937820259830914, + 3.8941944749676622, + 3.9958503599627875, + 4.094726121984422, + 4.194665493967477, + 4.30093124799896, + 4.405401367985178, + 4.506374189979397, + 4.608182796975598, + 4.709676775964908, + 4.811360677005723, + 4.886974932975136, + 4.9948937589651905, + 5.096819646016229, + 5.202075965993572, + 5.302422910986934, + 5.4059078529826365, + 5.513883223989978, + 5.620213889982551, + 5.723284445004538, + 5.827547619002871, + 5.933674683969002, + 6.039396367967129, + 6.145827915985137, + 6.25059027899988, + 6.359172966971528, + 6.460012155992445, + 6.560792160977144, + 6.662529485998675, + 6.757975118991453, + 6.859241431986447, + 6.961447529960424, + 7.062414016982075, + 7.16658376599662, + 7.26379698398523, + 7.370751223992556, + 7.4759146950091235, + 7.582475700008217, + 7.6851204429985955, + 7.78678983199643, + 7.888936538016424, + 7.99022622697521, + 8.093086795997806, + 8.198453549004626, + 8.301532647979911, + 8.403975675988477, + 8.504596590995789, + 8.60901312698843, + 8.713164173008408, + 8.817552163964137, + 8.925015337998047, + 9.01206173596438, + 9.071072886988986 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.22900999360718, + "p95": 106.9725610432215, + "max": 108.58268797164783 + } + }, + { + "start": 396519.497375678, + "first": 396519.628242119, + "last": 396528.56981389, + "end": 396528.569953811, + "elapsed_s": 9.072578133025672, + "chunk_offsets_s": [ + 0.13086644100258127, + 0.6121341150137596, + 0.713854945031926, + 0.8162822930025868, + 0.9206939970026724, + 1.0270757200196385, + 1.128166015027091, + 1.2308007570100017, + 1.3337467350065708, + 1.433522729028482, + 1.533398389001377, + 1.634023463993799, + 1.7360791450482793, + 1.8383932920405641, + 1.9383044560090639, + 2.042114746000152, + 2.1489284410490654, + 2.250952825008426, + 2.351478955009952, + 2.4528336370131, + 2.5553511939942837, + 2.6556133220437914, + 2.756274476996623, + 2.860262913047336, + 2.963014072040096, + 3.0692823060089722, + 3.1711774570285343, + 3.2752971739973873, + 3.3772418620064855, + 3.4828310330049135, + 3.5898002019966953, + 3.6967337540118024, + 3.7941439340356737, + 3.8943125560181215, + 3.995953449048102, + 4.094854971044697, + 4.19490661600139, + 4.3014830450410955, + 4.405468313023448, + 4.506332685996313, + 4.608224205032457, + 4.7098096730187535, + 4.8118048420292325, + 4.887213607027661, + 4.995118161023129, + 5.097035089042038, + 5.202255823998712, + 5.30263928102795, + 5.406123902997933, + 5.514020328992046, + 5.620332018996123, + 5.72334302199306, + 5.828077673038933, + 5.933881134027615, + 6.039533538045362, + 6.1459770210203715, + 6.250754537002649, + 6.359239592042286, + 6.460113677021582, + 6.5612367410212755, + 6.662486974033527, + 6.758208529034164, + 6.859450634045061, + 6.961511066998355, + 7.06288466101978, + 7.166691831022035, + 7.264010346028954, + 7.371138156042434, + 7.476054313010536, + 7.5825083090458065, + 7.6852276440477, + 7.786756792047527, + 7.889127324044239, + 7.99086455401266, + 8.093291342025623, + 8.198538494005334, + 8.301641673024278, + 8.404169934045058, + 8.50495126703754, + 8.609099752036855, + 8.713287726044655, + 8.817611141013913, + 8.925055626023095, + 9.012120121042244, + 9.072438211995177 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.42706799181178, + "p95": 107.44448500918224, + "max": 481.2676740111783 + } + }, + { + "start": 396519.49777237, + "first": 396519.755252747, + "last": 396528.569407038, + "end": 396528.569501855, + "elapsed_s": 9.071729485003743, + "chunk_offsets_s": [ + 0.2574803769821301, + 0.6117913760244846, + 0.7137551039922982, + 0.8156454709824175, + 0.9204918990144506, + 1.0270024390192702, + 1.1278170670266263, + 1.2304575699963607, + 1.3334821719909087, + 1.4329095230204985, + 1.5327011980116367, + 1.6337582769920118, + 1.7354450579732656, + 1.8380477679893374, + 1.9379757330170833, + 2.0419191439868882, + 2.148669173999224, + 2.2506122780032456, + 2.351328122022096, + 2.452358031994663, + 2.554822725011036, + 2.655012244009413, + 2.7559370180242695, + 2.8599203170160763, + 2.9627581179956906, + 3.068954958987888, + 3.170832765987143, + 3.274980466987472, + 3.3769602429820225, + 3.4824949339963496, + 3.5895391270169057, + 3.6963898470276035, + 3.793807065987494, + 3.894142634002492, + 3.9956110609928146, + 4.094668617006391, + 4.194612741004676, + 4.301151890016627, + 4.405255973979365, + 4.50611369201215, + 4.607924729993101, + 4.709752200986259, + 4.811173570982646, + 4.887053061975166, + 4.994949918997008, + 5.096768365998287, + 5.201925340981688, + 5.30240127799334, + 5.4058873250032775, + 5.513731669983827, + 5.6201836980180815, + 5.72323686000891, + 5.827570723020472, + 5.93362188298488, + 6.0394719209871255, + 6.145893803972285, + 6.250437733018771, + 6.358901716012042, + 6.45980543398764, + 6.560922530014068, + 6.662281739991158, + 6.7579586550127715, + 6.859292393026408, + 6.96118868002668, + 7.06254270602949, + 7.166525301989168, + 7.26377565599978, + 7.3704470450174995, + 7.475733942002989, + 7.58222222601762, + 7.684942280990072, + 7.786520676978398, + 7.888983657991048, + 7.990287203982007, + 8.092805001011584, + 8.198265114973765, + 8.30147805501474, + 8.403931292006746, + 8.504404941981193, + 8.608996151015162, + 8.713243965001311, + 8.81740446697222, + 8.924757159024011, + 9.011821685999166, + 9.071634667983744 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.46383701451123, + "p95": 107.35269205179065, + "max": 354.3109990423545 + } + }, + { + "start": 396519.496985259, + "first": 396519.883263912, + "last": 396528.568170098, + "end": 396528.568309939, + "elapsed_s": 9.071324680000544, + "chunk_offsets_s": [ + 0.3862786529934965, + 0.6123477640212514, + 0.7144344529951923, + 0.8163340369937941, + 0.9211621599970385, + 1.0275400269892998, + 1.1284765449818224, + 1.231032503012102, + 1.3340542250080034, + 1.4336000250186771, + 1.533596198016312, + 1.6344738029874861, + 1.7361577529809438, + 1.8385515650152229, + 1.9386294499854557, + 2.0424270359799266, + 2.1494039809913374, + 2.2511972750071436, + 2.35179591801716, + 2.4530564229935408, + 2.5554392270278186, + 2.655707433994394, + 2.7565824150224216, + 2.860512305982411, + 2.9632365540019237, + 3.0695746439741924, + 3.1714174749795347, + 3.2755604879930615, + 3.377540503977798, + 3.4831388110178523, + 3.590112923993729, + 3.69702604401391, + 3.7943730549886823, + 3.8946401739958674, + 3.9962604109896347, + 4.095186093007214, + 4.195206217991654, + 4.301733479020186, + 4.405964557023253, + 4.506788001977839, + 4.60850691102678, + 4.7101196920266375, + 4.811852073005866, + 4.887454905023333, + 4.995393090997823, + 5.097310098004527, + 5.202500353974756, + 5.302915667009074, + 5.406400448991917, + 5.5143083310103975, + 5.620582100993488, + 5.723792129021604, + 5.828153848007787, + 5.934133519011084, + 6.039743394998368, + 6.146283567009959, + 6.251008298015222, + 6.35943752899766, + 6.460376079019625, + 6.56138358998578, + 6.6626897910027765, + 6.758440115023404, + 6.860027439019177, + 6.9617984449723735, + 7.06300016597379, + 7.166961000999436, + 7.264293308020569, + 7.371130971005186, + 7.476276602013968, + 7.58279339899309, + 7.685450316988863, + 7.786954408977181, + 7.8894131819834, + 7.990803176013287, + 8.09352689498337, + 8.19882939197123, + 8.30189863499254, + 8.40445129602449, + 8.50510214798851, + 8.609365737996995, + 8.713539552001748, + 8.81786018202547, + 8.925341163994744, + 9.012394683028106, + 9.071184839005582 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 102.42629252024926, + "p95": 107.48098196927458, + "max": 226.06911102775484 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 33.9, + "per_stream_tps": 33.9, + "ttft_s_max": 0.2, + "request": { + "ttft_s": 0.2, + "decode_tps": 33.877, + "prompt_ttft_tps": 159.947, + "prefill_tps": 159.947, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 29.519, + "round_gap_p50_ms": 65.101, + "round_gap_p95_ms": 78.962, + "tokens_per_chunk": 2.246, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.2, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2, + "last_output_s": 7.728 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 159.947, + "aggregate_prefill_tps": 159.947, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 29.519, + "round_gap_p50_ms": 65.101, + "round_gap_p95_ms": 78.962, + "tokens_per_chunk": 2.246 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 33.12423985157316, + "makespan_s": 7.728479238983709, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 34.5857970998938, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.573074486979749, + "end_to_end_tps": 33.80397227574299, + "timing_valid": true, + "per_stream_tps": [ + 34.6 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19991701800609007, + "decode_tps": 34.5857970998938, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.06641315060622, + "prefill_tps": 160.06641315060622, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.913602803824652, + "round_gap_p50_ms": 64.23139298567548, + "round_gap_p95_ms": 73.98168003419414, + "tokens_per_chunk": 2.245614035087719, + "headers_s": 0.0010796260321512818, + "first_payload_s": 0.0010939789935946465, + "first_content_s": 0.19991701800609007, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19991701800609007, + "last_output_s": 7.572885732981376 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.913602803824652, + "round_gap_p50_ms": 64.23139298567548, + "round_gap_p95_ms": 73.98168003419414, + "round_gap_mean_ms": 65.24751075199369, + "tokens_per_chunk": 2.245614035087719, + "aggregate_prompt_ttft_tps": 160.06641315060622, + "aggregate_prefill_tps": 160.06641315060622 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396548.086268608, + "first": 396548.286185626, + "last": 396555.659154341, + "end": 396555.659343095, + "elapsed_s": 7.573074486979749, + "chunk_offsets_s": [ + 0.19991701800609007, + 0.2707934830104932, + 0.3372192980023101, + 0.3995409600320272, + 0.46176276600454, + 0.5323327329824679, + 0.5994694179971702, + 0.6617259919876233, + 0.7319504669867456, + 0.7987821419956163, + 0.8668780520092696, + 0.9373832659912296, + 0.9960071970126592, + 1.0562528389855288, + 1.1174175619962625, + 1.1800529879983515, + 1.2481063380255364, + 1.308112250000704, + 1.3682943879975937, + 1.4323121309862472, + 1.5015977490111254, + 1.5698454049997963, + 1.6407974080066197, + 1.7143796919845045, + 1.7892252199817449, + 1.8491734680137597, + 1.91430461400887, + 1.9822924110339954, + 2.0500213259947486, + 2.1102222640183754, + 2.1693269360112026, + 2.231470820028335, + 2.2971160350134596, + 2.35820680600591, + 2.4341426489991136, + 2.5082376259961165, + 2.5822193060303107, + 2.654370679985732, + 2.7249950949917547, + 2.7959275619941764, + 2.8722451680223458, + 2.940158788987901, + 3.0029864250100218, + 3.0729229130083695, + 3.139450361020863, + 3.213108422001824, + 3.281537664006464, + 3.3457690569921397, + 3.41180051502306, + 3.4740972020081244, + 3.5354173830128275, + 3.597503778990358, + 3.659200794994831, + 3.7206380169955082, + 3.7805863770190626, + 3.8448136739898473, + 3.91219069698127, + 3.9751659340108745, + 4.045241176034324, + 4.114147207001224, + 4.182510191982146, + 4.24924373801332, + 4.31491700100014, + 4.379017336992547, + 4.455071069009136, + 4.521720806020312, + 4.580365520028863, + 4.643559750984423, + 4.706151880032849, + 4.768486886983737, + 4.830285729025491, + 4.892980771022849, + 4.956508092989679, + 5.025812559004407, + 5.0928995800204575, + 5.15236291103065, + 5.2126810339977965, + 5.2772163019981235, + 5.338591348030604, + 5.4029297980014235, + 5.473052815999836, + 5.539265013008844, + 5.6112100970349275, + 5.6807601019972935, + 5.751432310033124, + 5.819848255021498, + 5.882921156997327, + 5.944448908034246, + 6.008470219036099, + 6.071622322022449, + 6.134230835014023, + 6.195329510024749, + 6.265819380001631, + 6.33523485501064, + 6.398828322009649, + 6.468843963986728, + 6.542618778010365, + 6.60168220102787, + 6.6618142740335315, + 6.722595122002531, + 6.7845021720277146, + 6.844173345016316, + 6.903466705989558, + 6.964871686999686, + 7.032751307997387, + 7.096091908984818, + 7.155038258002605, + 7.213779470010195, + 7.275161298981402, + 7.334948104980867, + 7.39422887400724, + 7.4593219719827175, + 7.523776327027008, + 7.572885732981376 + ], + "chunk_gaps_ms": { + "count": 113, + "p50": 64.23139298567548, + "p95": 73.98168003419414, + "max": 76.3176060281694 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 33.87690970309049, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.728479238983709, + "end_to_end_tps": 33.12423985157316, + "timing_valid": true, + "per_stream_tps": [ + 33.9 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.2011558460071683, + "decode_tps": 33.87690970309049, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 159.0806364079504, + "prefill_tps": 159.0806364079504, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 29.518631090154397, + "round_gap_p50_ms": 65.10114500997588, + "round_gap_p95_ms": 78.96232104394585, + "tokens_per_chunk": 2.245614035087719, + "headers_s": 0.0011972750071436167, + "first_payload_s": 0.0011995629756711423, + "first_content_s": 0.2011558460071683, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2011558460071683, + "last_output_s": 7.728406773996539 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 29.518631090154397, + "round_gap_p50_ms": 65.10114500997588, + "round_gap_p95_ms": 78.96232104394585, + "round_gap_mean_ms": 66.6128400707024, + "tokens_per_chunk": 2.245614035087719, + "aggregate_prompt_ttft_tps": 159.0806364079504, + "aggregate_prefill_tps": 159.0806364079504 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396555.660141055, + "first": 396555.861296901, + "last": 396563.388547829, + "end": 396563.388620294, + "elapsed_s": 7.728479238983709, + "chunk_offsets_s": [ + 0.2011558460071683, + 0.27184378099627793, + 0.34210440097376704, + 0.41091255901847035, + 0.47972095699515194, + 0.5487717089708894, + 0.6174536889884621, + 0.6886014060000889, + 0.7633542449912056, + 0.8308666300144978, + 0.8988649880047888, + 0.9704884529928677, + 1.0361548679647967, + 1.0959499619784765, + 1.1574817929649726, + 1.2192623949958943, + 1.286356088006869, + 1.346517200989183, + 1.4084268279839307, + 1.481206992000807, + 1.548124602995813, + 1.6074458049843088, + 1.6746200749767013, + 1.7446763559710234, + 1.8223208719864488, + 1.8891088819946162, + 1.9589013530057855, + 2.027894408965949, + 2.1008088309899904, + 2.1674545349669643, + 2.2291886719758622, + 2.291501118976157, + 2.356602263986133, + 2.415555862011388, + 2.4759173140046187, + 2.5350496169994585, + 2.59889577497961, + 2.6621799739659764, + 2.7260724519728683, + 2.7993523339973763, + 2.8762617059983313, + 2.9441319350153208, + 3.0141406640177593, + 3.08096624299651, + 3.146527424978558, + 3.2162087109754793, + 3.2820031750015914, + 3.3556785159744322, + 3.431825593987014, + 3.4992664260207675, + 3.5579595569870435, + 3.626686305971816, + 3.688368203002028, + 3.7503084689960815, + 3.8123159849783406, + 3.8751461649662815, + 3.9414985540206544, + 4.00451203197008, + 4.066347385989502, + 4.136572837014683, + 4.207429974980187, + 4.273842109018005, + 4.335203073977027, + 4.39672637701733, + 4.461530896020122, + 4.521476807014551, + 4.586953796970192, + 4.648815598979127, + 4.709442941006273, + 4.770884946978185, + 4.83115609397646, + 4.8953900469932705, + 4.9655422500218265, + 5.027008367993403, + 5.0862913290038705, + 5.144801995018497, + 5.203936425969005, + 5.264327878016047, + 5.3243131340132095, + 5.386672700988129, + 5.456158912973478, + 5.518108011980075, + 5.580350889998954, + 5.642444885976147, + 5.703363142965827, + 5.764310521015432, + 5.827386221964844, + 5.889468106965069, + 5.957608818018343, + 6.018982342968229, + 6.078994015988428, + 6.138071182009298, + 6.202402257011272, + 6.260165506973863, + 6.319458163983654, + 6.380545382970013, + 6.4487912629847415, + 6.509478173975367, + 6.570294717967045, + 6.630495127988979, + 6.690554224012885, + 6.750516312022228, + 6.820485744974576, + 6.897907153994311, + 6.979968113009818, + 7.060510192997754, + 7.135483051009942, + 7.210466564982198, + 7.291390169004444, + 7.369517728977371, + 7.448480050021317, + 7.5466099649784155, + 7.658998402999714, + 7.728406773996539 + ], + "chunk_gaps_ms": { + "count": 113, + "p50": 65.10114500997588, + "p95": 78.96232104394585, + "max": 112.3884380212985 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 31.423016658661627, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 8.31521326303482, + "end_to_end_tps": 30.786943389419115, + "timing_valid": true, + "per_stream_tps": [ + 31.4 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.20006586704403162, + "decode_tps": 31.423016658661627, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 159.9473237129313, + "prefill_tps": 159.9473237129313, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.823806442986882, + "round_gap_p50_ms": 70.35890896804631, + "round_gap_p95_ms": 88.67817500140518, + "tokens_per_chunk": 2.265486725663717, + "headers_s": 0.0009746970026753843, + "first_payload_s": 0.0009764090063981712, + "first_content_s": 0.20006586704403162, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.20006586704403162, + "last_output_s": 8.315136510005686 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.823806442986882, + "round_gap_p50_ms": 70.35890896804631, + "round_gap_p95_ms": 88.67817500140518, + "round_gap_mean_ms": 72.4559878835862, + "tokens_per_chunk": 2.265486725663717, + "aggregate_prompt_ttft_tps": 159.9473237129313, + "aggregate_prefill_tps": 159.9473237129313 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396563.389329533, + "first": 396563.5893954, + "last": 396571.704466043, + "end": 396571.704542796, + "elapsed_s": 8.31521326303482, + "chunk_offsets_s": [ + 0.20006586704403162, + 0.2705964100314304, + 0.339521081012208, + 0.4098456210340373, + 0.48010913701727986, + 0.5493449150235392, + 0.6192063950002193, + 0.6899871480418369, + 0.765376138035208, + 0.832170372013934, + 0.9005135970073752, + 0.973061120021157, + 1.0409763409988955, + 1.1113197770318948, + 1.1806186600006185, + 1.26143111102283, + 1.3494507030118257, + 1.416470299998764, + 1.4857121900422499, + 1.5586320030270144, + 1.6493197660311125, + 1.7367308250395581, + 1.8223484590416774, + 1.9249414090299979, + 2.023245406046044, + 2.1119235810474493, + 2.196366675023455, + 2.2804987900308333, + 2.3750774870277382, + 2.465616672008764, + 2.546561716008, + 2.6137061140034348, + 2.677511918998789, + 2.744452506012749, + 2.806277620024048, + 2.8807442650431767, + 2.954556696000509, + 3.0281463880091906, + 3.10032070602756, + 3.1754663180327043, + 3.2490882830461487, + 3.319526967999991, + 3.389146766043268, + 3.4593297210521996, + 3.531025475007482, + 3.598171425051987, + 3.669636808044743, + 3.7412842260091566, + 3.8158043270232156, + 3.883609306998551, + 3.9550724350265227, + 4.0258438440505415, + 4.096202753018588, + 4.166487645008601, + 4.23544415604556, + 4.305900602019392, + 4.386662908014841, + 4.4576241910108365, + 4.52829892700538, + 4.602442513045389, + 4.671705667045899, + 4.7414234330062754, + 4.809790323022753, + 4.87872989004245, + 4.955845041025896, + 5.023432690999471, + 5.0935904460493475, + 5.162049592006952, + 5.229062148020603, + 5.297486718045548, + 5.369458235043567, + 5.444550022017211, + 5.522302811034024, + 5.589991934015416, + 5.653748826007359, + 5.723337424045894, + 5.792298527027015, + 5.8603037490393035, + 5.930691714049317, + 6.004503281030338, + 6.080855367996264, + 6.15369535703212, + 6.225522824039217, + 6.291931983025279, + 6.364379392005503, + 6.434205848025158, + 6.5044967560097575, + 6.576572594000027, + 6.6529581370414235, + 6.72152811702108, + 6.787594984052703, + 6.855493997049052, + 6.923970872012433, + 6.991681243001949, + 7.0624170990195125, + 7.135186864004936, + 7.209238689043559, + 7.278852662013378, + 7.344699463050347, + 7.411138750030659, + 7.480612722050864, + 7.551097201008815, + 7.622039731009863, + 7.691529096045997, + 7.763580933038611, + 7.833403309050482, + 7.907468990015332, + 7.975394611014053, + 8.043378089030739, + 8.112845293013379, + 8.180893763026688, + 8.253446390037425, + 8.315136510005686 + ], + "chunk_gaps_ms": { + "count": 112, + "p50": 70.37343698902987, + "p95": 88.67817500140518, + "max": 102.59294998832047 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 56.2, + "per_stream_tps": 28.1, + "ttft_s_max": 0.39, + "request": { + "ttft_s": 0.294, + "decode_tps": 28.104, + "prompt_ttft_tps": 121.551, + "prefill_tps": 121.551, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.582, + "round_gap_p50_ms": 80.712, + "round_gap_p95_ms": 84.981, + "tokens_per_chunk": 2.306, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.294, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.294, + "last_output_s": 9.276 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 163.918, + "aggregate_prefill_tps": 163.918, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.217, + "round_gap_p50_ms": 80.716, + "round_gap_p95_ms": 84.939, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 55.18864106741694, + "makespan_s": 9.277271375001874, + "steady_tps": 57.3, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 56.177407401369706, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.277271375001874, + "end_to_end_tps": 55.18864106741694, + "timing_valid": true, + "steady_tps": 57.30475462018066, + "per_stream_tps": [ + 28.7, + 28.1 + ], + "ttft_s": [ + 0.39, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3935623280121945, + "decode_tps": 28.707147660544926, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.30859516363184, + "prefill_tps": 81.30859516363184, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.83453012555472, + "round_gap_p50_ms": 80.733569979202, + "round_gap_p95_ms": 84.5980389858596, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.001813345996197313, + "first_payload_s": 0.0018170900293625891, + "first_content_s": 0.3935623280121945, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3935623280121945, + "last_output_s": 9.27636751002865 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19870777503820136, + "decode_tps": 28.0905224281308, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.0405027878151, + "prefill_tps": 161.0405027878151, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.59919551366429, + "round_gap_p50_ms": 80.69070504279807, + "round_gap_p95_ms": 84.85127403400838, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002378151984885335, + "first_payload_s": 0.0023811919963918626, + "first_content_s": 0.19870777503820136, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19870777503820136, + "last_output_s": 9.276502631022595 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.2168628196095, + "round_gap_p50_ms": 80.71621000999585, + "round_gap_p95_ms": 84.5980389858596, + "round_gap_mean_ms": 81.63909108182203, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 162.31903953248218, + "aggregate_prefill_tps": 162.31903953248218 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396571.707244806, + "first": 396572.100807134, + "last": 396580.983612316, + "end": 396580.983793278, + "elapsed_s": 9.276548472000286, + "chunk_offsets_s": [ + 0.3935623280121945, + 0.47478302201488987, + 0.5558520519989543, + 0.6364507080288604, + 0.7180714390124194, + 0.7992364690289833, + 0.8790767019963823, + 0.9623952889814973, + 1.0430959310033359, + 1.121809785021469, + 1.201950852992013, + 1.286918672034517, + 1.366124916006811, + 1.4481119380216114, + 1.5287397149950266, + 1.609168705996126, + 1.6901025819825009, + 1.7698851660243236, + 1.8540599700063467, + 1.9386580089922063, + 2.018291920016054, + 2.094878330011852, + 2.1782184049952775, + 2.260438709985465, + 2.3453169760177843, + 2.4277979229809716, + 2.5120238949893974, + 2.5908089019940235, + 2.6718102670274675, + 2.7527827030280605, + 2.8313462840160355, + 2.9111775570199825, + 2.9901980540016666, + 3.068889059999492, + 3.1538508469820954, + 3.2384293990326114, + 3.3217121299821883, + 3.402834118984174, + 3.482074922998436, + 3.5645399980130605, + 3.6446007930207998, + 3.725471212004777, + 3.809510526014492, + 3.8864491159911267, + 3.968640331993811, + 4.052215609000996, + 4.133203166013118, + 4.211417926999275, + 4.294024378992617, + 4.3750682240352035, + 4.45547062298283, + 4.5366875100298785, + 4.617379974981304, + 4.69640034501208, + 4.782426142017357, + 4.863570052024443, + 4.944740410021041, + 5.02585952001391, + 5.1059540919959545, + 5.188138940022327, + 5.267457359994296, + 5.34558957698755, + 5.427789801033214, + 5.506898427032866, + 5.5877101580263115, + 5.6678354979958385, + 5.745601054979488, + 5.827563036989886, + 5.910506932996213, + 5.994278756028507, + 6.075926399033051, + 6.154984992987011, + 6.229062578000594, + 6.31042506598169, + 6.39045528502902, + 6.469485159032047, + 6.549859236984048, + 6.632952910033055, + 6.713753536983859, + 6.797367695020512, + 6.877439834002871, + 6.954859068035148, + 7.038641964027192, + 7.122317866014782, + 7.204978191002738, + 7.286778106994461, + 7.367096472997218, + 7.446795809024479, + 7.523980465019122, + 7.604714034998324, + 7.683744003996253, + 7.762196319992654, + 7.846052784007043, + 7.927647595002782, + 8.006097670993768, + 8.086359011998866, + 8.163676917029079, + 8.240243149979506, + 8.32044095499441, + 8.402252807980403, + 8.482642838032916, + 8.562341278011445, + 8.64113428501878, + 8.723537551995832, + 8.80962139798794, + 8.887063495989423, + 8.966070217022207, + 9.046257510024589, + 9.12639265798498, + 9.209866719029378, + 9.27636751002865 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 80.76709846500307, + "p95": 84.5980389858596, + "max": 86.08384599210694 + } + }, + { + "start": 396571.706521903, + "first": 396571.905229678, + "last": 396580.983024534, + "end": 396580.983169064, + "elapsed_s": 9.276647160993889, + "chunk_offsets_s": [ + 0.19870777503820136, + 0.4754177160211839, + 0.5563966489862651, + 0.6369282809901051, + 0.7187053170055151, + 0.7998633870156482, + 0.8796211070148274, + 0.9632272970047779, + 1.043727281037718, + 1.1224040469969623, + 1.2025299629895017, + 1.28738123702351, + 1.3667578339809552, + 1.448642183037009, + 1.5293752889847383, + 1.6096743100206368, + 1.6905392259941436, + 1.770429635012988, + 1.8546577509841882, + 1.9391075660241768, + 2.0188428219989873, + 2.0953363989829086, + 2.1786722980323248, + 2.2609054340282455, + 2.3457761330064386, + 2.4281533180037513, + 2.5124893879983574, + 2.5913664110121317, + 2.6723198399995454, + 2.7533731249859557, + 2.831823136017192, + 2.9117150499951094, + 2.990631658001803, + 3.0694471140159294, + 3.154433508985676, + 3.2388425550307147, + 3.3221592220361345, + 3.403246571018826, + 3.4825729120057076, + 3.5651296509895474, + 3.6451872790348716, + 3.725977441004943, + 3.8099645790061913, + 3.886965584999416, + 3.9692152650095522, + 4.052828335028607, + 4.133714563038666, + 4.211991932999808, + 4.294530223996844, + 4.375674566021189, + 4.456047796993516, + 4.537291963992175, + 4.617982669034973, + 4.696976062026806, + 4.782700976997148, + 4.863939383998513, + 4.945022412983235, + 5.026286180014722, + 5.106354032002855, + 5.188536672038026, + 5.268057557987049, + 5.3461134700337425, + 5.428289070026949, + 5.507507425034419, + 5.588141522021033, + 5.668283390987199, + 5.746184916992206, + 5.8281058429856785, + 5.910990824981127, + 5.994768008997198, + 6.076321075030137, + 6.155511813994963, + 6.22962976800045, + 6.31103105598595, + 6.391061483009253, + 6.469973772007506, + 6.550302024988923, + 6.633389778027777, + 6.7141059880377725, + 6.797976836038288, + 6.877954911033157, + 6.955448321998119, + 7.039226945023984, + 7.1229216160136275, + 7.205344723013695, + 7.2874184339889325, + 7.367664558987599, + 7.4474014150328, + 7.524468229035847, + 7.605109911004547, + 7.684217241010629, + 7.762752693030052, + 7.846132913022302, + 7.927855308982544, + 8.006579547014553, + 8.086847065016627, + 8.164169882016722, + 8.240822740015574, + 8.321042273018975, + 8.402745484025218, + 8.48314071499044, + 8.562821939005516, + 8.641733571013901, + 8.724003828014247, + 8.810212826996576, + 8.887634716986213, + 8.966564558038954, + 9.046501384000294, + 9.12687525403453, + 9.210322451021057, + 9.276502631022595 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 80.70345752639696, + "p95": 84.85127403400838, + "max": 276.7099409829825 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 56.23221921511285, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.266577090020292, + "end_to_end_tps": 55.25233266028749, + "timing_valid": true, + "steady_tps": 57.3452744956499, + "per_stream_tps": [ + 28.1, + 28.7 + ], + "ttft_s": [ + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19689494103658944, + "decode_tps": 28.11800039399238, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.52322091939052, + "prefill_tps": 162.52322091939052, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.564406643000744, + "round_gap_p50_ms": 80.63504099845886, + "round_gap_p95_ms": 84.9392749951221, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0011956600355915725, + "first_payload_s": 0.0012016120017506182, + "first_content_s": 0.19689494103658944, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19689494103658944, + "last_output_s": 9.265818635001779 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.38995203701779246, + "decode_tps": 28.727373471910692, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.06137412365902, + "prefill_tps": 82.06137412365902, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.81000450590406, + "round_gap_p50_ms": 80.64796996768564, + "round_gap_p95_ms": 85.02282801782712, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016293119988404214, + "first_payload_s": 0.0016315520042553544, + "first_content_s": 0.38995203701779246, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38995203701779246, + "last_output_s": 9.266503186023328 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.1872055744524, + "round_gap_p50_ms": 80.64796996768564, + "round_gap_p95_ms": 84.9392749951221, + "round_gap_mean_ms": 81.57034019532148, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.12274824731804, + "aggregate_prefill_tps": 164.12274824731804 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396580.984861144, + "first": 396581.181756085, + "last": 396590.250679779, + "end": 396590.250810548, + "elapsed_s": 9.265949404041748, + "chunk_offsets_s": [ + 0.19689494103658944, + 0.47037048399215564, + 0.5522601130069233, + 0.6327932010171935, + 0.7124481369974092, + 0.7927609670441598, + 0.8755436930223368, + 0.9561448290478438, + 1.03782642504666, + 1.1162076040054671, + 1.19538690301124, + 1.2784861760446802, + 1.3581831280025654, + 1.4390909069916233, + 1.5203664990258403, + 1.6007760660140775, + 1.680597739003133, + 1.7600768170086667, + 1.8447492410195991, + 1.9297256200225092, + 2.010919546999503, + 2.0872359060449526, + 2.1698434140416794, + 2.255387654993683, + 2.3370285620330833, + 2.4174047690466978, + 2.502666719025001, + 2.582211125001777, + 2.6630806970060803, + 2.7440099809900858, + 2.822130181011744, + 2.9022911060019396, + 2.981226226023864, + 3.0610522350179963, + 3.1459915100131184, + 3.2308146720170043, + 3.3132081310031936, + 3.395052879001014, + 3.4740632330067456, + 3.5566579890437424, + 3.6364579499932006, + 3.716870397038292, + 3.8000607430003583, + 3.8803012520074844, + 3.9629861210123636, + 4.044414673990104, + 4.125092611007858, + 4.204607818042859, + 4.286292645032518, + 4.368439509009477, + 4.449354745040182, + 4.530963107012212, + 4.610560826025903, + 4.69364371499978, + 4.778582302038558, + 4.859857445990201, + 4.941380303003825, + 5.0228861210052855, + 5.102362542995252, + 5.182997583993711, + 5.262977514998056, + 5.344514116994105, + 5.423720056016464, + 5.503645202028565, + 5.584567750047427, + 5.664455872029066, + 5.7420397470123135, + 5.821685114991851, + 5.905064119026065, + 5.989057640021201, + 6.070432976994198, + 6.148254743020516, + 6.222829389036633, + 6.303066138003487, + 6.38345866499003, + 6.462182039045729, + 6.543843890016433, + 6.626763514010236, + 6.707686125999317, + 6.790931672032457, + 6.871662522025872, + 6.951876055041794, + 7.035081873997115, + 7.1151549410424195, + 7.196886329038534, + 7.278089247993194, + 7.360041662002914, + 7.439618661010172, + 7.5174349379958585, + 7.595949047012255, + 7.674610197020229, + 7.753222594037652, + 7.836079049040563, + 7.917918454040773, + 7.9975255650351755, + 8.078237503010314, + 8.155547392030712, + 8.23289827303961, + 8.31303330900846, + 8.397668596997391, + 8.475530411000364, + 8.554517372045666, + 8.6321791849914, + 8.713539577031042, + 8.79901720903581, + 8.87747827701969, + 8.956782841007225, + 9.037226265005302, + 9.116786367027089, + 9.200154171034228, + 9.265818635001779 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 80.65648900810629, + "p95": 84.9392749951221, + "max": 273.4755429555662 + } + }, + { + "start": 396580.984786471, + "first": 396581.374738508, + "last": 396590.251289657, + "end": 396590.251363561, + "elapsed_s": 9.266577090020292, + "chunk_offsets_s": [ + 0.38995203701779246, + 0.4707738959696144, + 0.5526314289891161, + 0.6333908070228063, + 0.7127452280255966, + 0.7927190940245055, + 0.8756952140247449, + 0.9564012319897301, + 1.0381683639716357, + 1.116506694990676, + 1.1956434809835628, + 1.2786431220010854, + 1.3584700589999557, + 1.439413695014082, + 1.520763511012774, + 1.6011955899884924, + 1.6808007169747725, + 1.7604732050094754, + 1.8451145089929923, + 1.9301673049922101, + 2.0112006699782796, + 2.087460275972262, + 2.1704237239900976, + 2.255679226014763, + 2.337472806975711, + 2.417744468024466, + 2.5028626889688894, + 2.5824354799697176, + 2.6635559819987975, + 2.7444212649716064, + 2.8226126339868642, + 2.9028038950054906, + 2.981756647990551, + 3.0612880300031975, + 3.146317865990568, + 3.2311936839832924, + 3.313501445984002, + 3.3955964209744707, + 3.474626118026208, + 3.5568940229713917, + 3.6368907060241327, + 3.7172686249832623, + 3.8004394830204546, + 3.8801314270240255, + 3.963174347009044, + 4.044943911023438, + 4.125454695022199, + 4.205204048019368, + 4.286600807972718, + 4.368979146005586, + 4.449627115973271, + 4.531263543001842, + 4.610976382973604, + 4.694041606970131, + 4.7790644349879585, + 4.860425275983289, + 4.941667730978224, + 5.023054875025991, + 5.10274208302144, + 5.183360371971503, + 5.263421503012069, + 5.344974584993906, + 5.423954841971863, + 5.503852292022202, + 5.585020715021528, + 5.664820612000767, + 5.74227746197721, + 5.8221311349770986, + 5.905516155005898, + 5.989572158025112, + 6.0707694760058075, + 6.148708875000011, + 6.2230660149944015, + 6.303288588009309, + 6.383747868007049, + 6.4625745710218325, + 6.544075940968469, + 6.627111677022185, + 6.7079821130027995, + 6.791304412006866, + 6.87220249598613, + 6.9516855260008015, + 7.035470485978294, + 7.115520353021566, + 7.19711119600106, + 7.278764166985638, + 7.360422113968525, + 7.440104858018458, + 7.517733932996634, + 7.596333034976851, + 7.674834678997286, + 7.753795143973548, + 7.836281243013218, + 7.918185768998228, + 7.997889216989279, + 8.078549009980634, + 8.155922788020689, + 8.233181492018048, + 8.313231422973331, + 8.398004217015114, + 8.475901566969696, + 8.5550240019802, + 8.632645396981388, + 8.713797276024707, + 8.799172363011166, + 8.877950233989395, + 8.957223917997908, + 9.037494364019949, + 9.11732334899716, + 9.200548271008302, + 9.266503186023328 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 80.65388147952035, + "p95": 85.02282801782712, + "max": 85.37508698645979 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 53.41497180420339, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.74627004400827, + "end_to_end_tps": 52.53291748413672, + "timing_valid": true, + "steady_tps": 54.40843102718616, + "per_stream_tps": [ + 27.3, + 26.7 + ], + "ttft_s": [ + 0.39, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3903375930385664, + "decode_tps": 27.258021319593066, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.98031798807119, + "prefill_tps": 81.98031798807119, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 36.68644867047631, + "round_gap_p50_ms": 81.49656903697178, + "round_gap_p95_ms": 103.07791602099314, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012322520487941802, + "first_payload_s": 0.001234924013260752, + "first_content_s": 0.3903375930385664, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3903375930385664, + "last_output_s": 9.745382004010025 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.197682628990151, + "decode_tps": 26.707485902101695, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.87562945449454, + "prefill_tps": 161.87562945449454, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 37.44268568241786, + "round_gap_p50_ms": 81.42986497841775, + "round_gap_p95_ms": 103.16389997024089, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012113559641875327, + "first_payload_s": 0.0012157079763710499, + "first_content_s": 0.197682628990151, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.197682628990151, + "last_output_s": 9.745567478006706 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 37.064567176447085, + "round_gap_p50_ms": 81.49656903697178, + "round_gap_p95_ms": 103.07791602099314, + "round_gap_mean_ms": 85.92240572721825, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 163.918285483948, + "aggregate_prefill_tps": 163.918285483948 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396590.252394259, + "first": 396590.642731852, + "last": 396599.997776263, + "end": 396599.998563454, + "elapsed_s": 9.746169195044786, + "chunk_offsets_s": [ + 0.3903375930385664, + 0.4720804370008409, + 0.5531260740244761, + 0.6333997520268895, + 0.7172145040240139, + 0.7982815650175326, + 0.8785124110290781, + 0.9600200040149502, + 1.0405081000062637, + 1.1194087880430743, + 1.1988128090160899, + 1.2822634940384887, + 1.3611771750147454, + 1.4414016359951347, + 1.5219382120412774, + 1.6031557870446704, + 1.682921155996155, + 1.7630754240090027, + 1.8472409480018541, + 1.9323122720234096, + 2.0129151529981755, + 2.0900499200215563, + 2.1753676630323753, + 2.258581721049268, + 2.339393980044406, + 2.4195807770011015, + 2.504338674014434, + 2.58440678199986, + 2.6653436820488423, + 2.746999229013454, + 2.8249368040123954, + 2.905268018017523, + 2.9842053310130723, + 3.064119005051907, + 3.1491001690155827, + 3.234258230018895, + 3.316846282046754, + 3.3981322740437463, + 3.477458438021131, + 3.560980083013419, + 3.6407675960217603, + 3.721780257008504, + 3.8086556150228716, + 3.8857771180337295, + 3.9684923560125753, + 4.0495456250500865, + 4.130678303015884, + 4.209513855050318, + 4.291701711015776, + 4.373032903007697, + 4.453986955049913, + 4.536712769011501, + 4.618498621042818, + 4.699209935031831, + 4.784712271997705, + 4.865499330044258, + 4.9469359799986705, + 5.028432549035642, + 5.109059926006012, + 5.193004183995072, + 5.2737353380071, + 5.352646426006686, + 5.432722134049982, + 5.522876452014316, + 5.622440942039248, + 5.718891753000207, + 5.816579808015376, + 5.916235195007175, + 6.016998432052787, + 6.111419303051662, + 6.210508540039882, + 6.316332034999505, + 6.402763724036049, + 6.4837134730187245, + 6.564381122007035, + 6.64332179503981, + 6.724564410047606, + 6.807973606046289, + 6.89022995904088, + 6.973240863997489, + 7.053184762015007, + 7.131142177036963, + 7.2142834510304965, + 7.295216975035146, + 7.3766546320402995, + 7.459395501995459, + 7.541361500043422, + 7.622573283035308, + 7.699781475006603, + 7.779102455009706, + 7.858535165025387, + 7.937520270003006, + 8.020652936014812, + 8.103038889996242, + 8.19287875702139, + 8.295956673042383, + 8.394497424014844, + 8.492696669010911, + 8.595839433022775, + 8.701057530008256, + 8.800816436996683, + 8.901409705053084, + 9.000992803019471, + 9.104347057000268, + 9.211331699043512, + 9.310845708008856, + 9.410463270032778, + 9.512173908995464, + 9.594530727015808, + 9.67944105801871, + 9.745382004010025 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 81.50208101142198, + "p95": 103.07791602099314, + "max": 106.9846420432441 + } + }, + { + "start": 396590.25229341, + "first": 396590.449976039, + "last": 396599.997860888, + "end": 396599.997945176, + "elapsed_s": 9.745651765959337, + "chunk_offsets_s": [ + 0.197682628990151, + 0.4723588720080443, + 0.5533078360022046, + 0.6336145699606277, + 0.7175204589730129, + 0.7986305609811097, + 0.8788815179723315, + 0.9602117179892957, + 1.0406888379948214, + 1.1195932700065896, + 1.1991583490162157, + 1.2825899290037341, + 1.3615155779989436, + 1.4418345359736122, + 1.5221681339899078, + 1.603425036999397, + 1.6833347119973041, + 1.763445939985104, + 1.847443957987707, + 1.9327330599771813, + 2.0131525470060296, + 2.0903869309695438, + 2.175572481006384, + 2.2587911629816517, + 2.3396600949927233, + 2.4198642839910462, + 2.504750197986141, + 2.584865393990185, + 2.66554835595889, + 2.747348319971934, + 2.8253727440023795, + 2.905657077964861, + 2.984622870979365, + 3.064326671010349, + 3.149343978962861, + 3.2344679119996727, + 3.317304558993783, + 3.398515348962974, + 3.4777644249843433, + 3.5611891570151784, + 3.641124559973832, + 3.722202709002886, + 3.808552125992719, + 3.8860102079925127, + 3.968694773968309, + 4.049843212007545, + 4.131003281974699, + 4.209940178960096, + 4.292168963991571, + 4.373424810997676, + 4.45440868701553, + 4.536939458979759, + 4.618894704966806, + 4.699415328970645, + 4.784915025986265, + 4.86573621298885, + 4.947368879977148, + 5.028745880001225, + 5.109483945998363, + 5.193207017960958, + 5.274131214013323, + 5.352842075983062, + 5.432894439960364, + 5.523060389969032, + 5.62262495898176, + 5.719125546980649, + 5.816819681960624, + 5.91642577201128, + 6.017239762004465, + 6.111419942986686, + 6.210427179001272, + 6.316514277015813, + 6.403160927991848, + 6.484151796961669, + 6.564609955996275, + 6.643634614010807, + 6.724951037962455, + 6.808182567998301, + 6.890441032999661, + 6.973468946001958, + 7.05350932496367, + 7.131531413004268, + 7.214697278977837, + 7.295620099001098, + 7.377049963979516, + 7.45956763200229, + 7.541597470990382, + 7.622780853009317, + 7.699991236964706, + 7.779507018974982, + 7.858915104996413, + 7.937964114011265, + 8.021052972006146, + 8.103428557980806, + 8.19329431297956, + 8.296361476997845, + 8.394437455979642, + 8.493113712989725, + 8.596277612959966, + 8.701502957963385, + 8.801138008013368, + 8.901843564992305, + 9.001295125985052, + 9.104558243008796, + 9.211581604962703, + 9.311258927977178, + 9.410839434014633, + 9.512379863008391, + 9.59495033096755, + 9.679683315975126, + 9.745567478006706 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 81.53126598335803, + "p95": 103.16389997024089, + "max": 274.6762430178933 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.3, + "per_stream_tps": 21.6, + "ttft_s_max": 0.78, + "request": { + "ttft_s": 0.489, + "decode_tps": 21.584, + "prompt_ttft_tps": 67.917, + "prefill_tps": 67.917, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.331, + "round_gap_p50_ms": 103.673, + "round_gap_p95_ms": 107.874, + "tokens_per_chunk": 2.306, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.489, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.489, + "last_output_s": 12.153 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 163.65, + "aggregate_prefill_tps": 163.65, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.729, + "round_gap_p50_ms": 103.71, + "round_gap_p95_ms": 107.824, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 84.25549924066381, + "makespan_s": 12.153509375988506, + "steady_tps": 89.3, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.81838127618663, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.086128877999727, + "end_to_end_tps": 84.72522594591707, + "timing_valid": true, + "steady_tps": 89.75889045535881, + "per_stream_tps": [ + 22.6, + 21.8, + 22.2, + 21.5 + ], + "ttft_s": [ + 0.78, + 0.39, + 0.58, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.7763015599921346, + "decode_tps": 22.550365142902272, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.221094545171624, + "prefill_tps": 41.221094545171624, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.34517994112171, + "round_gap_p50_ms": 103.05647598579526, + "round_gap_p95_ms": 107.02176199993119, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016890729893930256, + "first_payload_s": 0.001691873010713607, + "first_content_s": 0.7763015599921346, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7763015599921346, + "last_output_s": 12.08432244497817 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3918097359710373, + "decode_tps": 21.808296387502143, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.67229413198004, + "prefill_tps": 81.67229413198004, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.85410901573578, + "round_gap_p50_ms": 103.06919499998912, + "round_gap_p95_ms": 106.86550399987027, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014753110008314252, + "first_payload_s": 0.0014784790109843016, + "first_content_s": 0.3918097359710373, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3918097359710373, + "last_output_s": 12.084607534983661 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5840524879749864, + "decode_tps": 22.17350988667291, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.789596241511916, + "prefill_tps": 54.789596241511916, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.09885918426638, + "round_gap_p50_ms": 103.05394796887413, + "round_gap_p95_ms": 107.0083859958686, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.001460605999454856, + "first_payload_s": 0.0014640619629062712, + "first_content_s": 0.5840524879749864, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5840524879749864, + "last_output_s": 12.084261579962913 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19943034299649298, + "decode_tps": 21.455595311632106, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.45702734695053, + "prefill_tps": 160.45702734695053, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.607888780315136, + "round_gap_p50_ms": 103.05378696648404, + "round_gap_p95_ms": 107.33472503488883, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0017307529924437404, + "first_payload_s": 0.0017489289748482406, + "first_content_s": 0.19943034299649298, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19943034299649298, + "last_output_s": 12.084441981976852 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.47650923035975, + "round_gap_p50_ms": 103.05705101927742, + "round_gap_p95_ms": 107.01243404764682, + "round_gap_mean_ms": 105.4228168521976, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.82223482513606, + "aggregate_prefill_tps": 164.82223482513606 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396600.000603666, + "first": 396600.776905226, + "last": 396612.084926111, + "end": 396612.085408787, + "elapsed_s": 12.084805121005047, + "chunk_offsets_s": [ + 0.7763015599921346, + 0.8805633599986322, + 0.9833142479765229, + 1.086198338016402, + 1.1886529360199347, + 1.2913163839839399, + 1.3945265890215524, + 1.4973874790011905, + 1.6013903159764595, + 1.702001534984447, + 1.8030867439811118, + 1.9084669220028445, + 2.0112722589983605, + 2.1126210860093124, + 2.215059123991523, + 2.317428200971335, + 2.4188360199914314, + 2.5220025929738767, + 2.628469885967206, + 2.735482320014853, + 2.838536348019261, + 2.935514347977005, + 3.0397130270139314, + 3.1435775909922086, + 3.2496992319938727, + 3.3532320159720257, + 3.4625588089693338, + 3.564937198010739, + 3.6683661899878643, + 3.772124416020233, + 3.873079622979276, + 3.976814922003541, + 4.07753396598855, + 4.178000208979938, + 4.284631535003427, + 4.391484943975229, + 4.496780770015903, + 4.601902641006745, + 4.702141809975728, + 4.806889982020948, + 4.909147073980421, + 5.0127676029806025, + 5.118574713007547, + 5.217865568003617, + 5.324889298994094, + 5.42754970601527, + 5.5310497540049255, + 5.632810584967956, + 5.736264905019198, + 5.839591350988485, + 5.941992876993027, + 6.046118962985929, + 6.148681273974944, + 6.252373403985985, + 6.359981956018601, + 6.463595797016751, + 6.567050131969154, + 6.6698650540201925, + 6.771984592021909, + 6.875568304967601, + 6.976037156011444, + 7.077571103989612, + 7.179856805014424, + 7.280759050976485, + 7.384657567017712, + 7.48706165299518, + 7.590118704014458, + 7.696057175984606, + 7.803078937984537, + 7.9107776989694685, + 8.015024986991193, + 8.115874305018224, + 8.21295633801492, + 8.316161839989945, + 8.41900669701863, + 8.522063173004426, + 8.624428762006573, + 8.729770236008335, + 8.834235748974606, + 8.939526294998359, + 9.042903702007607, + 9.142203660972882, + 9.246632613998372, + 9.351779334014282, + 9.455964076973032, + 9.56036362197483, + 9.663453137967736, + 9.76511145598488, + 9.864175012975466, + 9.963991073018406, + 10.06574318400817, + 10.16583398298826, + 10.269910980015993, + 10.375013892014977, + 10.475557670986746, + 10.579385659017134, + 10.681105913012289, + 10.780818004976027, + 10.883613021986093, + 10.989176450006198, + 11.088523306010757, + 11.188352981989738, + 11.287183047970757, + 11.391867571976036, + 11.500072209979407, + 11.600291570008267, + 11.701050470990594, + 11.8020859999815, + 11.90500540198991, + 12.010885040974244, + 12.08432244497817 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.05676350253634, + "p95": 107.02176199993119, + "max": 109.32679299730808 + } + }, + { + "start": 396600.000699379, + "first": 396600.392509115, + "last": 396612.085306914, + "end": 396612.085919016, + "elapsed_s": 12.08521963696694, + "chunk_offsets_s": [ + 0.3918097359710373, + 0.8803651179769076, + 0.9833296719589271, + 1.0861855059629306, + 1.1886053039925173, + 1.2912647029734217, + 1.39447514800122, + 1.4973554619937204, + 1.6015641409903765, + 1.7020517599885352, + 1.8031452239956707, + 1.908483706007246, + 2.0112801149953157, + 2.112643421976827, + 2.215114611957688, + 2.317376519960817, + 2.418612673995085, + 2.522084673983045, + 2.628465037967544, + 2.735235981992446, + 2.838577468006406, + 2.935351690975949, + 3.0398638129699975, + 3.1437464879709296, + 3.249764352978673, + 3.353063646994997, + 3.462621434009634, + 3.564988510974217, + 3.668439917964861, + 3.772112864011433, + 3.8729137660120614, + 3.9770628119586036, + 4.077372013009153, + 4.178055472963024, + 4.284693759982474, + 4.391537391988095, + 4.496608031971846, + 4.602024641993921, + 4.702372787985951, + 4.806875917012803, + 4.909175857959781, + 5.013004612992518, + 5.118618681968655, + 5.217967200966086, + 5.324597711965907, + 5.427613898995332, + 5.531223627971485, + 5.632802040956449, + 5.736681756970938, + 5.8396700079902075, + 5.942044444964267, + 6.045939376985189, + 6.1484636389650404, + 6.252396491996478, + 6.360168244980741, + 6.463268896972295, + 6.567273702006787, + 6.669866125972476, + 6.7721025929786265, + 6.8755383209791034, + 6.976117220008746, + 7.0775676959892735, + 7.179711458971724, + 7.280476649000775, + 7.384729248005897, + 7.486872659006622, + 7.589941854006611, + 7.696327562967781, + 7.803193066967651, + 7.910740210965741, + 8.015009561961051, + 8.11557028599782, + 8.212797392974608, + 8.315977949998342, + 8.419084794004448, + 8.52191051497357, + 8.624234151968267, + 8.729839453008026, + 8.834331749996636, + 8.939503255009186, + 9.042737331998069, + 9.141955833998509, + 9.246432868007105, + 9.35179894999601, + 9.456020572979469, + 9.560420277994126, + 9.66352492995793, + 9.76524206501199, + 9.863997810985893, + 9.964018224971369, + 10.065580061986111, + 10.16568015696248, + 10.270008469000459, + 10.375244038004894, + 10.475605192012154, + 10.579464667011052, + 10.681090456957463, + 10.780811955977697, + 10.883611821976956, + 10.989243154006545, + 11.088577737973537, + 11.188411653973162, + 11.287261848978233, + 11.391935268999077, + 11.50019006698858, + 11.600289233960211, + 11.701057270984165, + 11.80222060898086, + 11.905224507965613, + 12.01088582497323, + 12.084607534983661 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.08492349577136, + "p95": 106.86550399987027, + "max": 488.55538200587034 + } + }, + { + "start": 396600.000969686, + "first": 396600.585022174, + "last": 396612.085231266, + "end": 396612.085712518, + "elapsed_s": 12.084742831997573, + "chunk_offsets_s": [ + 0.5840524879749864, + 0.8797139269881882, + 0.982528239954263, + 1.085494122991804, + 1.1878103030030616, + 1.2904382789856754, + 1.3942805539700203, + 1.4967677439562976, + 1.601088039984461, + 1.7013516249717213, + 1.8024609289714135, + 1.9077077779802494, + 2.0105041229980998, + 2.1120848249993287, + 2.214595566969365, + 2.316576207987964, + 2.4179318829555996, + 2.5212551779695787, + 2.6276358459726907, + 2.734602582990192, + 2.837656530959066, + 2.934646850975696, + 3.039072748972103, + 3.1433795879711397, + 3.2490189689560793, + 3.352283750951756, + 3.4616666559595615, + 3.564071428962052, + 3.66772987897275, + 3.7712428710074164, + 3.8721078369999304, + 3.9761950909742154, + 4.0765769009594806, + 4.177507467975374, + 4.284333611954935, + 4.391027978970669, + 4.49624375597341, + 4.601430092006922, + 4.701840429974254, + 4.8064231449970976, + 4.908840413962025, + 5.0123190059675835, + 5.118271269951947, + 5.217344282951672, + 5.324203034979291, + 5.427116309991106, + 5.530630469962489, + 5.632376244990155, + 5.735965750005562, + 5.8393015720066614, + 5.941346869978588, + 6.04570367798442, + 6.148122387996409, + 6.252072487957776, + 6.359687631949782, + 6.462907612964045, + 6.566576095006894, + 6.669414584990591, + 6.771677148994058, + 6.87513229995966, + 6.975581294973381, + 7.077119258989114, + 7.179325054981746, + 7.280262309999671, + 7.384199609979987, + 7.486424878006801, + 7.589576986967586, + 7.695563090965152, + 7.80257147696102, + 7.910312637977768, + 8.014560949988663, + 8.114973991992883, + 8.212428892962635, + 8.315605897980276, + 8.418548532004934, + 8.52150743897073, + 8.6238257639925, + 8.729340342979413, + 8.833635758957826, + 8.939028881955892, + 9.042356303951237, + 9.141513573995326, + 9.245887933997437, + 9.351214799971785, + 9.455461959005333, + 9.559782495955005, + 9.663006877002772, + 9.764802363992203, + 9.863579117984045, + 9.963690268981736, + 10.065442395978607, + 10.165328712959308, + 10.269472159969155, + 10.374559358984698, + 10.47510041797068, + 10.578938517952338, + 10.680672436952591, + 10.780388031969778, + 10.883178568969015, + 10.988713740953244, + 11.08805147698149, + 11.187898576958105, + 11.286710818996653, + 11.391403646965045, + 11.499749006005004, + 11.600105183955748, + 11.700342815951444, + 11.801789163961075, + 11.90448505996028, + 12.010425532003865, + 12.084261579962913 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.10302846482955, + "p95": 107.0083859958686, + "max": 295.66143901320174 + } + }, + { + "start": 396600.000310975, + "first": 396600.199741318, + "last": 396612.084752957, + "end": 396612.086439853, + "elapsed_s": 12.086128877999727, + "chunk_offsets_s": [ + 0.19943034299649298, + 0.8806831529946066, + 0.9835436589783058, + 1.0863119079731405, + 1.1887830650084652, + 1.2914509609690867, + 1.3946661269874312, + 1.4976247450103983, + 1.6019073450006545, + 1.7022375380038284, + 1.8033211939618923, + 1.9086842520046048, + 2.011503765999805, + 2.112856096995529, + 2.2151150449644774, + 2.3175495300092734, + 2.4189385019708425, + 2.5221288989996538, + 2.6286058239638805, + 2.7359405489987694, + 2.8386509889969602, + 2.9356517900014296, + 3.0401729039731435, + 3.1439676269656047, + 3.2502308060065843, + 3.3532845929730684, + 3.4626799619873054, + 3.565076688013505, + 3.668489134986885, + 3.772277217998635, + 3.8731271919677965, + 3.9772670379607007, + 4.077583550999407, + 4.178072321985383, + 4.2848277449957095, + 4.391569136991166, + 4.496803377987817, + 4.602251189004164, + 4.702668023004662, + 4.806999246997293, + 4.909328994981479, + 5.013251496013254, + 5.118789050960913, + 5.217944208998233, + 5.324771762010641, + 5.427654635976069, + 5.531526590988506, + 5.632947178964969, + 5.736449307005387, + 5.840241517988034, + 5.942377905012108, + 6.046568759018555, + 6.149147982010618, + 6.252550604986027, + 6.36045016796561, + 6.464036424993537, + 6.567508361011278, + 6.6699931509792805, + 6.772158865991514, + 6.875983844976872, + 6.976576856977772, + 7.077710321987979, + 7.179889029008336, + 7.280719466973096, + 7.384776784980204, + 7.487017267965712, + 7.590473652002402, + 7.696543068974279, + 7.803426141967066, + 7.91089334897697, + 8.015173644002061, + 8.11589700897457, + 8.212985906982794, + 8.31664653198095, + 8.419118570978753, + 8.522066548990551, + 8.624402473971713, + 8.72984926099889, + 8.834372567012906, + 8.939490582968574, + 9.042921637999825, + 9.142101003963035, + 9.246641653997358, + 9.352007191977464, + 9.456056221970357, + 9.560365814017132, + 9.663573699013796, + 9.765273345983587, + 9.864299717999529, + 9.964217922999524, + 10.065886288997717, + 10.165907471964601, + 10.270562490972225, + 10.37547045701649, + 10.476093309000134, + 10.579506059992127, + 10.68122237897478, + 10.780953990004491, + 10.883765598991886, + 10.989290994999465, + 11.088622202980332, + 11.188466822961345, + 11.287288473977242, + 11.39198315696558, + 11.500241652014665, + 11.600444515992422, + 11.70115848898422, + 11.802261953009292, + 11.90546243096469, + 12.011018642981071, + 12.084441981976852 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.12209199764766, + "p95": 107.33472503488883, + "max": 681.2528099981137 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 85.31210149083797, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.153509375988506, + "end_to_end_tps": 84.25549924066381, + "timing_valid": true, + "steady_tps": 89.28917704051797, + "per_stream_tps": [ + 22.1, + 22.4, + 21.7, + 21.3 + ], + "ttft_s": [ + 0.59, + 0.78, + 0.39, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.5904574950109236, + "decode_tps": 22.054050414799242, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.19526429994422, + "prefill_tps": 54.19526429994422, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.34314473721144, + "round_gap_p50_ms": 103.65045000799, + "round_gap_p95_ms": 108.07585302973166, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002435176051221788, + "first_payload_s": 0.0024403600255027413, + "first_content_s": 0.5904574950109236, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5904574950109236, + "last_output_s": 12.15295940299984 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.783539583964739, + "decode_tps": 22.43270129109236, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.84031062997332, + "prefill_tps": 40.84031062997332, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.5777789764928, + "round_gap_p50_ms": 103.69596997043118, + "round_gap_p95_ms": 107.44496702682227, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002277269959449768, + "first_payload_s": 0.0022792379604652524, + "first_content_s": 0.783539583964739, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.783539583964739, + "last_output_s": 12.150873222970404 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.39484947797609493, + "decode_tps": 21.687546212279457, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.0435413616967, + "prefill_tps": 81.0435413616967, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.10941183534177, + "round_gap_p50_ms": 103.61798503436148, + "round_gap_p95_ms": 107.92433097958565, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018111219978891313, + "first_payload_s": 0.0018258579657413065, + "first_content_s": 0.39484947797609493, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39484947797609493, + "last_output_s": 12.152749495988246 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19703535898588598, + "decode_tps": 21.329187839451645, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.40739816802233, + "prefill_tps": 162.40739816802233, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.88411052156167, + "round_gap_p50_ms": 103.72081800596789, + "round_gap_p95_ms": 107.82399500021711, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016730559873394668, + "first_payload_s": 0.0016763529856689274, + "first_content_s": 0.19703535898588598, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19703535898588598, + "last_output_s": 12.152483541984111 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.72861151765192, + "round_gap_p50_ms": 103.70957001578063, + "round_gap_p95_ms": 107.82399500021711, + "round_gap_mean_ms": 106.00723579092036, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 163.1458945684614, + "aggregate_prefill_tps": 163.1458945684614 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396612.088471377, + "first": 396612.678928872, + "last": 396624.24143078, + "end": 396624.241885888, + "elapsed_s": 12.153414511005394, + "chunk_offsets_s": [ + 0.5904574950109236, + 0.8893585180048831, + 0.9928091580513865, + 1.0948872720473446, + 1.1974445910309441, + 1.302143099019304, + 1.4071858660317957, + 1.51031107903691, + 1.6146052150288597, + 1.7184132980182767, + 1.820992777007632, + 1.9263206190080382, + 2.0291187720140442, + 2.132828342029825, + 2.2371089580119587, + 2.3404512280249037, + 2.4425837110029534, + 2.545197814994026, + 2.652228537015617, + 2.7603274620487355, + 2.8638828070252202, + 2.9623457500129007, + 3.067519494041335, + 3.173562847019639, + 3.2778601350146346, + 3.382887270010542, + 3.4910302430507727, + 3.5928676510229707, + 3.6960229120450094, + 3.801047567045316, + 3.9020193030009978, + 4.005955083004665, + 4.106730705010705, + 4.20756477501709, + 4.31412482104497, + 4.4213999939966016, + 4.5252016930026, + 4.628096663043834, + 4.733419657044578, + 4.8381742290221155, + 4.943087075022049, + 5.047067560022697, + 5.153081680997275, + 5.253708229050972, + 5.359412393998355, + 5.463832996028941, + 5.568399150040932, + 5.669437414035201, + 5.77411011402728, + 5.877695939037949, + 5.9824896000209264, + 6.087041513994336, + 6.192091417033225, + 6.295335079019424, + 6.407002631051, + 6.51120367803378, + 6.614463324018288, + 6.717851467023138, + 6.822934090043418, + 6.927698070998304, + 7.0281892900238745, + 7.129322995024268, + 7.232409087009728, + 7.334420113009401, + 7.439003451028839, + 7.541212831041776, + 7.641094428021461, + 7.746999315044377, + 7.853173678042367, + 7.961066569027025, + 8.06514043000061, + 8.166409529047087, + 8.263260408013593, + 8.366341732034925, + 8.469182094035204, + 8.56996082002297, + 8.673506068997085, + 8.77861890004715, + 8.882062756048981, + 8.988780788029544, + 9.092725080030505, + 9.192100144049618, + 9.298280842020176, + 9.401544424006715, + 9.509620277036447, + 9.613796828023624, + 9.717179979023058, + 9.820358648023102, + 9.919585295021534, + 10.020119170018006, + 10.122159028018359, + 10.222360451996792, + 10.327299522003159, + 10.432974872004706, + 10.533380409993697, + 10.637350511038676, + 10.73792654601857, + 10.84157699602656, + 10.94535256701056, + 11.050839003000874, + 11.151036763039883, + 11.252972252026666, + 11.352382260025479, + 11.457046560011804, + 11.565132828021888, + 11.665205979021266, + 11.767316974001005, + 11.869124174001627, + 11.972204649995547, + 12.07824043504661, + 12.15295940299984 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.68001001188532, + "p95": 108.07585302973166, + "max": 298.9010229939595 + } + }, + { + "start": 396612.089410762, + "first": 396612.872950346, + "last": 396624.240283985, + "end": 396624.240374705, + "elapsed_s": 12.150963942985982, + "chunk_offsets_s": [ + 0.783539583964739, + 0.8883590850164182, + 0.9913451119791716, + 1.0938008300145157, + 1.1961860510054976, + 1.3011140809976496, + 1.406066078983713, + 1.509304812992923, + 1.614099753962364, + 1.7174077039817348, + 1.819971982971765, + 1.92532499297522, + 2.0281234339927323, + 2.1318194039631635, + 2.2360582599649206, + 2.3394522750168107, + 2.4418341999989934, + 2.5441428929916583, + 2.651149118959438, + 2.7592580119962804, + 2.8622267909813672, + 2.9613080919953063, + 3.0663955959607847, + 3.1725167089607567, + 3.2767949249828234, + 3.3822516159852967, + 3.4900180099648423, + 3.5917999770026654, + 3.6949569339631125, + 3.799982276977971, + 3.900979916972574, + 4.00490316899959, + 4.105304226977751, + 4.206019399978686, + 4.313060218992177, + 4.4203471199725755, + 4.524154259008355, + 4.627034508972429, + 4.732405630988069, + 4.837127178965602, + 4.9413310419768095, + 5.04595222097123, + 5.152046630973928, + 5.252653834992088, + 5.358334639982786, + 5.462690073007252, + 5.567360099987127, + 5.668700750975404, + 5.7728892539744265, + 5.876665224961471, + 5.981195795000531, + 6.085977743961848, + 6.191027230990585, + 6.294196187984198, + 6.405956669012085, + 6.510060914966743, + 6.6134225619607605, + 6.716829344979487, + 6.82190915197134, + 6.926564155961387, + 7.027149583969731, + 7.1287616129848175, + 7.231132226996124, + 7.333367126004305, + 7.4379884820082225, + 7.540078788006213, + 7.639959744992666, + 7.745983849978074, + 7.852121523988899, + 7.959993341995869, + 8.064042467973195, + 8.165366014989559, + 8.262124477012549, + 8.365321306977421, + 8.46814541198546, + 8.56892660196172, + 8.672364841972012, + 8.777549321996048, + 8.880716487008613, + 8.987741209974047, + 9.091672413982451, + 9.191601210972294, + 9.297235935984645, + 9.401069763989653, + 9.508514731016476, + 9.612626752990764, + 9.71615227300208, + 9.819348429969978, + 9.918520452978555, + 10.01908492000075, + 10.12099564098753, + 10.22198913700413, + 10.326410777983256, + 10.431822284997907, + 10.532334463961888, + 10.636312421003822, + 10.736891928012483, + 10.840540378005244, + 10.944302540970966, + 11.049813216959592, + 11.14996308798436, + 11.251954993989784, + 11.35135391401127, + 11.455980900966097, + 11.564066385966726, + 11.664090288977604, + 11.76629286800744, + 11.868108483962715, + 11.971179760002997, + 12.077222121006344, + 12.150873222970404 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.72906646807678, + "p95": 107.44496702682227, + "max": 111.76048102788627 + } + }, + { + "start": 396612.08876218, + "first": 396612.483611658, + "last": 396624.241511676, + "end": 396624.241571005, + "elapsed_s": 12.152808825019747, + "chunk_offsets_s": [ + 0.39484947797609493, + 0.889366325980518, + 0.9921125110122375, + 1.0948636080138385, + 1.1969445219729096, + 1.3021590989665128, + 1.407334778981749, + 1.5104966479702853, + 1.6144170369952917, + 1.718226719996892, + 1.821176394005306, + 1.9264387000002898, + 2.0294170469860546, + 2.1329532230156474, + 2.2370216450071894, + 2.3403714679880068, + 2.4421514029963873, + 2.5454713049693964, + 2.652170392975677, + 2.7604639590135776, + 2.863093438965734, + 2.9622710130061023, + 3.0674489170196466, + 3.173645408009179, + 3.277702532999683, + 3.382440546003636, + 3.491051602992229, + 3.592809010995552, + 3.6958538540056907, + 3.8009483339847066, + 3.901954405999277, + 4.00577860098565, + 4.106122714991216, + 4.207052161975298, + 4.314068451989442, + 4.421336808998603, + 4.525186171988025, + 4.628116742998827, + 4.7334777530049905, + 4.838109589007217, + 4.9424219650099985, + 5.046945446985774, + 5.153146896976978, + 5.253608851984609, + 5.359559835982509, + 5.463733377982862, + 5.568293388991151, + 5.669515302986838, + 5.773722222016659, + 5.877845172013622, + 5.981966217979789, + 6.087085817998741, + 6.192012759973295, + 6.295272246003151, + 6.406317423970904, + 6.511194140999578, + 6.614312521996908, + 6.717681817011908, + 6.822810344980098, + 6.927627877972554, + 7.028311370988376, + 7.129217297013383, + 7.231944794009905, + 7.334435441007372, + 7.438905801973306, + 7.540993292990606, + 7.641010058985557, + 7.7470293319784105, + 7.853286751022097, + 7.9610094639938325, + 8.065013756975532, + 8.166425417002756, + 8.263129175000358, + 8.366377044992987, + 8.469469072995707, + 8.569859170995187, + 8.67334843496792, + 8.778451922989916, + 8.881567486969288, + 8.988891700981185, + 9.092727047973312, + 9.191980542964302, + 9.29819778498495, + 9.401491719996557, + 9.509416050976142, + 9.613660954986699, + 9.71727894002106, + 9.820348680019379, + 9.919478621974122, + 10.020428692980204, + 10.122030210972298, + 10.222255266970024, + 10.327344802964944, + 10.432892039010767, + 10.533411049982533, + 10.63739751902176, + 10.73781548900297, + 10.841662388993427, + 10.945274310011882, + 11.050698824983556, + 11.15086400898872, + 11.252787961973809, + 11.352260146988556, + 11.456979774986394, + 11.565402335021645, + 11.665093626012094, + 11.767132363980636, + 11.868939356005285, + 11.972212777996901, + 12.078274722967763, + 12.152749495988246 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.71383401798084, + "p95": 107.92433097958565, + "max": 494.5168480044231 + } + }, + { + "start": 396612.088376512, + "first": 396612.285411871, + "last": 396624.240860054, + "end": 396624.240956967, + "elapsed_s": 12.152580455003772, + "chunk_offsets_s": [ + 0.19703535898588598, + 0.8899618040304631, + 0.9927364049945027, + 1.0951820589834824, + 1.197705554019194, + 1.3023430689936504, + 1.4074615489807911, + 1.510586777003482, + 1.6150542270042934, + 1.718835029983893, + 1.8213735970202833, + 1.92660959798377, + 2.0294974319986068, + 2.133180985983927, + 2.2373559679836035, + 2.3406935509992763, + 2.442474093986675, + 2.5456067150225863, + 2.6528555509867147, + 2.7606795459869318, + 2.863428834010847, + 2.9631541739800014, + 3.068325710017234, + 3.1739693470299244, + 3.2781527300248854, + 3.383060375985224, + 3.4920434370287694, + 3.593693643982988, + 3.6966909670154564, + 3.8018303270218894, + 3.90251863602316, + 4.006239454029128, + 4.1066508640069515, + 4.207310244033579, + 4.315038094006013, + 4.421779661031906, + 4.52564376097871, + 4.6286235000006855, + 4.733942269987892, + 4.838556376984343, + 4.942635647021234, + 5.047824223001953, + 5.154114267032128, + 5.254504540993366, + 5.360257042979356, + 5.46432620100677, + 5.568736754008569, + 5.669973756012041, + 5.774310772016179, + 5.878067830984946, + 5.982411902979948, + 6.087422606011387, + 6.192454668984283, + 6.295774634985719, + 6.406782676989678, + 6.5114209119929, + 6.61517011502292, + 6.718552194011863, + 6.823665681004059, + 6.9285052309860475, + 7.028526620997582, + 7.129545876989141, + 7.232403599016834, + 7.334879813017324, + 7.439349599007983, + 7.5414368489873596, + 7.6414577109972015, + 7.747531961009372, + 7.853549856983591, + 7.961241034034174, + 8.065456609998364, + 8.16664293903159, + 8.263573995034676, + 8.366822985000908, + 8.46950825699605, + 8.570334264019039, + 8.673685446032323, + 8.77890539902728, + 8.882013556023594, + 8.98911472701002, + 9.093173725006636, + 9.192442356026731, + 9.298648077994585, + 9.401953260006849, + 9.509858199977316, + 9.61410246300511, + 9.717492541996762, + 9.820791515987366, + 9.919767137034796, + 10.020579990989063, + 10.122473302995786, + 10.222856217005756, + 10.328177931020036, + 10.433880257012788, + 10.533856510999613, + 10.637897556007374, + 10.738260054029524, + 10.841821591020562, + 10.94571930699749, + 11.051144525990821, + 11.151312733010855, + 11.253233582014218, + 11.352703190990724, + 11.457275810011197, + 11.565584352996666, + 11.665540399029851, + 11.767574305005837, + 11.869384079996962, + 11.973079490999226, + 12.079138571978547, + 12.152483541984111 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 103.73501051799394, + "p95": 107.82399500021711, + "max": 692.9264450445771 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 81.89468041658408, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 12.652919891988859, + "end_to_end_tps": 80.92993623142601, + "timing_valid": true, + "steady_tps": 85.5159260016434, + "per_stream_tps": [ + 20.8, + 21.1, + 21.5, + 20.5 + ], + "ttft_s": [ + 0.39, + 0.59, + 0.78, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.39480824599741027, + "decode_tps": 20.80519791006143, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.0520051807882, + "prefill_tps": 81.0520051807882, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 48.06491167846081, + "round_gap_p50_ms": 104.58956303773448, + "round_gap_p95_ms": 133.59010103158653, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0016642400296404958, + "first_payload_s": 0.0016681600245647132, + "first_content_s": 0.39480824599741027, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39480824599741027, + "last_output_s": 12.651360724004917 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5883595399791375, + "decode_tps": 21.140870533813903, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.38851216916561, + "prefill_tps": 54.38851216916561, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 47.30174182754412, + "round_gap_p50_ms": 104.42356200655922, + "round_gap_p95_ms": 133.4626919706352, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0015867840265855193, + "first_payload_s": 0.0015885279863141477, + "first_content_s": 0.5883595399791375, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5883595399791375, + "last_output_s": 12.650303706002887 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7814257889986038, + "decode_tps": 21.48144159776923, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.9507856670663, + "prefill_tps": 40.9507856670663, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.55181056860944, + "round_gap_p50_ms": 104.49772200081497, + "round_gap_p95_ms": 132.92870298027992, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.001872194989118725, + "first_payload_s": 0.0018882270087487996, + "first_content_s": 0.7814257889986038, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7814257889986038, + "last_output_s": 12.65213748399401 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19784880802035332, + "decode_tps": 20.476650700350216, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.73966535450677, + "prefill_tps": 161.73966535450677, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 48.83611165877322, + "round_gap_p50_ms": 104.50010601198301, + "round_gap_p95_ms": 133.4991079638712, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012355479993857443, + "first_payload_s": 0.0012429720372892916, + "first_content_s": 0.19784880802035332, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19784880802035332, + "last_output_s": 12.651057281007525 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 47.688643933346896, + "round_gap_p50_ms": 104.53983501065522, + "round_gap_p95_ms": 133.4626919706352, + "round_gap_mean_ms": 110.55094730003144, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 163.64968499708155, + "aggregate_prefill_tps": 163.64968499708155 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396624.243539696, + "first": 396624.638347942, + "last": 396636.89490042, + "end": 396636.896015791, + "elapsed_s": 12.65247609501239, + "chunk_offsets_s": [ + 0.39480824599741027, + 0.887118273996748, + 0.990281839040108, + 1.0953237900394015, + 1.1968548269942403, + 1.3014443900319748, + 1.404062062036246, + 1.5070913060335442, + 1.6117861660313793, + 1.7157418820424937, + 1.8198079200228676, + 1.9250310730421916, + 2.0277157530072145, + 2.131931904994417, + 2.237937257043086, + 2.342482372012455, + 2.444616583001334, + 2.548589260026347, + 2.6568373220507056, + 2.7650189039995894, + 2.8682338620419614, + 2.9665907560265623, + 3.0714453770196997, + 3.178399059048388, + 3.283343153016176, + 3.3899668640224263, + 3.5008471280452795, + 3.6037973790080287, + 3.7094460560474545, + 3.814032851019874, + 3.9149923950317316, + 4.019099808996543, + 4.123168023012113, + 4.226591847022064, + 4.333814955025446, + 4.440604539006017, + 4.54538580001099, + 4.650379847036675, + 4.760070963995531, + 4.887075977050699, + 5.012210907996632, + 5.139955335995182, + 5.273959762009326, + 5.385648018040229, + 5.522037795046344, + 5.65377515804721, + 5.759431835031137, + 5.861014296999201, + 5.9654300340334885, + 6.070382049016189, + 6.174603496037889, + 6.281128566013649, + 6.384172210004181, + 6.488545211032033, + 6.59866493899608, + 6.704573059047107, + 6.808927019999828, + 6.912008744024206, + 7.016083198017441, + 7.121185502037406, + 7.221921219024807, + 7.3248549260315485, + 7.426868464041036, + 7.528770641016308, + 7.633821232011542, + 7.737322129018139, + 7.841197589004878, + 7.945872736047022, + 8.08100651705172, + 8.2182695500087, + 8.350757705047727, + 8.482068328012247, + 8.606276706035715, + 8.739424786996096, + 8.870255566027481, + 8.999970366014168, + 9.133560467045754, + 9.266503107035533, + 9.370672809018288, + 9.4788021830027, + 9.584262634045444, + 9.68411658302648, + 9.789720092026982, + 9.891831807035487, + 9.996765549003612, + 10.102574435994029, + 10.207499778014608, + 10.310427389049437, + 10.410353611048777, + 10.512362972018309, + 10.613785401044879, + 10.714769712009002, + 10.819982465996873, + 10.92811385501409, + 11.028575617994647, + 11.132988379045855, + 11.232552117027808, + 11.33346703602001, + 11.436566489050165, + 11.542198734008707, + 11.64308821305167, + 11.744439392001368, + 11.844742402026895, + 11.950051508028992, + 12.058793447038624, + 12.159968033025507, + 12.262443591025658, + 12.364764508034568, + 12.467745767033193, + 12.576982656028122, + 12.651360724004917 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 104.63235503993928, + "p95": 133.59010103158653, + "max": 492.31002799933776 + } + }, + { + "start": 396624.244264999, + "first": 396624.832624539, + "last": 396636.894568705, + "end": 396636.895087526, + "elapsed_s": 12.650822527008131, + "chunk_offsets_s": [ + 0.5883595399791375, + 0.8866432139766403, + 0.9900357890292071, + 1.0949157060240395, + 1.1956247360212728, + 1.30061402998399, + 1.4037576270056888, + 1.5067021659924649, + 1.610931981005706, + 1.7152160370023921, + 1.8192030980135314, + 1.9245934530044906, + 2.027081026986707, + 2.1312762339948677, + 2.2374174279975705, + 2.3416204269742593, + 2.4444152690120973, + 2.548004709999077, + 2.6562223880318925, + 2.7645081150112674, + 2.8675689750234596, + 2.965930365025997, + 3.070857627026271, + 3.1779242859920487, + 3.282867948990315, + 3.389125192014035, + 3.5004544369876385, + 3.6031333249993622, + 3.708978932001628, + 3.813410973001737, + 3.914411620993633, + 4.018538139993325, + 4.122711218020413, + 4.226037040993106, + 4.333244421985, + 4.439779730979353, + 4.544797938026022, + 4.649846129992511, + 4.759142362978309, + 4.8866129639791325, + 5.011697015026584, + 5.139455267984886, + 5.273068360984325, + 5.385007323988248, + 5.521194795030169, + 5.653259200975299, + 5.758889046031982, + 5.86053525202442, + 5.964958814030979, + 6.069779002980795, + 6.173958097991999, + 6.28073078597663, + 6.383833982981741, + 6.488030582026113, + 6.5983117680298164, + 6.703908045019489, + 6.8082664529792964, + 6.911523107031826, + 7.015447976009455, + 7.120524775993545, + 7.22150927898474, + 7.324461465992499, + 7.426305258995853, + 7.527937881008256, + 7.633342796005309, + 7.736448791984003, + 7.840817841002718, + 7.945214185980149, + 8.0804311989923, + 8.217745497007854, + 8.350381925003603, + 8.481496786989737, + 8.605845373997, + 8.73876996501349, + 8.869688312988728, + 8.999670171004254, + 9.13313286297489, + 9.26600679801777, + 9.370304549986031, + 9.478122783999424, + 9.583864742016885, + 9.683508065005299, + 9.788916627992876, + 9.891393451020122, + 9.996389225998428, + 10.101250423002057, + 10.20714059099555, + 10.309964952990413, + 10.410253258014563, + 10.511829830997158, + 10.613186595030129, + 10.7142770679784, + 10.819422236003447, + 10.92754047299968, + 11.028045116981957, + 11.132342069002334, + 11.232021423988044, + 11.333149049023632, + 11.436251286009792, + 11.541784650005866, + 11.642583072010893, + 11.743994972028304, + 11.844154732010793, + 11.949477037996985, + 12.057928287016694, + 12.159653054026421, + 12.261949329986237, + 12.364190775027964, + 12.467228722001892, + 12.576143080019392, + 12.650303706002887 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 104.4278015033342, + "p95": 133.4626919706352, + "max": 298.2836739975028 + } + }, + { + "start": 396624.244170374, + "first": 396625.025596163, + "last": 396636.896307858, + "end": 396636.896357507, + "elapsed_s": 12.652187132975087, + "chunk_offsets_s": [ + 0.7814257889986038, + 0.8863239630009048, + 0.9894792069680989, + 1.0945249670185149, + 1.1960481639835052, + 1.3004231170052662, + 1.4032963429926895, + 1.5062917459872551, + 1.6105509379995055, + 1.7150714760064147, + 1.8188037819927558, + 1.9243590189726092, + 2.0270290590124205, + 2.1312465539667755, + 2.2372641949914396, + 2.341604139015544, + 2.444386772986036, + 2.54786269296892, + 2.656166644010227, + 2.7642904489766806, + 2.8675255029811524, + 2.965866653015837, + 3.0707711310242303, + 3.177697355975397, + 3.2826715469709598, + 3.3893966670148075, + 3.5001554579939693, + 3.603076300001703, + 3.7087368660140783, + 3.8133023959817365, + 3.914277572010178, + 4.018399754015263, + 4.122479712008499, + 4.22589328000322, + 4.333120580005925, + 4.439764242968522, + 4.54465379298199, + 4.649692063976545, + 4.759602911013644, + 4.8863781620166264, + 5.011471029021777, + 5.13922560197534, + 5.273069449001923, + 5.384912650974002, + 5.521209882979747, + 5.653088847990148, + 5.758704004983883, + 5.860317713988479, + 5.964758748013992, + 6.069681658002082, + 6.173891665006522, + 6.2804376949789, + 6.383479690994136, + 6.487870531971566, + 6.597965604974888, + 6.703871531994082, + 6.808101859991439, + 6.911318112979643, + 7.015867131995037, + 7.120364853995852, + 7.2214810230070725, + 7.324160568008665, + 7.4261493849917315, + 7.528432046005037, + 7.633090841001831, + 7.736829644010868, + 7.84077905700542, + 7.945155929017346, + 8.08025015797466, + 8.21767927298788, + 8.350035729992669, + 8.481286256981548, + 8.605777406017296, + 8.738706108997576, + 8.8695829520002, + 8.99937781598419, + 9.132891708984971, + 9.265812652010936, + 9.370085891976487, + 9.478274033986963, + 9.583671220985707, + 9.683529297995847, + 9.788824178976938, + 9.891250009008218, + 9.996089510968886, + 10.10200262296712, + 10.206825772009324, + 10.309752631001174, + 10.409783957002219, + 10.511612100992352, + 10.613438036991283, + 10.714253164012916, + 10.8193937719916, + 10.927532200992573, + 11.027839115005918, + 11.132288291992154, + 11.2318596150144, + 11.332895511004608, + 11.43610125198029, + 11.541730969969649, + 11.642413854016922, + 11.743862106988672, + 11.844036698981654, + 11.949708191968966, + 12.057940366968978, + 12.159176488989033, + 12.26158435101388, + 12.364427272987086, + 12.466958815988619, + 12.576592187979259, + 12.65213748399401 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 104.50913000386208, + "p95": 132.92870298027992, + "max": 137.42911501321942 + } + }, + { + "start": 396624.243437615, + "first": 396624.441286423, + "last": 396636.894494896, + "end": 396636.89567486, + "elapsed_s": 12.652237244998105, + "chunk_offsets_s": [ + 0.19784880802035332, + 0.8879070180119015, + 0.9906622910057195, + 1.0959950450342149, + 1.1965438959887251, + 1.3012911730329506, + 1.4043966890312731, + 1.5077066880185157, + 1.6115141790360212, + 1.7165465620346367, + 1.819810223998502, + 1.9253734439844266, + 2.0280988769955, + 2.1321751230279915, + 2.2381972760194913, + 2.342524196021259, + 2.4449278980027884, + 2.5488901910139248, + 2.6571092450176366, + 2.765213050006423, + 2.86845309601631, + 2.966816214029677, + 3.0717585799866356, + 3.1788158789859153, + 3.283815350034274, + 3.390198913984932, + 3.501195772027131, + 3.6041298630298115, + 3.7097559950198047, + 3.81429583003046, + 3.9154218870098703, + 4.019548437034246, + 4.1234893220243976, + 4.226811753003858, + 4.3340226850123145, + 4.4407752610277385, + 4.545573593990412, + 4.650627401017118, + 4.760074596037157, + 4.887561790004838, + 5.012650320015382, + 5.140406669001095, + 5.2742520369938575, + 5.385892324033193, + 5.522087346995249, + 5.654194889997598, + 5.759638301038649, + 5.861472606018651, + 5.965894583030604, + 6.070548482006416, + 6.174843963002786, + 6.281480681034736, + 6.384541684994474, + 6.488929918035865, + 6.599046494986396, + 6.704782725020777, + 6.809267406992149, + 6.912690591008868, + 7.0164472659816965, + 7.121521328983363, + 7.222395992022939, + 7.325404420029372, + 7.427197939017788, + 7.528961586998776, + 7.63411611499032, + 7.737223759992048, + 7.841592327982653, + 7.946092433994636, + 8.081203943002038, + 8.218519504996948, + 8.35109079600079, + 8.482276809983887, + 8.606618806021288, + 8.739646662026644, + 8.870462128019426, + 9.000390226021409, + 9.13388933398528, + 9.26677813299466, + 9.371240271022543, + 9.478807670995593, + 9.584895408013836, + 9.6848283020081, + 9.790137792006135, + 9.892744679993484, + 9.99709736002842, + 10.102586276014335, + 10.207876022031996, + 10.311122740036808, + 10.411169779021293, + 10.512859857000876, + 10.614098604011815, + 10.715176964004058, + 10.820317685022019, + 10.92843928199727, + 11.028943924990017, + 11.133240765018854, + 11.232920937007293, + 11.333913009031676, + 11.43696366099175, + 11.542547665012535, + 11.643528616987169, + 11.744886084983591, + 11.845048837014474, + 11.950371431012172, + 12.058825095009524, + 12.160347620025277, + 12.262698617996648, + 12.365087727026548, + 12.468268299999181, + 12.576853037986439, + 12.651057281007525 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 104.51997051131912, + "p95": 133.4991079638712, + "max": 690.0582099915482 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.9, + "per_stream_tps": 45.9, + "ttft_s_max": 0.13, + "request": { + "ttft_s": 0.134, + "decode_tps": 45.853, + "prompt_ttft_tps": 104.366, + "prefill_tps": 104.366, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.809, + "round_gap_p50_ms": 73.743, + "round_gap_p95_ms": 90.476, + "tokens_per_chunk": 3.325, + "headers_s": 0.001, + "first_payload_s": 0.134, + "first_content_s": 0.134, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.134, + "last_output_s": 5.696 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 104.366, + "aggregate_prefill_tps": 104.366, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.809, + "round_gap_p50_ms": 73.743, + "round_gap_p95_ms": 90.476, + "tokens_per_chunk": 3.325 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 44.942511755214205, + "makespan_s": 5.696165835019201, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.09814900404337, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.788548408949282, + "end_to_end_tps": 44.225249909669195, + "timing_valid": true, + "per_stream_tps": [ + 45.1 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13414381898473948, + "decode_tps": 45.09814900404337, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.36559884725418, + "prefill_tps": 104.36559884725418, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.173859062604606, + "round_gap_p50_ms": 73.74323101248592, + "round_gap_p95_ms": 90.47589101828635, + "tokens_per_chunk": 3.3684210526315788, + "headers_s": 0.000887128000613302, + "first_payload_s": 0.13414381898473948, + "first_content_s": 0.13414381898473948, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13414381898473948, + "last_output_s": 5.788477879948914 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.173859062604606, + "round_gap_p50_ms": 73.74323101248592, + "round_gap_p95_ms": 90.47589101828635, + "round_gap_mean_ms": 75.39112081285566, + "tokens_per_chunk": 3.3684210526315788, + "aggregate_prompt_ttft_tps": 104.36559884725418, + "aggregate_prefill_tps": 104.36559884725418 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396703.840974536, + "first": 396703.975118355, + "last": 396709.629452416, + "end": 396709.629522945, + "elapsed_s": 5.788548408949282, + "chunk_offsets_s": [ + 0.13414381898473948, + 0.21097011998062953, + 0.277125165972393, + 0.3446374399936758, + 0.4136112639680505, + 0.4852061219862662, + 0.5516015859902836, + 0.6246226019575261, + 0.7008571529877372, + 0.7684734599897638, + 0.8302487029577605, + 0.9005354039836675, + 0.9670660849660635, + 1.0377044689957984, + 1.1055891629657708, + 1.1800851699663326, + 1.260528689948842, + 1.3306292459601536, + 1.4053627099492587, + 1.472563988994807, + 1.544072190998122, + 1.616918932995759, + 1.6876221179845743, + 1.7591664319625124, + 1.833603109989781, + 1.8956400509923697, + 1.9690652459976263, + 2.0307261039852165, + 2.0932293689693324, + 2.1551037959870882, + 2.2159361339872703, + 2.2815779419615865, + 2.3550149299553595, + 2.4275296209962107, + 2.5050917369662784, + 2.5886328399647027, + 2.6668976829969324, + 2.749697977968026, + 2.832479776989203, + 2.9175392299657688, + 3.00310409697704, + 3.0716164129553363, + 3.150918337982148, + 3.2331907879561186, + 3.313691076997202, + 3.394063492945861, + 3.467806723958347, + 3.5532229009550065, + 3.637249287974555, + 3.7239564529736526, + 3.814432343991939, + 3.9008245779550634, + 3.9928940199897625, + 4.077126760967076, + 4.161938499950338, + 4.249610011000186, + 4.332668628951069, + 4.405730972997844, + 4.492661260999739, + 4.566154008964077, + 4.635188170999754, + 4.697105621977244, + 4.765635330986697, + 4.83263967995299, + 4.908382881956641, + 4.977532116987277, + 5.07246363395825, + 5.1464630119735375, + 5.23299703997327, + 5.310434690967668, + 5.3968543649534695, + 5.479238672996871, + 5.574707395979203, + 5.654833024949767, + 5.724719625955913, + 5.788477879948914 + ], + "chunk_gaps_ms": { + "count": 75, + "p50": 73.74323101248592, + "p95": 90.47589101828635, + "max": 95.46872298233211 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.030438497985294, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.6703192759887315, + "end_to_end_tps": 45.147369581823305, + "timing_valid": true, + "per_stream_tps": [ + 46.0 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13032194296829402, + "decode_tps": 46.030438497985294, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.4262682179781, + "prefill_tps": 107.4262682179781, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.724755023651774, + "round_gap_p50_ms": 74.97311499901116, + "round_gap_p95_ms": 88.66996900178492, + "tokens_per_chunk": 3.324675324675325, + "headers_s": 0.0008562650182284415, + "first_payload_s": 0.13032194296829402, + "first_content_s": 0.13032194296829402, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13032194296829402, + "last_output_s": 5.6701344739994965 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.724755023651774, + "round_gap_p50_ms": 74.97311499901116, + "round_gap_p95_ms": 88.66996900178492, + "round_gap_mean_ms": 72.8922701451474, + "tokens_per_chunk": 3.324675324675325, + "aggregate_prompt_ttft_tps": 107.4262682179781, + "aggregate_prefill_tps": 107.4262682179781 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396709.631031199, + "first": 396709.761353142, + "last": 396715.301165673, + "end": 396715.301350475, + "elapsed_s": 5.6703192759887315, + "chunk_offsets_s": [ + 0.13032194296829402, + 0.19836516701616347, + 0.26477434200933203, + 0.3317413469776511, + 0.40149106696480885, + 0.47599664196604863, + 0.5424384899670258, + 0.6163097699754871, + 0.6912828849744983, + 0.7535482599632815, + 0.8135825089993887, + 0.8750963729689829, + 0.9358367740060203, + 0.9976199999800883, + 1.060071424988564, + 1.1228073009988293, + 1.1932833960163407, + 1.2553440170013346, + 1.3196360199945047, + 1.3901116030174308, + 1.44835412298562, + 1.5106835949700326, + 1.5720668809954077, + 1.635617837018799, + 1.705277283967007, + 1.7670452470192686, + 1.828195523004979, + 1.888943811005447, + 1.9528923709876835, + 2.013987398997415, + 2.076983388978988, + 2.140635657007806, + 2.210623779974412, + 2.2836155479890294, + 2.3587127599748783, + 2.4355877499911003, + 2.5211002469877712, + 2.6061008039978333, + 2.694770772999618, + 2.789713858976029, + 2.888668007974047, + 2.976101371983532, + 3.051744301978033, + 3.136643785983324, + 3.2156509879860096, + 3.2954463419737294, + 3.3761631450033747, + 3.4521034219651483, + 3.5439921739744022, + 3.6222281209775247, + 3.7066314719850197, + 3.7845484229619615, + 3.8635003289673477, + 3.947013911965769, + 4.027672138006892, + 4.104306277004071, + 4.187531728995964, + 4.262776463001501, + 4.342053988017142, + 4.424703801982105, + 4.5021722369710915, + 4.565183762984816, + 4.624232738977298, + 4.688203106983565, + 4.766459294012748, + 4.843664382991847, + 4.91959190700436, + 4.996772707963828, + 5.079336360970046, + 5.160250493965577, + 5.241735593008343, + 5.321504850988276, + 5.408060382993426, + 5.484713450015988, + 5.56121971597895, + 5.618680931976996, + 5.6701344739994965 + ], + "chunk_gaps_ms": { + "count": 76, + "p50": 75.03516349243, + "p95": 88.66996900178492, + "max": 98.95414899801835 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.85345100056254, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.696165835019201, + "end_to_end_tps": 44.942511755214205, + "timing_valid": true, + "per_stream_tps": [ + 45.9 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13455923198489472, + "decode_tps": 45.85345100056254, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.0434000215727, + "prefill_tps": 104.0434000215727, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.808609345188255, + "round_gap_p50_ms": 71.95394998416305, + "round_gap_p95_ms": 91.55086003011093, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0011046830331906676, + "first_payload_s": 0.13455923198489472, + "first_content_s": 0.13455923198489472, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13455923198489472, + "last_output_s": 5.6957546150079 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.808609345188255, + "round_gap_p50_ms": 71.95394998416305, + "round_gap_p95_ms": 91.55086003011093, + "round_gap_mean_ms": 72.22331666263644, + "tokens_per_chunk": 3.282051282051282, + "aggregate_prompt_ttft_tps": 104.0434000215727, + "aggregate_prefill_tps": 104.0434000215727 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396715.302917754, + "first": 396715.437476986, + "last": 396720.998672369, + "end": 396720.999083589, + "elapsed_s": 5.696165835019201, + "chunk_offsets_s": [ + 0.13455923198489472, + 0.2076105370069854, + 0.2670909889857285, + 0.3271127420011908, + 0.38726134499302134, + 0.4476327010197565, + 0.5061948400107212, + 0.5666559259989299, + 0.6356633669929579, + 0.6962772860424593, + 0.7585934459930286, + 0.8182409229921177, + 0.8786137040005997, + 0.941081129014492, + 1.0024035350070335, + 1.0671142300125211, + 1.1325848849955946, + 1.1964126430102624, + 1.2717099690344185, + 1.3516842370154336, + 1.42729852598859, + 1.4906558319926262, + 1.5706869009882212, + 1.655857363017276, + 1.7355646840296686, + 1.79590588103747, + 1.856679513992276, + 1.9168382760253735, + 1.9810250779846683, + 2.0456745729898103, + 2.1211065720417537, + 2.2078358660219237, + 2.2979432090069167, + 2.3894940690370277, + 2.483537146006711, + 2.5761165129952133, + 2.6537832070025615, + 2.737666569009889, + 2.8199290669872425, + 2.9054464290384203, + 2.9912483370280825, + 3.057734922040254, + 3.1298568570055068, + 3.200665516022127, + 3.2734943060204387, + 3.3472636489896104, + 3.415436490031425, + 3.4872818310395814, + 3.5678610000177287, + 3.6368056730134413, + 3.707537738024257, + 3.77949168800842, + 3.8495821800315753, + 3.923230754036922, + 4.001708463008981, + 4.078729342028964, + 4.162383438029792, + 4.235986043990124, + 4.3068054059986025, + 4.3892868350376375, + 4.468664488987997, + 4.53811374201905, + 4.599079153034836, + 4.6694568149978295, + 4.743253663007636, + 4.813298634020612, + 4.8830471219844185, + 4.9764922730391845, + 5.0468319990322925, + 5.120631967030931, + 5.195746987010352, + 5.270675478037447, + 5.353056057007052, + 5.433274999028072, + 5.510147349035833, + 5.586997459002305, + 5.644344994041603, + 5.6957546150079 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 71.95394998416305, + "p95": 91.55086003011093, + "max": 94.04307696968317 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.3, + "per_stream_tps": 29.1, + "ttft_s_max": 0.27, + "request": { + "ttft_s": 0.2, + "decode_tps": 29.152, + "prompt_ttft_tps": 78.144, + "prefill_tps": 78.144, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.303, + "round_gap_p50_ms": 107.727, + "round_gap_p95_ms": 127.192, + "tokens_per_chunk": 3.165, + "headers_s": 0.001, + "first_payload_s": 0.2, + "first_content_s": 0.2, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2, + "last_output_s": 8.887 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 106.109, + "aggregate_prefill_tps": 106.109, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.839, + "round_gap_p50_ms": 107.768, + "round_gap_p95_ms": 128.68, + "tokens_per_chunk": 3.16 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 56.662771026562055, + "makespan_s": 9.035915306012612, + "steady_tps": 59.7, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.30297141044994, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.035915306012612, + "end_to_end_tps": 56.662771026562055, + "timing_valid": true, + "steady_tps": 59.71453038834858, + "per_stream_tps": [ + 30.0, + 29.1 + ], + "ttft_s": [ + 0.14, + 0.27 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13567693898221478, + "decode_tps": 30.040069859037292, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 103.18629020540618, + "prefill_tps": 103.18629020540618, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.28887065484499, + "round_gap_p50_ms": 107.2732379543595, + "round_gap_p95_ms": 130.6666349992156, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0018423059955239296, + "first_payload_s": 0.13567693898221478, + "first_content_s": 0.13567693898221478, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13567693898221478, + "last_output_s": 8.624338955967687 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2666398800211027, + "decode_tps": 29.079020905428834, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 52.50527415063341, + "prefill_tps": 52.50527415063341, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.389053305894066, + "round_gap_p50_ms": 107.07648401148617, + "round_gap_p95_ms": 123.71735001215711, + "tokens_per_chunk": 3.0476190476190474, + "headers_s": 0.0021890299976803362, + "first_payload_s": 0.2666398800211027, + "first_content_s": 0.2666398800211027, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2666398800211027, + "last_output_s": 9.035848473024089 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.838961980369525, + "round_gap_p50_ms": 107.12824400980026, + "round_gap_p95_ms": 128.68039100430906, + "round_gap_mean_ms": 107.86169131242787, + "tokens_per_chunk": 3.1604938271604937, + "aggregate_prompt_ttft_tps": 105.01054830126682, + "aggregate_prefill_tps": 105.01054830126682 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396721.000320465, + "first": 396721.135997404, + "last": 396729.624659421, + "end": 396729.624752526, + "elapsed_s": 8.624432060983963, + "chunk_offsets_s": [ + 0.13567693898221478, + 0.3720307479961775, + 0.46839762397576123, + 0.5704482349683531, + 0.6721201390028, + 0.7729981140000746, + 0.8739072110038251, + 0.9793843509978615, + 1.0843951989663765, + 1.191344033984933, + 1.2948408189695328, + 1.4038439780124463, + 1.5049739569658414, + 1.6138443459640257, + 1.7174338849727064, + 1.8222962829750031, + 1.9314518439932726, + 2.04274499299936, + 2.151882153004408, + 2.256910282012541, + 2.360435978975147, + 2.467482798965648, + 2.57738671900006, + 2.6856059019919485, + 2.7895303560071625, + 2.8892483359668404, + 2.9961871869745664, + 3.0983735760091804, + 3.2025481759919785, + 3.3060133929830045, + 3.4134556250064634, + 3.523130598012358, + 3.6304038359667175, + 3.742373807996046, + 3.8554121589986607, + 3.9610144839971326, + 4.070020234968979, + 4.178758752008434, + 4.289023746969178, + 4.402120065991767, + 4.507417780987453, + 4.617960155010223, + 4.731183947005775, + 4.843502098985482, + 4.957248808001168, + 5.066794131998904, + 5.174576319986954, + 5.280773834965657, + 5.385920188971795, + 5.488560277968645, + 5.595246149983723, + 5.706304305000231, + 5.815426040964667, + 5.92777379299514, + 6.038277798972558, + 6.140890254988335, + 6.246360563964117, + 6.352812721976079, + 6.457452590984758, + 6.559439344971906, + 6.66635898000095, + 6.7713455079938285, + 6.873846859962214, + 6.980975103972014, + 7.090737246966455, + 7.197873123979662, + 7.299316032964271, + 7.4109863539924845, + 7.519243890012149, + 7.631051699980162, + 7.742075679008849, + 7.854983995959628, + 7.983782627969049, + 8.114449262968265, + 8.247075515973847, + 8.381273192993831, + 8.500939063960686, + 8.624338955967687 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 107.2732379543595, + "p95": 130.6666349992156, + "max": 236.35380901396275 + } + }, + { + "start": 396721.00021096, + "first": 396721.26685084, + "last": 396730.036059433, + "end": 396730.036126266, + "elapsed_s": 9.035915306012612, + "chunk_offsets_s": [ + 0.2666398800211027, + 0.3720877890009433, + 0.46845175203634426, + 0.5705027960357256, + 0.6724373259930871, + 0.7730400190339424, + 0.8739614189835265, + 0.9797289299895056, + 1.0845597450388595, + 1.191389170999173, + 1.2948809640365653, + 1.40387009101687, + 1.5053325680200942, + 1.6140048920060508, + 1.7176225099829026, + 1.8223298190278001, + 1.9316274130251259, + 2.0427847370156087, + 2.1522445090231486, + 2.2570955310366116, + 2.3604970520245843, + 2.467868563020602, + 2.577750194002874, + 2.685653551016003, + 2.789573284040671, + 2.889604436000809, + 2.996230499993544, + 3.0985623620217666, + 3.2025972160045058, + 3.3060659050242975, + 3.4136177219916135, + 3.523492106003687, + 3.630568590015173, + 3.742670083011035, + 3.855710113013629, + 3.9608742269920185, + 4.070084556005895, + 4.178670750989113, + 4.2888727860408835, + 4.401946321013384, + 4.507594023016281, + 4.618020620022435, + 4.73085135204019, + 4.84367105999263, + 4.957083430024795, + 5.0667380199884064, + 5.174752161023207, + 5.280806332011707, + 5.385836987989023, + 5.4884929489926435, + 5.595401576021686, + 5.706149215984624, + 5.815485497994814, + 5.927929506986402, + 6.038444023986813, + 6.14080593502149, + 6.246306179033127, + 6.3529969319934025, + 6.457482703030109, + 6.559483874007128, + 6.6666029340121895, + 6.77151736599626, + 6.873909148038365, + 6.981238610984292, + 7.090893007989507, + 7.198031173029449, + 7.299517875013407, + 7.4112013159901835, + 7.519282994035166, + 7.631222374038771, + 7.742246945039369, + 7.85504342103377, + 7.983723812038079, + 8.114320285036229, + 8.247420063999016, + 8.381643949018326, + 8.501195067015942, + 8.6249124170281, + 8.720465957012493, + 8.80526702402858, + 8.870102104032412, + 8.928869686031248, + 8.983526491036173, + 9.035848473024089 + ], + "chunk_gaps_ms": { + "count": 83, + "p50": 107.07648401148617, + "p95": 123.71735001215711, + "max": 134.22388501930982 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 56.11323175627137, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.222044936963357, + "end_to_end_tps": 55.51913957259374, + "timing_valid": true, + "steady_tps": 58.068260000425994, + "per_stream_tps": [ + 29.2, + 28.5 + ], + "ttft_s": [ + 0.13, + 0.26 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13296268897829577, + "decode_tps": 29.22564813661838, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 105.29269607570359, + "prefill_tps": 105.29269607570359, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.21652089032874, + "round_gap_p50_ms": 108.72778098564595, + "round_gap_p95_ms": 138.02931498503312, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0008998329867608845, + "first_payload_s": 0.13296268897829577, + "first_content_s": 0.13296268897829577, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13296268897829577, + "last_output_s": 8.858175516012125 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2636421389761381, + "decode_tps": 28.465190074486763, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.10228499271553, + "prefill_tps": 53.10228499271553, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.1306278785855, + "round_gap_p50_ms": 107.74327500257641, + "round_gap_p95_ms": 135.09406900266185, + "tokens_per_chunk": 3.0476190476190474, + "headers_s": 0.001305356970988214, + "first_payload_s": 0.2636421389761381, + "first_content_s": 0.2636421389761381, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2636421389761381, + "last_output_s": 9.221952248015441 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.67357438445712, + "round_gap_p50_ms": 108.36553695844486, + "round_gap_p95_ms": 135.64332301029935, + "round_gap_mean_ms": 110.52201835045707, + "tokens_per_chunk": 3.1604938271604937, + "aggregate_prompt_ttft_tps": 106.20456998543106, + "aggregate_prefill_tps": 106.20456998543106 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396730.037305861, + "first": 396730.17026855, + "last": 396738.895481377, + "end": 396738.895685843, + "elapsed_s": 8.858379982004408, + "chunk_offsets_s": [ + 0.13296268897829577, + 0.36969923798460513, + 0.46685455297119915, + 0.5677584809600376, + 0.6701496560126543, + 0.7720924899913371, + 0.8738206339767203, + 0.9798377319821157, + 1.084409519971814, + 1.19122963398695, + 1.2964110120083205, + 1.4039504289976321, + 1.5093904489767738, + 1.6194298900081776, + 1.7267266809940338, + 1.8333230479620397, + 1.9446287259925157, + 2.0562507740105502, + 2.167542451992631, + 2.274203219974879, + 2.379570919962134, + 2.4880161049659364, + 2.6200802410021424, + 2.7581095559871756, + 2.8905271989642642, + 3.019134068978019, + 3.1572735449881293, + 3.2864709009882063, + 3.419571975013241, + 3.550350545963738, + 3.685458807973191, + 3.824531924969051, + 3.9601752479793504, + 4.082708794972859, + 4.197659931960516, + 4.304971890000161, + 4.415683578001335, + 4.529562145005912, + 4.640782973961905, + 4.750166855985299, + 4.856598326005042, + 4.9665383429965, + 5.08041111700004, + 5.192206767969765, + 5.30686297401553, + 5.416582715988625, + 5.525310496974271, + 5.631517325004097, + 5.740006334963255, + 5.845267297001556, + 5.951309883967042, + 6.061508846003562, + 6.171890930971131, + 6.285254404996522, + 6.395110131998081, + 6.498427187965717, + 6.603903176961467, + 6.710303333995398, + 6.816741748014465, + 6.919810610008426, + 7.02751837996766, + 7.134237085003406, + 7.237933104974218, + 7.346814006974455, + 7.456096879963297, + 7.567132362979464, + 7.669055133999791, + 7.780842559994198, + 7.888026549015194, + 8.002443809004035, + 8.112929702969268, + 8.222466546983924, + 8.327588740969077, + 8.433330347994342, + 8.54108744696714, + 8.648249819991179, + 8.750961637997534, + 8.858175516012125 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 108.72778098564595, + "p95": 138.02931498503312, + "max": 236.73654900630936 + } + }, + { + "start": 396730.037081715, + "first": 396730.300723854, + "last": 396739.259033963, + "end": 396739.259126652, + "elapsed_s": 9.222044936963357, + "chunk_offsets_s": [ + 0.2636421389761381, + 0.37043705297401175, + 0.46686404099455103, + 0.5677830089698546, + 0.6699505819706246, + 0.7722131310147233, + 0.8739642039872706, + 0.9799589329631999, + 1.084849155973643, + 1.191620966012124, + 1.2965541330049746, + 1.404431121016387, + 1.5097199399606325, + 1.6197651569964364, + 1.7271979809738696, + 1.8337384120095521, + 1.9449741370044649, + 2.056582649005577, + 2.1676212360034697, + 2.274628120008856, + 2.379994140006602, + 2.4883596769650467, + 2.6204430449870415, + 2.7585330639849417, + 2.8906486720079556, + 3.019482360978145, + 3.157350488996599, + 3.2865886939689517, + 3.419995883014053, + 3.5507901029777713, + 3.685884171980433, + 3.8248720719711855, + 3.9605978750041686, + 4.083059309981763, + 4.197994590969756, + 4.3053013170138, + 4.4160347009892575, + 4.529638480977155, + 4.640890142007265, + 4.75050722801825, + 4.856928857974708, + 4.966619030979928, + 5.080523086013272, + 5.192539698968176, + 5.306986047013197, + 5.4166994849801995, + 5.5254283379763365, + 5.631621036969591, + 5.740126912016422, + 5.845393889991101, + 5.95142862101784, + 6.061604702961631, + 6.17199854797218, + 6.285404597991146, + 6.395528615976218, + 6.498574180994183, + 6.604050025984179, + 6.7107317699701525, + 6.816854260978289, + 6.920161284971982, + 7.027614316961262, + 7.1346633289940655, + 7.238348611979745, + 7.347146057989448, + 7.456427474971861, + 7.5674972150009125, + 7.669385504967067, + 7.781173746974673, + 7.8883586479933, + 8.00256171397632, + 8.11305383197032, + 8.222615587990731, + 8.327718277985696, + 8.433443548972718, + 8.541186823975295, + 8.648366844980046, + 8.751080582966097, + 8.858566830982454, + 8.929338193964213, + 8.99242594500538, + 9.055765874974895, + 9.115021764999256, + 9.170316303963773, + 9.221952248015441 + ], + "chunk_gaps_ms": { + "count": 83, + "p50": 107.74327500257641, + "p95": 135.09406900266185, + "max": 138.98789999075234 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 58.066591343037054, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.916541933023836, + "end_to_end_tps": 57.421364004774794, + "timing_valid": true, + "steady_tps": 60.380727779353386, + "per_stream_tps": [ + 30.8, + 29.0 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2637662210036069, + "decode_tps": 30.77700522074981, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.07730438996794, + "prefill_tps": 53.07730438996794, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.491790309922735, + "round_gap_p50_ms": 108.04139001993462, + "round_gap_p95_ms": 113.7215900234878, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0009300900273956358, + "first_payload_s": 0.2637662210036069, + "first_content_s": 0.2637662210036069, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2637662210036069, + "last_output_s": 8.549172750033904 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13344371801940724, + "decode_tps": 29.033295671518527, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.91314396653671, + "prefill_tps": 104.91314396653671, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.44321345099632, + "round_gap_p50_ms": 107.71097097313032, + "round_gap_p95_ms": 113.71394200250506, + "tokens_per_chunk": 3.0476190476190474, + "headers_s": 0.0012787490268237889, + "first_payload_s": 0.13344371801940724, + "first_content_s": 0.13344371801940724, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13344371801940724, + "last_output_s": 8.916463148023468 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.46750188045952, + "round_gap_p50_ms": 107.76780301239341, + "round_gap_p95_ms": 113.71394200250506, + "round_gap_mean_ms": 106.67766224396473, + "tokens_per_chunk": 3.1604938271604937, + "aggregate_prompt_ttft_tps": 106.10924347393774, + "aggregate_prefill_tps": 106.10924347393774 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396739.260243462, + "first": 396739.524009683, + "last": 396747.809416212, + "end": 396747.809559445, + "elapsed_s": 8.549315983022097, + "chunk_offsets_s": [ + 0.2637662210036069, + 0.3697186150238849, + 0.46634930098662153, + 0.5683719440130517, + 0.6724776480114087, + 0.7756456460338086, + 0.8776452650199644, + 0.9834808569867164, + 1.0883200080133975, + 1.1953866520198062, + 1.2998476070351899, + 1.4084249699953943, + 1.510336011997424, + 1.6194575080298819, + 1.723371706029866, + 1.8292434260365553, + 1.939360372023657, + 2.050560384988785, + 2.161769054015167, + 2.267370932037011, + 2.3726470950059593, + 2.4817348470096476, + 2.589051541988738, + 2.700493908021599, + 2.80588344798889, + 2.9065359979867935, + 3.015376003982965, + 3.1202253790106624, + 3.224171064037364, + 3.3288009809912182, + 3.4365325280232355, + 3.5461108770105056, + 3.655627401021775, + 3.769243340997491, + 3.883249461010564, + 3.9889100919826888, + 4.099218416027725, + 4.208257446996868, + 4.321156547986902, + 4.431628874037415, + 4.539593463006895, + 4.650398815982044, + 4.766302058007568, + 4.880023648031056, + 4.994791870994959, + 5.105390549986623, + 5.214399500982836, + 5.322847247007303, + 5.427344138035551, + 5.53105572599452, + 5.6390971160144545, + 5.75149286800297, + 5.8621756919892505, + 5.973810205003247, + 6.084493076021317, + 6.186856571002863, + 6.295033450005576, + 6.403150089026894, + 6.50859737303108, + 6.613376186985988, + 6.721882749989163, + 6.828708879998885, + 6.932216353015974, + 7.041095719032455, + 7.151869136025198, + 7.259626827028114, + 7.360650899994653, + 7.473069565021433, + 7.582502503995784, + 7.6943780279834755, + 7.806277438998222, + 7.9158270680345595, + 8.021862566005439, + 8.128187283000443, + 8.235175766982138, + 8.344320126983803, + 8.447322299994994, + 8.549172750033904 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 108.04139001993462, + "p95": 113.7215900234878, + "max": 115.90324202552438 + } + }, + { + "start": 396739.260130693, + "first": 396739.393574411, + "last": 396748.176593841, + "end": 396748.176672626, + "elapsed_s": 8.916541933023836, + "chunk_offsets_s": [ + 0.13344371801940724, + 0.3693060660152696, + 0.4666420880239457, + 0.5685770020354539, + 0.6724186230567284, + 0.7755273890215904, + 0.8772739010164514, + 0.9831077810376883, + 1.0883626960567199, + 1.1954282520455308, + 1.2998960230033845, + 1.4084106500376947, + 1.5103738360339776, + 1.6198002790333703, + 1.7237126370309852, + 1.8292663230095059, + 1.9396735910559073, + 2.050902388000395, + 2.1621171690057963, + 2.267694135021884, + 2.3726500710472465, + 2.481748447054997, + 2.5893024560064077, + 2.7006953500094824, + 2.805889464041684, + 2.9068963860045187, + 3.0153897480340675, + 3.1202347710495815, + 3.224521884054411, + 3.329108920006547, + 3.436737506010104, + 3.546350399032235, + 3.655986940022558, + 3.769552032055799, + 3.8835868400055915, + 3.988917292037513, + 4.099544547032565, + 4.208582570019644, + 4.32113651605323, + 4.43198873300571, + 4.539805769047234, + 4.650614626007155, + 4.766311050043441, + 4.880024992045946, + 4.995002657000441, + 5.105644296039827, + 5.214637888013385, + 5.322857743012719, + 5.427705966052599, + 5.531403201050125, + 5.639114172023255, + 5.751485444023274, + 5.8621900280122645, + 5.974159632052761, + 6.084492852038238, + 6.186855675012339, + 6.295049226027913, + 6.403154585044831, + 6.508955696015619, + 6.613585101033095, + 6.722111568029504, + 6.828681887011044, + 6.932235313055571, + 7.041344314056914, + 7.151880368008278, + 7.259648171020672, + 7.361007416038774, + 7.473060845048167, + 7.5824871280347, + 7.694678126019426, + 7.806285519036464, + 7.91582986805588, + 8.022055352048483, + 8.128505846019834, + 8.23551613802556, + 8.34433179104235, + 8.447327676054556, + 8.549182446033228, + 8.620924185030162, + 8.68353910004953, + 8.749931028054561, + 8.809512121020816, + 8.864325664006174, + 8.916463148023468 + ], + "chunk_gaps_ms": { + "count": 83, + "p50": 107.71097097313032, + "p95": 113.71394200250506, + "max": 235.86234799586236 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 72.9, + "per_stream_tps": 18.6, + "ttft_s_max": 0.65, + "request": { + "ttft_s": 0.365, + "decode_tps": 18.615, + "prompt_ttft_tps": 38.597, + "prefill_tps": 38.597, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.721, + "round_gap_p50_ms": 171.819, + "round_gap_p95_ms": 180.759, + "tokens_per_chunk": 3.221, + "headers_s": 0.002, + "first_payload_s": 0.365, + "first_content_s": 0.365, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.365, + "last_output_s": 14.046 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 106.173, + "aggregate_prefill_tps": 106.173, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.104, + "round_gap_p50_ms": 171.962, + "round_gap_p95_ms": 180.84, + "tokens_per_chunk": 3.2 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 72.47197232877299, + "makespan_s": 14.129600272979587, + "steady_tps": 75.0, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 73.02119029699513, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 14.103147915040608, + "end_to_end_tps": 72.60790329710241, + "timing_valid": true, + "steady_tps": 75.00593160363002, + "per_stream_tps": [ + 18.9, + 18.6, + 18.6, + 19.5 + ], + "ttft_s": [ + 0.13, + 0.4, + 0.26, + 0.53 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.13415174098918214, + "decode_tps": 18.904266102079784, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.3594357909149, + "prefill_tps": 104.3594357909149, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.89811276460943, + "round_gap_p50_ms": 170.95339595107362, + "round_gap_p95_ms": 180.11953303357586, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0017134889494627714, + "first_payload_s": 0.13415174098918214, + "first_content_s": 0.13415174098918214, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13415174098918214, + "last_output_s": 13.623170495964587 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.39567661203909665, + "decode_tps": 18.603734027397657, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 35.38242992895589, + "prefill_tps": 35.38242992895589, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.75264979209568, + "round_gap_p50_ms": 170.63030501594767, + "round_gap_p95_ms": 180.05948496283963, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.011028476001229137, + "first_payload_s": 0.39567661203909665, + "first_content_s": 0.39567661203909665, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39567661203909665, + "last_output_s": 14.102602309023496 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.26378774200566113, + "decode_tps": 18.62571025881578, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.07297410241127, + "prefill_tps": 53.07297410241127, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.68922774511042, + "round_gap_p50_ms": 170.73161795269698, + "round_gap_p95_ms": 180.00663700513542, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.011081372969783843, + "first_payload_s": 0.26378774200566113, + "first_content_s": 0.26378774200566113, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.26378774200566113, + "last_output_s": 13.95454081700882 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5252212840132415, + "decode_tps": 19.468465299831735, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 26.65543157928657, + "prefill_tps": 26.65543157928657, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.36511710600234, + "round_gap_p50_ms": 170.82472296897322, + "round_gap_p95_ms": 180.0599959678948, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.011641506047453731, + "first_payload_s": 0.5252212840132415, + "first_content_s": 0.5252212840132415, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5252212840132415, + "last_output_s": 13.623326146043837 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.92627685195447, + "round_gap_p50_ms": 170.80827400786802, + "round_gap_p95_ms": 180.0599959678948, + "round_gap_mean_ms": 170.8379822436505, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 106.62172631714628, + "aggregate_prefill_tps": 106.62172631714628 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396748.179368332, + "first": 396748.313520073, + "last": 396761.802538828, + "end": 396761.802686526, + "elapsed_s": 13.623318193946034, + "chunk_offsets_s": [ + 0.13415174098918214, + 0.6880825519911014, + 0.8418021319666877, + 0.9877466749749146, + 1.1481439359486103, + 1.2973158389795572, + 1.452007795975078, + 1.6107504479587078, + 1.7739807449979708, + 1.9358236359548755, + 2.0944828469655477, + 2.2612575619714335, + 2.427006490994245, + 2.591994067945052, + 2.7623498259927146, + 2.9333032219437882, + 3.101572014973499, + 3.2733158819610253, + 3.44153206696501, + 3.610490051971283, + 3.7788836139952764, + 3.9490868259454146, + 4.123525647970382, + 4.293684043979738, + 4.460556647973135, + 4.629289685981348, + 4.803259974985849, + 4.971649696992245, + 5.141137782949954, + 5.305246151983738, + 5.471929857973009, + 5.643200407968834, + 5.819276413996704, + 5.998356336960569, + 6.17783573595807, + 6.351671991986223, + 6.52386736695189, + 6.69479247496929, + 6.869080254982691, + 7.0447727689752355, + 7.2182038049795665, + 7.393227255961392, + 7.572400443954393, + 7.75540435698349, + 7.939508936950006, + 8.11179351399187, + 8.290220470982604, + 8.466000584943686, + 8.646093925985042, + 8.818648376967758, + 8.997800540993921, + 9.175501762947533, + 9.354314066993538, + 9.531650612945668, + 9.70361323497491, + 9.87035234895302, + 10.033539525000378, + 10.199856587976683, + 10.366208466992248, + 10.528976677975152, + 10.695678640971892, + 10.868384500965476, + 11.036309835966676, + 11.213787534972653, + 11.390249816991854, + 11.561274252948351, + 11.73418872395996, + 11.914308256993536, + 12.087122262979392, + 12.266789567947853, + 12.445214187959209, + 12.621012254967354, + 12.791699872992467, + 12.96123744698707, + 13.132374219945632, + 13.302988636947703, + 13.465224842948373, + 13.623170495964587 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 170.95339595107362, + "p95": 180.11953303357586, + "max": 553.9308110019192 + } + }, + { + "start": 396748.179465741, + "first": 396748.575142353, + "last": 396762.28206805, + "end": 396762.282207972, + "elapsed_s": 14.102742231043521, + "chunk_offsets_s": [ + 0.39567661203909665, + 0.6880809840513393, + 0.8417994760093279, + 0.9878107880358584, + 1.1479031820199452, + 1.2971368129947223, + 1.4518254100112244, + 1.610420173034072, + 1.7742923960322514, + 1.9358833320438862, + 2.0945742879994214, + 2.2612552260397933, + 2.4271759320399724, + 2.591998660005629, + 2.762330978002865, + 2.933288998028729, + 3.1016242559999228, + 3.2734868760453537, + 3.4415843880269676, + 3.610515092033893, + 3.7790230550454, + 3.9491612749989145, + 4.12368083401816, + 4.29373991600005, + 4.460717753041536, + 4.629401223035529, + 4.8034460410126485, + 4.971946739999112, + 5.141255400027148, + 5.305419305048417, + 5.471975346037652, + 5.643249097047374, + 5.819283022021409, + 5.998489138029981, + 6.177550309046637, + 6.351806473045144, + 6.524018697033171, + 6.694873596017715, + 6.869325601030141, + 7.045026611012872, + 7.218366062035784, + 7.393375081999693, + 7.572531677025836, + 7.755381972994655, + 7.939505785005167, + 8.112047803995665, + 8.290471305022947, + 8.466088154003955, + 8.646229431033134, + 8.818811355042271, + 8.997922430047765, + 9.175687812035903, + 9.354404580022674, + 9.531807191029657, + 9.703772980021313, + 9.87048737402074, + 10.033685942995362, + 10.199999965028837, + 10.366357540013269, + 10.528962709999178, + 10.695828210038599, + 10.8679802090046, + 11.036463613039814, + 11.213937345019076, + 11.390406442049425, + 11.561460175027605, + 11.734325621044263, + 11.914385106007103, + 12.08727026404813, + 12.266944673028775, + 12.445370269997511, + 12.62106000003405, + 12.791796513018198, + 12.961382504028734, + 13.13260412600357, + 13.303234431019519, + 13.465473086049315, + 13.62350600300124, + 13.738971386046614, + 13.851273745007347, + 13.95551041001454, + 14.03730618400732, + 14.102602309023496 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 170.6834090000484, + "p95": 180.05948496283963, + "max": 292.4043720122427 + } + }, + { + "start": 396748.179893249, + "first": 396748.443680991, + "last": 396762.134434066, + "end": 396762.13461682, + "elapsed_s": 13.954723571019713, + "chunk_offsets_s": [ + 0.26378774200566113, + 0.6874624179909006, + 0.8410832770168781, + 0.9871744940173812, + 1.1473424879950471, + 1.2966242639813572, + 1.4513092609704472, + 1.61009319400182, + 1.7736797179677524, + 1.9352223820169456, + 2.094027355022263, + 2.260909911012277, + 2.426656743977219, + 2.591643296997063, + 2.7619849430047907, + 2.9329271059832536, + 3.1011279309750535, + 3.272842773993034, + 3.4409548139665276, + 3.6100183349917643, + 3.778418777976185, + 3.9484830769943073, + 4.123054075986147, + 4.293222856009379, + 4.460093219007831, + 4.629047412017826, + 4.802796353993472, + 4.97158384101931, + 5.140731059014797, + 5.304780530976132, + 5.471461565000936, + 5.642727300000843, + 5.81868685601512, + 5.997979869018309, + 6.176996591966599, + 6.351295507978648, + 6.5233963709906675, + 6.6942046449985355, + 6.868719515972771, + 7.04441734199645, + 7.217852073023096, + 7.39286592497956, + 7.571935831976589, + 7.7550634579965845, + 7.938930372009054, + 8.111437750980258, + 8.28987173101632, + 8.46557037299499, + 8.645629314007238, + 8.818190132966265, + 8.99738397699548, + 9.175036253989674, + 9.353719517006539, + 9.531196160998661, + 9.703148045984562, + 9.869976777990814, + 10.033075137005653, + 10.199396102980245, + 10.365735789993778, + 10.52835859300103, + 10.695218075998127, + 10.867917697003577, + 11.0358373990166, + 11.21331983502023, + 11.389792579982895, + 11.560809272981714, + 11.73371934297029, + 11.913725979975425, + 12.08665667497553, + 12.266331835009623, + 12.444755207980052, + 12.620545611018315, + 12.791277228971012, + 12.96077086601872, + 13.13201136898715, + 13.302622921008151, + 13.46486314397771, + 13.622592187020928, + 13.73835539596621, + 13.850609707005788, + 13.95454081700882 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 170.7699459802825, + "p95": 180.00663700513542, + "max": 423.67467598523945 + } + }, + { + "start": 396748.179060057, + "first": 396748.704281341, + "last": 396761.802386203, + "end": 396761.803251939, + "elapsed_s": 13.624191882030573, + "chunk_offsets_s": [ + 0.5252212840132415, + 0.6882066180114634, + 0.8418081640265882, + 0.9879064210108481, + 1.1481011360301636, + 1.2973797119921073, + 1.4520630610059015, + 1.611174005025532, + 1.7741952910437249, + 1.9359721970395185, + 2.0946600810275413, + 2.2614839960006066, + 2.4272249250207096, + 2.5922266470151953, + 2.7625534600229003, + 2.9335219759959728, + 3.1018066410324536, + 3.2735083480365574, + 3.441681509022601, + 3.6106982300407253, + 3.7790578239946626, + 3.9492182680405676, + 4.1237329299910925, + 4.293883118021768, + 4.460762426024303, + 4.629493512038607, + 4.803459577029571, + 4.972139142046217, + 5.141366265015677, + 5.305430328997318, + 5.472115188022144, + 5.6434127620304935, + 5.819415470992681, + 5.998563843022566, + 6.177734007011168, + 6.351849177037366, + 6.52406092104502, + 6.694885644013993, + 6.86926816101186, + 7.044973379001021, + 7.2184040790307336, + 7.393425385991577, + 7.572555917024147, + 7.755571271001827, + 7.939663707045838, + 8.111974732019007, + 8.290420344041195, + 8.466197371017188, + 8.646293288038578, + 8.818844475026708, + 8.998035744007211, + 9.1757287090295, + 9.354447124002036, + 9.531840583018493, + 9.703817845031153, + 9.870548111037351, + 10.033732598996721, + 10.200046062003821, + 10.366410421032924, + 10.529063143010717, + 10.695883363019675, + 10.868503623001743, + 11.036496110027656, + 11.213983473018743, + 11.390444474003743, + 11.561480271047913, + 11.734382086026017, + 11.914442081993911, + 12.087308809044771, + 12.26698336203117, + 12.445416909991764, + 12.621195873012766, + 12.791920003015548, + 12.961438616039231, + 13.132566878048237, + 13.303185469994787, + 13.465408588992432, + 13.623326146043837 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 170.82472296897322, + "p95": 180.0599959678948, + "max": 184.09243604401127 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 71.05221775735177, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 14.525064993009437, + "end_to_end_tps": 70.49882396346085, + "timing_valid": true, + "steady_tps": 73.27750826187551, + "per_stream_tps": [ + 18.3, + 18.4, + 18.3, + 18.5 + ], + "ttft_s": [ + 0.17, + 0.65, + 0.49, + 0.34 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.16873743798350915, + "decode_tps": 18.324667448119577, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.96913931671898, + "prefill_tps": 82.96913931671898, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 54.57124953733428, + "round_gap_p50_ms": 172.14638402219862, + "round_gap_p95_ms": 210.9159940155223, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0010595470084808767, + "first_payload_s": 0.16873743798350915, + "first_content_s": 0.16873743798350915, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.16873743798350915, + "last_output_s": 14.084406070003752 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.6508134049945511, + "decode_tps": 18.381093539472715, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 21.511542160255924, + "prefill_tps": 21.511542160255924, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 54.40372727838729, + "round_gap_p50_ms": 171.6536749736406, + "round_gap_p95_ms": 210.37494798656553, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.0017373929731547832, + "first_payload_s": 0.6508134049945511, + "first_content_s": 0.6508134049945511, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.6508134049945511, + "last_output_s": 14.523763860983308 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.48921293299645185, + "decode_tps": 18.324895445544257, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 28.617395526012267, + "prefill_tps": 28.617395526012267, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 54.57057056460055, + "round_gap_p50_ms": 171.95817397441715, + "round_gap_p95_ms": 210.70215199142694, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.0017390729626640677, + "first_payload_s": 0.48921293299645185, + "first_content_s": 0.48921293299645185, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.48921293299645185, + "last_output_s": 14.404708426969592 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.33537740004248917, + "decode_tps": 18.545244669938768, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.744017331598165, + "prefill_tps": 41.744017331598165, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.92217885488279, + "round_gap_p50_ms": 171.966718044132, + "round_gap_p95_ms": 210.89466603007168, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0018734100158326328, + "first_payload_s": 0.33537740004248917, + "first_content_s": 0.33537740004248917, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.33537740004248917, + "last_output_s": 14.0855330080376 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 54.36693155880123, + "round_gap_p50_ms": 171.96227004751563, + "round_gap_p95_ms": 210.70215199142694, + "round_gap_mean_ms": 175.4881968037255, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 85.94809276211866, + "aggregate_prefill_tps": 85.94809276211866 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396762.28615193, + "first": 396762.454889368, + "last": 396776.370558, + "end": 396776.371080437, + "elapsed_s": 14.084928506985307, + "chunk_offsets_s": [ + 0.16873743798350915, + 0.8509793740231544, + 1.0078416250180453, + 1.1548164979903959, + 1.3154541460098699, + 1.4645811680238694, + 1.6171229929896072, + 1.7749154600314796, + 1.9353489450295456, + 2.0962924510240555, + 2.2554744519875385, + 2.4217009540298022, + 2.5886177190113813, + 2.7527701840153895, + 2.924884631007444, + 3.0921934790094383, + 3.2618121100240387, + 3.434638980019372, + 3.603444034990389, + 3.772081169008743, + 3.9395584180019796, + 4.129235309024807, + 4.3431431879871525, + 4.553567273018416, + 4.763591514027212, + 4.973634219029918, + 5.185150186996907, + 5.393390137993265, + 5.604306132008787, + 5.767148680984974, + 5.933622625016142, + 6.104229569027666, + 6.279840067028999, + 6.459379643027205, + 6.63565741002094, + 6.809436194016598, + 6.9813380150008015, + 7.155710980005097, + 7.331277892983053, + 7.507954320986755, + 7.679748653026763, + 7.852610834990628, + 8.03126300999429, + 8.213249650027137, + 8.39472692500567, + 8.5663429669803, + 8.743296437023673, + 8.91867614898365, + 9.100322513026185, + 9.270416971994564, + 9.446113487007096, + 9.622057315020356, + 9.80037951900158, + 9.976844537013676, + 10.15308380802162, + 10.318071866000537, + 10.479940869030543, + 10.645976728992537, + 10.812749715987593, + 10.976428305031732, + 11.145204992033541, + 11.314749334007502, + 11.482360266032629, + 11.660069536010269, + 11.83533998200437, + 12.01129294600105, + 12.186150028021075, + 12.366589148994535, + 12.538735533016734, + 12.720701547979843, + 12.900112578994595, + 13.076254905026872, + 13.25265857798513, + 13.424103163008112, + 13.59357635298511, + 13.765559214982204, + 13.927715628989972, + 14.084406070003752 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 172.14638402219862, + "p95": 210.9159940155223, + "max": 682.2419360396452 + } + }, + { + "start": 396762.286764672, + "first": 396762.937578077, + "last": 396776.810528533, + "end": 396776.811087018, + "elapsed_s": 14.524322345969267, + "chunk_offsets_s": [ + 0.6508134049945511, + 0.8505908419610932, + 1.0071593779721297, + 1.1540722029749304, + 1.3147564909886569, + 1.46412092394894, + 1.6164214339805767, + 1.7741057079983875, + 1.934646793990396, + 2.0955906529561616, + 2.254467610968277, + 2.4210044509964064, + 2.5883994280011393, + 2.7520737609593198, + 2.9239314859732985, + 3.091764674987644, + 3.2613592419656925, + 3.433865708997473, + 3.603205456980504, + 3.7712233839556575, + 3.9384952079853974, + 4.128880328964442, + 4.34273396799108, + 4.553344310959801, + 4.763081124983728, + 4.9734560729702935, + 5.1844595079892315, + 5.3926583549473435, + 5.6036309889750555, + 5.766415297985077, + 5.9332827819744125, + 6.103708683978766, + 6.279468718974385, + 6.458963445969857, + 6.6348757869564, + 6.80915374297183, + 6.980807417945471, + 7.154945436981507, + 7.331024802988395, + 7.507440299959853, + 7.679394552949816, + 7.852235039987136, + 8.030736108950805, + 8.212919118988793, + 8.394330921000801, + 8.565840945986565, + 8.742597614997067, + 8.91796449397225, + 9.09960829798365, + 9.269861254957505, + 9.445621673949063, + 9.621834336954635, + 9.800067563948687, + 9.976641558983829, + 10.151958756963722, + 10.317646149953362, + 10.47989413299365, + 10.645663637958933, + 10.811901995970402, + 10.976167486980557, + 11.14518763194792, + 11.313861725968309, + 11.482170727977064, + 11.659653579001315, + 11.835140411974862, + 12.011077871953603, + 12.185378868947737, + 12.366316537954845, + 12.537880467949435, + 12.720246583980042, + 12.89959662198089, + 13.075472625961993, + 13.25193671497982, + 13.42338504397776, + 13.593181020987686, + 13.765445789962541, + 13.927298616967164, + 14.084635959996376, + 14.198709728952963, + 14.30873878696002, + 14.405078814947046, + 14.472144460945856, + 14.523763860983308 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 171.75569999380969, + "p95": 210.37494798656553, + "max": 213.85363902663812 + } + }, + { + "start": 396762.286553118, + "first": 396762.775766051, + "last": 396776.691261545, + "end": 396776.69139801, + "elapsed_s": 14.404844891978428, + "chunk_offsets_s": [ + 0.48921293299645185, + 0.850876796990633, + 1.0075425979448482, + 1.1547562419436872, + 1.3151644789613783, + 1.464010730967857, + 1.6169112469651736, + 1.7746648979955353, + 1.9352202719892375, + 2.0961227859952487, + 2.2548637579893693, + 2.421385190973524, + 2.588541829958558, + 2.7520616649999283, + 2.9242329449625686, + 3.092028565995861, + 3.261057974945288, + 3.43414380698232, + 3.6031236479757354, + 3.7717418529791757, + 3.9388003949425183, + 4.128903417964466, + 4.342640366987325, + 4.553342518978752, + 4.763114500965457, + 4.972930611984339, + 5.184819894959219, + 5.392797347973101, + 5.6036750539788045, + 5.766550914966501, + 5.9333384139463305, + 6.104031214956194, + 6.279243836994283, + 6.459286057972349, + 6.634914122987539, + 6.809137342963368, + 6.981076411961112, + 7.154986716981512, + 7.330750591994729, + 7.507733390957583, + 7.6794280739850365, + 7.852280463965144, + 8.03102814394515, + 8.212941406993195, + 8.394159958988894, + 8.566118132963311, + 8.742691327992361, + 8.918397025961895, + 9.099608537973836, + 9.269943815947045, + 9.44589943595929, + 9.621898081968538, + 9.800118075974751, + 9.97654078999767, + 10.152117270976305, + 10.317771014990285, + 10.479681378987152, + 10.645719158987049, + 10.812018124968745, + 10.976261823961977, + 11.144961997983046, + 11.314137199951801, + 11.48219973599771, + 11.659791756945197, + 11.835063274949789, + 12.011446051998064, + 12.185675367945805, + 12.36632028198801, + 12.53817298298236, + 12.720082645944785, + 12.899621645978186, + 13.075752771983389, + 13.25208623695653, + 13.423540149990004, + 13.593304429959971, + 13.765264891961124, + 13.927090518991463, + 14.084290724946186, + 14.198777153971605, + 14.308880931988824, + 14.404708426969592 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 171.95931798778474, + "p95": 210.70215199142694, + "max": 361.66386399418116 + } + }, + { + "start": 396762.286022025, + "first": 396762.621399425, + "last": 396776.371555033, + "end": 396776.371749947, + "elapsed_s": 14.085727922036313, + "chunk_offsets_s": [ + 0.33537740004248917, + 0.8515972360037267, + 1.0081393709988333, + 1.1551242929999717, + 1.3156374910031445, + 1.4646334730205126, + 1.6175120359985158, + 1.7752592870383523, + 1.935577314987313, + 2.0964810450095683, + 2.2553097780328244, + 2.4220203650183976, + 2.588828056002967, + 2.752950538008008, + 2.924849543021992, + 3.0926366519997828, + 3.2618835830362514, + 3.434817142027896, + 3.603887655015569, + 3.772359250986483, + 3.9396115069976076, + 4.129734897986054, + 4.343420390039682, + 4.553938764031045, + 4.763975277019199, + 4.973550202033948, + 5.185437117004767, + 5.393684573005885, + 5.604579239035957, + 5.767335498007014, + 5.933933444030117, + 6.10473683802411, + 6.280153894040268, + 6.459903407027014, + 6.635734387033153, + 6.8097391400369816, + 6.981675986025948, + 7.155778405023739, + 7.331606824009214, + 7.508367220987566, + 7.679826461011544, + 7.852886854030658, + 8.031626678013708, + 8.213333027029876, + 8.394807372998912, + 8.566774091043044, + 8.743484598991927, + 8.918514546996448, + 9.100509842042811, + 9.270383260038216, + 9.44650520203868, + 9.622315460990649, + 9.801291000039782, + 9.977310541027691, + 10.153696854016744, + 10.31857486302033, + 10.480401642038487, + 10.646501102019101, + 10.813276617031079, + 10.976474450028036, + 11.145699269021861, + 11.315042776986957, + 11.482664748036768, + 11.660572468012106, + 11.835801394016016, + 12.011562021041755, + 12.186334909987636, + 12.366961984022055, + 12.538816685031634, + 12.720755404036026, + 12.90041437302716, + 13.076442810997833, + 13.252845172013622, + 13.42434350104304, + 13.59407051699236, + 13.766032787039876, + 13.928114673006348, + 14.0855330080376 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 171.966718044132, + "p95": 210.89466603007168, + "max": 516.2198359612375 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 72.8871279968637, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 14.129600272979587, + "end_to_end_tps": 72.47197232877299, + "timing_valid": true, + "steady_tps": 75.11678063323309, + "per_stream_tps": [ + 18.8, + 18.4, + 18.7, + 19.4 + ], + "ttft_s": [ + 0.13, + 0.27, + 0.39, + 0.53 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.1347424029954709, + "decode_tps": 18.831139073392908, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 103.90196173412895, + "prefill_tps": 103.90196173412895, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.103532192215106, + "round_gap_p50_ms": 172.59181203553453, + "round_gap_p95_ms": 182.0454570115544, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0011559799895621836, + "first_payload_s": 0.1347424029954709, + "first_content_s": 0.1347424029954709, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1347424029954709, + "last_output_s": 13.676143112010323 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2662213980220258, + "decode_tps": 18.39433940060865, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 52.58780888394895, + "prefill_tps": 52.58780888394895, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 54.36455086649706, + "round_gap_p50_ms": 171.68049199972302, + "round_gap_p95_ms": 180.83974899491295, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.0022043740027584136, + "first_payload_s": 0.2662213980220258, + "first_content_s": 0.2662213980220258, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2662213980220258, + "last_output_s": 14.129181868978776 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.3949292930192314, + "decode_tps": 18.73218963382662, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 35.449383592111154, + "prefill_tps": 35.449383592111154, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.3840420980043, + "round_gap_p50_ms": 172.50430799322203, + "round_gap_p95_ms": 180.67811499349773, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.0017199370195157826, + "first_payload_s": 0.3949292930192314, + "first_content_s": 0.3949292930192314, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3949292930192314, + "last_output_s": 14.007860028010327 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5274418990011327, + "decode_tps": 19.392903850605105, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 26.54320793724037, + "prefill_tps": 26.54320793724037, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.565253337178675, + "round_gap_p50_ms": 172.51163499895483, + "round_gap_p95_ms": 180.67875504493713, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0025829540099948645, + "first_payload_s": 0.5274418990011327, + "first_content_s": 0.5274418990011327, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5274418990011327, + "last_output_s": 13.676581499981694 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.104344623473786, + "round_gap_p50_ms": 172.51163499895483, + "round_gap_p95_ms": 180.83974899491295, + "round_gap_mean_ms": 171.41275796184576, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 106.17283174896149, + "aggregate_prefill_tps": 106.17283174896149 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396776.815519813, + "first": 396776.950262216, + "last": 396790.491662925, + "end": 396790.491918207, + "elapsed_s": 13.676398393989075, + "chunk_offsets_s": [ + 0.1347424029954709, + 0.6910046620178036, + 0.8438850980019197, + 0.9909207250457257, + 1.1530429790145718, + 1.3021892340038903, + 1.4543269739951938, + 1.6152122240164317, + 1.7768571610213257, + 1.9385066110407934, + 2.0985957250231877, + 2.267102297046222, + 2.432840602006763, + 2.599060815991834, + 2.7716526280273683, + 2.9394266650197096, + 3.1104237569961697, + 3.2834261810057797, + 3.452306869032327, + 3.6236823810031638, + 3.791841125988867, + 3.9605306280427612, + 4.1357229460263625, + 4.305811933008954, + 4.473204991023522, + 4.6422318239929155, + 4.817821840988472, + 4.984369642043021, + 5.155079596035648, + 5.320113126013894, + 5.487924876040779, + 5.660339822003152, + 5.836945513030514, + 6.012352888996247, + 6.189315800031181, + 6.36227903899271, + 6.5353091600118205, + 6.708757620013785, + 6.884785370028112, + 7.062920340045821, + 7.237219016999006, + 7.4114580930327065, + 7.590950915997382, + 7.774546739994548, + 7.960819389030803, + 8.134090039995499, + 8.314562649000436, + 8.491886539035477, + 8.672087721992284, + 8.844557805045042, + 9.022385907999706, + 9.201079796010163, + 9.380149239033926, + 9.558290752989706, + 9.731117224029731, + 9.89716374001, + 10.061316894018091, + 10.227474627026822, + 10.395354345033411, + 10.559467467013747, + 10.727392929024063, + 10.901159537024796, + 11.071564208017662, + 11.247923017013818, + 11.42408806399908, + 11.59705533599481, + 11.771209258993622, + 11.951943151012529, + 12.124678788008168, + 12.306724245019723, + 12.487399159988854, + 12.664580504992045, + 12.839687413012143, + 13.010981629020534, + 13.182575239043217, + 13.355986372043844, + 13.51833491603611, + 13.676143112010323 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 172.59181203553453, + "p95": 182.0454570115544, + "max": 556.2622590223327 + } + }, + { + "start": 396776.815320867, + "first": 396777.081542265, + "last": 396790.944502736, + "end": 396790.944813443, + "elapsed_s": 14.129492576001212, + "chunk_offsets_s": [ + 0.2662213980220258, + 0.6911416560178623, + 0.8441567010013387, + 0.9913601049920544, + 1.153844538028352, + 1.3029455610085279, + 1.4549825970316306, + 1.6154644670314156, + 1.7774357750313357, + 1.9387593810097314, + 2.0985942850238644, + 2.2673827480175532, + 2.4331797410268337, + 2.599399427010212, + 2.771992534981109, + 2.939699883980211, + 3.1105061739799567, + 3.2837447290075943, + 3.4528881710139103, + 3.624118690029718, + 3.7918584379949607, + 3.9605468360241503, + 4.136083988996688, + 4.3058017090079375, + 4.473291360016447, + 4.641678347019479, + 4.817859089991543, + 4.984405450988561, + 5.155605376989115, + 5.319853444001637, + 5.487891963974107, + 5.6606890260009095, + 5.836802679987159, + 6.012315305008087, + 6.189581401995383, + 6.362769492028747, + 6.535454633005429, + 6.708868021029048, + 6.88504537200788, + 7.0628883879981, + 7.2374899630085565, + 7.411484669020865, + 7.59106501302449, + 7.774568804015871, + 7.961139185004868, + 8.134514859993942, + 8.314881803991739, + 8.491930716030765, + 8.672013161005452, + 8.844859600008931, + 9.02269247098593, + 9.201102531980723, + 9.380475881975144, + 9.558298496995121, + 9.731243305024691, + 9.897424686991144, + 10.06104621902341, + 10.227236752980389, + 10.395498651021626, + 10.559486571000889, + 10.727810150012374, + 10.901412467996124, + 11.071669760975055, + 11.248238796018995, + 11.424221728986595, + 11.597359387029428, + 11.771180443000048, + 11.951671755989082, + 12.124793461000081, + 12.306862678029574, + 12.487702427024487, + 12.664697833999526, + 12.840443564986344, + 13.011228559014853, + 13.182909051014576, + 13.356249829987064, + 13.518586837977637, + 13.676579675986432, + 13.796695968019776, + 13.909917665005196, + 14.008381825988181, + 14.077243714011274, + 14.129181868978776 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 172.13679998531006, + "p95": 180.83974899491295, + "max": 424.92025799583644 + } + }, + { + "start": 396776.815898105, + "first": 396777.210827398, + "last": 396790.823758133, + "end": 396790.823824358, + "elapsed_s": 14.007926253019832, + "chunk_offsets_s": [ + 0.3949292930192314, + 0.6907802920322865, + 0.8434363250271417, + 0.9908883240423165, + 1.1538144740043208, + 1.302234770031646, + 1.454302654019557, + 1.6146480099996552, + 1.776589782035444, + 1.9382796800346114, + 2.098149032040965, + 2.2671284890384413, + 2.432806121010799, + 2.5989286540425383, + 2.7714789460296743, + 2.9389283240307122, + 3.109594277048018, + 3.283261139993556, + 3.4521984520251863, + 3.623231145029422, + 3.7915464830002747, + 3.960400083044078, + 4.13554995204322, + 4.305486266035587, + 4.472765994025394, + 4.641346711025108, + 4.817065770039335, + 4.984150664007757, + 5.154825081001036, + 5.319873668020591, + 5.487397494027391, + 5.659901802020613, + 5.835972896020394, + 6.011870212038048, + 6.189226423040964, + 6.362009116041008, + 6.53465996903833, + 6.708148638019338, + 6.88452085503377, + 7.06199551501777, + 7.237009686010424, + 7.410852471017279, + 7.590633521031123, + 7.773945550026838, + 7.960634459042922, + 8.133842869021464, + 8.31424675800372, + 8.491555560030974, + 8.67148952401476, + 8.84423216903815, + 9.021902799024247, + 9.200437133025844, + 9.379855364037212, + 9.55796631803969, + 9.730596722045448, + 9.89705127500929, + 10.060264835017733, + 10.226608266006224, + 10.395073621999472, + 10.558851748006418, + 10.727322032034863, + 10.90087804599898, + 11.071249628032092, + 11.247714230034035, + 11.423547850048635, + 11.596845621010289, + 11.770661589049269, + 11.950863684003707, + 12.124160559033044, + 12.306394417013507, + 12.487072532007005, + 12.664275061048102, + 12.839253473037388, + 13.010516056034248, + 13.182258356013335, + 13.355542814999353, + 13.518069297017064, + 13.675706883019302, + 13.796026409021579, + 13.909287595015485, + 14.007860028010327 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 172.52729999017902, + "p95": 180.67811499349773, + "max": 295.8509990130551 + } + }, + { + "start": 396776.81521317, + "first": 396777.342655069, + "last": 396790.49179467, + "end": 396790.49217573, + "elapsed_s": 13.676962559984531, + "chunk_offsets_s": [ + 0.5274418990011327, + 0.6911024709697813, + 0.8443383990088478, + 0.9918970539583825, + 1.1543010390014388, + 1.3027155269519426, + 1.4547294899821281, + 1.615625620004721, + 1.7773843499599025, + 1.938621859997511, + 2.0986222209758125, + 2.267700270982459, + 2.4328864740091376, + 2.599112431984395, + 2.7717453969526105, + 2.9398968140012585, + 3.1101508589927107, + 3.2834674940095283, + 3.4528009219793603, + 3.624103985959664, + 3.7923342349822633, + 3.960992536973208, + 4.136119125992991, + 4.305631643976085, + 4.4732345750089735, + 4.641852603992447, + 4.817610110971145, + 4.984766141977161, + 5.155093339970335, + 5.319770802976564, + 5.487886442977469, + 5.660475278971717, + 5.836321282957215, + 6.012163638952188, + 6.189825420966372, + 6.362337055965327, + 6.5354779929621145, + 6.709139863960445, + 6.884923802979756, + 7.062899171956815, + 7.237327753973659, + 7.411281210952438, + 7.591033924953081, + 7.774422210990451, + 7.961191760958172, + 8.134457868000027, + 8.314737354987301, + 8.491830362996552, + 8.672262811975088, + 8.844772687007207, + 9.022263522958383, + 9.20099968300201, + 9.380214551987592, + 9.558322337979916, + 9.73151908395812, + 9.897605551988818, + 10.061073082964867, + 10.227067822997924, + 10.395494762982707, + 10.55941540200729, + 10.727852198004257, + 10.901232945965603, + 11.071696433005854, + 11.248047770000994, + 11.423872877960093, + 11.59759470098652, + 11.771032488963101, + 11.951711244008038, + 12.124730628973339, + 12.306895557965618, + 12.487438359996304, + 12.665024636953603, + 12.840404107992072, + 13.010908747965004, + 13.182752521010116, + 13.356093172973488, + 13.518443012959324, + 13.676581499981694 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 172.51163499895483, + "p95": 180.67875504493713, + "max": 186.7695499677211 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 32.9, + "per_stream_tps": 32.9, + "ttft_s_max": 0.2, + "request": { + "ttft_s": 0.2, + "decode_tps": 32.928, + "prompt_ttft_tps": 160.308, + "prefill_tps": 160.308, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 30.369, + "round_gap_p50_ms": 62.783, + "round_gap_p95_ms": 82.418, + "tokens_per_chunk": 2.306, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.2, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2, + "last_output_s": 7.944 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 160.308, + "aggregate_prefill_tps": 160.308, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 30.369, + "round_gap_p50_ms": 62.783, + "round_gap_p95_ms": 82.418, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 32.22586814493035, + "makespan_s": 7.943928736029193, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 32.92792621219133, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.943928736029193, + "end_to_end_tps": 32.22586814493035, + "timing_valid": true, + "per_stream_tps": [ + 32.9 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19961553299799562, + "decode_tps": 32.92792621219133, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.30816599989402, + "prefill_tps": 160.30816599989402, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 30.36935862756389, + "round_gap_p50_ms": 78.50799901643768, + "round_gap_p95_ms": 92.03264297684655, + "tokens_per_chunk": 2.56, + "headers_s": 0.0009716090280562639, + "first_payload_s": 0.0009817529935389757, + "first_content_s": 0.19961553299799562, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19961553299799562, + "last_output_s": 7.943801983026788 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 30.36935862756389, + "round_gap_p50_ms": 78.50799901643768, + "round_gap_p95_ms": 92.03264297684655, + "round_gap_mean_ms": 78.22410555584638, + "tokens_per_chunk": 2.56, + "aggregate_prompt_ttft_tps": 160.30816599989402, + "aggregate_prefill_tps": 160.30816599989402 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396865.197526922, + "first": 396865.397142455, + "last": 396873.141328905, + "end": 396873.141455658, + "elapsed_s": 7.943928736029193, + "chunk_offsets_s": [ + 0.19961553299799562, + 0.27297244098735973, + 0.3439424459938891, + 0.41191373398760334, + 0.4756573640042916, + 0.5487978699966334, + 0.6177063829964027, + 0.6880724140210077, + 0.7650918700383045, + 0.8349325039889663, + 0.906527618994005, + 0.9729341400088742, + 1.0391816180199385, + 1.1123144770390354, + 1.181359775015153, + 1.2511342160287313, + 1.3335585410241038, + 1.4043974410160445, + 1.4760422040126286, + 1.544003684015479, + 1.6087800600216724, + 1.6759590040310286, + 1.7435663520009257, + 1.8201734680333175, + 1.8979671880370006, + 1.9599987220135517, + 2.0279586969991215, + 2.107259488024283, + 2.1878043700126, + 2.277976530021988, + 2.363247714994941, + 2.4600626280298457, + 2.5699640220263973, + 2.661952120019123, + 2.727426263038069, + 2.7970047350390814, + 2.8749241190380417, + 2.952759775042068, + 3.034819969034288, + 3.1352524530375376, + 3.240550841030199, + 3.3325834840070456, + 3.424441117036622, + 3.498404943034984, + 3.5660026270197704, + 3.6471540280035697, + 3.7300455890363082, + 3.8119900210294873, + 3.896961075020954, + 3.9759511899901554, + 4.058497628022451, + 4.139996376005001, + 4.22079583699815, + 4.300966412003618, + 4.380964584997855, + 4.465655940002762, + 4.550787603016943, + 4.632734899001662, + 4.711242898018099, + 4.788746791018639, + 4.8722294620238245, + 4.946732749987859, + 5.026520568993874, + 5.110789775033481, + 5.196645557996817, + 5.273515636043157, + 5.3527366340276785, + 5.431401898036711, + 5.510198764037341, + 5.592789106012788, + 5.668990297999699, + 5.7517152660293505, + 5.837453799031209, + 5.916910798987374, + 5.994250818039291, + 6.0727781929890625, + 6.152977712044958, + 6.2272929979953915, + 6.308728577045258, + 6.390311277995352, + 6.4745277800248004, + 6.550517178024165, + 6.626013579021674, + 6.701915456040297, + 6.784310613002162, + 6.862754259025678, + 6.945001014042646, + 7.026145598036237, + 7.108014845987782, + 7.185109951009508, + 7.260974019009154, + 7.338027635996696, + 7.416349569044542, + 7.497001364012249, + 7.57496420503594, + 7.6627920549944974, + 7.749115073995199, + 7.825006294995546, + 7.892647628032137, + 7.943801983026788 + ], + "chunk_gaps_ms": { + "count": 99, + "p50": 78.50799901643768, + "p95": 92.03264297684655, + "max": 109.90139399655163 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 32.198893210865855, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 8.119871226954274, + "end_to_end_tps": 31.527593584267272, + "timing_valid": true, + "per_stream_tps": [ + 32.2 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.20020649896468967, + "decode_tps": 32.198893210865855, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 159.83497121960974, + "prefill_tps": 159.83497121960974, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.05696812157939, + "round_gap_p50_ms": 61.88570795347914, + "round_gap_p95_ms": 82.41827704478055, + "tokens_per_chunk": 2.064516129032258, + "headers_s": 0.0011181070003658533, + "first_payload_s": 0.0011293389834463596, + "first_content_s": 0.20020649896468967, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.20020649896468967, + "last_output_s": 8.119733369967435 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.05696812157939, + "round_gap_p50_ms": 61.88570795347914, + "round_gap_p95_ms": 82.41827704478055, + "round_gap_mean_ms": 64.38639732522557, + "tokens_per_chunk": 2.064516129032258, + "aggregate_prompt_ttft_tps": 159.83497121960974, + "aggregate_prefill_tps": 159.83497121960974 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396873.142216866, + "first": 396873.342423365, + "last": 396881.261950236, + "end": 396881.262088093, + "elapsed_s": 8.119871226954274, + "chunk_offsets_s": [ + 0.20020649896468967, + 0.2826648079790175, + 0.3651306529645808, + 0.4442838099785149, + 0.5225739349843934, + 0.6055980569799431, + 0.6855937509681098, + 0.7666033419664018, + 0.8490217459620908, + 0.9291511369519867, + 1.007616079004947, + 1.0844884619582444, + 1.1584369439515285, + 1.2395294799935073, + 1.3166713529499248, + 1.398156292969361, + 1.4891838689800352, + 1.5705325359595008, + 1.6484973129699938, + 1.7274869319517165, + 1.809905208996497, + 1.8864758929703385, + 1.9633605479612015, + 2.0455046459683217, + 2.1305578599567525, + 2.2104892489733174, + 2.2858957609860227, + 2.346259023004677, + 2.4242633359972388, + 2.4754645089851692, + 2.527406503970269, + 2.581750649958849, + 2.646002333960496, + 2.7228118519997224, + 2.7766984739573672, + 2.8272666959674098, + 2.8814765849965625, + 2.9347575689898804, + 2.9864750179694965, + 3.0453380569815636, + 3.1044436429510824, + 3.155406043981202, + 3.2067282249918208, + 3.2613522469764575, + 3.314335051982198, + 3.3682526029879227, + 3.421914022997953, + 3.476770493958611, + 3.5364278449560516, + 3.5898247179575264, + 3.643299143994227, + 3.695269859977998, + 3.749255970993545, + 3.803436435991898, + 3.8552694699610583, + 3.9087304559652694, + 3.966425819962751, + 4.019866069953423, + 4.081630464992486, + 4.1354491979582235, + 4.191842564963736, + 4.254782427975442, + 4.316407460952178, + 4.381253374973312, + 4.450433969963342, + 4.511973307002336, + 4.573859014955815, + 4.634532567986753, + 4.697998227959033, + 4.7616013449733146, + 4.824887178954668, + 4.884927781007718, + 4.956407919002231, + 5.016969886957668, + 5.076959223952144, + 5.139085750968661, + 5.197105358005501, + 5.2586099579930305, + 5.32049905898748, + 5.3825070559978485, + 5.446999526000582, + 5.509334598958958, + 5.569795540999621, + 5.630264162959065, + 5.691014916985296, + 5.752128104970325, + 5.813043211994227, + 5.874950984958559, + 5.945065589970909, + 6.0041746469796635, + 6.069258369971067, + 6.131502545962576, + 6.193968691979535, + 6.2550081519875675, + 6.316627569962293, + 6.378867777995765, + 6.442983859975357, + 6.50630743795773, + 6.568155801971443, + 6.636303779960144, + 6.6990155119565316, + 6.759772040997632, + 6.820010149967857, + 6.883100429957267, + 6.948261081997771, + 7.009291309979744, + 7.072801817965228, + 7.141767659981269, + 7.215364889998455, + 7.276255981007125, + 7.336219494987745, + 7.3990149879828095, + 7.4643004249664955, + 7.523304105969146, + 7.582307625969406, + 7.635222029988654, + 7.689862435974646, + 7.750935735995881, + 7.812486577953678, + 7.879717937961686, + 7.948885892983526, + 8.012305552954786, + 8.070666970976163, + 8.119733369967435 + ], + "chunk_gaps_ms": { + "count": 123, + "p50": 61.88570795347914, + "p95": 82.41827704478055, + "max": 91.02757601067424 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 35.41184080980109, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.400140491023194, + "end_to_end_tps": 34.59393781922695, + "timing_valid": true, + "per_stream_tps": [ + 35.4 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.1988829500041902, + "decode_tps": 35.41184080980109, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.89865923311075, + "prefill_tps": 160.89865923311075, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.239141968672403, + "round_gap_p50_ms": 62.78261303668842, + "round_gap_p95_ms": 80.0954220467247, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012435480020940304, + "first_payload_s": 0.0012453399831429124, + "first_content_s": 0.1988829500041902, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1988829500041902, + "last_output_s": 7.3998641520156525 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.239141968672403, + "round_gap_p50_ms": 62.78261303668842, + "round_gap_p95_ms": 80.0954220467247, + "round_gap_mean_ms": 65.46346547283147, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 160.89865923311075, + "aggregate_prefill_tps": 160.89865923311075 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396881.262826021, + "first": 396881.461708971, + "last": 396888.662690173, + "end": 396888.662966512, + "elapsed_s": 7.400140491023194, + "chunk_offsets_s": [ + 0.1988829500041902, + 0.27181030198698863, + 0.34442829102044925, + 0.41448161500738934, + 0.484101495007053, + 0.5466903299675323, + 0.610026917012874, + 0.681138010986615, + 0.751203895022627, + 0.8236516750184819, + 0.8928352780058049, + 0.9519515039864928, + 1.0147734290221706, + 1.0766793140210211, + 1.1377038459759206, + 1.199209661979694, + 1.271013690973632, + 1.3334450050024316, + 1.3968493359861895, + 1.4576123779988848, + 1.5208268190035596, + 1.5801407580147497, + 1.640493636019528, + 1.7059615550097078, + 1.7754231769940816, + 1.8380995490006171, + 1.8998009680071846, + 1.9614248819998465, + 2.0245333060156554, + 2.085717360023409, + 2.145870058971923, + 2.2099079479812644, + 2.280576542019844, + 2.3449561949819326, + 2.403781298024114, + 2.4593868809752166, + 2.520617862988729, + 2.5818693569744937, + 2.6433013809728436, + 2.7061934510129504, + 2.77518566098297, + 2.838380677974783, + 2.900426707987208, + 2.9632093210238963, + 3.0236586629762314, + 3.086853311979212, + 3.1491190239903517, + 3.211501393991057, + 3.280083967023529, + 3.3413610300049186, + 3.401632482011337, + 3.463614191976376, + 3.5258505750098266, + 3.587912845017854, + 3.648943136970047, + 3.7137827950064093, + 3.78528238896979, + 3.8561168569722213, + 3.928648284985684, + 4.001460004015826, + 4.078464691992849, + 4.157438246998936, + 4.234110707999207, + 4.315061162982602, + 4.399970855971333, + 4.478730088972952, + 4.558825511019677, + 4.636127593985293, + 4.699790408019908, + 4.776951272971928, + 4.855914540006779, + 4.936311260971706, + 5.024572426977102, + 5.107852041022852, + 5.18144770298386, + 5.244838865997735, + 5.304961598012596, + 5.366736505005974, + 5.4294700140017085, + 5.495125055022072, + 5.5614536220091395, + 5.623441139992792, + 5.683861329976935, + 5.743607384967618, + 5.8089446789817885, + 5.869104259007145, + 5.929995350015815, + 5.99717037397204, + 6.063703758991323, + 6.124746226996649, + 6.185748278978281, + 6.245700529019814, + 6.307531468977686, + 6.368935411970597, + 6.430184282013215, + 6.494494477985427, + 6.562490405980498, + 6.623163494979963, + 6.683849287976045, + 6.74353209399851, + 6.803586265014019, + 6.862236518005375, + 6.915388701017946, + 6.972332488978282, + 7.039869755972177, + 7.1045421959715895, + 7.170381975010969, + 7.231292137992568, + 7.292457262985408, + 7.350805640977342, + 7.3998641520156525 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 62.802269036183134, + "p95": 80.0954220467247, + "max": 88.26116600539535 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.1, + "per_stream_tps": 22.9, + "ttft_s_max": 0.4, + "request": { + "ttft_s": 0.296, + "decode_tps": 22.839, + "prompt_ttft_tps": 120.808, + "prefill_tps": 120.808, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.784, + "round_gap_p50_ms": 106.981, + "round_gap_p95_ms": 123.901, + "tokens_per_chunk": 2.462, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.296, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.296, + "last_output_s": 11.508 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 162.313, + "aggregate_prefill_tps": 162.313, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.961, + "round_gap_p50_ms": 106.988, + "round_gap_p95_ms": 124.146, + "tokens_per_chunk": 2.462 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 44.4904495156703, + "makespan_s": 11.508087816007901, + "steady_tps": 46.0, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.101964684406944, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 11.508087816007901, + "end_to_end_tps": 44.4904495156703, + "timing_valid": true, + "steady_tps": 46.01445248752514, + "per_stream_tps": [ + 22.9, + 22.6 + ], + "ttft_s": [ + 0.4, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3950532500166446, + "decode_tps": 22.94698448143094, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.00173836983181, + "prefill_tps": 81.00173836983181, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.57871078046075, + "round_gap_p50_ms": 106.96800501318648, + "round_gap_p95_ms": 123.64596000406891, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0016618240042589605, + "first_payload_s": 0.0016636960208415985, + "first_content_s": 0.3950532500166446, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3950532500166446, + "last_output_s": 11.507624499034137 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.20001420902553946, + "decode_tps": 22.551289343181217, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 159.9886335870967, + "prefill_tps": 159.9886335870967, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.34336258039134, + "round_gap_p50_ms": 106.99429298983887, + "round_gap_p95_ms": 124.1555170272477, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0015395830268971622, + "first_payload_s": 0.0015434870147146285, + "first_content_s": 0.20001420902553946, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.20001420902553946, + "last_output_s": 11.507571667025331 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.96103668042605, + "round_gap_p50_ms": 106.98760504601523, + "round_gap_p95_ms": 124.14644396631047, + "round_gap_mean_ms": 108.83557624765672, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 161.9620261915864, + "aggregate_prefill_tps": 161.9620261915864 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396888.664177996, + "first": 396889.059231246, + "last": 396900.171802495, + "end": 396900.172164707, + "elapsed_s": 11.507986710988916, + "chunk_offsets_s": [ + 0.3950532500166446, + 0.4986060850205831, + 0.6061275349929929, + 0.7121992110041901, + 0.8200427599949762, + 0.9279142300365493, + 1.0336104779853486, + 1.1427137510036118, + 1.2493292890139855, + 1.3549372639972717, + 1.4617539549944922, + 1.5654111430048943, + 1.6714732350083068, + 1.781111698015593, + 1.879936887009535, + 1.9842215860262513, + 2.093640574021265, + 2.2006085790344514, + 2.3068361280020326, + 2.4147924309945665, + 2.5205288709839806, + 2.6185993810067885, + 2.7244301909813657, + 2.831780727021396, + 2.9438734379946254, + 3.054511349997483, + 3.166063687996939, + 3.2707713820273057, + 3.3779882050002925, + 3.4844083650386892, + 3.5939788590185344, + 3.707220029027667, + 3.8205736959935166, + 3.9278912720037624, + 4.034161782008596, + 4.137383254012093, + 4.242035860021133, + 4.350398870010395, + 4.461066287010908, + 4.57321464602137, + 4.68165530503029, + 4.794804778008256, + 4.911809089011513, + 5.019175002002157, + 5.127558220003266, + 5.242452686012257, + 5.350527309987228, + 5.4598918500123546, + 5.562940968025941, + 5.6734143670182675, + 5.781575407017954, + 5.892874846002087, + 6.005196935031563, + 6.108844971982762, + 6.217193582036998, + 6.329509078990668, + 6.439869069028646, + 6.546735952026211, + 6.67038191203028, + 6.79452835599659, + 6.922664279991295, + 7.054783106024843, + 7.177728754992131, + 7.296034933999181, + 7.435110628022812, + 7.571545449027326, + 7.671736299002077, + 7.77905821200693, + 7.881340106017888, + 7.984602379030548, + 8.092531785019673, + 8.201266350981314, + 8.307422443991527, + 8.409216861997265, + 8.509660915005952, + 8.61616109102033, + 8.720258300018031, + 8.823121608002111, + 8.93120914400788, + 9.037621751020197, + 9.136603502032813, + 9.249784831015859, + 9.35564844100736, + 9.460938750009518, + 9.567930979013909, + 9.67269163398305, + 9.776238421036396, + 9.874550612992607, + 9.981654827017337, + 10.086312761995941, + 10.190513634996023, + 10.293935748981312, + 10.402229175029788, + 10.506191630032845, + 10.610656539036427, + 10.714419647993054, + 10.816867465036921, + 10.917455982998945, + 11.02441914001247, + 11.130215677025262, + 11.240408768993802, + 11.346295355004258, + 11.43946672900347, + 11.507624499034137 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 106.96800501318648, + "p95": 123.64596000406891, + "max": 139.0756940236315 + } + }, + { + "start": 396888.664076891, + "first": 396888.8640911, + "last": 396900.171648558, + "end": 396900.171828079, + "elapsed_s": 11.507751188008115, + "chunk_offsets_s": [ + 0.20001420902553946, + 0.49864322104258463, + 0.6061614070204087, + 0.7122504590079188, + 0.8200849850545637, + 0.9279556860565208, + 1.0336555020185187, + 1.1426225820323452, + 1.249510266003199, + 1.3549830080009997, + 1.4616730580455624, + 1.5652071730000898, + 1.6716455570422113, + 1.7811537940287963, + 1.88009884103667, + 1.9841347370529547, + 2.093477629008703, + 2.200764996057842, + 2.307011234050151, + 2.4150244490010664, + 2.520686537027359, + 2.6187770630349405, + 2.7246228320291266, + 2.8319437210448086, + 2.9438613100210205, + 3.0546761040459387, + 3.166326586040668, + 3.270934936008416, + 3.3779225410544313, + 3.484568878018763, + 3.5941542200162075, + 3.707155132025946, + 3.8207858740352094, + 3.9280924900085665, + 4.033906787051819, + 4.137572312029079, + 4.24194592301501, + 4.350577592034824, + 4.460905773041304, + 4.572891619056463, + 4.68154802400386, + 4.794966588029638, + 4.911974227055907, + 5.019518957007676, + 5.127733374014497, + 5.242626528022811, + 5.350269851041958, + 5.45994029805297, + 5.563098234008066, + 5.673276318004355, + 5.781736913020723, + 5.8928201260278, + 6.005147351010237, + 6.109118494030554, + 6.217787828005385, + 6.329292421054561, + 6.440153775038198, + 6.546900306013413, + 6.670543513027951, + 6.794699030055199, + 6.9228243450052105, + 7.054683105030563, + 7.177625714044552, + 7.296083719003946, + 7.435280886013061, + 7.571708043047693, + 7.671909933036659, + 7.779225685051642, + 7.8814976760186255, + 7.984773741045501, + 8.092746971000452, + 8.201441313023679, + 8.307584765017964, + 8.409235886007082, + 8.509613107016776, + 8.616324981034268, + 8.720416973053943, + 8.823280762007926, + 8.931068631005473, + 9.037783369014505, + 9.136783776048105, + 9.249832976027392, + 9.355826411047019, + 9.461098463041708, + 9.568092756031547, + 9.67270371405175, + 9.77625670901034, + 9.874747319030575, + 9.981829853029922, + 10.086216857016552, + 10.190510451036971, + 10.293754883052316, + 10.40216167003382, + 10.506370720046107, + 10.610837548039854, + 10.71458737802459, + 10.816737943037879, + 10.917657569050789, + 11.024297443043906, + 11.130392447055783, + 11.240577955031767, + 11.346482269000262, + 11.439340840035584, + 11.507571667025331 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 106.99429298983887, + "p95": 124.1555170272477, + "max": 298.62901201704517 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 44.729082225415944, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 11.601355509017594, + "end_to_end_tps": 44.132773933358784, + "timing_valid": true, + "steady_tps": 45.34614996540702, + "per_stream_tps": [ + 22.4, + 22.8 + ], + "ttft_s": [ + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19845796999288723, + "decode_tps": 22.364744170983204, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.2432093361979, + "prefill_tps": 161.2432093361979, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.71323223528909, + "round_gap_p50_ms": 107.30544995749369, + "round_gap_p95_ms": 133.20533296791837, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0012283159885555506, + "first_payload_s": 0.0012420120183378458, + "first_content_s": 0.19845796999288723, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19845796999288723, + "last_output_s": 11.600332189991605 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.39429949899204075, + "decode_tps": 22.755139734047642, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.15658295737765, + "prefill_tps": 81.15658295737765, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.94611554521629, + "round_gap_p50_ms": 107.02113097067922, + "round_gap_p95_ms": 132.71632097894326, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.001567264029290527, + "first_payload_s": 0.0015697440248914063, + "first_content_s": 0.39429949899204075, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39429949899204075, + "last_output_s": 11.600558963022195 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.329673890252685, + "round_gap_p50_ms": 107.04050800995901, + "round_gap_p95_ms": 133.20533296791837, + "round_gap_mean_ms": 109.74822176713045, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 162.3131659147553, + "aggregate_prefill_tps": 162.3131659147553 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396900.17328507, + "first": 396900.37174304, + "last": 396911.77361726, + "end": 396911.774107048, + "elapsed_s": 11.600821978005115, + "chunk_offsets_s": [ + 0.19845796999288723, + 0.5007457379833795, + 0.6065385789843276, + 0.7141473260126077, + 0.8218847310054116, + 0.9557310140226036, + 1.0863004489801824, + 1.2214870810275897, + 1.355331365019083, + 1.4885366979870014, + 1.6216259659850039, + 1.752482076000888, + 1.8824351690127514, + 2.0172743420116603, + 2.141639653011225, + 2.268316857982427, + 2.3877381359925494, + 2.4967293930239975, + 2.6044723489903845, + 2.712236072984524, + 2.8199306770111434, + 2.9192347190110013, + 3.024606388004031, + 3.1276854909956455, + 3.239536984008737, + 3.350249584997073, + 3.4630074379965663, + 3.566509473021142, + 3.6734532060218044, + 3.7782821169821545, + 3.8864792970125563, + 3.996412349981256, + 4.106350619986188, + 4.2116114210220985, + 4.316906911029946, + 4.420977781002875, + 4.524816630000714, + 4.632971849991009, + 4.742163222981617, + 4.85431307903491, + 4.960431162035093, + 5.07151875103591, + 5.18597241898533, + 5.293711899023037, + 5.402778561983723, + 5.517303591012023, + 5.626416159037035, + 5.734862024022732, + 5.837917539989576, + 5.947930574009661, + 6.055258490028791, + 6.164654197986238, + 6.2765957090305164, + 6.38073777599493, + 6.488258593017235, + 6.60117934201844, + 6.709917002997827, + 6.815903160022572, + 6.923208609980065, + 7.027616904000752, + 7.133101752027869, + 7.237945192027837, + 7.3398288050084375, + 7.44604176498251, + 7.55339150299551, + 7.661597580998205, + 7.762482578982599, + 7.867853662988637, + 7.971745831018779, + 8.074276191997342, + 8.181267487001605, + 8.289539035991766, + 8.395742762018926, + 8.50035373098217, + 8.600640872027725, + 8.704498063016217, + 8.808687885990366, + 8.912465889996383, + 9.016533676011022, + 9.122070168028586, + 9.221238401019946, + 9.332192040979862, + 9.436535386019386, + 9.541676171997096, + 9.652135465003084, + 9.755690823018085, + 9.857842708996031, + 9.958712803025264, + 10.065753311035223, + 10.17026177601656, + 10.274992663005833, + 10.379008333024103, + 10.489512856991496, + 10.594128029013518, + 10.699673894036096, + 10.805297618033364, + 10.90526808903087, + 11.004817830980755, + 11.1125938250334, + 11.220108501031063, + 11.33090435701888, + 11.435486581991427, + 11.533308316022158, + 11.600332189991605 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 107.30544995749369, + "p95": 133.20533296791837, + "max": 302.2877679904923 + } + }, + { + "start": 396900.17316182, + "first": 396900.567461319, + "last": 396911.773720783, + "end": 396911.774517329, + "elapsed_s": 11.601355509017594, + "chunk_offsets_s": [ + 0.39429949899204075, + 0.5005582490121014, + 0.6068255749996752, + 0.7140067979926243, + 0.8215070799924433, + 0.9552995710400864, + 1.0863427700242028, + 1.2214322980144061, + 1.354946194041986, + 1.488835245021619, + 1.6215515660005622, + 1.7523902840330265, + 1.8823138250154443, + 2.0175627610296942, + 2.1412737460341305, + 2.268242234014906, + 2.388145101023838, + 2.4967233930365182, + 2.6044265250093304, + 2.7120433039963245, + 2.8194682100438513, + 2.919061917986255, + 3.0241573770181276, + 3.127530674042646, + 3.2395401200046763, + 3.350255874043796, + 3.4623972570407204, + 3.566120925999712, + 3.6729640180128627, + 3.7782931739930063, + 3.8865260170423426, + 3.9964186850120313, + 4.106279161002021, + 4.211484136991203, + 4.3165120530175045, + 4.420523434004281, + 4.52479224500712, + 4.632809925999027, + 4.742058467003517, + 4.854253621015232, + 4.960289685986936, + 5.071377483021934, + 5.185526280023623, + 5.293512054020539, + 5.403138472989667, + 5.5173083420377225, + 5.625954436021857, + 5.73468395503005, + 5.8377522230148315, + 5.947769929014612, + 6.055018756014761, + 6.1646910780109465, + 6.276598796015605, + 6.380285252991598, + 6.488120525027625, + 6.600982472999021, + 6.709501360019203, + 6.815939960011747, + 6.923149120004382, + 7.027147533022799, + 7.132989188015927, + 7.237505245022476, + 7.339382762031164, + 7.445504680043086, + 7.553438111033756, + 7.661609405011404, + 7.7622498359996825, + 7.867598359996919, + 7.971574162016623, + 8.074289151001722, + 8.181058810034301, + 8.289361592032947, + 8.395529075991362, + 8.499967337003909, + 8.600074250018224, + 8.704390636004973, + 8.808575291011948, + 8.911985270038713, + 9.015962126024533, + 9.121933076006826, + 9.221051595988683, + 9.332133430987597, + 9.436582698021084, + 9.54153220000444, + 9.652148729015607, + 9.755664438009262, + 9.857855668000411, + 9.958536542020738, + 10.065557672991417, + 10.170271776034497, + 10.274826770008076, + 10.379022045002785, + 10.48951132001821, + 10.594096443033777, + 10.699642213003244, + 10.805305665009655, + 10.905179927009158, + 11.004813958017621, + 11.112532319035381, + 11.220110997033771, + 11.330156019015703, + 11.435489172989037, + 11.53357342502568, + 11.600558963022195 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 107.02113097067922, + "p95": 132.71632097894326, + "max": 135.24893601424992 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.84763334993014, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 11.331865622021724, + "end_to_end_tps": 45.18232187690325, + "timing_valid": true, + "steady_tps": 46.55818504357538, + "per_stream_tps": [ + 23.3, + 22.9 + ], + "ttft_s": [ + 0.39, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3920242600142956, + "decode_tps": 23.333604005662423, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.62760130924828, + "prefill_tps": 81.62760130924828, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.85664570965238, + "round_gap_p50_ms": 106.54851398430765, + "round_gap_p95_ms": 111.61695298505947, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.001262092962861061, + "first_payload_s": 0.0012659329804591835, + "first_content_s": 0.3920242600142956, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3920242600142956, + "last_output_s": 11.320468915975653 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.1970147310057655, + "decode_tps": 22.92381667496507, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.42440266592828, + "prefill_tps": 162.42440266592828, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.62275332153099, + "round_gap_p50_ms": 106.62840603617951, + "round_gap_p95_ms": 112.02606599545106, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0011773870210163295, + "first_payload_s": 0.0011792750447057188, + "first_content_s": 0.1970147310057655, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1970147310057655, + "last_output_s": 11.320816827996168 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.23969951559169, + "round_gap_p50_ms": 106.59989702980965, + "round_gap_p95_ms": 111.87708401121199, + "round_gap_mean_ms": 107.0497415191833, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 163.2138479401967, + "aggregate_prefill_tps": 163.2138479401967 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396911.775690236, + "first": 396912.167714496, + "last": 396923.096159152, + "end": 396923.106971637, + "elapsed_s": 11.331281400984153, + "chunk_offsets_s": [ + 0.3920242600142956, + 0.4958011530106887, + 0.6027000519679859, + 0.7071045429911464, + 0.8167639700113796, + 0.9242384029785171, + 1.0309984189807437, + 1.1395350039820187, + 1.2458058099728078, + 1.3511506550130434, + 1.4572995029739104, + 1.561871098994743, + 1.6656185319880024, + 1.77580569696147, + 1.8754934850148857, + 1.9766347300028428, + 2.0850669749779627, + 2.192428843001835, + 2.300786811974831, + 2.409332640003413, + 2.5143859569798224, + 2.6135219699935988, + 2.718281967972871, + 2.8218918119673617, + 2.9318529359879903, + 3.0428797979839146, + 3.1515533410129137, + 3.254726725979708, + 3.363689890014939, + 3.4690086499904282, + 3.576912301010452, + 3.6885292539955117, + 3.797801767999772, + 3.903848737012595, + 4.009972843981814, + 4.116830919985659, + 4.221831864968408, + 4.332547914003953, + 4.44255511497613, + 4.555349980015308, + 4.663489250000566, + 4.775350750016514, + 4.89175836899085, + 5.000492692983244, + 5.107041206967551, + 5.221877173986286, + 5.332299806002993, + 5.44057024497306, + 5.5435639880015515, + 5.652797968999948, + 5.762505960010458, + 5.870789423002861, + 5.982054635009263, + 6.087863128981553, + 6.194212228001561, + 6.305470141989645, + 6.413525660987943, + 6.51986899797339, + 6.627752305998001, + 6.729245658963919, + 6.834333558974322, + 6.937472663004883, + 7.037793589988723, + 7.147522235987708, + 7.2570075310068205, + 7.365596965013538, + 7.465572618006263, + 7.5706010579597205, + 7.673998420999851, + 7.777688494999893, + 7.885529142979067, + 7.992664286983199, + 8.099411486007739, + 8.200825700012501, + 8.302302985975984, + 8.408902883005794, + 8.511811880976893, + 8.616453494003508, + 8.722063224995509, + 8.829284656967502, + 8.928355598996859, + 9.039764726010617, + 9.149038283969276, + 9.25523410801543, + 9.364219929964747, + 9.468556525011081, + 9.571127800969407, + 9.670359576994088, + 9.776431859994773, + 9.882638225972187, + 9.986574972979724, + 10.090300994983409, + 10.202900993986987, + 10.310627136961557, + 10.415718259988353, + 10.520517711993307, + 10.622549660969526, + 10.723296012962237, + 10.832839939976111, + 10.940574083011597, + 11.051446840981953, + 11.1579130020109, + 11.250568513991311, + 11.320468915975653 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 106.54851398430765, + "p95": 111.61695298505947, + "max": 116.40761897433549 + } + }, + { + "start": 396911.775590906, + "first": 396911.972605637, + "last": 396923.096407734, + "end": 396923.107456528, + "elapsed_s": 11.331865622021724, + "chunk_offsets_s": [ + 0.1970147310057655, + 0.496084951038938, + 0.6026875399984419, + 0.7074300860404037, + 0.8165930220275186, + 0.9241267360048369, + 1.0308975530206226, + 1.139921365014743, + 1.2461127600399777, + 1.3513521630084142, + 1.457160220015794, + 1.5615240030456334, + 1.6654817450325936, + 1.7753520540427417, + 1.8755093570216559, + 1.9766130979987793, + 2.0849122990039177, + 2.192036401014775, + 2.30076585104689, + 2.409157596004661, + 2.5141369590419345, + 2.613545538042672, + 2.7179608400329016, + 2.8214408570202067, + 2.9318373360438272, + 3.042853893013671, + 3.151372760999948, + 3.254499937000219, + 3.3633643140201457, + 3.468986089050304, + 3.5763705930439755, + 3.6883966590394266, + 3.79756462702062, + 3.9036271320073865, + 4.009981100040022, + 4.117174799030181, + 4.222167360014282, + 4.332175121002365, + 4.442921043024398, + 4.555219161033165, + 4.663246604031883, + 4.775123688043095, + 4.891351991042029, + 4.999957000021823, + 5.10706501500681, + 5.2215207980480045, + 5.3319165970315225, + 5.440491411020048, + 5.543158009997569, + 5.653121240029577, + 5.762151647999417, + 5.871134646993596, + 5.9819552400149405, + 6.088236146024428, + 6.194018431997392, + 6.305354843032546, + 6.413382377999369, + 6.519382955040783, + 6.6270108640310355, + 6.729090248001739, + 6.833932062028907, + 6.937354308029171, + 7.0381315010017715, + 7.147368152043782, + 7.256943594024051, + 7.365149257995654, + 7.465416549996007, + 7.570322827028576, + 7.673985155997798, + 7.777407704037614, + 7.885123629006557, + 7.992320887045935, + 8.099173849041108, + 8.201107946049888, + 8.302631153026596, + 8.408915235020686, + 8.512080879008863, + 8.616265265038237, + 8.721499403996859, + 8.82911580504151, + 8.92818636301672, + 9.039689524041023, + 9.148822007002309, + 9.255085689015687, + 9.363584475009702, + 9.468179509043694, + 9.570952245034277, + 9.66996814403683, + 9.776194222038612, + 9.882201688014902, + 9.986323623044882, + 10.089936554024462, + 10.202606411010493, + 10.310156518011354, + 10.415535375010222, + 10.520294650050346, + 10.622103378002066, + 10.723148568999022, + 10.83274765004171, + 10.940115016011987, + 11.051305397006217, + 11.157933803042397, + 11.250400285993237, + 11.320816827996168 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 106.62840603617951, + "p95": 112.02606599545106, + "max": 299.0702200331725 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 55.9, + "per_stream_tps": 14.4, + "ttft_s_max": 0.79, + "request": { + "ttft_s": 0.491, + "decode_tps": 14.411, + "prompt_ttft_tps": 67.76, + "prefill_tps": 67.76, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.392, + "round_gap_p50_ms": 168.117, + "round_gap_p95_ms": 210.397, + "tokens_per_chunk": 2.462, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.491, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.491, + "last_output_s": 18.263 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 162.873, + "aggregate_prefill_tps": 162.873, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.844, + "round_gap_p50_ms": 168.051, + "round_gap_p95_ms": 210.479, + "tokens_per_chunk": 2.462 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 55.46790356552374, + "makespan_s": 18.461126781010535, + "steady_tps": 57.8, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 55.52131335397989, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 18.571697295992635, + "end_to_end_tps": 55.13766370836535, + "timing_valid": true, + "steady_tps": 57.432924006194874, + "per_stream_tps": [ + 14.3, + 14.4, + 14.2, + 14.0 + ], + "ttft_s": [ + 0.59, + 0.79, + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.5909734230372123, + "decode_tps": 14.289733997503438, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.147951079663066, + "prefill_tps": 54.147951079663066, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.98030895289655, + "round_gap_p50_ms": 169.68190600164235, + "round_gap_p95_ms": 210.4592149844393, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.002230594982393086, + "first_payload_s": 0.002233362989500165, + "first_content_s": 0.5909734230372123, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5909734230372123, + "last_output_s": 18.43595220602583 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7859326619654894, + "decode_tps": 14.44769631728741, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.715956402642966, + "prefill_tps": 40.715956402642966, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.21518683940282, + "round_gap_p50_ms": 169.40722096478567, + "round_gap_p95_ms": 208.90830003190786, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.002242786984425038, + "first_payload_s": 0.00224501098273322, + "first_content_s": 0.7859326619654894, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7859326619654894, + "last_output_s": 18.435805306013208 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19889583997428417, + "decode_tps": 14.16519668280073, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.88823177064626, + "prefill_tps": 160.88823177064626, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 70.59556054129429, + "round_gap_p50_ms": 169.81931700138375, + "round_gap_p95_ms": 210.3349560056813, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.0009097320144064724, + "first_payload_s": 0.0009137479937635362, + "first_content_s": 0.19889583997428417, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19889583997428417, + "last_output_s": 18.20076377800433 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.39450053399195895, + "decode_tps": 14.029139862040097, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.11522607128398, + "prefill_tps": 81.11522607128398, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 71.28020747057984, + "round_gap_p50_ms": 169.64404500322416, + "round_gap_p95_ms": 210.48100799089298, + "tokens_per_chunk": 2.4150943396226414, + "headers_s": 0.0018641059868969023, + "first_payload_s": 0.0018666019896045327, + "first_content_s": 0.39450053399195895, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39450053399195895, + "last_output_s": 18.570953438989818 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 70.26781595104337, + "round_gap_p50_ms": 169.65322702890262, + "round_gap_p95_ms": 210.47924703452736, + "round_gap_mean_ms": 173.9640103642336, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 162.80067694328648, + "aggregate_prefill_tps": 162.80067694328648 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396923.109164887, + "first": 396923.70013831, + "last": 396941.545117093, + "end": 396941.545298249, + "elapsed_s": 18.436133362003602, + "chunk_offsets_s": [ + 0.5909734230372123, + 0.9230111000360921, + 1.0620338990120217, + 1.2160183010273613, + 1.3689470950048417, + 1.5279113380238414, + 1.6783302190015092, + 1.843913619988598, + 2.0041933620232157, + 2.1622912460006773, + 2.3323569360072725, + 2.498259845015127, + 2.6679417510167696, + 2.846441183995921, + 3.0124392610159703, + 3.1822073410148732, + 3.3534069409943186, + 3.5190639049978927, + 3.6943304290180095, + 3.865424139017705, + 4.037069202982821, + 4.197940933983773, + 4.36940271302592, + 4.535831418004818, + 4.707334525999613, + 4.880457317980472, + 5.05507103598211, + 5.2230527169886045, + 5.39179977402091, + 5.593907425005455, + 5.804366639989894, + 6.020352057996206, + 6.211281964031514, + 6.4373165820143186, + 6.605857966991607, + 6.774129569996148, + 6.944074778002687, + 7.116091565985698, + 7.285989217984024, + 7.458775560022332, + 7.62627618201077, + 7.801251675991807, + 7.975504864996765, + 8.145074410014786, + 8.314072406035848, + 8.487325938011054, + 8.660420842003077, + 8.83095036103623, + 8.995997994032223, + 9.16293782799039, + 9.336289789993316, + 9.50814051902853, + 9.683416892017704, + 9.855129506031517, + 10.035301363037433, + 10.210010840033647, + 10.379152560024522, + 10.54736781102838, + 10.719190295028966, + 10.884423142997548, + 11.055698844022118, + 11.225507294991985, + 11.39089433499612, + 11.555565391026903, + 11.73725738900248, + 11.939823214022908, + 12.143261967983562, + 12.350553511991166, + 12.563133126008324, + 12.772389049991034, + 12.978300834016409, + 13.190003031981178, + 13.360638245998416, + 13.523191455984488, + 13.680145771009848, + 13.847135576012079, + 14.0182421579957, + 14.188003302027937, + 14.35575270402478, + 14.524691508035176, + 14.690287870005704, + 14.861056844005361, + 15.026171848003287, + 15.193226734991185, + 15.360305590031203, + 15.5297759710229, + 15.695158549002372, + 15.855060203990433, + 16.024190174008254, + 16.193147755984683, + 16.361272278998513, + 16.529181341989897, + 16.70587493601488, + 16.87203429598594, + 17.044343500980176, + 17.21254963800311, + 17.37422716600122, + 17.53806352603715, + 17.708798712003045, + 17.884644524019677, + 18.052569450985175, + 18.201328688010108, + 18.333022951032035, + 18.43595220602583 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 169.68190600164235, + "p95": 210.4592149844393, + "max": 332.03767699887976 + } + }, + { + "start": 396923.109368044, + "first": 396923.895300706, + "last": 396941.54517335, + "end": 396941.54569877, + "elapsed_s": 18.436330725962762, + "chunk_offsets_s": [ + 0.7859326619654894, + 0.9229253539815545, + 1.0625713029876351, + 1.2149485319969244, + 1.3690838500042446, + 1.527764822007157, + 1.6782027920125984, + 1.8435112739680335, + 2.0041899060015567, + 2.161800994013902, + 2.331972030980978, + 2.4978573549888097, + 2.6680344250053167, + 2.846054007008206, + 3.013122955977451, + 3.181820739991963, + 3.353507758991327, + 3.518682727997657, + 3.693969092972111, + 3.86533740098821, + 4.037077362998389, + 4.197871795971878, + 4.368893308972474, + 4.535313902015332, + 4.707289867976215, + 4.88004836399341, + 5.054930216982029, + 5.2230334840132855, + 5.3915352880139835, + 5.593863823974971, + 5.804343071009498, + 6.0199718729709275, + 6.211241803015582, + 6.436811466002837, + 6.605847998987883, + 6.773733848996926, + 6.943724929995369, + 7.11609673401108, + 7.286421243974473, + 7.458746069984045, + 7.625873468001373, + 7.801304076972883, + 7.974992436997127, + 8.144685249018949, + 8.314092469983734, + 8.487468643987086, + 8.660363079980016, + 8.830558446992654, + 8.995626032992732, + 9.16256143496139, + 9.335911716974806, + 9.507751710014418, + 9.683155014005024, + 9.855104145011865, + 10.035175391007215, + 10.209987590962555, + 10.379116413998418, + 10.547336834017187, + 10.71914762101369, + 10.884035117982421, + 11.05527486599749, + 11.22512562200427, + 11.390874414006248, + 11.555669280991424, + 11.737248491961509, + 11.93969929101877, + 12.14277920499444, + 12.35014889400918, + 12.563090852985624, + 12.771999153017532, + 12.977962057979312, + 13.189626014966052, + 13.360620756982826, + 13.522797094017733, + 13.679866516962647, + 13.84709378296975, + 14.017831748991739, + 14.187623261008412, + 14.354929260967765, + 14.524317546980456, + 14.690747688000556, + 14.860675458970945, + 15.026153302984312, + 15.192959736974444, + 15.360786560981069, + 15.5298045949894, + 15.695148580009118, + 15.855037578963675, + 16.023932504002005, + 16.193135098961648, + 16.360840397013817, + 16.529112843971234, + 16.705825126962736, + 16.87188949197298, + 17.044219977979083, + 17.212214077997487, + 17.37420022097649, + 17.538157895964105, + 17.709712092007976, + 17.884561176993884, + 18.05216612998629, + 18.201323854969814, + 18.33263042999897, + 18.435805306013208 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 169.40722096478567, + "p95": 208.90830003190786, + "max": 225.56966298725456 + } + }, + { + "start": 396923.109797446, + "first": 396923.308693286, + "last": 396941.310561224, + "end": 396941.31072742, + "elapsed_s": 18.20092997397296, + "chunk_offsets_s": [ + 0.19889583997428417, + 0.9225642089731991, + 1.0615119819995016, + 1.21487933001481, + 1.3682328540016897, + 1.5269005299778655, + 1.6778429429978132, + 1.8435376909910701, + 2.003844809019938, + 2.1619148689787835, + 2.3318787169991992, + 2.4977315120049752, + 2.6677185450098477, + 2.8453655270277523, + 3.0121270450181328, + 3.181165380985476, + 3.3529064169852063, + 3.517826579976827, + 3.6937510389834642, + 3.8645681670168415, + 4.0368295650114305, + 4.1977218089741655, + 4.367879942001309, + 4.5354541449924, + 4.707034774008207, + 4.879876039980445, + 5.054643169976771, + 5.222115158976521, + 5.39122299302835, + 5.593179375980981, + 5.803514331986662, + 6.01978076400701, + 6.210531929973513, + 6.435859235993121, + 6.604909960995428, + 6.773547573015094, + 6.9433668900164776, + 7.1151616090210155, + 7.285544792015571, + 7.458358125004452, + 7.625513891980518, + 7.800817090028431, + 7.974716653989162, + 8.143945151998196, + 8.313717149023432, + 8.486861238023266, + 8.660034465021454, + 8.830045267008245, + 8.994915793009568, + 9.162363654002547, + 9.335275446996093, + 9.507125934993383, + 9.682833502010908, + 9.854821641987655, + 10.034590129973367, + 10.209467482985929, + 10.378605666977819, + 10.546958937018644, + 10.71876241202699, + 10.883405663014855, + 11.054646258999128, + 11.224922832974698, + 11.390489445009734, + 11.55432361800922, + 11.7367350399727, + 11.938940137973987, + 12.142730546998791, + 12.349773765017744, + 12.562716060027014, + 12.771283393027261, + 12.97777637297986, + 13.189424009993672, + 13.360261069028638, + 13.52261827402981, + 13.6792266460252, + 13.846149697026704, + 14.017193526029587, + 14.187423479976133, + 14.354677111026831, + 14.523609675001353, + 14.689840914972592, + 14.860474958026316, + 15.025431910995394, + 15.192165862012189, + 15.359875996015035, + 15.52931781602092, + 15.694778634991962, + 15.854660017997958, + 16.02319159102626, + 16.192185829975642, + 16.360530054022092, + 16.52880077197915, + 16.705179271986708, + 16.871084128972143, + 17.04395115497755, + 17.211616321001202, + 17.373507693002466, + 17.537192338029854, + 17.70889280899428, + 17.88361557200551, + 18.0518444100162, + 18.20076377800433 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 169.81931700138375, + "p95": 210.3349560056813, + "max": 723.668368998915 + } + }, + { + "start": 396923.109063189, + "first": 396923.503563723, + "last": 396941.680016628, + "end": 396941.680760485, + "elapsed_s": 18.571697295992635, + "chunk_offsets_s": [ + 0.39450053399195895, + 0.9229226179886609, + 1.0616557619650848, + 1.2149267880013213, + 1.3692942059715278, + 1.5282570570125245, + 1.6782103439909406, + 1.8444028309895657, + 2.004029053961858, + 2.1618066579685546, + 2.3321586920064874, + 2.4977984739816748, + 2.6675166210043244, + 2.8459904699702747, + 3.0121112529886886, + 3.181755297991913, + 3.353104245965369, + 3.518671735015232, + 3.6937961609801278, + 3.8651566929765977, + 4.036504293966573, + 4.1974254659726284, + 4.368693160999101, + 4.535165530978702, + 4.707070470962208, + 4.879968410008587, + 5.054714787984267, + 5.222698355966713, + 5.3913648999878205, + 5.593663738982286, + 5.804144746973179, + 6.020137860963587, + 6.210934164002538, + 6.436660678999033, + 6.6055373679846525, + 6.773812090978026, + 6.94424306997098, + 7.115744773996994, + 7.285883391974494, + 7.458596787007991, + 7.626029120001476, + 7.8006711669731885, + 7.974899266962893, + 8.144552493991796, + 8.313504760968499, + 8.487213439017069, + 8.660166356014088, + 8.83067806600593, + 8.995514014968649, + 9.162468008988071, + 9.33547983597964, + 9.507459078973625, + 9.683040739968419, + 9.854793993989006, + 10.035563351993915, + 10.209663871966768, + 10.378833015973214, + 10.547022298967931, + 10.718911423988175, + 10.883511761960108, + 11.055243056965992, + 11.225018916011322, + 11.390544374997262, + 11.554597768990789, + 11.737072711985093, + 11.939754411985632, + 12.142554431979079, + 12.35020807996625, + 12.563080421008635, + 12.771877406979911, + 12.977752004982904, + 13.18951090896735, + 13.360584276961163, + 13.522566752973944, + 13.67984106001677, + 13.846786640002392, + 14.01786171796266, + 14.187519369996153, + 14.35478192998562, + 14.524421309994068, + 14.690173131006304, + 14.860716324008536, + 15.025925761961844, + 15.192978441016749, + 15.360187443962786, + 15.529458299977705, + 15.694682169996668, + 15.854731299972627, + 16.0238018129603, + 16.192771250964142, + 16.36069794598734, + 16.528644673002418, + 16.70549031900009, + 16.87169249600265, + 17.044738758006133, + 17.211801572993863, + 17.37404325796524, + 17.5375140249962, + 17.70865425997181, + 17.884454710991122, + 18.052073344006203, + 18.20105551299639, + 18.33245729096234, + 18.43590892496286, + 18.507883008976933, + 18.570953438989818 + ], + "chunk_gaps_ms": { + "count": 105, + "p50": 169.64404500322416, + "p95": 210.48100799089298, + "max": 528.422083996702 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.35210496442968, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 17.984760778024793, + "end_to_end_tps": 56.93709316674395, + "timing_valid": true, + "steady_tps": 59.43278261879568, + "per_stream_tps": [ + 14.4, + 14.9, + 14.8, + 14.7 + ], + "ttft_s": [ + 0.2, + 0.79, + 0.39, + 0.59 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19947451096959412, + "decode_tps": 14.44636039663573, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 160.42149868901174, + "prefill_tps": 160.42149868901174, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.22158748253851, + "round_gap_p50_ms": 167.77696699136868, + "round_gap_p95_ms": 176.1902750004083, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0015118580195121467, + "first_payload_s": 0.0015135540161281824, + "first_content_s": 0.19947451096959412, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19947451096959412, + "last_output_s": 17.850979319016915 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7852828719769605, + "decode_tps": 14.941265141397524, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.74964721876533, + "prefill_tps": 40.74964721876533, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.92873665894035, + "round_gap_p50_ms": 167.6764529547654, + "round_gap_p95_ms": 175.20922800758854, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0021587680093944073, + "first_payload_s": 0.002161520009394735, + "first_content_s": 0.7852828719769605, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7852828719769605, + "last_output_s": 17.85211072000675 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.39363624597899616, + "decode_tps": 14.807429931172308, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.29332683887924, + "prefill_tps": 81.29332683887924, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.53366415699323, + "round_gap_p50_ms": 167.83246997511014, + "round_gap_p95_ms": 176.40738299814984, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.0017815600149333477, + "first_payload_s": 0.0017839440261013806, + "first_content_s": 0.39363624597899616, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39363624597899616, + "last_output_s": 17.61472060601227 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5908214530209079, + "decode_tps": 14.660347486986101, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.16187891685711, + "prefill_tps": 54.16187891685711, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 68.21120719598862, + "round_gap_p50_ms": 167.6538939937018, + "round_gap_p95_ms": 176.36058200150728, + "tokens_per_chunk": 2.4150943396226414, + "headers_s": 0.0026337860035710037, + "first_payload_s": 0.0026373540167696774, + "first_content_s": 0.5908214530209079, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5908214530209079, + "last_output_s": 17.984679287998006 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.97379887361518, + "round_gap_p50_ms": 167.71581600187346, + "round_gap_p95_ms": 176.40738299814984, + "round_gap_mean_ms": 168.28464769681426, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 162.8729673731682, + "aggregate_prefill_tps": 162.8729673731682 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396941.683640789, + "first": 396941.8831153, + "last": 396959.534620108, + "end": 396959.534926915, + "elapsed_s": 17.851286126009654, + "chunk_offsets_s": [ + 0.19947451096959412, + 0.9209034920204431, + 1.0597018480184488, + 1.2133809339720756, + 1.3672085190191865, + 1.524060360970907, + 1.679224117018748, + 1.843878372979816, + 2.0033442249987274, + 2.1607987040188164, + 2.3300327099859715, + 2.4950234169955365, + 2.664430206990801, + 2.8436268779914826, + 3.010824994009454, + 3.1774347299942747, + 3.3478542449884117, + 3.5128913819789886, + 3.69016090297373, + 3.8590441410196945, + 4.0271027209819295, + 4.188242347969208, + 4.356522707967088, + 4.522901759017259, + 4.695518580963835, + 4.868568820005748, + 5.039416721963789, + 5.2084045829833485, + 5.376120398985222, + 5.543897365976591, + 5.715351534017827, + 5.890068941982463, + 6.060266426007729, + 6.232483075000346, + 6.4008506939862855, + 6.569673343969043, + 6.741007393982727, + 6.9110292539699, + 7.080486878985539, + 7.252910600975156, + 7.420389186998364, + 7.592697974992916, + 7.769913734984584, + 7.937251036986709, + 8.102905933978036, + 8.275714876013808, + 8.446947845979594, + 8.615810905990656, + 8.777966680994723, + 8.94363810296636, + 9.11368141300045, + 9.283134614001028, + 9.456085024983622, + 9.626929293968715, + 9.80731831601588, + 9.983508591016289, + 10.149964393989649, + 10.316199279972352, + 10.486129829019774, + 10.646963568986394, + 10.816968007013202, + 10.985557516978588, + 11.150926348986104, + 11.313331706973258, + 11.483007495000493, + 11.647998042986728, + 11.80972831096733, + 11.97517886897549, + 12.14413848001277, + 12.313239550974686, + 12.480379695014562, + 12.650282282964326, + 12.817492300993763, + 12.979683295998257, + 13.138082398974802, + 13.302539700001944, + 13.473564309999347, + 13.638342925987672, + 13.80344009399414, + 13.972647846967448, + 14.13571513001807, + 14.304700591019355, + 14.467938193993177, + 14.632971965009347, + 14.798225211969111, + 14.964991676970385, + 15.128928174963221, + 15.287840211007278, + 15.45563163998304, + 15.621154328982811, + 15.79003744496731, + 15.961169201997109, + 16.136274405987933, + 16.303180198010523, + 16.472856384003535, + 16.635977145982906, + 16.79547128401464, + 16.961037411005236, + 17.129196027002763, + 17.301702930999454, + 17.468095376971178, + 17.614480137010105, + 17.745309402991552, + 17.850979319016915 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 167.77696699136868, + "p95": 176.1902750004083, + "max": 721.428981050849 + } + }, + { + "start": 396941.683916379, + "first": 396942.469199251, + "last": 396959.536027099, + "end": 396959.536133901, + "elapsed_s": 17.85221752198413, + "chunk_offsets_s": [ + 0.7852828719769605, + 0.9212074669776484, + 1.059806409990415, + 1.2138157120207325, + 1.3674057240132242, + 1.5242027799831703, + 1.6793788889772259, + 1.8436816009925678, + 2.0037286179722287, + 2.160998165025376, + 2.3302302819793113, + 2.495153116004076, + 2.664298204006627, + 2.843791009974666, + 3.01071033597691, + 3.177045920980163, + 3.3477678120252676, + 3.513105723017361, + 3.68997083499562, + 3.8592586260056123, + 4.027568412013352, + 4.188439488003496, + 4.356646294996608, + 4.523145109007601, + 4.6959608949837275, + 4.868758696014993, + 5.039866219973192, + 5.208575338998344, + 5.376092142018024, + 5.543768594972789, + 5.715235883020796, + 5.890445111028384, + 6.060430638026446, + 6.232605574012268, + 6.401054794027004, + 6.569858580012806, + 6.740898798976559, + 6.911201033974066, + 7.080583504983224, + 7.25279394199606, + 7.420322433987167, + 7.59287370700622, + 7.7697926930268295, + 7.937761895998847, + 8.10280785098439, + 8.275648139009718, + 8.44701912702294, + 8.61626109201461, + 8.778396531008184, + 8.943518691987265, + 9.113550785987172, + 9.283111620985437, + 9.45626326900674, + 9.626774762000423, + 9.807295419974253, + 9.983746355981566, + 10.150369491020683, + 10.316399156989064, + 10.48675041901879, + 10.647044146026019, + 10.81688718899386, + 10.985735984984785, + 11.151000590994954, + 11.313510767009575, + 11.483223147981334, + 11.648456789029296, + 11.810159695975017, + 11.975352072971873, + 12.14403838198632, + 12.313428274996113, + 12.480791032023262, + 12.650176936993375, + 12.817544158024248, + 12.979694224020932, + 13.137950139993336, + 13.303011293988675, + 13.473989023012109, + 13.638527202012483, + 13.803031733026728, + 13.972591686004307, + 14.135691849980503, + 14.304612621024717, + 14.467905762023292, + 14.632875818992034, + 14.79818876401987, + 14.965108047996182, + 15.128790108021349, + 15.287994246988092, + 15.455870061006863, + 15.621403454977553, + 15.79015839198837, + 15.961036559019703, + 16.13586676499108, + 16.303221479000058, + 16.473056051996537, + 16.636199999018572, + 16.795924926002044, + 16.960990705993026, + 17.129295277991332, + 17.30173437099438, + 17.468286149029154, + 17.615182887995616, + 17.745474622992333, + 17.85211072000675 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 167.6764529547654, + "p95": 175.20922800758854, + "max": 180.52065797382966 + } + }, + { + "start": 396941.683731623, + "first": 396942.077367869, + "last": 396959.298452229, + "end": 396959.298603912, + "elapsed_s": 17.6148722890066, + "chunk_offsets_s": [ + 0.39363624597899616, + 0.9210514000151306, + 1.0599198680138215, + 1.2136741729918867, + 1.3675168140325695, + 1.5243169750319794, + 1.679500187980011, + 1.8439152700011618, + 2.0035649820347317, + 2.1611191910342313, + 2.3303478049929254, + 2.495249934028834, + 2.6645370250334963, + 2.8439127079909667, + 3.0108413790003397, + 3.1772934140171856, + 3.3478341969894245, + 3.5132233580225147, + 3.689917184994556, + 3.8593845330178738, + 4.027408424008172, + 4.188521058007609, + 4.356910397007596, + 4.523215589986648, + 4.695813530997839, + 4.868825818004552, + 5.039724248985294, + 5.2086687330156565, + 5.3761503680143505, + 5.543898742005695, + 5.715362477989402, + 5.89032019599108, + 6.0605235359980725, + 6.232971262012143, + 6.401131356018595, + 6.570111018023454, + 6.7410196820273995, + 6.911331388982944, + 7.080473662004806, + 7.252875032019801, + 7.42044600402005, + 7.593001438013744, + 7.769916055025533, + 7.93758784403326, + 8.10292324598413, + 8.275770557986107, + 8.446939077985007, + 8.61613236903213, + 8.778273615986109, + 8.943617862008978, + 9.113807336019818, + 9.283197015000042, + 9.456389383994974, + 9.626908220991027, + 9.807416303025093, + 9.983823686023243, + 10.150230815983377, + 10.316531991004013, + 10.486481036990881, + 10.647177365026437, + 10.817021463997662, + 10.985626575013157, + 11.151082720025443, + 11.313593281025533, + 11.483343277999666, + 11.648291809018701, + 11.810024221020285, + 11.975482987996656, + 12.144393317983486, + 12.313520148978569, + 12.480642885027919, + 12.650309052027296, + 12.817621088004671, + 12.979815235012211, + 13.138081886980217, + 13.302837354014628, + 13.473842348030303, + 13.638616723997984, + 13.80350273498334, + 13.97271122498205, + 14.135821436007973, + 14.304734448029194, + 14.468036357022356, + 14.632958125032019, + 14.798318093991838, + 14.965478536032606, + 15.128913855005521, + 15.288118825003039, + 15.45595129497815, + 15.621485889016185, + 15.79028797801584, + 15.961139024992008, + 16.13624930102378, + 16.30335839401232, + 16.473125830001663, + 16.63628873700509, + 16.795764025999233, + 16.96085289499024, + 17.129301965993363, + 17.301711091015022, + 17.468351207033265, + 17.61472060601227 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 167.83246997511014, + "p95": 176.40738299814984, + "max": 527.4151540361345 + } + }, + { + "start": 396941.683310702, + "first": 396942.274132155, + "last": 396959.66798999, + "end": 396959.66807148, + "elapsed_s": 17.984760778024793, + "chunk_offsets_s": [ + 0.5908214530209079, + 0.9213209089939483, + 1.0601855220156722, + 1.2139736350509338, + 1.367773075005971, + 1.5245931410463527, + 1.679762001032941, + 1.8441574190510437, + 2.003884813049808, + 2.161373437033035, + 2.33061321801506, + 2.495511763030663, + 2.665079581027385, + 2.8442075780476443, + 3.0111964580137283, + 3.1775136750075035, + 3.3481532279984094, + 3.5134602269972675, + 3.6902188880485483, + 3.85962127399398, + 4.027684830012731, + 4.188806471996941, + 4.357090432022233, + 4.52350007602945, + 4.69611848203931, + 4.869142928044312, + 5.040008142997976, + 5.2089767240104266, + 5.376630618004128, + 5.544184460013639, + 5.7156151389935985, + 5.89060383400647, + 6.06082138203783, + 6.233060512051452, + 6.401431090023834, + 6.570398464042228, + 6.741280007001478, + 6.911562130029779, + 7.080749316024594, + 7.2531972150318325, + 7.420759563043248, + 7.593247731041629, + 7.770182221021969, + 7.937844298023265, + 8.103175459022168, + 8.276099381037056, + 8.447199611051474, + 8.61638938204851, + 8.778556902019773, + 8.943908749031834, + 9.11405375704635, + 9.28339858702384, + 9.45666012604488, + 9.627197747002356, + 9.807739509036765, + 9.984100091038272, + 10.150512374006212, + 10.31679511704715, + 10.486743810004555, + 10.647400698042475, + 10.817356271028984, + 10.985961894039065, + 11.151338662020862, + 11.313903288042638, + 11.483579123043455, + 11.64857091900194, + 11.810308611020446, + 11.975725921045523, + 12.144400390039664, + 12.313784538011532, + 12.480959947046358, + 12.650542112998664, + 12.817965191032272, + 12.980122009001207, + 13.13837451703148, + 13.303138481045607, + 13.474147858039942, + 13.638936299015768, + 13.803852534038015, + 13.973055200011004, + 14.136130291037261, + 14.305268779047765, + 14.46817693504272, + 14.633270019025076, + 14.798586243996397, + 14.965553209010977, + 15.12922600604361, + 15.288387583044823, + 15.456238229002338, + 15.621765654999763, + 15.790573552018031, + 15.96139122301247, + 16.136755104002077, + 16.30330498504918, + 16.47341169201536, + 16.63653835799778, + 16.79608056100551, + 16.961182486033067, + 17.129600484040566, + 17.301966440049, + 17.46862359700026, + 17.615042885008734, + 17.745775189017877, + 17.851371759024914, + 17.923252054024488, + 17.984679287998006 + ], + "chunk_gaps_ms": { + "count": 105, + "p50": 167.6538939937018, + "p95": 176.36058200150728, + "max": 330.4994559730403 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 55.851838436819875, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 18.461126781010535, + "end_to_end_tps": 55.46790356552374, + "timing_valid": true, + "steady_tps": 57.82359651630559, + "per_stream_tps": [ + 14.4, + 14.2, + 14.7, + 14.0 + ], + "ttft_s": [ + 0.59, + 0.39, + 0.78, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.5881826910190284, + "decode_tps": 14.375697337992833, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.404865169629346, + "prefill_tps": 54.404865169629346, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.56184291367546, + "round_gap_p50_ms": 168.11278701061383, + "round_gap_p95_ms": 214.29023501696065, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.001832953013945371, + "first_payload_s": 0.001836249022744596, + "first_content_s": 0.5881826910190284, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5881826910190284, + "last_output_s": 18.326452634006273 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.39360539097106084, + "decode_tps": 14.219893860759859, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.29969948087613, + "prefill_tps": 81.29969948087613, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 70.32401294917709, + "round_gap_p50_ms": 168.12171903438866, + "round_gap_p95_ms": 213.96399202058092, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.001462479995097965, + "first_payload_s": 0.0014642080059275031, + "first_content_s": 0.39360539097106084, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.39360539097106084, + "last_output_s": 18.326228693011217 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7823407810064964, + "decode_tps": 14.73324757599761, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 40.902891395782014, + "prefill_tps": 40.902891395782014, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.87369823535246, + "round_gap_p50_ms": 168.19165600463748, + "round_gap_p95_ms": 213.8773620245047, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.0016637810040265322, + "first_payload_s": 0.001669301011133939, + "first_content_s": 0.7823407810064964, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7823407810064964, + "last_output_s": 18.090133831021376 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19843783602118492, + "decode_tps": 13.962959609204969, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.25956945319504, + "prefill_tps": 161.25956945319504, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 71.6180543371878, + "round_gap_p50_ms": 167.86973999114707, + "round_gap_p95_ms": 214.3911049934104, + "tokens_per_chunk": 2.4150943396226414, + "headers_s": 0.0017117339884862304, + "first_payload_s": 0.0017148220213130116, + "first_content_s": 0.19843783602118492, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19843783602118492, + "last_output_s": 18.461041692004073 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 69.8444021088482, + "round_gap_p50_ms": 168.0511730373837, + "round_gap_p95_ms": 214.29023501696065, + "round_gap_mean_ms": 172.9157527937504, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 163.44942063464396, + "aggregate_prefill_tps": 163.44942063464396 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396959.671006552, + "first": 396960.259189243, + "last": 396977.997459186, + "end": 396977.997595125, + "elapsed_s": 18.326588572992478, + "chunk_offsets_s": [ + 0.5881826910190284, + 0.9191153440042399, + 1.0596352199791, + 1.2119739149929956, + 1.3671223190031014, + 1.5244046060252003, + 1.6752677140175365, + 1.8386793520185165, + 1.9979026900255121, + 2.1633819569833577, + 2.3681845309911296, + 2.5723521600011736, + 2.7776909670210443, + 2.9858954200171866, + 3.1935396529734135, + 3.361860289995093, + 3.5291419900022447, + 3.6949115130119026, + 3.8677528540138155, + 4.039197987993248, + 4.208558949001599, + 4.36917351000011, + 4.5372862970107235, + 4.700513647985645, + 4.872645722003654, + 5.045692119980231, + 5.215466495021246, + 5.38176250399556, + 5.550210765970405, + 5.717477147001773, + 5.88986199098872, + 6.062958417984191, + 6.233741755015217, + 6.405897600983735, + 6.574230801023077, + 6.743725034000818, + 6.9095792840234935, + 7.0830975730204955, + 7.251687834970653, + 7.422945081023499, + 7.590781338978559, + 7.763524503970984, + 7.937036245013587, + 8.105975071026478, + 8.273419080011081, + 8.446476953977253, + 8.618964573019184, + 8.788594882993493, + 8.962813740014099, + 9.166894862020854, + 9.380835364980157, + 9.595125599997118, + 9.81526025099447, + 10.029841899988241, + 10.25049109000247, + 10.468443017976824, + 10.640036434982903, + 10.808693195984233, + 10.981858950981405, + 11.145063082978595, + 11.314112493011635, + 11.481015020981431, + 11.644704838981852, + 11.80669657298131, + 11.975107181991916, + 12.138312381983269, + 12.299788311996963, + 12.464123870013282, + 12.632067488972098, + 12.79968358098995, + 12.965337886998896, + 13.133187504019588, + 13.300621784001123, + 13.461909545003437, + 13.616803614015225, + 13.780084904981777, + 13.951352896983735, + 14.117577243014239, + 14.287725867005065, + 14.455869132012594, + 14.621792061021551, + 14.790635213023052, + 14.954650308005512, + 15.119103813020047, + 15.285095639002975, + 15.45192128897179, + 15.61377563100541, + 15.77180564997252, + 15.939089868974406, + 16.10380476800492, + 16.273260569025297, + 16.441029020003043, + 16.615064964978956, + 16.78145632997621, + 16.950226593005937, + 17.112097588018514, + 17.27374219300691, + 17.43524445797084, + 17.60369547898881, + 17.77736166899558, + 17.944490068999585, + 18.09019282402005, + 18.220315723970998, + 18.326452634006273 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 168.11278701061383, + "p95": 214.29023501696065, + "max": 330.93265298521146 + } + }, + { + "start": 396959.67116654, + "first": 396960.064771931, + "last": 396977.997395233, + "end": 396977.997843531, + "elapsed_s": 18.32667699101148, + "chunk_offsets_s": [ + 0.39360539097106084, + 0.9188769540050998, + 1.059363628970459, + 1.2117315250216052, + 1.3663835499901325, + 1.5241603599861264, + 1.6745385929825716, + 1.8385916849947535, + 1.9975339290103875, + 2.162890186009463, + 2.3680836010025814, + 2.5720063599874265, + 2.777356286998838, + 2.9855966289760545, + 3.1932230860111304, + 3.361747967021074, + 3.5290393789764494, + 3.694571216998156, + 3.8673135949647985, + 4.0389801589772105, + 4.208643061982002, + 4.36908635601867, + 4.536786236974876, + 4.700584400969092, + 4.872361955989618, + 5.045832282979973, + 5.215423788991757, + 5.381691941991448, + 5.549946711980738, + 5.717501547012944, + 5.889772547991015, + 6.062702940020245, + 6.2335294939693995, + 6.4054142300155945, + 6.573863880010322, + 6.743631832010578, + 6.9093015500111505, + 7.083010595000815, + 7.2516291289939545, + 7.422844134969637, + 7.590418434992898, + 7.763466821983457, + 7.93670502101304, + 8.105576054018456, + 8.272967085998971, + 8.446153569966555, + 8.618173322989605, + 8.788343805004843, + 8.962481348018628, + 9.166488307993859, + 9.38045230001444, + 9.594348735001404, + 9.815166199987289, + 10.02956760599045, + 10.25021490699146, + 10.468328855000436, + 10.639928991964553, + 10.808649067010265, + 10.98136135598179, + 11.144647312990855, + 11.313653698016424, + 11.480738583020866, + 11.644417072995566, + 11.806337700982112, + 11.975142813986167, + 12.138027558976319, + 12.299566322995815, + 12.463662370981183, + 12.631784090015572, + 12.79940835898742, + 12.965070920006838, + 13.133265505020972, + 13.301093954010867, + 13.461694562982302, + 13.616453669965267, + 13.779769106011372, + 13.950997911975719, + 14.117259731981903, + 14.287421026965603, + 14.45578396198107, + 14.621500629989896, + 14.790578842977993, + 14.954388701997232, + 15.118797118018847, + 15.28484448097879, + 15.451882791996468, + 15.61346343200421, + 15.771593853016384, + 15.938832757994533, + 16.103477368014865, + 16.273231144004967, + 16.44059513899265, + 16.614753805974033, + 16.781404391978867, + 16.95001735596452, + 17.1118854219676, + 17.27349004300777, + 17.435146630974486, + 17.60319780401187, + 17.777094862016384, + 17.944285536010284, + 18.090101765992586, + 18.220006436982658, + 18.326228693011217 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 168.12171903438866, + "p95": 213.96399202058092, + "max": 525.271563034039 + } + }, + { + "start": 396959.671360816, + "first": 396960.453701597, + "last": 396977.761494647, + "end": 396977.761637866, + "elapsed_s": 18.090277049981523, + "chunk_offsets_s": [ + 0.7823407810064964, + 0.9188449700013734, + 1.0589412840199657, + 1.2113262999919243, + 1.3666195549885742, + 1.5237958729849197, + 1.674805255024694, + 1.8385799410170875, + 1.9972914280369878, + 2.1632781460066326, + 2.367952606000472, + 2.571922967035789, + 2.7772690859856084, + 2.9853529920219444, + 3.192870053986553, + 3.3614576249965467, + 3.528928721032571, + 3.694463871011976, + 3.8671770170331, + 4.038728345010895, + 4.208263998036273, + 4.368745276995469, + 4.536853534984402, + 4.699708670028485, + 4.872227233019657, + 5.045687431993429, + 5.214833696023561, + 5.381273804989178, + 5.549811061006039, + 5.717010463995393, + 5.889418317005038, + 6.06227656302508, + 6.233440164010972, + 6.405368660984095, + 6.5737539579859, + 6.743494260997977, + 6.90916500298772, + 7.082892657024786, + 7.251383316004649, + 7.422716772009153, + 7.589818518026732, + 7.763217665022239, + 7.9364500240189955, + 8.105432627024129, + 8.272820202982984, + 8.445911340997554, + 8.618351760029327, + 8.78809954301687, + 8.96235947398236, + 9.166357506008353, + 9.380375274980906, + 9.594252637005411, + 9.815018501016311, + 10.029433379007969, + 10.250078216020484, + 10.468183299992234, + 10.639512246998493, + 10.808400758018252, + 10.98122220102232, + 11.144647521025036, + 11.313580257003196, + 11.480600628012326, + 11.64455576398177, + 11.806276867981069, + 11.974850376020186, + 12.137768401997164, + 12.299306717002764, + 12.463711588992737, + 12.631659416016191, + 12.79926774802152, + 12.964940902020317, + 13.133132558024954, + 13.300329313031398, + 13.461054406012408, + 13.616314451035578, + 13.779355368984398, + 13.950742786983028, + 14.117164833995048, + 14.287288160994649, + 14.455647206981666, + 14.621358610980678, + 14.790328118018806, + 14.954250762995798, + 15.1186682190164, + 15.284696542017628, + 15.451611601980403, + 15.613345157005824, + 15.771344663982745, + 15.938693044008687, + 16.10338069399586, + 16.272971315018367, + 16.440601203008555, + 16.614664620021358, + 16.781150499009527, + 16.94974741403712, + 17.111875342030544, + 17.273344215995166, + 17.434821025002748, + 17.603091514029074, + 17.7769575319835, + 17.94417810998857, + 18.090133831021376 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 168.19165600463748, + "p95": 213.8773620245047, + "max": 220.76586401090026 + } + }, + { + "start": 396959.670584719, + "first": 396959.869022555, + "last": 396978.131626411, + "end": 396978.1317115, + "elapsed_s": 18.461126781010535, + "chunk_offsets_s": [ + 0.19843783602118492, + 0.9193448050064035, + 1.0595750260399655, + 1.2120178830227815, + 1.3668659130344167, + 1.5244861440150999, + 1.6750440610339865, + 1.839019567007199, + 1.9979528030380607, + 2.1633778130053543, + 2.368500810000114, + 2.572491875034757, + 2.7778040730045177, + 2.9860188310267404, + 3.193450851016678, + 3.3619097790215164, + 3.5294382520369254, + 3.69508554803906, + 3.8677917339955457, + 4.0393747120397165, + 4.208801034023054, + 4.369380315009039, + 4.5371612859889865, + 4.7003759809886105, + 4.872818862029817, + 5.046338502026629, + 5.215504414984025, + 5.3824434950365685, + 5.55039237003075, + 5.717680959030986, + 5.8900297220097855, + 6.062957042013295, + 6.233989775995724, + 6.406406058988068, + 6.574310146039352, + 6.743995887984056, + 6.910235857998487, + 7.083359723037574, + 7.251944256015122, + 7.423247568018269, + 7.590407938987482, + 7.7638259819941595, + 7.937064389989246, + 8.106032415991649, + 8.273377543024253, + 8.44653797900537, + 8.619000734004658, + 8.788753894041292, + 8.963355783023871, + 9.166943438991439, + 9.381334543984849, + 9.595379589998629, + 9.815558768983465, + 10.030059089011047, + 10.250640357029624, + 10.468726208026055, + 10.640143925033044, + 10.809009474993218, + 10.981800101988483, + 11.145105419040192, + 11.31412023701705, + 11.481184576987289, + 11.645431159005966, + 11.806822607992217, + 11.97541054803878, + 12.138835977006238, + 12.299951530992985, + 12.464134429988917, + 12.632229924027342, + 12.799850065028295, + 12.96552781102946, + 13.133704779029358, + 13.300837035989389, + 13.461672355013434, + 13.61731903301552, + 13.780445073032752, + 13.951710120018106, + 14.118108086986467, + 14.288212197017856, + 14.456081937009003, + 14.621939296019264, + 14.79092614701949, + 14.954821783991065, + 15.119289513037074, + 15.285271019034553, + 15.452240928018, + 15.614279594039544, + 15.772014838003088, + 15.93928476900328, + 16.10430260200519, + 16.27351622300921, + 16.44125976099167, + 16.615560704027303, + 16.78171521500917, + 16.95037251600297, + 17.11234248901019, + 17.273925269022584, + 17.435495279030874, + 17.604244579037186, + 17.777532008010894, + 17.944739787024446, + 18.09102981799515, + 18.220848823024426, + 18.326716720010154, + 18.397955950000323, + 18.461041692004073 + ], + "chunk_gaps_ms": { + "count": 105, + "p50": 167.86973999114707, + "p95": 214.3911049934104, + "max": 720.9069689852186 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.47, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/form.txt new file mode 100644 index 00000000000..25d7aea02f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/form.txt @@ -0,0 +1 @@ +windows (kept): 40.34 ms at 1 row, 62.19 at 4, 179.59 at 32, a draft 1.96 ms; experts factored diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/golden.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/golden.json new file mode 100644 index 00000000000..c8742d3b8ef --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/golden.json @@ -0,0 +1,41 @@ +{ + "count": { + "n": 512, + "token_sha256": "ba28cfb7c5b94418cb274891300c856ef827ac5d647505c33d6793a240e7ce48", + "text": "Count 1..N? User says count upward from one, one number per line. Probably continue pattern? Just count 1 to 204? Ambiguous; likely mirror 204 lines. I'll do 1–204.1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n191\n192\n193\n194\n195\n196\n197\n198\n199\n200\n201\n202\n203\n204<|user|>The user wants me to count upward from one, one number per line. The previous response counted 1 to 204. Now the user says \"Continue\" — so I should continue counting from 205.\n\nLet me continue from 205.205\n", + "seconds": { + "drafts": 11.37, + "plain": 23.19 + }, + "drafts": { + "per_round": 4.231404958677686, + "accepted": 0.7666666666666667 + } + }, + "prose": { + "n": 512, + "token_sha256": "dae7e2a5c84e5b6fb9d32a16a36fdb3abfa616b94c936b672c01ed51b18a08a6", + "text": "# 古代の道から現代の物流へ――日本の道路網に刻まれた時間\n\n日本の国土を飛行機から眺めると、幹線道路や鉄道、高速道路が幾重にも絡み合う様子が見える。一見すると現代ならではの風景に思えるが、その多くは実に千数百年前、古代の国家が描いた「道」の設計思想を色濃く受け継いでいる。古代の道路網と現代の物流網のあいだには、断絶ではなく連続の糸が張り巡らされているのである。\n\n## 律令国家が描いた幹線の原型\n\n七世紀後半、律令国家は都と地方を結ぶ官道を整備した。なかでも有名なのが東海道、東山道、北陸道、山陽道、南海道、西海道といった「七道」である。中央から諸国に派遣される使者や、地方から都へ運ばれる租税・貢納物は、この道網を通じて流れた。駅家が約十六キロメートルごとに置かれ、馬や人夫が常時待機していたという。これはまさに古代の「物流インフラ」であり、国家の存立を支える動脈だった。\n\n注目すべきは、これらの道が単に二点間を結ぶのではなく、地形と既存の集落配置を考慮しながら、後世の生活圏を規定するように引かれたことである。たとえば東海道のルートは、鎌倉時代の鎌倉街道、江戸時代の五街道、そして現代の国道一号線や東海道新幹線・東名高速道路へと、ほぼ同じ地理的骨格を保ちながら継承されてきた。山や河川の渡河点、峠の位置といった自然条件は千年経っても変わらない。だからこそ、古代人が選んだ「通りやすい場所」は、現代のエンジニアが選ぶ場所とも重なるのである。\n\n## 駅制から宿場町、そして物流拠点へ\n\n古代の駅家", + "seconds": { + "drafts": 16.76, + "plain": 23.31 + }, + "drafts": { + "per_round": 2.048, + "accepted": 0.4824399260628466 + } + }, + "code": { + "n": 512, + "token_sha256": "db45a54eb863ca46490cb8b9f235656c7b78494b7a175833d8b62403517c25f3", + "text": "Write a module with TTL LRU cache and tests.```python\n\"\"\"\nttl_lru_cache.py\n\nA thread-safe LRU cache with per-entry TTL (time-to-live) expiry.\n\nFeatures\n--------\n- Least-Recently-Used eviction when the capacity is exceeded.\n- Per-entry time-to-live: expired entries are treated as missing and\n purged lazily on access (and opportunistically during writes).\n- Thread safety via a single re-entrant lock.\n- Full type hints and docstrings.\n- Self-contained unit tests runnable via `python ttl_lru_cache.py`\n or `pytest ttl_lru_cache.py`.\n\nRequires Python 3.9+ (uses built-in generics).\n\"\"\"\n\nfrom __future__ import annotations\n\nimport threading\nimport time\nimport unittest\nfrom collections import OrderedDict\nfrom typing import Callable, Generic, Hashable, Optional, TypeVar\n\n__all__ = [\"TTLCache\", \"TTLCacheError\"]\n\nK = TypeVar(\"K\", bound=Hashable)\nV = TypeVar(\"V\")\n\n\nclass TTLCacheError(Exception):\n \"\"\"Base exception for TTLCache errors.\"\"\"\n\n\nclass TTLCache(Generic[K, V]):\n \"\"\"\n A fixed-capacity, thread-safe LRU cache whose entries expire\n after a configurable time-to-live.\n\n Args:\n maxsize: Maximum number of entries. Must be > 0.\n ttl: Default time-to-live in seconds for entries that do not\n specify one. Must be > 0. May be ``None`` to mean\n \"no expiry\" for entries inserted without an explicit ttl.\n\n Example:\n >>> cache = TTLCache(maxsize=2, ttl=60)\n >>> cache.put(\"a\", 1)\n >>> cache.get(\"a\")\n 1\n \"\"\"\n\n def __init__(\n self,\n maxsize: int,\n ttl: Optional[float] = None,\n clock: Callable[[], float] = time.monotonic,\n ) -> None:\n if maxsize <= 0:\n raise ValueError(\"maxsize must be a positive integer\")\n if ttl is not None and ttl <= 0:\n raise ValueError(\"ttl must be positive or None\")\n\n self._maxsize = maxsize\n self._default_ttl = ttl\n self._clock = clock # injectable for testing\n self._lock = threading.RLock()\n # Maps key -> (value, expiry_deadline or None). OrderedDict gives\n # us", + "seconds": { + "drafts": 13.74, + "plain": 23.46 + }, + "drafts": { + "per_round": 2.942528735632184, + "accepted": 0.6686507936507936 + } + } +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/resume.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/resume.json new file mode 100644 index 00000000000..45a1a7b3122 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-b/resume.json @@ -0,0 +1,56 @@ +{ + "nonce": "18e8b5d6b0bdcc5b", + "requested_reply_tokens": 64, + "temperature": 0, + "rows": [ + { + "phase": "first", + "seconds": 6.644, + "prompt_tokens": 6597, + "cached_tokens": 0, + "tokens": 64, + "token_sha256": "deb64028ba572c1338a0c7d8f9e985afe8bc6615602dd189d3c18218b8a3ef7c", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the most stones? Which line mentions the two lines that mention the most stones? The user asks two questions: \"Which line mentions the most stones?\" and \"Which line mentions the two lines that second most stones?\" \u2014 wait, let me" + }, + { + "phase": "repeated", + "seconds": 2.31, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "deb64028ba572c1338a0c7d8f9e985afe8bc6615602dd189d3c18218b8a3ef7c", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the most stones? Which line mentions the two lines that mention the most stones? The user asks two questions: \"Which line mentions the most stones?\" and \"Which line mentions the two lines that second most stones?\" \u2014 wait, let me", + "same_as_first": true + }, + { + "phase": "draft_false", + "seconds": 3.247, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "deb64028ba572c1338a0c7d8f9e985afe8bc6615602dd189d3c18218b8a3ef7c", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the most stones? Which line mentions the two lines that mention the most stones? The user asks two questions: \"Which line mentions the most stones?\" and \"Which line mentions the two lines that second most stones?\" \u2014 wait, let me", + "same_as_first": true + }, + { + "phase": "concurrent", + "seconds": 3.599, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "deb64028ba572c1338a0c7d8f9e985afe8bc6615602dd189d3c18218b8a3ef7c", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the most stones? Which line mentions the two lines that mention the most stones? The user asks two questions: \"Which line mentions the most stones?\" and \"Which line mentions the two lines that second most stones?\" \u2014 wait, let me", + "same_as_first": true + }, + { + "phase": "concurrent", + "seconds": 3.537, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "deb64028ba572c1338a0c7d8f9e985afe8bc6615602dd189d3c18218b8a3ef7c", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the most stones? Which line mentions the two lines that mention the most stones? The user asks two questions: \"Which line mentions the most stones?\" and \"Which line mentions the two lines that second most stones?\" \u2014 wait, let me", + "same_as_first": true + } + ] +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/conc.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/conc.json new file mode 100644 index 00000000000..94910596fb6 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/conc.json @@ -0,0 +1,17629 @@ +{ + "label": "ex", + "tokens": 256, + "mixed": false, + "cells": [ + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 44.0, + "per_stream_tps": 44.0, + "ttft_s_max": 0.13, + "request": { + "ttft_s": 0.129, + "decode_tps": 43.954, + "prompt_ttft_tps": 108.745, + "prefill_tps": 108.745, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.751, + "round_gap_p50_ms": 68.513, + "round_gap_p95_ms": 78.391, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.129, + "first_content_s": 0.129, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.129, + "last_output_s": 5.93 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 108.745, + "aggregate_prefill_tps": 108.745, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.751, + "round_gap_p50_ms": 68.513, + "round_gap_p95_ms": 78.391, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 43.169667989386696, + "makespan_s": 5.930089619010687, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 45.62094153642132, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.718384640000295, + "end_to_end_tps": 44.76788745711006, + "timing_valid": true, + "per_stream_tps": [ + 45.6 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.12874177901539952, + "decode_tps": 45.62094153642132, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.74480768457754, + "prefill_tps": 108.74480768457754, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.919758039225332, + "round_gap_p50_ms": 66.85330503387377, + "round_gap_p95_ms": 78.39077402604744, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0011907790321856737, + "first_payload_s": 0.12874177901539952, + "first_content_s": 0.12874177901539952, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12874177901539952, + "last_output_s": 5.718280079017859 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.919758039225332, + "round_gap_p50_ms": 66.85330503387377, + "round_gap_p95_ms": 78.39077402604744, + "round_gap_mean_ms": 66.54212261907689, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 108.74480768457754, + "aggregate_prefill_tps": 108.74480768457754 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395753.46285514, + "first": 395753.591596919, + "last": 395759.181135219, + "end": 395759.18123978, + "elapsed_s": 5.718384640000295, + "chunk_offsets_s": [ + 0.12874177901539952, + 0.19036369101377204, + 0.2584069590084255, + 0.3279759220313281, + 0.40551915200194344, + 0.480759593017865, + 0.555269161995966, + 0.6322673149988987, + 0.7076516450033523, + 0.7774096180219203, + 0.8473823280073702, + 0.9218049210030586, + 0.9956474770442583, + 1.0713255050359294, + 1.1501538840238936, + 1.22803311701864, + 1.3007445900002494, + 1.3657287250389345, + 1.4293724640156142, + 1.4880617239978164, + 1.5450455270474777, + 1.602116548048798, + 1.6614641980268061, + 1.7212416279944591, + 1.7886900270241313, + 1.8592628870392218, + 1.927660191024188, + 1.9975259570055641, + 2.064379262039438, + 2.1402864929987118, + 2.222006019030232, + 2.299107165017631, + 2.360110623005312, + 2.4187017049989663, + 2.484127077041194, + 2.5477661280310713, + 2.613931746047456, + 2.6847839530091733, + 2.753942128038034, + 2.8219491410418414, + 2.892538193031214, + 2.951942979998421, + 3.019698213029187, + 3.084952528006397, + 3.153619210002944, + 3.2216258700354956, + 3.2890093559981324, + 3.3560762150445953, + 3.4334374759928323, + 3.50760995503515, + 3.5861946990480646, + 3.6604394980240613, + 3.724897469044663, + 3.78627961804159, + 3.8572832830250263, + 3.9311597420019098, + 4.0155449740123, + 4.093935748038348, + 4.167132249043789, + 4.232844584039412, + 4.2918893989990465, + 4.363385740027297, + 4.431786180008203, + 4.491180534998421, + 4.555776619003154, + 4.6112852730439045, + 4.668258820020128, + 4.724563290015794, + 4.783938652020879, + 4.843913124001119, + 4.900294794002548, + 4.9597313410486095, + 5.024616628012154, + 5.081515471043531, + 5.141096387000289, + 5.198813814029563, + 5.2561596049927175, + 5.313563973002601, + 5.371587802015711, + 5.431588083039969, + 5.495823523029685, + 5.557488267018925, + 5.613797729020007, + 5.668750137032475, + 5.718280079017859 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 66.96008204016834, + "p95": 78.39077402604744, + "max": 84.38523201039061 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 40.13898627387564, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 6.483430135005619, + "end_to_end_tps": 39.48527163388306, + "timing_valid": true, + "per_stream_tps": [ + 40.1 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.1303327060304582, + "decode_tps": 40.13898627387564, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.41739680236715, + "prefill_tps": 107.41739680236715, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 24.913434364705108, + "round_gap_p50_ms": 68.51301703136414, + "round_gap_p95_ms": 93.29686796991155, + "tokens_per_chunk": 2.8444444444444446, + "headers_s": 0.0010728100314736366, + "first_payload_s": 0.1303327060304582, + "first_content_s": 0.1303327060304582, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1303327060304582, + "last_output_s": 6.483258469030261 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 24.913434364705108, + "round_gap_p50_ms": 68.51301703136414, + "round_gap_p95_ms": 93.29686796991155, + "round_gap_mean_ms": 71.38118834831239, + "tokens_per_chunk": 2.8444444444444446, + "aggregate_prompt_ttft_tps": 107.41739680236715, + "aggregate_prefill_tps": 107.41739680236715 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395759.181789673, + "first": 395759.312122379, + "last": 395765.665048142, + "end": 395765.665219808, + "elapsed_s": 6.483430135005619, + "chunk_offsets_s": [ + 0.1303327060304582, + 0.198557608993724, + 0.27386076998664066, + 0.3488695290288888, + 0.42536886100424454, + 0.5068663859856315, + 0.5908912129816599, + 0.6749041689909063, + 0.7563500130199827, + 0.8386983930249698, + 0.9134635010268539, + 0.9988070619874634, + 1.0638251500204206, + 1.1205555110354908, + 1.1791008340078406, + 1.2438739280332811, + 1.3328391700051725, + 1.4083406699937768, + 1.4654547630343586, + 1.522720905020833, + 1.5819384260103106, + 1.6372220059856772, + 1.6878942780313082, + 1.7454601990175433, + 1.8105005120160058, + 1.8671779130236246, + 1.9278090469888411, + 1.993806999991648, + 2.075846210005693, + 2.150146465981379, + 2.224725187988952, + 2.3093110140180215, + 2.4278358810115606, + 2.5302507230080664, + 2.631916405982338, + 2.7115720250294544, + 2.7973509980365634, + 2.890647866006475, + 2.9764749190071598, + 3.040234674990643, + 3.118131733033806, + 3.212841014028527, + 3.2955672059906647, + 3.377579599036835, + 3.4607143389876, + 3.525651753996499, + 3.58048422599677, + 3.6418477830011398, + 3.7070794249884784, + 3.7755924420198426, + 3.84382267302135, + 3.910864331992343, + 3.976250184001401, + 4.0449603230226785, + 4.118511195993051, + 4.1917182260076515, + 4.265888160036411, + 4.3324288229923695, + 4.4033957670326345, + 4.473364093981218, + 4.54247350100195, + 4.611829245986883, + 4.68384764099028, + 4.7502890379983, + 4.819687616021838, + 4.883198234019801, + 4.944160123995971, + 5.009043314028531, + 5.074872609984595, + 5.1399066030280665, + 5.2066035229945555, + 5.27066872199066, + 5.3469510930008255, + 5.417930165014695, + 5.487128261011094, + 5.552564865036402, + 5.618710195994936, + 5.6836382990004495, + 5.748364256985951, + 5.8159860169980675, + 5.891533788992092, + 5.9572385079809465, + 6.023746513994411, + 6.092074202024378, + 6.159897693025414, + 6.22760342201218, + 6.293931587017141, + 6.368048001022544, + 6.436847292992752, + 6.483258469030261 + ], + "chunk_gaps_ms": { + "count": 89, + "p50": 68.51301703136414, + "p95": 93.29686796991155, + "max": 118.52486699353904 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 43.95439950628234, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.930089619010687, + "end_to_end_tps": 43.169667989386696, + "timing_valid": true, + "per_stream_tps": [ + 44.0 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.12849998596357182, + "decode_tps": 43.95439950628234, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.94942824327491, + "prefill_tps": 108.94942824327491, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.750851137371843, + "round_gap_p50_ms": 68.67644301382825, + "round_gap_p95_ms": 76.57890202244744, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009627609979361296, + "first_payload_s": 0.12849998596357182, + "first_content_s": 0.12849998596357182, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12849998596357182, + "last_output_s": 5.929967025993392 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 22.750851137371843, + "round_gap_p50_ms": 68.67644301382825, + "round_gap_p95_ms": 76.57890202244744, + "round_gap_mean_ms": 69.06508380987881, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 108.94942824327491, + "aggregate_prefill_tps": 108.94942824327491 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395765.665878118, + "first": 395765.794378104, + "last": 395771.595845144, + "end": 395771.595967737, + "elapsed_s": 5.930089619010687, + "chunk_offsets_s": [ + 0.12849998596357182, + 0.19023620296502486, + 0.2582546710036695, + 0.32530501898145303, + 0.39552081999136135, + 0.4696876669768244, + 0.543028489977587, + 0.6217823089682497, + 0.6983612109906971, + 0.7688724069739692, + 0.8419987799716182, + 0.9112416759599, + 0.9862986750085838, + 1.0606491399812512, + 1.1369460870046169, + 1.2168708450044505, + 1.2965506879845634, + 1.3628288679756224, + 1.4283399209962226, + 1.4939706709701568, + 1.561252956977114, + 1.6273676629643887, + 1.690618071006611, + 1.7605656139785424, + 1.8339886619942263, + 1.9050505989580415, + 1.9734438720042817, + 2.0433778149890713, + 2.1106520199682564, + 2.1821915459586307, + 2.254286389972549, + 2.32716971996706, + 2.3967559000011533, + 2.46429748396622, + 2.535680656961631, + 2.5997973769553937, + 2.6693527239840478, + 2.736669425969012, + 2.8057291689910926, + 2.8730028299614787, + 2.9462716529960744, + 3.012478568009101, + 3.0802433869685046, + 3.1459268569597043, + 3.213912029983476, + 3.2820387720130384, + 3.3489053570083342, + 3.416173578996677, + 3.4950673189596273, + 3.567453989002388, + 3.63967716996558, + 3.706746670010034, + 3.7729469129699282, + 3.8433366999961436, + 3.9129840490058996, + 3.984750472998712, + 4.060598887968808, + 4.133275976986624, + 4.198542803991586, + 4.262745059968438, + 4.326483056007419, + 4.387037982000038, + 4.452166551956907, + 4.520275613002013, + 4.592438697989564, + 4.659119985997677, + 4.721083324984647, + 4.78777498198906, + 4.856727954989765, + 4.926731546991505, + 4.995407990005333, + 5.062951125961263, + 5.13540163700236, + 5.200016169983428, + 5.265774616971612, + 5.33644451899454, + 5.401713153987657, + 5.4686948449816555, + 5.533615091990214, + 5.604105472972151, + 5.68053523695562, + 5.750183929980267, + 5.8224082619999535, + 5.883116645971313, + 5.929967025993392 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 68.81470800726674, + "p95": 76.57890202244744, + "max": 79.92475799983367 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 77.5, + "per_stream_tps": 39.0, + "ttft_s_max": 0.25, + "request": { + "ttft_s": 0.191, + "decode_tps": 39.061, + "prompt_ttft_tps": 81.793, + "prefill_tps": 81.793, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.603, + "round_gap_p50_ms": 76.92, + "round_gap_p95_ms": 82.352, + "tokens_per_chunk": 3.012, + "headers_s": 0.002, + "first_payload_s": 0.191, + "first_content_s": 0.191, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.191, + "last_output_s": 6.711 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 110.736, + "aggregate_prefill_tps": 110.736, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.573, + "round_gap_p50_ms": 76.883, + "round_gap_p95_ms": 82.383, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 76.28447997704318, + "makespan_s": 6.71171908301767, + "steady_tps": 78.1, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 77.27211663544587, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 6.7298506669467315, + "end_to_end_tps": 76.07895410141239, + "timing_valid": true, + "steady_tps": 77.94362603246105, + "per_stream_tps": [ + 39.4, + 38.6 + ], + "ttft_s": [ + 0.25, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.25445010903058574, + "decode_tps": 39.38569823747223, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.02060916121342, + "prefill_tps": 55.02060916121342, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.389926921457562, + "round_gap_p50_ms": 77.3273900267668, + "round_gap_p95_ms": 82.65926397871226, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0014595499960705638, + "first_payload_s": 0.25445010903058574, + "first_content_s": 0.25445010903058574, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25445010903058574, + "last_output_s": 6.728881474002264 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.1294380109757185, + "decode_tps": 38.636058317722934, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.1598820506156, + "prefill_tps": 108.1598820506156, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.88255747458806, + "round_gap_p50_ms": 77.44163100142032, + "round_gap_p95_ms": 82.71246403455734, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015093259862624109, + "first_payload_s": 0.1294380109757185, + "first_content_s": 0.1294380109757185, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1294380109757185, + "last_output_s": 6.729490166995674 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.636242198022813, + "round_gap_p50_ms": 77.41713401628658, + "round_gap_p95_ms": 82.71246403455734, + "round_gap_mean_ms": 77.82430667256925, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.87497233249972, + "aggregate_prefill_tps": 109.87497233249972 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395771.597473463, + "first": 395771.851923572, + "last": 395778.326354937, + "end": 395778.326606188, + "elapsed_s": 6.729132725042291, + "chunk_offsets_s": [ + 0.25445010903058574, + 0.32703602901892737, + 0.4055937019875273, + 0.4833462469978258, + 0.5641233490314335, + 0.6459217880037613, + 0.723363371042069, + 0.7991754180402495, + 0.878252535010688, + 0.953336559003219, + 1.028942620032467, + 1.1039996200124733, + 1.18141675402876, + 1.2579284390085377, + 1.3336692050215788, + 1.4124998730258085, + 1.494843982043676, + 1.571806567022577, + 1.646592075994704, + 1.7239194660214707, + 1.8007751860423014, + 1.8761791810393333, + 1.9499392250436358, + 2.0284732970176265, + 2.108278294035699, + 2.189848988025915, + 2.266118158993777, + 2.3460380370379426, + 2.4227354360045865, + 2.5045813160249963, + 2.587415445013903, + 2.6700747089926153, + 2.7441977640264668, + 2.8200281470199116, + 2.8976359230000526, + 2.9713659820263274, + 3.048018436995335, + 3.1257183899870142, + 3.206319794000592, + 3.2819440150051378, + 3.3592102040420286, + 3.4367870520218275, + 3.51489886501804, + 3.5803350849892013, + 3.6602023229934275, + 3.738221894018352, + 3.8148476610076614, + 3.8902204720070586, + 3.9692110450123437, + 4.052658908010926, + 4.1340739040169865, + 4.212052899994887, + 4.288645962020382, + 4.369021571998019, + 4.44916486099828, + 4.529631032026373, + 4.608390867011622, + 4.691346005012747, + 4.765957129013259, + 4.840211528993677, + 4.913931492017582, + 4.984534530027304, + 5.05991215701215, + 5.136591556016356, + 5.21486631402513, + 5.292033525998704, + 5.363934880006127, + 5.440813705034088, + 5.520329067017883, + 5.600447395001538, + 5.677374541002791, + 5.753360909991898, + 5.828739417018369, + 5.90715734398691, + 5.9841729390318505, + 6.065121307037771, + 6.1407909039990045, + 6.219095247040968, + 6.29381669202121, + 6.371994121000171, + 6.45001447701361, + 6.527725390042178, + 6.611503336986061, + 6.679594431014266, + 6.728881474002264 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 77.3722620215267, + "p95": 82.65926397871226, + "max": 83.77794694388285 + } + }, + { + "start": 395771.597088468, + "first": 395771.726526479, + "last": 395778.326578635, + "end": 395778.326939135, + "elapsed_s": 6.7298506669467315, + "chunk_offsets_s": [ + 0.1294380109757185, + 0.32725503796245903, + 0.406077881983947, + 0.4838985559763387, + 0.5645795289892703, + 0.6461592619889416, + 0.7239443519501947, + 0.799732077983208, + 0.8784804249880835, + 0.9538925639935769, + 1.0293951679486781, + 1.104228196956683, + 1.1816295069875196, + 1.2581909689470194, + 1.3342193699791096, + 1.4129558119457215, + 1.4952999369706959, + 1.5723776759696193, + 1.6471427049837075, + 1.724147978995461, + 1.8013484389521182, + 1.8766699849511497, + 1.9501758179976605, + 2.02880465995986, + 2.1088260269607417, + 2.1904192959773354, + 2.2664455049671233, + 2.346351270971354, + 2.4230427339789458, + 2.50502995995339, + 2.5877424239879474, + 2.670380999974441, + 2.7445224709808826, + 2.820342005987186, + 2.898236551962327, + 2.9718502099858597, + 3.048345367948059, + 3.126026247977279, + 3.206771653960459, + 3.282253889949061, + 3.359526862972416, + 3.4373580969986506, + 3.515448308957275, + 3.580847648961935, + 3.6605241649667732, + 3.7385487129795365, + 3.815402145963162, + 3.8905379139469005, + 3.969528230954893, + 4.052987422968727, + 4.134632212982979, + 4.212348421977367, + 4.288962812977843, + 4.3695759129477665, + 4.44961691199569, + 4.529959001985844, + 4.608718708972447, + 4.691654407943133, + 4.76626490696799, + 4.840531147958245, + 4.9145074809785, + 4.985074101947248, + 5.060228254995309, + 5.13716044096509, + 5.215180828992743, + 5.29235412098933, + 5.364247953984886, + 5.4413928459980525, + 5.520614588982426, + 5.600768677948508, + 5.677961073990446, + 5.753840113990009, + 5.82904573896667, + 5.907324256957509, + 5.984765887958929, + 6.065697662997991, + 6.141248555970378, + 6.219335200963542, + 6.294308279990219, + 6.372485116997268, + 6.4505585939623415, + 6.528208817995619, + 6.6120058369706385, + 6.680089090950787, + 6.729490166995674 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 77.5459275173489, + "p95": 82.71246403455734, + "max": 197.81702698674053 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 77.46568091516414, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 6.71171908301767, + "end_to_end_tps": 76.28447997704318, + "timing_valid": true, + "steady_tps": 78.13582682907487, + "per_stream_tps": [ + 38.7, + 39.5 + ], + "ttft_s": [ + 0.13, + 0.25 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.12725339899770916, + "decode_tps": 38.73338643826882, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 110.01670768929348, + "prefill_tps": 110.01670768929348, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.81752054119373, + "round_gap_p50_ms": 76.94148097652942, + "round_gap_p95_ms": 82.38324598642066, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0009436880354769528, + "first_payload_s": 0.12725339899770916, + "first_content_s": 0.12725339899770916, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12725339899770916, + "last_output_s": 6.7107211370021105 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2525914040161297, + "decode_tps": 39.48225192053231, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.425480746391536, + "prefill_tps": 55.425480746391536, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.32783596064238, + "round_gap_p50_ms": 76.79050404112786, + "round_gap_p95_ms": 82.10268296534196, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015761909889988601, + "first_payload_s": 0.2525914040161297, + "first_content_s": 0.2525914040161297, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2525914040161297, + "last_output_s": 6.7111895739799365 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.572678250918056, + "round_gap_p50_ms": 76.83136803098023, + "round_gap_p95_ms": 82.38324598642066, + "round_gap_mean_ms": 77.63134469028695, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 110.85096149278307, + "aggregate_prefill_tps": 110.85096149278307 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395778.32828534, + "first": 395778.455538739, + "last": 395785.039006477, + "end": 395785.039169534, + "elapsed_s": 6.710884194006212, + "chunk_offsets_s": [ + 0.12725339899770916, + 0.32552111899713054, + 0.40280550002353266, + 0.48044388502603397, + 0.5604202270042151, + 0.64239999698475, + 0.7196677059982903, + 0.7960251340409741, + 0.8746592240058817, + 0.9500779070076533, + 1.0249786819913425, + 1.0999050890095532, + 1.1766623450093903, + 1.2534937130403705, + 1.3292827520053834, + 1.4080229389946908, + 1.4929706730181351, + 1.5691435560001992, + 1.6442573720123619, + 1.7199476420064457, + 1.7970896860351786, + 1.8727226430200972, + 1.94669678498758, + 2.02500552800484, + 2.101975330035202, + 2.1822378680226393, + 2.2621340340119787, + 2.3420353840338066, + 2.418976865010336, + 2.5013601109967567, + 2.583758269029204, + 2.6653549470356666, + 2.738309782987926, + 2.8137653149897233, + 2.889859572984278, + 2.9641911740181968, + 3.040377849014476, + 3.1180959939956665, + 3.19740503403591, + 3.273258025990799, + 3.3497851039865054, + 3.42639031104045, + 3.5043578820186667, + 3.56997637700988, + 3.6498826870229095, + 3.7279372829943895, + 3.8055617960053496, + 3.8809895520098507, + 3.9604948179912753, + 4.043125794036314, + 4.12486117699882, + 4.2022634639870375, + 4.279308771016076, + 4.359571180015337, + 4.440199961012695, + 4.522082193987444, + 4.601659509004094, + 4.683524830034003, + 4.758138066041283, + 4.833134489017539, + 4.906904453004245, + 4.977867335022893, + 5.052411434007809, + 5.1278007730143145, + 5.203089791990351, + 5.283448266040068, + 5.355612663028296, + 5.43287134799175, + 5.511938146024477, + 5.591808936034795, + 5.667711688030977, + 5.743226837017573, + 5.818958338990342, + 5.893782200990245, + 5.970572257996537, + 6.051026717002969, + 6.126857644994743, + 6.203542964009102, + 6.278866143024061, + 6.356898595986422, + 6.435576910036616, + 6.512124709028285, + 6.594326608988922, + 6.661542173998896, + 6.7107211370021105 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 76.9556415034458, + "p95": 82.38324598642066, + "max": 198.2677199994214 + } + }, + { + "start": 395778.327909704, + "first": 395778.580501108, + "last": 395785.039099278, + "end": 395785.039628787, + "elapsed_s": 6.71171908301767, + "chunk_offsets_s": [ + 0.2525914040161297, + 0.3257392019731924, + 0.40313120000064373, + 0.4807656640186906, + 0.5607402629684657, + 0.6427286399994045, + 0.7199926049797796, + 0.7963536499883048, + 0.8749849870218895, + 0.9504013829864562, + 1.0253074850188568, + 1.1002349319751374, + 1.1775001289788634, + 1.2542906330199912, + 1.3296124839689583, + 1.4083070859778672, + 1.493812874017749, + 1.5699943319777958, + 1.644795474014245, + 1.7202282689977437, + 1.7977994210086763, + 1.873024598986376, + 1.947533018013928, + 2.0258397120051086, + 2.102401366981212, + 2.1827328969957307, + 2.26257819798775, + 2.3424658839940093, + 2.419284661009442, + 2.501788915018551, + 2.584187808970455, + 2.6657830949989147, + 2.738738170999568, + 2.8140885820030235, + 2.8902862169779837, + 2.9646165060112253, + 3.0408075170125812, + 3.1185233099968173, + 3.1977356299757957, + 3.273686318018008, + 3.350213108002208, + 3.4266819619806483, + 3.504785855009686, + 3.570409228967037, + 3.6503111869678833, + 3.728361928020604, + 3.805991208006162, + 3.8812118099885993, + 3.9607215239666402, + 4.0435537659795955, + 4.125289805990178, + 4.202690907986835, + 4.279639974003658, + 4.359896784008015, + 4.440626605995931, + 4.522385892982129, + 4.602087146020494, + 4.6838493929826654, + 4.758564150019083, + 4.8335644619655795, + 4.907226441020612, + 4.978296266985126, + 5.052736365003511, + 5.128228809975553, + 5.2035187559667975, + 5.283716141013429, + 5.356037642981391, + 5.433201463019941, + 5.512365893984679, + 5.59223844402004, + 5.668027994979639, + 5.74355855199974, + 5.819264966004994, + 5.8942109100171365, + 5.970901716966182, + 6.05135841696756, + 6.1271849920158274, + 6.2039713530102745, + 6.279295428015757, + 6.357328151992988, + 6.436002083006315, + 6.5125532890087925, + 6.5946559719741344, + 6.661969330976717, + 6.7111895739799365 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 76.80464052828029, + "p95": 82.10268296534196, + "max": 85.50578803988174 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 77.47224882116853, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 6.711693670018576, + "end_to_end_tps": 76.28476881880441, + "timing_valid": true, + "steady_tps": 78.13975698296446, + "per_stream_tps": [ + 39.5, + 38.7 + ], + "ttft_s": [ + 0.25, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.25275977404089645, + "decode_tps": 39.48403023693696, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.38856035586899, + "prefill_tps": 55.38856035586899, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.326695223338902, + "round_gap_p50_ms": 76.87425002222881, + "round_gap_p95_ms": 81.98645798256621, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015723980031907558, + "first_payload_s": 0.25275977404089645, + "first_content_s": 0.25275977404089645, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25275977404089645, + "last_output_s": 6.7110670559923165 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.1281582560040988, + "decode_tps": 38.73687027308162, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 109.23993846757908, + "prefill_tps": 109.23993846757908, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.81519861956693, + "round_gap_p50_ms": 76.8987299525179, + "round_gap_p95_ms": 82.32052496168762, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0015348460292443633, + "first_payload_s": 0.1281582560040988, + "first_content_s": 0.1281582560040988, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1281582560040988, + "last_output_s": 6.711033903993666 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 25.570946921452915, + "round_gap_p50_ms": 76.88349799718708, + "round_gap_p95_ms": 82.32052496168762, + "round_gap_mean_ms": 77.62608886869636, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 110.73611335049605, + "aggregate_prefill_tps": 110.73611335049605 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395785.040545996, + "first": 395785.29330577, + "last": 395791.751613052, + "end": 395791.751807294, + "elapsed_s": 6.711261297983583, + "chunk_offsets_s": [ + 0.25275977404089645, + 0.32575494702905416, + 0.4036080699879676, + 0.4810617330367677, + 0.5621245020302013, + 0.643667564028874, + 0.7216922080260701, + 0.7976152970222756, + 0.8788550749886781, + 0.9538697550306097, + 1.0289534120238386, + 1.104376223986037, + 1.1813326500123367, + 1.2580895220162347, + 1.3334882060298696, + 1.412482716026716, + 1.4938011990161613, + 1.5703904220135882, + 1.6478668529889546, + 1.7241296250140294, + 1.8011750440346077, + 1.8768624190124683, + 1.9499593040090986, + 2.0282713760389015, + 2.105822896002792, + 2.1863612920278683, + 2.2632447900250554, + 2.3428632889990695, + 2.4197375390212983, + 2.501117255014833, + 2.5840736420359462, + 2.6655460800393485, + 2.7387732550268993, + 2.8137385100126266, + 2.8892390350229107, + 2.962806213006843, + 3.0388714789878577, + 3.1173624800285324, + 3.196040490991436, + 3.272326463018544, + 3.3488396370084956, + 3.425537149014417, + 3.503220238024369, + 3.569861991039943, + 3.6497544610174373, + 3.7283053179853596, + 3.8053966740262695, + 3.8810467360308394, + 3.9630331940134056, + 4.0456430339836515, + 4.127591444004793, + 4.205354309990071, + 4.282053966016974, + 4.362880862026941, + 4.443051959038712, + 4.522887099999934, + 4.602356494986452, + 4.687626920000184, + 4.762834994005971, + 4.837122787022963, + 4.911128401989117, + 4.981478717003483, + 5.056577542040031, + 5.132364902005065, + 5.207787121995352, + 5.285645621013828, + 5.357153627031948, + 5.434059013030492, + 5.513061107019894, + 5.593650192022324, + 5.669933525030501, + 5.74603056703927, + 5.821180608007126, + 5.895977254025638, + 5.971795974008273, + 6.052916696004104, + 6.128649591002613, + 6.205169789027423, + 6.280146053002682, + 6.358253802987747, + 6.436065485002473, + 6.512660564039834, + 6.595173123991117, + 6.662146975984797, + 6.7110670559923165 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 76.87887400970794, + "p95": 81.98645798256621, + "max": 85.27042501373217 + } + }, + { + "start": 395785.040452395, + "first": 395785.168610651, + "last": 395791.751486299, + "end": 395791.752146065, + "elapsed_s": 6.711693670018576, + "chunk_offsets_s": [ + 0.1281582560040988, + 0.3259985650074668, + 0.4036317340214737, + 0.4810855730320327, + 0.5621497019892558, + 0.643692716024816, + 0.7217167520429939, + 0.7976406730012968, + 0.8788805640069768, + 0.9538971000001766, + 1.0289795399876311, + 1.104404368030373, + 1.1813510180218145, + 1.258102547028102, + 1.3335089420434088, + 1.4125088280416094, + 1.493802527023945, + 1.5703731420217082, + 1.6481937690405175, + 1.7241516730282456, + 1.8011848210007884, + 1.8771301970118657, + 1.949972920003347, + 2.028296896023676, + 2.105804366990924, + 2.186642575019505, + 2.263272742042318, + 2.342866777034942, + 2.41976550698746, + 2.501142952009104, + 2.5841012109885924, + 2.66556697600754, + 2.7387786470353603, + 2.813765341998078, + 2.88926949899178, + 2.9630694150109775, + 3.038882167020347, + 3.117393616004847, + 3.196328877005726, + 3.2723317749914713, + 3.348843237035908, + 3.4255679170018993, + 3.503224254003726, + 3.569840262993239, + 3.6499972310266457, + 3.728292070038151, + 3.805400738026947, + 3.8810500479885377, + 3.963292013038881, + 4.045612538000569, + 4.127614869037643, + 4.205357559025288, + 4.2823179209954105, + 4.362874109996483, + 4.4430530309909955, + 4.52312831900781, + 4.602600593003444, + 4.687608728010673, + 4.762826721998863, + 4.837376198032871, + 4.911112898029387, + 4.981441245006863, + 5.056574630027171, + 5.132365990022663, + 5.207786465995014, + 5.285646756994538, + 5.357415406033397, + 5.4340536540257744, + 5.51330794201931, + 5.593652512005065, + 5.6699600529973395, + 5.746034967014566, + 5.821181072038598, + 5.896224201016594, + 5.971717653039377, + 6.053161418996751, + 6.128653735038824, + 6.205199278017972, + 6.280136581044644, + 6.358258331019897, + 6.436063325032592, + 6.512662997003645, + 6.595168019994162, + 6.662134464015253, + 6.711033903993666 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 76.92268997197971, + "p95": 82.32052496168762, + "max": 197.84030900336802 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 0.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 118.3, + "per_stream_tps": 29.9, + "ttft_s_max": 0.51, + "request": { + "ttft_s": 0.317, + "decode_tps": 29.912, + "prompt_ttft_tps": 45.832, + "prefill_tps": 45.832, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.432, + "round_gap_p50_ms": 98.686, + "round_gap_p95_ms": 104.51, + "tokens_per_chunk": 3.012, + "headers_s": 0.001, + "first_payload_s": 0.317, + "first_content_s": 0.317, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.317, + "last_output_s": 8.751 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 110.53, + "aggregate_prefill_tps": 110.53, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.072, + "round_gap_p50_ms": 98.706, + "round_gap_p95_ms": 104.463, + "tokens_per_chunk": 3.012 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 116.99497302607705, + "makespan_s": 8.752512809005566, + "steady_tps": 121.5, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 113.28362249088144, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 9.142112621979322, + "end_to_end_tps": 112.00912112350437, + "timing_valid": true, + "steady_tps": 116.19566450916577, + "per_stream_tps": [ + 28.7, + 28.3, + 29.6, + 29.1 + ], + "ttft_s": [ + 0.26, + 0.13, + 0.51, + 0.38 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.256318130006548, + "decode_tps": 28.729384012385246, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.61962444733172, + "prefill_tps": 54.61962444733172, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.80756843129319, + "round_gap_p50_ms": 99.58419395843521, + "round_gap_p95_ms": 129.21297102002427, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001380236994009465, + "first_payload_s": 0.256318130006548, + "first_content_s": 0.256318130006548, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.256318130006548, + "last_output_s": 9.132248079986311 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.12920645897975191, + "decode_tps": 28.324288585455626, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.35371629675228, + "prefill_tps": 108.35371629675228, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.30538805883707, + "round_gap_p50_ms": 99.42428796784952, + "round_gap_p95_ms": 129.58329496905208, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0011194349499419332, + "first_payload_s": 0.12920645897975191, + "first_content_s": 0.12920645897975191, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12920645897975191, + "last_output_s": 9.132080413983203 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5088787989807315, + "decode_tps": 29.569972602789843, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.511462509425755, + "prefill_tps": 27.511462509425755, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.81809017657503, + "round_gap_p50_ms": 99.31513504125178, + "round_gap_p95_ms": 128.38490004651248, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0016617589863017201, + "first_payload_s": 0.5088787989807315, + "first_content_s": 0.5088787989807315, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5088787989807315, + "last_output_s": 9.132491794007365 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38253249594708905, + "decode_tps": 29.14049533720645, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.59819792652713, + "prefill_tps": 36.59819792652713, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.316506580559206, + "round_gap_p50_ms": 99.33430299861357, + "round_gap_p95_ms": 129.22857096418738, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0020916519570164382, + "first_payload_s": 0.38253249594708905, + "first_content_s": 0.38253249594708905, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38253249594708905, + "last_output_s": 9.133241673989687 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.561888311816126, + "round_gap_p50_ms": 99.5203530183062, + "round_gap_p95_ms": 129.55931096803397, + "round_gap_mean_ms": 104.92001808944181, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 109.92195339907964, + "aggregate_prefill_tps": 109.92195339907964 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395791.754173188, + "first": 395792.010491318, + "last": 395800.886421268, + "end": 395800.895962879, + "elapsed_s": 9.141789690998849, + "chunk_offsets_s": [ + 0.256318130006548, + 0.6043239290011115, + 0.712670877983328, + 0.8258723689941689, + 0.9406070740078576, + 1.0645148900221102, + 1.1798415050143376, + 1.2762674770201556, + 1.3764825239777565, + 1.4731822420144454, + 1.5689993280102499, + 1.6667338240076788, + 1.765426121011842, + 1.8645876540103927, + 1.9607432070188224, + 2.0609478389960714, + 2.1647987450123765, + 2.2637477639946155, + 2.3613993949838914, + 2.4590894429711625, + 2.5586097959894687, + 2.6566249660099857, + 2.751419994980097, + 2.8516655860003084, + 2.950748062983621, + 3.053661727986764, + 3.152321193017997, + 3.2528791719814762, + 3.366008309996687, + 3.495221281016711, + 3.6328307000221685, + 3.7635383409797214, + 3.8853298489702865, + 4.009108881000429, + 4.137281889969017, + 4.259917837975081, + 4.384468764998019, + 4.512945376976859, + 4.64872940198984, + 4.746715820976533, + 4.8466539540095255, + 4.945848719973583, + 5.04519747098675, + 5.118267364974599, + 5.221647643018514, + 5.321469695016276, + 5.420490347023588, + 5.518243115977384, + 5.618303826020565, + 5.722488239000086, + 5.8255364500219, + 5.925609911966603, + 6.024877174990252, + 6.126526539970655, + 6.227368409978226, + 6.329418146982789, + 6.4325554789975286, + 6.536531521996949, + 6.6328910129959695, + 6.728875332977623, + 6.8250091259833425, + 6.91718214499997, + 7.013508132018615, + 7.113640650990419, + 7.210533571022097, + 7.310117764980532, + 7.403958896989934, + 7.50261959398631, + 7.603298566013109, + 7.705504464975093, + 7.804050232982263, + 7.901728215976618, + 8.000137918977998, + 8.098340740019921, + 8.197165597986896, + 8.29907698201714, + 8.3983338290127, + 8.496536505990662, + 8.59277775598457, + 8.693038740020711, + 8.793006554013118, + 8.891415296995547, + 8.994732805993408, + 9.078078429971356, + 9.132248079986311 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.70312297809869, + "p95": 129.21297102002427, + "max": 348.0057989945635 + } + }, + { + "start": 395791.753936114, + "first": 395791.883142573, + "last": 395800.886016528, + "end": 395800.88644778, + "elapsed_s": 9.132511665986385, + "chunk_offsets_s": [ + 0.12920645897975191, + 0.6042915129801258, + 0.7126749900053255, + 0.8259776489576325, + 0.9407679549767636, + 1.0645590499625541, + 1.1796549589489587, + 1.2767212250037119, + 1.3765827649622224, + 1.4729639199795201, + 1.5695417649694718, + 1.6670544509543106, + 1.7654359609587118, + 1.8644726449856535, + 1.9606769179808907, + 2.0613612339948304, + 2.1651748759904876, + 2.263757987995632, + 2.3612881299923174, + 2.4591546269948594, + 2.5585233949823305, + 2.6565445649903268, + 2.751441514992621, + 2.8522265189676546, + 2.9508739999728277, + 3.0537160969688557, + 3.1522297839983366, + 3.253556329989806, + 3.365717026987113, + 3.495300321956165, + 3.6327713229693472, + 3.7633834749576636, + 3.885208759980742, + 4.009668149985373, + 4.1372594889835455, + 4.2599555339547805, + 4.384882944985293, + 4.51292603299953, + 4.64904122898588, + 4.746762684953865, + 4.8471182939829305, + 4.9459106079884805, + 5.04533489595633, + 5.1182185969664715, + 5.22163282695692, + 5.321420238004066, + 5.4204745549941435, + 5.518571133958176, + 5.618427234992851, + 5.722613215970341, + 5.825511856994126, + 5.925732888979837, + 6.024996599997394, + 6.1265957889845595, + 6.227445641998202, + 6.329501187952701, + 6.43267512798775, + 6.5365969149861485, + 6.632830116956029, + 6.728980469983071, + 6.825518634985201, + 6.9171104959677905, + 7.013584261003416, + 7.113951229956001, + 7.2110147919738665, + 7.310044163954444, + 7.403952207998373, + 7.502769754966721, + 7.603604217001703, + 7.705651473952457, + 7.804054663982242, + 7.902037338993978, + 8.00014860695228, + 8.098365875950549, + 8.19722897495376, + 8.29906014999142, + 8.398395908996463, + 8.496528489980847, + 8.592773468000814, + 8.693165460950695, + 8.792977976961993, + 8.891418063954916, + 8.994883254985325, + 9.078062780958135, + 9.132080413983203 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.60584950749762, + "p95": 129.58329496905208, + "max": 475.08505400037393 + } + }, + { + "start": 395791.754423831, + "first": 395792.26330263, + "last": 395800.886915625, + "end": 395800.895815309, + "elapsed_s": 9.141391478013247, + "chunk_offsets_s": [ + 0.5088787989807315, + 0.6041732070152648, + 0.7119923270074651, + 0.8259682090138085, + 0.9401835330063477, + 1.063882083981298, + 1.1793503639637493, + 1.2758279039990157, + 1.3759823109721765, + 1.472684604988899, + 1.5686295480118133, + 1.6662580110132694, + 1.765114084992092, + 1.8640697770169936, + 1.9602900500176474, + 2.0609431819757447, + 2.1647966320160776, + 2.263434529013466, + 2.360931981995236, + 2.4588865599944256, + 2.558180687017739, + 2.656165698019322, + 2.751105014991481, + 2.8512376939761452, + 2.950552829017397, + 3.053303388005588, + 3.151815955992788, + 3.252869907009881, + 3.365474720019847, + 3.495034030987881, + 3.6325192399672233, + 3.763175408996176, + 3.8848341639968567, + 4.00875180499861, + 4.136857836972922, + 4.25959916296415, + 4.384157096967101, + 4.512541997013614, + 4.648240005015396, + 4.746388569008559, + 4.846248812973499, + 4.945526476018131, + 5.0446489860187285, + 5.117921472992748, + 5.221336214977782, + 5.321006521990057, + 5.419893556972966, + 5.517633541021496, + 5.617809020972345, + 5.722292701015249, + 5.825098252971657, + 5.92511549097253, + 6.024371538020205, + 6.126009494997561, + 6.2270476699923165, + 6.328844108968042, + 6.432058192964178, + 6.5363354079891, + 6.632584322011098, + 6.729147271020338, + 6.824582369008567, + 6.916745277005248, + 7.012861660972703, + 7.1130301330122165, + 7.210343696991913, + 7.309401165985037, + 7.403655725007411, + 7.502048004011158, + 7.602821072970983, + 7.704934106965084, + 7.8037502450169995, + 7.901203475019429, + 7.999836492002942, + 8.098039200005587, + 8.196614105021581, + 8.298756114963908, + 8.39813502697507, + 8.496230310003739, + 8.592458295985125, + 8.692842193995602, + 8.792697925993707, + 8.891105981019791, + 8.994236593018286, + 9.077770281990524, + 9.132491794007365 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.34702352620661, + "p95": 128.38490004651248, + "max": 137.48520897934213 + } + }, + { + "start": 395791.753850257, + "first": 395792.136382753, + "last": 395800.887091931, + "end": 395800.887187243, + "elapsed_s": 9.133336985949427, + "chunk_offsets_s": [ + 0.38253249594708905, + 0.6044378979713656, + 0.7131384819513187, + 0.8260063380002975, + 0.9410923909745179, + 1.0647071799612604, + 1.1802992379525676, + 1.2770733559736982, + 1.3769078719778918, + 1.4733372359769419, + 1.569424851972144, + 1.667199379997328, + 1.7658382369554602, + 1.8648319449857809, + 1.9609243769664317, + 2.0613649309962057, + 2.1654230379499495, + 2.263926997955423, + 2.3615830289782025, + 2.459338148997631, + 2.5586724519962445, + 2.6568300880026072, + 2.7515972599503584, + 2.8521030949777924, + 2.9513146599638276, + 3.0540876039885916, + 3.1525705389794894, + 3.2533823929843493, + 3.366231527994387, + 3.4954600989585742, + 3.6330205089761876, + 3.7635508209932595, + 3.8855853239656426, + 4.009635525988415, + 4.1377474459586665, + 4.260307730000932, + 4.3850582739687525, + 4.513461253955029, + 4.649179086962249, + 4.747091151948553, + 4.8471638149931096, + 4.946349700971041, + 5.045345505001023, + 5.11868901696289, + 5.221818444959354, + 5.32220110995695, + 5.420903550984804, + 5.518816048977897, + 5.618799574964214, + 5.723020867968444, + 5.825767187983729, + 5.926026731962338, + 6.0252859149477445, + 6.1269172159954906, + 6.227439738984685, + 6.329663028998766, + 6.433077947993297, + 6.536779941001441, + 6.633043974987231, + 6.729663147998508, + 6.825399353983812, + 6.917401202954352, + 7.013759926951025, + 7.113738091953564, + 7.211041671980638, + 7.310217797989026, + 7.40415481798118, + 7.5027896909741685, + 7.603502279962413, + 7.70566937798867, + 7.804250377987046, + 7.901922057964839, + 8.0003369289916, + 8.098540629958734, + 8.197394863993395, + 8.299487657961436, + 8.39857946295524, + 8.496713115950115, + 8.593277536972892, + 8.693478888948448, + 8.79312745097559, + 8.891591041989159, + 8.995123721950222, + 9.078253550978843, + 9.133241673989687 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 99.49143251287751, + "p95": 129.22857096418738, + "max": 221.90540202427655 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 118.29186909812884, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 8.752512809005566, + "end_to_end_tps": 116.99497302607705, + "timing_valid": true, + "steady_tps": 121.52441031003067, + "per_stream_tps": [ + 29.6, + 30.5, + 30.9, + 30.0 + ], + "ttft_s": [ + 0.13, + 0.38, + 0.51, + 0.25 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.1290303779533133, + "decode_tps": 29.575019241760092, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 108.50158096154365, + "prefill_tps": 108.50158096154365, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.812319506051054, + "round_gap_p50_ms": 98.64621801534668, + "round_gap_p95_ms": 104.46296102600172, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0008328079711645842, + "first_payload_s": 0.1290303779533133, + "first_content_s": 0.1290303779533133, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1290303779533133, + "last_output_s": 8.751171851996332 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38105921901296824, + "decode_tps": 30.464827630538643, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.739696355498886, + "prefill_tps": 36.739696355498886, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.82473848621343, + "round_gap_p50_ms": 98.72660198016092, + "round_gap_p95_ms": 104.55712099792436, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001498126017395407, + "first_payload_s": 0.38105921901296824, + "first_content_s": 0.38105921901296824, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38105921901296824, + "last_output_s": 8.751367532997392 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5054614899563603, + "decode_tps": 30.928778793820165, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.69746118781217, + "prefill_tps": 27.69746118781217, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.33234673332167, + "round_gap_p50_ms": 98.62364100990817, + "round_gap_p95_ms": 104.2448629741557, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0008865209529176354, + "first_payload_s": 0.5054614899563603, + "first_content_s": 0.5054614899563603, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5054614899563603, + "last_output_s": 8.750209906953387 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25477401999523863, + "decode_tps": 30.01168974739229, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.950657842827304, + "prefill_tps": 54.950657842827304, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.32034978426664, + "round_gap_p50_ms": 98.72514597373083, + "round_gap_p95_ms": 104.59483397426084, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0019118419731967151, + "first_payload_s": 0.25477401999523863, + "first_content_s": 0.25477401999523863, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25477401999523863, + "last_output_s": 8.751463214983232 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.0724386274632, + "round_gap_p50_ms": 98.70640997542068, + "round_gap_p95_ms": 104.46296102600172, + "round_gap_mean_ms": 100.398474404799, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 110.52966258910938, + "aggregate_prefill_tps": 110.52966258910938 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395800.89733806, + "first": 395801.026368438, + "last": 395809.648509912, + "end": 395809.648734602, + "elapsed_s": 8.751396541949362, + "chunk_offsets_s": [ + 0.1290303779533133, + 0.6015879539772868, + 0.7006492149666883, + 0.7990849819616415, + 0.9009405580000021, + 1.00548151897965, + 1.1043238819693215, + 1.2015175249543972, + 1.3019580789841712, + 1.3984354760032147, + 1.494066015991848, + 1.5910006009507924, + 1.6900576379848644, + 1.7890717149712145, + 1.8875735309557058, + 1.9869346019695513, + 2.090308208949864, + 2.1891378510044888, + 2.2869195959647186, + 2.384400361974258, + 2.4838963479851373, + 2.5822475379682146, + 2.676867300993763, + 2.7772127499920316, + 2.8765526699717157, + 2.9784401179640554, + 3.076953085954301, + 3.1782242239569314, + 3.2770710829645395, + 3.381932655000128, + 3.4866204819991253, + 3.5903028269531205, + 3.6841621350031346, + 3.7815491399960592, + 3.8799591309507377, + 3.9755244230036624, + 4.07483376696473, + 4.175101695000194, + 4.277529179991689, + 4.375329181959387, + 4.473771364951972, + 4.572830817953218, + 4.670770756958518, + 4.744425921002403, + 4.847070767951664, + 4.946951428952161, + 5.0454474369762465, + 5.142639223951846, + 5.243518918985501, + 5.347493570996448, + 5.451108779001515, + 5.550680749991443, + 5.6492010619840585, + 5.751421600987669, + 5.852938773983624, + 5.955744662962388, + 6.05664997297572, + 6.161112934001721, + 6.257941085961647, + 6.354034991003573, + 6.4525212869630195, + 6.543834874988534, + 6.638834337994922, + 6.73743935499806, + 6.8346540859784, + 6.93477452598745, + 7.028211877972353, + 7.129886571958195, + 7.230844618985429, + 7.33241451298818, + 7.430862711975351, + 7.52782052999828, + 7.625837668951135, + 7.7233807719894685, + 7.821260677999817, + 7.923148525995202, + 8.020955696003512, + 8.119076500006486, + 8.215237125987187, + 8.313883344002534, + 8.414140632958151, + 8.511148898978718, + 8.615259615995456, + 8.696417603001464, + 8.751171851996332 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.73793003498577, + "p95": 104.46296102600172, + "max": 472.5575760239735 + } + }, + { + "start": 395800.89774064, + "first": 395801.278799859, + "last": 395809.649108173, + "end": 395809.649756436, + "elapsed_s": 8.752015796024352, + "chunk_offsets_s": [ + 0.38105921901296824, + 0.6009872290305793, + 0.6999928730074316, + 0.7988483720109798, + 0.9007900760043412, + 1.0054346860270016, + 1.1042473370325752, + 1.2013491550460458, + 1.3012328399927355, + 1.397839150042273, + 1.4938031019992195, + 1.5914931180304848, + 1.689840612001717, + 1.7888680170290172, + 1.886769795033615, + 1.9870915480423719, + 2.090060622023884, + 2.188787224004045, + 2.286445976002142, + 2.384163240029011, + 2.4834315110347234, + 2.581688428996131, + 2.676296702993568, + 2.776614664006047, + 2.87622353102779, + 2.977938833006192, + 3.076796188019216, + 3.178024606022518, + 3.2766099750297144, + 3.381456586997956, + 3.4861374210449867, + 3.589953544025775, + 3.683592657034751, + 3.781422755040694, + 3.879466182028409, + 3.9753569650347345, + 4.074281041044742, + 4.175255089008715, + 4.277002967020962, + 4.375181484036148, + 4.47350305801956, + 4.572643744002562, + 4.670507314032875, + 4.743956748046912, + 4.846782397013158, + 4.946791235008277, + 5.045293387025595, + 5.142181540024467, + 5.243058018037118, + 5.347340769018047, + 5.4509255299926735, + 5.550345754018053, + 5.649052163993474, + 5.751123214024119, + 5.852827636001166, + 5.955518372007646, + 6.056396323023364, + 6.160953444021288, + 6.2576896600076, + 6.3538165730424225, + 6.4521778440102935, + 6.543647529033478, + 6.638606831023935, + 6.736730148026254, + 6.8345652050338686, + 6.934511675033718, + 7.027901731024031, + 7.129585929040331, + 7.2303821830428205, + 7.332453889015596, + 7.430798999033868, + 7.527576623018831, + 7.625642883009277, + 7.723220194049645, + 7.821018932037987, + 7.922980429022573, + 8.02080542204203, + 8.118913971004076, + 8.214908579015173, + 8.313883104012348, + 8.413509618025273, + 8.510907008021604, + 8.614934493030887, + 8.696092272002716, + 8.751367532997392 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.76962649286725, + "p95": 104.55712099792436, + "max": 219.9280100176111 + } + }, + { + "start": 395800.898433462, + "first": 395801.403894952, + "last": 395809.648643369, + "end": 395809.649463201, + "elapsed_s": 8.751029738981742, + "chunk_offsets_s": [ + 0.5054614899563603, + 0.6004114319803193, + 0.6996652699890547, + 0.7980947970063426, + 0.900039077969268, + 1.0046714159543626, + 1.1033709769835696, + 1.2005963010014966, + 1.3006112349685282, + 1.3972406009561382, + 1.4931646959739737, + 1.5903284669620916, + 1.6890941899619065, + 1.7881202659918927, + 1.886318910983391, + 1.985968530003447, + 2.0892980229691602, + 2.1881566259544343, + 2.2854094060021453, + 2.3833744329749607, + 2.482926035008859, + 2.5810531270108186, + 2.675677769992035, + 2.7760254109743983, + 2.875381250982173, + 2.9774112770101056, + 3.0760257819783874, + 3.1772166949813254, + 3.2758403359912336, + 3.3809169979649596, + 3.4853705349960364, + 3.5893269619555213, + 3.68297388398787, + 3.7806422199937515, + 3.8789471379714087, + 3.9746090549742803, + 4.07387113396544, + 4.174510665994603, + 4.276224399975035, + 4.374415172962472, + 4.47274033195572, + 4.571900265989825, + 4.669746252009645, + 4.743208053987473, + 4.846143031958491, + 4.946043581003323, + 5.044543924974278, + 5.1414053729968145, + 5.2423183000064455, + 5.346563162980601, + 5.450138114974834, + 5.549721444956958, + 5.648304749978706, + 5.750516600965057, + 5.851930539996829, + 5.954776205995586, + 6.0557554209954105, + 6.160214589966927, + 6.256951892981306, + 6.353185847983696, + 6.451522493967786, + 6.542907697963528, + 6.637978761980776, + 6.736288815969601, + 6.833653212990612, + 6.933746547962073, + 7.027164380007889, + 7.128675936954096, + 7.229249436990358, + 7.331395910994615, + 7.4300585449673235, + 7.526945433986839, + 7.6249000919633545, + 7.722462108009495, + 7.820365054009017, + 7.922237813996617, + 8.020064599986654, + 8.118087434966583, + 8.21406421996653, + 8.313043879985344, + 8.41272497200407, + 8.510253353975713, + 8.614088597008958, + 8.695443434000481, + 8.750209906953387 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.64313749130815, + "p95": 104.2448629741557, + "max": 105.076661973726 + } + }, + { + "start": 395800.897243627, + "first": 395801.152017647, + "last": 395809.648706842, + "end": 395809.649218334, + "elapsed_s": 8.751974707003683, + "chunk_offsets_s": [ + 0.25477401999523863, + 0.6013799689826556, + 0.7004282050183974, + 0.7991038950276561, + 0.9011555360048078, + 1.0058012660010718, + 1.1044856919907033, + 1.2017174949869514, + 1.3021149130072445, + 1.3986965980147943, + 1.4942329779732972, + 1.5910162330255844, + 1.6902197520248592, + 1.7892487730132416, + 1.8873293999931775, + 1.9876408650306985, + 2.0903325129766017, + 2.1889673700206913, + 2.2864783440018073, + 2.38441573898308, + 2.4838405229966156, + 2.5820848650182597, + 2.6766984189744107, + 2.777034413011279, + 2.8764715809957124, + 2.9783485649968497, + 3.077151280012913, + 3.178472354018595, + 3.276944121986162, + 3.3818693590001203, + 3.486464192974381, + 3.5903041069977917, + 3.6839777969871648, + 3.7817736379802227, + 3.8798853069893084, + 3.9757146810297854, + 4.075001224002335, + 4.175626083975658, + 4.277579949004576, + 4.375548896030523, + 4.473778469022363, + 4.5730298919952475, + 4.670781460998114, + 4.744313104019966, + 4.847508724022191, + 4.947154087014496, + 5.045654286979698, + 5.142427830025554, + 5.243435254029464, + 5.347698180994485, + 5.451884931011591, + 5.550690382020548, + 5.649415527994279, + 5.751430833013728, + 5.853417770005763, + 5.9561806509736925, + 6.0565036840271205, + 6.161325399996713, + 6.258375409990549, + 6.3542523690266535, + 6.45238520600833, + 6.544042157009244, + 6.63903942797333, + 6.737401114020031, + 6.835001386003569, + 6.934776270005386, + 7.028220661974046, + 7.129746219026856, + 7.230343286995776, + 7.332284462987445, + 7.431164458976127, + 7.528010627022013, + 7.626033271022607, + 7.723541749990545, + 7.8214500559843145, + 7.923368096991908, + 8.021170369989704, + 8.11935179901775, + 8.21514304500306, + 8.31406057800632, + 8.413820597983431, + 8.51133933197707, + 8.615168222982902, + 8.69640190701466, + 8.751463214983232 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.76393049489707, + "p95": 104.59483397426084, + "max": 346.6059489874169 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 119.23502384295772, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 8.683133841026574, + "end_to_end_tps": 117.9297726774342, + "timing_valid": true, + "steady_tps": 122.50665009100075, + "per_stream_tps": [ + 29.8, + 31.2, + 30.3, + 30.7 + ], + "ttft_s": [ + 0.13, + 0.5, + 0.25, + 0.38 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.12786871899152175, + "decode_tps": 29.8116504588383, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 109.48729376829263, + "prefill_tps": 109.48729376829263, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.54393281179535, + "round_gap_p50_ms": 97.99117199145257, + "round_gap_p95_ms": 103.05496398359537, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0006433019880205393, + "first_payload_s": 0.12786871899152175, + "first_content_s": 0.12786871899152175, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.12786871899152175, + "last_output_s": 8.681571585999336 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5029930369928479, + "decode_tps": 31.176103964590563, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.8333872844428, + "prefill_tps": 27.8333872844428, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.0758488981108, + "round_gap_p50_ms": 98.06477295933291, + "round_gap_p95_ms": 102.8336490271613, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.0012575960136018693, + "first_payload_s": 0.5029930369928479, + "first_content_s": 0.5029930369928479, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5029930369928479, + "last_output_s": 8.682334506011102 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.2534194479812868, + "decode_tps": 30.25397932674875, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.24437888063666, + "prefill_tps": 55.24437888063666, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.05350311771583, + "round_gap_p50_ms": 98.13456604024395, + "round_gap_p95_ms": 103.18421298870817, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001422878005541861, + "first_payload_s": 0.2534194479812868, + "first_content_s": 0.2534194479812868, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2534194479812868, + "last_output_s": 8.682062742998824 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.37791580002522096, + "decode_tps": 30.70852247526573, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 37.045288921674306, + "prefill_tps": 37.045288921674306, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.564249901813184, + "round_gap_p50_ms": 97.88265795214102, + "round_gap_p95_ms": 102.90350700961426, + "tokens_per_chunk": 3.011764705882353, + "headers_s": 0.001514350005891174, + "first_payload_s": 0.37791580002522096, + "first_content_s": 0.37791580002522096, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.37791580002522096, + "last_output_s": 8.681799524987582 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.80938368235879, + "round_gap_p50_ms": 98.02336397115141, + "round_gap_p95_ms": 103.05496398359537, + "round_gap_mean_ms": 99.59991475001776, + "tokens_per_chunk": 3.011764705882353, + "aggregate_prompt_ttft_tps": 111.29929215508221, + "aggregate_prefill_tps": 111.29929215508221 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3fcd20ce2fb0", + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395809.651253314, + "first": 395809.779122033, + "last": 395818.3328249, + "end": 395818.333143671, + "elapsed_s": 8.6818903569947, + "chunk_offsets_s": [ + 0.12786871899152175, + 0.5967861040262505, + 0.6981712590204552, + 0.7954946800018661, + 0.8954557260149159, + 0.997426855028607, + 1.0944039050373249, + 1.1924852370284498, + 1.2908512279973365, + 1.386224743037019, + 1.4849519690033048, + 1.580563758034259, + 1.67888885299908, + 1.7764684360008687, + 1.871812398021575, + 1.9720385510008782, + 2.074343699030578, + 2.1729473730083555, + 2.2685543129919097, + 2.365787654009182, + 2.4636640560347587, + 2.560442255984526, + 2.6544082370237447, + 2.752755428024102, + 2.850445108022541, + 2.95233137300238, + 3.049522713001352, + 3.150923340988811, + 3.248319434002042, + 3.35057589400094, + 3.4545700669987127, + 3.557625030982308, + 3.651289905013982, + 3.749281077005435, + 3.846871491987258, + 3.941112852015067, + 4.037818507000338, + 4.137490831024479, + 4.237166915030684, + 4.333456678024959, + 4.431004133017268, + 4.532292872027028, + 4.630500174011104, + 4.703218465030659, + 4.805518958019093, + 4.903970902028959, + 5.002064073982183, + 5.097477429022547, + 5.197398187010549, + 5.300448463007342, + 5.402173686015885, + 5.501550391025376, + 5.598795250989497, + 5.699683442013338, + 5.799530984018929, + 5.900098372017965, + 6.000596767000388, + 6.102895004034508, + 6.1992732000071555, + 6.2945207779994234, + 6.390242599998601, + 6.481354474031832, + 6.5763178410124965, + 6.673321787035093, + 6.770066259021405, + 6.874318674032111, + 6.96836689603515, + 7.06567034998443, + 7.165607123984955, + 7.266656660998706, + 7.364140355028212, + 7.461634673993103, + 7.561885675997473, + 7.65884998999536, + 7.755717022984754, + 7.856726191006601, + 7.954719395027496, + 8.051490826997906, + 8.147868096013553, + 8.246760460024234, + 8.345442101999652, + 8.442321119015105, + 8.545598549011629, + 8.627652002032846, + 8.681571585999336 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.99218800617382, + "p95": 103.05496398359537, + "max": 468.9173850347288 + } + }, + { + "start": 395809.651320978, + "first": 395810.154314015, + "last": 395818.333655484, + "end": 395818.33403296, + "elapsed_s": 8.682711981993634, + "chunk_offsets_s": [ + 0.5029930369928479, + 0.596954537963029, + 0.6977303439634852, + 0.7958104599965736, + 0.8954641110030934, + 0.9975486170151271, + 1.0941369269858114, + 1.1922273800009862, + 1.2911375840194523, + 1.3856634899857454, + 1.4846662869676948, + 1.580959073966369, + 1.679089926998131, + 1.7766752549796365, + 1.8720731369685382, + 1.9721571929985657, + 2.074499125999864, + 2.1729804609785788, + 2.2686056579696015, + 2.3653527859714814, + 2.4635036870022304, + 2.560047149017919, + 2.654434846015647, + 2.7529601819696836, + 2.85066563897999, + 2.9524370710132644, + 3.0495609539793804, + 3.151139374997001, + 3.2483743319753557, + 3.350657639966812, + 3.454766181996092, + 3.5576182149816304, + 3.651465011003893, + 3.749529783963226, + 3.8468553489656188, + 3.9413378789904527, + 4.03792233299464, + 4.137258428963833, + 4.237518567009829, + 4.333582872000989, + 4.4311975599848665, + 4.532480138994288, + 4.630606670980342, + 4.70295550301671, + 4.805272091994993, + 4.903695155982859, + 5.001876792986877, + 5.0975547269918025, + 5.197492061008234, + 5.300280605966691, + 5.402216086979024, + 5.5012870929786, + 5.598423903982621, + 5.699835220002569, + 5.799285541987047, + 5.900591944984626, + 6.00036554998951, + 6.103199199016672, + 6.199040031002369, + 6.294304567971267, + 6.3904155300115235, + 6.481094471993856, + 6.576607715978753, + 6.673373851983342, + 6.770100547990296, + 6.8741904979688115, + 6.968514113978017, + 7.065712270967197, + 7.165357874007896, + 7.266530259978026, + 7.364339365973137, + 7.461710435978603, + 7.561580872978084, + 7.658564292010851, + 7.755266874970403, + 7.856777872017119, + 7.954735027975403, + 8.051694541994948, + 8.148059793980792, + 8.246827612980269, + 8.346111293009017, + 8.442007484962232, + 8.545845879998524, + 8.627299215004314, + 8.682334506011102 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.07244449621066, + "p95": 102.8336490271613, + "max": 104.10854202928022 + } + }, + { + "start": 395809.651481956, + "first": 395809.904901404, + "last": 395818.333544699, + "end": 395818.333736877, + "elapsed_s": 8.682254921004642, + "chunk_offsets_s": [ + 0.2534194479812868, + 0.5968827129690908, + 0.6978847290156409, + 0.7957116579636931, + 0.8951427799765952, + 0.9971218769787811, + 1.094122831011191, + 1.1919777449802496, + 1.290717882977333, + 1.38593549199868, + 1.4844016919960268, + 1.5805639500031248, + 1.678729970997665, + 1.7763309149886481, + 1.8716623809887096, + 1.9721001199795865, + 2.074184705968946, + 2.1729089239961468, + 2.2686319299973547, + 2.3653455050080083, + 2.4637657369603403, + 2.5597224090015516, + 2.654396204976365, + 2.7527274119784124, + 2.8503178589744493, + 2.95182268001372, + 3.049165830016136, + 3.15079181996407, + 3.2483414029702544, + 3.3501613949774764, + 3.454549362999387, + 3.5575175099656917, + 3.6511456959997304, + 3.749169059970882, + 3.846536257013213, + 3.941347430984024, + 4.037398215965368, + 4.137166124011856, + 4.237190658983309, + 4.333365892991424, + 4.430864947964437, + 4.532258695981, + 4.6306245750165544, + 4.703157440992072, + 4.804996985010803, + 4.903246783011127, + 5.0014882769901305, + 5.097547414014116, + 5.197262841975316, + 5.300447054964025, + 5.402212182001676, + 5.50137688498944, + 5.59833470301237, + 5.699599233979825, + 5.799381301971152, + 5.900345030007884, + 6.000295644975267, + 6.102842811960727, + 6.198974861006718, + 6.294206390972249, + 6.390104550984688, + 6.480703731998801, + 6.576243599993177, + 6.673273306980263, + 6.769996418966912, + 6.8738830059883185, + 6.96791306801606, + 7.066196002997458, + 7.165302704961505, + 7.266228768974543, + 7.364020161970984, + 7.462154728011228, + 7.561717802018393, + 7.658230063971132, + 7.755298155010678, + 7.856682415003888, + 7.954171357967425, + 8.051366505969781, + 8.147743295005057, + 8.246829196985345, + 8.346141309011728, + 8.44219156599138, + 8.545475571998395, + 8.627293661993463, + 8.682062742998824 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 98.15029351739213, + "p95": 103.18421298870817, + "max": 343.463264987804 + } + }, + { + "start": 395809.651166161, + "first": 395810.029081961, + "last": 395818.332965686, + "end": 395818.334300002, + "elapsed_s": 8.683133841026574, + "chunk_offsets_s": [ + 0.37791580002522096, + 0.5969495609751903, + 0.6977800240274519, + 0.7956626819795929, + 0.895767585025169, + 0.9977546349982731, + 1.094242591992952, + 1.1926873360062018, + 1.291214608005248, + 1.3859080360271037, + 1.4846238379832357, + 1.5809497780282982, + 1.679381800990086, + 1.7769008559989743, + 1.872141057974659, + 1.9721975129796192, + 2.0745987099944614, + 2.173283279989846, + 2.2690530699910596, + 2.3657423889962956, + 2.4642919820034876, + 2.560343134973664, + 2.654777745017782, + 2.7529573820065707, + 2.8507375909830444, + 2.952370429004077, + 3.049663289973978, + 3.1513915690011345, + 3.2485778689733706, + 3.3507540079881437, + 3.4547611090238206, + 3.5576289509772323, + 3.651774406025652, + 3.749549494998064, + 3.847090022987686, + 3.94134517502971, + 4.0378436599858105, + 4.137629808974452, + 4.237358373007737, + 4.333615304029081, + 4.431265368009917, + 4.532293256022967, + 4.630694048013538, + 4.7032124969991855, + 4.805666622996796, + 4.9036484669777565, + 5.002099338977132, + 5.097924601985142, + 5.197720094001852, + 5.300623601011466, + 5.402675083023496, + 5.5015561989857815, + 5.598943701013923, + 5.699873284029309, + 5.799548855982721, + 5.900274997984525, + 6.000739488983527, + 6.103116382029839, + 6.199810501013417, + 6.294684635009617, + 6.390638396027498, + 6.481097800016869, + 6.576519475027453, + 6.673650351003744, + 6.770370389975142, + 6.874480500002392, + 6.968375137017574, + 7.066040961013641, + 7.165769285988063, + 7.266818694013637, + 7.364545239019208, + 7.46203474199865, + 7.561857788008638, + 7.659172857005615, + 7.755885760008823, + 7.857061201997567, + 7.954577058029827, + 8.051922206999734, + 8.148284067981876, + 8.247204688028432, + 8.345660567982122, + 8.442248318984639, + 8.54606301797321, + 8.62768308998784, + 8.681799524987582 + ], + "chunk_gaps_ms": { + "count": 84, + "p50": 97.93225096655078, + "p95": 102.90350700961426, + "max": 219.0337609499693 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "3fcd20ce2fb0da2d0d18ea1f198e6512e3be5c199ee53241cd198c95a1e40611", + "output_sha256": "64589a335b074e19ecfe5509272975612b804e23d390b19a86b0ff9691cb70fa", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 36.0, + "per_stream_tps": 36.0, + "ttft_s_max": 0.2, + "request": { + "ttft_s": 0.195, + "decode_tps": 35.967, + "prompt_ttft_tps": 163.842, + "prefill_tps": 163.842, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.804, + "round_gap_p50_ms": 58.904, + "round_gap_p95_ms": 70.489, + "tokens_per_chunk": 2.151, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.195, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.195, + "last_output_s": 7.285 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 163.842, + "aggregate_prefill_tps": 163.842, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.804, + "round_gap_p50_ms": 58.904, + "round_gap_p95_ms": 70.489, + "tokens_per_chunk": 2.151 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 35.138995950240165, + "makespan_s": 7.285353297018446, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 35.688128165773634, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.340433316014241, + "end_to_end_tps": 34.8753253355627, + "timing_valid": true, + "per_stream_tps": [ + 35.7 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.1950795369921252, + "decode_tps": 35.688128165773634, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 164.03565690896502, + "prefill_tps": 164.03565690896502, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.02052254898145, + "round_gap_p50_ms": 56.861757999286056, + "round_gap_p95_ms": 69.3192039616406, + "tokens_per_chunk": 2.015748031496063, + "headers_s": 0.0013539009960368276, + "first_payload_s": 0.0013568769791163504, + "first_content_s": 0.1950795369921252, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1950795369921252, + "last_output_s": 7.340312786982395 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.02052254898145, + "round_gap_p50_ms": 56.861757999286056, + "round_gap_p95_ms": 69.3192039616406, + "round_gap_mean_ms": 56.70820039674817, + "tokens_per_chunk": 2.015748031496063, + "aggregate_prompt_ttft_tps": 164.03565690896502, + "aggregate_prefill_tps": 164.03565690896502 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395837.178059927, + "first": 395837.373139464, + "last": 395844.518372714, + "end": 395844.518493243, + "elapsed_s": 7.340433316014241, + "chunk_offsets_s": [ + 0.1950795369921252, + 0.26468141499208286, + 0.3318080379976891, + 0.3969763549976051, + 0.45755619497504085, + 0.5258273250074126, + 0.5901180809596553, + 0.6530335919815116, + 0.720633179997094, + 0.785182129999157, + 0.8511870629736222, + 0.9178097289986908, + 0.965902202995494, + 1.012839577975683, + 1.0611079090158455, + 1.1116609660093673, + 1.1677361879847012, + 1.2163090190151706, + 1.2665810009930283, + 1.3147361319861375, + 1.3688718950143084, + 1.4197677240008488, + 1.4748095920076594, + 1.5258650699979626, + 1.5868044659728184, + 1.6390319709898904, + 1.6979927569627762, + 1.7559524920070544, + 1.8149874539813027, + 1.8709333629813045, + 1.9220134649658576, + 1.9810678989742883, + 2.0364200429758057, + 2.084998440986965, + 2.1333744860021397, + 2.179890447994694, + 2.227710759965703, + 2.2742330909823067, + 2.322401773009915, + 2.3731202239869162, + 2.4346881859819405, + 2.496588167967275, + 2.5659646679996513, + 2.635283871961292, + 2.7015641030156985, + 2.7696720479871146, + 2.835513138968963, + 2.8968220580136403, + 2.9732681299792603, + 3.036627500958275, + 3.107282109966036, + 3.172661132994108, + 3.2314263000153005, + 3.284861992986407, + 3.344656642002519, + 3.4059766019927338, + 3.4724265150143765, + 3.52957905898802, + 3.5802626140066423, + 3.6388625639956445, + 3.7017505699768662, + 3.761042719008401, + 3.8293845849693753, + 3.8995800699922256, + 3.9691849569790065, + 4.027466103958432, + 4.084342052985448, + 4.141191474976949, + 4.196551297965925, + 4.25399955699686, + 4.313320264976937, + 4.373357524978928, + 4.439613867958542, + 4.496690444007982, + 4.556503236992285, + 4.616797443013638, + 4.676230040960945, + 4.73148197500268, + 4.780107286002021, + 4.839581692009233, + 4.904180419980548, + 4.9627979539800435, + 5.017371561960317, + 5.066320748010185, + 5.11641007300932, + 5.164292272995226, + 5.215480551996734, + 5.26607668196084, + 5.323212377959862, + 5.379246702999808, + 5.438919336011168, + 5.499059795984067, + 5.556780954007991, + 5.615663514996413, + 5.674914622970391, + 5.732210400979966, + 5.787394782004412, + 5.8362213429645635, + 5.885615988983773, + 5.936013300961349, + 5.986580550961662, + 6.036050429975148, + 6.085596101998817, + 6.138985458004754, + 6.203471496002749, + 6.251961349975318, + 6.298681123007555, + 6.347680869977921, + 6.39570721500786, + 6.444865219003987, + 6.494251721014734, + 6.543939394992776, + 6.598561354971025, + 6.6472214179812, + 6.695489094010554, + 6.747841623960994, + 6.798242248012684, + 6.847644766967278, + 6.894963808998, + 6.94547000201419, + 7.002331760013476, + 7.062314618960954, + 7.119380827003624, + 7.17609880695818, + 7.2364854459883645, + 7.293135184969287, + 7.340312786982395 + ], + "chunk_gaps_ms": { + "count": 126, + "p50": 56.86885351315141, + "p95": 69.3192039616406, + "max": 76.44607196561992 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 36.48547234153056, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.1861425479874015, + "end_to_end_tps": 35.624119378441364, + "timing_valid": true, + "per_stream_tps": [ + 36.5 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19666211295407265, + "decode_tps": 36.48547234153056, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.7156320011323, + "prefill_tps": 162.7156320011323, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.40816921977253, + "round_gap_p50_ms": 60.23052497766912, + "round_gap_p95_ms": 76.89142000162974, + "tokens_per_chunk": 2.226086956521739, + "headers_s": 0.0010082179796881974, + "first_payload_s": 0.0010188099695369601, + "first_content_s": 0.19666211295407265, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19666211295407265, + "last_output_s": 7.185745263996068 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.40816921977253, + "round_gap_p50_ms": 60.23052497766912, + "round_gap_p95_ms": 76.89142000162974, + "round_gap_mean_ms": 61.307746938964875, + "tokens_per_chunk": 2.226086956521739, + "aggregate_prompt_ttft_tps": 162.7156320011323, + "aggregate_prefill_tps": 162.7156320011323 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395844.519187137, + "first": 395844.71584925, + "last": 395851.704932401, + "end": 395851.705329685, + "elapsed_s": 7.1861425479874015, + "chunk_offsets_s": [ + 0.19666211295407265, + 0.2656321299728006, + 0.3334897519671358, + 0.39837420999538153, + 0.45874521700898185, + 0.526762040972244, + 0.5917132199974731, + 0.6508457509917207, + 0.7180736869922839, + 0.781134991964791, + 0.8383904009824619, + 0.8939271699637175, + 0.9425275689573027, + 0.9982102749636397, + 1.0479129569721408, + 1.1057728679734282, + 1.161641015962232, + 1.210116325004492, + 1.260739751975052, + 1.3105815379531123, + 1.3714217660017312, + 1.4316522909794003, + 1.4947102039586753, + 1.5663909189752303, + 1.6415738909854554, + 1.7090971900033765, + 1.7744693799759261, + 1.836734677955974, + 1.902691353985574, + 1.965538703952916, + 2.01722759695258, + 2.079128425975796, + 2.138206284958869, + 2.2034006500034593, + 2.270259351003915, + 2.3423417969606817, + 2.414009216008708, + 2.4883347720024176, + 2.5644522809889168, + 2.639793334994465, + 2.723197472980246, + 2.7984088929952122, + 2.8760630569886416, + 2.9508344889618456, + 3.018850512977224, + 3.0833626319654286, + 3.1602540519670583, + 3.234002707002219, + 3.298101444961503, + 3.3583476189523935, + 3.4157669819542207, + 3.464472597988788, + 3.515409434970934, + 3.572061078972183, + 3.6228263619705103, + 3.68308447196614, + 3.749266078986693, + 3.807460904994514, + 3.867841175990179, + 3.93711004400393, + 4.014562797965482, + 4.083994850981981, + 4.144135775975883, + 4.222450681962073, + 4.302336498978548, + 4.361884777958039, + 4.420275701966602, + 4.475990617007483, + 4.533632253995165, + 4.594473329954781, + 4.654340491979383, + 4.715443025983404, + 4.778480538981967, + 4.833541878964752, + 4.890163042990025, + 4.947985432983842, + 5.004541523987427, + 5.0627697429736145, + 5.124689613003284, + 5.184231139952317, + 5.24485574895516, + 5.304833328991663, + 5.363115643966012, + 5.422204318980221, + 5.48414860496996, + 5.543161582958419, + 5.601832349959295, + 5.662947652977891, + 5.7251582609605975, + 5.774177719955333, + 5.82332092395518, + 5.872382495959755, + 5.92173861397896, + 5.971769811003469, + 6.021574412996415, + 6.072976214985829, + 6.132177594990935, + 6.188527987978887, + 6.241440971964039, + 6.298521930992138, + 6.354296526988037, + 6.403490386961494, + 6.462240866967477, + 6.5211978610022925, + 6.585138293972705, + 6.641714208992198, + 6.698546430969145, + 6.759502002969384, + 6.815371239965316, + 6.872151827963535, + 6.933327354956418, + 6.999927893979475, + 7.076189083978534, + 7.139867962978315, + 7.185745263996068 + ], + "chunk_gaps_ms": { + "count": 114, + "p50": 60.23834948427975, + "p95": 76.89142000162974, + "max": 83.40413798578084 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 35.96663766338866, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.285353297018446, + "end_to_end_tps": 35.138995950240165, + "timing_valid": true, + "per_stream_tps": [ + 36.0 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19530989200575277, + "decode_tps": 35.96663766338866, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 163.8421877733538, + "prefill_tps": 163.8421877733538, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.80354420001637, + "round_gap_p50_ms": 58.904000965412706, + "round_gap_p95_ms": 70.48862398369238, + "tokens_per_chunk": 2.1512605042016806, + "headers_s": 0.001323708042036742, + "first_payload_s": 0.0013288120389916003, + "first_content_s": 0.19530989200575277, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19530989200575277, + "last_output_s": 7.285213663009927 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.80354420001637, + "round_gap_p50_ms": 58.904000965412706, + "round_gap_p95_ms": 70.48862398369238, + "round_gap_mean_ms": 60.08393026274724, + "tokens_per_chunk": 2.1512605042016806, + "aggregate_prompt_ttft_tps": 163.8421877733538, + "aggregate_prefill_tps": 163.8421877733538 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395851.706128157, + "first": 395851.901438049, + "last": 395858.99134182, + "end": 395858.991481454, + "elapsed_s": 7.285353297018446, + "chunk_offsets_s": [ + 0.19530989200575277, + 0.26344846200663596, + 0.33186773699708283, + 0.39982636901549995, + 0.46645556401927024, + 0.5331385510507971, + 0.6009236770332791, + 0.6676948410458863, + 0.7351560760289431, + 0.7993728960282169, + 0.8629895500489511, + 0.9207572680315934, + 0.9737816770211793, + 1.0212269620387815, + 1.0716731700231321, + 1.1287744820001535, + 1.184217267029453, + 1.2325761590036564, + 1.283001376024913, + 1.3327547780354507, + 1.3974675700301304, + 1.4575492310104892, + 1.519957776996307, + 1.592443188012112, + 1.6671506680431776, + 1.734175451041665, + 1.8010319280438125, + 1.8719857720425352, + 1.9404288880177774, + 1.99713418004103, + 2.0449299000320025, + 2.096539880032651, + 2.1529770250199363, + 2.2107092550140806, + 2.267235650040675, + 2.32896132604219, + 2.389593808038626, + 2.45236074202694, + 2.5215532410074957, + 2.59290236904053, + 2.6633909930242226, + 2.729468263045419, + 2.7883722640108317, + 2.845933052012697, + 2.9037957480177283, + 2.9629121030448005, + 3.017477903049439, + 3.08024037303403, + 3.1457307890523225, + 3.204463444999419, + 3.2580369469942525, + 3.3180035030236468, + 3.3769474400323816, + 3.4374715849990025, + 3.496449747006409, + 3.5549282880383544, + 3.613399918016512, + 3.6733408410218544, + 3.730479561025277, + 3.7893165060086176, + 3.8468284780392423, + 3.90485944703687, + 3.9631860670051537, + 4.021787489007693, + 4.0850704600452445, + 4.140478108020034, + 4.1975461399997585, + 4.256458749994636, + 4.314826826041099, + 4.37032345100306, + 4.4308156270417385, + 4.492639176023658, + 4.560932899010368, + 4.621114049048629, + 4.678194497013465, + 4.733389839006122, + 4.789497382007539, + 4.847545359050855, + 4.904558190028183, + 4.964433305023704, + 5.03249070502352, + 5.090985567017924, + 5.147206598019693, + 5.2066717889974825, + 5.26310005504638, + 5.322023432003334, + 5.382221174018923, + 5.442658134037629, + 5.508712300041225, + 5.5677922230097465, + 5.625516645028256, + 5.68200395104941, + 5.740376668050885, + 5.795258135010954, + 5.851480190001894, + 5.91062233800767, + 5.977141292009037, + 6.035549545020331, + 6.094182647997513, + 6.151963358046487, + 6.208949117048178, + 6.271057837002445, + 6.3355253000045195, + 6.406901420035865, + 6.476976904028561, + 6.529916447994765, + 6.58413739700336, + 6.6398831130354665, + 6.700298039999325, + 6.766494527051691, + 6.826395562035032, + 6.884152305021416, + 6.94925622100709, + 7.007552249007858, + 7.0639636820415035, + 7.121082227036823, + 7.181582916004118, + 7.238374656997621, + 7.285213663009927 + ], + "chunk_gaps_ms": { + "count": 118, + "p50": 58.90830548014492, + "p95": 70.48862398369238, + "max": 74.70748003106564 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 58.4, + "per_stream_tps": 29.2, + "ttft_s_max": 0.39, + "request": { + "ttft_s": 0.292, + "decode_tps": 29.22, + "prompt_ttft_tps": 122.398, + "prefill_tps": 122.398, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.223, + "round_gap_p50_ms": 77.499, + "round_gap_p95_ms": 82.356, + "tokens_per_chunk": 2.306, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.292, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.292, + "last_output_s": 8.922 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 164.881, + "aggregate_prefill_tps": 164.881, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.847, + "round_gap_p50_ms": 77.502, + "round_gap_p95_ms": 82.228, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 57.3779268050594, + "makespan_s": 8.923292083025444, + "steady_tps": 59.6, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 56.54064518294962, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 9.21742533199722, + "end_to_end_tps": 55.546964749760605, + "timing_valid": true, + "steady_tps": 57.65229108539874, + "per_stream_tps": [ + 28.9, + 28.3 + ], + "ttft_s": [ + 0.39, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.3880577789968811, + "decode_tps": 28.882554290961178, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.46194698820145, + "prefill_tps": 82.46194698820145, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.62297655276808, + "round_gap_p50_ms": 77.57205195957795, + "round_gap_p95_ms": 99.9965540249832, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0013866529916413128, + "first_payload_s": 0.0013908770051784813, + "first_content_s": 0.3880577789968811, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3880577789968811, + "last_output_s": 9.216916799952742 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19695899699581787, + "decode_tps": 28.27090220377504, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.47036433009188, + "prefill_tps": 162.47036433009188, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 35.37205826655469, + "round_gap_p50_ms": 77.57280301302671, + "round_gap_p95_ms": 100.6321280146949, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0012734519550576806, + "first_payload_s": 0.00128266797401011, + "first_content_s": 0.19695899699581787, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19695899699581787, + "last_output_s": 9.216833854967263 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.997517409661384, + "round_gap_p50_ms": 77.57280301302671, + "round_gap_p95_ms": 100.00495304120705, + "round_gap_mean_ms": 81.13060854057866, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.880561912435, + "aggregate_prefill_tps": 164.880561912435 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395858.992558184, + "first": 395859.380615963, + "last": 395868.209474984, + "end": 395868.209881531, + "elapsed_s": 9.217323346994817, + "chunk_offsets_s": [ + 0.3880577789968811, + 0.4669271379825659, + 0.5448655929649249, + 0.6231553149991669, + 0.6995596119668335, + 0.7766893549705856, + 0.8541246529784985, + 0.9336251229979098, + 1.011304390965961, + 1.0870227929553948, + 1.1642473209649324, + 1.2451309239841066, + 1.322071912989486, + 1.3991894809878431, + 1.4769047809531912, + 1.5535210800007917, + 1.6320167880039662, + 1.7084663650020957, + 1.7911185279954225, + 1.8730091970064677, + 1.9500087469932623, + 2.022178618994076, + 2.1019854759797454, + 2.182180879986845, + 2.2598238280043006, + 2.337707019003574, + 2.41952587896958, + 2.495334504987113, + 2.5725529209594242, + 2.650697297998704, + 2.7252241050009616, + 2.8022268069908023, + 2.8776977179804817, + 2.9536796269821934, + 3.036078571982216, + 3.1185547499917448, + 3.2126005589962006, + 3.3124613509862684, + 3.4120357079664245, + 3.5118164669838734, + 3.60768667695811, + 3.7076832309830934, + 3.8116515819565393, + 3.9060977139743045, + 4.010679798957426, + 4.111385542957578, + 4.209712496958673, + 4.305421872995794, + 4.406252881977707, + 4.513794467959087, + 4.601372838951647, + 4.68071908300044, + 4.75730149296578, + 4.833916592004243, + 4.915998173994012, + 4.99357022595359, + 5.071843579993583, + 5.150557641987689, + 5.227071267960127, + 5.305093371949624, + 5.38073881296441, + 5.455663782951888, + 5.531639003951568, + 5.607162331987638, + 5.6852144039585255, + 5.761735181964468, + 5.836942314985208, + 5.913216097978875, + 5.993031114980113, + 6.074062206957024, + 6.152735068986658, + 6.227423125994392, + 6.301752729981672, + 6.378530165995471, + 6.455265457974747, + 6.530543711967766, + 6.607952625956386, + 6.689147815981414, + 6.767507266951725, + 6.849456816969905, + 6.926238524960354, + 7.001973102975171, + 7.083643033984117, + 7.161132027977146, + 7.238835664989892, + 7.317162539984565, + 7.394899920967873, + 7.470767588994931, + 7.544516627967823, + 7.620176822005305, + 7.695758693967946, + 7.770997971994802, + 7.850110405997839, + 7.9284360649762675, + 8.003985280985944, + 8.081267361994833, + 8.155310515954625, + 8.228685103997122, + 8.305646381981205, + 8.384244714980014, + 8.458854050957598, + 8.533535114955157, + 8.607052871957421, + 8.685953671985772, + 8.768603387987241, + 8.844016827992164, + 8.919527132005896, + 8.99624759098515, + 9.07230246096151, + 9.153874597977847, + 9.216916799952742 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.60749998851679, + "p95": 99.9965540249832, + "max": 107.5415859813802 + } + }, + { + "start": 395858.992456199, + "first": 395859.189415196, + "last": 395868.209290054, + "end": 395868.209509368, + "elapsed_s": 9.217053168977145, + "chunk_offsets_s": [ + 0.19695899699581787, + 0.4668720499612391, + 0.5448425049544312, + 0.6230887709534727, + 0.6995029390091076, + 0.7766166019719094, + 0.8540843490045518, + 0.9336116510094143, + 1.0112809669808485, + 1.0869849369628355, + 1.1642056729760952, + 1.2450877240044065, + 1.3220134009607136, + 1.3991381679661572, + 1.4768411169643514, + 1.5534688549814746, + 1.6319424989633262, + 1.7084378199651837, + 1.7910585919744335, + 1.872938651998993, + 1.9499846829567105, + 2.0221574989845976, + 2.1019357789773494, + 2.1821416639722884, + 2.259780147986021, + 2.337674139009323, + 2.419494629953988, + 2.495313672989141, + 2.572514056984801, + 2.650632801989559, + 2.725187112984713, + 2.8021868389914744, + 2.877659589983523, + 2.953619401960168, + 3.036069452005904, + 3.118509773979895, + 3.212518301967066, + 3.3124133339733817, + 3.4119575629592873, + 3.511798754974734, + 3.607628372963518, + 3.707633326004725, + 3.811627582006622, + 3.9060264179715887, + 4.010603189992253, + 4.111235318006948, + 4.209645071998239, + 4.305404656974133, + 4.406213665963151, + 4.5137526909820735, + 4.6012417009915225, + 4.680681755009573, + 4.757261684979312, + 4.833842606982216, + 4.915963005973026, + 4.993535808986053, + 5.07178517896682, + 5.150519225979224, + 5.22700656298548, + 5.305037131009158, + 5.380686221003998, + 5.455613206955604, + 5.5316126679535955, + 5.607125099981204, + 5.685150994977448, + 5.761687052960042, + 5.836918713990599, + 5.913167456979863, + 5.99297437799396, + 6.0740240149898455, + 6.152693980955519, + 6.227396452974062, + 6.301699753967114, + 6.378489030001219, + 6.455188833002467, + 6.5304631349863485, + 6.607914385967888, + 6.689120055991225, + 6.767455074994359, + 6.849407231959049, + 6.926201947964728, + 7.001818828983232, + 7.083510967961047, + 7.16105209197849, + 7.238806496956386, + 7.317117755999789, + 7.394890816998668, + 7.470772804983426, + 7.544527763966471, + 7.6201814619707875, + 7.695758053974714, + 7.770997732004616, + 7.850081301992759, + 7.928388175962027, + 8.003992720972747, + 8.0812700339593, + 8.155263427994214, + 8.228632238984574, + 8.30560958199203, + 8.38424177095294, + 8.458804545982275, + 8.533531786990352, + 8.607020903960802, + 8.685957831970882, + 8.768603259988595, + 8.844022187986411, + 8.919521899952088, + 8.996247862989549, + 9.07226017198991, + 9.153818245977163, + 9.216833854967263 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.60564351337962, + "p95": 100.6321280146949, + "max": 269.91305296542123 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 58.452904449748175, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.923232169996481, + "end_to_end_tps": 57.378312056202155, + "timing_valid": true, + "steady_tps": 59.637975483813904, + "per_stream_tps": [ + 29.2, + 29.9 + ], + "ttft_s": [ + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19726832903688774, + "decode_tps": 29.226452224874087, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.2155981967903, + "prefill_tps": 162.2155981967903, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.215579513579094, + "round_gap_p50_ms": 77.49273994704708, + "round_gap_p95_ms": 82.49955403152853, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014320940244942904, + "first_payload_s": 0.0014363020309247077, + "first_content_s": 0.19726832903688774, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19726832903688774, + "last_output_s": 8.922241104999557 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.38750569499097764, + "decode_tps": 29.87796517019395, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.5794315119551, + "prefill_tps": 82.5794315119551, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.46948141560835, + "round_gap_p50_ms": 77.5059080333449, + "round_gap_p95_ms": 82.21206400776282, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0013126690173521638, + "first_payload_s": 0.0013185570132918656, + "first_content_s": 0.38750569499097764, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38750569499097764, + "last_output_s": 8.922223455971107 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.84253046459372, + "round_gap_p50_ms": 77.50209898222238, + "round_gap_p95_ms": 82.22803199896589, + "round_gap_mean_ms": 78.45313880428544, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 165.1588630239102, + "aggregate_prefill_tps": 165.1588630239102 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395868.210782228, + "first": 395868.408050557, + "last": 395877.133023333, + "end": 395877.133905133, + "elapsed_s": 8.923122905020136, + "chunk_offsets_s": [ + 0.19726832903688774, + 0.4666042900062166, + 0.5443965840386227, + 0.6227862430387177, + 0.698961082031019, + 0.7762838350026868, + 0.856858651037328, + 0.9359116770210676, + 1.0138398770359345, + 1.0890727700316347, + 1.165252233040519, + 1.2460777070373297, + 1.3222709300462157, + 1.4002440260373987, + 1.4772867280407809, + 1.5541237010038458, + 1.6312350610387512, + 1.7070849680458196, + 1.7882775500183925, + 1.8701461870223284, + 1.9476311500184238, + 2.0201796980109066, + 2.1006800979957916, + 2.18077475001337, + 2.2582788970321417, + 2.3352879030280747, + 2.4186092740274034, + 2.4944427650189027, + 2.572653319046367, + 2.650327756011393, + 2.7249951240373775, + 2.8016036310000345, + 2.87701721402118, + 2.9538228750461712, + 3.035714760015253, + 3.1182143140467815, + 3.2007369580096565, + 3.278776613995433, + 3.3551994709996507, + 3.4348892390262336, + 3.511232974997256, + 3.589903629035689, + 3.6698842479963787, + 3.7434277340071276, + 3.8230391649995, + 3.9034984770114534, + 3.980364329996519, + 4.056061884039082, + 4.135455873038154, + 4.213855645037256, + 4.29150481702527, + 4.369188998010941, + 4.446358887013048, + 4.522444316011388, + 4.605281185999047, + 4.6836167180445045, + 4.761391299020033, + 4.839353499002755, + 4.916316504997667, + 4.994366130034905, + 5.069806273037102, + 5.1445752260042354, + 5.220663568004966, + 5.296507460006978, + 5.375386628031265, + 5.45286597503582, + 5.527236989000812, + 5.604589487018529, + 5.685793269018177, + 5.766842362005264, + 5.845097845012788, + 5.920747446012683, + 5.991785916034132, + 6.068769402045291, + 6.146262141992338, + 6.224753385991789, + 6.302373887039721, + 6.382641853007954, + 6.461797056021169, + 6.543561660044361, + 6.621238865016494, + 6.694834607013036, + 6.7771886240225285, + 6.854425201017875, + 6.934035001031589, + 7.0144518640008755, + 7.093517834029626, + 7.17004520399496, + 7.243972885014955, + 7.319196051044855, + 7.395020358031616, + 7.470990347035695, + 7.549968957027886, + 7.629641445004381, + 7.705331399047282, + 7.782828586001415, + 7.856386344006751, + 7.930671437003184, + 8.0075962980045, + 8.086498746997677, + 8.161543895024806, + 8.236451698001474, + 8.310527716006618, + 8.389575719018467, + 8.472656543017365, + 8.547595866024494, + 8.624242149002384, + 8.700415052007884, + 8.777551324048545, + 8.858864884008653, + 8.922241104999557 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.49496345059015, + "p95": 82.49955403152853, + "max": 269.3359609693289 + } + }, + { + "start": 395868.210672963, + "first": 395868.598178658, + "last": 395877.132896419, + "end": 395877.133280055, + "elapsed_s": 8.922607092012186, + "chunk_offsets_s": [ + 0.38750569499097764, + 0.4668220679741353, + 0.5446125859743915, + 0.6228152349940501, + 0.6992032760172151, + 0.7765033249743283, + 0.8570729569764808, + 0.9361484639812261, + 1.0140828709700145, + 1.0892750120256096, + 1.1654965549823828, + 1.246102107979823, + 1.3225059719989076, + 1.400496540009044, + 1.477506234019529, + 1.55435083899647, + 1.6315222309785895, + 1.7073986349860206, + 1.788185324985534, + 1.870359644992277, + 1.9478617439744994, + 2.0203999080113135, + 2.1008891399833374, + 2.181078849011101, + 2.2582749929861166, + 2.335493953025434, + 2.4188182199723087, + 2.4946596149820834, + 2.57286048901733, + 2.650542653980665, + 2.7249227869906463, + 2.801603758998681, + 2.8772248799796216, + 2.954046988976188, + 3.0359774180105887, + 3.1181894820183516, + 3.200725037022494, + 3.2790120560093783, + 3.3552035830216482, + 3.4350861529819667, + 3.511437601002399, + 3.5901778240222484, + 3.6699154329835437, + 3.743372228986118, + 3.8232763669802807, + 3.903831231989898, + 3.9805966679705307, + 4.056014794972725, + 4.135371408017818, + 4.213772939983755, + 4.291541618003976, + 4.369202582980506, + 4.446367143013049, + 4.522488028975204, + 4.605310979008209, + 4.683554925024509, + 4.761377618997358, + 4.839397147006821, + 4.916217176010832, + 4.994247168011498, + 5.069752784969751, + 5.144574793986976, + 5.220919378974941, + 5.29680523899151, + 5.375675446994137, + 5.452766005997546, + 5.527236652967986, + 5.604852641001344, + 5.685963990981691, + 5.766848394006956, + 5.845273894025013, + 5.920924871985335, + 5.991781627992168, + 6.0687731460202485, + 6.146432542998809, + 6.224739593977574, + 6.302552944980562, + 6.382819582009688, + 6.461975137004629, + 6.543737708998378, + 6.621414193999954, + 6.694870414969046, + 6.777098446968012, + 6.8546043550013565, + 6.934024551999755, + 7.014344182971399, + 7.093699547986034, + 7.1702298619784415, + 7.243946005008183, + 7.319378532993142, + 7.395014838024508, + 7.471169501019176, + 7.550143870001193, + 7.629826134012546, + 7.7055129039799795, + 7.783004971977789, + 7.856414199981373, + 7.930946991022211, + 8.007591722009238, + 8.086421097978018, + 8.161808473989367, + 8.236416849016678, + 8.310807735018898, + 8.389500454009976, + 8.472645166970324, + 8.54779330798192, + 8.624496679985896, + 8.700431643985212, + 8.777726541971788, + 8.858783954987302, + 8.922223455971107 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.56094803335145, + "p95": 82.21206400776282, + "max": 83.32426694687456 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 58.42657670898866, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.923292083025444, + "end_to_end_tps": 57.3779268050594, + "timing_valid": true, + "steady_tps": 59.65085134444649, + "per_stream_tps": [ + 29.9, + 29.2 + ], + "ttft_s": [ + 0.39, + 0.19 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.38948411599267274, + "decode_tps": 29.88391711227977, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.15996156465083, + "prefill_tps": 82.15996156465083, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.462815341201846, + "round_gap_p50_ms": 77.40176195511594, + "round_gap_p95_ms": 81.61204302450642, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0009489530348218977, + "first_payload_s": 0.0009548410307615995, + "first_content_s": 0.38948411599267274, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38948411599267274, + "last_output_s": 8.922502027999144 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.1936865359894, + "decode_tps": 29.213764943209405, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 165.2154076510062, + "prefill_tps": 165.2154076510062, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 34.230439039403755, + "round_gap_p50_ms": 77.38833798794076, + "round_gap_p95_ms": 81.74388500628993, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0008630650117993355, + "first_payload_s": 0.0008659290033392608, + "first_content_s": 0.1936865359894, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1936865359894, + "last_output_s": 8.922448491037358 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.846627190302804, + "round_gap_p50_ms": 77.40176195511594, + "round_gap_p95_ms": 81.69129199814051, + "round_gap_mean_ms": 78.46263575933831, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 164.28244032129444, + "aggregate_prefill_tps": 164.28244032129444 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395877.134759061, + "first": 395877.524243177, + "last": 395886.057261089, + "end": 395886.057962279, + "elapsed_s": 8.923203218029812, + "chunk_offsets_s": [ + 0.38948411599267274, + 0.46839776501292363, + 0.5461074670311064, + 0.6227597660035826, + 0.6997741010272875, + 0.7769451889907941, + 0.853360302047804, + 0.9302786519983783, + 1.009176573017612, + 1.0854008840397, + 1.164175364014227, + 1.244644963007886, + 1.32007648301078, + 1.3975317820440978, + 1.4744904530234635, + 1.5517285490059294, + 1.6281883190385997, + 1.7046126800123602, + 1.7857150860363618, + 1.8672798160114326, + 1.9439001150312833, + 2.0167621549917385, + 2.0964491550112143, + 2.176080219040159, + 2.253719792002812, + 2.330604637041688, + 2.4120567270438187, + 2.488436334999278, + 2.566673946043011, + 2.64412692503538, + 2.719179689011071, + 2.7955204500467516, + 2.870412764023058, + 2.946647812030278, + 3.0296706040389836, + 3.1116594340419397, + 3.191863080020994, + 3.270217011042405, + 3.34695830399869, + 3.4281840870389715, + 3.5060257100267336, + 3.583543217042461, + 3.6643601480172947, + 3.738111571990885, + 3.819126360991504, + 3.897145890048705, + 3.974547652003821, + 4.050980814034119, + 4.1303638750105165, + 4.211975918035023, + 4.2898116370197386, + 4.369207323004957, + 4.446708990028128, + 4.524105345015414, + 4.606304881046526, + 4.685378676047549, + 4.763356300012674, + 4.841902442043647, + 4.91863763803849, + 4.996895841031801, + 5.072659444005694, + 5.148960796010215, + 5.225636087998282, + 5.301051623013336, + 5.378805325017311, + 5.455435673007742, + 5.5307158950017765, + 5.6089184660231695, + 5.689856646000408, + 5.771547937998548, + 5.85058166802628, + 5.92528572503943, + 5.997032858023886, + 6.074000263994094, + 6.151238137041219, + 6.227660914999433, + 6.306169456045609, + 6.386091210995801, + 6.4668880620156415, + 6.5477227690280415, + 6.624537710042205, + 6.699226727010682, + 6.780014026036952, + 6.857253883033991, + 6.9357149680145085, + 7.014678634004667, + 7.092275695002172, + 7.169251469022129, + 7.245486101019196, + 7.320966229017358, + 7.396354933036491, + 7.471964311029296, + 7.5516318550216965, + 7.63058668904705, + 7.7068804409937, + 7.784507550008129, + 7.8580666680354625, + 7.931580409000162, + 8.009152846003417, + 8.088076654996257, + 8.163561712019145, + 8.238506059045903, + 8.312446413037833, + 8.391020603012294, + 8.473284092033282, + 8.549373649992049, + 8.624966772040352, + 8.701976915006526, + 8.778626703016926, + 8.859414978011046, + 8.922502027999144 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.42737047374249, + "p95": 81.61204302450642, + "max": 83.02279200870544 + } + }, + { + "start": 395877.134670196, + "first": 395877.328356732, + "last": 395886.057118687, + "end": 395886.057302897, + "elapsed_s": 8.922632700996473, + "chunk_offsets_s": [ + 0.1936865359894, + 0.46827926801051944, + 0.5461401870124973, + 0.6227945820428431, + 0.6998108050320297, + 0.7769837169907987, + 0.8533387500210665, + 0.9303085079882294, + 1.0092130689881742, + 1.0854148840298876, + 1.164159300038591, + 1.2446721800370142, + 1.320117844035849, + 1.3975061820237897, + 1.4745223729987629, + 1.5517706139944494, + 1.6281937430030666, + 1.704649897001218, + 1.7857420790242031, + 1.8674490500125103, + 1.9440433490090072, + 2.0168052430381067, + 2.0970235930290073, + 2.17634079803247, + 2.2540072349947877, + 2.3305983330355957, + 2.412092103040777, + 2.4884680160321295, + 2.566710810002405, + 2.644697651034221, + 2.719747567025479, + 2.7960245659924112, + 2.870696463040076, + 2.946864805999212, + 3.029601899033878, + 3.111568201042246, + 3.1917993029928766, + 3.270150210999418, + 3.3468760150135495, + 3.4282063750433736, + 3.50605159800034, + 3.5835633770329878, + 3.6643814929993823, + 3.738051508029457, + 3.8190670490148477, + 3.8970782090327702, + 3.9745483890292235, + 4.051003822009079, + 4.130369891994633, + 4.211925166018773, + 4.289678900036961, + 4.36918754701037, + 4.4467179020284675, + 4.523996656003874, + 4.606312240997795, + 4.685269699024502, + 4.763611631002277, + 4.841807465010788, + 4.918656566005666, + 4.997050689999014, + 5.072946711035911, + 5.148947756038979, + 5.225573798990808, + 5.300981206994038, + 5.378961390990298, + 5.455454857030418, + 5.530737944005523, + 5.60893563402351, + 5.6897938449983485, + 5.771537730004638, + 5.850576020020526, + 5.925299005000852, + 5.997056505992077, + 6.0739022310008295, + 6.151226713031065, + 6.227655491034966, + 6.306158719991799, + 6.386112426989712, + 6.4671457600197755, + 6.54773973004194, + 6.624541119032074, + 6.699243896000553, + 6.7800395310041495, + 6.857271468034014, + 6.9356288079870865, + 7.014580361021217, + 7.0922119180322625, + 7.169233101012651, + 7.245662295026705, + 7.320948261010926, + 7.396512551000342, + 7.4719474950106815, + 7.551564782042988, + 7.6305959690362215, + 7.706816392019391, + 7.784440765040927, + 7.858080843987409, + 7.931480024999473, + 8.00909089302877, + 8.088058046996593, + 8.163499502988998, + 8.238502123043872, + 8.312445501040202, + 8.391296669025905, + 8.473264972039033, + 8.549578275997192, + 8.624995268008206, + 8.701994739007205, + 8.778933458030224, + 8.859352305007633, + 8.922448491037358 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 77.42925899219699, + "p95": 81.74388500628993, + "max": 274.59273202111945 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 0.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.7, + "per_stream_tps": 22.8, + "ttft_s_max": 0.77, + "request": { + "ttft_s": 0.483, + "decode_tps": 22.807, + "prompt_ttft_tps": 68.885, + "prefill_tps": 68.885, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.847, + "round_gap_p50_ms": 98.094, + "round_gap_p95_ms": 103.406, + "tokens_per_chunk": 2.306, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.483, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.483, + "last_output_s": 11.56 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 166.466, + "aggregate_prefill_tps": 166.466, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.446, + "round_gap_p50_ms": 98.148, + "round_gap_p95_ms": 103.466, + "tokens_per_chunk": 2.306 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 88.56664665642707, + "makespan_s": 11.561914542980958, + "steady_tps": 94.1, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 86.69458032457888, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.962866784015205, + "end_to_end_tps": 85.59821140600428, + "timing_valid": true, + "steady_tps": 90.73216919007872, + "per_stream_tps": [ + 22.4, + 22.0, + 22.8, + 21.7 + ], + "ttft_s": [ + 0.58, + 0.39, + 0.77, + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.582953531993553, + "decode_tps": 22.41053507175931, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.892882955127014, + "prefill_tps": 54.892882955127014, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.621870776309684, + "round_gap_p50_ms": 98.9363850094378, + "round_gap_p95_ms": 125.90420997003093, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002527399978134781, + "first_payload_s": 0.0025302639696747065, + "first_content_s": 0.582953531993553, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.582953531993553, + "last_output_s": 11.961530579952523 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3891328820027411, + "decode_tps": 22.034532833816222, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.23411970560377, + "prefill_tps": 82.23411970560377, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.38330844324995, + "round_gap_p50_ms": 99.04294600710273, + "round_gap_p95_ms": 125.9132350096479, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018225450185127556, + "first_payload_s": 0.0018258250202052295, + "first_content_s": 0.3891328820027411, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3891328820027411, + "last_output_s": 11.961876535031479 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7739969239919446, + "decode_tps": 22.793909596564003, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.343833558094396, + "prefill_tps": 41.343833558094396, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.871368172432426, + "round_gap_p50_ms": 98.97787304362282, + "round_gap_p95_ms": 124.15713700465858, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.002262356982100755, + "first_payload_s": 0.0022656539804302156, + "first_content_s": 0.7739969239919446, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7739969239919446, + "last_output_s": 11.961195807962213 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19672954198904335, + "decode_tps": 21.675694998134855, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.6598612311221, + "prefill_tps": 162.6598612311221, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 46.13462221562205, + "round_gap_p50_ms": 98.91985694412142, + "round_gap_p95_ms": 125.93518703943118, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018233609735034406, + "first_payload_s": 0.0018253930029459298, + "first_content_s": 0.19672954198904335, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19672954198904335, + "last_output_s": 11.961058206972666 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 45.00279240190353, + "round_gap_p50_ms": 98.97787304362282, + "round_gap_p95_ms": 125.90420997003093, + "round_gap_mean_ms": 104.32465511350364, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 165.265971918144, + "aggregate_prefill_tps": 165.265971918144 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395886.060106492, + "first": 395886.643060024, + "last": 395898.021637072, + "end": 395898.022878459, + "elapsed_s": 11.962771966995206, + "chunk_offsets_s": [ + 0.582953531993553, + 0.8731667829561047, + 0.9715407619951293, + 1.070788876968436, + 1.1678063469589688, + 1.2673376489547081, + 1.367389485007152, + 1.464826222974807, + 1.5649627469829284, + 1.660484297957737, + 1.7575139770051464, + 1.8576840049936436, + 1.954157709958963, + 2.0520574919646606, + 2.1515590180060826, + 2.249305615958292, + 2.3472495589521714, + 2.44455186300911, + 2.546312626975123, + 2.6505687899771146, + 2.7485446209902875, + 2.8418091599596664, + 2.9420732529833913, + 3.0429280399694107, + 3.1417253830004483, + 3.2401488989708014, + 3.3437778399675153, + 3.44048589898739, + 3.538225775992032, + 3.6409467890043743, + 3.7379221149603836, + 3.8368584999698214, + 3.9324660999700427, + 4.0292487039696425, + 4.132517177960835, + 4.235307983995881, + 4.334519250958692, + 4.436116396973375, + 4.531573531974573, + 4.632508623995818, + 4.7419560049893335, + 4.8546575930085965, + 4.967753664997872, + 5.077913596993312, + 5.199178098002449, + 5.298115170968231, + 5.397140003973618, + 5.493560188973788, + 5.593424582970329, + 5.6922576379729435, + 5.790556704974733, + 5.889601489994675, + 5.986627776990645, + 6.084449207002763, + 6.1881110449903645, + 6.2879174539702944, + 6.387134432967287, + 6.4868755939533, + 6.584725839958992, + 6.685196559003089, + 6.783515946008265, + 6.8805167760001495, + 6.97806153196143, + 7.0750614979770035, + 7.173535925976466, + 7.271733759960625, + 7.366439863981213, + 7.4682438599993475, + 7.570389379980043, + 7.67364745400846, + 7.7736246479908, + 7.869655068963766, + 7.961301609000657, + 8.059613970981445, + 8.157523002009839, + 8.25449906400172, + 8.352706514007878, + 8.453417491982691, + 8.551876671961509, + 8.653853325988166, + 8.752482123964, + 8.846535293967463, + 8.948602316959295, + 9.046094735967927, + 9.146772368985694, + 9.246009188995231, + 9.34410842997022, + 9.440967882983387, + 9.534700777963735, + 9.630691678961739, + 9.727079910982866, + 9.82520179200219, + 9.939291889953893, + 10.066706451005302, + 10.192610660975333, + 10.31678735098103, + 10.438549490005244, + 10.561626809008885, + 10.68934206099948, + 10.818539390980732, + 10.939937527000438, + 11.062617881980259, + 11.191835835983511, + 11.298658952990081, + 11.402986876957584, + 11.498430700972676, + 11.595205064979382, + 11.691551424970385, + 11.789556136995088, + 11.89082278398564, + 11.961530579952523 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.93672898760997, + "p95": 125.90420997003093, + "max": 290.2132509625517 + } + }, + { + "start": 395886.06030603, + "first": 395886.449438912, + "last": 395898.022182565, + "end": 395898.02230231, + "elapsed_s": 11.961996280006133, + "chunk_offsets_s": [ + 0.3891328820027411, + 0.8727832750300877, + 0.9711047730525024, + 1.0705288750468753, + 1.1676935940049589, + 1.2669273250503466, + 1.3671091940486804, + 1.464550524018705, + 1.5644848060328513, + 1.6602274320321158, + 1.7572255420382135, + 1.8573528820415959, + 1.9540604930371046, + 2.0516613610088825, + 2.15129202400567, + 2.2489045400288887, + 2.346980964008253, + 2.4441702120238915, + 2.546258418005891, + 2.6501637939945795, + 2.748507533047814, + 2.841788488032762, + 2.9417406740249135, + 3.0423933310084976, + 3.1418503600289114, + 3.240033458045218, + 3.3434940130100586, + 3.440459803037811, + 3.5381172470515594, + 3.6410076380125247, + 3.737638096034061, + 3.836902004026342, + 3.9324383080238476, + 4.029220656026155, + 4.132117542030755, + 4.23521851102123, + 4.3345202910131775, + 4.435360390052665, + 4.531577484041918, + 4.6324629750452, + 4.741678354039323, + 4.854613720031921, + 4.9678680340293795, + 5.077305847022217, + 5.198817151016556, + 5.298115123005118, + 5.397158069012221, + 5.49359305301914, + 5.593370694026817, + 5.692154501040932, + 5.790668338013347, + 5.889497393043712, + 5.9866795529960655, + 6.084393733995967, + 6.188050099997781, + 6.287835693045054, + 6.387068080017343, + 6.486312772030942, + 6.584654255013447, + 6.685056654037908, + 6.783397609018721, + 6.88023842102848, + 6.977928122039884, + 7.074943369021639, + 7.173268979997374, + 7.271720960037783, + 7.36631989502348, + 7.468420870020054, + 7.570371811045334, + 7.6736420940142125, + 7.773234196996782, + 7.869647053012159, + 7.960730787017383, + 8.059592707024422, + 8.157591979019344, + 8.254480936040636, + 8.35272598604206, + 8.452987392025534, + 8.551881040039007, + 8.653507067007013, + 8.752220745023806, + 8.8465716940118, + 8.948635789041873, + 9.046023311035242, + 9.146766945021227, + 9.24612144601997, + 9.344055357039906, + 9.440899306035135, + 9.534590360999573, + 9.630574141046964, + 9.726967702037655, + 9.825249233050272, + 9.939382403041236, + 10.066682242031675, + 10.192595477041323, + 10.316773815022316, + 10.438262191019021, + 10.561156869051047, + 10.689307693042792, + 10.818501887028106, + 10.939559939026367, + 11.062579642049968, + 11.191385368001647, + 11.29833384504309, + 11.402945373032708, + 11.498415100038983, + 11.594841781014111, + 11.69153200101573, + 11.789505129039753, + 11.890810751996469, + 11.961876535031479 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.13766648969613, + "p95": 125.9132350096479, + "max": 483.6503930273466 + } + }, + { + "start": 395886.060523856, + "first": 395886.83452078, + "last": 395898.021719664, + "end": 395898.021798577, + "elapsed_s": 11.961274720961228, + "chunk_offsets_s": [ + 0.7739969239919446, + 0.8726751619833522, + 0.9710756209678948, + 1.070110518950969, + 1.1673319109831937, + 1.266778027988039, + 1.367166265961714, + 1.4644893229706213, + 1.564351524983067, + 1.6598590759676881, + 1.757342102995608, + 1.857335313980002, + 1.9536792089929804, + 2.0512745889718644, + 2.151017828960903, + 2.2488406029879116, + 2.346905842947308, + 2.443895840959158, + 2.5461037769564427, + 2.6500104169826955, + 2.7483746520010754, + 2.8416509819799103, + 2.9420138119603507, + 3.0424175069783814, + 3.141468516958412, + 3.2398883999558166, + 3.3431959789595567, + 3.4403226019931026, + 3.538177503971383, + 3.6407183869741857, + 3.7376657279673964, + 3.836756770964712, + 3.932147184968926, + 4.028774587961379, + 4.132022309000604, + 4.234791547001805, + 4.334408353955951, + 4.435500758991111, + 4.53121226496296, + 4.632309565960895, + 4.741606594005134, + 4.854472438979428, + 4.96750346996123, + 5.077277429983951, + 5.198823838960379, + 5.297754655999597, + 5.396882145956624, + 5.493264297954738, + 5.5930973629583605, + 5.691686160978861, + 5.7902941419743, + 5.889343183953315, + 5.9863396939472295, + 6.0841119879623875, + 6.187768560950644, + 6.287811772956047, + 6.38678964599967, + 6.486296915973071, + 6.5843772609950975, + 6.684629658004269, + 6.783263880002778, + 6.879938530968502, + 6.977580070961267, + 7.074807142955251, + 7.1732085309922695, + 7.2716502549592406, + 7.366182853991631, + 7.468269924982451, + 7.569823661993723, + 7.673039719986264, + 7.773413493996486, + 7.869522683962714, + 7.960710802988615, + 8.059500642004423, + 8.157296151970513, + 8.254342567001004, + 8.35257513698889, + 8.452850286965258, + 8.552256291965023, + 8.653191303950734, + 8.751944198971614, + 8.846275835996494, + 8.948301049997099, + 9.045746332965791, + 9.146453805966303, + 9.245747585955542, + 9.343760873947758, + 9.440618551976513, + 9.534456103981938, + 9.63044069998432, + 9.726830932951998, + 9.824897740967572, + 9.939070415974129, + 10.06654329696903, + 10.192456435994245, + 10.316613572998904, + 10.437927355989814, + 10.560821009974461, + 10.689269900962245, + 10.818440029979683, + 10.939657571958378, + 11.062043828947935, + 11.191496824962087, + 11.297927954001352, + 11.402814282977488, + 11.498264442954678, + 11.5948598299874, + 11.691412127984222, + 11.789348374994006, + 11.890652926987968, + 11.961195807962213 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 99.0063855133485, + "p95": 124.15713700465858, + "max": 129.45299601415172 + } + }, + { + "start": 395886.060011675, + "first": 395886.256741217, + "last": 395898.021069882, + "end": 395898.021194331, + "elapsed_s": 11.961182655999437, + "chunk_offsets_s": [ + 0.19672954198904335, + 0.8733417129842564, + 0.97127936698962, + 1.0710319359786808, + 1.167732315021567, + 1.26712855999358, + 1.3673121079918928, + 1.4647333580069244, + 1.5647170799784362, + 1.660201127990149, + 1.7576632099808194, + 1.8579073189757764, + 1.9540373570052907, + 2.0518506430089474, + 2.151396489003673, + 2.249029468977824, + 2.3471046130289324, + 2.4442812529741786, + 2.5464647240005434, + 2.6503713480196893, + 2.748493277002126, + 2.84178202401381, + 2.9423585680196993, + 3.0428035269724205, + 3.141707047005184, + 3.240098609996494, + 3.3435802700114436, + 3.440479019016493, + 3.5385095389792696, + 3.6409116690047085, + 3.737844449991826, + 3.8370855260291137, + 3.9324481959920377, + 4.029164767998736, + 4.132667660014704, + 4.235452912980691, + 4.334969767020084, + 4.43593769101426, + 4.531969535979442, + 4.632491632015444, + 4.741853796003852, + 4.8546772570116445, + 4.967719007981941, + 5.0777311630081385, + 5.1990191849763505, + 5.298096370999701, + 5.397098243993241, + 5.494064897997305, + 5.593417367024813, + 5.692094084981363, + 5.790523552976083, + 5.890046790998895, + 5.987060708983336, + 6.084858971007634, + 6.188097093021497, + 6.288428146974184, + 6.387133696989622, + 6.4864880699897185, + 6.584738272009417, + 6.685039773990866, + 6.783491866022814, + 6.8803063579835, + 6.97799634700641, + 7.075033834029455, + 7.173477733973414, + 7.271742816024926, + 7.366447032021824, + 7.468572999991011, + 7.570096593000926, + 7.674015952972695, + 7.773817770008463, + 7.869653453002684, + 7.960911445028614, + 8.059486114012543, + 8.157508809992578, + 8.25448740000138, + 8.35317178297555, + 8.453448260028381, + 8.552368116972502, + 8.653874317998998, + 8.75236429902725, + 8.846487326023635, + 8.94899542501662, + 9.046106000023428, + 9.146751152991783, + 9.246011749026366, + 9.34453454602044, + 9.440979211009108, + 9.534681498014834, + 9.630687215016223, + 9.727086070983205, + 9.825225313019473, + 9.939251329982653, + 10.06667952198768, + 10.192614709027112, + 10.316737846995238, + 10.43832785601262, + 10.561876428022515, + 10.689285757020116, + 10.819052916020155, + 10.939742052985821, + 11.062461784982588, + 11.19211187097244, + 11.298348614014685, + 11.402982557017822, + 11.498377867974341, + 11.595025463029742, + 11.692015062028076, + 11.790039102023002, + 11.890792255988345, + 11.961058206972666 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.96086496883072, + "p95": 125.93518703943118, + "max": 676.6121709952131 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.73825232071344, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.561914542980958, + "end_to_end_tps": 88.56664665642707, + "timing_valid": true, + "steady_tps": 94.06083021891365, + "per_stream_tps": [ + 22.8, + 23.6, + 22.4, + 23.2 + ], + "ttft_s": [ + 0.39, + 0.77, + 0.19, + 0.58 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.38552398601314053, + "decode_tps": 22.819397071788543, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 83.00391457072475, + "prefill_tps": 83.00391457072475, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.82236729805157, + "round_gap_p50_ms": 98.04653696483001, + "round_gap_p95_ms": 103.30122703453526, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014519020332954824, + "first_payload_s": 0.0014555340167135, + "first_content_s": 0.38552398601314053, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38552398601314053, + "last_output_s": 11.56022764701629 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.768354489991907, + "decode_tps": 23.631204299667335, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.64744322680674, + "prefill_tps": 41.64744322680674, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.316929231324764, + "round_gap_p50_ms": 98.23556203627959, + "round_gap_p95_ms": 103.0437370063737, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0014335809973999858, + "first_payload_s": 0.001437628990970552, + "first_content_s": 0.768354489991907, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.768354489991907, + "last_output_s": 11.559171443979722 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19446614501066506, + "decode_tps": 22.4372328672174, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 164.5530639703123, + "prefill_tps": 164.5530639703123, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.568775745117854, + "round_gap_p50_ms": 98.06189697701484, + "round_gap_p95_ms": 102.68402099609375, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0013748450437560678, + "first_payload_s": 0.0013912130380049348, + "first_content_s": 0.19446614501066506, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19446614501066506, + "last_output_s": 11.559503960015718 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5762136800331064, + "decode_tps": 23.21402373561605, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.53495362720552, + "prefill_tps": 55.53495362720552, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.07740921560931, + "round_gap_p50_ms": 98.03469700273126, + "round_gap_p95_ms": 103.25679503148422, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0017640169826336205, + "first_payload_s": 0.0017666409839875996, + "first_content_s": 0.5762136800331064, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5762136800331064, + "last_output_s": 11.56095303001348 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.44637037252587, + "round_gap_p50_ms": 98.14825002104044, + "round_gap_p95_ms": 103.04428002564237, + "round_gap_mean_ms": 100.71658586358271, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 166.46608890093304, + "aggregate_prefill_tps": 166.46608890093304 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395898.024510299, + "first": 395898.410034285, + "last": 395909.584737946, + "end": 395909.584853835, + "elapsed_s": 11.560343536024448, + "chunk_offsets_s": [ + 0.38552398601314053, + 0.8715973170474172, + 0.9691644090344198, + 1.068486942036543, + 1.1670280270045623, + 1.265734714048449, + 1.362880730011966, + 1.4601718990015797, + 1.5595822730101645, + 1.6585432340507396, + 1.7546370640047826, + 1.8556144600152038, + 1.9517634910298511, + 2.049770203011576, + 2.1482959120185114, + 2.2449529470177367, + 2.3421724520158023, + 2.439499798056204, + 2.5418487280257978, + 2.645749400020577, + 2.7437358560273424, + 2.8380359250004403, + 2.9384859240381047, + 3.0386421770090237, + 3.1378534770337865, + 3.2357444600202143, + 3.3391804080456495, + 3.4355617770343088, + 3.533791851019487, + 3.633090144023299, + 3.72867225704249, + 3.8281309510348365, + 3.92680240602931, + 4.023151822038926, + 4.127065199019853, + 4.230109479045495, + 4.329772383032832, + 4.427719127037562, + 4.524164144007955, + 4.624482959043235, + 4.72326390305534, + 4.822667588014156, + 4.924148910038639, + 5.018540307006333, + 5.119916108029429, + 5.21785648399964, + 5.316335552022792, + 5.412086930999067, + 5.5111543260281906, + 5.610245273041073, + 5.70820046402514, + 5.807687527034432, + 5.9053071640082635, + 6.001990951015614, + 6.105292178050149, + 6.204483062028885, + 6.304128110001329, + 6.40244892105693, + 6.500276912003756, + 6.599079904030077, + 6.695075381023344, + 6.792176868999377, + 6.889605768024921, + 6.988920957024675, + 7.087658844015095, + 7.185454627033323, + 7.28047887905268, + 7.378294149006251, + 7.479190553014632, + 7.581189720018301, + 7.680719135038089, + 7.779532719054259, + 7.870534468034748, + 7.968130185035989, + 8.065149528032634, + 8.161709491047077, + 8.259509977011476, + 8.360134875052609, + 8.458181412017439, + 8.558812501025386, + 8.657760535017587, + 8.75181834504474, + 8.85389391303761, + 8.951525406038854, + 9.050982212007511, + 9.150312633020803, + 9.248476115055382, + 9.3455841630348, + 9.439163969014771, + 9.535101414017845, + 9.632242502004374, + 9.727345331048127, + 9.827295694034547, + 9.926975063048303, + 10.02576832700288, + 10.123803888040129, + 10.21795777900843, + 10.312901471043006, + 10.410024159005843, + 10.510288765013684, + 10.605819310003426, + 10.700642424053513, + 10.798050027049612, + 10.897305759019218, + 11.001184192020446, + 11.096269645029679, + 11.19338415702805, + 11.290989586035721, + 11.388131330022588, + 11.489534299005754, + 11.56022764701629 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.10500949970447, + "p95": 103.30122703453526, + "max": 486.07333103427663 + } + }, + { + "start": 395898.024870191, + "first": 395898.793224681, + "last": 395909.584041635, + "end": 395909.585410352, + "elapsed_s": 11.560540160979144, + "chunk_offsets_s": [ + 0.768354489991907, + 0.8713982269982807, + 0.9693475780077279, + 1.0682163150049746, + 1.166780519997701, + 1.265487062977627, + 1.3627097039716318, + 1.4601861870032735, + 1.559768033970613, + 1.6580035960068926, + 1.7543304999708198, + 1.8551821999717504, + 1.9514639030094258, + 2.0494958800263703, + 2.147991332982201, + 2.2449493469903246, + 2.3421555549721234, + 2.43891548801912, + 2.5416663729702123, + 2.645449572999496, + 2.7435070690116845, + 2.8378228819929063, + 2.938378306978848, + 3.0384574870113283, + 3.1376406580093317, + 3.2355893540079705, + 3.3390654620015994, + 3.4352869099820964, + 3.5337304580025375, + 3.632919966010377, + 3.7283814700203948, + 3.827995956991799, + 3.926520481996704, + 4.023089660971891, + 4.126361095986795, + 4.2293125269934535, + 4.329367195023224, + 4.427527732972521, + 4.523890333017334, + 4.624382461013738, + 4.723322655016091, + 4.822471057996154, + 4.924172636994626, + 5.018339121015742, + 5.1194541190052405, + 5.217839810997248, + 5.316133950022049, + 5.411965218023397, + 5.510834546003025, + 5.610100887017325, + 5.707994557975326, + 5.8074218279798515, + 5.905023847997654, + 6.001783940999303, + 6.105058526969515, + 6.203860462992452, + 6.303855899022892, + 6.402224167017266, + 6.500018924998585, + 6.599073758989107, + 6.694774561969098, + 6.791773857024964, + 6.8893239090102725, + 6.988821594975889, + 7.087435977009591, + 7.185179854976013, + 7.2801680589909665, + 7.377970913017634, + 7.478882053983398, + 7.580890643992461, + 7.680513611994684, + 7.77911145001417, + 7.870251137006562, + 7.9681933369720355, + 8.06485674099531, + 8.16156838502502, + 8.259306214982644, + 8.360202795010991, + 8.457778382988181, + 8.558826068998314, + 8.657497539010365, + 8.751593367021997, + 8.853488371998537, + 8.951204842014704, + 9.050685313006397, + 9.150218583992682, + 9.24822241597576, + 9.34544243302662, + 9.439003950974438, + 9.534698497969657, + 9.631976370990742, + 9.727390883024782, + 9.827025450998917, + 9.926771764003206, + 10.025142255995888, + 10.123787342978176, + 10.217749440984335, + 10.31246397801442, + 10.409881165018305, + 10.510021194000728, + 10.605591962987091, + 10.70019763498567, + 10.797485877003055, + 10.897015244001523, + 11.000888461014256, + 11.095838535984512, + 11.192842487012967, + 11.290564636990894, + 11.387668829003815, + 11.48899587802589, + 11.559171443979722 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.26485053054057, + "p95": 103.0437370063737, + "max": 103.87321701273322 + } + }, + { + "start": 395898.024395898, + "first": 395898.218862043, + "last": 395909.583899858, + "end": 395909.584180293, + "elapsed_s": 11.55978439503815, + "chunk_offsets_s": [ + 0.19446614501066506, + 0.8715629490325227, + 0.9691090960404836, + 1.067998233018443, + 1.166537846031133, + 1.2652520849951543, + 1.362892922013998, + 1.4604951820219867, + 1.5595315039972775, + 1.6581454059924, + 1.754562647023704, + 1.8559818080393597, + 1.9517329779919237, + 2.0495349850389175, + 2.1482159110018983, + 2.2452271259971894, + 2.3425179430050775, + 2.4392824200331233, + 2.541663142037578, + 2.64573637599824, + 2.7436450549867004, + 2.8379232680308633, + 2.938474196009338, + 3.0386252170428634, + 3.1377896679914556, + 3.235267126990948, + 3.339165016019251, + 3.4358737480361015, + 3.5337742670089938, + 3.6326275470200926, + 3.7286493770079687, + 3.8280679900199175, + 3.926312161027454, + 4.023951782030053, + 4.126635803026147, + 4.229199982015416, + 4.329629358020611, + 4.427691254997626, + 4.524075728026219, + 4.624521423014812, + 4.723591329995543, + 4.822567107039504, + 4.9243344950373285, + 5.018469939008355, + 5.120300223992672, + 5.217860275995918, + 5.316280256025493, + 5.412323989032302, + 5.511064213002101, + 5.610288105031941, + 5.708138176007196, + 5.807684071012773, + 5.905329884029925, + 6.00184912601253, + 6.1053312179865316, + 6.20442429301329, + 6.304027932987083, + 6.402361320040654, + 6.500287712027784, + 6.599044480011798, + 6.694998227991164, + 6.792040468018968, + 6.889485447027255, + 6.988893851987086, + 7.087603627005592, + 7.185281504993327, + 7.280303389008623, + 7.378200228034984, + 7.479421194992028, + 7.581109702994581, + 7.68092416098807, + 7.7792672120267525, + 7.870400674990378, + 7.968551981030032, + 8.065088935021777, + 8.161695313989185, + 8.259411432023626, + 8.360533774015494, + 8.458094003028236, + 8.559032886987552, + 8.657646564999595, + 8.75173778401222, + 8.853710359020624, + 8.951424333034083, + 9.050884227035567, + 9.150509563041851, + 9.248416466987692, + 9.3455346589908, + 9.43954134901287, + 9.534865204012021, + 9.632148740987759, + 9.727569045033306, + 9.82723062200239, + 9.926904582011048, + 10.025705893989652, + 10.124141747015528, + 10.217825442028698, + 10.312732189020608, + 10.409964174032211, + 10.510199132026173, + 10.605782174039632, + 10.700536902993917, + 10.798063739028294, + 10.897223278996535, + 11.00103179103462, + 11.096576304000337, + 11.193228907010052, + 11.290947617031634, + 11.388380548043642, + 11.489368650014512, + 11.559503960015718 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.10660150833428, + "p95": 102.68402099609375, + "max": 677.0968040218577 + } + }, + { + "start": 395898.024299305, + "first": 395898.600512985, + "last": 395909.585252335, + "end": 395909.586213848, + "elapsed_s": 11.561914542980958, + "chunk_offsets_s": [ + 0.5762136800331064, + 0.8720718980184756, + 0.9695392770227045, + 1.0682417069911025, + 1.1667912569828331, + 1.265499624016229, + 1.3631787330377847, + 1.4604661740013398, + 1.559960532002151, + 1.6584890729864128, + 1.7550227800384164, + 1.8561321930028498, + 1.9520948540302925, + 2.049808315001428, + 2.1486451469827443, + 2.245366487011779, + 2.3424797669867985, + 2.439613702998031, + 2.541907272010576, + 2.6461156440200284, + 2.7438631370314397, + 2.8381928860326298, + 2.938878824003041, + 3.0389452999806963, + 3.1380095100030303, + 3.235524201998487, + 3.33956540399231, + 3.4361197180114686, + 3.5341544150142, + 3.6328672299860045, + 3.7290833169827238, + 3.828520875016693, + 3.926544691028539, + 4.023596226004884, + 4.126853021036368, + 4.229437905014493, + 4.329862288024742, + 4.428022410022095, + 4.524299618031364, + 4.62441371002933, + 4.723623186000623, + 4.822814485989511, + 4.924581554019824, + 5.018681525019929, + 5.120341040019412, + 5.218254167004488, + 5.316481426008977, + 5.412622664007358, + 5.511086389014963, + 5.610784157994203, + 5.70834835403366, + 5.807717111019883, + 5.905365740007255, + 6.002043735992629, + 6.105329123034608, + 6.204337061033584, + 6.304255455033854, + 6.402378105034586, + 6.500331617018674, + 6.599455828021746, + 6.695224055030849, + 6.79227107798215, + 6.889733049029019, + 6.989322735986207, + 7.087805517017841, + 7.185569940018468, + 7.280616000003647, + 7.378416198014747, + 7.479296970006544, + 7.581339657015633, + 7.681304372032173, + 7.779604976007249, + 7.870627861004323, + 7.968555548985023, + 8.065289432997815, + 8.162204471009318, + 8.259648154024035, + 8.360433645022567, + 8.458272707997821, + 8.559238761023153, + 8.6578873040271, + 8.751938586006872, + 8.853968520998023, + 8.951642750995234, + 9.051128245017026, + 9.150426650012378, + 9.248574900033418, + 9.345868901989888, + 9.439311347028706, + 9.535094710008707, + 9.632367832004093, + 9.727868936024606, + 9.827395342988893, + 9.927105367998593, + 10.025616228987928, + 10.124131011019927, + 10.217983108013868, + 10.312960911018308, + 10.410300610004924, + 10.510418430028949, + 10.60580028599361, + 10.700914187007584, + 10.798385165981017, + 10.897446880990174, + 11.001325346005615, + 11.096833329997025, + 11.193748160032555, + 11.291323604993522, + 11.388419349037576, + 11.489888383017387, + 11.56095303001348 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.07867350173183, + "p95": 103.25679503148422, + "max": 295.85821798536927 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 89.84288839050706, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 11.549676522030495, + "end_to_end_tps": 88.66049175028975, + "timing_valid": true, + "steady_tps": 94.14783354129672, + "per_stream_tps": [ + 22.8, + 23.2, + 22.5, + 23.7 + ], + "ttft_s": [ + 0.39, + 0.58, + 0.19, + 0.77 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.38655671797459945, + "decode_tps": 22.84592604748837, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.78215980223298, + "prefill_tps": 82.78215980223298, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.77148021583208, + "round_gap_p50_ms": 98.03255303995684, + "round_gap_p95_ms": 103.32620400004089, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018087850185111165, + "first_payload_s": 0.0018115530256181955, + "first_content_s": 0.38655671797459945, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38655671797459945, + "last_output_s": 11.54828417301178 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5770117859938182, + "decode_tps": 23.242803882602697, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.45813929066404, + "prefill_tps": 55.45813929066404, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.02406908610982, + "round_gap_p50_ms": 98.09743403457105, + "round_gap_p95_ms": 103.48502197302878, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0018486249609850347, + "first_payload_s": 0.0018507529748603702, + "first_content_s": 0.5770117859938182, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5770117859938182, + "last_output_s": 11.548149402951822 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.1949827600037679, + "decode_tps": 22.46157366143754, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 164.11707373196288, + "prefill_tps": 164.11707373196288, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 44.52047817632739, + "round_gap_p50_ms": 97.94498496921733, + "round_gap_p95_ms": 103.97697699954733, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0015139669994823635, + "first_payload_s": 0.0015316630015149713, + "first_content_s": 0.1949827600037679, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1949827600037679, + "last_output_s": 11.547704694967251 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7672197970096022, + "decode_tps": 23.65298911812603, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.70903843295835, + "prefill_tps": 41.70903843295835, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.27795459617696, + "round_gap_p50_ms": 98.0908409692347, + "round_gap_p95_ms": 103.3007469959557, + "tokens_per_chunk": 2.3063063063063063, + "headers_s": 0.0021320850355550647, + "first_payload_s": 0.0021346290013752878, + "first_content_s": 0.7672197970096022, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7672197970096022, + "last_output_s": 11.548098219034728 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.39849551861156, + "round_gap_p50_ms": 98.0237050098367, + "round_gap_p95_ms": 103.4659969736822, + "round_gap_mean_ms": 100.60560324769044, + "tokens_per_chunk": 2.3063063063063063, + "aggregate_prompt_ttft_tps": 166.8361537318334, + "aggregate_prefill_tps": 166.8361537318334 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "98f95af2c394", + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395909.587785671, + "first": 395909.974342389, + "last": 395921.136069844, + "end": 395921.136770922, + "elapsed_s": 11.5489852509927, + "chunk_offsets_s": [ + 0.38655671797459945, + 0.8655955690192059, + 0.9639491810230538, + 1.061961189028807, + 1.159609818016179, + 1.25789538200479, + 1.3543825279921293, + 1.45176241901936, + 1.5534064460080117, + 1.6487817899906076, + 1.7461714249802753, + 1.846381438022945, + 1.9429988419869915, + 2.0412752850097604, + 2.139366911025718, + 2.237673818017356, + 2.3362806329969317, + 2.433955534012057, + 2.5372718819999136, + 2.6402907380252145, + 2.738414491992444, + 2.8315210940199904, + 2.9319091900251806, + 3.0319971700082533, + 3.1307921310071833, + 3.2294523540185764, + 3.3324207619880326, + 3.4286589300027117, + 3.52690519700991, + 3.62561009201454, + 3.722618267987855, + 3.8206508210278116, + 3.915189435996581, + 4.011661719006952, + 4.1149686420103535, + 4.218434638984036, + 4.318474154977594, + 4.4165965329739265, + 4.513043727027252, + 4.615819045982789, + 4.713506987027358, + 4.811425298976246, + 4.912675498984754, + 5.006821086979471, + 5.112027388997376, + 5.2108242369722575, + 5.311792291002348, + 5.407897704979405, + 5.506919179984834, + 5.605951934994664, + 5.704280955018476, + 5.803065498999786, + 5.900422381993849, + 5.997656719002407, + 6.100868345994968, + 6.199667754000984, + 6.299525988986716, + 6.397497468977235, + 6.494543996988796, + 6.593404798011761, + 6.6898492079926655, + 6.786414099973626, + 6.883070720010437, + 6.97960282600252, + 7.079016320989467, + 7.175904111005366, + 7.271521664981265, + 7.369478954002261, + 7.46961683902191, + 7.572943043021951, + 7.673977705009747, + 7.770079631998669, + 7.860682466009166, + 7.958000004000496, + 8.055556185019668, + 8.151927793980576, + 8.249814426002558, + 8.351037729997188, + 8.451069917995483, + 8.552506952022668, + 8.650388960028067, + 8.745092249999288, + 8.845511002000421, + 8.942791707988363, + 9.04248656501295, + 9.141329078003764, + 9.240487497998402, + 9.337441993004177, + 9.431361338996794, + 9.526549993024673, + 9.622585150995292, + 9.718571301025804, + 9.817497559008189, + 9.917923318978865, + 10.013116132991854, + 10.111738148028962, + 10.20585447200574, + 10.299908988003153, + 10.396827097982168, + 10.497319579008035, + 10.592110134020913, + 10.690161502978299, + 10.784890328999609, + 10.88387751497794, + 10.987417689990252, + 11.082886186020914, + 11.17897108901525, + 11.276083154021762, + 11.37350578099722, + 11.477614201023243, + 11.54828417301178 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.04196099867113, + "p95": 103.32620400004089, + "max": 479.0388510446064 + } + }, + { + "start": 395909.587840792, + "first": 395910.164852578, + "last": 395921.135990195, + "end": 395921.137097309, + "elapsed_s": 11.549256516969763, + "chunk_offsets_s": [ + 0.5770117859938182, + 0.8656254559755325, + 0.9639653719495982, + 1.0620628059841692, + 1.1594896729802713, + 1.2580214149784297, + 1.354658865951933, + 1.4518572189845145, + 1.5532855489873327, + 1.6488529740017839, + 1.7462627529748715, + 1.846464030968491, + 1.9430932739633135, + 2.041283732978627, + 2.139467438973952, + 2.237883947964292, + 2.3361477669677697, + 2.433645146957133, + 2.5373802179819904, + 2.640357138996478, + 2.7385084769921377, + 2.831615590956062, + 2.931800147984177, + 3.0318605770007707, + 3.13109755696496, + 3.2294841299881227, + 3.332567018980626, + 3.428743873955682, + 3.5269085409818217, + 3.625647851964459, + 3.722141718957573, + 3.819830139982514, + 3.9155167029821314, + 4.011663189972751, + 4.114973489951808, + 4.218638032965828, + 4.31850441097049, + 4.416696101950947, + 4.513226608978584, + 4.615820373001043, + 4.713398841966409, + 4.811293793958612, + 4.912680506997276, + 5.006890014978126, + 5.112030044954736, + 5.2109089900041, + 5.311598687956575, + 5.407781975984108, + 5.50711753295036, + 5.606236800958868, + 5.704155593004543, + 5.803122026962228, + 5.900422252947465, + 5.997690062969923, + 6.100959449948277, + 6.199761050986126, + 6.299418626993429, + 6.397388395969756, + 6.494380778982304, + 6.593434669950511, + 6.6898590959608555, + 6.786449202976655, + 6.883139999990817, + 6.979634489980526, + 7.078639196988661, + 7.176087039988488, + 7.271525824966375, + 7.369251174968667, + 7.46968731895322, + 7.572723247983959, + 7.674109161947854, + 7.770091486978345, + 7.8604729429935105, + 7.958105140947737, + 8.055650120950304, + 8.151478621992283, + 8.24950232700212, + 8.351337492000312, + 8.450787354959175, + 8.55197497899644, + 8.650391855975613, + 8.744931527995504, + 8.845599993946962, + 8.942670521966647, + 9.04252118896693, + 9.141336533997674, + 9.240376359957736, + 9.337476024986245, + 9.431411818950437, + 9.526417942950502, + 9.62231156398775, + 9.71846102795098, + 9.817552438995335, + 9.917299888969865, + 10.013239333988167, + 10.11179962096503, + 10.206059689982794, + 10.300056812993716, + 10.39692612295039, + 10.497019784001168, + 10.591960291960277, + 10.69031339196954, + 10.784781190974172, + 10.883979499980342, + 10.98746452195337, + 11.082977834972553, + 11.17901817697566, + 11.275834494968876, + 11.373571573989466, + 11.47728480497608, + 11.548149402951822 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.1243860151153, + "p95": 103.48502197302878, + "max": 288.61366998171434 + } + }, + { + "start": 395909.587934728, + "first": 395909.782917488, + "last": 395921.135639423, + "end": 395921.136133188, + "elapsed_s": 11.548198459960986, + "chunk_offsets_s": [ + 0.1949827600037679, + 0.8657500179833733, + 0.9636709539918229, + 1.0616760670091026, + 1.1592218150035478, + 1.2578402939834632, + 1.3543607519823126, + 1.4514702879823744, + 1.5530410829815082, + 1.6485614199773408, + 1.7459490390028805, + 1.8463071020087227, + 1.9427066950011067, + 2.0409776190062985, + 2.139078027976211, + 2.2377213229774497, + 2.335863732965663, + 2.4337243490153924, + 2.5377013260149397, + 2.6399729439872317, + 2.73811181797646, + 2.8312155719613656, + 2.9315143059939146, + 3.031491677975282, + 3.13092973298626, + 3.2291460629785433, + 3.3329528470057994, + 3.4288328199763782, + 3.5265794660081156, + 3.6253003620076925, + 3.721867284970358, + 3.820305378001649, + 3.9152397089637816, + 4.011332340014633, + 4.114639759005513, + 4.218638688966166, + 4.318178456975147, + 4.416169761971105, + 4.513182928960305, + 4.615504322980996, + 4.713128295959905, + 4.81104558397783, + 4.912356952962, + 5.006747775012627, + 5.1116988100111485, + 5.210743916977663, + 5.31157544098096, + 5.4075405659968965, + 5.507082285999786, + 5.6063201949582435, + 5.703764870006125, + 5.802738519967534, + 5.90013031498529, + 5.9973315639654174, + 6.10131223796634, + 6.199329094961286, + 6.299044880957808, + 6.397148746997118, + 6.494464093004353, + 6.5930937879602425, + 6.690228972001933, + 6.786819895962253, + 6.8832146729691885, + 6.979297576006502, + 7.0790014889789745, + 7.17632438801229, + 7.271189357968979, + 7.369020965998061, + 7.469761048967484, + 7.572711184970103, + 7.673756983014755, + 7.769742940959986, + 7.860455519985408, + 7.957945219997782, + 8.055161238007713, + 8.151202123961411, + 8.249492647999432, + 8.351425541972276, + 8.4506009859615, + 8.55216822901275, + 8.650113213981967, + 8.744770374963991, + 8.845690043992363, + 8.942291702958755, + 9.042179585958365, + 9.141295765992254, + 9.24050532298861, + 9.337135381996632, + 9.431492236966733, + 9.526214150013402, + 9.62237593397731, + 9.718116496980656, + 9.817229860986117, + 9.917606804985553, + 10.012829779007006, + 10.111499362974428, + 10.206083802971989, + 10.300454992975574, + 10.396544696006458, + 10.496816070983186, + 10.592135382001288, + 10.689893389004283, + 10.784460132999811, + 10.88433836796321, + 10.987091686984058, + 11.082820425974205, + 11.178635853982996, + 11.276093474007212, + 11.373175026965328, + 11.47727323800791, + 11.547704694967251 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 97.96814498258755, + "p95": 103.97697699954733, + "max": 670.7672579796053 + } + }, + { + "start": 395909.587716262, + "first": 395910.354936059, + "last": 395921.135814481, + "end": 395921.137392784, + "elapsed_s": 11.549676522030495, + "chunk_offsets_s": [ + 0.7672197970096022, + 0.865618001029361, + 0.9641952470410615, + 1.0619767419993877, + 1.1594953540479764, + 1.2578981820261106, + 1.3545034090057015, + 1.4521184060140513, + 1.553324478038121, + 1.6486652130261064, + 1.7460920640151016, + 1.8463844950310886, + 1.9429922660347074, + 2.041262821003329, + 2.139365839015227, + 2.237682923034299, + 2.336183448031079, + 2.433608763036318, + 2.537219834048301, + 2.6402592820231803, + 2.738437453052029, + 2.831539735023398, + 2.9318259890424088, + 3.0318252010038123, + 3.1309106440166943, + 3.229470818012487, + 3.3324003780144267, + 3.4286133460118435, + 3.5268897410132922, + 3.62562196503859, + 3.7221695280168205, + 3.8198544930201024, + 3.915556288033258, + 4.01164795900695, + 4.114948706002906, + 4.218420479039196, + 4.3184929880080745, + 4.416481492051389, + 4.513029535009991, + 4.615809638053179, + 4.713436491030734, + 4.811357971047983, + 4.912665868003387, + 5.00677556701703, + 5.112008909054566, + 5.210781469009817, + 5.3115828490117565, + 5.407839481020346, + 5.50688188400818, + 5.6061012640129775, + 5.704060681047849, + 5.803045803040732, + 5.900442206009757, + 5.9976440310128964, + 6.100839706021361, + 6.199634506017901, + 6.299366484046914, + 6.397457325016148, + 6.494363756035455, + 6.593420559016522, + 6.689820712024812, + 6.786385492014233, + 6.883057808037847, + 6.979616091004573, + 7.078856480016839, + 7.1758903990266845, + 7.2714986730134115, + 7.369612875045277, + 7.4695844710222445, + 7.572702913021203, + 7.673850407998543, + 7.770064192009158, + 7.86047520005377, + 7.95796374802012, + 8.05547037604265, + 8.151519839011598, + 8.249516472045798, + 8.351251444022637, + 8.45097473403439, + 8.551974339003209, + 8.650599266053177, + 8.74484131904319, + 8.845492570020724, + 8.943022990017198, + 9.04272608802421, + 9.141282470023725, + 9.240366121055558, + 9.337454345019069, + 9.431305019010324, + 9.526730315003078, + 9.622319421032444, + 9.718436580034904, + 9.817751690046862, + 9.917294978047721, + 10.01350351300789, + 10.11200279102195, + 10.205855337029789, + 10.299851307005156, + 10.397122477006633, + 10.497208954009693, + 10.591960501042195, + 10.690572275023442, + 10.784763016039506, + 10.883847292046994, + 10.987400954007171, + 11.082851338025648, + 11.178959985030815, + 11.275801759038586, + 11.373490374011453, + 11.477575753000565, + 11.548098219034728 + ], + "chunk_gaps_ms": { + "count": 110, + "p50": 98.09692949056625, + "p95": 103.3007469959557, + "max": 105.2333420375362 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "98f95af2c394a9340781bb382dae9e5715b3a9c724c8d4ede48d5c84d7df3423", + "output_sha256": "631efb36da29c99e1df3cd4d0d43d8c651caa1c915c75b14b9d9a923c6212d75", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.5, + "per_stream_tps": 46.5, + "ttft_s_max": 0.17, + "request": { + "ttft_s": 0.126, + "decode_tps": 46.526, + "prompt_ttft_tps": 111.054, + "prefill_tps": 111.054, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.493, + "round_gap_p50_ms": 68.972, + "round_gap_p95_ms": 94.664, + "tokens_per_chunk": 3.368, + "headers_s": 0.001, + "first_payload_s": 0.126, + "first_content_s": 0.126, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.126, + "last_output_s": 5.623 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 111.054, + "aggregate_prefill_tps": 111.054, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.493, + "round_gap_p50_ms": 68.972, + "round_gap_p95_ms": 94.664, + "tokens_per_chunk": 3.368 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 45.529182724195785, + "makespan_s": 5.622767304012086, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.3561627641078, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.627359691017773, + "end_to_end_tps": 45.49202717726036, + "timing_valid": true, + "per_stream_tps": [ + 46.4 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.1260099450009875, + "decode_tps": 46.3561627641078, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 111.10234196110702, + "prefill_tps": 111.10234196110702, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.572104772534587, + "round_gap_p50_ms": 67.39589403150603, + "round_gap_p95_ms": 94.66388396685943, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0009666490368545055, + "first_payload_s": 0.1260099450009875, + "first_content_s": 0.1260099450009875, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1260099450009875, + "last_output_s": 5.626896661997307 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.572104772534587, + "round_gap_p50_ms": 67.39589403150603, + "round_gap_p95_ms": 94.66388396685943, + "round_gap_mean_ms": 71.44008723371843, + "tokens_per_chunk": 3.282051282051282, + "aggregate_prompt_ttft_tps": 111.10234196110702, + "aggregate_prefill_tps": 111.10234196110702 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395986.330157884, + "first": 395986.456167829, + "last": 395991.957054546, + "end": 395991.957517575, + "elapsed_s": 5.627359691017773, + "chunk_offsets_s": [ + 0.1260099450009875, + 0.18305166001664475, + 0.23852932802401483, + 0.2960943760117516, + 0.3544403600390069, + 0.4125117009971291, + 0.469545720028691, + 0.5278941669967026, + 0.595214125001803, + 0.6526719880057499, + 0.7118992920150049, + 0.7686295959865674, + 0.8275361930136569, + 0.8844384670373984, + 0.9432679110323079, + 1.0076188640086912, + 1.071917928988114, + 1.1311518730362877, + 1.1900890790275298, + 1.249833507987205, + 1.3090530839981511, + 1.3651271890266798, + 1.4251735570142046, + 1.4866775390109979, + 1.554706608003471, + 1.613502772001084, + 1.6708105049910955, + 1.729861168016214, + 1.7872933989856392, + 1.8523364550201222, + 1.9131816300214268, + 1.9874905670294538, + 2.0650660149985924, + 2.1361667130258866, + 2.2079490019823425, + 2.2794762160046957, + 2.3540332830161788, + 2.4272892010048963, + 2.5004463670193218, + 2.571612586034462, + 2.6557409450178966, + 2.753434010024648, + 2.8480978939915076, + 2.920977985020727, + 3.0000003590248525, + 3.089332464034669, + 3.2302845520316623, + 3.335595257987734, + 3.417960448015947, + 3.506261999020353, + 3.5896043989923783, + 3.6766234730021097, + 3.7614158230135217, + 3.8501392020261846, + 3.932310245989356, + 4.0157384860212915, + 4.108700802025851, + 4.189241782994941, + 4.273607648035977, + 4.3599518359988, + 4.440696531033609, + 4.5019953430164605, + 4.558500525017735, + 4.61994725803379, + 4.689231027034111, + 4.748847423004918, + 4.816243317036424, + 4.908586795034353, + 4.973935406014789, + 5.060615966038313, + 5.148471161024645, + 5.236071713035926, + 5.328526680008508, + 5.408584424003493, + 5.464992948982399, + 5.523277683998458, + 5.578750904009212, + 5.626896661997307 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 67.39589403150603, + "p95": 94.66388396685943, + "max": 140.9520879969932 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.5262312201946, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.607049429032486, + "end_to_end_tps": 45.65681170464973, + "timing_valid": true, + "per_stream_tps": [ + 46.5 + ], + "ttft_s": [ + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.126065241987817, + "decode_tps": 46.5262312201946, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 111.05360826858974, + "prefill_tps": 111.05360826858974, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.493251737225435, + "round_gap_p50_ms": 68.97229398600757, + "round_gap_p95_ms": 94.92204699199647, + "tokens_per_chunk": 3.3684210526315788, + "headers_s": 0.0011136429966427386, + "first_payload_s": 0.126065241987817, + "first_content_s": 0.126065241987817, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.126065241987817, + "last_output_s": 5.606844434980303 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.493251737225435, + "round_gap_p50_ms": 68.97229398600757, + "round_gap_p95_ms": 94.92204699199647, + "round_gap_mean_ms": 73.07705590656649, + "tokens_per_chunk": 3.3684210526315788, + "aggregate_prompt_ttft_tps": 111.05360826858974, + "aggregate_prefill_tps": 111.05360826858974 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395991.958418303, + "first": 395992.084483545, + "last": 395997.565262738, + "end": 395997.565467732, + "elapsed_s": 5.607049429032486, + "chunk_offsets_s": [ + 0.126065241987817, + 0.18438376899575815, + 0.24098456802312285, + 0.2983837270294316, + 0.3565291970153339, + 0.41454855300253257, + 0.47094283800106496, + 0.5277234310051426, + 0.5951841580099426, + 0.6526668540318497, + 0.7122646889765747, + 0.7692376680206507, + 0.8274097460089251, + 0.8849882180220447, + 0.9439792159828357, + 1.0056775039993227, + 1.0690429600072093, + 1.1282562800333835, + 1.1882451919955201, + 1.2482060869806446, + 1.307106668013148, + 1.3628700189874507, + 1.4228631390142255, + 1.4857762060128152, + 1.5547484999988228, + 1.6136532250093296, + 1.6711860169889405, + 1.7303207599907182, + 1.7881013629958034, + 1.8498864520224743, + 1.9093971980037168, + 1.973553797986824, + 2.0530469770310447, + 2.140313462004997, + 2.229689439001959, + 2.32416026602732, + 2.41496638499666, + 2.4991803449811414, + 2.5852271069888957, + 2.677814971015323, + 2.7727166010299698, + 2.856692783010658, + 2.9414631639956497, + 3.027614007005468, + 3.1121451380313374, + 3.199884267989546, + 3.2817500450182706, + 3.3730683620087802, + 3.4659713489818387, + 3.552227567997761, + 3.636471816978883, + 3.725650415988639, + 3.807863620982971, + 3.890192011022009, + 3.974392818985507, + 4.057011820026673, + 4.146763768978417, + 4.233253334998153, + 4.314109679020476, + 4.375078407989349, + 4.431739670981187, + 4.491178978001699, + 4.554873636981938, + 4.616550229024142, + 4.6822441869881, + 4.752736766997259, + 4.825186823029071, + 4.9266193640069105, + 5.015619785990566, + 5.1105418329825625, + 5.215885418991093, + 5.317768412991427, + 5.4013040629797615, + 5.475008402019739, + 5.545145491021685, + 5.606844434980303 + ], + "chunk_gaps_ms": { + "count": 75, + "p50": 68.97229398600757, + "p95": 94.92204699199647, + "max": 105.34358600853011 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.73040389801039, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 5.622767304012086, + "end_to_end_tps": 45.529182724195785, + "timing_valid": true, + "per_stream_tps": [ + 46.7 + ], + "ttft_s": [ + 0.17 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.16582325502531603, + "decode_tps": 46.73040389801039, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 84.42724151002004, + "prefill_tps": 84.42724151002004, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.399344250961555, + "round_gap_p50_ms": 78.35574401542544, + "round_gap_p95_ms": 86.31231600884348, + "tokens_per_chunk": 3.6056338028169015, + "headers_s": 0.0010540260118432343, + "first_payload_s": 0.16582325502531603, + "first_content_s": 0.16582325502531603, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.16582325502531603, + "last_output_s": 5.622656039020512 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 21.399344250961555, + "round_gap_p50_ms": 78.35574401542544, + "round_gap_p95_ms": 86.31231600884348, + "round_gap_mean_ms": 77.95475405707423, + "tokens_per_chunk": 3.6056338028169015, + "aggregate_prompt_ttft_tps": 84.42724151002004, + "aggregate_prefill_tps": 84.42724151002004 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 395997.566298668, + "first": 395997.732121923, + "last": 396003.188954707, + "end": 396003.189065972, + "elapsed_s": 5.622767304012086, + "chunk_offsets_s": [ + 0.16582325502531603, + 0.25532321800710633, + 0.32304774003569037, + 0.392029681999702, + 0.45266319101210684, + 0.5171571220271289, + 0.6002691200119443, + 0.6689139709924348, + 0.7521866260212846, + 0.8274740680353716, + 0.903295291995164, + 0.979267189046368, + 1.0574644189910032, + 1.1316939470125362, + 1.208174105035141, + 1.2852672130102292, + 1.370788961998187, + 1.4491447060136124, + 1.5265060720266774, + 1.601115956029389, + 1.6771106210071594, + 1.7562825650093146, + 1.8333253840100951, + 1.9127586270333268, + 2.0010726260370575, + 2.079774101031944, + 2.1590440300060436, + 2.239293456019368, + 2.319148270005826, + 2.3993433440336958, + 2.4799499420332722, + 2.5650566940312274, + 2.653978028043639, + 2.729124845005572, + 2.8132996530039236, + 2.894147645041812, + 2.975229495030362, + 3.055415495997295, + 3.1280673450091854, + 3.2069802790065296, + 3.2905537690385245, + 3.367324553022627, + 3.445733033993747, + 3.517470218008384, + 3.599372268014122, + 3.674293819000013, + 3.754304027010221, + 3.8343481399933808, + 3.9178190529928543, + 3.996738034009468, + 4.069326603028458, + 4.146301901026163, + 4.21922666503815, + 4.297684138000477, + 4.377815051004291, + 4.4600168479955755, + 4.544682412990369, + 4.621067482046783, + 4.697013267024886, + 4.779275287990458, + 4.8550748160341755, + 4.928937125019729, + 5.004283400019631, + 5.090595716028474, + 5.176136777037755, + 5.255934839020483, + 5.331822383042891, + 5.409257623017766, + 5.48433882300742, + 5.5612905219895765, + 5.622656039020512 + ], + "chunk_gaps_ms": { + "count": 70, + "p50": 78.38211249327287, + "p95": 86.31231600884348, + "max": 89.4999629817903 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 60.2, + "per_stream_tps": 30.7, + "ttft_s_max": 0.26, + "request": { + "ttft_s": 0.195, + "decode_tps": 30.714, + "prompt_ttft_tps": 80.139, + "prefill_tps": 80.139, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.572, + "round_gap_p50_ms": 104.649, + "round_gap_p95_ms": 110.751, + "tokens_per_chunk": 3.202, + "headers_s": 0.001, + "first_payload_s": 0.195, + "first_content_s": 0.195, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.195, + "last_output_s": 8.501 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 108.318, + "aggregate_prefill_tps": 108.318, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.407, + "round_gap_p50_ms": 104.629, + "round_gap_p95_ms": 110.81, + "tokens_per_chunk": 3.2 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 59.47585902789108, + "makespan_s": 8.608534762985073, + "steady_tps": 61.9, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 60.16990709012846, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.608284635003656, + "end_to_end_tps": 59.4775871975779, + "timing_valid": true, + "steady_tps": 61.94712684714901, + "per_stream_tps": [ + 31.7, + 30.1 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2634312169975601, + "decode_tps": 31.71050545105302, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.14480250125279, + "prefill_tps": 53.14480250125279, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.535290458979194, + "round_gap_p50_ms": 104.54103496158496, + "round_gap_p95_ms": 110.34905898850411, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0013310050126165152, + "first_payload_s": 0.2634312169975601, + "first_content_s": 0.2634312169975601, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2634312169975601, + "last_output_s": 8.304930284037255 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13220654899487272, + "decode_tps": 30.08495354506423, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 105.89490540701544, + "prefill_tps": 105.89490540701544, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.239207050863506, + "round_gap_p50_ms": 104.52623496530578, + "round_gap_p95_ms": 110.31216295668855, + "tokens_per_chunk": 3.1219512195121952, + "headers_s": 0.001560558972414583, + "first_payload_s": 0.13220654899487272, + "first_content_s": 0.13220654899487272, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13220654899487272, + "last_output_s": 8.608204346965067 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.38724875492135, + "round_gap_p50_ms": 104.52623496530578, + "round_gap_p95_ms": 110.34905898850411, + "round_gap_mean_ms": 104.54111939879677, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 106.1335342851402, + "aggregate_prefill_tps": 106.1335342851402 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396003.190692243, + "first": 396003.45412346, + "last": 396011.495622527, + "end": 396011.495836289, + "elapsed_s": 8.305144046025816, + "chunk_offsets_s": [ + 0.2634312169975601, + 0.3660334179876372, + 0.4615846709930338, + 0.5586105780093931, + 0.6589740369818173, + 0.7569529140018858, + 0.8565486859879456, + 0.961525532999076, + 1.06390458001988, + 1.1693940080003813, + 1.2717512790113688, + 1.376116665021982, + 1.4765321880113333, + 1.5820735369925387, + 1.6843331269919872, + 1.7865137560293078, + 1.8933673090068623, + 2.002017471997533, + 2.109973661019467, + 2.2139578909846023, + 2.3147774020326324, + 2.4208420049981214, + 2.529511912027374, + 2.6380194969824515, + 2.7398941870196722, + 2.8367250360315666, + 2.941922669997439, + 3.0424139390233904, + 3.1442113640368916, + 3.2448008420178667, + 3.3523954590200447, + 3.4599937709863298, + 3.565424798987806, + 3.675508416024968, + 3.78634868003428, + 3.888940225006081, + 3.995945987990126, + 4.102241440035868, + 4.210983204015065, + 4.317959574982524, + 4.42077246599365, + 4.52894060901599, + 4.641050709004048, + 4.751399767992552, + 4.8642147710197605, + 4.970905699010473, + 5.0759730280260555, + 5.1807496339897625, + 5.282902757986449, + 5.382952807005495, + 5.486859660013579, + 5.596241143008228, + 5.70410814601928, + 5.813867792021483, + 5.921145558007993, + 6.022100383008365, + 6.124378213018645, + 6.22891924798023, + 6.3309304200229235, + 6.433671134000178, + 6.538620670035016, + 6.641598762013018, + 6.741163173981477, + 6.845723826030735, + 6.95187257300131, + 7.056929966027383, + 7.156775196024682, + 7.264912074024323, + 7.36744937900221, + 7.4773868339834735, + 7.584708649024833, + 7.691348777036183, + 7.793771551980171, + 7.896976687014103, + 8.000761810981203, + 8.10484461899614, + 8.20601927000098, + 8.304930284037255 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 104.54103496158496, + "p95": 110.34905898850411, + "max": 112.81500302720815 + } + }, + { + "start": 396003.190304864, + "first": 396003.322511413, + "last": 396011.798509211, + "end": 396011.798589499, + "elapsed_s": 8.608284635003656, + "chunk_offsets_s": [ + 0.13220654899487272, + 0.3665884139481932, + 0.4617821119609289, + 0.5592148069990799, + 0.6595259939786047, + 0.7575513669871725, + 0.8570310899522156, + 0.9620067529613152, + 1.0643686479888856, + 1.1698572759632953, + 1.2722101629478857, + 1.3766697569517419, + 1.477012463961728, + 1.5825594129855745, + 1.6847961549647152, + 1.786830109951552, + 1.8938231369829737, + 2.002540740999393, + 2.109907370992005, + 2.2144469829509035, + 2.3152849749894813, + 2.42133948096307, + 2.5299921229598112, + 2.6385353729710914, + 2.7403886549873278, + 2.8372167839552276, + 2.942409745999612, + 3.0429411429795437, + 3.1447483449592255, + 3.2453132459777407, + 3.3528860229998827, + 3.460513279947918, + 3.565913170983549, + 3.6759914759895764, + 3.7868413239484653, + 3.8894555890001357, + 3.9964057040051557, + 4.102733043953776, + 4.21090105897747, + 4.318451354978606, + 4.4212613179697655, + 4.52946043695556, + 4.6415664730011486, + 4.751878635957837, + 4.864437748969067, + 4.971393350977451, + 5.07648963999236, + 5.181203956948593, + 5.283391257980838, + 5.383455418981612, + 5.48736316896975, + 5.596178772975691, + 5.704590117966291, + 5.814375539950561, + 5.921622905996628, + 6.022002076962963, + 6.124888536985964, + 6.229414771951269, + 6.331111700972542, + 6.433843070990406, + 6.539117169973906, + 6.642137694987468, + 6.741341622953769, + 6.846261269995011, + 6.952357600966934, + 7.057140430959407, + 7.157307344954461, + 7.265400445961859, + 7.367970534949563, + 7.477926230989397, + 7.585200076980982, + 7.691867788962554, + 7.79423176398268, + 7.897161119966768, + 8.001257750962395, + 8.105297837988473, + 8.206218214996625, + 8.305502383969724, + 8.378827759996057, + 8.459129762952216, + 8.535924644966144, + 8.608204346965067 + ], + "chunk_gaps_ms": { + "count": 81, + "p50": 104.52623496530578, + "p95": 110.31216295668855, + "max": 234.38186495332047 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 60.15603549195871, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.608534762985073, + "end_to_end_tps": 59.47585902789108, + "timing_valid": true, + "steady_tps": 62.151146531131936, + "per_stream_tps": [ + 31.7, + 30.1 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2574284390429966, + "decode_tps": 31.67941546273158, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.38404572566153, + "prefill_tps": 54.38404572566153, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.566239003886412, + "round_gap_p50_ms": 104.75628601852804, + "round_gap_p95_ms": 110.80988001776859, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0011430670274421573, + "first_payload_s": 0.2574284390429966, + "first_content_s": 0.2574284390429966, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2574284390429966, + "last_output_s": 8.306819385034032 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13049242098350078, + "decode_tps": 30.078017745979356, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.2859243049076, + "prefill_tps": 107.2859243049076, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.2468718000432, + "round_gap_p50_ms": 104.49978802353144, + "round_gap_p95_ms": 110.69258296629414, + "tokens_per_chunk": 3.1219512195121952, + "headers_s": 0.0009940890013240278, + "first_payload_s": 0.13049242098350078, + "first_content_s": 0.13049242098350078, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13049242098350078, + "last_output_s": 8.608444729994517 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.40655540196481, + "round_gap_p50_ms": 104.62879599072039, + "round_gap_p95_ms": 110.80988001776859, + "round_gap_mean_ms": 104.6034383227978, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 108.72570029975556, + "aggregate_prefill_tps": 108.72570029975556 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396011.799650998, + "first": 396012.057079437, + "last": 396020.106470383, + "end": 396020.106682801, + "elapsed_s": 8.307031803007703, + "chunk_offsets_s": [ + 0.2574284390429966, + 0.36078197602182627, + 0.45473414205480367, + 0.5519871710566804, + 0.652239062008448, + 0.7502159870346077, + 0.8531319670146331, + 0.9574960250174627, + 1.0599401450017467, + 1.165338053018786, + 1.2675798980053514, + 1.372573850036133, + 1.471736467035953, + 1.5781434240052477, + 1.679409533040598, + 1.7815212810528465, + 1.8906603770446964, + 1.9993694690056145, + 2.108688198029995, + 2.212306105007883, + 2.313010288053192, + 2.418476229009684, + 2.5233700840035453, + 2.630612970038783, + 2.7316685330006294, + 2.828822409035638, + 2.933741369051859, + 3.0368288710014895, + 3.1383085010456853, + 3.239586098003201, + 3.3444308960461058, + 3.4522714360500686, + 3.5584683440392837, + 3.6674739670124836, + 3.778283847030252, + 3.8847953340155073, + 3.9923314380575903, + 4.0997504540137015, + 4.206548919028137, + 4.314505252055824, + 4.4176348660257645, + 4.525985203043092, + 4.637075278034899, + 4.746845340006985, + 4.860320461040828, + 4.966851388046052, + 5.072555508057121, + 5.176372041052673, + 5.27824362704996, + 5.3790013620164245, + 5.483757648034953, + 5.591045207052957, + 5.69951874500839, + 5.810599171032663, + 5.918566128006205, + 6.017960683035199, + 6.124241223034915, + 6.229395289032254, + 6.332515528018121, + 6.43270049005514, + 6.537373303028289, + 6.639559052011464, + 6.73946271603927, + 6.843513091036584, + 6.953320738044567, + 7.05783698905725, + 7.157286985020619, + 7.265286406036466, + 7.368053153040819, + 7.477669517043978, + 7.584915828017984, + 7.690649547032081, + 7.792519485054072, + 7.896282818051986, + 7.999020893010311, + 8.105200025020167, + 8.205746510007884, + 8.306819385034032 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 104.75628601852804, + "p95": 110.80988001776859, + "max": 113.4751210338436 + } + }, + { + "start": 396011.799550629, + "first": 396011.93004305, + "last": 396020.407995359, + "end": 396020.408085392, + "elapsed_s": 8.608534762985073, + "chunk_offsets_s": [ + 0.13049242098350078, + 0.3610868590185419, + 0.45460773998638615, + 0.5519691869849339, + 0.6525373689946719, + 0.7501419379841536, + 0.8534144180011936, + 0.9578382199979387, + 1.059848208038602, + 1.1656959439860657, + 1.2677322840318084, + 1.3727354200091213, + 1.4715193290030584, + 1.5784940680023283, + 1.6797363520017825, + 1.7814023999962956, + 1.8905477520311251, + 1.9995289419894107, + 2.1085798130370677, + 2.21213776798686, + 2.313356052036397, + 2.418682423012797, + 2.5230738740065135, + 2.630812188028358, + 2.7319770000176504, + 2.828609463002067, + 2.9336655440274626, + 3.0371262499829754, + 3.1381933800294064, + 3.239936789032072, + 3.34469400299713, + 3.452176731021609, + 3.5587857229984365, + 3.6677550250315107, + 3.778447607997805, + 3.884635859983973, + 3.9926868340116926, + 4.0997595739900135, + 4.206721064983867, + 4.314376051013824, + 4.4179393330123276, + 4.525833152991254, + 4.637409377028234, + 4.74716491100844, + 4.8604697590344585, + 4.966488169040531, + 5.07276578200981, + 5.176117014023475, + 5.278032393020112, + 5.378862129000481, + 5.483361917024013, + 5.5910553830326535, + 5.69979714701185, + 5.810909510008059, + 5.918482911016326, + 6.018240781035274, + 6.124234599003103, + 6.2296882520313375, + 6.332419543003198, + 6.432998172997031, + 6.537626968987752, + 6.6398939520004205, + 6.739368667011149, + 6.843826677999459, + 6.953259313013405, + 7.058145216025878, + 7.157470281992573, + 7.26547893602401, + 7.367986591998488, + 7.47757318103686, + 7.5850866450346075, + 7.690594154992141, + 7.792434284987394, + 7.8964661480276845, + 7.999185597989708, + 8.105097447987646, + 8.205639021005481, + 8.306720920023508, + 8.381206275022123, + 8.461916203028522, + 8.539118960034102, + 8.608444729994517 + ], + "chunk_gaps_ms": { + "count": 81, + "p50": 104.49978802353144, + "p95": 110.69258296629414, + "max": 230.5944380350411 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 59.55623298530414, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 8.694868230028078, + "end_to_end_tps": 58.885308719433766, + "timing_valid": true, + "steady_tps": 61.22950066867642, + "per_stream_tps": [ + 31.3, + 29.8 + ], + "ttft_s": [ + 0.26, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2582637759624049, + "decode_tps": 31.343155260616857, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.20814416512659, + "prefill_tps": 54.20814416512659, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 31.9048925254987, + "round_gap_p50_ms": 105.20317102782428, + "round_gap_p95_ms": 113.99496800731868, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0009923769976012409, + "first_payload_s": 0.2582637759624049, + "first_content_s": 0.2582637759624049, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2582637759624049, + "last_output_s": 8.394011369964574 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13144127902342007, + "decode_tps": 29.77811649265207, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 106.51144072864275, + "prefill_tps": 106.51144072864275, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 33.58170756860179, + "round_gap_p50_ms": 105.09531397838145, + "round_gap_p95_ms": 114.0398159623146, + "tokens_per_chunk": 3.1219512195121952, + "headers_s": 0.0008676730212755501, + "first_payload_s": 0.13144127902342007, + "first_content_s": 0.13144127902342007, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13144127902342007, + "last_output_s": 8.694776709016878 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 32.74330004705025, + "round_gap_p50_ms": 105.09531397838145, + "round_gap_p95_ms": 114.0398159623146, + "round_gap_mean_ms": 105.69039888604827, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 108.31839342445133, + "aggregate_prefill_tps": 108.31839342445133 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396020.409524366, + "first": 396020.667788142, + "last": 396028.803535736, + "end": 396028.803732762, + "elapsed_s": 8.394208395970054, + "chunk_offsets_s": [ + 0.2582637759624049, + 0.36098223499720916, + 0.45510481897508726, + 0.5557185529614799, + 0.6566828029463068, + 0.7548960179556161, + 0.8543660459690727, + 0.9605326649616472, + 1.0625555489677936, + 1.1663228019606322, + 1.268345477990806, + 1.376665461983066, + 1.4887357069528662, + 1.608548489981331, + 1.720813775958959, + 1.8374478239566088, + 1.9693257469916716, + 2.077704803959932, + 2.1847426799940877, + 2.2879158789874054, + 2.388628782995511, + 2.494331829948351, + 2.597642629989423, + 2.703770033956971, + 2.806401739944704, + 2.9027048089774325, + 3.0077935939771123, + 3.107568407955114, + 3.2085127539467067, + 3.3108355929725803, + 3.416152013000101, + 3.523674484982621, + 3.632362521952018, + 3.742094343993813, + 3.8528376469621435, + 3.956536771962419, + 4.062603902944829, + 4.16936831997009, + 4.278558040969074, + 4.386074465990532, + 4.492423582996707, + 4.601303876959719, + 4.7139540639473125, + 4.825430845958181, + 4.939425813965499, + 5.045375502959359, + 5.150578673987184, + 5.255944053991698, + 5.357936745975167, + 5.459739691985305, + 5.562796489975881, + 5.6686831709812395, + 5.776569327979814, + 5.886179628956597, + 5.99405682500219, + 6.095366981986444, + 6.199552815000061, + 6.30535656795837, + 6.406947896000929, + 6.507863552949857, + 6.614433616981842, + 6.718349094968289, + 6.8198671589489095, + 6.924255953985266, + 7.030953058972955, + 7.136004036001395, + 7.236658666981384, + 7.346346472972073, + 7.4498153229942545, + 7.563487934996374, + 7.671958560997155, + 7.779298583976924, + 7.882944299955852, + 7.986964131996501, + 8.089926672982983, + 8.193849414994475, + 8.294413804949727, + 8.394011369964574 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 105.20317102782428, + "p95": 113.99496800731868, + "max": 131.87792303506285 + } + }, + { + "start": 396020.409290955, + "first": 396020.540732234, + "last": 396029.104067664, + "end": 396029.104159185, + "elapsed_s": 8.694868230028078, + "chunk_offsets_s": [ + 0.13144127902342007, + 0.3614525599987246, + 0.45515323599101976, + 0.5560497890110128, + 0.657007911009714, + 0.7553651910275221, + 0.8547683380311355, + 0.9609635180095211, + 1.0630179540021345, + 1.1663493950036354, + 1.2688035790342838, + 1.3770439950167201, + 1.4888757729786448, + 1.608995535003487, + 1.7212665650295094, + 1.8378454450285062, + 1.9692852990119718, + 2.078049639996607, + 2.185090171988122, + 2.2882257549790666, + 2.3889753150288016, + 2.494689257990103, + 2.5979866820271127, + 2.703673905984033, + 2.806187738024164, + 2.903062716999557, + 3.0081470540026203, + 3.107578200986609, + 3.208876646007411, + 3.3106381199904718, + 3.4164941129856743, + 3.524016442010179, + 3.632365834026132, + 3.7425086200237274, + 3.8531413950258866, + 3.9568659440265037, + 4.0629657310200855, + 4.169369777024258, + 4.278898205026053, + 4.386107922997326, + 4.492446624033619, + 4.601635336992331, + 4.714259970991407, + 4.825744674017187, + 4.939784489979502, + 5.045370479987469, + 5.150597379019018, + 5.256247257988434, + 5.3582689259783365, + 5.460084896010812, + 5.563141998020001, + 5.669004775001667, + 5.7769106440246105, + 5.886544065026101, + 5.993813591019716, + 6.095383751031477, + 6.199862867011689, + 6.305367737018969, + 6.406936888000928, + 6.508231269021053, + 6.614465089980513, + 6.718337928003166, + 6.81964451703243, + 6.924605734006036, + 7.031264566001482, + 7.136359879979864, + 7.237014383019414, + 7.346351978019811, + 7.449842956033535, + 7.563490768021438, + 7.67188249703031, + 7.779620268032886, + 7.882942012976855, + 7.987293159007095, + 8.090237492986489, + 8.193971192988101, + 8.294833745982032, + 8.394896131998394, + 8.46856003900757, + 8.548404710018076, + 8.62534469802631, + 8.694776709016878 + ], + "chunk_gaps_ms": { + "count": 81, + "p50": 105.09531397838145, + "p95": 114.0398159623146, + "max": 230.01128097530454 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "code", + "temperature": 1.0, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 73.5, + "per_stream_tps": 18.9, + "ttft_s_max": 0.52, + "request": { + "ttft_s": 0.324, + "decode_tps": 18.945, + "prompt_ttft_tps": 44.937, + "prefill_tps": 44.937, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.786, + "round_gap_p50_ms": 166.732, + "round_gap_p95_ms": 199.402, + "tokens_per_chunk": 3.221, + "headers_s": 0.001, + "first_payload_s": 0.324, + "first_content_s": 0.324, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.324, + "last_output_s": 13.624 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 109.178, + "aggregate_prefill_tps": 109.178, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.742, + "round_gap_p50_ms": 166.886, + "round_gap_p95_ms": 199.448, + "tokens_per_chunk": 3.2 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 73.04807705414694, + "makespan_s": 14.018165040004533, + "steady_tps": 75.3, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 73.42529611868142, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 14.022353611013386, + "end_to_end_tps": 73.02625710392395, + "timing_valid": true, + "steady_tps": 75.33645014966106, + "per_stream_tps": [ + 19.5, + 18.5, + 18.9, + 18.9 + ], + "ttft_s": [ + 0.51, + 0.26, + 0.39, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.512130327988416, + "decode_tps": 19.49282558566538, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.336791505768176, + "prefill_tps": 27.336791505768176, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.30092585116954, + "round_gap_p50_ms": 168.39160199742764, + "round_gap_p95_ms": 199.44815599592403, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0012094840058125556, + "first_payload_s": 0.512130327988416, + "first_content_s": 0.512130327988416, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.512130327988416, + "last_output_s": 13.593866420036647 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.25870062998728827, + "decode_tps": 18.527509263497482, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.11660574884536, + "prefill_tps": 54.11660574884536, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.97379570983021, + "round_gap_p50_ms": 167.4912900198251, + "round_gap_p95_ms": 199.28410602733493, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.0012652130099013448, + "first_payload_s": 0.25870062998728827, + "first_content_s": 0.25870062998728827, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.25870062998728827, + "last_output_s": 14.022018535993993 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38574314600555226, + "decode_tps": 18.860322519173366, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.29358070252916, + "prefill_tps": 36.29358070252916, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.02136265079253, + "round_gap_p50_ms": 167.7104759728536, + "round_gap_p95_ms": 199.35623498167843, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.0011718349996954203, + "first_payload_s": 0.38574314600555226, + "first_content_s": 0.38574314600555226, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38574314600555226, + "last_output_s": 13.906190621957649 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13046808599028736, + "decode_tps": 18.938573772809928, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 107.30593534607554, + "prefill_tps": 107.30593534607554, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.80228659222998, + "round_gap_p50_ms": 168.08891104301438, + "round_gap_p95_ms": 203.44453101279214, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.001274796959478408, + "first_payload_s": 0.13046808599028736, + "first_content_s": 0.13046808599028736, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13046808599028736, + "last_output_s": 13.595051167008933 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.77459270100557, + "round_gap_p50_ms": 168.02719800034538, + "round_gap_p95_ms": 199.44815599592403, + "round_gap_mean_ms": 170.34836884501797, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 109.17792362170192, + "aggregate_prefill_tps": 109.17792362170192 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396029.106476295, + "first": 396029.618606623, + "last": 396042.700342715, + "end": 396042.701046257, + "elapsed_s": 13.594569962006062, + "chunk_offsets_s": [ + 0.512130327988416, + 0.6702004710095935, + 0.8197675720439292, + 0.9634983930154704, + 1.1200458169914782, + 1.2641498260200024, + 1.4120807510334998, + 1.5875425490085036, + 1.7838248030166142, + 1.977858603990171, + 2.174572910007555, + 2.3815545469988137, + 2.585004518041387, + 2.7844526740373112, + 3.0000567940296605, + 3.1639540010364726, + 3.3272230899892747, + 3.492672775988467, + 3.6565326059935614, + 3.8211777239921503, + 3.9842241550213657, + 4.151592259004246, + 4.323188692040276, + 4.487759730021935, + 4.650738608033862, + 4.8149384740390815, + 4.982266914041247, + 5.146660366037395, + 5.312701273011044, + 5.469624396995641, + 5.63110057299491, + 5.797085352009162, + 5.967719376028981, + 6.140239818021655, + 6.3134971630061045, + 6.481888765003532, + 6.649065476027317, + 6.8159449200029485, + 6.984677180997096, + 7.160852171014994, + 7.330068117007613, + 7.499058973044157, + 7.676126867008861, + 7.8557176170288585, + 8.036843870009761, + 8.201640109007712, + 8.375624646025244, + 8.546939619991463, + 8.72273367800517, + 8.891576037043706, + 9.064943639037665, + 9.238547195040155, + 9.41372707101982, + 9.586805183032993, + 9.75665164703969, + 9.9176062180195, + 10.076995445997454, + 10.241453875030857, + 10.405043543025386, + 10.56557050999254, + 10.730822771030944, + 10.897432291996665, + 11.064962046046276, + 11.236812130024191, + 11.409521726018284, + 11.577966545999516, + 11.747196476033423, + 11.92336305003846, + 12.091875788988546, + 12.269408440042753, + 12.44421616801992, + 12.616988661000505, + 12.784504863026086, + 12.949696883035358, + 13.115341035998426, + 13.284081474004779, + 13.4400942689972, + 13.593866420036647 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 168.39160199742764, + "p95": 199.44815599592403, + "max": 215.6041199923493 + } + }, + { + "start": 396029.105802192, + "first": 396029.364502822, + "last": 396043.127820728, + "end": 396043.128036026, + "elapsed_s": 14.022233834024519, + "chunk_offsets_s": [ + 0.25870062998728827, + 0.6712194100255147, + 0.8202660100068897, + 0.9644157310249284, + 1.1207931370008737, + 1.2646036709775217, + 1.412571332999505, + 1.588072842976544, + 1.7844131140154786, + 1.9785963870235719, + 2.175169572001323, + 2.3820918640121818, + 2.585759949986823, + 2.785044056014158, + 3.0008802100201137, + 3.1647402009693906, + 3.3279494490125217, + 3.4935311200097203, + 3.6570227870251983, + 3.8216947379987687, + 3.984674319974147, + 4.152102008985821, + 4.323698042018805, + 4.488261286984198, + 4.651270437985659, + 4.815413886972237, + 4.982787030981854, + 5.147507078014314, + 5.313260686991271, + 5.4701199710252695, + 5.631589985976461, + 5.797571068978868, + 5.968581160996109, + 6.14071998297004, + 6.314089377003256, + 6.482392659003381, + 6.649565241008531, + 6.816463452996686, + 6.98543698102003, + 7.161688514985144, + 7.3304994979989715, + 7.499426305002999, + 7.6765847760252655, + 7.856239589978941, + 8.037326610996388, + 8.202385717013385, + 8.376400622015353, + 8.547437064989936, + 8.723134337982628, + 8.892310652008746, + 9.065547885023989, + 9.23931181099033, + 9.414190804003738, + 9.587333892006427, + 9.757149251992814, + 9.91834547399776, + 10.077447611023672, + 10.241972727992106, + 10.405441260023508, + 10.566297030018177, + 10.731373752001673, + 10.897871800989378, + 11.065363091009203, + 11.237218694994226, + 11.410094276012387, + 11.578569528006483, + 11.747690112970304, + 11.924125729012303, + 12.092337825975846, + 12.269902860978618, + 12.444757341989316, + 12.617473481979687, + 12.785240022989456, + 12.950053399021272, + 13.115828961017542, + 13.284464821976144, + 13.440822725009639, + 13.594369416998234, + 13.706294732983224, + 13.813317089981865, + 13.906898853019811, + 13.973241842992138, + 14.022018535993993 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 167.62891551479697, + "p95": 199.28410602733493, + "max": 412.5187800382264 + } + }, + { + "start": 396029.106402438, + "first": 396029.492145584, + "last": 396043.01259306, + "end": 396043.012909175, + "elapsed_s": 13.906506736995652, + "chunk_offsets_s": [ + 0.38574314600555226, + 0.6699376049800776, + 0.8196175229968503, + 0.9634251929819584, + 1.1199037680053152, + 1.2638513119891286, + 1.411807948956266, + 1.5874091719742864, + 1.783623458002694, + 1.9776350659667514, + 2.1744276129757054, + 2.3814186579547822, + 2.5848459730041213, + 2.7842022079857998, + 2.9999018170055933, + 3.1638755520107225, + 3.327054191962816, + 3.4930501399794593, + 3.6562236119643785, + 3.8210550989606418, + 3.9841246659634635, + 4.1514478419558145, + 4.323063650983386, + 4.487710865971167, + 4.650639902974945, + 4.814856648968998, + 4.982270514010452, + 5.146656125958543, + 5.312492935976479, + 5.469485339999665, + 5.630952236009762, + 5.797899872006383, + 5.967698383959942, + 6.140047800960019, + 6.313717853976414, + 6.481745051976759, + 6.648928482958581, + 6.815817190974485, + 6.984675581974443, + 7.160833594971336, + 7.329942995973397, + 7.498970668006223, + 7.676402149954811, + 7.855553598958068, + 8.036586411006283, + 8.201632717973553, + 8.37561894999817, + 8.546787506958935, + 8.722612204961479, + 8.891560501011554, + 9.064904870989267, + 9.238536635995843, + 9.413557229971047, + 9.586673837970011, + 9.756497629976366, + 9.91757869796129, + 10.076897446007933, + 10.241294401988853, + 10.40501955896616, + 10.565545357996598, + 10.730655024992302, + 10.897201746003702, + 11.064912221976556, + 11.236427326977719, + 11.409322221006732, + 11.577918449009303, + 11.747044570976868, + 11.923354186001234, + 12.091689035994932, + 12.269269478973001, + 12.444038614979945, + 12.616824931988958, + 12.784493519982789, + 12.949940917955246, + 13.115198315004818, + 13.28431003598962, + 13.440059788990766, + 13.594880717981141, + 13.705625078000594, + 13.812685162993148, + 13.906190621957649 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 167.8688369865995, + "p95": 199.35623498167843, + "max": 284.19445897452533 + } + }, + { + "start": 396029.105682415, + "first": 396029.236150501, + "last": 396042.700733582, + "end": 396042.700806239, + "elapsed_s": 13.595123823964968, + "chunk_offsets_s": [ + 0.13046808599028736, + 0.6707709889742546, + 0.8204614669666626, + 0.9646102919941768, + 1.1207420169957913, + 1.2646548069897108, + 1.4126000209944323, + 1.5882549089728855, + 1.7844343300093897, + 1.978473394003231, + 2.1752359409583732, + 2.38226780196419, + 2.585712332976982, + 2.7849773839698173, + 3.0007698569679633, + 3.16464619996259, + 3.3279257849790156, + 3.4935886889579706, + 3.657254134013783, + 3.821865283010993, + 3.9849401940009557, + 4.1522962669841945, + 4.323868139006663, + 4.488472488999832, + 4.651448166987393, + 4.8156506569939665, + 4.983123482961673, + 5.147554726980161, + 5.313270478975028, + 5.4704644219600596, + 5.631745971972123, + 5.7983493490028195, + 5.968830314988736, + 6.141093507001642, + 6.314498244959395, + 6.482570563966874, + 6.649747658986598, + 6.81694000196876, + 6.985729943960905, + 7.161842820991296, + 7.330726812011562, + 7.49973861197941, + 7.677279389987234, + 7.856403384008445, + 8.037526196974795, + 8.202572870999575, + 8.376565615006257, + 8.547617562988307, + 8.723419604997616, + 8.892579390958417, + 9.065826656005811, + 9.239500452997163, + 9.41440122196218, + 9.587492981983814, + 9.757326453982387, + 9.918512850999832, + 10.077696156979073, + 10.242131161969155, + 10.405621644982602, + 10.566464694973547, + 10.731436056958046, + 10.898154634982347, + 11.065542963973712, + 11.237664123007562, + 11.410767146968283, + 11.578856058011297, + 11.747865971003193, + 11.9242804509704, + 12.092514980002306, + 12.270085791009478, + 12.445061600999907, + 12.617664540011901, + 12.785430568968877, + 12.950422010966577, + 13.116022306960076, + 13.284716455964372, + 13.441000502964016, + 13.595051167008933 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 168.08891104301438, + "p95": 203.44453101279214, + "max": 540.3029029839672 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 74.8049445502601, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 13.768389064003713, + "end_to_end_tps": 74.37326147887273, + "timing_valid": true, + "steady_tps": 76.66015790409759, + "per_stream_tps": [ + 19.5, + 18.7, + 19.4, + 19.7 + ], + "ttft_s": [ + 0.26, + 0.13, + 0.51, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2590964589617215, + "decode_tps": 19.49352671567011, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 54.0339302825761, + "prefill_tps": 54.0339302825761, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.29908069411256, + "round_gap_p50_ms": 165.9917079959996, + "round_gap_p95_ms": 186.10271700890735, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.001083850977011025, + "first_payload_s": 0.2590964589617215, + "first_content_s": 0.2590964589617215, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2590964589617215, + "last_output_s": 13.340362035960425 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13234432798344642, + "decode_tps": 18.701236137565026, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 105.78466197471731, + "prefill_tps": 105.78466197471731, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 53.47240110996234, + "round_gap_p50_ms": 165.49767198739573, + "round_gap_p95_ms": 178.9597210008651, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.001059081987477839, + "first_payload_s": 0.13234432798344642, + "first_content_s": 0.13234432798344642, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13234432798344642, + "last_output_s": 13.767806611023843 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5128244659863412, + "decode_tps": 19.407239579338412, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.29978955483938, + "prefill_tps": 27.29978955483938, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.52716314506845, + "round_gap_p50_ms": 165.50568799721077, + "round_gap_p95_ms": 177.9965750174597, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.0020975720253773034, + "first_payload_s": 0.5128244659863412, + "first_content_s": 0.5128244659863412, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5128244659863412, + "last_output_s": 13.652251067978796 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38627657695906237, + "decode_tps": 19.68483984863927, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 36.24346086478788, + "prefill_tps": 36.24346086478788, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 50.800514898226396, + "round_gap_p50_ms": 165.9562029526569, + "round_gap_p95_ms": 186.61577900638804, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0019394260016269982, + "first_payload_s": 0.38627657695906237, + "first_content_s": 0.38627657695906237, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38627657695906237, + "last_output_s": 13.340407876006793 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 51.77478996184244, + "round_gap_p50_ms": 165.64194503007457, + "round_gap_p95_ms": 179.75864000618458, + "round_gap_mean_ms": 167.1211574717699, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 109.18153331491736, + "aggregate_prefill_tps": 109.18153331491736 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396043.129939804, + "first": 396043.389036263, + "last": 396056.47030184, + "end": 396056.470410593, + "elapsed_s": 13.340470789000392, + "chunk_offsets_s": [ + 0.2590964589617215, + 0.6702942839474417, + 0.8203660949948244, + 0.9624645169824362, + 1.1189407569472678, + 1.261954307963606, + 1.4096163520007394, + 1.5648032359895296, + 1.720295418985188, + 1.8763811909593642, + 2.0309397969977, + 2.1933468459756114, + 2.3566714889602736, + 2.517389001965057, + 2.6841560769826174, + 2.8482374789891765, + 3.0133868899429217, + 3.1847585379728116, + 3.350750245968811, + 3.515538021980319, + 3.6785484369611368, + 3.8439326679799706, + 4.0137745249667205, + 4.1783956429571845, + 4.340746035974007, + 4.504497082962189, + 4.669834175962023, + 4.834024426992983, + 4.999680868000723, + 5.157666194951162, + 5.322467202960979, + 5.489113573974464, + 5.659891039947979, + 5.832333353988361, + 6.004435664974153, + 6.174537555954885, + 6.342772837961093, + 6.5078736579744145, + 6.676819873973727, + 6.848756198945921, + 7.0153224089881405, + 7.183974606974516, + 7.357680580986198, + 7.533803794998676, + 7.711819890944753, + 7.877164215955418, + 8.052347900986206, + 8.223529802984558, + 8.402846726996358, + 8.569763596984558, + 8.74149479996413, + 8.912925504962914, + 9.08687578496756, + 9.261428567988332, + 9.429829370987136, + 9.592855754948687, + 9.751325966964941, + 9.911432354943827, + 10.074428833962884, + 10.23467872699257, + 10.397894872992765, + 10.563522465992719, + 10.727111814951058, + 10.898540183959994, + 11.071509670990054, + 11.240178140986245, + 11.413849139993545, + 11.612529178964905, + 11.798631895973813, + 12.01110056397738, + 12.187272209965158, + 12.363554545969237, + 12.530288804962765, + 12.69715866597835, + 12.863769708957989, + 13.028852495946921, + 13.18610044097295, + 13.340362035960425 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 165.9917079959996, + "p95": 186.10271700890735, + "max": 411.1978249857202 + } + }, + { + "start": 396043.129689642, + "first": 396043.26203397, + "last": 396056.897496253, + "end": 396056.897718159, + "elapsed_s": 13.768028517020866, + "chunk_offsets_s": [ + 0.13234432798344642, + 0.670448780991137, + 0.8205245599965565, + 0.9626385340234265, + 1.119125735014677, + 1.2621261490276083, + 1.4097027520183474, + 1.564967525016982, + 1.7206833899836056, + 1.8765788240125403, + 2.0311063419794664, + 2.193443326978013, + 2.3567955369944684, + 2.5175715149962343, + 2.6841539809829555, + 2.848531096999068, + 3.0135602679802105, + 3.184887627023272, + 3.3508424059837125, + 3.5156795430229977, + 3.6784287560149096, + 3.8439169229823165, + 4.01390972500667, + 4.178591820993461, + 4.3408986770082265, + 4.504530859005172, + 4.67002721800236, + 4.833988361991942, + 4.9996303070220165, + 5.157793636026327, + 5.322470579005312, + 5.488805793982465, + 5.659991824009921, + 5.832415866025258, + 6.004562354006339, + 6.174996279994957, + 6.342970776022412, + 6.507892233028542, + 6.677005139004905, + 6.848921464988962, + 7.0153727770084515, + 7.183980381989386, + 7.357805637991987, + 7.534100069024134, + 7.712126981001347, + 7.877221992996056, + 8.052658880013041, + 8.223589018976782, + 8.402548739977647, + 8.569887708988972, + 8.741479902993888, + 8.913077954028267, + 9.087055579002481, + 9.261910956003703, + 9.429971563979052, + 9.592962827999145, + 9.751726259011775, + 9.911542340007145, + 10.074616916012019, + 10.23466872703284, + 10.398026298033074, + 10.56352397002047, + 10.727293353003915, + 10.898973739997018, + 11.072421360004228, + 11.240304349979851, + 11.413921556028072, + 11.61264517903328, + 11.799552177020814, + 12.011515591002535, + 12.187216497026384, + 12.363694787025452, + 12.53042008599732, + 12.697272602992598, + 12.863701787020545, + 13.029479269986041, + 13.186484428006224, + 13.339947215979919, + 13.451548097014893, + 13.55983073898824, + 13.652254300017375, + 13.718901069019921, + 13.767806611023843 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 165.56980850873515, + "p95": 178.9597210008651, + "max": 538.1044530076906 + } + }, + { + "start": 396043.129411879, + "first": 396043.642236345, + "last": 396056.781662947, + "end": 396056.782031623, + "elapsed_s": 13.652619744010735, + "chunk_offsets_s": [ + 0.5128244659863412, + 0.6706511679803953, + 0.8206930420128629, + 0.96285887301201, + 1.1191242630011402, + 1.262559529975988, + 1.409812833997421, + 1.5651773670106195, + 1.7206501420005225, + 1.87680825102143, + 2.031314216030296, + 2.1936681770021096, + 2.357706265989691, + 2.5176782840280794, + 2.6843708470114507, + 2.848511800984852, + 3.013789214019198, + 3.1850846050074324, + 3.3510403449763544, + 3.51589465001598, + 3.6786077020224184, + 3.8440897570108064, + 4.014113488025032, + 4.178693629975896, + 4.341114935989026, + 4.50471407698933, + 4.670112339023035, + 4.834188508975785, + 4.999827717023436, + 5.158007733989507, + 5.322647077031434, + 5.489015109022148, + 5.660202050989028, + 5.83261239703279, + 6.004733540001325, + 6.175145402026828, + 6.343158202013001, + 6.508077163016424, + 6.677181910024956, + 6.849133579002228, + 7.015577307029162, + 7.184179073025007, + 7.3578607109957375, + 7.534111462009605, + 7.712108037027065, + 7.8773709060042165, + 8.052674880018458, + 8.22380873397924, + 8.40265055000782, + 8.570094640017487, + 8.741678722028155, + 8.91329722001683, + 9.087201019981876, + 9.262129119015299, + 9.43028020800557, + 9.59315222199075, + 9.751943173003383, + 9.911729349987581, + 10.07459336402826, + 10.234862344979774, + 10.398208620026708, + 10.563714308023918, + 10.727513611025643, + 10.8989646040136, + 11.071910827013198, + 11.240505937021226, + 11.414132070029154, + 11.612822221009992, + 11.799023276020307, + 12.011193973012269, + 12.187404595024418, + 12.363813587988261, + 12.530629736022092, + 12.697286874987185, + 12.863917454029433, + 13.029454373987392, + 13.186276170017663, + 13.340506390028168, + 13.451762836019043, + 13.560035973030608, + 13.652251067978796 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 165.52130397758447, + "p95": 177.9965750174597, + "max": 212.17069699196145 + } + }, + { + "start": 396043.129329095, + "first": 396043.515605672, + "last": 396056.469736971, + "end": 396056.470049086, + "elapsed_s": 13.340719991014339, + "chunk_offsets_s": [ + 0.38627657695906237, + 0.6709672819706611, + 0.8206955849891528, + 0.9631428589927964, + 1.1193006319808774, + 1.2624262640019879, + 1.409821936977096, + 1.5655691460124217, + 1.7208486709860153, + 1.8768297859933227, + 2.031604329997208, + 2.193662447971292, + 2.3581723499810323, + 2.5178812139783986, + 2.6846065599820577, + 2.848683177959174, + 3.0140820639790036, + 3.1857715870137326, + 3.35141882696189, + 3.515911913011223, + 3.678996825008653, + 3.84495302796131, + 4.014481121965218, + 4.178892399009783, + 4.34112167096464, + 4.505061839008704, + 4.670328339969274, + 4.834438654012047, + 5.000073926988989, + 5.158344968978781, + 5.322903543012217, + 5.489623417961411, + 5.660445955989417, + 5.833104911958799, + 6.00499630899867, + 6.175291706982534, + 6.343803310999647, + 6.508954354969319, + 6.6774830800131895, + 6.849477820971515, + 7.016400819004048, + 7.184689460962545, + 7.358242793998215, + 7.5343206789693795, + 7.71237378299702, + 7.877716701012105, + 8.052904640964698, + 8.224084623972885, + 8.40384326397907, + 8.570328800997231, + 8.742477128980681, + 8.914044649980497, + 9.087549678981304, + 9.262127037975006, + 9.430504081014078, + 9.593394430994522, + 9.752234407002106, + 9.911996662965976, + 10.075410315010231, + 10.235662975988816, + 10.398457133967895, + 10.564057621988468, + 10.728157087985892, + 10.899802963016555, + 11.07256952096941, + 11.240733409998938, + 11.414362856012303, + 11.613088782993145, + 11.799704561999533, + 12.011385221965611, + 12.187716485001147, + 12.363694450003095, + 12.530981994990725, + 12.697445675963536, + 12.864572834980208, + 13.029738423996605, + 13.186442298989277, + 13.340407876006793 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 165.9562029526569, + "p95": 186.61577900638804, + "max": 284.69070501159877 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 73.46329524941623, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 14.018165040004533, + "end_to_end_tps": 73.04807705414694, + "timing_valid": true, + "steady_tps": 75.30745749986232, + "per_stream_tps": [ + 19.1, + 18.9, + 18.9, + 19.0 + ], + "ttft_s": [ + 0.26, + 0.52, + 0.39, + 0.13 + ], + "errors": [], + "thinking_modes": [ + "not applicable" + ], + "requests": [ + { + "prompt_tokens": 14, + "ttft_s": 0.2612863690010272, + "decode_tps": 19.132671206238555, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 53.58105764769138, + "prefill_tps": 53.58105764769138, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.26661709808361, + "round_gap_p50_ms": 167.03400696860626, + "round_gap_p95_ms": 220.20810196409002, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0017517280066385865, + "first_payload_s": 0.2612863690010272, + "first_content_s": 0.2612863690010272, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.2612863690010272, + "last_output_s": 13.589273729012348 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.5182890339638107, + "decode_tps": 18.88980461906954, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 27.011954879557695, + "prefill_tps": 27.011954879557695, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.938610015610486, + "round_gap_p50_ms": 166.12705501029268, + "round_gap_p95_ms": 214.01301899459213, + "tokens_per_chunk": 3.0843373493975905, + "headers_s": 0.0021749489824287593, + "first_payload_s": 0.5182890339638107, + "first_content_s": 0.5182890339638107, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5182890339638107, + "last_output_s": 14.017634587944485 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.38943305698921904, + "decode_tps": 18.870730642901304, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 35.94969597146339, + "prefill_tps": 35.94969597146339, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.992118796214974, + "round_gap_p50_ms": 166.4290580083616, + "round_gap_p95_ms": 219.850835041143, + "tokens_per_chunk": 3.1604938271604937, + "headers_s": 0.0014882539981044829, + "first_payload_s": 0.38943305698921904, + "first_content_s": 0.38943305698921904, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38943305698921904, + "last_output_s": 13.902423350024037 + }, + { + "prompt_tokens": 14, + "ttft_s": 0.13354931602953002, + "decode_tps": 18.950531154197996, + "thinking": "not applicable", + "thinking_off_requested": false, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 104.83018869901484, + "prefill_tps": 104.83018869901484, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.76896947442426, + "round_gap_p50_ms": 167.03955898992717, + "round_gap_p95_ms": 219.9463240103796, + "tokens_per_chunk": 3.282051282051282, + "headers_s": 0.0017402879893779755, + "first_payload_s": 0.13354931602953002, + "first_content_s": 0.13354931602953002, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.13354931602953002, + "last_output_s": 13.589636532007717 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 52.741578846083335, + "round_gap_p50_ms": 166.88645398244262, + "round_gap_p95_ms": 219.91193998837844, + "round_gap_mean_ms": 170.24180513609178, + "tokens_per_chunk": 3.2, + "aggregate_prompt_ttft_tps": 107.96461167707784, + "aggregate_prefill_tps": 107.96461167707784 + }, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "4ea5890db75b", + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "9ad5da4b74fc", + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "e83550d98e0d", + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "6b0505e27f4f", + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396056.899830212, + "first": 396057.161116581, + "last": 396070.489103941, + "end": 396070.48963617, + "elapsed_s": 13.58980595797766, + "chunk_offsets_s": [ + 0.2612863690010272, + 0.677532900008373, + 0.8275774159701541, + 0.9712535329745151, + 1.1261211190139875, + 1.2703809869708493, + 1.4186721249716356, + 1.5748401550226845, + 1.7295607309788465, + 1.8859489239985123, + 2.040713548019994, + 2.2034351939801127, + 2.364609415992163, + 2.525635236990638, + 2.691815714992117, + 2.8545723690185696, + 3.0193898099823855, + 3.1871639040182345, + 3.351344203983899, + 3.515541366999969, + 3.6803963929996826, + 3.84854349802481, + 4.020151645003352, + 4.183862404024694, + 4.345026689989027, + 4.508379285980482, + 4.676254981022794, + 4.840664946008474, + 5.00769895297708, + 5.16523598897038, + 5.328295829007402, + 5.496458359004464, + 5.66724590602098, + 5.83980762999272, + 6.014595134998672, + 6.182417566014919, + 6.350436125998385, + 6.51672143797623, + 6.685861800971907, + 6.862600238004234, + 7.031306404969655, + 7.200736835016869, + 7.376093354017939, + 7.570213700993918, + 7.796620536013506, + 8.00175825302722, + 8.222660747007467, + 8.442868848971557, + 8.662736229016446, + 8.871169433987234, + 9.085147909005173, + 9.258362327003852, + 9.43042599898763, + 9.601620014000218, + 9.769606605987065, + 9.932955218013376, + 10.09081923298072, + 10.251424634014256, + 10.414367482007947, + 10.573670967016369, + 10.737328462011646, + 10.905053643975407, + 11.068280413979664, + 11.240110418992117, + 11.411381044017617, + 11.579909880994819, + 11.74811788398074, + 11.92482860799646, + 12.09142025897745, + 12.26751371397404, + 12.442079552973155, + 12.614013671991415, + 12.78099660697626, + 12.948588538973127, + 13.113392508996185, + 13.279267160978634, + 13.43540492001921, + 13.589273729012348 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 167.03400696860626, + "p95": 220.20810196409002, + "max": 416.24653100734577 + } + }, + { + "start": 396056.899927508, + "first": 396057.418216542, + "last": 396070.917562096, + "end": 396070.917693105, + "elapsed_s": 14.017765596974641, + "chunk_offsets_s": [ + 0.5182890339638107, + 0.6774912209948525, + 0.8272660849615932, + 0.971080956980586, + 1.126134383957833, + 1.270133416983299, + 1.4185098359594122, + 1.5750085579929873, + 1.7297119819559157, + 1.8856196249835193, + 2.0403818499762565, + 2.203453242953401, + 2.3646364889573306, + 2.5253893949557096, + 2.691785139963031, + 2.8542288469616324, + 3.0193801949499175, + 3.186671707953792, + 3.3508599439519458, + 3.5151619719690643, + 3.680202711955644, + 3.8483730979496613, + 4.020536289957818, + 4.184700428973883, + 4.344857041956857, + 4.50821488496149, + 4.676027586974669, + 4.840826900966931, + 5.008130157948472, + 5.165280933957547, + 5.328396182972938, + 5.496619464945979, + 5.6673977639875375, + 5.8399219359853305, + 6.014665953000076, + 6.182085323962383, + 6.350248588947579, + 6.516865839948878, + 6.685532806965057, + 6.8629219699651, + 7.031121331965551, + 7.200870740984101, + 7.375412435969338, + 7.570369047985878, + 7.797099420975428, + 8.0018039989518, + 8.22290550195612, + 8.443320422957186, + 8.662769301969092, + 8.871260139974765, + 9.085273158969358, + 9.258136597985867, + 9.430192941974383, + 9.601287803961895, + 9.769794496998657, + 9.932323484972585, + 10.090593519969843, + 10.251922255964018, + 10.41413567296695, + 10.573355252970941, + 10.737046219990589, + 10.905423039977904, + 11.06848379294388, + 11.240207284979988, + 11.411523333983496, + 11.57989616994746, + 11.748251789947972, + 11.925124163972214, + 12.091059056983795, + 12.267313360993285, + 12.441387259983458, + 12.614210282976273, + 12.781945000984706, + 12.948831454967149, + 13.113215531979222, + 13.279342586989515, + 13.435655706969555, + 13.590264154947363, + 13.70058684895048, + 13.808681616967078, + 13.902876090956852, + 13.969244089967106, + 14.017634587944485 + ], + "chunk_gaps_ms": { + "count": 82, + "p50": 166.26140000880696, + "p95": 214.01301899459213, + "max": 226.73037298955023 + } + }, + { + "start": 396056.900266392, + "first": 396057.289699449, + "last": 396070.802689742, + "end": 396070.802955697, + "elapsed_s": 13.902689305017702, + "chunk_offsets_s": [ + 0.38943305698921904, + 0.6769661430153064, + 0.8270805950160138, + 0.9713344780029729, + 1.1253622480435297, + 1.2698769019916654, + 1.4187527180183679, + 1.5745576249901205, + 1.729284841043409, + 1.8854435750399716, + 2.0402140560327098, + 2.202903844998218, + 2.364037443010602, + 2.5251348160090856, + 2.6912836940027773, + 2.854065196006559, + 3.0187462359899655, + 3.1865251300041564, + 3.350678837043233, + 3.5149884020211175, + 3.6802674800273962, + 3.8484201050014235, + 4.019386646046769, + 4.18414671102073, + 4.3443088280037045, + 4.508237909001764, + 4.675773696042597, + 4.8403967680060305, + 5.007372646010481, + 5.165003107045777, + 5.328107523033395, + 5.496180963993538, + 5.666884206002578, + 5.839496442989912, + 6.014247548009735, + 6.182058363046963, + 6.3501062510185875, + 6.516360443027224, + 6.6855053980252706, + 6.862470813037362, + 7.0309840660193, + 7.200709171011113, + 7.375250290031545, + 7.569861170020886, + 7.796265379991382, + 8.001389370008837, + 8.222125158004928, + 8.4425041420036, + 8.662354977044743, + 8.870848375023343, + 9.084775329043623, + 9.257980660011526, + 9.43004029901931, + 9.601114233024418, + 9.76925511501031, + 9.932146202016156, + 10.090438910003286, + 10.25107509503141, + 10.41398199100513, + 10.573177650047, + 10.736997115018312, + 10.904862890020013, + 11.067891899030656, + 11.239522398042027, + 11.411002336011734, + 11.579621879034676, + 11.747767480032053, + 11.924631614005193, + 12.091060672013555, + 12.267179518996272, + 12.441696221998427, + 12.613782422035001, + 12.781165568041615, + 12.948247271997388, + 13.113029242027551, + 13.279079992033076, + 13.435134501021821, + 13.589225567993708, + 13.700158892024774, + 13.808141291025095, + 13.902423350024037 + ], + "chunk_gaps_ms": { + "count": 80, + "p50": 166.70246800640598, + "p95": 219.850835041143, + "max": 287.5330860260874 + } + }, + { + "start": 396056.899528065, + "first": 396057.033077381, + "last": 396070.489164597, + "end": 396070.48929607, + "elapsed_s": 13.589768005011138, + "chunk_offsets_s": [ + 0.13354931602953002, + 0.6777526629739441, + 0.8275510310195386, + 0.9716122570098378, + 1.1261539190309122, + 1.2707294540014118, + 1.419041296991054, + 1.575228622998111, + 1.7299536950304173, + 1.8858943469822407, + 2.040631628013216, + 2.203511465981137, + 2.3648295300081372, + 2.525637956976425, + 2.691893108014483, + 2.8544922239962034, + 3.0193636980256997, + 3.1869187019765377, + 3.3511201849905774, + 3.5154265019809827, + 3.6807741569937207, + 3.8489061419968493, + 4.02037131099496, + 4.184274407976773, + 4.345136162999552, + 4.508829898026306, + 4.676676537026651, + 4.8412739600171335, + 5.008313519007061, + 5.1658212739857845, + 5.328664504981134, + 5.496834858029615, + 5.6675110760261305, + 5.840190625982359, + 6.0148002409841865, + 6.1825703990180045, + 6.350784338021185, + 6.516934112005401, + 6.686020763008855, + 6.862976705015171, + 7.031655976024922, + 7.201119846024085, + 7.375911335984711, + 7.570664601982571, + 7.797062699974049, + 8.002263345988467, + 8.223113454994746, + 8.443059779005125, + 8.662971718993504, + 8.871517980995122, + 9.085367351013701, + 9.258602874004282, + 9.430673153023235, + 9.601763519982342, + 9.769843584974296, + 9.932795936998446, + 10.091058099002112, + 10.251867711020168, + 10.414606251986697, + 10.573815063980874, + 10.737686833017506, + 10.905266429996118, + 11.068511728022713, + 11.240182564011775, + 11.411553285026457, + 11.580135883006733, + 11.748315998003818, + 11.925423925975338, + 12.091563221008983, + 12.26785874099005, + 12.441889888024889, + 12.614398988022003, + 12.781386354996357, + 12.948858189978637, + 13.113822353014257, + 13.279537932015955, + 13.43614579102723, + 13.589636532007717 + ], + "chunk_gaps_ms": { + "count": 77, + "p50": 167.03955898992717, + "p95": 219.9463240103796, + "max": 544.2033469444141 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "4ea5890db75b1c9b8fc29ba1467a8ba880ee9a4a6e2e009e5ae3683bbc1932ba", + "output_sha256": "8858141dc5f6d82ef641c03c1df214c0b501c95d973adf736bd059593cc50e29", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "9ad5da4b74fc2493dcaacc7130b1fe8fb745d3820c1ddf6c80caaa8d77a397ac", + "output_sha256": "84b6e06a8eee8af223ef0b19a1967bfdb89ed7ce858dab71e794c7729cf36a5e", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "e83550d98e0d7410f68de4910cc91c748725489975bba9d48e4d6f680d391ac0", + "output_sha256": "fbf8ca8cde538c9f627907d47854e3966af450d2e7f995c064a03c1956589aa4", + "complete": true, + "error": null, + "thinking": "not applicable" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "alone": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + }, + "serial": { + "tokens": 256, + "token_sha256": "6b0505e27f4ffabd1c4a034fc772125365af3de8cafaba8bbad640ed52eeda03", + "output_sha256": "8a97a0536e2f4488cf017834419cc36cb5755220acb7939c3775907bf4da3c77", + "complete": true, + "error": null, + "thinking": "not applicable" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 36.3, + "per_stream_tps": 36.3, + "ttft_s_max": 0.2, + "request": { + "ttft_s": 0.198, + "decode_tps": 36.32, + "prompt_ttft_tps": 161.834, + "prefill_tps": 161.834, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.533, + "round_gap_p50_ms": 60.033, + "round_gap_p95_ms": 74.491, + "tokens_per_chunk": 2.286, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.198, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.198, + "last_output_s": 7.219 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 161.834, + "aggregate_prefill_tps": 161.834, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.533, + "round_gap_p50_ms": 60.033, + "round_gap_p95_ms": 74.491, + "tokens_per_chunk": 2.286 + }, + "completions": { + "truncated": 3 + }, + "timing_valid": true, + "end_to_end_tps": 35.4616795259311, + "makespan_s": 7.219060219998937, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 37.23973962510745, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.043776018021163, + "end_to_end_tps": 36.34414259411945, + "timing_valid": true, + "per_stream_tps": [ + 37.2 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19612827600212768, + "decode_tps": 37.23973962510745, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 163.15852386145917, + "prefill_tps": 163.15852386145917, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.853034152950652, + "round_gap_p50_ms": 60.03254698589444, + "round_gap_p95_ms": 71.15863799117506, + "tokens_per_chunk": 2.2857142857142856, + "headers_s": 0.001081881986465305, + "first_payload_s": 0.0010940110078081489, + "first_content_s": 0.19612827600212768, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19612827600212768, + "last_output_s": 7.043651985004544 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 26.853034152950652, + "round_gap_p50_ms": 60.03254698589444, + "round_gap_p95_ms": 71.15863799117506, + "round_gap_mean_ms": 61.689402783805555, + "tokens_per_chunk": 2.2857142857142856, + "aggregate_prompt_ttft_tps": 163.15852386145917, + "aggregate_prefill_tps": 163.15852386145917 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396141.764408962, + "first": 396141.960537238, + "last": 396148.808060947, + "end": 396148.80818498, + "elapsed_s": 7.043776018021163, + "chunk_offsets_s": [ + 0.19612827600212768, + 0.2585334060131572, + 0.3190267090103589, + 0.3780090060317889, + 0.4375539650209248, + 0.49767865700414404, + 0.5551947000203654, + 0.6179041370050982, + 0.6839450300321914, + 0.7438592879916541, + 0.8031222430290654, + 0.8586007300182246, + 0.914901786018163, + 0.9746226340066642, + 1.031239836011082, + 1.0894328930298798, + 1.160660732013639, + 1.2200944100040942, + 1.2832251150393859, + 1.3409438470262103, + 1.4009763940121047, + 1.4571446800255217, + 1.5132223090040497, + 1.5752280910382979, + 1.6439801949891262, + 1.7031564459903166, + 1.7618022910319269, + 1.8204449689947069, + 1.881197251030244, + 1.9400186029961333, + 1.996228473028168, + 2.0580610850011, + 2.1277305569965392, + 2.1888574350159615, + 2.246681497024838, + 2.309891819022596, + 2.3682195490109734, + 2.426285822002683, + 2.4850689010345377, + 2.5443844010005705, + 2.6120033250190318, + 2.6716728130122647, + 2.73069607000798, + 2.7886849979986437, + 2.8455997710116208, + 2.90618870704202, + 2.9662358940113336, + 3.0255533150047995, + 3.0919055390404537, + 3.150214564986527, + 3.2071388110052794, + 3.2666253040079027, + 3.325749027018901, + 3.3853031690232456, + 3.4436810290208086, + 3.5059237250243314, + 3.572933252027724, + 3.6348283769912086, + 3.7001554709859192, + 3.7600098400143906, + 3.8312618720228784, + 3.900010310986545, + 3.963051623024512, + 4.029642122040968, + 4.102409608021844, + 4.168803560023662, + 4.23577731003752, + 4.304190049995668, + 4.370416736986954, + 4.4407055110204965, + 4.507818447018508, + 4.5687575790216215, + 4.641642682021484, + 4.709158229001332, + 4.775202787015587, + 4.842180313018616, + 4.913338951009791, + 4.978239193034824, + 5.039120661036577, + 5.100022288039327, + 5.174154506996274, + 5.235586747992784, + 5.302420673018787, + 5.365204335015733, + 5.435447891999502, + 5.501003356999718, + 5.557772001018748, + 5.622729378985241, + 5.690231183019932, + 5.748210302030202, + 5.807767469028477, + 5.865003765036818, + 5.923108549031895, + 5.981138341012411, + 6.03796967404196, + 6.098204111040104, + 6.163127489038743, + 6.221969449019525, + 6.2792388970265165, + 6.336319895985071, + 6.394199926988222, + 6.451657649013214, + 6.507776670041494, + 6.56779576203553, + 6.634241843014024, + 6.691836413985584, + 6.75007412803825, + 6.812187431030907, + 6.873046963009983, + 6.932553777005523, + 6.990098524023779, + 7.043651985004544 + ], + "chunk_gaps_ms": { + "count": 111, + "p50": 60.03254698589444, + "p95": 71.15863799117506, + "max": 74.13221895694733 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 36.31972066026817, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.219060219998937, + "end_to_end_tps": 35.4616795259311, + "timing_valid": true, + "per_stream_tps": [ + 36.3 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.1977334920084104, + "decode_tps": 36.31972066026817, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.83399016004284, + "prefill_tps": 161.83399016004284, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.53325140779363, + "round_gap_p50_ms": 65.77109900536016, + "round_gap_p95_ms": 75.3641999908723, + "tokens_per_chunk": 2.3486238532110093, + "headers_s": 0.0010826339712366462, + "first_payload_s": 0.0010936579783447087, + "first_content_s": 0.1977334920084104, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1977334920084104, + "last_output_s": 7.2187126009957865 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 27.53325140779363, + "round_gap_p50_ms": 65.77109900536016, + "round_gap_p95_ms": 75.3641999908723, + "round_gap_mean_ms": 65.00906582395719, + "tokens_per_chunk": 2.3486238532110093, + "aggregate_prompt_ttft_tps": 161.83399016004284, + "aggregate_prefill_tps": 161.83399016004284 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396148.809102269, + "first": 396149.006835761, + "last": 396156.02781487, + "end": 396156.028162489, + "elapsed_s": 7.219060219998937, + "chunk_offsets_s": [ + 0.1977334920084104, + 0.2702014069654979, + 0.33954090799670666, + 0.39933591696899384, + 0.45852381602162495, + 0.5182620720006526, + 0.5792561490088701, + 0.650573973020073, + 0.7262502390076406, + 0.7945313780219294, + 0.860504365991801, + 0.9192871740087867, + 0.9802001930074766, + 1.0410131000098772, + 1.1080215069814585, + 1.1729089170112275, + 1.243059305998031, + 1.3026363119715825, + 1.3665709769702516, + 1.4252844079746865, + 1.4857161429827102, + 1.5412228549830616, + 1.5982307969825342, + 1.6603163399850018, + 1.7274476430029608, + 1.7867442480055615, + 1.8454903179663233, + 1.9045339279691689, + 1.965338531008456, + 2.023325490008574, + 2.0804298329749145, + 2.1415461350115947, + 2.210468720004428, + 2.2714761570096016, + 2.3293042989680544, + 2.3904532570159063, + 2.4483965520048514, + 2.5063589669880457, + 2.5657458279747516, + 2.6252737629693, + 2.6916934439796023, + 2.7517601989675313, + 2.811106452019885, + 2.868540142022539, + 2.926614941970911, + 2.9873629519715905, + 3.046780549979303, + 3.106950938992668, + 3.173231034015771, + 3.2312020729877986, + 3.2879668769892305, + 3.350331590976566, + 3.4099866150063463, + 3.4697996879694983, + 3.5271655049873516, + 3.590032736014109, + 3.657094246998895, + 3.7184592229896225, + 3.7861257640179247, + 3.8560810309718363, + 3.927337542991154, + 3.997826622973662, + 4.068277350976132, + 4.133730750007089, + 4.208772338985, + 4.285765353008173, + 4.3558419499895535, + 4.4221090850187466, + 4.490740466979332, + 4.566104666970205, + 4.633291682985146, + 4.69898559700232, + 4.771596106002107, + 4.840258815966081, + 4.907105268968735, + 4.973520326020662, + 5.045040695986245, + 5.111508217989467, + 5.18054824398132, + 5.250098803022411, + 5.322549405973405, + 5.390496094012633, + 5.45960840897169, + 5.527503351971973, + 5.590576104994398, + 5.662933970976155, + 5.732635252003092, + 5.802395012986381, + 5.878277425013948, + 5.944048524019308, + 6.009610036970116, + 6.0742358599673025, + 6.143969685013872, + 6.210630967980251, + 6.278527799993753, + 6.349057072016876, + 6.427919064997695, + 6.493522018019576, + 6.55949963099556, + 6.623559416970238, + 6.689431844977662, + 6.757291507965419, + 6.82421940198401, + 6.894533919985406, + 6.974588165001478, + 7.041091335006058, + 7.109224135987461, + 7.173425492015667, + 7.2187126009957865 + ], + "chunk_gaps_ms": { + "count": 108, + "p50": 65.82176350639202, + "p95": 75.3641999908723, + "max": 80.05424501607195 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 35.17947192586402, + "requested_requests": 1, + "timed_requests": 1, + "makespan_s": 7.446598529000767, + "end_to_end_tps": 34.37811223513775, + "timing_valid": true, + "per_stream_tps": [ + 35.2 + ], + "ttft_s": [ + 0.2 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.197921542043332, + "decode_tps": 35.17947192586402, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 161.6802277793191, + "prefill_tps": 161.6802277793191, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.425668301882553, + "round_gap_p50_ms": 59.27959602558985, + "round_gap_p95_ms": 74.49067098787054, + "tokens_per_chunk": 2.115702479338843, + "headers_s": 0.0010453540016897023, + "first_payload_s": 0.0010483140358701348, + "first_content_s": 0.197921542043332, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.197921542043332, + "last_output_s": 7.4464669590233825 + } + ], + "pooled": { + "streams_timed": 1, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 28.425668301882553, + "round_gap_p50_ms": 59.27959602558985, + "round_gap_p95_ms": 74.49067098787054, + "round_gap_mean_ms": 60.40454514150042, + "tokens_per_chunk": 2.115702479338843, + "aggregate_prompt_ttft_tps": 161.6802277793191, + "aggregate_prefill_tps": 161.6802277793191 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396156.028997649, + "first": 396156.226919191, + "last": 396163.475464608, + "end": 396163.475596178, + "elapsed_s": 7.446598529000767, + "chunk_offsets_s": [ + 0.197921542043332, + 0.27241221303120255, + 0.3423930330318399, + 0.4096091370447539, + 0.47984325501602143, + 0.5508331720484421, + 0.6199801280163229, + 0.6919021340436302, + 0.7676238560234196, + 0.836466521024704, + 0.9054429460084066, + 0.9692002180381678, + 1.032124057004694, + 1.1024741440196522, + 1.1697966339997947, + 1.236963490024209, + 1.3169392540003173, + 1.3853066340088844, + 1.4555239190231077, + 1.5229134340188466, + 1.5916723050177097, + 1.655903629027307, + 1.7221312280162238, + 1.7932011620141566, + 1.8709307760000229, + 1.941895269032102, + 2.011967258004006, + 2.0824682420352474, + 2.1507779570529237, + 2.219181546010077, + 2.2911403520265594, + 2.3664881990407594, + 2.4424694449990056, + 2.5059406010550447, + 2.5592419000458904, + 2.6246489150216803, + 2.6794419400393963, + 2.7405891220550984, + 2.7929839480202645, + 2.8599119370337576, + 2.9164695870131254, + 2.9665749190025963, + 3.0160237480304204, + 3.06610365601955, + 3.115437220025342, + 3.164916481007822, + 3.2145063200150616, + 3.2663809330551885, + 3.3260821970179677, + 3.3748379630269483, + 3.4250247360323556, + 3.4739368240116164, + 3.521447570004966, + 3.568963789031841, + 3.6168972920277156, + 3.6699359790072776, + 3.727152964042034, + 3.7781364480033517, + 3.8270458320039324, + 3.8751275920076296, + 3.9235025870148093, + 3.972661621053703, + 4.020894535002299, + 4.072163126023952, + 4.128299251024146, + 4.177888114005327, + 4.228050358011387, + 4.27913806703873, + 4.3283261260367, + 4.37749685702147, + 4.424922930018511, + 4.474996646051295, + 4.530994194035884, + 4.582778518029954, + 4.641901201044675, + 4.699107369000558, + 4.756275809020735, + 4.815891456033569, + 4.875824611051939, + 4.934851564001292, + 4.9984710740391165, + 5.066200176021084, + 5.133522170013748, + 5.200661666051019, + 5.2680635480210185, + 5.340116484032478, + 5.396475108049344, + 5.459909832046833, + 5.527160225028638, + 5.595133569033351, + 5.664978788001463, + 5.729045678046532, + 5.789462821034249, + 5.858441535034217, + 5.921217260998674, + 5.995454313000664, + 6.069997737009544, + 6.127881016000174, + 6.188432672002818, + 6.245912123005837, + 6.303519415028859, + 6.36511077801697, + 6.421918494044803, + 6.482405782036949, + 6.547167671029456, + 6.606447267055046, + 6.6645095880376175, + 6.72146532102488, + 6.779324216011446, + 6.836482927028555, + 6.890947021020111, + 6.942421614017803, + 6.998463723051827, + 7.0494741830043495, + 7.106933010043576, + 7.166188462055288, + 7.22897793201264, + 7.286905867047608, + 7.345482481003273, + 7.401139082037844, + 7.4464669590233825 + ], + "chunk_gaps_ms": { + "count": 120, + "p50": 59.44762151921168, + "p95": 74.49067098787054, + "max": 79.97576397610828 + } + } + ], + "equal_alone": [ + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 2, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 47.1, + "per_stream_tps": 23.6, + "ttft_s_max": 0.45, + "request": { + "ttft_s": 0.305, + "decode_tps": 23.632, + "prompt_ttft_tps": 112.82, + "prefill_tps": 112.82, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.317, + "round_gap_p50_ms": 103.076, + "round_gap_p95_ms": 109.467, + "tokens_per_chunk": 2.462, + "headers_s": 0.001, + "first_payload_s": 0.001, + "first_content_s": 0.305, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.305, + "last_output_s": 11.042 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 163.773, + "aggregate_prefill_tps": 163.773, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 41.978, + "round_gap_p50_ms": 103.059, + "round_gap_p95_ms": 109.299, + "tokens_per_chunk": 2.462 + }, + "completions": { + "truncated": 6 + }, + "timing_valid": true, + "end_to_end_tps": 46.36457788867246, + "makespan_s": 11.042913002020214, + "steady_tps": 48.0, + "alone": { + "equal": 6, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 46.09999772674423, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 11.261031406989787, + "end_to_end_tps": 45.4665280199999, + "timing_valid": true, + "steady_tps": 46.750571976514, + "per_stream_tps": [ + 23.1, + 23.5 + ], + "ttft_s": [ + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19742486596805975, + "decode_tps": 23.050267928518345, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 162.08697847198792, + "prefill_tps": 162.08697847198792, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.38344365892493, + "round_gap_p50_ms": 103.20438799681142, + "round_gap_p95_ms": 133.67975398432463, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0014686699723824859, + "first_payload_s": 0.001473389973398298, + "first_content_s": 0.19742486596805975, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19742486596805975, + "last_output_s": 11.260202998993918 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.390783755981829, + "decode_tps": 23.459830383965468, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 81.88671998302806, + "prefill_tps": 81.88671998302806, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.62605413735169, + "round_gap_p50_ms": 103.2361329998821, + "round_gap_p95_ms": 131.97028200374916, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0013810379896312952, + "first_payload_s": 0.0013869099784642458, + "first_content_s": 0.390783755981829, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.390783755981829, + "last_output_s": 11.260427561006509 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 43.00474889813831, + "round_gap_p50_ms": 103.20438799681142, + "round_gap_p95_ms": 133.58954503200948, + "round_gap_mean_ms": 106.4680676604395, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 163.77343996605612, + "aggregate_prefill_tps": 163.77343996605612 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396163.476979663, + "first": 396163.674404529, + "last": 396174.737182662, + "end": 396174.737915645, + "elapsed_s": 11.26093598199077, + "chunk_offsets_s": [ + 0.19742486596805975, + 0.4910108359763399, + 0.5941466789809056, + 0.6966517969849519, + 0.8006294399965554, + 0.90695107501233, + 1.0094916169764474, + 1.1130525679909624, + 1.2155235089594498, + 1.316868791996967, + 1.419494533969555, + 1.519826831005048, + 1.6204940429888666, + 1.7266000909730792, + 1.8372088230098598, + 1.9580983099876903, + 2.0946402680128813, + 2.223052771005314, + 2.3550192289985716, + 2.4890988279948942, + 2.622778581979219, + 2.7471758789615706, + 2.8736786679946817, + 2.9991175750037655, + 3.1339315969962627, + 3.2729019459802657, + 3.3793783339788206, + 3.4801505389623344, + 3.5837807549978606, + 3.686770293978043, + 3.7920073900022544, + 3.901327277009841, + 4.011004575993866, + 4.1128260549739935, + 4.2158063289825805, + 4.316423300013412, + 4.4177753669791855, + 4.522438808984589, + 4.628679610963445, + 4.738751202006824, + 4.841635858989321, + 4.94942528300453, + 5.06335809500888, + 5.168442822003271, + 5.273007559007965, + 5.382801514992025, + 5.487252652004827, + 5.590599457966164, + 5.689285417960491, + 5.795168439974077, + 5.89958144898992, + 6.004618398961611, + 6.113102102011908, + 6.21187167998869, + 6.3147949450067244, + 6.422119372989982, + 6.527050545962993, + 6.630369127960876, + 6.733399179007392, + 6.832174131995998, + 6.934416687989142, + 7.037789477966726, + 7.13467086100718, + 7.236806711007375, + 7.340436864004005, + 7.44454274896998, + 7.5407191650010645, + 7.64187198196305, + 7.741259660979267, + 7.840779885998927, + 7.944357013970148, + 8.049331980000716, + 8.153244103014003, + 8.251352187013254, + 8.34767066896893, + 8.450161497981753, + 8.5506394119584, + 8.650589097000193, + 8.751601576979738, + 8.854567755013704, + 8.951378641999327, + 9.060072491003666, + 9.160723414970562, + 9.263306965003721, + 9.367080958967563, + 9.468791076971684, + 9.56865349796135, + 9.664462198968977, + 9.76839800196467, + 9.870394122961443, + 9.971294504997786, + 10.07360061298823, + 10.180133401998319, + 10.282773992978036, + 10.385630505974405, + 10.488834893971216, + 10.586429964983836, + 10.684361407009419, + 10.790151836001314, + 10.892992796958424, + 10.998519831977319, + 11.10038222395815, + 11.194118649000302, + 11.260202998993918 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.20438799681142, + "p95": 133.67975398432463, + "max": 293.5859700082801 + } + }, + { + "start": 396163.476884238, + "first": 396163.867667994, + "last": 396174.737311799, + "end": 396174.737527113, + "elapsed_s": 11.260642874985933, + "chunk_offsets_s": [ + 0.390783755981829, + 0.4913517190143466, + 0.5943190489779226, + 0.6969429039745592, + 0.8009006429929286, + 0.9071459730039351, + 1.0096856349846348, + 1.1132497540093027, + 1.2157880879822187, + 1.317091081989929, + 1.4196631439845078, + 1.519742270000279, + 1.620663820009213, + 1.7267733729677275, + 1.8373809999902733, + 1.958300183992833, + 2.0949484310112894, + 2.223347974009812, + 2.355318256013561, + 2.4893922549672425, + 2.622981799999252, + 2.747469577996526, + 2.8739842229988426, + 2.9993828579899855, + 3.134130174992606, + 3.2731152279884554, + 3.3795923839788884, + 3.4800291619612835, + 3.5837211229954846, + 3.6869572559953667, + 3.7922076960094273, + 3.901502366992645, + 4.011201057990547, + 4.113023129000794, + 4.215748407994397, + 4.31630485097412, + 4.417997593001928, + 4.522656106972136, + 4.628713418962434, + 4.738928706967272, + 4.841802948969416, + 4.949703733960632, + 5.063688114983961, + 5.168351700995117, + 5.27336466696579, + 5.382742234971374, + 5.487545806972776, + 5.59086475596996, + 5.6895791969727725, + 5.795465659000911, + 5.899876938958187, + 6.004779215960298, + 6.11332547996426, + 6.211859920003917, + 6.3147326890029944, + 6.422345631988719, + 6.527041569992434, + 6.630291382956784, + 6.733620317012537, + 6.832362933957484, + 6.934605536982417, + 7.037716996972449, + 7.134879838966299, + 7.236724197980948, + 7.340624704957008, + 7.444757182965986, + 7.5409437119960785, + 7.641889774007723, + 7.741294973995537, + 7.840966511983424, + 7.9445497679989785, + 8.04933837999124, + 8.153430089005269, + 8.25155522901332, + 8.347880286979489, + 8.450362683972344, + 8.550835222005844, + 8.65080369100906, + 8.75149903196143, + 8.854755132982973, + 8.951585155969951, + 9.060268140980043, + 9.160944233008195, + 9.263265908986796, + 9.367319378012326, + 9.468996998970397, + 9.568540345004294, + 9.664656440960243, + 9.768313728971407, + 9.870605948963203, + 9.971184903988615, + 10.073791383008938, + 10.18032556399703, + 10.282711847976316, + 10.385819691990037, + 10.488735597988125, + 10.586627039010637, + 10.684549023979343, + 10.790373533964157, + 10.893186926958151, + 10.998723594006151, + 11.100619330012705, + 11.194051207974553, + 11.260427561006509 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.2361329998821, + "p95": 131.97028200374916, + "max": 138.9850529958494 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 47.38208742420985, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 10.96044543501921, + "end_to_end_tps": 46.713429945477635, + "timing_valid": true, + "steady_tps": 48.29957649559146, + "per_stream_tps": [ + 23.7, + 24.1 + ], + "ttft_s": [ + 0.2, + 0.39 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19611862901365384, + "decode_tps": 23.691043712104925, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 163.16654955696305, + "prefill_tps": 163.16654955696305, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.210044105783766, + "round_gap_p50_ms": 103.07810001540929, + "round_gap_p95_ms": 109.0946689946577, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0012946520000696182, + "first_payload_s": 0.0013082200312055647, + "first_content_s": 0.19611862901365384, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19611862901365384, + "last_output_s": 10.959679875988513 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3865526440204121, + "decode_tps": 24.117665516256533, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.7830322596635, + "prefill_tps": 82.7830322596635, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 41.463382901879505, + "round_gap_p50_ms": 103.03848295006901, + "round_gap_p95_ms": 108.7997070280835, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0021761649986729026, + "first_payload_s": 0.0021787890000268817, + "first_content_s": 0.3865526440204121, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3865526440204121, + "last_output_s": 10.959715283999685 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 41.83671350383163, + "round_gap_p50_ms": 103.03848295006901, + "round_gap_p95_ms": 108.95897302543744, + "round_gap_mean_ms": 103.57632954832103, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 165.566064519327, + "aggregate_prefill_tps": 165.566064519327 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396174.739024536, + "first": 396174.935143165, + "last": 396185.698704412, + "end": 396185.69937037, + "elapsed_s": 10.960345834027976, + "chunk_offsets_s": [ + 0.19611862901365384, + 0.4869665100122802, + 0.5921781500219367, + 0.6942070710356347, + 0.7958974129869603, + 0.8989248560392298, + 0.9996150759980083, + 1.1037721780012362, + 1.2063655370147899, + 1.3098342320299707, + 1.4115131020080298, + 1.5124147480237298, + 1.6121265750261955, + 1.7185775869875215, + 1.8145462420070544, + 1.9150535480002873, + 2.0200452500139363, + 2.1236089700250886, + 2.2290901010273956, + 2.3339386010193266, + 2.43736830400303, + 2.5331842050072737, + 2.635047540999949, + 2.7339131680200808, + 2.8404821330332197, + 2.949015661026351, + 3.055079645011574, + 3.1559982200269587, + 3.259485043003224, + 3.361535261035897, + 3.4667344040353782, + 3.575605632038787, + 3.6830722860177048, + 3.7863115870277397, + 3.8892475410248153, + 3.99201714101946, + 4.093189926003106, + 4.198644704010803, + 4.304397886036895, + 4.414989338023588, + 4.518148045986891, + 4.625417578034103, + 4.739566808042582, + 4.843605109024793, + 4.950484173023142, + 5.062203204026446, + 5.166534100018907, + 5.270492352021392, + 5.369371723034419, + 5.47692831302993, + 5.580612051009666, + 5.68631771201035, + 5.795412381005008, + 5.894272695994005, + 5.998835097998381, + 6.108638253994286, + 6.214639982033987, + 6.31839895201847, + 6.420733444043435, + 6.519845617993269, + 6.6213772220071405, + 6.7236987220239826, + 6.822778207017109, + 6.925856307032518, + 7.034475483989809, + 7.138567273039371, + 7.234406134986784, + 7.335381222015712, + 7.434939544007648, + 7.535524818988051, + 7.638992250023875, + 7.743577932997141, + 7.845907737035304, + 7.945268584997393, + 8.044312197016552, + 8.146341791027226, + 8.247081579989754, + 8.346908448031172, + 8.447313448996283, + 8.550635343010072, + 8.64762194402283, + 8.755507194029633, + 8.856573786004446, + 8.958971431013197, + 9.06315248599276, + 9.166277018026449, + 9.26550647203112, + 9.361531111993827, + 9.466603982029483, + 9.570316568017006, + 9.672566419991199, + 9.772915213019587, + 9.87940964999143, + 9.98162084503565, + 10.084994611039292, + 10.18584363302216, + 10.282147556019481, + 10.378653399995528, + 10.482878773997072, + 10.585561621992383, + 10.692020139016677, + 10.794070467993151, + 10.886715842992999, + 10.959679875988513 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.07810001540929, + "p95": 109.0946689946577, + "max": 290.84788099862635 + } + }, + { + "start": 396174.738924935, + "first": 396175.125477579, + "last": 396185.698640219, + "end": 396185.698886654, + "elapsed_s": 10.959961718996055, + "chunk_offsets_s": [ + 0.3865526440204121, + 0.48698339000111446, + 0.5921377330087125, + 0.6941784470109269, + 0.7958937170333229, + 0.8988862640107982, + 0.9996263720095158, + 1.1036451369873248, + 1.2063505600090139, + 1.3098233200144023, + 1.4115265739965253, + 1.5123871479881927, + 1.6120636779814959, + 1.7185607550200075, + 1.8145499540260062, + 1.915008892014157, + 2.0200599540257826, + 2.123573850025423, + 2.2290037639904767, + 2.3339283610112034, + 2.437368927989155, + 2.5331411969964392, + 2.6349808840313926, + 2.7338888790109195, + 2.840455236029811, + 2.9490303809870966, + 3.0552366549964063, + 3.156179341021925, + 3.259665589022916, + 3.3616880939807743, + 3.4669289980083704, + 3.575887971033808, + 3.6832242230302654, + 3.7862627059803344, + 3.8894602630170994, + 3.992168679018505, + 4.093180037976708, + 4.198851138993632, + 4.304270092980005, + 4.415158428018913, + 4.518303488031961, + 4.625597676029429, + 4.739735529990867, + 4.84376003901707, + 4.950641294999514, + 5.062130548001733, + 5.166463362984359, + 5.270674897998106, + 5.369549661001656, + 5.477089371008333, + 5.5808002289850265, + 5.686491889005993, + 5.795291596034076, + 5.894425673992373, + 5.998757897003088, + 6.108434220019262, + 6.214795120002236, + 6.318572697986383, + 6.420665476005524, + 6.519997171009891, + 6.621557815989945, + 6.7238573000067845, + 6.822932273033075, + 6.926021092978772, + 7.034365835017525, + 7.1385026490315795, + 7.2345895930193365, + 7.335601864033379, + 7.435101961018518, + 7.53567946102703, + 7.639146508008707, + 7.743757950025611, + 7.8460612740018405, + 7.945425449986942, + 8.044260709022637, + 8.14649619202828, + 8.247257165028714, + 8.347136082011275, + 8.447513450984843, + 8.550799649034161, + 8.647776281984989, + 8.755678476009052, + 8.856571241980419, + 8.959167513006832, + 9.063309750985354, + 9.16645876300754, + 9.265712074004114, + 9.361689097015187, + 9.466758112015668, + 9.570254759979434, + 9.67272802098887, + 9.77311951899901, + 9.8793252009782, + 9.981775214022491, + 10.08528960600961, + 10.186049234995153, + 10.28230464499211, + 10.378808824985754, + 10.483032568008639, + 10.585713992011733, + 10.692171388014685, + 10.794240182032809, + 10.886885285028256, + 10.959715283999685 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.03848295006901, + "p95": 108.7997070280835, + "max": 114.13785396143794 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 47.14344128009709, + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 11.042913002020214, + "end_to_end_tps": 46.36457788867246, + "timing_valid": true, + "steady_tps": 47.981151229100554, + "per_stream_tps": [ + 23.6, + 24.1 + ], + "ttft_s": [ + 0.22, + 0.45 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.22400033997837454, + "decode_tps": 23.571968310244326, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 142.85692603452898, + "prefill_tps": 142.85692603452898, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 42.423271015742976, + "round_gap_p50_ms": 103.057459986303, + "round_gap_p95_ms": 109.6680510090664, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0014215499977581203, + "first_payload_s": 0.0014325419906526804, + "first_content_s": 0.22400033997837454, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.22400033997837454, + "last_output_s": 11.041934448992833 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.4512835270143114, + "decode_tps": 24.07737305185744, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 70.90885903084425, + "prefill_tps": 70.90885903084425, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 41.53277011766263, + "round_gap_p50_ms": 103.07339602150023, + "round_gap_p95_ms": 109.2661910224706, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0016227360465563834, + "first_payload_s": 0.0016282240394502878, + "first_content_s": 0.4512835270143114, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.4512835270143114, + "last_output_s": 11.042139907018282 + } + ], + "pooled": { + "streams_timed": 2, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 41.9780205667028, + "round_gap_p50_ms": 103.05944399442524, + "round_gap_p95_ms": 109.29875203873962, + "round_gap_mean_ms": 103.92616742241955, + "tokens_per_chunk": 2.4615384615384617, + "aggregate_prompt_ttft_tps": 141.8177180616885, + "aggregate_prefill_tps": 141.8177180616885 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396185.700488957, + "first": 396185.924489297, + "last": 396196.742423406, + "end": 396196.743310166, + "elapsed_s": 11.042821209004615, + "chunk_offsets_s": [ + 0.22400033997837454, + 0.5518137940089218, + 0.6548684540321119, + 0.7569347200333141, + 0.8598709140205756, + 0.9642317459802143, + 1.066205066978, + 1.1736506969900802, + 1.2782625069958158, + 1.3804133179946803, + 1.4821662050089799, + 1.5846740109845996, + 1.6859420770197175, + 1.7931359289796092, + 1.8892055450123735, + 1.9866943740053102, + 2.091922671010252, + 2.1962106699938886, + 2.2992681299801916, + 2.403595458017662, + 2.508191908011213, + 2.6049317070282996, + 2.7076506189769134, + 2.806154689984396, + 2.913173499982804, + 3.0200778290163726, + 3.1287117099855095, + 3.228448498004582, + 3.3320726189995185, + 3.4346298489836045, + 3.5400666600326076, + 3.6476925640017726, + 3.756985154992435, + 3.8590559809817933, + 3.9610970949870534, + 4.063907383999322, + 4.164638421032578, + 4.2738271720008925, + 4.380661580013111, + 4.4915000750334, + 4.595678168989252, + 4.704976921027992, + 4.817887099983636, + 4.922923955018632, + 5.028476126026362, + 5.139443502004724, + 5.243865982978605, + 5.348628146981355, + 5.4485053840326145, + 5.555857877014205, + 5.6591423630015925, + 5.764809800020885, + 5.874477851029951, + 5.973748202028219, + 6.077256146003492, + 6.187445131014101, + 6.294249747006688, + 6.397817547025625, + 6.500595436024014, + 6.600310574984178, + 6.704137914988678, + 6.805479421978816, + 6.902350598014891, + 7.004333934979513, + 7.1097745699808, + 7.2146454870235175, + 7.311343429028057, + 7.414743804023601, + 7.514343357994221, + 7.614311299985275, + 7.717767114983872, + 7.822741730022244, + 7.924799996020738, + 8.02372864697827, + 8.121574665012304, + 8.225716486980673, + 8.327697264030576, + 8.428934465977363, + 8.53181706002215, + 8.634729622979648, + 8.73185891303001, + 8.840147319016978, + 8.942627397016622, + 9.046022203983739, + 9.151137956010643, + 9.254809342033695, + 9.353710488998331, + 9.449356756987981, + 9.553915319032967, + 9.656270580017008, + 9.757762857014313, + 9.85724201000994, + 9.962579108017962, + 10.064981745032128, + 10.168017492978834, + 10.271014632016886, + 10.369166027987376, + 10.468731630011462, + 10.574394587019924, + 10.677507040032651, + 10.783634465013165, + 10.8857780440012, + 10.975954867026303, + 11.041934448992833 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.057459986303, + "p95": 109.6680510090664, + "max": 327.8134540305473 + } + }, + { + "start": 396185.700397164, + "first": 396186.151680691, + "last": 396196.742537071, + "end": 396196.742850258, + "elapsed_s": 11.042453094036318, + "chunk_offsets_s": [ + 0.4512835270143114, + 0.5517831540200859, + 0.6551383920013905, + 0.7572006900445558, + 0.8601925970287994, + 0.9642574260360561, + 1.0665027979994193, + 1.1736385690164752, + 1.2785836630500853, + 1.380587384046521, + 1.4823522390215658, + 1.5848499010317028, + 1.6861397590255365, + 1.7933117549982853, + 1.88923018501373, + 1.9866922470391728, + 2.092145728995092, + 2.1963809599983506, + 2.299440403992776, + 2.4035320809925906, + 2.508407654007897, + 2.605122269014828, + 2.7076794350286946, + 2.8063656680169515, + 2.9133461420424283, + 3.0202640070347115, + 3.128717342042364, + 3.2286353959934786, + 3.3322588930022903, + 3.434660041995812, + 3.5402552540181205, + 3.647886342019774, + 3.7571525330422446, + 3.859257072035689, + 3.9612841050256975, + 4.063935976999346, + 4.164842952042818, + 4.273826532007661, + 4.380637084017508, + 4.491678493039217, + 4.5958781230147, + 4.705173483002, + 4.818081038014498, + 4.923153333016671, + 5.028705057047773, + 5.139634304039646, + 5.244059265009128, + 5.348824932996649, + 5.448713882011361, + 5.555809748999309, + 5.659317149023991, + 5.7650008740019985, + 5.8742511290474795, + 5.973965612996835, + 6.077282931015361, + 6.187683837022632, + 6.294247379002627, + 6.398042974004056, + 6.500810286030173, + 6.600503377034329, + 6.704312796005979, + 6.80571724800393, + 6.902537079993635, + 7.004540577006992, + 7.109997708001174, + 7.2148671530303545, + 7.311314677004702, + 7.414946270000655, + 7.514548623992596, + 7.614538646012079, + 7.717971966019832, + 7.8227417939924635, + 7.925004830001853, + 8.023964090039954, + 8.121768731041811, + 8.225918681011535, + 8.327963619027287, + 8.429138484003488, + 8.532004262029659, + 8.634922729048412, + 8.732088387012482, + 8.840348585043103, + 8.94237670704024, + 9.046243599033915, + 9.151308694039471, + 9.254996879026294, + 9.353924266994, + 9.449588264047634, + 9.554116537037771, + 9.65625426004408, + 9.757998971035704, + 9.857428668008652, + 9.962780758040026, + 10.065166915010195, + 10.168240311031695, + 10.271225002012216, + 10.369009690999519, + 10.468961136997677, + 10.57460697303759, + 10.677694946003612, + 10.783806274994276, + 10.885467368992977, + 10.976162245031446, + 11.042139907018282 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 103.07339602150023, + "p95": 109.2661910224706, + "max": 112.90755501249805 + } + } + ], + "equal_alone": [ + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + }, + { + "prompt": "chat", + "temperature": 1.0, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.7, + "per_stream_tps": 14.9, + "ttft_s_max": 0.81, + "request": { + "ttft_s": 0.48, + "decode_tps": 14.907, + "prompt_ttft_tps": 69.193, + "prefill_tps": 69.193, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.081, + "round_gap_p50_ms": 163.961, + "round_gap_p95_ms": 183.284, + "tokens_per_chunk": 2.462, + "headers_s": 0.002, + "first_payload_s": 0.002, + "first_content_s": 0.48, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.48, + "last_output_s": 17.653 + }, + "pooled": { + "aggregate_prompt_ttft_tps": 165.959, + "aggregate_prefill_tps": 165.959, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.433, + "round_gap_p50_ms": 163.762, + "round_gap_p95_ms": 183.417, + "tokens_per_chunk": 2.456 + }, + "completions": { + "truncated": 12 + }, + "timing_valid": true, + "end_to_end_tps": 57.3018063357135, + "makespan_s": 17.870291801984422, + "steady_tps": 59.9, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + }, + "reps": [ + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.697960193122874, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 17.87453244702192, + "end_to_end_tps": 57.28821176358148, + "timing_valid": true, + "steady_tps": 59.893645140222574, + "per_stream_tps": [ + 14.6, + 15.1, + 14.9, + 14.7 + ], + "ttft_s": [ + 0.2, + 0.77, + 0.39, + 0.58 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.19561560201691464, + "decode_tps": 14.565535293437115, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 163.58613357043473, + "prefill_tps": 163.58613357043473, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 68.65521794111997, + "round_gap_p50_ms": 163.73540699714795, + "round_gap_p95_ms": 204.88242799183354, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0010201220284216106, + "first_payload_s": 0.0010343300527893007, + "first_content_s": 0.19561560201691464, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19561560201691464, + "last_output_s": 17.702696177002508 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.7705110929673538, + "decode_tps": 15.060105686188233, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.530875145175656, + "prefill_tps": 41.530875145175656, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.400596439181, + "round_gap_p50_ms": 163.65174198290333, + "round_gap_p95_ms": 202.11011299397796, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0019156819907948375, + "first_payload_s": 0.0019188659498468041, + "first_content_s": 0.7705110929673538, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7705110929673538, + "last_output_s": 17.70266318495851 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3877168030012399, + "decode_tps": 14.926940921830246, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 82.53446781850634, + "prefill_tps": 82.53446781850634, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.9929629410891, + "round_gap_p50_ms": 163.7719509890303, + "round_gap_p95_ms": 204.8874199972488, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.0024471759679727256, + "first_payload_s": 0.002462967997416854, + "first_content_s": 0.3877168030012399, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3877168030012399, + "last_output_s": 17.47092235297896 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.579188700998202, + "decode_tps": 14.744164627477058, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.24969659257793, + "prefill_tps": 55.24969659257793, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.82344237641048, + "round_gap_p50_ms": 163.50191598758101, + "round_gap_p95_ms": 204.8772429698147, + "tokens_per_chunk": 2.392523364485981, + "headers_s": 0.002796987013425678, + "first_payload_s": 0.002799162990413606, + "first_content_s": 0.579188700998202, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.579188700998202, + "last_output_s": 17.874166506982874 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.46805492445014, + "round_gap_p50_ms": 163.72740600490943, + "round_gap_p95_ms": 204.8874199972488, + "round_gap_mean_ms": 166.62812596353302, + "tokens_per_chunk": 2.4556354916067145, + "aggregate_prompt_ttft_tps": 165.95902494735967, + "aggregate_prefill_tps": 165.95902494735967 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396196.745559692, + "first": 396196.941175294, + "last": 396214.448255869, + "end": 396214.44835915, + "elapsed_s": 17.70279945799848, + "chunk_offsets_s": [ + 0.19561560201691464, + 0.9009630730142817, + 1.0351604980533011, + 1.1839398720185272, + 1.3344775660079904, + 1.4881451789988205, + 1.6339755640365183, + 1.7941789840115234, + 1.9464596880134195, + 2.099816225003451, + 2.265300544037018, + 2.4578553330502473, + 2.668061636039056, + 2.8849713160307147, + 3.089853744022548, + 3.300213441019878, + 3.5064620740013197, + 3.708251928037498, + 3.9104272730182856, + 4.074814093997702, + 4.23805079102749, + 4.3979172960389405, + 4.56188406504225, + 4.722760339034721, + 4.88895972102182, + 5.055328753020149, + 5.220826304052025, + 5.383765175007284, + 5.550085070019122, + 5.71405260701431, + 5.879760928044561, + 6.048309085017536, + 6.215876000002027, + 6.382011590001639, + 6.5466094520525075, + 6.711015681037679, + 6.8740501690190285, + 7.040340496052522, + 7.204186863033101, + 7.374453229014762, + 7.538091514026746, + 7.707884755043779, + 7.877427034021821, + 8.040846245014109, + 8.205111673043575, + 8.373680198041257, + 8.543539614998735, + 8.708949998021126, + 8.866678514052182, + 9.02790696802549, + 9.195003095024731, + 9.3596847190056, + 9.53135042602662, + 9.69903537502978, + 9.872957520012278, + 10.042322724999394, + 10.205616927007213, + 10.368057457031682, + 10.537175811012276, + 10.695649551053066, + 10.859842194011435, + 11.021667534019798, + 11.183002325007692, + 11.340806186024565, + 11.505080366041511, + 11.66767150600208, + 11.824272299010772, + 11.985727668041363, + 12.150411036040168, + 12.312863950035535, + 12.473357820999809, + 12.637093227996957, + 12.798357826017309, + 12.95412174804369, + 13.106806071999017, + 13.267826171999332, + 13.433059209026396, + 13.596584726008587, + 13.757486649032217, + 13.919897659041453, + 14.080636605038308, + 14.246092924033292, + 14.403175722050946, + 14.5655353559996, + 14.730023794050794, + 14.892594085016754, + 15.050893742998596, + 15.204195001046173, + 15.366973631025758, + 15.528132164035924, + 15.692068837000988, + 15.856627036002465, + 16.027428271016106, + 16.189716576016508, + 16.355229024018627, + 16.516768153000157, + 16.673639494052622, + 16.830017085012514, + 16.994792118028272, + 17.16282135801157, + 17.326292907004245, + 17.470656350022182, + 17.599081335996743, + 17.702696177002508 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 163.73540699714795, + "p95": 204.88242799183354, + "max": 705.347470997367 + } + }, + { + "start": 396196.746040353, + "first": 396197.516551446, + "last": 396214.448703538, + "end": 396214.448816643, + "elapsed_s": 17.702776289952453, + "chunk_offsets_s": [ + 0.7705110929673538, + 0.9005818689474836, + 1.0348508149618283, + 1.1835350189940073, + 1.3341070339665748, + 1.4877208389807492, + 1.6335815759957768, + 1.7937570119975135, + 1.946065138967242, + 2.099398140970152, + 2.2647578989854082, + 2.457438592973631, + 2.667697759985458, + 2.884596847987268, + 3.0894853079807945, + 3.2998562529683113, + 3.506092949945014, + 3.707898019987624, + 3.910008132981602, + 4.074276920000557, + 4.237696899974253, + 4.397385338961612, + 4.561350426985882, + 4.722388910944574, + 4.8885317809763364, + 5.05490753299091, + 5.220451659988612, + 5.383380434999708, + 5.549729753984138, + 5.713633081992157, + 5.879225818964187, + 6.047948344959877, + 6.215503915969748, + 6.381649889983237, + 6.546240856987424, + 6.71066714997869, + 6.873712372966111, + 7.040018539992161, + 7.203813962987624, + 7.374106873001438, + 7.537758614984341, + 7.7075366549543105, + 7.877062261977699, + 8.040309646981768, + 8.204712483973708, + 8.373504403978586, + 8.543201819993556, + 8.708752459962852, + 8.866398478974588, + 9.027542372990865, + 9.19466417998774, + 9.359317578957416, + 9.53098790999502, + 9.698652426945046, + 9.87259089195868, + 10.041898623981979, + 10.205328475974966, + 10.367710572958458, + 10.536810350953601, + 10.695289034978487, + 10.859510989976116, + 11.021401354984846, + 11.182655905955471, + 11.340696152998134, + 11.5047562510008, + 11.667584800976329, + 11.823923319985624, + 11.985368655994534, + 12.150173560949042, + 12.31243629695382, + 12.473003000952303, + 12.636750631965697, + 12.798187983979005, + 12.953762831981294, + 13.10646502795862, + 13.267456295958254, + 13.432720773969777, + 13.596218929975294, + 13.757172565965448, + 13.919528838945553, + 14.08026674494613, + 14.245752247981727, + 14.402832086954731, + 14.565161815960892, + 14.729653757996857, + 14.892234048980754, + 15.050508170970716, + 15.20357105898438, + 15.366576137952507, + 15.527571550977882, + 15.691531119984575, + 15.856029541988391, + 16.02705093898112, + 16.189310778980143, + 16.354818618972786, + 16.51623488398036, + 16.673244192963466, + 16.829589784960262, + 16.99409148696577, + 17.162870461994316, + 17.32599586294964, + 17.47032932296861, + 17.598656242946163, + 17.70266318495851 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 163.65174198290333, + "p95": 202.11011299397796, + "max": 216.89908800181001 + } + }, + { + "start": 396196.74538633, + "first": 396197.133103133, + "last": 396214.216308683, + "end": 396214.216734047, + "elapsed_s": 17.4713477169862, + "chunk_offsets_s": [ + 0.3877168030012399, + 0.9014436539728194, + 1.0355991590186022, + 1.1842653789790347, + 1.3349327869946137, + 1.4885475669871084, + 1.634307840024121, + 1.7944803789723665, + 1.9467807949986309, + 2.1001608049846254, + 2.26536041701911, + 2.457972055010032, + 2.6683006630046293, + 2.885202326986473, + 3.090089746983722, + 3.3004475869820453, + 3.5066961720003746, + 3.7084737539989874, + 3.910724108980503, + 4.074876974977087, + 4.238289545988664, + 4.397987584990915, + 4.561953281983733, + 4.722993622010108, + 4.88923801202327, + 5.055632019997574, + 5.221054866968188, + 5.383985273016151, + 5.550329760997556, + 5.714350353984628, + 5.87999593897257, + 6.048550447972957, + 6.216107298969291, + 6.382248023990542, + 6.546842463023495, + 6.711241043987684, + 6.874279978976119, + 7.040569394011982, + 7.20441748999292, + 7.374691950972192, + 7.5383225890109316, + 7.708110629988369, + 7.877662907994818, + 8.041072310996242, + 8.205425883992575, + 8.374089321994688, + 8.543770593998488, + 8.709058174979873, + 8.866973956988659, + 9.028138138994109, + 9.19523129001027, + 9.359918641974218, + 9.53158358100336, + 9.699152831977699, + 9.873191569990013, + 10.042436581978109, + 10.20590528199682, + 10.368308322969824, + 10.537410838005599, + 10.695884370012209, + 10.860072101000696, + 11.022001266013831, + 11.183227784000337, + 11.341293311968911, + 11.505313056986779, + 11.668141014990397, + 11.824497069988865, + 11.985962694976479, + 12.150743838981725, + 12.312971135019325, + 12.473596672003623, + 12.637324078008533, + 12.798785399005283, + 12.95435760699911, + 13.107064875017386, + 13.268060863018036, + 13.433321915974375, + 13.59682272898499, + 13.757715803978499, + 13.920130189973861, + 14.080869871017057, + 14.246323294995818, + 14.403404972981662, + 14.565764205995947, + 14.730252211971674, + 14.892823496018536, + 15.051226162991952, + 15.204309834982269, + 15.367283458006568, + 15.528357942996081, + 15.692129893985111, + 15.85686393402284, + 16.027760146011133, + 16.190140019985847, + 16.355527698993683, + 16.51701845997013, + 16.673975609010085, + 16.830321568006184, + 16.994908806984313, + 17.16366411896888, + 17.32655874901684, + 17.47092235297896 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 163.7719509890303, + "p95": 204.8874199972488, + "max": 513.7268509715796 + } + }, + { + "start": 396196.745276729, + "first": 396197.32446543, + "last": 396214.619443236, + "end": 396214.619809176, + "elapsed_s": 17.87453244702192, + "chunk_offsets_s": [ + 0.579188700998202, + 0.9011658119852655, + 1.0353745800093748, + 1.1841526579810306, + 1.3346887049847282, + 1.4883606369839981, + 1.6341729100095108, + 1.7944014350068755, + 1.9466684259823523, + 2.1000176679808646, + 2.26539832202252, + 2.458016535034403, + 2.668183861998841, + 2.8851893190294504, + 3.090066561999265, + 3.300423683016561, + 3.506664539978374, + 3.708457274013199, + 3.910642380011268, + 4.074914078984875, + 4.238199945015367, + 4.398000144981779, + 4.561986290034838, + 4.722977189987432, + 4.889172427996527, + 5.05554008303443, + 5.221034307032824, + 5.383970073016826, + 5.550204208004288, + 5.714204640011303, + 5.879909026029054, + 6.0484212299925275, + 6.216073761985172, + 6.382230824034195, + 6.546832095016725, + 6.71123107598396, + 6.874177034012973, + 7.040559730026871, + 7.20439464203082, + 7.37466155103175, + 7.538214251981117, + 7.708096068992745, + 7.877644204010721, + 8.040968902001623, + 8.205261674011126, + 8.37413791398285, + 8.543746465002187, + 8.70942195499083, + 8.867027429980226, + 9.028125258977525, + 9.195133576984517, + 9.359880737029016, + 9.531566396006383, + 9.699177599977702, + 9.873160690010991, + 10.042459974007215, + 10.205961889994796, + 10.368200434022583, + 10.537384085997473, + 10.69585369701963, + 10.85997597198002, + 11.021849712007679, + 11.183224824024364, + 11.341330943978392, + 11.505210096016526, + 11.668179382977542, + 11.824486957979389, + 11.98594059800962, + 12.150799455994274, + 12.312976702989545, + 12.473451342026237, + 12.637195164978039, + 12.798821126983967, + 12.954207813018002, + 13.107018618029542, + 13.268043166026473, + 13.433193307020701, + 13.59666127100354, + 13.757688603014685, + 13.92009594902629, + 14.080836670997087, + 14.246192844992038, + 14.403381469019223, + 14.565747037995607, + 14.730071985977702, + 14.89275651902426, + 15.051103457983118, + 15.204234666016418, + 15.367182464979123, + 15.528196869010571, + 15.692144390020985, + 15.856682285026181, + 16.027639601030387, + 16.189931538014207, + 16.35542625800008, + 16.51687725802185, + 16.673850056016818, + 16.83022963203257, + 16.994942647987045, + 17.163043185020797, + 17.326498349022586, + 17.470874384976923, + 17.599210552987643, + 17.702912339998875, + 17.772684390016366, + 17.827538519981317, + 17.874166506982874 + ], + "chunk_gaps_ms": { + "count": 106, + "p50": 163.52730846847408, + "p95": 204.8772429698147, + "max": 321.9771109870635 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 58.58317992915642, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 17.6050601649913, + "end_to_end_tps": 58.165095171687305, + "timing_valid": true, + "steady_tps": 61.158253553483064, + "per_stream_tps": [ + 15.3, + 15.0, + 15.3, + 14.6 + ], + "ttft_s": [ + 0.76, + 0.38, + 0.57, + 0.19 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.7627404140075669, + "decode_tps": 15.294164108199633, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 41.95398514661967, + "prefill_tps": 41.95398514661967, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 65.38441675696888, + "round_gap_p50_ms": 164.08120200503618, + "round_gap_p95_ms": 170.89109198423102, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0019287390168756247, + "first_payload_s": 0.0019350910442881286, + "first_content_s": 0.7627404140075669, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.7627404140075669, + "last_output_s": 17.43576668703463 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.3824804819887504, + "decode_tps": 14.953099524179644, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 83.6643999024797, + "prefill_tps": 83.6643999024797, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.87576701960472, + "round_gap_p50_ms": 164.07318599522114, + "round_gap_p95_ms": 173.4991820412688, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0011771800345741212, + "first_payload_s": 0.0011806520051322877, + "first_content_s": 0.3824804819887504, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.3824804819887504, + "last_output_s": 17.435801071987953 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5730466279783286, + "decode_tps": 15.331096997400275, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.84187819566085, + "prefill_tps": 55.84187819566085, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 65.22690451763314, + "round_gap_p50_ms": 164.14699598681182, + "round_gap_p95_ms": 173.49347000708804, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.001390589983202517, + "first_payload_s": 0.0014054059865884483, + "first_content_s": 0.5730466279783286, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5730466279783286, + "last_output_s": 17.20590727997478 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.19378915400011465, + "decode_tps": 14.645794982289106, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 165.1279204200513, + "prefill_tps": 165.1279204200513, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 68.27898391376377, + "round_gap_p50_ms": 163.93947298638523, + "round_gap_p95_ms": 173.48308599321172, + "tokens_per_chunk": 2.392523364485981, + "headers_s": 0.0012505559716373682, + "first_payload_s": 0.0012553089763969183, + "first_content_s": 0.19378915400011465, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.19378915400011465, + "last_output_s": 17.604930052009877 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.44151805199263, + "round_gap_p50_ms": 164.08120200503618, + "round_gap_p95_ms": 173.49347000708804, + "round_gap_mean_ms": 164.09285330032077, + "tokens_per_chunk": 2.4556354916067145, + "aggregate_prompt_ttft_tps": 167.79885822551475, + "aggregate_prefill_tps": 167.79885822551475 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396214.621614025, + "first": 396215.384354439, + "last": 396232.057380712, + "end": 396232.057561786, + "elapsed_s": 17.435947760997806, + "chunk_offsets_s": [ + 0.7627404140075669, + 0.882730886049103, + 1.0145419040345587, + 1.162631911050994, + 1.3117776730214246, + 1.4635594130377285, + 1.611267561034765, + 1.7752945380052552, + 1.9284917630138807, + 2.081981487048324, + 2.2468426330015063, + 2.4086989820352755, + 2.5736880330368876, + 2.747596722037997, + 2.9122445060056634, + 3.0783340000198223, + 3.242557218996808, + 3.402891953010112, + 3.5703792850254104, + 3.7355041770497337, + 3.915150282031391, + 4.091891927004326, + 4.279594285006169, + 4.449449320032727, + 4.615223866014276, + 4.783179090009071, + 4.949636571051087, + 5.116894205042627, + 5.281122416025028, + 5.444881632050965, + 5.611997038999107, + 5.78245873603737, + 5.948950729041826, + 6.119481098023243, + 6.283562300028279, + 6.447889761009719, + 6.611601951997727, + 6.778222763037775, + 6.941452069033403, + 7.109384028997738, + 7.272782825049944, + 7.441931069013663, + 7.612822160997894, + 7.777869485027622, + 7.943487406009808, + 8.113432249054313, + 8.28104158199858, + 8.44518441701075, + 8.603021079034079, + 8.763255285040941, + 8.930361940001603, + 9.09775301499758, + 9.268638219044078, + 9.434822818031535, + 9.60823806305416, + 9.778874657000415, + 9.940872047038283, + 10.104782416019589, + 10.27088048600126, + 10.429032544023357, + 10.594639009039383, + 10.75679451302858, + 10.920779507025145, + 11.077238172001671, + 11.242931486049201, + 11.403632432047743, + 11.561763433041051, + 11.722466683015227, + 11.886990690021776, + 12.048884415999055, + 12.213364886003546, + 12.379203130025417, + 12.539220357022714, + 12.696021522046067, + 12.848731798003428, + 13.009310663037468, + 13.173478779033758, + 13.333778297004756, + 13.492860107042361, + 13.65515438100556, + 13.81529215304181, + 13.980672713019885, + 14.139666330011096, + 14.301186212047469, + 14.462749407044612, + 14.626330637023784, + 14.785804355051368, + 14.939487777010072, + 15.102728828031104, + 15.2678849210497, + 15.431458199047484, + 15.595091830007732, + 15.765889178030193, + 15.927129969000816, + 16.092521136044525, + 16.25125657604076, + 16.406447916000616, + 16.563757790019736, + 16.72875152999768, + 16.8984006580431, + 17.062945210025646, + 17.205874848004896, + 17.333074846013915, + 17.43576668703463 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 164.08120200503618, + "p95": 170.89109198423102, + "max": 187.7023580018431 + } + }, + { + "start": 396214.621726922, + "first": 396215.004207404, + "last": 396232.057527994, + "end": 396232.058106431, + "elapsed_s": 17.436379508988466, + "chunk_offsets_s": [ + 0.3824804819887504, + 0.8829585040220991, + 1.0145098880166188, + 1.162617719033733, + 1.3118273059953935, + 1.4636529019917361, + 1.6117779340129346, + 1.775298330001533, + 1.928694037022069, + 2.081929759006016, + 2.246797065017745, + 2.4087136380258016, + 2.5736728810006753, + 2.7477018589852378, + 2.912550477019977, + 3.0789048050064594, + 3.24263058003271, + 3.403113587992266, + 3.570667399035301, + 3.7356095539871603, + 3.915320636006072, + 4.0920496879843995, + 4.2798338400316425, + 4.449720025993884, + 4.615463452995755, + 4.783463092986494, + 4.949643996020313, + 5.117225455993321, + 5.281298641988542, + 5.445101985998917, + 5.612287601979915, + 5.7824502880102955, + 5.948973754013423, + 6.119827406015247, + 6.283773150993511, + 6.448194772005081, + 6.611834035022184, + 6.7784281090134755, + 6.941613015020266, + 7.109575359034352, + 7.272766393027268, + 7.44218270300189, + 7.613063219003379, + 7.778122671006713, + 7.943708256003447, + 8.113421593036037, + 8.281286976009142, + 8.445179585018195, + 8.603206809028052, + 8.763467687007505, + 8.930950250010937, + 9.097506436984986, + 9.268748764006887, + 9.434934930992313, + 9.608434113033582, + 9.778990609978791, + 9.940983473032247, + 10.105066467018332, + 10.2708519740263, + 10.42915001703659, + 10.594844290986657, + 10.756772321008611, + 10.920944645011332, + 11.077369212987833, + 11.242977279005572, + 11.403816993988585, + 11.561886090028565, + 11.722532299987506, + 11.887147556000855, + 12.04903460899368, + 12.213581832009368, + 12.379293723031878, + 12.53940159099875, + 12.696109379001427, + 12.848865816020407, + 13.00945714500267, + 13.173605996009428, + 13.333916858013254, + 13.493023212999105, + 13.655292958021164, + 13.815410091017839, + 13.980747130000964, + 14.139776651980355, + 14.301319413993042, + 14.462757711007725, + 14.626467917987611, + 14.78596838901285, + 14.939615491020959, + 15.102892286027782, + 15.26802937098546, + 15.43149618402822, + 15.59519939898746, + 15.765876921010204, + 15.92723313800525, + 16.092618113034405, + 16.25092919601593, + 16.406464237021282, + 16.56389907101402, + 16.728854266984854, + 16.8980050390237, + 17.063066490984056, + 17.20587260799948, + 17.333100989984814, + 17.435801071987953 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 164.07318599522114, + "p95": 173.4991820412688, + "max": 500.4780220333487 + } + }, + { + "start": 396214.621837435, + "first": 396215.194884063, + "last": 396231.827744715, + "end": 396231.827855581, + "elapsed_s": 17.206018146011047, + "chunk_offsets_s": [ + 0.5730466279783286, + 0.882766245980747, + 1.0146738730254583, + 1.1626260399934836, + 1.311772393004503, + 1.4635944049805403, + 1.611245448992122, + 1.7752793059917167, + 1.9284173310152255, + 2.081989695027005, + 2.2468074649805203, + 2.4086482290294953, + 2.5736737130209804, + 2.747538978001103, + 2.9125834529986605, + 3.0784865290042944, + 3.242455826024525, + 3.402785087993834, + 3.5702471869881265, + 3.735698899021372, + 3.9152933550067246, + 4.0918702150229365, + 4.279560781025793, + 4.449442007986363, + 4.615179418004118, + 4.783217123011127, + 4.949657740013208, + 5.117020717996638, + 5.281255554000381, + 5.4448463509907015, + 5.612079711980186, + 5.782536000013351, + 5.949400605983101, + 6.119408746017143, + 6.28343687497545, + 6.447987521998584, + 6.611650560982525, + 6.7781551469815895, + 6.9414009809843265, + 7.109318429022096, + 7.272787368972786, + 7.441896779986564, + 7.6128856660216115, + 7.777908172982279, + 7.9434499819763005, + 8.113367561018094, + 8.280912588990759, + 8.44518420897657, + 8.602990759012755, + 8.763212356017902, + 8.930341587984003, + 9.09766904602293, + 9.268574922985863, + 9.434777426009532, + 9.60827089601662, + 9.778831185016315, + 9.940826015023049, + 10.104808960983064, + 10.270894583023619, + 10.428981792007107, + 10.594645968987606, + 10.756798480986618, + 10.920777202991303, + 11.077209275972564, + 11.242974703025538, + 11.403656559996307, + 11.561725129024126, + 11.722470298991539, + 11.886988210026175, + 12.048858784022741, + 12.213327846024185, + 12.37923735397635, + 12.539239510020707, + 12.695935120980721, + 12.848700837988872, + 13.00929543102393, + 13.173442427010741, + 13.333745736978017, + 13.492849307018332, + 13.6551308290218, + 13.815247113001533, + 13.980683737026993, + 14.139614233979955, + 14.301139588002115, + 14.462766174983699, + 14.626302605029196, + 14.785805106977932, + 14.9394463209901, + 15.10271730797831, + 15.267832520999946, + 15.431432774988934, + 15.595038036990445, + 15.765939561999403, + 15.927046080003493, + 16.092558928998187, + 16.25092257198412, + 16.406503165024333, + 16.56384825502755, + 16.728637096995953, + 16.898288929020055, + 17.06289356102934, + 17.20590727997478 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 164.14699598681182, + "p95": 173.49347000708804, + "max": 309.71961800241843 + } + }, + { + "start": 396214.621536376, + "first": 396214.81532553, + "last": 396232.226466428, + "end": 396232.226596541, + "elapsed_s": 17.6050601649913, + "chunk_offsets_s": [ + 0.19378915400011465, + 0.8829445999581367, + 1.0147809619666077, + 1.1628743939800188, + 1.3119502349873073, + 1.4637738149613142, + 1.6114636429701932, + 1.7756495020003058, + 1.9289706959971227, + 2.0822388179949485, + 2.2470479629701003, + 2.40886349597713, + 2.5739202109980397, + 2.7477833639713936, + 2.9125045409891754, + 3.0785160979721695, + 3.242997879977338, + 3.4035391120123677, + 3.571047818986699, + 3.735891957010608, + 3.9153855959884822, + 4.092073688982055, + 4.279781950986944, + 4.44964634598, + 4.615403723961208, + 4.78335350798443, + 4.949911565985531, + 5.117101406969596, + 5.281299474008847, + 5.445054337964393, + 5.612170209002215, + 5.78278886701446, + 5.949489023012575, + 6.120075743994676, + 6.2837928789667785, + 6.448076578963082, + 6.611771425988991, + 6.778543071006425, + 6.941629095003009, + 7.109570670989342, + 7.273011498968117, + 7.442110750998836, + 7.6130283389938995, + 7.778094430977944, + 7.943662735982798, + 8.113729115983006, + 8.281276703986805, + 8.445427907980047, + 8.603218056960031, + 8.76343111100141, + 8.930539046006743, + 9.097909480973613, + 9.268820364959538, + 9.435003891994711, + 9.608486977987923, + 9.779050034994725, + 9.941053104994353, + 10.104952081979718, + 10.271112809015904, + 10.429205857974011, + 10.594861475983635, + 10.75704528397182, + 10.920984756958205, + 11.077410030004103, + 11.243107071961276, + 11.40388024301501, + 11.561951930983923, + 11.722634940990247, + 11.887208405009005, + 12.049070209963247, + 12.213553128007334, + 12.379378860001452, + 12.539484087959863, + 12.696183938998729, + 12.84890306397574, + 13.009517961007077, + 13.173660125001334, + 13.333956906979438, + 13.493059597967658, + 13.65535670297686, + 13.815461435006, + 13.980851930973586, + 14.13983737200033, + 14.301361477992032, + 14.462998753995635, + 14.626508318993729, + 14.786014117009472, + 14.939660642994568, + 15.102902078011539, + 15.268066938966513, + 15.431631464976817, + 15.59526219998952, + 15.766187341010664, + 15.927607845980674, + 16.092746482987422, + 16.251554898975883, + 16.406713263015263, + 16.564014751987997, + 16.728990203991998, + 16.898253408959135, + 17.063311133009847, + 17.206122211006004, + 17.333363824989647, + 17.436359444982372, + 17.503530415007845, + 17.55770001100609, + 17.604930052009877 + ], + "chunk_gaps_ms": { + "count": 106, + "p50": 164.04081849032082, + "p95": 173.48308599321172, + "max": 689.155445958022 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + }, + { + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 57.70439692662911, + "requested_requests": 4, + "timed_requests": 4, + "makespan_s": 17.870291801984422, + "end_to_end_tps": 57.3018063357135, + "timing_valid": true, + "steady_tps": 59.52072487566503, + "per_stream_tps": [ + 14.7, + 14.9, + 14.8, + 14.9 + ], + "ttft_s": [ + 0.38, + 0.57, + 0.19, + 0.81 + ], + "errors": [], + "thinking_modes": [ + "off" + ], + "requests": [ + { + "prompt_tokens": 32, + "ttft_s": 0.38454044004902244, + "decode_tps": 14.725460237044842, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 83.21621516821622, + "prefill_tps": 83.21621516821622, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.90959222342673, + "round_gap_p50_ms": 164.07211497426033, + "round_gap_p95_ms": 183.1516600213945, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.001923171046655625, + "first_payload_s": 0.0019273630459792912, + "first_content_s": 0.38454044004902244, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.38454044004902244, + "last_output_s": 17.70148645702284 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.5729442129959352, + "decode_tps": 14.887590841612266, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 55.85186004876713, + "prefill_tps": 55.85186004876713, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.17003514127367, + "round_gap_p50_ms": 163.98155404021963, + "round_gap_p95_ms": 183.41691000387073, + "tokens_per_chunk": 2.4615384615384617, + "headers_s": 0.0018626099918037653, + "first_payload_s": 0.0018657940090633929, + "first_content_s": 0.5729442129959352, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.5729442129959352, + "last_output_s": 17.701303174020723 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.1937006739899516, + "decode_tps": 14.763619172337862, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 165.20334875892084, + "prefill_tps": 165.20334875892084, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.7340690197204, + "round_gap_p50_ms": 164.23418099293485, + "round_gap_p95_ms": 183.45345498528332, + "tokens_per_chunk": 2.5098039215686274, + "headers_s": 0.0015309909940697253, + "first_payload_s": 0.001534415001515299, + "first_content_s": 0.1937006739899516, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.1937006739899516, + "last_output_s": 17.465888274018653 + }, + { + "prompt_tokens": 32, + "ttft_s": 0.8061392519739456, + "decode_tps": 14.943697698195699, + "thinking": "off", + "thinking_off_requested": true, + "completion": "truncated", + "token_timing": "chunk", + "prompt_ttft_tps": 39.69537511248024, + "prefill_tps": 39.69537511248024, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 66.91784190205748, + "round_gap_p50_ms": 163.57583802891895, + "round_gap_p95_ms": 177.46963701210916, + "tokens_per_chunk": 2.392523364485981, + "headers_s": 0.002642600971739739, + "first_payload_s": 0.0026459770160727203, + "first_content_s": 0.8061392519739456, + "first_reasoning_s": null, + "first_tool_s": null, + "first_output_s": 0.8061392519739456, + "last_output_s": 17.870188936998602 + } + ], + "pooled": { + "streams_timed": 4, + "streams_token_timed": 0, + "itl_mean_ms": null, + "itl_p50_ms": null, + "itl_p95_ms": null, + "tpot_ms": null, + "chunk_tpot_estimate_ms": 67.43288457161957, + "round_gap_p50_ms": 163.76188804861158, + "round_gap_p95_ms": 183.41691000387073, + "round_gap_mean_ms": 166.54126455944785, + "tokens_per_chunk": 2.4556354916067145, + "aggregate_prompt_ttft_tps": 158.78150044992097, + "aggregate_prefill_tps": 158.78150044992097 + }, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3463a68eb112", + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "96f9af0c0dc9", + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "3672ac37f298", + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 256, + "cache_state": "cold", + "complete": true, + "token_sha": "fb6e67c7120b", + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "completion": "truncated", + "finish_reasons": [ + "length" + ], + "tool_calls": 0, + "tool_sha256": null + } + ], + "client_intervals": [ + { + "start": 396232.228508767, + "first": 396232.613049207, + "last": 396249.929995224, + "end": 396249.930204314, + "elapsed_s": 17.701695547031704, + "chunk_offsets_s": [ + 0.38454044004902244, + 0.9609203820000403, + 1.1221350289997645, + 1.3103651380515657, + 1.501990431046579, + 1.6937636460061185, + 1.876915306027513, + 2.0878012489993125, + 2.2407866330468096, + 2.3947157860384323, + 2.561671641014982, + 2.7236312870518304, + 2.886897874006536, + 3.0601940950145945, + 3.2226037770160474, + 3.3848706270218827, + 3.5507357510505244, + 3.7123204500530846, + 3.880834928015247, + 4.046204720041715, + 4.211086203053128, + 4.367371058033314, + 4.531032913015224, + 4.69115814199904, + 4.857837402028963, + 5.0260659900377505, + 5.191992939042393, + 5.354266604001168, + 5.520806695043575, + 5.684878810017835, + 5.852487551048398, + 6.021488018042874, + 6.188753764028661, + 6.355117886036169, + 6.520699070999399, + 6.6869904400082305, + 6.853238656010944, + 7.0203493920271285, + 7.185454158054199, + 7.352481325040571, + 7.515606886998285, + 7.68505545402877, + 7.855268381012138, + 8.017959411023185, + 8.180845067021437, + 8.349264648044482, + 8.519843706046231, + 8.686361605010461, + 8.844307997031137, + 9.005995721032377, + 9.172881479025818, + 9.336471110000275, + 9.508802633034065, + 9.676735522050876, + 9.853947108029388, + 10.02435789204901, + 10.187921955017373, + 10.354109146050178, + 10.522062099014875, + 10.680279998050537, + 10.844965511001647, + 11.00736255402444, + 11.167008499032818, + 11.32415065902751, + 11.489963767002337, + 11.652613965037744, + 11.810810023045633, + 11.971339816052932, + 12.13631890004035, + 12.300521785044111, + 12.462347399035934, + 12.628916594025213, + 12.78983981499914, + 12.950528394023422, + 13.103129438008182, + 13.264517847041134, + 13.430453933018725, + 13.59153801901266, + 13.754072344047017, + 13.916741630004253, + 14.077788740047254, + 14.243213524052408, + 14.401105596043635, + 14.563252669002395, + 14.7292641630047, + 14.89237114903517, + 15.051447520032525, + 15.206111513020005, + 15.368782239034772, + 15.528970940038562, + 15.691856292018201, + 15.85629028303083, + 16.03029799903743, + 16.192714899021666, + 16.35818715603091, + 16.516448670998216, + 16.670746724004857, + 16.828221543051768, + 16.993878874054644, + 17.161855572019704, + 17.324599498009775, + 17.466190164035652, + 17.59522488503717, + 17.70148645702284 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 164.07211497426033, + "p95": 183.1516600213945, + "max": 576.3799419510178 + } + }, + { + "start": 396232.228829683, + "first": 396232.801773896, + "last": 396249.930132857, + "end": 396249.930486893, + "elapsed_s": 17.701657210011035, + "chunk_offsets_s": [ + 0.5729442129959352, + 0.9603086310089566, + 1.1217294410453178, + 1.3098269239999354, + 1.5013607120490633, + 1.6932815450127237, + 1.8766984550165944, + 2.08723425102653, + 2.2403828040114604, + 2.394237172033172, + 2.5610134250018746, + 2.723231266019866, + 2.8863474520039745, + 3.0596274800482206, + 3.2219444420188665, + 3.384236508049071, + 3.5501389290438965, + 3.712099359021522, + 3.880285322025884, + 4.0455764250364155, + 4.210389347048476, + 4.366799388022628, + 4.5303673860034905, + 4.690386166039389, + 4.857442086038645, + 5.025374654040206, + 5.19135317200562, + 5.353808119019959, + 5.520383330003824, + 5.684364884044044, + 5.852016362012364, + 6.020854363043327, + 6.188127005007118, + 6.3546245520119555, + 6.520133481011726, + 6.686517090012785, + 6.852992877014913, + 7.0198207620414905, + 7.184808791032992, + 7.352019559999462, + 7.515068512992002, + 7.684381750994362, + 7.854722935007885, + 8.017327772045974, + 8.180378869001288, + 8.34883005102165, + 8.519373060029466, + 8.685888447042089, + 8.843674486037344, + 9.005751462012995, + 9.172202560002916, + 9.33583220699802, + 9.508419172023423, + 9.67652654304402, + 9.853837025992107, + 10.023872799007222, + 10.187263900006656, + 10.353570531995501, + 10.521558750013355, + 10.679775336000603, + 10.844406241027173, + 11.006805651995819, + 11.166263035032898, + 11.32372927799588, + 11.48949803400319, + 11.65193581301719, + 11.810221137013286, + 11.970796737994533, + 12.135623373033013, + 12.300083652022295, + 12.462424326047767, + 12.62823340302566, + 12.789262305013835, + 12.950101637048647, + 13.102684105047956, + 13.263761406997219, + 13.429843782039825, + 13.591053390002344, + 13.753361103998031, + 13.91664844402112, + 14.077306686027441, + 14.242738607048523, + 14.400642519001849, + 14.56224848201964, + 14.728678492014296, + 14.891674805025104, + 15.050842010008637, + 15.205860389047302, + 15.36831994500244, + 15.528518183040433, + 15.691234958008863, + 15.855821622011717, + 16.029597991029732, + 16.192160603997763, + 16.357575836998876, + 16.51575983100338, + 16.670047596038785, + 16.827639489027206, + 16.99334688403178, + 17.160909769998398, + 17.324607754009776, + 17.4664644220029, + 17.595122467027977, + 17.701303174020723 + ], + "chunk_gaps_ms": { + "count": 103, + "p50": 163.98155404021963, + "p95": 183.41691000387073, + "max": 387.36441801302135 + } + }, + { + "start": 396232.228610288, + "first": 396232.422310962, + "last": 396249.694498562, + "end": 396249.694835141, + "elapsed_s": 17.46622485300759, + "chunk_offsets_s": [ + 0.1937006739899516, + 0.9605971309938468, + 1.1222737670177594, + 1.3101034549763426, + 1.5016558999777772, + 1.6935616920236498, + 1.8770151470089331, + 2.0876044150209054, + 2.240832441020757, + 2.3945183440227993, + 2.561483687022701, + 2.7231055059819482, + 2.886630608001724, + 3.0597722979728132, + 3.222416720003821, + 3.384526656009257, + 3.5502810269827023, + 3.712386563012842, + 3.8805718540097587, + 4.0458595479722135, + 4.210683798999526, + 4.367086543003097, + 4.530783518974204, + 4.690706074004993, + 4.857590327970684, + 5.025667954003438, + 5.1917393680196255, + 5.353975001024082, + 5.520761718973517, + 5.684523607022129, + 5.852047035004944, + 6.021017518010922, + 6.188505953992717, + 6.35478948202217, + 6.520293706969824, + 6.68668586097192, + 6.853270063991658, + 7.020097550004721, + 7.184974025003612, + 7.352181929978542, + 7.51534627698129, + 7.684690491005313, + 7.855098603002261, + 8.017488558019977, + 8.180545175971929, + 8.348995845008176, + 8.519432934001088, + 8.686447045998648, + 8.844057946000248, + 9.00568987801671, + 9.1726021009963, + 9.336217491014395, + 9.508486438018735, + 9.676443375006784, + 9.853991315991152, + 10.024038097006269, + 10.187431613972876, + 10.353910456993617, + 10.52187092899112, + 10.680090411973651, + 10.84471614897484, + 11.006972741975915, + 11.166778848972172, + 11.324114355025813, + 11.489771221007686, + 11.652338266023435, + 11.810509155970067, + 11.970914979989175, + 12.13589812797727, + 12.300354599021375, + 12.46246362401871, + 12.62850771000376, + 12.78953425999498, + 12.950090372993145, + 13.103110318013933, + 13.264219477016013, + 13.430128617968876, + 13.591363521991298, + 13.753768596972805, + 13.916926991019864, + 14.077412415994331, + 14.242797983984929, + 14.400932825985365, + 14.562520165985916, + 14.728824190970045, + 14.89196479297243, + 15.051117453025654, + 15.205793254019227, + 15.368487644009292, + 15.528805227018893, + 15.691612754017115, + 15.85584693501005, + 16.029940459993668, + 16.19245118397521, + 16.357881616975646, + 16.515919465979096, + 16.670362575969193, + 16.828039989981335, + 16.99349392700242, + 17.160971114994027, + 17.324623259017244, + 17.465888274018653 + ], + "chunk_gaps_ms": { + "count": 101, + "p50": 164.23418099293485, + "p95": 183.45345498528332, + "max": 766.8964570038952 + } + }, + { + "start": 396232.228418015, + "first": 396233.034557267, + "last": 396250.098606952, + "end": 396250.098709817, + "elapsed_s": 17.870291801984422, + "chunk_offsets_s": [ + 0.8061392519739456, + 0.9608616610057652, + 1.1224046149873175, + 1.310141519003082, + 1.5020007509738207, + 1.6940181119716726, + 1.877364668995142, + 2.087937474017963, + 2.2409254329977557, + 2.394848890020512, + 2.5614843579824083, + 2.723374867986422, + 2.887034418992698, + 3.0601167010026984, + 3.2224233109736815, + 3.384782416978851, + 3.5506301969871856, + 3.7123332810006104, + 3.8809903530054726, + 4.046120718005113, + 4.211093897989485, + 4.367502658977173, + 4.53086927899858, + 4.691163549025077, + 4.85797193099279, + 5.026041843986604, + 5.192028041987214, + 5.354305067972746, + 5.521023991983384, + 5.6848484729998745, + 5.85250926297158, + 6.021434337017126, + 6.188771891989745, + 6.354871370014735, + 6.52065057400614, + 6.687141479982529, + 6.8535401779809035, + 7.020507457025815, + 7.18539817200508, + 7.352515453007072, + 7.515619270969182, + 7.685000140976626, + 7.855428446026053, + 8.017911057977472, + 8.180993594985921, + 8.349309558980167, + 8.519853417004924, + 8.686686326982453, + 8.844460828986485, + 9.006222666008398, + 9.173042327980511, + 9.33661816600943, + 9.508955914003309, + 9.676883201987948, + 9.854352839000057, + 10.024516421020962, + 10.187860656995326, + 10.353859910974279, + 10.522233652009163, + 10.68042734300252, + 10.845118967990857, + 11.007400666014291, + 11.166768895986024, + 11.324403924983926, + 11.490097543981392, + 11.652652635995764, + 11.810940583993215, + 11.971322742989287, + 12.136264338972978, + 12.30067423399305, + 12.462591479998082, + 12.628866048995405, + 12.78996757499408, + 12.95018986100331, + 13.103389392024837, + 13.264339988993015, + 13.430633789976127, + 13.591676196025219, + 13.753872388973832, + 13.917176704970188, + 14.077946531993803, + 14.243369444971904, + 14.401272956980392, + 14.562876328011043, + 14.729186833021231, + 14.892323867999949, + 15.051486591983121, + 15.20632773800753, + 15.368935294973198, + 15.529103612992913, + 15.691876115975901, + 15.856116681010462, + 16.030243534012698, + 16.192885154974647, + 16.358364788000472, + 16.516396477993112, + 16.670790515025146, + 16.828358008002397, + 16.993549606006127, + 17.161500462971162, + 17.325113822997082, + 17.466740377014503, + 17.595481063006446, + 17.702292032015976, + 17.768581186013762, + 17.823209154012147, + 17.870188936998602 + ], + "chunk_gaps_ms": { + "count": 106, + "p50": 163.59459902741946, + "p95": 177.46963701210916, + "max": 210.57280502282083 + } + } + ], + "equal_alone": [ + true, + true, + true, + true + ], + "comparisons": [ + { + "concurrent": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3463a68eb11294263084e2693634c78c7c4ab3b865ef9dfd2d27affae273681b", + "output_sha256": "e4fe2428ebd47e59f260d0d2e0ee08fb03626db89c59d0dcc49b22ceadd1c761", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "96f9af0c0dc9258a9a4f2b3ebae309da1fa22d9d1a801a15b65c40ffc6bcfa6b", + "output_sha256": "ba3f043ca0377a7ebb395a4b9864cb0d80b858031abe1372ec29366fa55e538f", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "3672ac37f2982882b4f48addb244ea161614266385c684249a4628f6fa209963", + "output_sha256": "1d580f1338c4fbce6025d3905ee08c497bac7fbab71c3141bb0a8d5cf35eae34", + "complete": true, + "error": null, + "thinking": "off" + } + }, + { + "concurrent": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "alone": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + }, + "serial": { + "tokens": 256, + "token_sha256": "fb6e67c7120bf830a1d4680094431b139e59d04b4458ee67e4d672b5cf69c81e", + "output_sha256": "bab840af9f0760a0160ac3af223a17f338817c31ee433b8e78f033ff3b6f901b", + "complete": true, + "error": null, + "thinking": "off" + } + } + ] + } + ] + } + ], + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + }, + "collector_us_per_chunk": 2.48, + "thinking_switch": true, + "thinking_applicable": true +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/form.txt new file mode 100644 index 00000000000..61f72ad9f90 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts classic diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/golden.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/golden.json new file mode 100644 index 00000000000..fdd1e2700ec --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/golden.json @@ -0,0 +1,41 @@ +{ + "count": { + "n": 512, + "token_sha256": "ba28cfb7c5b94418cb274891300c856ef827ac5d647505c33d6793a240e7ce48", + "text": "Count 1..N? User says count upward from one, one number per line. Probably continue pattern? Just count 1 to 204? Ambiguous; likely mirror 204 lines. I'll do 1–204.1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n191\n192\n193\n194\n195\n196\n197\n198\n199\n200\n201\n202\n203\n204<|user|>The user wants me to count upward from one, one number per line. The previous response counted 1 to 204. Now the user says \"Continue\" — so I should continue counting from 205.\n\nLet me continue from 205.205\n", + "seconds": { + "drafts": 11.11, + "plain": 22.38 + }, + "drafts": { + "per_round": 4.302521008403361, + "accepted": 0.7401129943502824 + } + }, + "prose": { + "n": 512, + "token_sha256": "dae7e2a5c84e5b6fb9d32a16a36fdb3abfa616b94c936b672c01ed51b18a08a6", + "text": "# 古代の道から現代の物流へ――日本の道路網に刻まれた時間\n\n日本の国土を飛行機から眺めると、幹線道路や鉄道、高速道路が幾重にも絡み合う様子が見える。一見すると現代ならではの風景に思えるが、その多くは実に千数百年前、古代の国家が描いた「道」の設計思想を色濃く受け継いでいる。古代の道路網と現代の物流網のあいだには、断絶ではなく連続の糸が張り巡らされているのである。\n\n## 律令国家が描いた幹線の原型\n\n七世紀後半、律令国家は都と地方を結ぶ官道を整備した。なかでも有名なのが東海道、東山道、北陸道、山陽道、南海道、西海道といった「七道」である。中央から諸国に派遣される使者や、地方から都へ運ばれる租税・貢納物は、この道網を通じて流れた。駅家が約十六キロメートルごとに置かれ、馬や人夫が常時待機していたという。これはまさに古代の「物流インフラ」であり、国家の存立を支える動脈だった。\n\n注目すべきは、これらの道が単に二点間を結ぶのではなく、地形と既存の集落配置を考慮しながら、後世の生活圏を規定するように引かれたことである。たとえば東海道のルートは、鎌倉時代の鎌倉街道、江戸時代の五街道、そして現代の国道一号線や東海道新幹線・東名高速道路へと、ほぼ同じ地理的骨格を保ちながら継承されてきた。山や河川の渡河点、峠の位置といった自然条件は千年経っても変わらない。だからこそ、古代人が選んだ「通りやすい場所」は、現代のエンジニアが選ぶ場所とも重なるのである。\n\n## 駅制から宿場町、そして物流拠点へ\n\n古代の駅家", + "seconds": { + "drafts": 15.93, + "plain": 22.55 + }, + "drafts": { + "per_round": 1.9320754716981132, + "accepted": 0.5359477124183006 + } + }, + "code": { + "n": 512, + "token_sha256": "db45a54eb863ca46490cb8b9f235656c7b78494b7a175833d8b62403517c25f3", + "text": "Write a module with TTL LRU cache and tests.```python\n\"\"\"\nttl_lru_cache.py\n\nA thread-safe LRU cache with per-entry TTL (time-to-live) expiry.\n\nFeatures\n--------\n- Least-Recently-Used eviction when the capacity is exceeded.\n- Per-entry time-to-live: expired entries are treated as missing and\n purged lazily on access (and opportunistically during writes).\n- Thread safety via a single re-entrant lock.\n- Full type hints and docstrings.\n- Self-contained unit tests runnable via `python ttl_lru_cache.py`\n or `pytest ttl_lru_cache.py`.\n\nRequires Python 3.9+ (uses built-in generics).\n\"\"\"\n\nfrom __future__ import annotations\n\nimport threading\nimport time\nimport unittest\nfrom collections import OrderedDict\nfrom typing import Callable, Generic, Hashable, Optional, TypeVar\n\n__all__ = [\"TTLCache\", \"TTLCacheError\"]\n\nK = TypeVar(\"K\", bound=Hashable)\nV = TypeVar(\"V\")\n\n\nclass TTLCacheError(Exception):\n \"\"\"Base exception for TTLCache errors.\"\"\"\n\n\nclass TTLCache(Generic[K, V]):\n \"\"\"\n A fixed-capacity, thread-safe LRU cache whose entries expire\n after a configurable time-to-live.\n\n Args:\n maxsize: Maximum number of entries. Must be > 0.\n ttl: Default time-to-live in seconds for entries that do not\n specify one. Must be > 0. May be ``None`` to mean\n \"no expiry\" for entries inserted without an explicit ttl.\n\n Example:\n >>> cache = TTLCache(maxsize=2, ttl=60)\n >>> cache.put(\"a\", 1)\n >>> cache.get(\"a\")\n 1\n \"\"\"\n\n def __init__(\n self,\n maxsize: int,\n ttl: Optional[float] = None,\n clock: Callable[[], float] = time.monotonic,\n ) -> None:\n if maxsize <= 0:\n raise ValueError(\"maxsize must be a positive integer\")\n if ttl is not None and ttl <= 0:\n raise ValueError(\"ttl must be positive or None\")\n\n self._maxsize = maxsize\n self._default_ttl = ttl\n self._clock = clock # injectable for testing\n self._lock = threading.RLock()\n # Maps key -> (value, expiry_deadline or None). OrderedDict gives\n # us", + "seconds": { + "drafts": 13.05, + "plain": 22.56 + }, + "drafts": { + "per_round": 2.942528735632184, + "accepted": 0.7094736842105264 + } + } +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/resume.json b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/resume.json new file mode 100644 index 00000000000..d66c7909938 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/re-h/resume.json @@ -0,0 +1,56 @@ +{ + "nonce": "18e8b52d2e0259a8", + "requested_reply_tokens": 64, + "temperature": 0, + "rows": [ + { + "phase": "first", + "seconds": 6.637, + "prompt_tokens": 6597, + "cached_tokens": 0, + "tokens": 64, + "token_sha256": "4df5df51ca816da528dc4ba7d86869032173576eecd49520d9fdd342ecba5fc4", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the fewest stones? Several lines tie for the fewest, so list all lines that mention 0 stones.\n\nLines mentioning 0 stones: 0, 101, 202\n\nLet me verify: Line 0: 0" + }, + { + "phase": "repeated", + "seconds": 2.266, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "4df5df51ca816da528dc4ba7d86869032173576eecd49520d9fdd342ecba5fc4", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the fewest stones? Several lines tie for the fewest, so list all lines that mention 0 stones.\n\nLines mentioning 0 stones: 0, 101, 202\n\nLet me verify: Line 0: 0", + "same_as_first": true + }, + { + "phase": "draft_false", + "seconds": 3.102, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "4df5df51ca816da528dc4ba7d86869032173576eecd49520d9fdd342ecba5fc4", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the fewest stones? Several lines tie for the fewest, so list all lines that mention 0 stones.\n\nLines mentioning 0 stones: 0, 101, 202\n\nLet me verify: Line 0: 0", + "same_as_first": true + }, + { + "phase": "concurrent", + "seconds": 3.392, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "4df5df51ca816da528dc4ba7d86869032173576eecd49520d9fdd342ecba5fc4", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the fewest stones? Several lines tie for the fewest, so list all lines that mention 0 stones.\n\nLines mentioning 0 stones: 0, 101, 202\n\nLet me verify: Line 0: 0", + "same_as_first": true + }, + { + "phase": "concurrent", + "seconds": 3.344, + "prompt_tokens": 6597, + "cached_tokens": 6144, + "tokens": 64, + "token_sha256": "4df5df51ca816da528dc4ba7d86869032173576eecd49520d9fdd342ecba5fc4", + "content": "Line 232 mentions the most stones, with 100.<|user|>Which line mentions the fewest stones? Several lines tie for the fewest, so list all lines that mention 0 stones.\n\nLines mentioning 0 stones: 0, 101, 202\n\nLet me verify: Line 0: 0", + "same_as_first": true + } + ] +} \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/form.txt new file mode 100644 index 00000000000..309b311d245 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/form.txt @@ -0,0 +1 @@ +windows (timed): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts classic diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/nodraft.json new file mode 100644 index 00000000000..e7c3547797f --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 25.405520065592228, + "decode_tps_all": [ + 25.38, + 25.47, + 25.41 + ], + "ttft_s_median": 0.12079862097743899, + "prompt_ttft_tps_median": 115.895, + "prefill_tps_median": 115.895, + "itl_mean_ms_median": 39.362, + "itl_p50_ms_median": 39.116, + "itl_p95_ms_median": 40.283, + "tpot_ms_median": 39.362, + "chunk_tpot_estimate_ms_median": 39.362, + "round_gap_p50_ms_median": 39.116, + "round_gap_p95_ms_median": 40.283, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.121, + "first_content_s_median": 0.121, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.121, + "last_output_s_median": 5.119, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 25.349518016467798, + "decode_tps_all": [ + 25.39, + 25.35, + 25.35 + ], + "ttft_s_median": 0.18806349096121266, + "prompt_ttft_tps_median": 170.155, + "prefill_tps_median": 170.155, + "itl_mean_ms_median": 39.448, + "itl_p50_ms_median": 39.296, + "itl_p95_ms_median": 40.205, + "tpot_ms_median": 39.448, + "chunk_tpot_estimate_ms_median": 39.448, + "round_gap_p50_ms_median": 39.296, + "round_gap_p95_ms_median": 40.205, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.188, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.188, + "last_output_s_median": 5.198, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill32768.json new file mode 100644 index 00000000000..89385b03bfb --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill32768.json @@ -0,0 +1,209 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.724777020979673, + "decode_tps": 34.7923524909915, + "elapsed_s": 23.15607133699814, + "chunk_offsets_s": [ + 22.724777020979673, + 22.79709102702327, + 22.859570557018742, + 22.92288531002123, + 22.984698946005665, + 23.047681936994195, + 23.107641730981413, + 23.155906246975064 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 62.47952999547124, + "p95": 72.31400604359806, + "max": 72.31400604359806 + }, + "completion": "truncated", + "headers_s": 0.025042010005563498, + "first_payload_s": 15.101061816967558, + "first_output_s": 22.724777020979673, + "last_output_s": 23.155906246975064, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.116235358000267, + "decode_tps": 34.765473527089924, + "elapsed_s": 22.5478237530333, + "chunk_offsets_s": [ + 22.116235358000267, + 22.18717882502824, + 22.251139987027273, + 22.31400678603677, + 22.375350499001797, + 22.439122731040698, + 22.499958935019094, + 22.547697912028525 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 62.86679900949821, + "p95": 70.94346702797338, + "max": 70.94346702797338 + }, + "completion": "truncated", + "headers_s": 0.012142466031946242, + "first_payload_s": 15.083914034010377, + "first_output_s": 22.116235358000267, + "last_output_s": 22.547697912028525, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.646740488009527, + "decode_tps": 33.09761338326986, + "elapsed_s": 23.100052908004727, + "chunk_offsets_s": [ + 22.646740488009527, + 22.741260580020025, + 22.80318334000185, + 22.865593128022738, + 22.92722195002716, + 22.991332939011045, + 23.051954934024252, + 23.099945370981004 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 61.92275998182595, + "p95": 94.52009201049805, + "max": 94.52009201049805 + }, + "completion": "truncated", + "headers_s": 0.0023855750332586467, + "first_payload_s": 15.059393734030891, + "first_output_s": 22.646740488009527, + "last_output_s": 23.099945370981004, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 45.8952823060099, + "decode_tps": 26.02393442847014, + "elapsed_s": 46.471811135008465, + "chunk_offsets_s": [ + 45.8952823060099, + 46.02194126800168, + 46.134810306015424, + 46.24100289796479, + 46.334245909994934, + 46.40977662696969, + 46.47167478199117 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 99.71780198975466, + "p95": 126.6589619917795, + "max": 126.6589619917795 + }, + "completion": "truncated", + "headers_s": 0.004338169004768133, + "first_payload_s": 15.07390049600508, + "first_output_s": 45.8952823060099, + "last_output_s": 46.47167478199117, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.706262649968266, + "decode_tps": 1.59479805690562, + "elapsed_s": 32.11194745497778, + "chunk_offsets_s": [ + 22.706262649968266, + 22.800280850962736, + 24.24472778098425, + 26.001470212999266, + 27.5457691809861, + 29.06779362197267, + 30.589971201959997, + 32.11184220598079 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 1522.02444098657, + "p95": 1756.7424320150167, + "max": 1756.7424320150167 + }, + "completion": "truncated", + "headers_s": 0.0042158960131928325, + "first_payload_s": 15.079673447005916, + "first_output_s": 22.706262649968266, + "last_output_s": 32.11184220598079, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.471925552003086, + "end_to_end_tps": 0.6885877789632648, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill8192.json new file mode 100644 index 00000000000..edc4c393778 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh1/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.624311302031856, + "decode_tps": 38.348370847521146, + "elapsed_s": 6.015569409006275, + "chunk_offsets_s": [ + 5.624311302031856, + 5.702590078988578, + 5.7764345750329085, + 5.845490274019539, + 5.910059963003732, + 5.9679233339848, + 6.015462208015379 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.8126939854119, + "p95": 78.27877695672214, + "max": 78.27877695672214 + }, + "completion": "truncated", + "headers_s": 0.015054028015583754, + "first_payload_s": 5.624311302031856, + "first_output_s": 5.624311302031856, + "last_output_s": 6.015462208015379, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.620806709979661, + "decode_tps": 29.309679609863096, + "elapsed_s": 6.132691959966905, + "chunk_offsets_s": [ + 5.620806709979661, + 5.707550061983056, + 5.792006352974568, + 5.874214014969766, + 5.935261751990765, + 6.001630979008041, + 6.073541136982385, + 6.132583030965179 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 71.91015797434375, + "p95": 86.74335200339556, + "max": 86.74335200339556 + }, + "completion": "truncated", + "headers_s": 0.0012381550041027367, + "first_payload_s": 5.620806709979661, + "first_output_s": 5.620806709979661, + "last_output_s": 6.132583030965179, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 6.050736352975946, + "decode_tps": 35.79464110499979, + "elapsed_s": 6.470063721004408, + "chunk_offsets_s": [ + 6.050736352975946, + 6.1423619439592585, + 6.2154745779698715, + 6.2850549389841035, + 6.358191924984567, + 6.4229278569691814, + 6.4697934949654154 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 71.3464975124225, + "p95": 91.62559098331258, + "max": 91.62559098331258 + }, + "completion": "truncated", + "headers_s": 0.001981298963073641, + "first_payload_s": 6.050736352975946, + "first_output_s": 6.050736352975946, + "last_output_s": 6.4697934949654154, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 11.930164913006593, + "decode_tps": 34.42075560546557, + "elapsed_s": 12.36603393102996, + "chunk_offsets_s": [ + 11.930164913006593, + 12.039140604028944, + 12.129473895998672, + 12.198018009017687, + 12.260019387991633, + 12.31805716198869, + 12.365948489983566 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 65.27274599648081, + "p95": 108.97569102235138, + "max": 108.97569102235138 + }, + "completion": "truncated", + "headers_s": 0.0015491510275751352, + "first_payload_s": 11.930164913006593, + "first_output_s": 11.930164913006593, + "last_output_s": 12.365948489983566, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.615244886022992, + "decode_tps": 2.3028808385279556, + "elapsed_s": 12.129097124037798, + "chunk_offsets_s": [ + 5.615244886022992, + 5.692748329020105, + 7.148635684046894, + 8.907122108037584, + 10.458453033003025, + 12.038759544026107, + 12.128825506020803 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1503.6091399961151, + "p95": 1758.4864239906892, + "max": 1758.4864239906892 + }, + "completion": "truncated", + "headers_s": 0.001290443993639201, + "first_payload_s": 5.615244886022992, + "first_output_s": 5.615244886022992, + "last_output_s": 12.128825506020803, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 12.366143020044547, + "end_to_end_tps": 2.587710650615193, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/form.txt new file mode 100644 index 00000000000..61f72ad9f90 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts classic diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/nodraft.json new file mode 100644 index 00000000000..e1cb7e00ce1 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 25.447436041247183, + "decode_tps_all": [ + 25.42, + 25.46, + 25.45 + ], + "ttft_s_median": 0.12175500701414421, + "prompt_ttft_tps_median": 114.985, + "prefill_tps_median": 114.985, + "itl_mean_ms_median": 39.297, + "itl_p50_ms_median": 39.129, + "itl_p95_ms_median": 40.085, + "tpot_ms_median": 39.297, + "chunk_tpot_estimate_ms_median": 39.297, + "round_gap_p50_ms_median": 39.129, + "round_gap_p95_ms_median": 40.085, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.122, + "first_content_s_median": 0.122, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.122, + "last_output_s_median": 5.114, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 25.39616212699927, + "decode_tps_all": [ + 25.4, + 23.28, + 25.45 + ], + "ttft_s_median": 0.18943100300384685, + "prompt_ttft_tps_median": 168.927, + "prefill_tps_median": 168.927, + "itl_mean_ms_median": 39.376, + "itl_p50_ms_median": 39.183, + "itl_p95_ms_median": 40.362, + "tpot_ms_median": 39.376, + "chunk_tpot_estimate_ms_median": 39.376, + "round_gap_p50_ms_median": 39.183, + "round_gap_p95_ms_median": 40.362, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.189, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.189, + "last_output_s_median": 5.191, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill32768.json new file mode 100644 index 00000000000..358d6412504 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill32768.json @@ -0,0 +1,205 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.107239347998984, + "decode_tps": 33.44149054602168, + "elapsed_s": 22.55590449401643, + "chunk_offsets_s": [ + 22.107239347998984, + 22.20276807801565, + 22.293403048010077, + 22.379294501035474, + 22.455971337039955, + 22.508000111032743, + 22.555783947987948 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 81.28414451493882, + "p95": 95.5287300166674, + "max": 95.5287300166674 + }, + "completion": "truncated", + "headers_s": 0.015406260034069419, + "first_payload_s": 15.104594923031982, + "first_output_s": 22.107239347998984, + "last_output_s": 22.555783947987948, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 23.173289059021045, + "decode_tps": 34.842371219422695, + "elapsed_s": 23.603913209051825, + "chunk_offsets_s": [ + 23.173289059021045, + 23.26247494999552, + 23.345780458010267, + 23.42792719003046, + 23.503779423015658, + 23.556029597006273, + 23.60379936802201 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 78.99948250269517, + "p95": 89.18589097447693, + "max": 89.18589097447693 + }, + "completion": "truncated", + "headers_s": 0.0036702430224977434, + "first_payload_s": 15.10289219301194, + "first_output_s": 23.173289059021045, + "last_output_s": 23.60379936802201, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 23.230663489957806, + "decode_tps": 34.80648760007128, + "elapsed_s": 23.66171494399896, + "chunk_offsets_s": [ + 23.230663489957806, + 23.320960213954095, + 23.40376258897595, + 23.484731957956683, + 23.561785391997546, + 23.613289915956557, + 23.661617631965782 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 79.01140151079744, + "p95": 90.29672399628907, + "max": 90.29672399628907 + }, + "completion": "truncated", + "headers_s": 0.0023835869506001472, + "first_payload_s": 15.06349837797461, + "first_output_s": 23.230663489957806, + "last_output_s": 23.661617631965782, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 46.186765684047714, + "decode_tps": 31.975809849871602, + "elapsed_s": 46.656018925015815, + "chunk_offsets_s": [ + 46.186765684047714, + 46.29402083205059, + 46.39120772201568, + 46.47801355103729, + 46.544370333023835, + 46.60384061100194, + 46.65587030001916 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 76.58130550407805, + "p95": 107.25514800287783, + "max": 107.25514800287783 + }, + "completion": "truncated", + "headers_s": 0.005146089009940624, + "first_payload_s": 15.090408124029636, + "first_output_s": 46.186765684047714, + "last_output_s": 46.65587030001916, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.226167974004056, + "decode_tps": 1.7177411321692986, + "elapsed_s": 30.95864981698105, + "chunk_offsets_s": [ + 22.226167974004056, + 22.339216519962065, + 24.037273990979884, + 26.381959205958992, + 27.926683823985513, + 29.446154372999445, + 30.958566423971206 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1532.0975835202262, + "p95": 2344.6852149791084, + "max": 2344.6852149791084 + }, + "completion": "truncated", + "headers_s": 0.005122840986587107, + "first_payload_s": 15.093437349016313, + "first_output_s": 22.226167974004056, + "last_output_s": 30.958566423971206, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.656127629976254, + "end_to_end_tps": 0.685869180009706, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill8192.json new file mode 100644 index 00000000000..116d577b32d --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/rh2/prefill8192.json @@ -0,0 +1,207 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.628673529019579, + "decode_tps": 38.86568759828531, + "elapsed_s": 6.014756391989067, + "chunk_offsets_s": [ + 5.628673529019579, + 5.7047155239852145, + 5.777842418989167, + 5.847053819976281, + 5.910639840003569, + 5.96748126600869, + 6.014618071028963 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.39871050720103, + "p95": 76.04199496563524, + "max": 76.04199496563524 + }, + "completion": "truncated", + "headers_s": 0.014727870002388954, + "first_payload_s": 5.628673529019579, + "first_output_s": 5.628673529019579, + "last_output_s": 6.014618071028963, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.620711768977344, + "decode_tps": 33.81478539132926, + "elapsed_s": 6.064409220009111, + "chunk_offsets_s": [ + 5.620711768977344, + 5.707684397988487, + 5.7896093289600685, + 5.861792456009425, + 5.9122357569867745, + 5.967190333001781, + 6.016808282001875, + 6.0643047069897875 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 54.95457601500675, + "p95": 86.972629011143, + "max": 86.972629011143 + }, + "completion": "truncated", + "headers_s": 0.0012046039919368923, + "first_payload_s": 5.620711768977344, + "first_output_s": 5.620711768977344, + "last_output_s": 6.0643047069897875, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.623109997017309, + "decode_tps": 37.441695886608265, + "elapsed_s": 6.0238875490031205, + "chunk_offsets_s": [ + 5.623109997017309, + 5.714859823987354, + 5.788043264008593, + 5.853200546989683, + 5.909108381019905, + 5.976278979040217, + 6.023732875997666 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 66.16394050070085, + "p95": 91.74982697004452, + "max": 91.74982697004452 + }, + "completion": "truncated", + "headers_s": 0.001671025005634874, + "first_payload_s": 5.623109997017309, + "first_output_s": 5.623109997017309, + "last_output_s": 6.023732875997666, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.89456380798947, + "decode_tps": 31.640878359632435, + "elapsed_s": 13.36876082298113, + "chunk_offsets_s": [ + 12.89456380798947, + 13.010721519007348, + 13.101799147960264, + 13.166915070964023, + 13.218625504989177, + 13.269781357957982, + 13.320629687979817, + 13.368634085985832 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 51.71043402515352, + "p95": 116.15771101787686, + "max": 116.15771101787686 + }, + "completion": "truncated", + "headers_s": 0.0013733729720115662, + "first_payload_s": 12.89456380798947, + "first_output_s": 12.89456380798947, + "last_output_s": 13.368634085985832, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.788181996962521, + "decode_tps": 2.0512493847210322, + "elapsed_s": 13.100878850964364, + "chunk_offsets_s": [ + 5.788181996962521, + 5.882721834990662, + 8.137384344008751, + 9.89526581496466, + 11.423349971999414, + 13.011035232979339, + 13.100798450002912 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1557.8847090073396, + "p95": 2254.6625090180896, + "max": 2254.6625090180896 + }, + "completion": "truncated", + "headers_s": 0.001333229010924697, + "first_payload_s": 5.788181996962521, + "first_output_s": 5.788181996962521, + "last_output_s": 13.100798450002912, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 13.368891511985566, + "end_to_end_tps": 2.3936165516274217, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/roff/form.txt b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/form.txt new file mode 100644 index 00000000000..61f72ad9f90 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/form.txt @@ -0,0 +1 @@ +windows (kept): 38.78 ms at 1 row, 59.91 at 4, 179.20 at 32, a draft 1.92 ms; experts classic diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/roff/nodraft.json b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/nodraft.json new file mode 100644 index 00000000000..0b5d6850cd7 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/nodraft.json @@ -0,0 +1,150 @@ +[ + { + "label": "nodraft", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "thinking": "not applicable", + "thinking_off_requested": false, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 23.728870703688493, + "decode_tps_all": [ + 23.65, + 23.75, + 23.73 + ], + "ttft_s_median": 0.124606960976962, + "prompt_ttft_tps_median": 112.353, + "prefill_tps_median": 112.353, + "itl_mean_ms_median": 42.143, + "itl_p50_ms_median": 41.951, + "itl_p95_ms_median": 42.92, + "tpot_ms_median": 42.143, + "chunk_tpot_estimate_ms_median": 42.143, + "round_gap_p50_ms_median": 41.951, + "round_gap_p95_ms_median": 42.92, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.125, + "first_content_s_median": 0.125, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.125, + "last_output_s_median": 5.477, + "evidence": [ + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 14, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "1d7c9d905ba7", + "output_sha256": "75998633440b6ddc841d2159f82c84ab825a7070585c8effb8c41e858eb7acbc", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": " Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... The next number is found by adding up the two numbers before it. The Fibonacci sequence i", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + }, + { + "label": "nodraft", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "thinking": "off", + "thinking_off_requested": true, + "thinking_switch": true, + "thinking_applicable": true, + "decode_tps_median": 22.851532984197025, + "decode_tps_all": [ + 21.72, + 22.85, + 23.66 + ], + "ttft_s_median": 0.19301379803800955, + "prompt_ttft_tps_median": 165.791, + "prefill_tps_median": 165.791, + "itl_mean_ms_median": 43.761, + "itl_p50_ms_median": 42.064, + "itl_p95_ms_median": 55.059, + "tpot_ms_median": 43.761, + "chunk_tpot_estimate_ms_median": 43.761, + "round_gap_p50_ms_median": 42.064, + "round_gap_p95_ms_median": 55.059, + "tokens_per_chunk_median": 1.0, + "headers_s_median": 0.001, + "first_payload_s_median": 0.001, + "first_content_s_median": 0.193, + "first_reasoning_s_median": null, + "first_tool_s_median": null, + "first_output_s_median": 0.193, + "last_output_s_median": 5.797, + "evidence": [ + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + }, + { + "prompt_tokens": 32, + "cached_tokens": 0, + "tokens": 128, + "cache_state": "cold", + "complete": true, + "token_sha": "458d573f26b0", + "output_sha256": "80029314f57f5bcd08bdb77410fe41bf4995196990ebacd20ad0bd65ec57aaf8", + "completion": "truncated", + "tool_sha256": null + } + ], + "sample": "# How GPUs Do Matrix Multiplication\n\n## The Plain-English Explanation\n\nImagine you have a huge stack of homework to grade, where each problem is completely inde", + "deprecated_keys": { + "prefill_tps": "deprecated: same value as prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time", + "aggregate_prefill_tps": "deprecated: same value as aggregate_prompt_ttft_tps; prompt tokens over client TTFT, not the engine's prefill time" + } + } +] \ No newline at end of file diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill32768.json b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill32768.json new file mode 100644 index 00000000000..b6daaf897a0 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill32768.json @@ -0,0 +1,208 @@ +{ + "schema_version": 1, + "fixture_sha256": "c105be05d1b0c6b28e44631b828c1891b966318135c251dff3e8a62222893c45", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.54428472201107, + "decode_tps": 30.310451649775512, + "elapsed_s": 23.03928750997875, + "chunk_offsets_s": [ + 22.54428472201107, + 22.63377242698334, + 22.69904062896967, + 22.770433383004274, + 22.85803116596071, + 22.924273137003183, + 22.98789356398629, + 23.03916352399392 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 66.24197104247287, + "p95": 89.48770497227088, + "max": 89.48770497227088 + }, + "completion": "truncated", + "headers_s": 0.015514335012994707, + "first_payload_s": 15.077464776986744, + "first_output_s": 22.54428472201107, + "last_output_s": 23.03916352399392, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.811845081974752, + "decode_tps": 29.57343921808111, + "elapsed_s": 23.319207404972985, + "chunk_offsets_s": [ + 22.811845081974752, + 22.903183414950036, + 22.98538385494612, + 23.052551323955413, + 23.121923036989756, + 23.2040928209899, + 23.26737207797123, + 23.319056971988175 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 69.37171303434297, + "p95": 91.33833297528327, + "max": 91.33833297528327 + }, + "completion": "truncated", + "headers_s": 0.003897203947417438, + "first_payload_s": 15.068303634994663, + "first_output_s": 22.811845081974752, + "last_output_s": 23.319056971988175, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.63781940797344, + "decode_tps": 29.47747346067779, + "elapsed_s": 23.146813919011038, + "chunk_offsets_s": [ + 22.63781940797344, + 22.7304467309732, + 22.81331636296818, + 22.883858041022904, + 22.965832176967524, + 23.032119880022947, + 23.095447074971162, + 23.146682557999156 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 70.54167805472389, + "p95": 92.62732299976051, + "max": 92.62732299976051 + }, + "completion": "truncated", + "headers_s": 0.0023536860244348645, + "first_payload_s": 15.059826934011653, + "first_output_s": 22.63781940797344, + "last_output_s": 23.146682557999156, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 45.82383548998041, + "decode_tps": 30.651703337473364, + "elapsed_s": 46.31330793799134, + "chunk_offsets_s": [ + 45.82383548998041, + 45.93550648196833, + 46.03738003998296, + 46.130774909979664, + 46.198108800977934, + 46.26117927697487, + 46.31320470495848 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 80.3643804974854, + "p95": 111.6709919879213, + "max": 111.6709919879213 + }, + "completion": "truncated", + "headers_s": 0.002386757987551391, + "first_payload_s": 15.06181198899867, + "first_output_s": 45.82383548998041, + "last_output_s": 46.31320470495848, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 32768, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "2e98fab70f4c", + "token_sha256": "2e98fab70f4c82714237166e1223f4ad5511add2d8fc713220f365af8179f711", + "output_sha256": "ff99f150b3c184074e45ce88e409480ed6b3edcd5e7ea3ff7f70fb2215868d9d", + "ttft_s": 22.65053295099642, + "decode_tps": 1.8976990570852577, + "elapsed_s": 30.55494388297666, + "chunk_offsets_s": [ + 22.65053295099642, + 22.74231055600103, + 24.203540088958107, + 25.970497378963046, + 27.517589506984223, + 29.04270589799853, + 30.55484209000133 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 1518.6262915085535, + "p95": 1766.9572900049388, + "max": 1766.9572900049388 + }, + "completion": "truncated", + "headers_s": 0.0023431250010617077, + "first_payload_s": 15.060471799981315, + "first_output_s": 22.65053295099642, + "last_output_s": 30.55484209000133, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 46.31340745900525, + "end_to_end_tps": 0.6909446260961278, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill8192.json b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill8192.json new file mode 100644 index 00000000000..80137f86f1f --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/runs/roff/prefill8192.json @@ -0,0 +1,206 @@ +{ + "schema_version": 1, + "fixture_sha256": "74bb6517bf642880d0771689496aeef11328e2784700b5ea0f3ca09cb4570b21", + "requested_reply_tokens": 16, + "temperature": 0, + "seed": 1234, + "rows": [ + { + "phase": "first", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.657575730991084, + "decode_tps": 37.32457431423956, + "elapsed_s": 6.0595522779622115, + "chunk_offsets_s": [ + 5.657575730991084, + 5.737388030975126, + 5.8124174059485085, + 5.884417857974768, + 5.949321811960544, + 6.00880397297442, + 6.059455732989591 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 68.45220300601795, + "p95": 79.8122999840416, + "max": 79.8122999840416 + }, + "completion": "truncated", + "headers_s": 0.014466995955444872, + "first_payload_s": 5.657575730991084, + "first_output_s": 5.657575730991084, + "last_output_s": 6.059455732989591, + "tool_calls": 0, + "tool_sha256": null + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.645154989033472, + "decode_tps": 34.5903337626464, + "elapsed_s": 6.078935046039987, + "chunk_offsets_s": [ + 5.645154989033472, + 5.733689545013476, + 5.8182889760355465, + 5.893946085998323, + 5.9613280960475095, + 6.0281828050501645, + 6.07880214904435 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 71.51956000598148, + "p95": 88.53455598000437, + "max": 88.53455598000437 + }, + "completion": "truncated", + "headers_s": 0.0011123950243927538, + "first_payload_s": 5.645154989033472, + "first_output_s": 5.645154989033472, + "last_output_s": 6.07880214904435, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "repeated", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 5.64954489498632, + "decode_tps": 33.27728255520606, + "elapsed_s": 6.100438377005048, + "chunk_offsets_s": [ + 5.64954489498632, + 5.747329936013557, + 5.8348743240348995, + 5.906878263980616, + 5.982473854033742, + 6.049582022009417, + 6.100302855018526 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 73.79976499942131, + "p95": 97.78504102723673, + "max": 97.78504102723673 + }, + "completion": "truncated", + "headers_s": 0.0010950820287689567, + "first_payload_s": 5.64954489498632, + "first_output_s": 5.64954489498632, + "last_output_s": 6.100302855018526, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 12.93118971498916, + "decode_tps": 30.819635953104857, + "elapsed_s": 13.417962478008121, + "chunk_offsets_s": [ + 12.93118971498916, + 13.039912330976222, + 13.14176241896348, + 13.231574716977775, + 13.30728096497478, + 13.367322125006467, + 13.417892413970549 + ], + "chunk_gaps_ms": { + "count": 6, + "p50": 82.75927300564945, + "p95": 108.72261598706245, + "max": 108.72261598706245 + }, + "completion": "truncated", + "headers_s": 0.0019958739867433906, + "first_payload_s": 12.93118971498916, + "first_output_s": 12.93118971498916, + "last_output_s": 13.417892413970549, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + }, + { + "phase": "concurrent", + "prompt_tokens": 8192, + "cached_tokens": 0, + "tokens": 16, + "cache_state": "cold", + "complete": true, + "token_sha": "43b05393cf25", + "token_sha256": "43b05393cf25fad17a506612a56724b62ad4adfb023853bcb1b1aff9cf317536", + "output_sha256": "5e6ba5ae2aacff70f7233f67a12fd42c1a43d9a57abff68f01c2c5e12a4e976e", + "ttft_s": 6.690043261973187, + "decode_tps": 2.293227045682608, + "elapsed_s": 13.231147320999298, + "chunk_offsets_s": [ + 6.690043261973187, + 6.7694924880051985, + 8.213460567989387, + 9.957695585966576, + 11.471425177995116, + 13.04051600000821, + 13.142033653974067, + 13.231044087966438 + ], + "chunk_gaps_ms": { + "count": 7, + "p50": 1443.968079984188, + "p95": 1744.2350179771893, + "max": 1744.2350179771893 + }, + "completion": "truncated", + "headers_s": 0.0018363050185143948, + "first_payload_s": 6.690043261973187, + "first_output_s": 6.690043261973187, + "last_output_s": 13.231044087966438, + "tool_calls": 0, + "tool_sha256": null, + "equal_first_tokens": true, + "equal_first_output": true + } + ], + "concurrent_timing": { + "requested_requests": 2, + "timed_requests": 2, + "makespan_s": 13.418390482023824, + "end_to_end_tps": 2.384786762828921, + "timing_valid": true + }, + "qualified": true +} diff --git a/docs/receipts/glm-decode-pdl-60e67379/tools/first.py b/docs/receipts/glm-decode-pdl-60e67379/tools/first.py new file mode 100644 index 00000000000..70ad700e6f2 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/tools/first.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +"""first.py PORT PROMPT_JSON N REPS: REPS cold greedy completions of N tokens, drafts off; prints the reply-sha histogram.""" +import collections +import hashlib +import json +import sys +import urllib.request + +port, prompt, n, reps = sys.argv[1], json.load(open(sys.argv[2])), int(sys.argv[3]), int(sys.argv[4]) +seen = collections.Counter() +for _ in range(reps): + body = {"model": "local-model", "prompt": prompt, "max_tokens": n, "temperature": 0, "ignore_eos": True, "draft": False} + req = urllib.request.Request(f"http://127.0.0.1:{port}/v1/completions", data=json.dumps(body).encode(), + headers={"Content-Type": "application/json"}) + r = json.load(urllib.request.urlopen(req, timeout=3600)) + seen[hashlib.sha256(r["choices"][0]["text"].encode()).hexdigest()[:8]] += 1 +print(dict(seen)) diff --git a/docs/receipts/glm-decode-pdl-60e67379/tools/pdl_ab.py b/docs/receipts/glm-decode-pdl-60e67379/tools/pdl_ab.py new file mode 100644 index 00000000000..c181746acf0 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/tools/pdl_ab.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +"""pdl_ab.py RUNS LABEL...: one row a serve from its suite files; labels holding "b" before a digit are main's.""" +import json +import statistics +import sys +from pathlib import Path + + +def med(xs): + return statistics.median(xs) if xs else None + + +def row(d): + r = {} + if (d / "nodraft.json").exists(): + nd = json.loads((d / "nodraft.json").read_text())[0] + r["plain tok/s"] = nd["decode_tps_median"] + r["ITL p50 ms"] = nd["itl_p50_ms_median"] + r["plain sha"] = ",".join(sorted({e["token_sha"] for e in nd["evidence"]})) + for n in (8192, 32768): + p = d / f"prefill{n}.json" + if p.exists(): + rows = json.loads(p.read_text())["rows"] + r[f"cold {n // 1024}k s"] = med([x["ttft_s"] for x in rows if x["phase"] in ("first", "repeated")]) + r[f"{n // 1024}k sha"] = ",".join(sorted({x["token_sha"] for x in rows})) + if (d / "drafted.json").exists(): + dr = json.loads((d / "drafted.json").read_text()) + dr = dr[0] if isinstance(dr, list) else dr + r["drafted tok/s"] = dr["decode_tps_median"] + if (d / "c4.json").exists(): + c4 = json.loads((d / "c4.json").read_text()) + r["4 streams tok/s"] = c4_rate(c4) + if (d / "form.txt").exists(): + r["experts"] = (d / "form.txt").read_text().split()[-1] + return r + + +def c4_rate(c4): + """The 4-stream cells' summed reply rate (`aggregate_tps`), median over the prompts.""" + return med([c["aggregate_tps"] for c in c4["cells"] if c["streams"] == 4 and not c["failed"]]) + + +def main(argv): + root, labels = Path(argv[1]), argv[2:] + rows = {lab: row(root / lab) for lab in labels} + cols = [k for k in dict.fromkeys(k for r in rows.values() for k in r)] + print("| serve | " + " | ".join(cols) + " |") + print("| --- |" + " --- |" * len(cols)) + for lab, r in rows.items(): + cells = [f"{r[c]:.3f}" if isinstance(r.get(c), float) else str(r.get(c, "")) for c in cols] + print(f"| {lab} | " + " | ".join(cells) + " |") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/docs/receipts/glm-decode-pdl-60e67379/tools/suites.sh b/docs/receipts/glm-decode-pdl-60e67379/tools/suites.sh new file mode 100644 index 00000000000..152e45680d1 --- /dev/null +++ b/docs/receipts/glm-decode-pdl-60e67379/tools/suites.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# usage (in a serve's run folder): suites.sh SUITE REPO PROMPTS; the suites each serve ran, against 127.0.0.1:8090. +# ab: plain decode, cold 8k and 32k prompts; dc: drafted decode, four streams; ex: drafted = plain, concurrent = alone, +# resumed = cold. PROMPTS is this folder's prompts/ (the cold 8k and 32k token lists). +suite=$1 T=$2/tools A=$2/docs/receipts/glm-fp4local-80517fc3/tools P=$3 B=http://127.0.0.1:8090 +case $suite in +ab) + PYTHONPATH=$T python3 $A/openai_aligned.py nodraft $B local-model --tokens 128 --reps 3 --temperatures 0 --label nodraft --output nodraft.json + for n in 8192 32768; do python3 $T/bench_cache.py $B local-model --prompt-file $P/p$n.json --tokens 16 --require-cold --output prefill$n.json; done ;; +dc) + python3 $T/bench_openai.py $B local-model --tokens 256 --reps 3 --temperatures 0 --label drafted --output drafted.json + python3 $T/bench_concurrent.py $B local-model --levels 4 --tokens 256 --reps 2 --temperatures 0 --label c4 --output c4.json ;; +ex) + python3 $A/golden_http.py 8090 $A/dc.json golden.json + python3 $T/bench_concurrent.py $B local-model --levels 1,2,4 --tokens 256 --reps 3 --temperatures 0,1 --alone --serial --label ex --output conc.json + python3 $A/resume_http.py 8090 resume.json ;; +esac diff --git a/docs/receipts/quality-suite/Aleph-Alpha--Kolibri-1.gb10.json b/docs/receipts/quality-suite/Aleph-Alpha--Kolibri-1.gb10.json new file mode 100644 index 00000000000..6e9cf66af6e --- /dev/null +++ b/docs/receipts/quality-suite/Aleph-Alpha--Kolibri-1.gb10.json @@ -0,0 +1,1442 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "Kolibri-1-e52eb4627d", + "checkpoint": "Aleph-Alpha/Kolibri-1@e52eb4627d11516b0c01de49210ab5a4e4061444", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "NVIDIA GB10", + "seconds": 348.5, + "quality": { + "overall": { + "items": 228, + "passed": 199, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 94 + }, + "mmlu": { + "items": 100, + "passed": 78 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 7 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "3", + "text": "Josh starts with 3 balls and adds 1 ball each week. After 4 weeks, he juggles 3 + 4 = 7 balls. He drops 3 balls on stage, so he has 7 - 3 = 4 balls left. Two are caught by the crowd, but one is lost, " + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times more points than Sara, so Erin has 3 × 8 = 24 points. She scored 14 points to reach this total, so she had 24 − 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hired the carriage for 4 hours (5 PM to 9 PM) but gets 1 hour free, so he pays for 3 hours.\n\n- 1st paid hour: $15\n- 2nd paid hour: $30 (twice the first)\n- 3rd paid hour: $60 (twice the second)\n\n" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": false, + "read": "12", + "text": "Unused lengths:\n- 1/6 of 12 mm = 2 mm\n- 1 - 2/3 = 1/3 of 12 mm = 4 mm\n- 1 - 1/2 = 1/2 of 12 mm = 6 mm\n\nTotal unused = 2 + 4 + 6 = 12 mm\n\nAnswer: 12" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": false, + "read": "1630", + "text": "Bernice drove 325 km in 4 days. The total distance is 1955 km. \nRemaining distance = 1955 − 325 = 1630 km.\n\nAnswer: 1630" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 m².\n\n1. He sells half: 80 / 2 = 40 m² for $50.\n2. He sells another 1/4 of his land: 80 / 4 = 20 m² for $30.\n3. Remaining land: 80 - 40 - 20 = 20 m².\n4. He sells the remaining 20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": false, + "read": "D", + "text": "D. Not wrong, Not wrong" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "D", + "text": "D. Not wrong, Not wrong" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": false, + "read": "2", + "text": "2" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/LiquidAI--LFM2.5-24B-A2B-MLX-4bit.m5-ultra.json b/docs/receipts/quality-suite/LiquidAI--LFM2.5-24B-A2B-MLX-4bit.m5-ultra.json new file mode 100644 index 00000000000..886dd68c557 --- /dev/null +++ b/docs/receipts/quality-suite/LiquidAI--LFM2.5-24B-A2B-MLX-4bit.m5-ultra.json @@ -0,0 +1,1468 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "lfm2.5-24b-a2b-4bit", + "checkpoint": "LiquidAI/LFM2.5-24B-A2B-MLX-4bit@667408d494bde191c2cb9dd4f4549827816b9275", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "Apple M5 Ultra", + "seconds": 63.8, + "quality": { + "overall": { + "items": 228, + "passed": 173, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 93 + }, + "mmlu": { + "items": 100, + "passed": 58 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 2 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": false, + "read": "33", + "text": "\nThe Doubtfire family originally had 7 adopted kittens. \n\n- Patchy (the first cat) has now had three times the number of adopted kittens: \\(3 \\times 7 = 21\\). \n- Trixie (the other cat) has had 12 ki" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "\nErin scored 14 points and now has three times more points than Sara, who scored 8. \nThree times Sara's points is $3 \\times 8 = 24$. \nThus, Erin's current total is 24 points. \nSince she scored 14 p" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": false, + "read": "1260", + "text": "\nRuiz makes 120 lb in 2 h → 60 lb per hour. \nMarissa’s rate = (3/4)·60 lb/h = 45 lb/h. \n\nTogether they make 60 + 45 = 105 lb per hour. \nIn 12 h they produce 105 × 12 = 1260 lb.\n\n**Answer: 1260**" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "\nThe rental lasts 4 hours (5 PM–9 PM). He receives 1 free hour, so he pays for 3 hours. \n- First paid hour: \\$15 \n- Each subsequent hour costs twice the previous: \\$30, \\$60 \n\nTotal cost = 15 + 30 " + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": false, + "read": "25.5", + "text": "\nLet the age of the twin be \\(T\\) and the age of the triplet be \\(R\\).\n\n- One twin is 7 years older than one triplet: \\(T = R + 7\\).\n- Their combined ages sum to 44: \\(T + R = 44\\).\n\nSubstituting the " + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": false, + "read": "20", + "text": "\nThe original length of each glue stick is 12 mm.\n\n- First stick: \\( \\frac{1}{6} \\) remains → \\(12 \\times \\frac{1}{6}=2\\) mm used, so \\(12-2=10\\) mm unused. \n- Second stick: \\( \\frac{2}{3} \\) remains" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "\nAbraham starts with 80 m².\n\n- He sells half: 40 m² for \\$50 → \\$1.25 per m². \n- Then he sells a quarter of the original land: 20 m² for \\$30 → \\$1.50 per m². \n- The remaining land is 80 – 40 – 20 =" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": false, + "read": "cut at 32 tokens (no single letter)", + "text": "\nWe need to evaluate the truth of two statements about group theory.\n\n**Statement 1:** \"Every solvable group is of prime-power order.\"\n\nRecall that" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": false, + "read": "cut at 32 tokens (C)", + "text": "\nC\n\nExplanation: When a dependent variable has recently exhibited a structural change (e.g., a shift in its underlying economic relationships or behavior), models that are" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": false, + "read": "cut at 32 tokens (no single letter)", + "text": "\nC\n\nThe problem states that approximately 2 out of 5 seniors go on to attend graduate school. With 750 seniors at the college, we" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "cut at 32 tokens (no single letter)", + "text": "\nWe are given:\n\n- Each story (floor) is **14.3 feet** tall.\n- The total height of the building is **185.9" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": false, + "read": "C", + "text": "\nC. 76%" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": false, + "read": "cut at 32 tokens (A)", + "text": "\nA\n\nThe collision theory of reaction rates primarily considers the frequency of collisions between reactant molecules, the energy of the collisions (specifically whether it meets the activation" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": false, + "read": "cut at 32 tokens (C)", + "text": "\nC\n\nIn a well-designed experiment, treatments are carefully planned to ensure that the experimental units are as similar as possible in response to the treatments, minimizing" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "D", + "text": "\nD" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": false, + "read": "D", + "text": "\nD\nD" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": false, + "read": "D", + "text": "\nD\nD" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": false, + "read": "no answer", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": false, + "read": "C", + "text": "\nC\nC" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": false, + "read": "D", + "text": "\nD" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "D", + "text": "\nD" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": false, + "read": "A", + "text": "\nA. liable for battery." + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "B", + "text": "\nB" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "C", + "text": "\nC\nC" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "\nC" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "C", + "text": "\nC\nC" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": false, + "read": "D", + "text": "\nD\nD" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": false, + "read": "A", + "text": "\nA" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": false, + "read": "D", + "text": "\nD.D" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": false, + "read": "B", + "text": "\nB\nB" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "\nD" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": false, + "read": "cut at 48 tokens (no number)", + "text": "We need to read the notes. The question: \"In which room does the council of Harlow Ford meet now? Answer with the number only.\"\n\nWe have a correction note: \"Correction to the earlier notice: the counc" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": false, + "read": "cut at 48 tokens (no number)", + "text": "We need to parse the question: \"What is the treatment plant's budget now, in millions of pounds? Answer with the number only.\"\n\nWe have notes about the town of Harlow Ford. The original text says: \"Th" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": false, + "read": "cut at 48 tokens (1847)", + "text": "We need to answer: \"In which year was the old mill built, according to the latest records?\" The notes mention that the old mill on the Tane was built in 1847 (first note). Then later a later survey of" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": false, + "read": "cut at 48 tokens (6)", + "text": "We need to read the notes. The question: \"How many new wells will be drilled? Answer with the number only.\"\n\nThe notes mention: \"The town plans to drill 6 new wells upstream. The plan was later cut" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": false, + "read": "cut at 48 tokens (9)", + "text": "We need to read the notes. The question: \"For how many days in all was the river closed to boats? Answer with the number only.\"\n\nWe have the following: \"The river was closed to boats for 9 days in" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": false, + "read": "cut at 48 tokens (1200)", + "text": "We need to answer: \"How many houses will the new pipes reach, by the revised figures? Answer with the number only.\"\n\nWe have multiple notes. The question mentions \"The new pipes will reach 1200 houses" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/README.md b/docs/receipts/quality-suite/README.md new file mode 100644 index 00000000000..ee80f6f41e6 --- /dev/null +++ b/docs/receipts/quality-suite/README.md @@ -0,0 +1,28 @@ +# Quality suite receipts + +Each file here is one run of TensorFold Web's quality suite against one checkpoint, made with +[`tools/quality_suite.py`](../../../tools/quality_suite.py). `tensorfold models` shows each checkpoint's score from +these files, and a host test checks that the two agree. + +- **The suite.** 228 items from [`web/tensorfold_web/quality.py`](../../../web/tensorfold_web/quality.py), digest + `d21a62442423`: 100 GSM8K problems and 100 MMLU questions drawn with a fixed seed, 20 instruction checks and 8 + long-context items. Each item has a fixed reply length, and replies are scored by the Bench's strict rules. A run + under another digest is not comparable. +- **How it runs.** One request at a time, greedy (temperature 0, top_p 1). Thinking is off when the model's + `capabilities.thinking_switch` says an off request works, and left at the model's default otherwise. Drafts stay as + shipped, because TensorFold's replies are the same with them or without. +- **What a file holds.** The suite digest, the checkpoint as `REPO@REVISION` and how that revision was established, + the engine commit, the chip, the summary overall and per category, and every item's verdict. A missed item keeps + the first 200 characters of its reply. +- **Names.** `REPO.CHIP.json`, with the repository's `/` written as `--`. +- **One score per checkpoint.** The same weights score within a point or so on either backend. Lightning MLX 4-bit at + d9d758fb passed 192 items on an M5 Max (Metal) and 191 on a GB10 (CUDA). The three items that differ are GSM8K + problems, where the backends' rounding sends a long greedy calculation down different tokens. The catalog cites + the first receipt measured. + +Rerun one: + +```sh +tensorfold serve REPO --port 8080 +python3 tools/quality_suite.py http://127.0.0.1:8080 out.json --checkpoint REPO@REVISION +``` diff --git a/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.gb10.json b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.gb10.json new file mode 100644 index 00000000000..bc4c3b1dae3 --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.gb10.json @@ -0,0 +1,1450 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit", + "checkpoint": "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit@d9d758fb83953437f7263256b0d96157e2a348b8", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "NVIDIA GB10", + "seconds": 81.7, + "quality": { + "overall": { + "items": 228, + "passed": 191, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 87 + }, + "mmlu": { + "items": 100, + "passed": 76 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": false, + "read": "75000", + "text": "Marcy's annual pension after 30 years is calculated based on the 5% annual entitlement starting after 20 years. For each year beyond the initial 20, she accrues 5% of the $50,000 base value.\n\n- Years " + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "no number", + "text": "To find the needed score, first calculate the sum of the first five tests: 89 + 71 + 92 + 100 + 86 = 438. Let \\(x\\) be the sixth test score. The lowest score among the six is \\(\\min(71, x)\\). The aver" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": false, + "read": "4050", + "text": "Theo starts with $6000.\n\nFirst, calculate his expenses:\n* **Business suits:** 6 suits × $100 = $600\n* **Suitcases:** 3 suitcases × $50 = $150\n* **Flight ticket:** $700 + (5 × $100) = $700 + $500" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "6", + "text": "Josh starts with 3 balls and adds 1 ball per week. After 4 weeks, he has 3 + 4 = 7 balls. He drops 3 balls on stage, but 2 are recovered. He is left with 7 - 3 + 2 = 6 balls.\n\nAnswer: 6" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times more than Sara, so she has 3 × 8 = 24 points. Since Erin scored 14 points to reach this total, she had 24 − 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": false, + "read": "58.64", + "text": "Jon's total time is 40 + 80 + 50 = 170 minutes. James finished 10 minutes after Jon, so his total time was 180 minutes.\n\nJames swam 10% faster than Jon's 40 minutes, so his swim time was 40 / 1.1 ≈ 36" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": false, + "read": "42", + "text": "Brett is currently 14 years old. In four years, he will be 18. The problem states that in four years, Angela will be three times as old as Brett is *now*. Three times 14 is 42. Therefore, Angela is cu" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": false, + "read": "79", + "text": "Initially, there are 48 passengers. At the first stop, 8 get off, leaving 40. Then, 5 times 8 = 40 people get on, bringing the total to 80. At the second stop, 21 get off, leaving 59. \"3 times fewer\" " + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage from 5 PM to 9 PM, which is a total of 4 hours. He gets 1 hour free, so he pays for 3 hours. The first paid hour costs $15. The second hour costs twice that, which is $30. The" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": false, + "read": "11", + "text": "Let the age of one triplet be \\(x\\). Then the age of the other triplet is \\(x + 7\\) (since one twin is 7 years older than one triplet). Let the age of one twin be \\(t\\). The other twin is \\(t + 7\\) (a" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": false, + "read": "15.6", + "text": "Let your age be \\( x \\). \nThen your brother is \\( x + 3 \\) and your sister is \\( x - 2 \\). \nYour mom's age is \\( 3(x + 3) - 1 = 3x + 8 \\). \n\nThe sum of all ages is: \n\\[\nx + (x + 3) + (x - 2) + (3x" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": false, + "read": "0", + "text": "Let Sam's portion be $S$. Then Harry's portion is $S + 60$. Together, they have 100 feet of fence, so:\n\n$$S + (S + 60) = 100$$\n$$2S + 60 = 100$$\n$$2S = 40$$\n$$S = 20$$\n\nSam gets 20 feet, and the remai" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters of land.\n\n1. He sold half of the land: \\( \\frac{1}{2} \\times 80 = 40 \\) square meters for $50.\n2. He sold another \\( \\frac{1}{4} \\) of his land: \\( \\frac{1}{4} \\ti" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.m5-max.json b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.m5-max.json new file mode 100644 index 00000000000..fc89400daff --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.m5-max.json @@ -0,0 +1,1449 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit", + "checkpoint": "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit@d9d758fb83953437f7263256b0d96157e2a348b8", + "engine": "d1ed7b0ede075f1d443a1b491c8cb0ca0a1a8c10", + "machine": "Apple M5 Max", + "seconds": 65.5, + "quality": { + "overall": { + "items": 228, + "passed": 192, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 88 + }, + "mmlu": { + "items": 100, + "passed": 76 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "no number", + "text": "To find the needed score, first calculate the sum of the first five tests: 89 + 71 + 92 + 100 + 86 = 438. Let \\(x\\) be the sixth test score. The lowest score among the six is \\(\\min(71, x)\\). The aver" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": false, + "read": "6050", + "text": "Theo's total expenses are calculated as follows:\n\n- Business suits: 6 × $100 = $600\n- Suitcases: 3 × $50 = $150\n- Flight ticket: 5 × $100 + $700 = $1200\n- Total spent on items: $600 + $150 + $1200 = $" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "6", + "text": "Josh starts with 3 balls and adds 1 ball per week. After 4 weeks, he has 3 + 4 = 7 balls. He drops 3 balls on stage, but 2 are recovered. He is left with 7 - 3 + 2 = 6 balls.\n\nAnswer: 6" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times more than Sara, so she has 3 × 8 = 24 points. Since Erin scored 14 points to reach this total, she had 24 − 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": false, + "read": "42", + "text": "Brett is currently 14 years old. In four years, he will be 18. The problem states that in four years, Angela will be three times as old as Brett is *now*. Three times 14 is 42. Therefore, Angela is cu" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": false, + "read": "79", + "text": "Initially, there are 48 passengers. On the first stop, 8 get off, leaving 40. Then, 5 times 8 = 40 people get on, bringing the total back to 80. On the second stop, 21 get off, leaving 59. \"3 times fe" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage from 5 PM to 9 PM, which is a total of 4 hours. He gets 1 hour free, so he pays for 3 hours. The first paid hour costs $15. The second hour costs twice that, which is $30. The" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": false, + "read": "cut at 512 tokens (3)", + "text": "Let the age of one triplet be \\(x\\). Then the other triplet is also \\(x\\) (since they are triplets, we assume they are the same age). Let the age of one twin be \\(t\\). The other twin is \\(t + 7\\) (sin" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": false, + "read": "5", + "text": "The goal is $6300, and $2100 has already been raised. The remaining amount is $6300 - $2100 = $4200. Since the rate is equal per hour, the additional hours needed are $4200 ÷ $2100 per hour = 2 hours." + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": false, + "read": "15.6", + "text": "Let your age be \\( x \\). \nThen your brother is \\( x + 3 \\) and your sister is \\( x - 2 \\). \nYour mom's age is \\( 3(x + 3) - 1 = 3x + 8 \\).\n\nAdding all ages: \n\\[\nx + (x + 3) + (x - 2) + (3x + 8) = 8" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": false, + "read": "0", + "text": "Let Sam's portion be $S$. Then Harry's portion is $S + 60$. Together, they have 100 feet of fence, so:\n\n$$S + (S + 60) = 100$$\n$$2S + 60 = 100$$\n$$2S = 40$$\n$$S = 20$$\n\nSam gets 20 feet, and the remai" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters of land.\n\n1. He sold half of the land: \\( \\frac{1}{2} \\times 80 = 40 \\) square meters for $50.\n2. He sold another \\( \\frac{1}{4} \\) of his land: \\( \\frac{1}{4} \\ti" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "served from the Hugging Face cache snapshot of this revision" +} diff --git a/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4.m5-ultra.json b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4.m5-ultra.json new file mode 100644 index 00000000000..b1b778ad06c --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4.m5-ultra.json @@ -0,0 +1,1449 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "e66379203bff3dae2d20c27663f1f9248a74f2ea", + "checkpoint": "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4@e66379203bff3dae2d20c27663f1f9248a74f2ea", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "Apple M5 Ultra", + "seconds": 68.9, + "quality": { + "overall": { + "items": 228, + "passed": 192, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 93 + }, + "mmlu": { + "items": 100, + "passed": 72 + }, + "instructions": { + "items": 20, + "passed": 19 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": false, + "read": "280", + "text": "First, calculate Blake's total distance. He runs back and forth 15 times across the 100-yard field. One round trip is 200 yards, so Blake runs $15 \\times 200 = 3,000$ yards.\n\nNext, calculate Kelly's t" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": false, + "read": "61", + "text": "First, calculate the total cost of the tickets: 3 tickets × $20.25 = $60.75.\nNext, find the cost of food: $60.75 - $4.50 = $56.25.\nThen, calculate the total cost of the rides: 2 rides × $33 = $66.\nAdd" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "120", + "text": "To get an average of 93, Brinley needs a total score of $93 \\times 6 = 558$ across all six tests. She has five scores: 89, 71, 92, 100, and 86. The sum of these is $89 + 71 + 92 + 100 + 86 = 438$. The" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times more points than Sara, so Erin has 3 × 8 = 24 points. Since Erin scored 14 points to reach this total, she had 24 - 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage from 5 PM to 9 PM, which is a total of 4 hours. He gets 1 hour free, so he pays for 3 hours.\n\nThe first paid hour costs $15. Each subsequent hour costs twice the previous hour" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": false, + "read": "0", + "text": "Let Sam's portion be $S$. Then Harry's portion is $S + 60$. Together, they have 100 feet of fence, so:\n\n$S + (S + 60) = 100$\n$2S + 60 = 100$\n$2S = 40$\n$S = 20$\n\nSam gets 20 feet, and Harry gets 80 fee" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters of land.\n\n1. He sold half of the land (40 m²) for $50.\n2. He sold another 1/4 of the land (20 m²) for $30.\n3. The remaining land is 80 - 40 - 20 = 20 m². He sol" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": false, + "read": "failed paragraphs", + "text": "The sea is a vast, ever-changing canvas of blue and green, its surface shimmering under the sun's relentless gaze. It breathes in rhythmic tides, pulling away and returning with a powerful, ancient pu" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "served from the Hugging Face cache snapshot of this revision; its config.json sha256 and safetensors bytes match the Hub" +} diff --git a/docs/receipts/quality-suite/TensorFold--Qwen3.6-35B-A3B-MLX-4bit-MTP.gb10.json b/docs/receipts/quality-suite/TensorFold--Qwen3.6-35B-A3B-MLX-4bit-MTP.gb10.json new file mode 100644 index 00000000000..b9ceba9c0a0 --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--Qwen3.6-35B-A3B-MLX-4bit-MTP.gb10.json @@ -0,0 +1,1437 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "Qwen3.6-35B-A3B-MLX-4bit-MTP-f84b054c", + "checkpoint": "TensorFold/Qwen3.6-35B-A3B-MLX-4bit-MTP@f84b054c5677b6e59bdb969ae61915b0983d68bb", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "NVIDIA GB10", + "seconds": 296.1, + "quality": { + "overall": { + "items": 228, + "passed": 204, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 93 + }, + "mmlu": { + "items": 100, + "passed": 83 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "cut at 512 tokens (100)", + "text": "To find the required score on the sixth test, we must determine which score will be dropped and then solve for the missing value.\n\n**Step 1: Analyze the current scores and the dropping rule.**\nBrinley" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Let $E$ be Erin's initial score and $S$ be Sara's score.\nWe are given that Sara scored 8 points, so $S = 8$.\nAfter scoring 14 points, Erin's new score is $E + 14$.\nThe problem states that this new sco" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": true, + "read": "75" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": false, + "read": "20", + "text": "To find the total length of the glue sticks that are **not used**, we first need to determine the length of the used portion for each stick.\n\nThe original length of each glue stick is 12 mm.\n\n**1. Fir" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": false, + "read": "cut at 512 tokens (4)", + "text": "Here is the step-by-step calculation:\n\n1. **Initial Amount (Day 1):** The problem states the initial amount of water is 4,000 gallons.\n2. **Day 2 Amount:** After a day of heavy rain, the amount doub" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": false, + "read": "1", + "text": "First, calculate the total amount of money Sarah earns from selling the original rope. She sells 20 meters at $2 per meter:\n$$20 \\text{ meters} \\times \\$2/\\text{meter} = \\$40$$\n\nNext, determine how mu" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Here is the step-by-step breakdown of the sales:\n\n1. **First Sale:**\n * Total land: 80 square meters.\n * Sold half: $80 / 2 = 40$ square meters.\n * Revenue: $50.\n * Remaining land" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": false, + "read": "cut at 512 tokens (7)", + "text": "First, calculate the total number of holes the dog digs while Nate is on vacation. The dog digs 6 holes per day for 14 days:\n$$6 \\text{ holes/day} \\times 14 \\text{ days} = 84 \\text{ holes}$$\n\nNext, de" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": false, + "read": "cut at 32 tokens (no single letter)", + "text": "The patient is presenting with atrial fibrillation with rapid ventricular response (RVR). The initial treatment with metoprolol (a beta-blocker)" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub; its config.json and every safetensors shard's sha256 equal those of 81169a9bc511a27c1b4eedb77a2cd98ced431847, the revision the README pins" +} diff --git a/docs/receipts/quality-suite/TensorFold--Qwen3.8-27B-MLX-4bit.m5-ultra.json b/docs/receipts/quality-suite/TensorFold--Qwen3.8-27B-MLX-4bit.m5-ultra.json new file mode 100644 index 00000000000..a391398c615 --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--Qwen3.8-27B-MLX-4bit.m5-ultra.json @@ -0,0 +1,1440 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "70ae7fac63274ff2eac54152031433374cb80f2f", + "checkpoint": "TensorFold/Qwen3.8-27B-MLX-4bit@70ae7fac63274ff2eac54152031433374cb80f2f", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "Apple M5 Ultra", + "seconds": 567.8, + "quality": { + "overall": { + "items": 228, + "passed": 201, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 92 + }, + "mmlu": { + "items": 100, + "passed": 81 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": false, + "read": "cut at 512 tokens (20)", + "text": "To determine Marcy's annual pension, we need to calculate the base pension amount and the additional entitlement she has earned based on her years of service.\n\n**Step 1: Identify the base pension.**\nT" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": false, + "read": "cut at 512 tokens (2920)", + "text": "To determine who runs farther, we need to calculate the total distance each person covers. The football field is 100 yards long.\n\n**1. Calculate Blake's Distance:**\nBlake runs back and forth 15 times." + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "cut at 512 tokens (no number)", + "text": "To find the score Brinley needs on the sixth test, we must first determine which score will be dropped. Mr. Bert allows the removal of the lowest score from the average.\n\nLet $x$ be the score on the s" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "To find out how many points Erin had before, we first need to determine her current total points.\n\n1. **Calculate Erin's current points:**\n The problem states that Erin now has three times more po" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": false, + "read": "504", + "text": "To find the difference in Ada's weekly electric bill, we need to calculate the cost of the additional energy consumption provided by the new device.\n\n**Step 1: Calculate the daily energy consumption o" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "First, determine the total duration of the rental. James hires the carriage from 5 PM to 9 PM, which is a total of 4 hours.\n\nNext, account for the free hour. Since he gets 1 hour free, the number of p" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "cut at 512 tokens (40)", + "text": "To determine the total earnings, we need to calculate the revenue from each of the three sales based on the area of land sold.\n\n**Step 1: Calculate the area and revenue for the first sale.**\nAbraham s" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": false, + "read": "cut at 512 tokens (-1)", + "text": "**Step 1: Calculate the total number of holes dug by the dog.**\nThe dog digs 6 holes per day for 14 days.\nTotal holes = $6 \\text{ holes/day} \\times 14 \\text{ days} = 84 \\text{ holes}$.\n\n**Step 2: Dete" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "served from the Hugging Face cache snapshot of this revision; its config.json and every safetensors shard's sha256 equal those of 22d8d538154e0e5b6f8dcb1fcc74a60a0798104c, the Hub's main on 15 Nov 2026" +} diff --git a/docs/receipts/quality-suite/TensorFold--Qwen3.8-Flash-Next-MLX-4bit-MTP.m5-ultra.json b/docs/receipts/quality-suite/TensorFold--Qwen3.8-Flash-Next-MLX-4bit-MTP.m5-ultra.json new file mode 100644 index 00000000000..aeb32670acd --- /dev/null +++ b/docs/receipts/quality-suite/TensorFold--Qwen3.8-Flash-Next-MLX-4bit-MTP.m5-ultra.json @@ -0,0 +1,1432 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "Qwen3.8-Flash-Next-MLX-4bit-MTP-2b170fa6", + "checkpoint": "TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTP@2b170fa6309d5d1ee380b35636075fac7945f286", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "Apple M5 Ultra", + "seconds": 140.6, + "quality": { + "overall": { + "items": 228, + "passed": 209, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 93 + }, + "mmlu": { + "items": 100, + "passed": 88 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "cut at 512 tokens (no number)", + "text": "To find the score Brinley needs on the sixth test, we must determine the required score such that the average of her top five scores (after dropping the lowest) is 93.\n\n**Step 1: Identify the current " + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "6", + "text": "Josh starts with 3 balls. He adds 1 ball each week for 4 weeks, so he adds $4 \\times 1 = 4$ balls. His total number of balls before the show is $3 + 4 = 7$ balls.\n\nDuring the performance, he drops 3 b" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "cut at 512 tokens (3)", + "text": "First, determine Sara's score, which is given as 8 points.\n\nNext, calculate Erin's current total score. The problem states that after scoring 14 points, Erin has \"three times more points than Sara.\" I" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": false, + "read": "cut at 512 tokens (2)", + "text": "To find the difference in Ada's weekly electric bill, we can focus directly on the cost of the additional consumption, as the base consumption remains constant.\n\n1. **Identify the additional consumpt" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage from 5 PM to 9 PM, which is a total duration of 4 hours.\nHe gets 1 hour free, so he pays for $4 - 1 = 3$ hours.\n\nThe cost structure is as follows:\n1. **First paid hour**: $15" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": false, + "read": "20", + "text": "To find the total length of the glue sticks that are **not used**, we first need to determine the fraction of each glue stick that has been used, and then calculate the corresponding length in millime" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters of land.\n\n1. **First Sale:** He sells half of the land.\n * Area sold: $80 \\div 2 = 40$ square meters.\n * Revenue: $50.\n * Remaining land: $80 - 40 " + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "A", + "text": "A. 275" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "cut at 32 tokens (no single letter)", + "text": "**Step-by-step Deduction:**\n\n1. **Determine the hydrogen ion concentration $[H^+]$:**\n The pH of the solution" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/mlx-community--Qwen3.5-2B-MLX-4bit.m5-ultra.json b/docs/receipts/quality-suite/mlx-community--Qwen3.5-2B-MLX-4bit.m5-ultra.json new file mode 100644 index 00000000000..362e6c8e298 --- /dev/null +++ b/docs/receipts/quality-suite/mlx-community--Qwen3.5-2B-MLX-4bit.m5-ultra.json @@ -0,0 +1,1499 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "qwen3.5-2b-4bit", + "checkpoint": "mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "Apple M5 Ultra", + "seconds": 124.2, + "quality": { + "overall": { + "items": 228, + "passed": 142, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 70 + }, + "mmlu": { + "items": 100, + "passed": 45 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 7 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": false, + "read": "180", + "text": "To find the total distance, we multiply the number of sprints by the distance per sprint:\n$3 \\text{ sprints} \\times 60 \\text{ meters/sprint} = 180 \\text{ meters}$.\n\nAnswer: 180" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": false, + "read": "50", + "text": "To calculate the total cost, we first determine the cost of the first glass and then apply the discount to the remaining glasses.\n\n1. **First glass**: Costs $5.\n2. **Remaining glasses**: There are 1" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": false, + "read": "48", + "text": "To find the total number of kittens, we need to calculate the number of kittens Patchy has and Trixie has, then add them together.\n\n1. **Trixie's kittens**: The problem states Trixie has had **12** k" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": false, + "read": "51250", + "text": "To calculate Marcy's annual pension after quitting, we need to determine the total accumulated value of her pension at the time she quits (Year 30) and then apply the 5% reduction rule.\n\n**Step 1: Cal" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": false, + "read": "360", + "text": "To find the total inner volume, we must subtract the wall thickness from the outer dimensions of each box.\n\n**1. Calculate the outer dimensions:**\n* Length: $5 + 1 + 1 = 7$ inches\n* Width: $6 + 1 " + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": false, + "read": "500", + "text": "To find the total distance run by each, we calculate the number of back-and-forth trips (round trips) for each person.\n\n**1. Blake's Distance:**\nBlake runs back and forth 15 times.\nSince a round trip " + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": false, + "read": "9.5", + "text": "To find the total time, we first need to determine how many potatoes Billy needs to cut.\n\n1. **Calculate the number of potatoes to cut:**\n Billy has 60 potatoes. Since he peels and cuts them one b" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": false, + "read": "32", + "text": "**Step-by-step breakdown:**\n\n1. **Cost of tickets:** $20.25\n2. **Cost of food:** $4.50 less than tickets = $20.25 - $4.50 = $15.75\n3. **Total cost:** Tickets + Food + Rides\n * Rides cost: $33." + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "120", + "text": "To find the required score, we first calculate the current average of Brinley's scores.\n\n1. **Sum the current scores:**\n $89 + 71 + 92 + 100 + 86 = 438$\n\n2. **Count the number of tests:**\n The" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": false, + "read": "30", + "text": "Mico and Marco's current ages sum to 20. In 10 years, their ages will increase by 10. Therefore, the sum of their ages in the future is $20 + 10 = 30$.\n\nAnswer: 30" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": false, + "read": "35", + "text": "To find the number of crates Sam sold, we first calculate the total sales over the weekend and the weekdays, then sum them up to get the weekly total.\n\n1. **Weekend Sales**: 20 crates (Monday) + 20 c" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": false, + "read": "0", + "text": "**Step-by-step Solution:**\n\n1. **Calculate the cost of business suits:**\n There are 6 suits at $100 each.\n $6 \\times 100 = 600$.\n\n2. **Calculate the cost of suitcases:**\n There are 3 suitca" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "-6.666", + "text": "Let $E$ be Erin's score and $S$ be Sara's score.\nWe are given that Sara scored 8 points.\nWe are given that after scoring 14 points, Erin has three times more points than Sara.\nFirst, calculate Erin's " + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": false, + "read": "20", + "text": "1. **Total weight**: 20 ounces.\n2. **Pieces per person**: 1 piece each (2 people total).\n3. **Weight per piece**: $20 \\div 2 = 10$ ounces.\n4. **Remaining cake**: The remaining cake is the weight o" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": false, + "read": "14", + "text": "To find the number of kids not allergic to anything, we first need to determine the total number of unique allergies present in the class.\n\n1. **Identify the groups:**\n * Group A (Dairy): 9 kids" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": false, + "read": "50", + "text": "Let $A$ be Angela's current age.\nBrett is currently 14.\nIn four years, Brett's age will be $14 + 4 = 18$.\nAccording to the problem, in four years Angela will be three times as old as Brett is now.\nSo," + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": false, + "read": "105", + "text": "To find the difference in the weekly electric bill, we first calculate the additional energy consumed per day and then convert that to a weekly basis.\n\n1. **Calculate the additional daily consumption" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": false, + "read": "1260", + "text": "**Step-by-step Calculation:**\n\n1. **Calculate Ruiz's production rate:** Ruiz makes 120 pounds in 2 hours.\n Rate = $120 \\div 2 = 60$ pounds per hour.\n\n2. **Calculate Marissa's production rate:** M" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "**Step-by-step breakdown:**\n1. **Total duration:** From 5 PM to 9 PM is 4 hours.\n2. **Free time:** 1 hour is free.\n3. **Paid time:** $4 - 1 = 3$ hours.\n4. **Cost calculation:**\n * The first p" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": false, + "read": "cut at 512 tokens (no number)", + "text": "Let the age of the younger twin be $T$ and the older twin be $O$.\nLet the age of the younger triplet be $Tr$ and the older triplet be $Tr + 3$.\n\nThe problem states that one twin is 7 years older than " + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": false, + "read": "102", + "text": "To find the overall pass rate, we need to calculate the total number of students who passed and divide it by the total number of students.\n\n**Step 1: Calculate the number of students who passed in eac" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": false, + "read": "48", + "text": "To find the total amount of tea at the beginning, we first calculate the total amount consumed by the students and then add that to the remaining amount.\n\n1. **Calculate the amount consumed by the 4 " + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": false, + "read": "20", + "text": "To find the total number of students good at math, we can use the principle of inclusion-exclusion.\n\nLet $M$ be the set of students good at math.\nLet $E$ be the set of students good at English.\n\nWe ar" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": false, + "read": "20.5", + "text": "Let $x$ be your age.\nSince you are three years younger than your brother, your brother is $x + 3$.\nSince you are 2 years older than your sister, your sister is $x - 2$.\nYour mom's age is one less than" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": false, + "read": "38.5", + "text": "1. **Calculate the cost of the original rope:**\n Sarah has a 20-meter rope.\n The price is $2 per meter.\n Total cost = $2 \\times 20 = $40.\n\n2. **Calculate the profit from selling the origina" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": false, + "read": "59.6", + "text": "To find the average number of Junebugs Rita removes per day, we need to sum the total number of Junebugs removed over the five days (Monday through Friday) and divide by the number of days.\n\n1. **Mon" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": false, + "read": "cut at 512 tokens (0)", + "text": "To solve this problem, let's break down the information given for the first plane:\n\n1. **Total Daily Flights**: The problem states the first plane flies \"multiple times a day.\" Let $T$ be the total n" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": true, + "read": "170" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": false, + "read": "468", + "text": "First, calculate the cost of the cheddar cheese: $3.00.\nNext, calculate the cost of the gruyere cheese: $3.00 × 2 = $6.00.\nThen, find the total cost per week for the cheese: $3.00 + $6.00 = $9.00.\nFin" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": false, + "read": "-180", + "text": "To find the cost per stick, we first need to determine the total number of sticks in a bag. Since there are 30 sticks per bag, the original price per stick is $18.00 divided by 30.\n\n$18.00 / 30 = $0.6" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": false, + "read": "2.57", + "text": "To solve this, we first calculate the total number of holes Nate needs to fill.\n1. **Initial holes**: Nate digs 6 holes per day for 14 days.\n $6 \\times 14 = 84$ holes.\n2. **Holes filled by the do" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "A", + "text": "A." + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": false, + "read": "A", + "text": "A." + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": false, + "read": "14", + "text": "14" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4.gb10.json b/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4.gb10.json new file mode 100644 index 00000000000..b425542dae1 --- /dev/null +++ b/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4.gb10.json @@ -0,0 +1,1445 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4", + "checkpoint": "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4@bee7596271d1495f6992ae224aefde4410e816b8", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "NVIDIA GB10", + "seconds": 93.6, + "quality": { + "overall": { + "items": 228, + "passed": 196, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 91 + }, + "mmlu": { + "items": 100, + "passed": 77 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": false, + "read": "40", + "text": "To determine the winner and the difference in distance, we calculate the total yards each person ran.\n\n**Blake's Distance:**\nBlake runs back and forth 15 times. One round trip (back and forth) is 100 " + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": false, + "read": "61", + "text": "First, calculate the total cost of the tickets: 3 tickets × $20.25 = $60.75. \nNext, the food cost $4.50 less than the tickets: $60.75 - $4.50 = $56.25. \nThe rides cost $33 each, so 2 rides = 2 × $33" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": false, + "read": "191", + "text": "To find the score Brinley needs on the sixth test, we first determine which score will be dropped. The five current scores are 89, 71, 92, 100, and 86. The lowest score is 71, so it will be removed fr" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "1", + "text": "Josh starts with 3 balls and adds 1 ball each week. After 4 weeks, he has 3 + 4 = 7 balls. On stage, he drops 3 balls, leaving him with 7 - 3 = 4 balls. Two are caught, and one is lost, so he is left " + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times more points than Sara, so Erin has 3 × 8 = 24 points. Since Erin scored 14 points to reach this total, she had 24 - 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage from 5 PM to 9 PM, which is a total of 4 hours. He gets 1 hour free, so he pays for 3 hours. The first paid hour costs $15. The second hour costs twice that, which is $30. The" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": false, + "read": "0", + "text": "Sarah's rope is 20 meters long. Selling it at $2 per meter gives her $20 \\times 2 = \\$40$.\n\nShe uses this $40 to buy a new rope that costs $1.50 per meter. The amount of new rope she can buy is $\\$40 " + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": false, + "read": "0", + "text": "Let Sam's portion be $S$. Then Harry's portion is $S + 60$. Together, they have 100 feet of fence, so:\n\n$$S + (S + 60) = 100$$\n\n$$2S + 60 = 100$$\n\n$$2S = 40$$\n\n$$S = 20$$\n\nSam gets 20 feet, and Harry " + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters of land.\n\n1. He sold half of the land: $80 \\div 2 = 40$ square meters for $50.\n2. After a month, he sold another 1/4 of his land: $80 \\times \\frac{1}{4} = 20$ sq" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4.gb10.json b/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4.gb10.json new file mode 100644 index 00000000000..06ed80f2da5 --- /dev/null +++ b/docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4.gb10.json @@ -0,0 +1,1434 @@ +{ + "suite": { + "quality": 1, + "digest": "d21a62442423" + }, + "protocol": { + "temperature": 0.0, + "top_p": 1.0, + "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" + }, + "model": "NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4", + "checkpoint": "nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4@82d93699acd3be9e4617c53360fe5b3f5dbeb1b3", + "engine": "d6c4cce602eef4aff235625a5325bb617a9674ff", + "machine": "NVIDIA GB10", + "seconds": 258.2, + "quality": { + "overall": { + "items": 228, + "passed": 207, + "unscored": 0 + }, + "categories": { + "gsm8k": { + "items": 100, + "passed": 96 + }, + "mmlu": { + "items": 100, + "passed": 83 + }, + "instructions": { + "items": 20, + "passed": 20 + }, + "long_context": { + "items": 8, + "passed": 8 + } + } + }, + "items": [ + { + "category": "gsm8k", + "id": "gsm8k-3", + "passed": true, + "read": "540" + }, + { + "category": "gsm8k", + "id": "gsm8k-5", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-23", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-54", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-62", + "passed": true, + "read": "25000" + }, + { + "category": "gsm8k", + "id": "gsm8k-80", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-83", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-86", + "passed": true, + "read": "22" + }, + { + "category": "gsm8k", + "id": "gsm8k-106", + "passed": true, + "read": "72" + }, + { + "category": "gsm8k", + "id": "gsm8k-118", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-120", + "passed": true, + "read": "240" + }, + { + "category": "gsm8k", + "id": "gsm8k-140", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-157", + "passed": true, + "read": "80" + }, + { + "category": "gsm8k", + "id": "gsm8k-167", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-174", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-189", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-205", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-221", + "passed": true, + "read": "90" + }, + { + "category": "gsm8k", + "id": "gsm8k-278", + "passed": true, + "read": "40" + }, + { + "category": "gsm8k", + "id": "gsm8k-297", + "passed": true, + "read": "55" + }, + { + "category": "gsm8k", + "id": "gsm8k-310", + "passed": true, + "read": "2050" + }, + { + "category": "gsm8k", + "id": "gsm8k-312", + "passed": true, + "read": "32" + }, + { + "category": "gsm8k", + "id": "gsm8k-328", + "passed": true, + "read": "2" + }, + { + "category": "gsm8k", + "id": "gsm8k-340", + "passed": false, + "read": "3", + "text": "Josh starts with 3 balls and adds 1 ball each week. After 4 weeks, he is juggling 3 + 4 = 7 balls. He drops 3 balls, leaving 4. Two are caught by the crowd, but one is lost, so he continues with 4 - 1" + }, + { + "category": "gsm8k", + "id": "gsm8k-348", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-355", + "passed": true, + "read": "34" + }, + { + "category": "gsm8k", + "id": "gsm8k-368", + "passed": false, + "read": "10", + "text": "Sara scored 8 points. Erin now has three times as many points as Sara, so Erin has 3 × 8 = 24 points. Since Erin scored 14 points to reach 24, she had 24 − 14 = 10 points before.\n\nAnswer: 10" + }, + { + "category": "gsm8k", + "id": "gsm8k-381", + "passed": true, + "read": "67" + }, + { + "category": "gsm8k", + "id": "gsm8k-393", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-429", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-436", + "passed": true, + "read": "15" + }, + { + "category": "gsm8k", + "id": "gsm8k-440", + "passed": true, + "read": "98" + }, + { + "category": "gsm8k", + "id": "gsm8k-443", + "passed": true, + "read": "59" + }, + { + "category": "gsm8k", + "id": "gsm8k-462", + "passed": true, + "read": "71" + }, + { + "category": "gsm8k", + "id": "gsm8k-477", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-496", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-519", + "passed": true, + "read": "280" + }, + { + "category": "gsm8k", + "id": "gsm8k-526", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-531", + "passed": true, + "read": "66" + }, + { + "category": "gsm8k", + "id": "gsm8k-537", + "passed": true, + "read": "188" + }, + { + "category": "gsm8k", + "id": "gsm8k-545", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-547", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-549", + "passed": true, + "read": "398" + }, + { + "category": "gsm8k", + "id": "gsm8k-573", + "passed": true, + "read": "600" + }, + { + "category": "gsm8k", + "id": "gsm8k-595", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-603", + "passed": true, + "read": "1800" + }, + { + "category": "gsm8k", + "id": "gsm8k-605", + "passed": true, + "read": "42" + }, + { + "category": "gsm8k", + "id": "gsm8k-612", + "passed": true, + "read": "30" + }, + { + "category": "gsm8k", + "id": "gsm8k-613", + "passed": true, + "read": "93000" + }, + { + "category": "gsm8k", + "id": "gsm8k-624", + "passed": true, + "read": "85" + }, + { + "category": "gsm8k", + "id": "gsm8k-645", + "passed": true, + "read": "48" + }, + { + "category": "gsm8k", + "id": "gsm8k-652", + "passed": false, + "read": "105", + "text": "James hires the carriage for 4 hours total (5 PM to 9 PM). \nHe gets 1 hour free, so he pays for 3 hours. \n\n- 1st paid hour: $15 \n- 2nd paid hour: $15 × 2 = $30 \n- 3rd paid hour: $30 × 2 = $60 \n\nT" + }, + { + "category": "gsm8k", + "id": "gsm8k-669", + "passed": true, + "read": "132" + }, + { + "category": "gsm8k", + "id": "gsm8k-670", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-674", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-687", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-706", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-709", + "passed": true, + "read": "3000" + }, + { + "category": "gsm8k", + "id": "gsm8k-717", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-730", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-791", + "passed": true, + "read": "100" + }, + { + "category": "gsm8k", + "id": "gsm8k-804", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-806", + "passed": true, + "read": "70" + }, + { + "category": "gsm8k", + "id": "gsm8k-808", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-822", + "passed": true, + "read": "1260" + }, + { + "category": "gsm8k", + "id": "gsm8k-824", + "passed": true, + "read": "52" + }, + { + "category": "gsm8k", + "id": "gsm8k-840", + "passed": true, + "read": "16" + }, + { + "category": "gsm8k", + "id": "gsm8k-845", + "passed": true, + "read": "12" + }, + { + "category": "gsm8k", + "id": "gsm8k-855", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-857", + "passed": true, + "read": "14000" + }, + { + "category": "gsm8k", + "id": "gsm8k-865", + "passed": true, + "read": "23" + }, + { + "category": "gsm8k", + "id": "gsm8k-880", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-902", + "passed": true, + "read": "8" + }, + { + "category": "gsm8k", + "id": "gsm8k-928", + "passed": true, + "read": "60" + }, + { + "category": "gsm8k", + "id": "gsm8k-930", + "passed": true, + "read": "14" + }, + { + "category": "gsm8k", + "id": "gsm8k-993", + "passed": true, + "read": "11" + }, + { + "category": "gsm8k", + "id": "gsm8k-999", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1005", + "passed": true, + "read": "1490" + }, + { + "category": "gsm8k", + "id": "gsm8k-1050", + "passed": true, + "read": "655" + }, + { + "category": "gsm8k", + "id": "gsm8k-1065", + "passed": true, + "read": "95" + }, + { + "category": "gsm8k", + "id": "gsm8k-1079", + "passed": true, + "read": "10" + }, + { + "category": "gsm8k", + "id": "gsm8k-1084", + "passed": true, + "read": "20" + }, + { + "category": "gsm8k", + "id": "gsm8k-1102", + "passed": true, + "read": "113" + }, + { + "category": "gsm8k", + "id": "gsm8k-1108", + "passed": true, + "read": "38" + }, + { + "category": "gsm8k", + "id": "gsm8k-1113", + "passed": true, + "read": "-3" + }, + { + "category": "gsm8k", + "id": "gsm8k-1118", + "passed": true, + "read": "5" + }, + { + "category": "gsm8k", + "id": "gsm8k-1126", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1148", + "passed": true, + "read": "9" + }, + { + "category": "gsm8k", + "id": "gsm8k-1150", + "passed": true, + "read": "21" + }, + { + "category": "gsm8k", + "id": "gsm8k-1155", + "passed": true, + "read": "13" + }, + { + "category": "gsm8k", + "id": "gsm8k-1161", + "passed": false, + "read": "140", + "text": "Abraham starts with 80 square meters.\n\n- He sold half: \\(80 \\times \\frac{1}{2} = 40\\) m² for $50. Remaining: 40 m².\n- He sold another 1/4 of his land: \\(80 \\times \\frac{1}{4} = 20\\) m² for $30. Remain" + }, + { + "category": "gsm8k", + "id": "gsm8k-1207", + "passed": true, + "read": "64" + }, + { + "category": "gsm8k", + "id": "gsm8k-1211", + "passed": true, + "read": "448" + }, + { + "category": "gsm8k", + "id": "gsm8k-1233", + "passed": true, + "read": "81" + }, + { + "category": "gsm8k", + "id": "gsm8k-1238", + "passed": true, + "read": "520" + }, + { + "category": "gsm8k", + "id": "gsm8k-1243", + "passed": true, + "read": "50" + }, + { + "category": "gsm8k", + "id": "gsm8k-1246", + "passed": true, + "read": "3360" + }, + { + "category": "gsm8k", + "id": "gsm8k-1284", + "passed": true, + "read": "25" + }, + { + "category": "gsm8k", + "id": "gsm8k-1303", + "passed": true, + "read": "4" + }, + { + "category": "gsm8k", + "id": "gsm8k-1315", + "passed": true, + "read": "5" + }, + { + "category": "mmlu", + "id": "mmlu-50", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-161", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-163", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-294", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-502", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-593", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-600", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-631", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-802", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1768", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-1839", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-1848", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-1949", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2171", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-2287", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-2312", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-2348", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2363", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-2583", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3041", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3179", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-3295", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3652", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3720", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-3736", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-3858", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4076", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-4876", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5186", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-5393", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5638", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-5765", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6138", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6194", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6498", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6558", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-6560", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6643", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-6760", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-6764", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-6818", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7345", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7440", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7449", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-7739", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-7825", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-7946", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8248", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8271", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8479", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-8500", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8622", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-8637", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-8678", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-8984", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9098", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9137", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9142", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9224", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9300", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9346", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9360", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9388", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-9436", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-9639", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9861", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-9874", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10159", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10172", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-10514", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10558", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-10921", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-10949", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11181", + "passed": false, + "read": "D", + "text": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11309", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11323", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-11468", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-11525", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11657", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11765", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11789", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11907", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-11909", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-11942", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12113", + "passed": false, + "read": "C", + "text": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12191", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12215", + "passed": false, + "read": "A", + "text": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12385", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12459", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12505", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12511", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-12655", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-12758", + "passed": true, + "read": "D" + }, + { + "category": "mmlu", + "id": "mmlu-12793", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-12923", + "passed": true, + "read": "C" + }, + { + "category": "mmlu", + "id": "mmlu-13001", + "passed": false, + "read": "B", + "text": "B" + }, + { + "category": "mmlu", + "id": "mmlu-13161", + "passed": true, + "read": "A" + }, + { + "category": "mmlu", + "id": "mmlu-13349", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-13568", + "passed": true, + "read": "B" + }, + { + "category": "mmlu", + "id": "mmlu-14025", + "passed": true, + "read": "D" + }, + { + "category": "instructions", + "id": "if-words-50", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-words-120", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-city", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-json-list", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-no-comma", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-lowercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-uppercase", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-ends-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-starts-with", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-4", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-bullets-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-paragraphs-2", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-keyword-3", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-include", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-exclude", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-one-word", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-number-only", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-french", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-title", + "passed": true, + "read": "all checks" + }, + { + "category": "instructions", + "id": "if-quote", + "passed": true, + "read": "all checks" + }, + { + "category": "long_context", + "id": "lc-room", + "passed": true, + "read": "31" + }, + { + "category": "long_context", + "id": "lc-budget", + "passed": true, + "read": "17" + }, + { + "category": "long_context", + "id": "lc-year", + "passed": true, + "read": "1852" + }, + { + "category": "long_context", + "id": "lc-wells", + "passed": true, + "read": "4" + }, + { + "category": "long_context", + "id": "lc-limit", + "passed": true, + "read": "37" + }, + { + "category": "long_context", + "id": "lc-staff", + "passed": true, + "read": "29" + }, + { + "category": "long_context", + "id": "lc-days", + "passed": true, + "read": "13" + }, + { + "category": "long_context", + "id": "lc-houses", + "passed": true, + "read": "1450" + } + ], + "identity": "the served copy's config.json sha256 and safetensors bytes match this revision on the Hub" +} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/README.md b/docs/receipts/xpu-qwen27-sampled-topk/README.md new file mode 100644 index 00000000000..37c22f1381e --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/README.md @@ -0,0 +1,156 @@ +# XPU Qwen3.8-27B sampled rows: the top_k on the card + +Receipts for the XPU Qwen3.8-27B drawing a sampled row from a top-k kept on the card (`topk_part` and `topk_merge` in +`zig/kernels/xpu/qwen27/glue_quant.cl`). Before, every sampled row copied its 248,320 fp16 logits to the host, waited on the +card, and scanned them on one CPU thread (`pickRow` in `zig/src/native/xpu.zig`): once a round for a lone stream's DFlash2 tree +path and once a row in shared rounds. Now the forward that produced the logits also keeps, for the rows of its sampled +streams, the `top_k` largest values with their ids and a flag for any NaN or infinity in the row, in the copy and the +sync the greedy tokens already take. The draw is the same keyed rule over the same candidates. Measured on 2026-11-11, +from 10:28 to 11:27 local time, against `main` at `6b739dd5e`. + +## What runs where + +- On the card, after `argmax`, when a row of the forward belongs to a sampled stream with temperature above 0, no grammar + mask, and `top_k` from 1 to 64: `topk_part` (one work-group per 1,024 ids of a row keeps its K best and flags any value + that is not finite) and `topk_merge` (one work-group a row merges the up to 256 lists, by value and then the lower id, + and ORs the flags). Values, ids and the flag go to one 528-byte row per logits row, copied beside the greedy tokens. +- On the host, the draw: the K values are widened to float64 and handed, with their ids, to the sampling rule `pickRow` already + uses (`lanes.sampling.choose`). A flagged row fails as `NonfiniteLogits`, as `pickRow`'s scan of the whole row does. +- Unchanged, still on the host: `top_k` of 0 or above 64, temperature 0 with a sampling block, rows with a grammar mask, the + prompt's last row (`first`), and any stream the card did not keep candidates for. Greedy streams read the device `argmax` as before. +- `verify`, `verifyTree` and `verifyMulti` no longer copy the rows' tokens and wait a second time: `forward` hands them back + from the copy and the sync it already makes. + +## Why the tokens cannot change + +`pickRow` already draws a row with `top_k` up to 256 from its `top_k` largest values alone (`top_p` and `min_p` act on that +list, not on the whole row), tied values keeping the lower id, and fails on a value that is not finite anywhere in the row. +The card keeps exactly that list: the K largest of the row by value, the lower id first at a tie (signed zeros are equal, +and the value reported is the winning element's own, so a `-0` stays `-0`), where K is `top_k`. Each group's K best contain +every id of the row's K best that falls in the group, and the merge takes the K best of the lists in the same order. The flag +is raised by every id of the row, not by the candidates. Everything after is the same call with the same bits, the same +`position` and the same seed. + +- Host test (`zig/src/native/xpu_sampled_topk_test.zig`, `zig build test-draft-xpu-host`): a model of the two kernels and the + plain scan, for random rows, rows of a few levels (many ties, signed zeros), lengths on and around the 1,024-id group, + `top_k` 1 to 64 and five `top_p`, `min_p`, temperature settings: `pickRow` over the whole row equals the draw from the + candidates (1,080 draws), the candidates equal the full sort's first 64, and a NaN, `+Inf` or `-Inf` anywhere (first + or last id of a group, outside the candidates) fails both the same way. With the merge's tie rule reversed the order + test fails. +- Served: `compare.out` (`token_sha256` per request). + +## Builds and hardware + +- Branch: the two commits that carry this receipt (kernel and host code, then the kernel contract). Base: `main` at + `6b739dd5e`. Both binaries carry the same local VRAM-guard patch to `zig/src/xpu/rt.zig`, which is not part of this change + and not committed; the runs also set that patch's card variable, left out of the scripts. +- Zig 0.17.0. Binaries: `zig build xpu-native -j2 -Doptimize=ReleaseFast -Dxpu-dpas=true -Dngen-include=` in each tree. +- `tensorfold-native` SHA-256, main: `91828565f980e55ac7d56835ed49fb617e8aa211c603948c5f77e9f7c1558ef9` + (MD5 `8d37d0f55c713f4b2f65baeb0f332fbb`); branch: + `c748436aded95ce62c1877d3dc66bca4a04f9849eac38da175551d947200ebc4` (MD5 `26ae47dc157a2f4d507edd3b7fda7086`). + A rebuild at the last commit of the branch gives the same branch SHA-256. +- Card: Intel Arc Pro B70 (BMG-G31, PCI id `0xe223`), the host's card 0 (`ZE_AFFINITY_MASK=0`). The host has a second + B70, which these runs did not use. One card only. +- Host: Intel Core Ultra 7 270K Plus, 30 GiB RAM, Ubuntu 26.04.1, Linux 7.0.0-43-generic. +- Driver: compute-runtime (`libze-intel-gpu1`, `intel-opencl-icd`, `intel-ocloc`) 26.35.39758.21, IGC 2.41.5 + (`intel-igc-core-2`, `intel-igc-opencl-2`), Level Zero loader 1.32.0 (`libze1`). +- Checkpoints: `Qwen3.8-27B-GPTQ-Int4-sym-G128-MTP-BF16` and its `Qwen3.8-27B-DFlash2` drafter, local copies. Hugging Face + revisions, from each copy's download metadata: target `9d189a60e4c0ad7f9f47cd94bfa393ca10b3924e`, drafter + `50307d4c4cde6860d4eee73e2547cd786fe8e8a4`. + +## Method + +`runs/` holds every request of four passes in the order main, branch, branch, main (`p1-main`, `p2-branch`, `p3-branch`, +`p4-main`), one JSON line a request. A pass starts a fresh `tensorfold-native serve` (port 8091, bf16 KV, the DFlash2 drafter, +`--context 10240 --prompt-cache-gib 0`) at `--parallel 1`, then 4, then 8 (all eight streams fit in bf16: `/health` reports +`max_batch_size` 8), and stops it. A cell is one prompt at one width: a wave of that many concurrent requests, stream i +with seed 1000 + i, 256 new tokens, thinking off, the checkpoint's own sampling (temperature 1.0, top_k 20, top_p 0.95; the +request sends none), one warm-up wave and three measured ones. Prompts: the short pair of `bench_topk.py` (34 tokens of +code, 29 of text) and the two corpora of the earlier receipt cut near 8,000 tokens (7,588 code, 7,912 text; +`scripts/build_corp_code.sh` rebuilds `corp_code.txt`, `corp_text.txt` is that receipt's). At one stream, two greedy +requests (`temperature` 0, short code and text) go first. Every request records the server's `tensorfold.token_sha256`. +`bench_topk.py` reads its cells from `CELLS` (`depth:kinds;...`, default `0:code,text;8192:code,text`), `GREEDY=1` for +the greedy pair and `SEED0` (default 1000); a request without `tensorfold.token_sha256` counts as a failure. + +## Exactness: same tokens, main against branch + +`compare.out`, 840 requests (four passes, 2 greedy and 208 sampled a pass): + +- 54 (mode, width, prompt, stream) cells; each carries one distinct `token_sha256` over the two main passes, the two branch + passes and the four waves of each: `MISMATCH main/branch/passes/waves: 0`. Every request produced 256 tokens. +- The same prompt and seed gives the same hash at 1, 4 and 8 streams (a stream in a shared round equals the lone one): + `MISMATCH across 1, 4 and 8 streams: 0 of 34` (prompt, seed) pairs. +- The two greedy requests have the same hash on main and on the branch (greedy is unchanged). + +After the timed passes, a review changed the kernel's tail and the host bookkeeping, not the candidates of the served +vocabulary: a group's cleared winner becomes the `(-inf, 0x7fffffff)` sentinel (a group with fewer live ids than K no +longer repeats its last id), and the forward notes the rows it holds candidates for after its sync. On that final tree +one more pass (1, 4 and 8 streams, the same cells, 210 requests) gives the receipt's `token_sha256` for every +(prompt, seed, mode): 0 of 210 differ (`final-tree/served.jsonl`). The contract, the host test, the device tests, +`zig build test` and `pr_check` were run again on it. The timed passes were not repeated. Then the contract gained a row +of fp16 subnormals of both signs above a -1 floor (the card's half-to-float must keep them as the host does); +`contract-run.out` is that run, on the host's second B70. + +## Speed + +Decode tok/s, served, sampled, DFlash2, one card. A cell reads `main / branch = ratio (pair 1-2, pair 4-3; gap)`: main is the +mean of passes 1 and 4, branch the mean of passes 2 and 3, each pass's value the median of its three measured waves; the +ratio is branch over main on the unrounded means; the two paired ratios are branch pass 2 over main pass 1 and branch pass 3 +over main pass 4, and the gap is their difference. "Per stream" is the mean over the wave's streams of each stream's +`(tokens - 1) / (last token - first token)`; with 4 or 8 streams at 8,000 tokens the prefills take turns, so a stream's rate +depends on which one is served first. "Wave" is the wave's completion tokens over its wall time, prefill included, so at 8,000 +tokens it is mostly prefill. + +| streams | prompt tokens | kind | per stream, main / branch | ratio (pairs; gap) | wave, main / branch | ratio (pairs; gap) | +|---|---|---|---|---|---|---| +| 1 | 34 | code | 153.00 / 158.61 | 1.037 (1.037, 1.037; 0.000) | 146.76 / 151.90 | 1.035 (1.035, 1.035; 0.000) | +| 1 | 29 | text | 80.20 / 80.56 | 1.005 (1.004, 1.005; 0.001) | 78.54 / 78.88 | 1.004 (1.004, 1.005; 0.001) | +| 1 | 7,588 | code | 65.00 / 65.40 | 1.006 (1.005, 1.007; 0.001) | 31.94 / 32.01 | 1.002 (1.001, 1.003; 0.002) | +| 1 | 7,912 | text | 60.66 / 60.93 | 1.004 (1.004, 1.005; 0.001) | 30.23 / 30.27 | 1.001 (1.000, 1.002; 0.002) | +| 4 | 34 | code | 67.64 / 74.88 | 1.107 (1.109, 1.105; 0.003) | 219.78 / 245.27 | 1.116 (1.114, 1.118; 0.005) | +| 4 | 29 | text | 46.37 / 51.27 | 1.106 (1.103, 1.109; 0.006) | 175.25 / 192.56 | 1.099 (1.102, 1.096; 0.006) | +| 4 | 7,588 | code | 22.32 / 23.19 | 1.039 (1.026, 1.053; 0.027) | 42.38 / 43.29 | 1.021 (1.020, 1.023; 0.003) | +| 4 | 7,912 | text | 21.73 / 22.77 | 1.048 (1.043, 1.053; 0.010) | 41.87 / 42.67 | 1.019 (1.017, 1.021; 0.003) | +| 8 | 34 | code | 37.51 / 41.39 | 1.103 (1.126, 1.081; 0.045) | 257.12 / 284.62 | 1.107 (1.102, 1.112; 0.010) | +| 8 | 29 | text | 31.19 / 34.49 | 1.106 (1.101, 1.110; 0.009) | 213.63 / 238.90 | 1.118 (1.134, 1.103; 0.031) | +| 8 | 7,588 | code | 12.11 / 12.62 | 1.042 (1.038, 1.047; 0.010) | 45.14 / 45.98 | 1.019 (1.018, 1.019; 0.001) | +| 8 | 7,912 | text | 11.97 / 12.50 | 1.044 (1.079, 1.010; 0.068) | 44.05 / 44.85 | 1.018 (1.018, 1.018; 0.001) | + +## Tests + +On the branch, on card 0, one binary at a time (`tests/`): + +- `tf-xpu-qwen27-means-test`, `tf-xpu-qwen27-seam-test`, `tf-xpu-qwen27-close-test`: all three printed `ok` + (`tests/branch-*.out`): group means worst error over the sum of absolute terms 4.19e-7 (prompt) and 2.80e-7 (decode) against a + bound of 2e-6; a 1,100-token prompt cut at 64 and at 1,024 gives 0 of 248,320 logits different; three open and close rounds, + 29,999, 30,000 and 29,998 MiB free after each. +- `zig build test`: rc 0 (`tests/zig-build-test.rc`); its output (`tests/zig-build-test.out`) holds stderr lines from tests that expect a failure (`failed command`, `DeviceLost`), which are not failures +- `python3 tools/pr_check.py --base 6b739dd5e`: 0 errors. + +The kernel contract (`zig build -Dxpu-contract=true tf-xpu-contract-run`, `contract-run.out`): + +```text +SUMMARY bmg-g31 0xe223 10 kernels: 10 pass gates 1-4, 0 fail, 0 known findings; 7 controls: 7 red as planted, 0 missed; 0 limit problems; gates 5607 ms, limits 1 ms +``` + +`topk_part` and `topk_merge` register as one kernel, "xpu top-k (the candidates)", with a stated rule (a row with a NaN or an +infinity anywhere raises the flag, whatever the candidates hold; else the flag is clear and the K candidates are the K +largest, the lower id first at a tie). It passes gate 1 (NaN, `+Inf` and `-Inf` planted in rows 0 to 3, outside the top +values for the NaN and `-Inf` rows), gate 2, and gate 3 on 14 shapes: 1 to 16 rows, 1 to 64 candidates, 64 to 262,144 ids +including 1,023, 1,025 and 100,003 (not whole groups), and rows holding one value everywhere or zeros of both signs on top. +Two planted controls, each a copy of `topk_merge` in `zig/kernels/xpu/contract_gate_controls.cl` over the real `topk_part`, +go red for their reason: the merge that breaks ties to the higher id at gate 3 (`candidate 0 is 15.875 at id 248007, the rule +gives 15.875 at id 317`), and the merge whose flag reads the merged candidates instead of the groups' flags at gate 1 +(`row 0 flag 0 where the row holds a value that is not finite`). `limits.out` has the gate 5 records +(`topk_part`, `topk_merge`: 256 work-items, 192 SLM bytes, sub-group 16, 256 GRF, no spill). + +## Files + +`runs/--par.jsonl` (requests; `-greedy` for the two greedy ones), `final-tree/served.jsonl`, +`compare.out`, `contract-run.out`, +`limits.out`, `tests/`, `scripts/` (`bench_topk.py` the client, `run_pass.sh` and `driver.sh` the passes, `compare_topk.py`, +`run-tests.sh`, `build_corp_code.sh`). + +The code corpus uses the top-level Python files from Ubuntu 26.04 python3.14 (3.14.4-1ubuntu0.2), concatenated in +punctuation- and case-blind filename order, then cut to 1,500,000 bytes. Expected SHA-256: +`31b2f903b4a2ea01728927e53436d924994c93cf3114c7b7f35e58d906961e30`. The historical corpus builder prints its digest. diff --git a/docs/receipts/xpu-qwen27-sampled-topk/compare.out b/docs/receipts/xpu-qwen27-sampled-topk/compare.out new file mode 100644 index 00000000000..bacfe1da50f --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/compare.out @@ -0,0 +1,20 @@ +streams checked: 54 (mode, streams, depth, kind, stream); requests: 840 +MISMATCH main/branch/passes/waves (distinct token_sha256 != 1): 0 +streams not at 256 tokens: 0 [] +sampled: 52 streams, 32 distinct hashes +greedy: 2 streams, 2 distinct hashes +MISMATCH across 1, 4 and 8 streams (same prompt and seed, distinct token_sha256 != 1): 0 of 34 (prompt, seed) pairs + +cell (streams, prompt tokens, kind) | per-stream tok/s main / branch = ratio (pairs) | aggregate tok/s main / branch = ratio (pairs) +1 streams, short code: 153.00 / 158.61 = 1.037 (1.037, 1.037; gap 0.000) | 146.76 / 151.90 = 1.035 (1.035, 1.035; gap 0.000) +1 streams, short text: 80.20 / 80.56 = 1.005 (1.004, 1.005; gap 0.001) | 78.54 / 78.88 = 1.004 (1.004, 1.005; gap 0.001) +1 streams, 8192 code: 65.00 / 65.40 = 1.006 (1.005, 1.007; gap 0.001) | 31.94 / 32.01 = 1.002 (1.001, 1.003; gap 0.002) +1 streams, 8192 text: 60.66 / 60.93 = 1.004 (1.004, 1.005; gap 0.001) | 30.23 / 30.27 = 1.001 (1.000, 1.002; gap 0.002) +4 streams, short code: 67.64 / 74.88 = 1.107 (1.109, 1.105; gap 0.003) | 219.78 / 245.27 = 1.116 (1.114, 1.118; gap 0.005) +4 streams, short text: 46.37 / 51.27 = 1.106 (1.103, 1.109; gap 0.006) | 175.25 / 192.56 = 1.099 (1.102, 1.096; gap 0.006) +4 streams, 8192 code: 22.32 / 23.19 = 1.039 (1.026, 1.053; gap 0.027) | 42.38 / 43.29 = 1.021 (1.020, 1.023; gap 0.003) +4 streams, 8192 text: 21.73 / 22.77 = 1.048 (1.043, 1.053; gap 0.010) | 41.87 / 42.67 = 1.019 (1.017, 1.021; gap 0.003) +8 streams, short code: 37.51 / 41.39 = 1.103 (1.126, 1.081; gap 0.045) | 257.12 / 284.62 = 1.107 (1.102, 1.112; gap 0.010) +8 streams, short text: 31.19 / 34.49 = 1.106 (1.101, 1.110; gap 0.009) | 213.63 / 238.90 = 1.118 (1.134, 1.103; gap 0.031) +8 streams, 8192 code: 12.11 / 12.62 = 1.042 (1.038, 1.047; gap 0.010) | 45.14 / 45.98 = 1.019 (1.018, 1.019; gap 0.001) +8 streams, 8192 text: 11.97 / 12.50 = 1.044 (1.079, 1.010; gap 0.068) | 44.05 / 44.85 = 1.018 (1.018, 1.018; gap 0.001) diff --git a/docs/receipts/xpu-qwen27-sampled-topk/contract-run.out b/docs/receipts/xpu-qwen27-sampled-topk/contract-run.out new file mode 100644 index 00000000000..5ecc8d5fa82 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/contract-run.out @@ -0,0 +1,75 @@ +error: module build: Size of SLM (163840) larger than available (131072) + +PASS nonfinite xpu add_rmsnorm (the normed row, fp16): 5122 non-finite and 20478 finite outputs match the float64 classes +PASS repeat xpu add_rmsnorm (the normed row, fp16): five runs byte-identical (10240 bytes), inputs and guards untouched, no overlap +PASS shapes xpu add_rmsnorm (the normed row, fp16): 8 shapes within the float64 bound (worst 0.941 of the bound), 0 edges refused by the kernel +PASS sums xpu add_rmsnorm (the normed row, fp16): within its bound at k 5120; fp16 sums would miss 120x, bf16 0.6x (a 16-bit output follows the sum of squares as ss^-1/2: a bf16 sum's error is a few output ulps; fp16's overflowing sums give 0, which the bound's residual roundings put at 120x) +PASS nonfinite xpu add_rmsnorm (the residual in place, fp32): 3 non-finite and 25597 finite outputs match the float64 classes +PASS repeat xpu add_rmsnorm (the residual in place, fp32): five runs byte-identical (20480 bytes), inputs and guards untouched, no overlap +PASS shapes xpu add_rmsnorm (the residual in place, fp32): 8 shapes within the float64 bound (worst 0.000 of the bound), 0 edges refused by the kernel +N/A sums xpu add_rmsnorm (the residual in place, fp32): declares none sums +PASS nonfinite xpu add_rmsnorm_dec (the normed row, fp16): 5122 non-finite and 20478 finite outputs match the float64 classes +PASS repeat xpu add_rmsnorm_dec (the normed row, fp16): five runs byte-identical (10240 bytes), inputs and guards untouched, no overlap +PASS shapes xpu add_rmsnorm_dec (the normed row, fp16): 5 shapes within the float64 bound (worst 0.000 of the bound), 0 edges refused by the kernel +PASS sums xpu add_rmsnorm_dec (the normed row, fp16): within its bound at k 5120; fp16 sums would miss 120x, bf16 0.5x (a 16-bit output follows the sum of squares as ss^-1/2: a bf16 sum's error is a few output ulps; fp16's overflowing sums give 0, which the bound's residual roundings put at 120x) +PASS nonfinite xpu add_rmsnorm_dec (the residual in place, fp32): 3 non-finite and 25597 finite outputs match the float64 classes +PASS repeat xpu add_rmsnorm_dec (the residual in place, fp32): five runs byte-identical (20480 bytes), inputs and guards untouched, no overlap +PASS shapes xpu add_rmsnorm_dec (the residual in place, fp32): 5 shapes within the float64 bound (worst 0.000 of the bound), 0 edges refused by the kernel +N/A sums xpu add_rmsnorm_dec (the residual in place, fp32): declares none sums +PASS nonfinite xpu gated_norm (the gated row, fp16): 130 non-finite and 30590 finite outputs match the float64 classes +PASS repeat xpu gated_norm (the gated row, fp16): five runs byte-identical (12288 bytes), inputs and guards untouched, no overlap +PASS shapes xpu gated_norm (the gated row, fp16): 5 shapes within the float64 bound (worst 0.926 of the bound), 0 edges refused by the kernel +PASS sums xpu gated_norm (the gated row, fp16): within its bound at k 6144; fp16 sums would miss 120x, bf16 0.1x (a 16-bit output follows the sum of squares as ss^-1/2: a bf16 sum's error is a few output ulps; fp16's overflowing sums give 0, which the bound's residual roundings put at 120x) +PASS nonfinite xpu swiglu (the activation, fp16): 4 non-finite and 87036 finite outputs match the float64 classes +PASS repeat xpu swiglu (the activation, fp16): five runs byte-identical (34816 bytes), inputs and guards untouched, no overlap +PASS shapes xpu swiglu (the activation, fp16): 5 shapes within the float64 bound (worst 0.933 of the bound), 0 edges refused by the kernel +N/A sums xpu swiglu (the activation, fp16): declares none sums +PASS nonfinite xpu swiglu (the row sums, fp16): 4 non-finite and 1356 finite outputs match the float64 classes +PASS repeat xpu swiglu (the row sums, fp16): five runs byte-identical (544 bytes), inputs and guards untouched, no overlap +PASS shapes xpu swiglu (the row sums, fp16): 5 shapes within the float64 bound (worst 0.996 of the bound), 0 edges refused by the kernel +PASS sums xpu swiglu (the row sums, fp16): within its bound at k 17408; fp16 sums would miss 0x, bf16 0.0x (the f16 output's own rounding is 2^-11 of the value, and a f16 sum's error over a group of 64 is a few of those ulps, so its miss stays under the 100x the gate asks) +PASS nonfinite xpu argmax (the pick): the stated rule holds: a NaN compares false, so it is skipped; the pick is the largest value above -Inf, the lowest index on a tie, and 0x7fffffff when no value compares above -Inf (a row of NaNs, or of -Inf) +PASS repeat xpu argmax (the pick): five runs byte-identical (4 bytes), inputs and guards untouched, no overlap +PASS shapes xpu argmax (the pick): 7 shapes exact by its own check (worst 0.000 of the bound), 0 edges refused by the kernel +N/A sums xpu argmax (the pick): declares none sums +PASS nonfinite xpu top-k (the candidates): the stated rule holds: a row holding a NaN or an infinity anywhere raises the flag, whatever the candidates hold; else the flag is clear and the K candidates are the K largest values, the lower id first at a tie, signed zeros equal +PASS repeat xpu top-k (the candidates): five runs byte-identical (528 bytes), inputs and guards untouched, no overlap +PASS shapes xpu top-k (the candidates): 14 shapes exact by its own check (worst 0.000 of the bound), 0 edges refused by the kernel +N/A sums xpu top-k (the candidates): declares none sums +FAIL shapes control: top-k merge breaking ties the wrong way: at 1x248320x20: row 0 candidate 0 is 15.875 at id 247086, the rule gives 15.875 at id 271 +CONTROL control: top-k merge breaking ties the wrong way: red at shapes, as planted +FAIL nonfinite control: top-k flag read off the candidates only: row 0 flag 0 where the row holds a value that is not finite +CONTROL control: top-k flag read off the candidates only: red at nonfinite, as planted +PASS nonfinite xpu embed (the gathered row, fp32): the stated rule holds: a NaN stays a NaN, an infinity stays an infinity, and a finite value rounds once to bf16, to nearest even, as glue.cl's embed stores it +PASS repeat xpu embed (the gathered row, fp32): five runs byte-identical (20480 bytes), inputs and guards untouched, no overlap +PASS shapes xpu embed (the gathered row, fp32): 9 shapes exact by its own check (worst 0.000 of the bound), 0 edges refused by the kernel +N/A sums xpu embed (the gathered row, fp32): declares none sums +FAIL nonfinite control: fmax row max: 1 of 8 outputs differ in class; first at 0: finite where float64 gives nan +CONTROL control: fmax row max: red at nonfinite, as planted +FAIL repeat control: atomic-add row sum: 4 of 4 repeats differ from the first run's bytes, first at byte 0 +CONTROL control: atomic-add row sum: red at repeat, as planted +FAIL repeat control: row sum writing its input: 4 of 4 repeats differ from the first run's bytes, first at byte 0 +CONTROL control: row sum writing its input: red at repeat, as planted +FAIL shapes control: row sum losing a tail input: at 8x1x1 output 0 is 0.000000e0 where float64 gives -3.203125e-1: 1864134.22 of its bound +CONTROL control: row sum losing a tail input: red at shapes, as planted +FAIL sums control: dot summed in half: 621378.4x over its exact-sum bound at k 4096: not fp32 sums (fp16 would miss 29826162x, bf16 16777216x) +CONTROL control: dot summed in half: red at sums, as planted +PASS limits: 8 registered XPU launches against bmg-g31, 0 problems +RED limits control: 2048 work-items a work-group: red on every card class +RED limits control: 200 work-items, not a multiple of sub-group 16: red on every card class +RED limits control: 160 KiB of SLM: red on every card class +RED limits control: 1024 work-items at 256 GRF: red on every card class +RED limits control: sub-group 32 at 256 GRF: red on every card class +RED limits control: sub-group 8: red on every card class +PASS limits live bmg-g31: PCI id 0xe223, 8 EUs a Xe-core, 8 threads an EU, SIMD 16, 32 Xe-cores +N/A limits live contract_controls: the driver does not build the image (BuildFailed); gate 5's table holds its limits +PASS limits live add_rmsnorm: 128 work-items required, sub-group 16 (the kernel's most 16), 10272 SLM bytes, 0 spill bytes, 0 private bytes, 14 arguments +PASS limits live add_rmsnorm_dec: 512 work-items required, sub-group 16 (the kernel's most 16), 10368 SLM bytes, 0 spill bytes, 0 private bytes, 14 arguments +PASS limits live gated_norm: 256 work-items required, sub-group 16 (the kernel's most 16), 12288 SLM bytes, 0 spill bytes, 0 private bytes, 12 arguments +PASS limits live swiglu: 256 work-items required, sub-group 16 (the kernel's most 16), 2048 SLM bytes, 0 spill bytes, 0 private bytes, 7 arguments +PASS limits live argmax: 256 work-items required, sub-group 16 (the kernel's most 16), 2048 SLM bytes, 0 spill bytes, 0 private bytes, 3 arguments +PASS limits live topk_part: 256 work-items required, sub-group 16 (the kernel's most 16), 192 SLM bytes, 0 spill bytes, 0 private bytes, 6 arguments +PASS limits live topk_merge: 256 work-items required, sub-group 16 (the kernel's most 16), 192 SLM bytes, 0 spill bytes, 0 private bytes, 6 arguments +PASS limits live embed: 256 work-items required, sub-group 16 (the kernel's most 16), 0 SLM bytes, 0 spill bytes, 0 private bytes, 6 arguments +RED limits live control: sub-group 8: declared only, ocloc does not build it for this device: control: sub-group 8 on bmg-g31: sub-group 8, the device runs { 16, 32 } +SUMMARY bmg-g31 0xe223 10 kernels: 10 pass gates 1-4, 0 fail, 0 known findings; 7 controls: 7 red as planted, 0 missed; 0 limit problems; gates 5779 ms, limits 0 ms diff --git a/docs/receipts/xpu-qwen27-sampled-topk/final-tree/served.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/final-tree/served.jsonl new file mode 100644 index 00000000000..f7aad02f2ac --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/final-tree/served.jsonl @@ -0,0 +1,210 @@ +{"ok": true, "token_sha256": "5d721308b699d401dae7698a19eb8af0418c8a4ab835f68c3c71c394b8e9102f", "text_sha256": "ef79dee7153a363aadcf383ed572fbe239fe1f0074f21a92400f0b7efab01337", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396171.0421453, "t_first": 1794396171.130186, "t1": 1794396173.124949, "ttft_s": 0.08804082870483398, "decode_tok_s": 127.83474182354163, "label": "p5-final-par1-greedy", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 2.0832345485687256, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "356fb0b3163a59e43a18c611211d279e96191c0ab6e4f01e8eb13b7445e099f6", "text_sha256": "5d3300bf0d0b7e170a26c73e967ef7ef9a3319996f826e21759a8b4143449b62", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396173.1254346, "t_first": 1794396173.203874, "t1": 1794396176.5166051, "ttft_s": 0.07843947410583496, "decode_tok_s": 76.97576346380872, "label": "p5-final-par1-greedy", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 3.3916962146759033, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396176.5540578, "t_first": 1794396176.6355114, "t1": 1794396178.29399, "ttft_s": 0.08145356178283691, "decode_tok_s": 153.75538497300883, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7404792308807373, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396178.2945132, "t_first": 1794396178.3706763, "t1": 1794396179.9815235, "ttft_s": 0.07616305351257324, "decode_tok_s": 158.30178958179252, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6874167919158936, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396179.9821417, "t_first": 1794396180.0594804, "t1": 1794396181.670226, "ttft_s": 0.07733869552612305, "decode_tok_s": 158.31177137450698, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.688539981842041, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396181.6711266, "t_first": 1794396181.7474616, "t1": 1794396183.3585494, "ttft_s": 0.07633495330810547, "decode_tok_s": 158.27815228123512, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6880285739898682, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396183.3590076, "t_first": 1794396183.4383376, "t1": 1794396186.7113354, "ttft_s": 0.0793299674987793, "decode_tok_s": 77.9102251844194, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.352644681930542, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396186.7120318, "t_first": 1794396186.7911446, "t1": 1794396189.9605699, "ttft_s": 0.07911276817321777, "decode_tok_s": 80.45622785154255, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2490060329437256, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396189.9612525, "t_first": 1794396190.0410883, "t1": 1794396193.211241, "ttft_s": 0.07983589172363281, "decode_tok_s": 80.43776657222637, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2505030632019043, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396193.211763, "t_first": 1794396193.2914102, "t1": 1794396196.461466, "ttft_s": 0.07964730262756348, "decode_tok_s": 80.44022274671714, "label": "p5-final-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2501308917999268, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396202.5240047, "t_first": 1794396206.6031578, "t1": 1794396210.6032143, "ttft_s": 4.079153060913086, "decode_tok_s": 63.74909946104454, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.07968807220459, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396210.6037772, "t_first": 1794396214.6863127, "t1": 1794396218.5866797, "ttft_s": 4.0825355052948, "decode_tok_s": 65.3784627421975, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.9834303855896, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396218.5874326, "t_first": 1794396222.671531, "t1": 1794396226.5726745, "ttft_s": 4.0840983390808105, "decode_tok_s": 65.36544904710027, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.985838890075684, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396226.5732384, "t_first": 1794396230.659674, "t1": 1794396234.56505, "ttft_s": 4.086435556411743, "decode_tok_s": 65.29460998780611, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.992365598678589, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396240.4518929, "t_first": 1794396244.709114, "t1": 1794396248.9620667, "ttft_s": 4.257221221923828, "decode_tok_s": 59.958345516940746, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.510954856872559, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396248.962925, "t_first": 1794396253.2202692, "t1": 1794396257.4074032, "ttft_s": 4.2573442459106445, "decode_tok_s": 60.90084490402721, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.44501805305481, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396257.4079943, "t_first": 1794396261.6697745, "t1": 1794396265.8548572, "ttft_s": 4.261780261993408, "decode_tok_s": 60.93069596512014, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.447448015213013, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396265.8555021, "t_first": 1794396270.1138856, "t1": 1794396274.3000915, "ttft_s": 4.258383512496948, "decode_tok_s": 60.91434780974381, "label": "p5-final-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.444971799850464, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396303.8144176, "t_first": 1794396304.0946684, "t1": 1794396307.2600439, "ttft_s": 0.28025078773498535, "decode_tok_s": 80.55916346321072, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.401634931564331, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396303.8149865, "t_first": 1794396304.3016963, "t1": 1794396308.1291194, "ttft_s": 0.4867098331451416, "decode_tok_s": 66.62446079877529, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.401634931564331, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396303.8152716, "t_first": 1794396304.2223883, "t1": 1794396307.9616401, "ttft_s": 0.4071166515350342, "decode_tok_s": 68.19545997180869, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.401634931564331, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396303.815468, "t_first": 1794396303.9547517, "t1": 1794396308.2155437, "ttft_s": 0.1392836570739746, "decode_tok_s": 59.84802801535466, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.401634931564331, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396308.2160017, "t_first": 1794396308.2937424, "t1": 1794396311.2754595, "ttft_s": 0.07774066925048828, "decode_tok_s": 85.52119152153631, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.222188949584961, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396308.2162883, "t_first": 1794396308.3729413, "t1": 1794396312.1478674, "ttft_s": 0.15665292739868164, "decode_tok_s": 67.55098973118996, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.222188949584961, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396308.2164657, "t_first": 1794396308.4522028, "t1": 1794396311.7703562, "ttft_s": 0.23573708534240723, "decode_tok_s": 76.84997367313764, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.222188949584961, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396308.2165942, "t_first": 1794396308.531057, "t1": 1794396312.4378529, "ttft_s": 0.31446266174316406, "decode_tok_s": 65.27087705636846, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.222188949584961, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396312.4383318, "t_first": 1794396312.5147278, "t1": 1794396315.4579964, "ttft_s": 0.07639598846435547, "decode_tok_s": 86.63837388577025, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.171020269393921, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396312.4386573, "t_first": 1794396312.593615, "t1": 1794396316.3186944, "ttft_s": 0.15495777130126953, "decode_tok_s": 68.45491856658761, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.171020269393921, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396312.4389555, "t_first": 1794396312.6728046, "t1": 1794396315.9542089, "ttft_s": 0.23384904861450195, "decode_tok_s": 77.71063241292528, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.171020269393921, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396312.43948, "t_first": 1794396312.7511933, "t1": 1794396316.6090398, "ttft_s": 0.31171321868896484, "decode_tok_s": 66.09905295605996, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.171020269393921, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396316.6095846, "t_first": 1794396316.686719, "t1": 1794396319.6286056, "ttft_s": 0.07713437080383301, "decode_tok_s": 86.67906998908435, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.170655012130737, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396316.6101058, "t_first": 1794396316.7647386, "t1": 1794396320.4893072, "ttft_s": 0.1546328067779541, "decode_tok_s": 68.46430473282729, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.170655012130737, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396316.6104105, "t_first": 1794396316.8437061, "t1": 1794396320.1247861, "ttft_s": 0.23329567909240723, "decode_tok_s": 77.7183120841265, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.170655012130737, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396316.6110551, "t_first": 1794396316.9221883, "t1": 1794396320.7797196, "ttft_s": 0.31113314628601074, "decode_tok_s": 66.1044537465221, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.170655012130737, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396320.7804148, "t_first": 1794396320.8602827, "t1": 1794396326.2783954, "ttft_s": 0.07986783981323242, "decode_tok_s": 47.06435829949573, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.498366594314575, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396320.7808514, "t_first": 1794396320.9727454, "t1": 1794396325.9897957, "ttft_s": 0.1918940544128418, "decode_tok_s": 50.826678320246025, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.498366594314575, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396320.7812424, "t_first": 1794396321.1384764, "t1": 1794396326.0764656, "ttft_s": 0.35723400115966797, "decode_tok_s": 51.64045279736385, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.498366594314575, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396320.781586, "t_first": 1794396321.053879, "t1": 1794396326.2317684, "ttft_s": 0.2722930908203125, "decode_tok_s": 49.24786585947038, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.498366594314575, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396326.2787848, "t_first": 1794396326.4389663, "t1": 1794396331.5433602, "ttft_s": 0.16018152236938477, "decode_tok_s": 49.956959052527445, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.264832973480225, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396326.2791193, "t_first": 1794396326.3581147, "t1": 1794396331.1184466, "ttft_s": 0.0789954662322998, "decode_tok_s": 53.567693810148604, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.264832973480225, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396326.279442, "t_first": 1794396326.6008704, "t1": 1794396331.4594998, "ttft_s": 0.3214282989501953, "decode_tok_s": 52.48393643341689, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.264832973480225, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396326.2795537, "t_first": 1794396326.519979, "t1": 1794396331.4224315, "ttft_s": 0.24042534828186035, "decode_tok_s": 52.01478272744356, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.264832973480225, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396331.5439239, "t_first": 1794396331.6229775, "t1": 1794396336.8566132, "ttft_s": 0.07905364036560059, "decode_tok_s": 48.723299895464805, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.3130717277526855, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396331.544412, "t_first": 1794396331.7037368, "t1": 1794396336.573385, "ttft_s": 0.15932488441467285, "decode_tok_s": 52.36517887458791, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.3130717277526855, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396331.5446372, "t_first": 1794396331.7846425, "t1": 1794396336.6585436, "ttft_s": 0.2400052547454834, "decode_tok_s": 52.319485615911425, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.3130717277526855, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396331.5450997, "t_first": 1794396331.8655422, "t1": 1794396336.8142338, "ttft_s": 0.32044243812561035, "decode_tok_s": 51.52877169875561, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.3130717277526855, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396336.8569968, "t_first": 1794396336.9361567, "t1": 1794396342.07204, "ttft_s": 0.07915997505187988, "decode_tok_s": 49.65066056816215, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.2586915493011475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396336.857242, "t_first": 1794396337.0170252, "t1": 1794396341.8682032, "ttft_s": 0.15978312492370605, "decode_tok_s": 52.56455311179878, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.2586915493011475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396336.8575053, "t_first": 1794396337.100172, "t1": 1794396341.994287, "ttft_s": 0.24266672134399414, "decode_tok_s": 52.10339387256237, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.2586915493011475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396336.8577006, "t_first": 1794396337.1810966, "t1": 1794396342.1154351, "ttft_s": 0.3233959674835205, "decode_tok_s": 51.678658932912825, "label": "p5-final-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.2586915493011475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396348.1672027, "t_first": 1794396352.2683792, "t1": 1794396370.8395321, "ttft_s": 4.101176500320435, "decode_tok_s": 13.730973032373191, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.810654401779175, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396348.1678543, "t_first": 1794396356.3824222, "t1": 1794396371.8484972, "ttft_s": 8.21456789970398, "decode_tok_s": 16.487699751284968, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.810654401779175, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396348.1684883, "t_first": 1794396360.4984782, "t1": 1794396369.558984, "ttft_s": 12.329989910125732, "decode_tok_s": 28.144123931162873, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.810654401779175, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396348.1687613, "t_first": 1794396364.6156917, "t1": 1794396371.9773686, "ttft_s": 16.446930408477783, "decode_tok_s": 34.638846879165605, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.810654401779175, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396371.9779549, "t_first": 1794396376.0742576, "t1": 1794396394.4588575, "ttft_s": 4.09630274772644, "decode_tok_s": 13.870304551251001, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.689886808395386, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396371.9783647, "t_first": 1794396380.1955142, "t1": 1794396395.4772365, "ttft_s": 8.217149496078491, "decode_tok_s": 16.686600821150225, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.689886808395386, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396371.9787319, "t_first": 1794396384.3152869, "t1": 1794396393.5929344, "ttft_s": 12.336555004119873, "decode_tok_s": 27.48541590203898, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.689886808395386, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396371.9791248, "t_first": 1794396388.4366128, "t1": 1794396395.667412, "ttft_s": 16.45748805999756, "decode_tok_s": 35.26581129029546, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.689886808395386, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396395.66807, "t_first": 1794396399.7697067, "t1": 1794396418.1143794, "ttft_s": 4.101636648178101, "decode_tok_s": 13.90049331757139, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.65118670463562, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396395.6687346, "t_first": 1794396403.8929641, "t1": 1794396419.1284263, "ttft_s": 8.224229574203491, "decode_tok_s": 16.737267097074653, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.65118670463562, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396395.6692438, "t_first": 1794396408.0176518, "t1": 1794396417.2508752, "ttft_s": 12.348407983779907, "decode_tok_s": 27.61765722502363, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.65118670463562, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396395.6695647, "t_first": 1794396412.1407814, "t1": 1794396419.3188674, "ttft_s": 16.471216678619385, "decode_tok_s": 35.52479010332289, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.65118670463562, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396419.319406, "t_first": 1794396423.4199235, "t1": 1794396441.7726114, "ttft_s": 4.100517511367798, "decode_tok_s": 13.894422565400005, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.659794569015503, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396419.3197947, "t_first": 1794396431.6709023, "t1": 1794396442.788282, "ttft_s": 12.351107597351074, "decode_tok_s": 22.937059601751418, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.659794569015503, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396419.3202562, "t_first": 1794396427.545756, "t1": 1794396440.9086792, "ttft_s": 8.225499868392944, "decode_tok_s": 19.08265109567732, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.659794569015503, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396419.320731, "t_first": 1794396435.7953496, "t1": 1794396442.9787862, "ttft_s": 16.474618673324585, "decode_tok_s": 35.49832942891185, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.659794569015503, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396448.8744676, "t_first": 1794396457.4463964, "t1": 1794396472.9432344, "ttft_s": 8.57192873954773, "decode_tok_s": 16.454969618506286, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.069215774536133, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396448.874755, "t_first": 1794396453.150053, "t1": 1794396472.5598938, "ttft_s": 4.275298118591309, "decode_tok_s": 13.137665699354065, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.069215774536133, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396448.8753283, "t_first": 1794396466.0410984, "t1": 1794396472.753618, "ttft_s": 17.165770053863525, "decode_tok_s": 37.98871563283937, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.069215774536133, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396448.8755624, "t_first": 1794396461.7423992, "t1": 1794396472.8072102, "ttft_s": 12.866836786270142, "decode_tok_s": 23.046033068327578, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.069215774536133, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396472.9437718, "t_first": 1794396477.2136612, "t1": 1794396496.4418867, "ttft_s": 4.2698893547058105, "decode_tok_s": 13.261754206247483, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.019357204437256, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396472.9441948, "t_first": 1794396481.5161574, "t1": 1794396496.570595, "ttft_s": 8.571962594985962, "decode_tok_s": 16.938527106964127, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.019357204437256, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396472.9446733, "t_first": 1794396485.815187, "t1": 1794396496.9627593, "ttft_s": 12.870513677597046, "decode_tok_s": 22.874935781390946, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.019357204437256, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396472.9451077, "t_first": 1794396490.113928, "t1": 1794396496.79995, "ttft_s": 17.16882038116455, "decode_tok_s": 38.13927137009432, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.019357204437256, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396496.9632542, "t_first": 1794396501.229227, "t1": 1794396520.4214964, "ttft_s": 4.265972852706909, "decode_tok_s": 13.28659970733263, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.950164318084717, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396496.9636383, "t_first": 1794396509.828246, "t1": 1794396520.54971, "ttft_s": 12.864607810974121, "decode_tok_s": 23.784065490867626, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.950164318084717, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396496.9640706, "t_first": 1794396505.528561, "t1": 1794396520.913049, "ttft_s": 8.564490556716919, "decode_tok_s": 16.575137385046766, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.950164318084717, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396496.9644592, "t_first": 1794396514.1267192, "t1": 1794396520.7811809, "ttft_s": 17.162260055541992, "decode_tok_s": 38.320154878920675, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.950164318084717, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396520.9135761, "t_first": 1794396525.185404, "t1": 1794396544.3868124, "ttft_s": 4.271827936172485, "decode_tok_s": 13.28027584595634, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.966076135635376, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396520.9139893, "t_first": 1794396533.7870178, "t1": 1794396544.5156054, "ttft_s": 12.87302851676941, "decode_tok_s": 23.76827303423337, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.966076135635376, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396520.9143112, "t_first": 1794396529.4864712, "t1": 1794396544.8792727, "ttft_s": 8.572160005569458, "decode_tok_s": 16.56618514930643, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.966076135635376, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396520.9147663, "t_first": 1794396538.087139, "t1": 1794396544.7472823, "ttft_s": 17.172372579574585, "decode_tok_s": 38.28746404198998, "label": "p5-final-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.966076135635376, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.3355596, "t_first": 1794396574.7244165, "t1": 1794396580.5105164, "ttft_s": 0.3888568878173828, "decode_tok_s": 44.07113667823962, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.33609, "t_first": 1794396575.1972518, "t1": 1794396581.68651, "ttft_s": 0.8611617088317871, "decode_tok_s": 39.29570817346012, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.3363063, "t_first": 1794396574.9528084, "t1": 1794396581.8194818, "ttft_s": 0.616502046585083, "decode_tok_s": 37.135885539196046, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.336799, "t_first": 1794396575.0707402, "t1": 1794396581.941172, "ttft_s": 0.7339413166046143, "decode_tok_s": 37.11557185337006, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.3370621, "t_first": 1794396575.2760272, "t1": 1794396582.318218, "ttft_s": 0.9389650821685791, "decode_tok_s": 36.210322554128474, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.3374283, "t_first": 1794396574.8382432, "t1": 1794396581.1689062, "ttft_s": 0.5008149147033691, "decode_tok_s": 40.280141492069085, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.337661, "t_first": 1794396574.6053863, "t1": 1794396580.9844685, "ttft_s": 0.26772522926330566, "decode_tok_s": 39.97440256901211, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396574.3379376, "t_first": 1794396574.477869, "t1": 1794396580.9840696, "ttft_s": 0.13993144035339355, "decode_tok_s": 39.19338144627815, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.983367443084717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3189874, "t_first": 1794396582.3963153, "t1": 1794396588.0121846, "ttft_s": 0.07732796669006348, "decode_tok_s": 45.40703978655946, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3192263, "t_first": 1794396582.4750922, "t1": 1794396589.0998387, "ttft_s": 0.15586590766906738, "decode_tok_s": 38.4920385481988, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.319453, "t_first": 1794396582.6313758, "t1": 1794396589.0994399, "ttft_s": 0.3119227886199951, "decode_tok_s": 39.42447032840507, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.319574, "t_first": 1794396582.7093625, "t1": 1794396589.4226677, "ttft_s": 0.3897883892059326, "decode_tok_s": 37.98427020329791, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3200665, "t_first": 1794396582.8655033, "t1": 1794396589.5459676, "ttft_s": 0.5454368591308594, "decode_tok_s": 38.17099976595204, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3202498, "t_first": 1794396582.7874315, "t1": 1794396588.6133645, "ttft_s": 0.4671816825866699, "decode_tok_s": 43.76981350345359, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3205047, "t_first": 1794396582.553302, "t1": 1794396588.2932317, "ttft_s": 0.23279738426208496, "decode_tok_s": 44.42563139122268, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396582.3209162, "t_first": 1794396582.9438372, "t1": 1794396588.7476356, "ttft_s": 0.6229209899902344, "decode_tok_s": 43.93674293875071, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.227473497390747, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5467067, "t_first": 1794396589.6237788, "t1": 1794396595.2764554, "ttft_s": 0.0770721435546875, "decode_tok_s": 45.111372689679094, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5473208, "t_first": 1794396589.9388735, "t1": 1794396596.3817675, "ttft_s": 0.3915526866912842, "decode_tok_s": 39.57848766641839, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5475385, "t_first": 1794396589.8604348, "t1": 1794396596.2985861, "ttft_s": 0.3128962516784668, "decode_tok_s": 39.60764290224802, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5476034, "t_first": 1794396589.7027617, "t1": 1794396596.8836823, "ttft_s": 0.15515828132629395, "decode_tok_s": 35.51076723621702, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5476847, "t_first": 1794396589.7814827, "t1": 1794396596.4602566, "ttft_s": 0.23379802703857422, "decode_tok_s": 38.180660789164726, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5483024, "t_first": 1794396590.174347, "t1": 1794396596.2073183, "ttft_s": 0.626044511795044, "decode_tok_s": 42.26772909197855, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.548541, "t_first": 1794396590.0959294, "t1": 1794396594.898918, "ttft_s": 0.5473883152008057, "decode_tok_s": 53.091944411158316, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396589.5486534, "t_first": 1794396590.017472, "t1": 1794396596.342782, "ttft_s": 0.46881866455078125, "decode_tok_s": 40.31422971033883, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.337708950042725, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8849652, "t_first": 1794396596.9633756, "t1": 1794396602.5325563, "ttft_s": 0.07841038703918457, "decode_tok_s": 45.787704242295966, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8856764, "t_first": 1794396597.0418782, "t1": 1794396603.6135428, "ttft_s": 0.15620183944702148, "decode_tok_s": 38.802954291933055, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8862891, "t_first": 1794396597.1989446, "t1": 1794396603.6130054, "ttft_s": 0.3126554489135742, "decode_tok_s": 39.75640498524283, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8867328, "t_first": 1794396597.1206312, "t1": 1794396603.936492, "ttft_s": 0.23389840126037598, "decode_tok_s": 37.412736177736285, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8882003, "t_first": 1794396597.277378, "t1": 1794396604.0601997, "ttft_s": 0.3891777992248535, "decode_tok_s": 37.5949734432049, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.888822, "t_first": 1794396597.3561282, "t1": 1794396603.129992, "ttft_s": 0.46730613708496094, "decode_tok_s": 44.164533346767236, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.8896832, "t_first": 1794396597.4341335, "t1": 1794396602.809897, "ttft_s": 0.5444502830505371, "decode_tok_s": 47.43512321008555, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794396596.89068, "t_first": 1794396597.5121298, "t1": 1794396603.264067, "ttft_s": 0.6214497089385986, "decode_tok_s": 44.332890521526856, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.175815582275391, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0609307, "t_first": 1794396604.1409314, "t1": 1794396612.7428863, "ttft_s": 0.08000063896179199, "decode_tok_s": 29.64442407198782, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0613196, "t_first": 1794396604.3354404, "t1": 1794396612.1995113, "ttft_s": 0.2741208076477051, "decode_tok_s": 32.42595387187797, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.06162, "t_first": 1794396604.2532277, "t1": 1794396611.382671, "ttft_s": 0.19160771369934082, "decode_tok_s": 35.76716798783054, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0621088, "t_first": 1794396604.4162319, "t1": 1794396612.2905397, "ttft_s": 0.3541231155395508, "decode_tok_s": 32.38379857403166, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0624804, "t_first": 1794396604.497019, "t1": 1794396612.819354, "ttft_s": 0.4345386028289795, "decode_tok_s": 30.64043923402821, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0627728, "t_first": 1794396604.5778942, "t1": 1794396612.9465592, "ttft_s": 0.5151214599609375, "decode_tok_s": 30.470809933413058, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0634866, "t_first": 1794396604.658739, "t1": 1794396611.8703973, "ttft_s": 0.595252513885498, "decode_tok_s": 35.359412708729046, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396604.0637448, "t_first": 1794396604.73979, "t1": 1794396611.5309768, "ttft_s": 0.6760451793670654, "decode_tok_s": 37.54866522620073, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.88628602027893, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.9472957, "t_first": 1794396613.1078937, "t1": 1794396620.494943, "ttft_s": 0.1605980396270752, "decode_tok_s": 34.51987297767556, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.9475455, "t_first": 1794396613.1885688, "t1": 1794396620.0361924, "ttft_s": 0.24102330207824707, "decode_tok_s": 37.239196455974835, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.9478078, "t_first": 1794396613.026914, "t1": 1794396620.4518728, "ttft_s": 0.07910609245300293, "decode_tok_s": 34.34362424253517, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.947956, "t_first": 1794396613.2694712, "t1": 1794396621.4717615, "ttft_s": 0.3215150833129883, "decode_tok_s": 31.088877713474087, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.948491, "t_first": 1794396613.3503637, "t1": 1794396621.5876954, "ttft_s": 0.4018726348876953, "decode_tok_s": 30.956626671247097, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.9486964, "t_first": 1794396613.4313788, "t1": 1794396621.6722834, "ttft_s": 0.482682466506958, "decode_tok_s": 30.943205062690982, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.949155, "t_first": 1794396613.592924, "t1": 1794396620.6782057, "ttft_s": 0.6437690258026123, "decode_tok_s": 35.99010089062709, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396612.94924, "t_first": 1794396613.5121837, "t1": 1794396620.3528335, "ttft_s": 0.562943696975708, "decode_tok_s": 37.27716018864646, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.725388526916504, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.673046, "t_first": 1794396621.7524362, "t1": 1794396629.097898, "ttft_s": 0.07939004898071289, "decode_tok_s": 34.715312034431385, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.6735234, "t_first": 1794396622.237534, "t1": 1794396628.9542232, "ttft_s": 0.5640106201171875, "decode_tok_s": 37.96513368883732, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.6738582, "t_first": 1794396621.8330178, "t1": 1794396629.1413789, "ttft_s": 0.15915966033935547, "decode_tok_s": 34.8915438269211, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.674379, "t_first": 1794396622.075771, "t1": 1794396629.4068346, "ttft_s": 0.40139198303222656, "decode_tok_s": 34.78349351187394, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.6746788, "t_first": 1794396621.913907, "t1": 1794396630.4599073, "ttft_s": 0.2392282485961914, "decode_tok_s": 29.838520099709516, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.675605, "t_first": 1794396621.9948194, "t1": 1794396630.7594275, "ttft_s": 0.3192143440246582, "decode_tok_s": 29.09428416973213, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.6764526, "t_first": 1794396622.3187327, "t1": 1794396629.3257856, "ttft_s": 0.642280101776123, "decode_tok_s": 36.391904513518504, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396621.6766663, "t_first": 1794396622.1565063, "t1": 1794396629.1419249, "ttft_s": 0.4798400402069092, "decode_tok_s": 36.50461284149623, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.087007522583008, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7602344, "t_first": 1794396630.9208832, "t1": 1794396637.9415677, "ttft_s": 0.16064882278442383, "decode_tok_s": 36.32124484474334, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7605772, "t_first": 1794396630.8400974, "t1": 1794396637.7073512, "ttft_s": 0.07952022552490234, "decode_tok_s": 37.132747406117694, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7612367, "t_first": 1794396631.1635997, "t1": 1794396638.1273098, "ttft_s": 0.4023630619049072, "decode_tok_s": 36.61841137113612, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7613702, "t_first": 1794396631.4064872, "t1": 1794396639.0705252, "ttft_s": 0.6451170444488525, "decode_tok_s": 33.272277864527965, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7615194, "t_first": 1794396631.0017645, "t1": 1794396639.8008683, "ttft_s": 0.24024510383605957, "decode_tok_s": 28.980224307537537, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7616463, "t_first": 1794396631.0827312, "t1": 1794396638.741722, "ttft_s": 0.32108497619628906, "decode_tok_s": 33.29420346122305, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7619405, "t_first": 1794396631.3252459, "t1": 1794396638.8283677, "ttft_s": 0.5633053779602051, "decode_tok_s": 33.98585348874468, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794396630.7621496, "t_first": 1794396631.2443297, "t1": 1794396637.9418626, "ttft_s": 0.482180118560791, "decode_tok_s": 38.07372119007291, "label": "p5-final-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.041279554367065, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8780832, "t_first": 1794396649.9766817, "t1": 1794396688.7041886, "ttft_s": 4.098598480224609, "decode_tok_s": 6.584467231947768, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8784692, "t_first": 1794396674.7178996, "t1": 1794396689.8667202, "ttft_s": 28.839430332183838, "decode_tok_s": 16.832993543358313, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8786552, "t_first": 1794396670.5883656, "t1": 1794396686.0053701, "ttft_s": 24.709710359573364, "decode_tok_s": 16.540177995646516, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8788676, "t_first": 1794396666.4639103, "t1": 1794396689.446413, "ttft_s": 20.585042715072632, "decode_tok_s": 11.095397369940203, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8794806, "t_first": 1794396662.3416557, "t1": 1794396689.698681, "ttft_s": 16.462175130844116, "decode_tok_s": 9.321188850477963, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8801012, "t_first": 1794396658.2191567, "t1": 1794396690.3117337, "ttft_s": 12.33905553817749, "decode_tok_s": 7.945762665124111, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8804038, "t_first": 1794396654.0956874, "t1": 1794396688.3600786, "ttft_s": 8.215283632278442, "decode_tok_s": 7.442128436829397, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396645.8807676, "t_first": 1794396678.8402395, "t1": 1794396689.1803677, "ttft_s": 32.95947194099426, "decode_tok_s": 24.66120298298065, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.434441566467285, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.312734, "t_first": 1794396694.416081, "t1": 1794396732.5506887, "ttft_s": 4.103347063064575, "decode_tok_s": 6.686839455423982, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.3132372, "t_first": 1794396702.6699202, "t1": 1794396734.409141, "ttft_s": 12.356683015823364, "decode_tok_s": 8.034223686331522, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.313586, "t_first": 1794396706.7980874, "t1": 1794396731.003198, "ttft_s": 16.484501361846924, "decode_tok_s": 10.534965311314044, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.314, "t_first": 1794396698.5413017, "t1": 1794396734.4085517, "ttft_s": 8.227301836013794, "decode_tok_s": 7.109549805019538, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.314324, "t_first": 1794396719.1934464, "t1": 1794396734.6316345, "ttft_s": 28.879122495651245, "decode_tok_s": 16.517482410782456, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.314564, "t_first": 1794396715.0653543, "t1": 1794396734.8219478, "ttft_s": 24.75079035758972, "decode_tok_s": 12.907083422117129, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.3147314, "t_first": 1794396710.935914, "t1": 1794396733.021583, "ttft_s": 20.621182680130005, "decode_tok_s": 11.54594862081432, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396690.3150575, "t_first": 1794396723.3234937, "t1": 1794396732.2775981, "ttft_s": 33.00843620300293, "decode_tok_s": 28.478559992007717, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.509854793548584, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8225865, "t_first": 1794396738.9259977, "t1": 1794396776.5781891, "ttft_s": 4.1034111976623535, "decode_tok_s": 6.772514175534134, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.822967, "t_first": 1794396743.0608702, "t1": 1794396778.3039014, "ttft_s": 8.237903118133545, "decode_tok_s": 7.235472967535845, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8233073, "t_first": 1794396751.3114014, "t1": 1794396774.7181382, "ttft_s": 16.488094091415405, "decode_tok_s": 10.894299432941002, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8235872, "t_first": 1794396747.1855915, "t1": 1794396778.304471, "ttft_s": 12.362004280090332, "decode_tok_s": 8.194382433845023, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8241878, "t_first": 1794396763.6947515, "t1": 1794396777.6313565, "ttft_s": 28.870563745498657, "decode_tok_s": 18.29713911150987, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8245182, "t_first": 1794396755.4389226, "t1": 1794396779.488018, "ttft_s": 20.614404439926147, "decode_tok_s": 10.603309431855706, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8247411, "t_first": 1794396759.5665386, "t1": 1794396778.7596455, "ttft_s": 24.74179744720459, "decode_tok_s": 13.286019895846952, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396734.8252118, "t_first": 1794396767.8241863, "t1": 1794396778.919895, "ttft_s": 32.998974561691284, "decode_tok_s": 22.981858031286816, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.66597938537598, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4887495, "t_first": 1794396783.5935984, "t1": 1794396820.963376, "ttft_s": 4.104848861694336, "decode_tok_s": 6.823695933847428, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4891813, "t_first": 1794396787.7167966, "t1": 1794396823.8861003, "ttft_s": 8.227615356445312, "decode_tok_s": 7.050177200753132, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4895382, "t_first": 1794396791.8412309, "t1": 1794396820.071427, "ttft_s": 12.35169267654419, "decode_tok_s": 9.032880885917756, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.48971, "t_first": 1794396800.1038597, "t1": 1794396824.0763028, "ttft_s": 20.614149570465088, "decode_tok_s": 10.637213691402273, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.490296, "t_first": 1794396804.2392561, "t1": 1794396821.8506804, "ttft_s": 24.748960256576538, "decode_tok_s": 14.479237851115563, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4905062, "t_first": 1794396795.9691596, "t1": 1794396823.1397753, "ttft_s": 16.47865343093872, "decode_tok_s": 9.385138823070063, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4914243, "t_first": 1794396812.4960072, "t1": 1794396822.877243, "ttft_s": 33.00458288192749, "decode_tok_s": 24.56354946374952, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794396779.4916217, "t_first": 1794396808.3666885, "t1": 1794396823.1405044, "ttft_s": 28.87506675720215, "decode_tok_s": 17.26026655800471, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.58805966377258, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9273615, "t_first": 1794396838.4999135, "t1": 1794396874.3760393, "ttft_s": 8.572551965713501, "decode_tok_s": 7.107790883901285, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9276497, "t_first": 1794396834.2000058, "t1": 1794396872.4747455, "ttft_s": 4.272356033325195, "decode_tok_s": 6.6623575161328095, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9280171, "t_first": 1794396842.8089247, "t1": 1794396875.1879513, "ttft_s": 12.880907535552979, "decode_tok_s": 7.875468362453464, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9284122, "t_first": 1794396847.1176553, "t1": 1794396874.507352, "ttft_s": 17.18924307823181, "decode_tok_s": 9.310070188891146, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.92891, "t_first": 1794396851.4189508, "t1": 1794396874.5660655, "ttft_s": 21.49004077911377, "decode_tok_s": 11.016491805268473, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9292884, "t_first": 1794396860.0272853, "t1": 1794396874.5080597, "ttft_s": 30.097996950149536, "decode_tok_s": 17.609555463683694, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.929519, "t_first": 1794396864.3275783, "t1": 1794396874.0955997, "ttft_s": 34.398059368133545, "decode_tok_s": 26.105594059426483, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396829.9296734, "t_first": 1794396855.7242918, "t1": 1794396874.857899, "ttft_s": 25.794618368148804, "decode_tok_s": 13.327335405842323, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.26129937171936, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.188726, "t_first": 1794396879.463564, "t1": 1794396920.5334458, "ttft_s": 4.274837970733643, "decode_tok_s": 6.208929466153898, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.1891139, "t_first": 1794396896.674646, "t1": 1794396918.9938807, "ttft_s": 21.48553204536438, "decode_tok_s": 11.425122847461486, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.18934, "t_first": 1794396883.7665048, "t1": 1794396918.4402828, "ttft_s": 8.577164649963379, "decode_tok_s": 7.354260605235564, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.1896188, "t_first": 1794396888.0683267, "t1": 1794396918.93121, "ttft_s": 12.878707885742188, "decode_tok_s": 8.26235181199539, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.190099, "t_first": 1794396900.98016, "t1": 1794396918.6541893, "ttft_s": 25.790060997009277, "decode_tok_s": 14.427949334368916, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.1902616, "t_first": 1794396892.3717556, "t1": 1794396920.360831, "ttft_s": 17.181493997573853, "decode_tok_s": 9.110697518680807, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.1904092, "t_first": 1794396905.290619, "t1": 1794396919.3317935, "ttft_s": 30.100209712982178, "decode_tok_s": 18.16087374118008, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396875.1910894, "t_first": 1794396909.594895, "t1": 1794396920.79915, "ttft_s": 34.40380549430847, "decode_tok_s": 22.75921046348589, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.61073446273804, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.799702, "t_first": 1794396925.070378, "t1": 1794396965.8459606, "ttft_s": 4.270676136016846, "decode_tok_s": 6.253742657755519, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8001246, "t_first": 1794396937.987612, "t1": 1794396963.6599016, "ttft_s": 17.187487363815308, "decode_tok_s": 9.93288888037374, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8004436, "t_first": 1794396933.682807, "t1": 1794396966.4958687, "ttft_s": 12.882363319396973, "decode_tok_s": 7.7712955353344055, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8009794, "t_first": 1794396929.3761148, "t1": 1794396963.4475002, "ttft_s": 8.575135469436646, "decode_tok_s": 7.484286216394879, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8016596, "t_first": 1794396942.2884052, "t1": 1794396963.7934964, "ttft_s": 21.486745595932007, "decode_tok_s": 11.857657228376093, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8018253, "t_first": 1794396955.1958284, "t1": 1794396966.2351093, "ttft_s": 34.39400315284729, "decode_tok_s": 23.09933069990346, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8019962, "t_first": 1794396946.588385, "t1": 1794396963.7942605, "ttft_s": 25.786388874053955, "decode_tok_s": 14.820518812340412, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396920.8026538, "t_first": 1794396950.8921335, "t1": 1794396966.1844516, "ttft_s": 30.089479684829712, "decode_tok_s": 16.675038946841667, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.69671297073364, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.496602, "t_first": 1794396970.7710865, "t1": 1794397011.1599188, "ttft_s": 4.274484395980835, "decode_tok_s": 6.313626447827462, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4970455, "t_first": 1794396975.0809994, "t1": 1794397010.88983, "ttft_s": 8.583953857421875, "decode_tok_s": 7.1211484637758575, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4974573, "t_first": 1794396979.3849077, "t1": 1794397011.9174197, "ttft_s": 12.887450456619263, "decode_tok_s": 7.838312651526191, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4976082, "t_first": 1794396983.6878245, "t1": 1794397010.268423, "ttft_s": 17.190216302871704, "decode_tok_s": 9.593463409416, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.498081, "t_first": 1794396992.2949693, "t1": 1794397009.9188783, "ttft_s": 25.79688835144043, "decode_tok_s": 14.468980749358982, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4984155, "t_first": 1794396987.993391, "t1": 1794397011.4295259, "ttft_s": 21.494975566864014, "decode_tok_s": 10.880633773895156, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4989233, "t_first": 1794396996.5959446, "t1": 1794397009.847349, "ttft_s": 30.097021341323853, "decode_tok_s": 19.243243546675018, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794396966.4992163, "t_first": 1794397000.8982403, "t1": 1794397011.7852836, "ttft_s": 34.39902400970459, "decode_tok_s": 23.42233739986465, "label": "p5-final-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.421610593795776, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/limits.out b/docs/receipts/xpu-qwen27-sampled-topk/limits.out new file mode 100644 index 00000000000..91a1ed9481f --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/limits.out @@ -0,0 +1,31 @@ +PASS limits bmg-g31 add_rmsnorm: 128 work-items, 10272 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD add_rmsnorm: .usage = .{ .{ .threads = .{ 128, 1, 1 }, .slm = 10272, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 add_rmsnorm_dec: 512 work-items, 10368 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD add_rmsnorm_dec: .usage = .{ .{ .threads = .{ 512, 1, 1 }, .slm = 10368, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 gated_norm: 256 work-items, 12288 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD gated_norm: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 12288, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 swiglu: 256 work-items, 2048 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD swiglu: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 2048, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 argmax: 256 work-items, 2048 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD argmax: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 2048, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 topk_part: 256 work-items, 192 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD topk_part: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 topk_merge: 256 work-items, 192 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD topk_merge: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +PASS limits bmg-g31 embed: 256 work-items, 0 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current) +RECORD embed: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 0, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: 2048 work-items a work-group: 256 work-items, 0 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current): control: 2048 work-items a work-group on bmg-g31: 2048 work-items a work-group, the most is 1024 +control: 2048 work-items a work-group on bmg-g31: a work-group dimension of 2048, the most is 1024 +control: 2048 work-items a work-group on bmg-g31: 2048 work-items at 256 GRF and sub-group 16, a Xe-core holds 512 +RECORD control: 2048 work-items a work-group: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 0, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: 200 work-items, not a multiple of sub-group 16: 256 work-items, 0 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current): control: 200 work-items, not a multiple of sub-group 16 on bmg-g31: 200 work-items are not a multiple of sub-group 16 +RECORD control: 200 work-items, not a multiple of sub-group 16: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 0, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: 160 KiB of SLM: 256 work-items, 163840 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current): control: 160 KiB of SLM on bmg-g31: 163840 SLM bytes a work-group, the most is 131072 +RECORD control: 160 KiB of SLM: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 163840, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: 1024 work-items at 256 GRF: 1024 work-items, 0 SLM bytes, sub-group 16, 256 GRF, 0 spill bytes, 0 private bytes (record current): control: 1024 work-items at 256 GRF on bmg-g31: 1024 work-items at 256 GRF and sub-group 16, a Xe-core holds 512 +RECORD control: 1024 work-items at 256 GRF: .usage = .{ .{ .threads = .{ 1024, 1, 1 }, .slm = 0, .sub_group = 16, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: sub-group 32 at 256 GRF: 256 work-items, 0 SLM bytes, sub-group 32, 256 GRF, 0 spill bytes, 0 private bytes (record current): control: sub-group 32 at 256 GRF on bmg-g31: sub-group 32 at 256 GRF (the most is 16) +RECORD control: sub-group 32 at 256 GRF: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 0, .sub_group = 32, .grf = 256, .spill = 0, .private = 0 }, } +RED limits bmg-g31 control: sub-group 8: declared only, ocloc does not build it for this device: control: sub-group 8 on bmg-g31: sub-group 8, the device runs { 16, 32 } +RECORD control: sub-group 8: .usage = .{ .{ .threads = .{ 256, 1, 1 }, .slm = 0, .sub_group = 8, .grf = 256, .spill = 0, .private = 0 }, } +PASS xpu-kernel-contract-limits: every registered launch fits bmg-g31, every record current, every control red diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1-greedy.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1-greedy.jsonl new file mode 100644 index 00000000000..b93201b207a --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1-greedy.jsonl @@ -0,0 +1,2 @@ +{"ok": true, "token_sha256": "5d721308b699d401dae7698a19eb8af0418c8a4ab835f68c3c71c394b8e9102f", "text_sha256": "ef79dee7153a363aadcf383ed572fbe239fe1f0074f21a92400f0b7efab01337", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389341.522845, "t_first": 1794389341.6106522, "t1": 1794389343.60315, "ttft_s": 0.08780717849731445, "decode_tok_s": 127.98007356822147, "label": "p1-main-par1-greedy", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 2.080845594406128, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "356fb0b3163a59e43a18c611211d279e96191c0ab6e4f01e8eb13b7445e099f6", "text_sha256": "5d3300bf0d0b7e170a26c73e967ef7ef9a3319996f826e21759a8b4143449b62", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389343.6037295, "t_first": 1794389343.6822634, "t1": 1794389346.991023, "ttft_s": 0.07853388786315918, "decode_tok_s": 77.06815361122656, "label": "p1-main-par1-greedy", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 3.3877813816070557, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1.jsonl new file mode 100644 index 00000000000..ddadb383810 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par1.jsonl @@ -0,0 +1,16 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389347.0291216, "t_first": 1794389347.110416, "t1": 1794389348.8224132, "ttft_s": 0.08129429817199707, "decode_tok_s": 148.9488355977332, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7937989234924316, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389348.8232462, "t_first": 1794389348.899665, "t1": 1794389350.5658078, "ttft_s": 0.07641887664794922, "decode_tok_s": 153.04811507333176, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7430415153503418, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389350.566302, "t_first": 1794389350.64266, "t1": 1794389352.31025, "ttft_s": 0.07635784149169922, "decode_tok_s": 152.91527197550033, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7442588806152344, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389352.310598, "t_first": 1794389352.38771, "t1": 1794389354.0542133, "ttft_s": 0.07711219787597656, "decode_tok_s": 153.01500853884528, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7440297603607178, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389354.0549605, "t_first": 1794389354.1343217, "t1": 1794389357.4150617, "ttft_s": 0.0793612003326416, "decode_tok_s": 77.72636607557283, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.3603644371032715, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389357.4154012, "t_first": 1794389357.4946105, "t1": 1794389360.6718884, "ttft_s": 0.0792093276977539, "decode_tok_s": 80.25738250694914, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.256843090057373, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389360.6724246, "t_first": 1794389360.751543, "t1": 1794389363.929919, "ttft_s": 0.07911849021911621, "decode_tok_s": 80.2296528974595, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2578883171081543, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389363.9303849, "t_first": 1794389364.0094993, "t1": 1794389367.1873205, "ttft_s": 0.07911443710327148, "decode_tok_s": 80.24365979460336, "label": "p1-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2573728561401367, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389373.2845721, "t_first": 1794389377.356184, "t1": 1794389381.3782983, "ttft_s": 4.0716118812561035, "decode_tok_s": 63.39949152251012, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.094355583190918, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389381.379057, "t_first": 1794389385.460099, "t1": 1794389389.3789852, "ttft_s": 4.081042051315308, "decode_tok_s": 65.06950903449534, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.000493049621582, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389389.3795748, "t_first": 1794389393.4627512, "t1": 1794389397.384007, "ttft_s": 4.083176374435425, "decode_tok_s": 65.03018707614834, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.004973888397217, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389397.3846383, "t_first": 1794389401.4691577, "t1": 1794389405.389785, "ttft_s": 4.084519386291504, "decode_tok_s": 65.04061132904204, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.005674123764038, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389411.3048842, "t_first": 1794389415.5607016, "t1": 1794389419.832769, "ttft_s": 4.255817413330078, "decode_tok_s": 59.69007077605197, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.528337001800537, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389419.8333192, "t_first": 1794389424.088835, "t1": 1794389428.2894466, "ttft_s": 4.255515813827515, "decode_tok_s": 60.70544597023993, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.45652437210083, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389428.2899482, "t_first": 1794389432.5495567, "t1": 1794389436.7534, "ttft_s": 4.259608507156372, "decode_tok_s": 60.65877780290227, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.463940620422363, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389436.7539709, "t_first": 1794389441.0105188, "t1": 1794389445.2128935, "ttft_s": 4.256547927856445, "decode_tok_s": 60.67997701355103, "label": "p1-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.4594407081604, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par4.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par4.jsonl new file mode 100644 index 00000000000..783f3eb230b --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par4.jsonl @@ -0,0 +1,64 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389474.6455631, "t_first": 1794389475.1058722, "t1": 1794389478.3873565, "ttft_s": 0.4603090286254883, "decode_tok_s": 77.70873531619003, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.798287630081177, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389474.6460042, "t_first": 1794389474.906176, "t1": 1794389479.3530643, "ttft_s": 0.26017189025878906, "decode_tok_s": 57.34346987156759, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.798287630081177, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389474.6463554, "t_first": 1794389475.0235858, "t1": 1794389479.1682084, "ttft_s": 0.3772304058074951, "decode_tok_s": 61.52550589177618, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.798287630081177, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389474.6465502, "t_first": 1794389474.788547, "t1": 1794389479.443345, "ttft_s": 0.1419968605041504, "decode_tok_s": 54.78218352542697, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.798287630081177, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389479.443799, "t_first": 1794389479.521295, "t1": 1794389482.8197289, "ttft_s": 0.07749605178833008, "decode_tok_s": 77.30941924448453, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.651015758514404, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389479.4440844, "t_first": 1794389479.5996733, "t1": 1794389483.79446, "ttft_s": 0.15558886528015137, "decode_tok_s": 60.78974044360387, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.651015758514404, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389479.4442387, "t_first": 1794389479.7572644, "t1": 1794389483.3737001, "ttft_s": 0.31302571296691895, "decode_tok_s": 70.51141413373605, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.651015758514404, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389479.444466, "t_first": 1794389479.6786587, "t1": 1794389484.0944352, "ttft_s": 0.2341926097869873, "decode_tok_s": 57.74748801489155, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.651015758514404, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389484.0949981, "t_first": 1794389484.3304234, "t1": 1794389487.455881, "ttft_s": 0.23542523384094238, "decode_tok_s": 81.5880486256896, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.711348533630371, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389484.0952594, "t_first": 1794389484.172987, "t1": 1794389488.2399893, "ttft_s": 0.0777275562286377, "decode_tok_s": 62.69974330300352, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.711348533630371, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389484.0954087, "t_first": 1794389484.2518063, "t1": 1794389488.0097685, "ttft_s": 0.15639758110046387, "decode_tok_s": 67.85592419659491, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.711348533630371, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389484.0956614, "t_first": 1794389484.4085405, "t1": 1794389488.8058789, "ttft_s": 0.3128790855407715, "decode_tok_s": 57.98962403247839, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.711348533630371, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389488.806643, "t_first": 1794389488.884338, "t1": 1794389492.1404386, "ttft_s": 0.07769489288330078, "decode_tok_s": 78.31453233473988, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.590954780578613, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389488.8070078, "t_first": 1794389488.9632883, "t1": 1794389493.0537446, "ttft_s": 0.156280517578125, "decode_tok_s": 62.34023409160442, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.590954780578613, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389488.8072639, "t_first": 1794389489.0424392, "t1": 1794389492.6933749, "ttft_s": 0.23517537117004395, "decode_tok_s": 69.84510943350982, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.590954780578613, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389488.8074284, "t_first": 1794389489.1215, "t1": 1794389493.3972528, "ttft_s": 0.3140716552734375, "decode_tok_s": 59.638621069134956, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.590954780578613, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389493.3976433, "t_first": 1794389493.4767828, "t1": 1794389499.382452, "ttft_s": 0.07913947105407715, "decode_tok_s": 43.178849141620816, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.985260009765625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389493.397904, "t_first": 1794389493.670253, "t1": 1794389499.1215014, "ttft_s": 0.27234911918640137, "decode_tok_s": 46.77827553327598, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.985260009765625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389493.3981209, "t_first": 1794389493.5891037, "t1": 1794389499.218824, "ttft_s": 0.19098281860351562, "decode_tok_s": 45.29532382451893, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.985260009765625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389493.3982637, "t_first": 1794389493.751239, "t1": 1794389499.3826504, "ttft_s": 0.35297536849975586, "decode_tok_s": 45.28172171788891, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.985260009765625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389499.383053, "t_first": 1794389499.462093, "t1": 1794389505.2031863, "ttft_s": 0.0790400505065918, "decode_tok_s": 44.416628149048854, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.820446491241455, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389499.3834128, "t_first": 1794389499.5431995, "t1": 1794389504.8626776, "ttft_s": 0.15978670120239258, "decode_tok_s": 47.93703410813828, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.820446491241455, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389499.383545, "t_first": 1794389499.624271, "t1": 1794389504.9954953, "ttft_s": 0.24072599411010742, "decode_tok_s": 47.475208788422584, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.820446491241455, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389499.3836942, "t_first": 1794389499.7053583, "t1": 1794389505.1602511, "ttft_s": 0.32166409492492676, "decode_tok_s": 46.74702251742708, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.820446491241455, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389505.2035663, "t_first": 1794389505.282963, "t1": 1794389511.0590591, "ttft_s": 0.07939672470092773, "decode_tok_s": 44.14746488616301, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.8557374477386475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389505.2038133, "t_first": 1794389505.3641944, "t1": 1794389510.8036034, "ttft_s": 0.16038107872009277, "decode_tok_s": 46.88009288815223, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.8557374477386475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389505.2041416, "t_first": 1794389505.445225, "t1": 1794389510.892879, "ttft_s": 0.24108338356018066, "decode_tok_s": 46.80914015189296, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.8557374477386475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389505.2044294, "t_first": 1794389505.526606, "t1": 1794389511.0162814, "ttft_s": 0.3221766948699951, "decode_tok_s": 46.45083485531414, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.8557374477386475, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389511.0596771, "t_first": 1794389511.2204041, "t1": 1794389516.8704765, "ttft_s": 0.16072702407836914, "decode_tok_s": 45.13216554173219, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.8111724853515625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389511.0600815, "t_first": 1794389511.1395218, "t1": 1794389516.4041421, "ttft_s": 0.07944035530090332, "decode_tok_s": 48.43654153007746, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.8111724853515625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389511.060397, "t_first": 1794389511.3012831, "t1": 1794389516.7822115, "ttft_s": 0.24088621139526367, "decode_tok_s": 46.52496446076939, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.8111724853515625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389511.060614, "t_first": 1794389511.3822951, "t1": 1794389516.7427297, "ttft_s": 0.32168102264404297, "decode_tok_s": 47.57077033025235, "label": "p1-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.8111724853515625, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389522.9488037, "t_first": 1794389527.0430427, "t1": 1794389545.9420137, "ttft_s": 4.094238996505737, "decode_tok_s": 13.492798042287665, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.240596771240234, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389522.949377, "t_first": 1794389535.2712169, "t1": 1794389546.9965334, "ttft_s": 12.321839809417725, "decode_tok_s": 21.74781375556527, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.240596771240234, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389522.9497097, "t_first": 1794389531.156797, "t1": 1794389544.9992, "ttft_s": 8.207087278366089, "decode_tok_s": 18.421656760377896, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.240596771240234, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389522.9504254, "t_first": 1794389539.3919427, "t1": 1794389547.1889277, "ttft_s": 16.44151735305786, "decode_tok_s": 32.70494978660166, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.240596771240234, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389547.1893709, "t_first": 1794389551.285856, "t1": 1794389570.077327, "ttft_s": 4.096485137939453, "decode_tok_s": 13.569986082469217, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.131676197052002, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389547.1898806, "t_first": 1794389555.404937, "t1": 1794389571.1288252, "ttft_s": 8.215056419372559, "decode_tok_s": 16.217362870093687, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.131676197052002, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389547.1902397, "t_first": 1794389559.5232096, "t1": 1794389569.1491883, "ttft_s": 12.332969903945923, "decode_tok_s": 26.4908128023382, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.131676197052002, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389547.1906002, "t_first": 1794389563.646316, "t1": 1794389571.3207057, "ttft_s": 16.455715894699097, "decode_tok_s": 33.22739830343689, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.131676197052002, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389571.32121, "t_first": 1794389575.4160123, "t1": 1794389594.211567, "ttft_s": 4.094802379608154, "decode_tok_s": 13.56703778699289, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.134982585906982, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389571.3217156, "t_first": 1794389579.537817, "t1": 1794389595.2634864, "ttft_s": 8.21610140800476, "decode_tok_s": 16.21552595143612, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.134982585906982, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389571.3221734, "t_first": 1794389583.65676, "t1": 1794389593.2815762, "ttft_s": 12.33458662033081, "decode_tok_s": 26.494012482968227, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.134982585906982, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389571.3223133, "t_first": 1794389587.7778578, "t1": 1794389595.4558275, "ttft_s": 16.455544471740723, "decode_tok_s": 33.211904990286996, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.134982585906982, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389595.4563997, "t_first": 1794389599.5512435, "t1": 1794389618.3525414, "ttft_s": 4.094843864440918, "decode_tok_s": 13.562893440377069, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.140004873275757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389595.4568253, "t_first": 1794389603.6729472, "t1": 1794389619.4039493, "ttft_s": 8.216121912002563, "decode_tok_s": 16.210028992610784, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.140004873275757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389595.4572487, "t_first": 1794389607.7954886, "t1": 1794389617.4225607, "ttft_s": 12.338239908218384, "decode_tok_s": 26.487804127837464, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.140004873275757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389595.4576712, "t_first": 1794389611.9184964, "t1": 1794389619.5959482, "ttft_s": 16.460825204849243, "decode_tok_s": 33.21414513771954, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.140004873275757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389625.5126624, "t_first": 1794389629.778797, "t1": 1794389649.46316, "ttft_s": 4.26613450050354, "decode_tok_s": 12.954445026133811, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.469017505645752, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389625.5130904, "t_first": 1794389638.3655977, "t1": 1794389649.6009886, "ttft_s": 12.85250735282898, "decode_tok_s": 22.696139567735734, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.469017505645752, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389625.5134113, "t_first": 1794389634.071678, "t1": 1794389649.981262, "ttft_s": 8.558266639709473, "decode_tok_s": 16.02807460409792, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.469017505645752, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389625.513765, "t_first": 1794389642.6652038, "t1": 1794389649.844887, "ttft_s": 17.15143871307373, "decode_tok_s": 35.51688738847545, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.469017505645752, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389649.9817612, "t_first": 1794389654.2524135, "t1": 1794389673.9152799, "ttft_s": 4.2706522941589355, "decode_tok_s": 12.96860769987753, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.45071578025818, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389649.982198, "t_first": 1794389662.848335, "t1": 1794389674.0527928, "ttft_s": 12.866137027740479, "decode_tok_s": 22.75879881609286, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.45071578025818, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389649.9824476, "t_first": 1794389658.550489, "t1": 1794389674.4320052, "ttft_s": 8.568041324615479, "decode_tok_s": 16.05640144786727, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.45071578025818, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389649.982882, "t_first": 1794389667.148528, "t1": 1794389674.2995052, "ttft_s": 17.165646076202393, "decode_tok_s": 35.65946236388493, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.45071578025818, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389674.4327343, "t_first": 1794389678.704044, "t1": 1794389698.3636842, "ttft_s": 4.271309852600098, "decode_tok_s": 12.970735936317643, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.448631763458252, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389674.4332154, "t_first": 1794389683.003726, "t1": 1794389698.5036862, "ttft_s": 8.570510625839233, "decode_tok_s": 16.45165516370977, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.448631763458252, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389674.4337482, "t_first": 1794389687.3031409, "t1": 1794389698.8807812, "ttft_s": 12.86939263343811, "decode_tok_s": 22.025213558370286, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.448631763458252, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389674.434207, "t_first": 1794389691.602433, "t1": 1794389698.7479308, "ttft_s": 17.16822600364685, "decode_tok_s": 35.68680687838897, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.448631763458252, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389698.8813827, "t_first": 1794389703.1468868, "t1": 1794389722.816949, "ttft_s": 4.2655041217803955, "decode_tok_s": 12.96386351785443, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.45089030265808, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389698.8819346, "t_first": 1794389707.4477992, "t1": 1794389722.9545317, "ttft_s": 8.565864562988281, "decode_tok_s": 16.444470206388534, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.45089030265808, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389698.8823283, "t_first": 1794389716.05354, "t1": 1794389723.3319044, "ttft_s": 17.17121171951294, "decode_tok_s": 35.035343833773375, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.45089030265808, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794389698.8826501, "t_first": 1794389711.7493172, "t1": 1794389723.1987176, "ttft_s": 12.866667032241821, "decode_tok_s": 22.271908618389645, "label": "p1-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.45089030265808, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par8.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par8.jsonl new file mode 100644 index 00000000000..f30ec536717 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p1-main-par8.jsonl @@ -0,0 +1,128 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.697337, "t_first": 1794389752.840262, "t1": 1794389759.5065007, "ttft_s": 0.14292502403259277, "decode_tok_s": 38.252455129842986, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.697696, "t_first": 1794389752.9668803, "t1": 1794389760.8109694, "ttft_s": 0.2691843509674072, "decode_tok_s": 32.50855503871765, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.697978, "t_first": 1794389753.3748162, "t1": 1794389760.9589453, "ttft_s": 0.6768381595611572, "decode_tok_s": 33.62284539242719, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.6981604, "t_first": 1794389753.6415882, "t1": 1794389761.0928307, "ttft_s": 0.9434278011322021, "decode_tok_s": 34.222480588604355, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.6983156, "t_first": 1794389753.2378988, "t1": 1794389761.4829588, "ttft_s": 0.5395832061767578, "decode_tok_s": 30.927610110701757, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.6985412, "t_first": 1794389753.719997, "t1": 1794389760.2362437, "ttft_s": 1.0214557647705078, "decode_tok_s": 39.13295613205752, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.6987205, "t_first": 1794389753.5104551, "t1": 1794389760.0316076, "ttft_s": 0.811734676361084, "decode_tok_s": 39.10351738334617, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389752.6990259, "t_first": 1794389753.097798, "t1": 1794389760.0313647, "ttft_s": 0.3987722396850586, "decode_tok_s": 36.77760895712138, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.786171436309814, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4836366, "t_first": 1794389761.5605304, "t1": 1794389768.5139105, "ttft_s": 0.07689380645751953, "decode_tok_s": 36.67281178991373, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.483999, "t_first": 1794389761.7179403, "t1": 1794389768.9726975, "ttft_s": 0.23394131660461426, "decode_tok_s": 35.14935016685094, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4842308, "t_first": 1794389761.6388237, "t1": 1794389768.827799, "ttft_s": 0.15459299087524414, "decode_tok_s": 35.470979958443586, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.484426, "t_first": 1794389761.7966168, "t1": 1794389769.415077, "ttft_s": 0.3121907711029053, "decode_tok_s": 33.47133069275723, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4845927, "t_first": 1794389761.8746576, "t1": 1794389769.1478047, "ttft_s": 0.39006495475769043, "decode_tok_s": 35.06047606044623, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4850805, "t_first": 1794389761.9528866, "t1": 1794389768.9286788, "ttft_s": 0.4678061008453369, "decode_tok_s": 36.5549881363058, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4854112, "t_first": 1794389762.0326064, "t1": 1794389767.631094, "ttft_s": 0.5471951961517334, "decode_tok_s": 45.548015376531204, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389761.4855132, "t_first": 1794389762.110996, "t1": 1794389768.9727829, "ttft_s": 0.6254827976226807, "decode_tok_s": 37.16233189091751, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.931915760040283, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4158278, "t_first": 1794389769.4925318, "t1": 1794389775.6874876, "ttft_s": 0.07670402526855469, "decode_tok_s": 41.16252111722473, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4163094, "t_first": 1794389769.5705154, "t1": 1794389776.8917737, "ttft_s": 0.1542060375213623, "decode_tok_s": 34.830078290433995, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4166033, "t_first": 1794389769.6485965, "t1": 1794389776.893193, "ttft_s": 0.2319931983947754, "decode_tok_s": 35.198647800108205, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4168062, "t_first": 1794389770.0398233, "t1": 1794389777.2545106, "ttft_s": 0.6230170726776123, "decode_tok_s": 35.34456695361413, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4171, "t_first": 1794389769.7270303, "t1": 1794389777.3834827, "ttft_s": 0.30993032455444336, "decode_tok_s": 33.305241918746354, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4175124, "t_first": 1794389769.9617405, "t1": 1794389776.353428, "ttft_s": 0.5442280769348145, "decode_tok_s": 39.89556815180755, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.4181418, "t_first": 1794389769.8051398, "t1": 1794389775.9963698, "ttft_s": 0.38699793815612793, "decode_tok_s": 41.187291957097344, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389769.418566, "t_first": 1794389769.8832924, "t1": 1794389776.5022483, "ttft_s": 0.46472644805908203, "decode_tok_s": 38.52571398808144, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.968308210372925, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.384269, "t_first": 1794389777.461579, "t1": 1794389784.3783429, "ttft_s": 0.07731008529663086, "decode_tok_s": 36.86695223640955, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3845015, "t_first": 1794389777.6188722, "t1": 1794389784.8296537, "ttft_s": 0.23437070846557617, "decode_tok_s": 35.36371159967478, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3846104, "t_first": 1794389777.5402205, "t1": 1794389784.6848989, "ttft_s": 0.1556100845336914, "decode_tok_s": 35.69089990563939, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3850346, "t_first": 1794389777.6976166, "t1": 1794389785.3020086, "ttft_s": 0.31258201599121094, "decode_tok_s": 33.53325266062545, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3852942, "t_first": 1794389777.7766967, "t1": 1794389785.0486777, "ttft_s": 0.3914024829864502, "decode_tok_s": 35.06609821566243, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3853827, "t_first": 1794389777.8553534, "t1": 1794389784.7852821, "ttft_s": 0.469970703125, "decode_tok_s": 36.79691496261572, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.3854754, "t_first": 1794389777.934357, "t1": 1794389783.4955719, "ttft_s": 0.5488815307617188, "decode_tok_s": 45.85328988203688, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794389777.38619, "t_first": 1794389778.0123854, "t1": 1794389784.829788, "ttft_s": 0.6261954307556152, "decode_tok_s": 37.404274753194336, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.91821551322937, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3026433, "t_first": 1794389785.713995, "t1": 1794389793.561986, "ttft_s": 0.41135168075561523, "decode_tok_s": 32.4923920446847, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.302851, "t_first": 1794389785.46758, "t1": 1794389793.7207973, "ttft_s": 0.16472911834716797, "decode_tok_s": 30.89704211014735, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3030226, "t_first": 1794389785.3821576, "t1": 1794389793.2412548, "ttft_s": 0.07913494110107422, "decode_tok_s": 32.44647472049567, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3032541, "t_first": 1794389785.5482767, "t1": 1794389795.0038397, "ttft_s": 0.24502253532409668, "decode_tok_s": 26.968251193043102, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3035758, "t_first": 1794389785.6292315, "t1": 1794389794.9123094, "ttft_s": 0.3256556987762451, "decode_tok_s": 27.469337350107743, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3037724, "t_first": 1794389785.7950292, "t1": 1794389794.600203, "ttft_s": 0.4912567138671875, "decode_tok_s": 28.96024583407976, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3040543, "t_first": 1794389785.8760138, "t1": 1794389794.078055, "ttft_s": 0.5719594955444336, "decode_tok_s": 31.089822077612446, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389785.3043742, "t_first": 1794389785.9572017, "t1": 1794389793.721084, "ttft_s": 0.6528275012969971, "decode_tok_s": 32.84439239391448, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.701690912246704, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0043995, "t_first": 1794389795.2520652, "t1": 1794389803.2646728, "ttft_s": 0.2476656436920166, "decode_tok_s": 31.824845735951747, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.004504, "t_first": 1794389795.171228, "t1": 1794389802.4261696, "ttft_s": 0.16672396659851074, "decode_tok_s": 35.14845611145341, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0046036, "t_first": 1794389795.09015, "t1": 1794389803.0613859, "ttft_s": 0.08554649353027344, "decode_tok_s": 31.990021112176766, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0049012, "t_first": 1794389795.4951766, "t1": 1794389803.820082, "ttft_s": 0.49027538299560547, "decode_tok_s": 30.630978718100522, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0050173, "t_first": 1794389795.6572404, "t1": 1794389804.524358, "ttft_s": 0.6522231101989746, "decode_tok_s": 28.75793580917001, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0050905, "t_first": 1794389795.4141157, "t1": 1794389804.2788758, "ttft_s": 0.4090251922607422, "decode_tok_s": 28.765583657614233, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0051548, "t_first": 1794389795.333035, "t1": 1794389804.365433, "ttft_s": 0.3278801441192627, "decode_tok_s": 28.231705512814525, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389795.0053904, "t_first": 1794389795.5762222, "t1": 1794389803.1131968, "ttft_s": 0.5708317756652832, "decode_tok_s": 33.8332038006776, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.520540475845337, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5253112, "t_first": 1794389804.6861598, "t1": 1794389812.4393365, "ttft_s": 0.16084861755371094, "decode_tok_s": 32.88974445235089, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5256388, "t_first": 1794389804.6054976, "t1": 1794389812.1789753, "ttft_s": 0.07985877990722656, "decode_tok_s": 33.67013261067018, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5262482, "t_first": 1794389804.8482175, "t1": 1794389812.6450849, "ttft_s": 0.32196927070617676, "decode_tok_s": 32.705442824558126, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5267618, "t_first": 1794389804.767343, "t1": 1794389813.6570017, "ttft_s": 0.24058127403259277, "decode_tok_s": 28.68501580395029, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5270374, "t_first": 1794389804.929059, "t1": 1794389814.3846304, "ttft_s": 0.4020216464996338, "decode_tok_s": 26.96822739325198, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5280905, "t_first": 1794389805.010013, "t1": 1794389813.298466, "ttft_s": 0.48192262649536133, "decode_tok_s": 30.76569345251425, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5283337, "t_first": 1794389805.0910711, "t1": 1794389813.394291, "ttft_s": 0.5627374649047852, "decode_tok_s": 30.710977944553743, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389804.5285783, "t_first": 1794389805.172088, "t1": 1794389812.4395108, "ttft_s": 0.6435096263885498, "decode_tok_s": 35.08809147339521, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.860059022903442, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.385547, "t_first": 1794389814.5463152, "t1": 1794389822.2929552, "ttft_s": 0.1607682704925537, "decode_tok_s": 32.917497274616956, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.385862, "t_first": 1794389814.4653924, "t1": 1794389822.0315974, "ttft_s": 0.07953023910522461, "decode_tok_s": 33.70249671624017, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.3864136, "t_first": 1794389814.7081475, "t1": 1794389822.4991508, "ttft_s": 0.3217339515686035, "decode_tok_s": 32.73005960370203, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.3867176, "t_first": 1794389814.6272151, "t1": 1794389823.5085504, "ttft_s": 0.24049758911132812, "decode_tok_s": 28.7118988956544, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.3875678, "t_first": 1794389814.8700995, "t1": 1794389824.225797, "ttft_s": 0.4825317859649658, "decode_tok_s": 27.256118841489812, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.3878932, "t_first": 1794389814.950848, "t1": 1794389823.149039, "ttft_s": 0.5629549026489258, "decode_tok_s": 31.104423189810998, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.3882582, "t_first": 1794389814.7890787, "t1": 1794389823.2429676, "ttft_s": 0.4008204936981201, "decode_tok_s": 30.16363276400537, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794389814.388462, "t_first": 1794389815.0317235, "t1": 1794389822.2935421, "ttft_s": 0.6432614326477051, "decode_tok_s": 35.11517050785049, "label": "p1-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.840914249420166, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3279617, "t_first": 1794389838.5538409, "t1": 1794389873.7126691, "ttft_s": 8.225879192352295, "decode_tok_s": 7.252801433683921, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3283792, "t_first": 1794389842.6728606, "t1": 1794389874.7083507, "ttft_s": 12.344481468200684, "decode_tok_s": 7.959921940115706, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3287854, "t_first": 1794389834.4369392, "t1": 1794389871.3305278, "ttft_s": 4.108153820037842, "decode_tok_s": 6.911770041106758, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3291028, "t_first": 1794389855.0367103, "t1": 1794389875.2741683, "ttft_s": 24.70760750770569, "decode_tok_s": 12.600396755257481, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.329514, "t_first": 1794389846.7922475, "t1": 1794389873.713307, "ttft_s": 16.462733507156372, "decode_tok_s": 9.472138391544012, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3297172, "t_first": 1794389850.912878, "t1": 1794389875.4682899, "ttft_s": 20.583160877227783, "decode_tok_s": 10.384676172995368, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3301113, "t_first": 1794389863.284551, "t1": 1794389874.2066536, "ttft_s": 32.954439640045166, "decode_tok_s": 23.347152763860276, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389830.3305295, "t_first": 1794389859.159755, "t1": 1794389873.7740626, "ttft_s": 28.829225540161133, "decode_tok_s": 17.448654171440364, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.140934228897095, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.468957, "t_first": 1794389879.5673738, "t1": 1794389918.3299904, "ttft_s": 4.098416805267334, "decode_tok_s": 6.5785032627003845, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4693365, "t_first": 1794389887.8213112, "t1": 1794389920.3283007, "ttft_s": 12.351974725723267, "decode_tok_s": 7.844466808106742, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4696083, "t_first": 1794389896.0705185, "t1": 1794389916.698993, "ttft_s": 20.600910186767578, "decode_tok_s": 12.361553944378114, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4698818, "t_first": 1794389883.697191, "t1": 1794389920.3278446, "ttft_s": 8.227309226989746, "decode_tok_s": 6.961382743724771, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.470087, "t_first": 1794389891.9452744, "t1": 1794389920.5745173, "ttft_s": 16.475187301635742, "decode_tok_s": 8.906976720170999, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4704406, "t_first": 1794389904.3248181, "t1": 1794389920.7655375, "ttft_s": 28.854377508163452, "decode_tok_s": 15.510270221277999, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4707553, "t_first": 1794389900.1995676, "t1": 1794389918.8360937, "ttft_s": 24.728812217712402, "decode_tok_s": 13.682807542841212, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389875.4710443, "t_first": 1794389908.4551687, "t1": 1794389918.0365508, "ttft_s": 32.984124422073364, "decode_tok_s": 26.614114648213242, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.297141551971436, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7664971, "t_first": 1794389924.8701386, "t1": 1794389963.1924686, "ttft_s": 4.103641510009766, "decode_tok_s": 6.654083924782218, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7668293, "t_first": 1794389928.9967554, "t1": 1794389965.043641, "ttft_s": 8.229926109313965, "decode_tok_s": 7.074120131160464, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7674496, "t_first": 1794389933.1332238, "t1": 1794389961.1947715, "ttft_s": 12.365774154663086, "decode_tok_s": 9.087168042742915, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7678876, "t_first": 1794389937.2624176, "t1": 1794389965.0444133, "ttft_s": 16.494529962539673, "decode_tok_s": 9.178606248472875, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.768473, "t_first": 1794389945.5280905, "t1": 1794389964.3216178, "ttft_s": 24.759617567062378, "decode_tok_s": 13.568501274462703, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.76903, "t_first": 1794389941.3938172, "t1": 1794389966.2757714, "ttft_s": 20.624787092208862, "decode_tok_s": 10.24839118426469, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7696536, "t_first": 1794389949.6593893, "t1": 1794389965.536834, "ttft_s": 28.88973569869995, "decode_tok_s": 16.06051881204592, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389920.7704387, "t_first": 1794389953.7884018, "t1": 1794389965.7069666, "ttft_s": 33.01796317100525, "decode_tok_s": 21.395193494773885, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.509876012802124, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.2764442, "t_first": 1794389970.3727565, "t1": 1794390009.093493, "ttft_s": 4.0963122844696045, "decode_tok_s": 6.585618534820088, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.2766795, "t_first": 1794389982.759911, "t1": 1794390011.087859, "ttft_s": 16.48323154449463, "decode_tok_s": 9.00171100657508, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.2768261, "t_first": 1794389978.631229, "t1": 1794390007.4607122, "ttft_s": 12.354402780532837, "decode_tok_s": 8.84511170755693, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.276936, "t_first": 1794389974.5028114, "t1": 1794390011.0871537, "ttft_s": 8.22587537765503, "decode_tok_s": 6.9701950172612355, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.2774, "t_first": 1794389986.8886635, "t1": 1794390011.3310332, "ttft_s": 20.611263513565063, "decode_tok_s": 10.432703667248937, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.2775717, "t_first": 1794389991.0196989, "t1": 1794390011.521942, "ttft_s": 24.742127180099487, "decode_tok_s": 12.437663502364854, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.278162, "t_first": 1794389995.1485517, "t1": 1794390009.5990176, "ttft_s": 28.870389699935913, "decode_tok_s": 17.646489840140465, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794389966.278452, "t_first": 1794389999.279365, "t1": 1794390008.7999868, "ttft_s": 33.00091314315796, "decode_tok_s": 26.78396495355574, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.24605679512024, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.4053993, "t_first": 1794390030.2814949, "t1": 1794390063.440428, "ttft_s": 12.876095533370972, "decode_tok_s": 7.690235350723791, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.405682, "t_first": 1794390021.6802182, "t1": 1794390061.6197464, "ttft_s": 4.2745361328125, "decode_tok_s": 6.384652281109236, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.4060514, "t_first": 1794390025.9813876, "t1": 1794390063.7710164, "ttft_s": 8.575336217880249, "decode_tok_s": 6.7478831752122295, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.4064476, "t_first": 1794390043.185239, "t1": 1794390062.3601646, "ttft_s": 25.778791427612305, "decode_tok_s": 13.298617464042826, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.406708, "t_first": 1794390034.581999, "t1": 1794390062.2939322, "ttft_s": 17.175291061401367, "decode_tok_s": 9.201812040635323, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.4070084, "t_first": 1794390038.8834698, "t1": 1794390062.3595378, "ttft_s": 21.47646141052246, "decode_tok_s": 10.862125624453071, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.407355, "t_first": 1794390051.7900357, "t1": 1794390062.1518931, "ttft_s": 34.38268065452576, "decode_tok_s": 24.60948745052436, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390017.4074962, "t_first": 1794390047.4879026, "t1": 1794390062.2237985, "ttft_s": 30.080406427383423, "decode_tok_s": 17.304682539357668, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.3661584854126, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7719164, "t_first": 1794390068.044653, "t1": 1794390107.99552, "ttft_s": 4.272736549377441, "decode_tok_s": 6.382840174063388, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7724586, "t_first": 1794390076.6515467, "t1": 1794390108.2115161, "ttft_s": 12.879088163375854, "decode_tok_s": 8.079855736373945, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7728467, "t_first": 1794390089.556254, "t1": 1794390108.2122376, "ttft_s": 25.78340721130371, "decode_tok_s": 13.668536823670559, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7733762, "t_first": 1794390080.9550965, "t1": 1794390107.8434055, "ttft_s": 17.18172025680542, "decode_tok_s": 9.483675599747333, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7737176, "t_first": 1794390072.3477092, "t1": 1794390110.1261153, "ttft_s": 8.573991537094116, "decode_tok_s": 6.749887727753624, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7741098, "t_first": 1794390093.8580582, "t1": 1794390108.4987557, "ttft_s": 30.083948373794556, "decode_tok_s": 17.417202996062244, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7745326, "t_first": 1794390085.255512, "t1": 1794390109.0499685, "ttft_s": 21.480979442596436, "decode_tok_s": 10.71678187705669, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390063.7748575, "t_first": 1794390098.1611135, "t1": 1794390110.1931586, "ttft_s": 34.386255979537964, "decode_tok_s": 21.193404556785744, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.421722173690796, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.193786, "t_first": 1794390123.0582778, "t1": 1794390153.5981631, "ttft_s": 12.864491939544678, "decode_tok_s": 8.349736668656801, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.1942184, "t_first": 1794390118.7597518, "t1": 1794390154.4979038, "ttft_s": 8.56553339958191, "decode_tok_s": 7.13523183309591, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.1945906, "t_first": 1794390114.4625008, "t1": 1794390156.8291335, "ttft_s": 4.2679102420806885, "decode_tok_s": 6.018887595005917, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.195087, "t_first": 1794390127.3601139, "t1": 1794390156.9626741, "ttft_s": 17.165026903152466, "decode_tok_s": 8.614119777915871, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.1955488, "t_first": 1794390131.6636126, "t1": 1794390155.183221, "ttft_s": 21.468063831329346, "decode_tok_s": 10.842017205592859, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.195827, "t_first": 1794390135.9653738, "t1": 1794390154.564415, "ttft_s": 25.76954674720764, "decode_tok_s": 13.710384150202833, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.1964378, "t_first": 1794390144.5695362, "t1": 1794390154.050523, "ttft_s": 34.373098373413086, "decode_tok_s": 26.895934408118706, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390110.1966872, "t_first": 1794390140.268663, "t1": 1794390156.516609, "ttft_s": 30.071975708007812, "decode_tok_s": 15.694291427621826, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.769432067871094, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9633532, "t_first": 1794390161.2325532, "t1": 1794390202.104589, "ttft_s": 4.269200086593628, "decode_tok_s": 6.238984561739675, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.963668, "t_first": 1794390169.8351586, "t1": 1794390201.3168058, "ttft_s": 12.871490478515625, "decode_tok_s": 8.099957348178611, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9639926, "t_first": 1794390182.7534986, "t1": 1794390202.8273664, "ttft_s": 25.78950595855713, "decode_tok_s": 12.703082563256284, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9642866, "t_first": 1794390165.5348897, "t1": 1794390201.3161302, "ttft_s": 8.570603132247925, "decode_tok_s": 7.126639454041714, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9645984, "t_first": 1794390174.1455178, "t1": 1794390201.1745064, "ttft_s": 17.180919408798218, "decode_tok_s": 9.434315274456912, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9648316, "t_first": 1794390178.4472523, "t1": 1794390201.0986557, "ttft_s": 21.482420682907104, "decode_tok_s": 11.257580609537381, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.9652019, "t_first": 1794390191.3557243, "t1": 1794390201.8915884, "ttft_s": 34.390522480010986, "decode_tok_s": 24.203045637493588, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390156.965306, "t_first": 1794390187.0556867, "t1": 1794390203.1534941, "ttft_s": 30.090380668640137, "decode_tok_s": 15.840666591843393, "label": "p1-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.190552949905396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1-greedy.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1-greedy.jsonl new file mode 100644 index 00000000000..7eeb7f045aa --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1-greedy.jsonl @@ -0,0 +1,2 @@ +{"ok": true, "token_sha256": "5d721308b699d401dae7698a19eb8af0418c8a4ab835f68c3c71c394b8e9102f", "text_sha256": "ef79dee7153a363aadcf383ed572fbe239fe1f0074f21a92400f0b7efab01337", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390232.5534568, "t_first": 1794390232.64484, "t1": 1794390234.6365945, "ttft_s": 0.09138321876525879, "decode_tok_s": 128.02782467467176, "label": "p2-branch-par1-greedy", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 2.0838568210601807, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "356fb0b3163a59e43a18c611211d279e96191c0ab6e4f01e8eb13b7445e099f6", "text_sha256": "5d3300bf0d0b7e170a26c73e967ef7ef9a3319996f826e21759a8b4143449b62", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390234.637372, "t_first": 1794390234.716036, "t1": 1794390238.0225248, "ttft_s": 0.07866406440734863, "decode_tok_s": 77.12108496289304, "label": "p2-branch-par1-greedy", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 3.38561749458313, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1.jsonl new file mode 100644 index 00000000000..832ce4e7dbb --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par1.jsonl @@ -0,0 +1,16 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390238.0592046, "t_first": 1794390238.142057, "t1": 1794390239.7968636, "ttft_s": 0.08285236358642578, "decode_tok_s": 154.09655596892676, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7381327152252197, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390239.79739, "t_first": 1794390239.874157, "t1": 1794390241.4817214, "ttft_s": 0.0767669677734375, "decode_tok_s": 158.62505550517943, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6847360134124756, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390241.4821653, "t_first": 1794390241.5594804, "t1": 1794390243.167045, "ttft_s": 0.07731509208679199, "decode_tok_s": 158.62503197943232, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6851775646209717, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390243.1676047, "t_first": 1794390243.2457216, "t1": 1794390244.853647, "ttft_s": 0.07811689376831055, "decode_tok_s": 158.58944551467587, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6864912509918213, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390244.8543425, "t_first": 1794390244.9340074, "t1": 1794390248.2017713, "ttft_s": 0.07966494560241699, "decode_tok_s": 78.03501460492288, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.3478951454162598, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390248.2024677, "t_first": 1794390248.28237, "t1": 1794390251.4471314, "ttft_s": 0.07990241050720215, "decode_tok_s": 80.57479709726653, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2451834678649902, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390251.4477496, "t_first": 1794390251.527623, "t1": 1794390254.6920009, "ttft_s": 0.07987332344055176, "decode_tok_s": 80.58455905704207, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2446939945220947, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390254.692442, "t_first": 1794390254.771683, "t1": 1794390257.9376533, "ttft_s": 0.07924103736877441, "decode_tok_s": 80.54402719714268, "label": "p2-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2455966472625732, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390264.014247, "t_first": 1794390268.1081736, "t1": 1794390272.1060853, "ttft_s": 4.093926668167114, "decode_tok_s": 63.783299799140735, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.09232211112976, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390272.1066928, "t_first": 1794390276.2035198, "t1": 1794390280.1025913, "ttft_s": 4.096827030181885, "decode_tok_s": 65.4001864143524, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.996479511260986, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390280.1032307, "t_first": 1794390284.1995435, "t1": 1794390288.098791, "ttft_s": 4.096312761306763, "decode_tok_s": 65.397235241472, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.9959716796875, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390288.0993142, "t_first": 1794390292.1987317, "t1": 1794390296.0980983, "ttft_s": 4.099417448043823, "decode_tok_s": 65.39523595319854, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.999297857284546, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390301.991023, "t_first": 1794390306.2559643, "t1": 1794390310.5061111, "ttft_s": 4.264941215515137, "decode_tok_s": 59.99792667148648, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.515648603439331, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390310.5067503, "t_first": 1794390314.7762773, "t1": 1794390318.9617097, "ttft_s": 4.269526958465576, "decode_tok_s": 60.925604227542095, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.455612421035767, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390318.9627488, "t_first": 1794390323.2292316, "t1": 1794390327.4138124, "ttft_s": 4.266482830047607, "decode_tok_s": 60.93800359219126, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.451888799667358, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390327.414564, "t_first": 1794390331.6843238, "t1": 1794390335.8695254, "ttft_s": 4.269759893417358, "decode_tok_s": 60.92896391524944, "label": "p2-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.455463886260986, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par4.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par4.jsonl new file mode 100644 index 00000000000..439d179521b --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par4.jsonl @@ -0,0 +1,64 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390365.2501237, "t_first": 1794390365.6503963, "t1": 1794390368.683917, "ttft_s": 0.4002726078033447, "decode_tok_s": 84.06074173883492, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.388977527618408, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390365.2505567, "t_first": 1794390365.3916485, "t1": 1794390369.552664, "ttft_s": 0.14109182357788086, "decode_tok_s": 61.283116910500944, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.388977527618408, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390365.250945, "t_first": 1794390365.5237062, "t1": 1794390369.3858552, "ttft_s": 0.27276110649108887, "decode_tok_s": 66.02541745254206, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.388977527618408, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390365.2512014, "t_first": 1794390365.7298725, "t1": 1794390369.6387467, "ttft_s": 0.4786710739135742, "decode_tok_s": 65.23617342767832, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.388977527618408, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390369.639211, "t_first": 1794390369.795577, "t1": 1794390372.6852648, "ttft_s": 0.15636610984802246, "decode_tok_s": 88.24482771736409, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.300251007080078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390369.6394758, "t_first": 1794390369.7166033, "t1": 1794390373.3480906, "ttft_s": 0.07712745666503906, "decode_tok_s": 70.21916202684925, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.300251007080078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390369.6398444, "t_first": 1794390369.8746336, "t1": 1794390373.1834953, "ttft_s": 0.23478913307189941, "decode_tok_s": 77.06577687930545, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.300251007080078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390369.6404142, "t_first": 1794390369.953355, "t1": 1794390373.9389834, "ttft_s": 0.3129408359527588, "decode_tok_s": 63.97987382497164, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.300251007080078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390373.9397802, "t_first": 1794390374.0173078, "t1": 1794390376.9636889, "ttft_s": 0.07752752304077148, "decode_tok_s": 86.54684917921304, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.176900625228882, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390373.940283, "t_first": 1794390374.25341, "t1": 1794390377.8268454, "ttft_s": 0.3131270408630371, "decode_tok_s": 71.35990388091226, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.176900625228882, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390373.9405344, "t_first": 1794390374.095973, "t1": 1794390377.459001, "ttft_s": 0.15543866157531738, "decode_tok_s": 75.82452368788992, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.176900625228882, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390373.940973, "t_first": 1794390374.1747804, "t1": 1794390378.1160913, "ttft_s": 0.23380732536315918, "decode_tok_s": 64.69928599842623, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.176900625228882, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390378.1167285, "t_first": 1794390378.194364, "t1": 1794390381.127775, "ttft_s": 0.07763552665710449, "decode_tok_s": 86.92951999399851, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.15906286239624, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390378.1169667, "t_first": 1794390378.2724984, "t1": 1794390381.9859867, "ttft_s": 0.155531644821167, "decode_tok_s": 68.66858776081588, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.15906286239624, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390378.1174846, "t_first": 1794390378.350921, "t1": 1794390381.6225486, "ttft_s": 0.23343634605407715, "decode_tok_s": 77.94285479421268, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.15906286239624, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390378.1176932, "t_first": 1794390378.4288886, "t1": 1794390382.275404, "ttft_s": 0.31119537353515625, "decode_tok_s": 66.29376782592445, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.15906286239624, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390382.2758608, "t_first": 1794390382.3552594, "t1": 1794390387.7386634, "ttft_s": 0.07939863204956055, "decode_tok_s": 47.36779911347541, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.463230133056641, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390382.2761989, "t_first": 1794390382.6311116, "t1": 1794390387.4368436, "ttft_s": 0.35491275787353516, "decode_tok_s": 53.061635433298335, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.463230133056641, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390382.2763853, "t_first": 1794390382.5501533, "t1": 1794390387.6128955, "ttft_s": 0.27376794815063477, "decode_tok_s": 50.367960336581476, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.463230133056641, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390382.2766936, "t_first": 1794390382.467404, "t1": 1794390387.6505113, "ttft_s": 0.19071030616760254, "decode_tok_s": 49.19828618174231, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.463230133056641, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390387.7395432, "t_first": 1794390387.8189874, "t1": 1794390393.0634124, "ttft_s": 0.07944416999816895, "decode_tok_s": 48.623061090991186, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.324185848236084, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390387.739942, "t_first": 1794390387.9000926, "t1": 1794390392.775112, "ttft_s": 0.16015052795410156, "decode_tok_s": 52.307485095963465, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.324185848236084, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390387.7403536, "t_first": 1794390388.061811, "t1": 1794390392.9019485, "ttft_s": 0.3214573860168457, "decode_tok_s": 52.68445389509723, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.324185848236084, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390387.7406785, "t_first": 1794390387.9809976, "t1": 1794390393.0171208, "ttft_s": 0.24031901359558105, "decode_tok_s": 50.63418547110093, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.324185848236084, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390393.0638394, "t_first": 1794390393.1430917, "t1": 1794390398.3278165, "ttft_s": 0.07925224304199219, "decode_tok_s": 49.1829382379872, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.2643373012542725, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390393.0641906, "t_first": 1794390393.2239552, "t1": 1794390398.0334291, "ttft_s": 0.15976452827453613, "decode_tok_s": 53.02035117692514, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.2643373012542725, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390393.0643895, "t_first": 1794390393.385901, "t1": 1794390398.20539, "ttft_s": 0.32151150703430176, "decode_tok_s": 52.910173647481635, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.2643373012542725, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390393.0645118, "t_first": 1794390393.3049235, "t1": 1794390398.2427943, "ttft_s": 0.24041175842285156, "decode_tok_s": 51.64169201278301, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.2643373012542725, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390398.3282602, "t_first": 1794390398.4075544, "t1": 1794390403.6114953, "ttft_s": 0.07929420471191406, "decode_tok_s": 49.00132542810687, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.2835001945495605, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390398.328473, "t_first": 1794390398.4884439, "t1": 1794390403.3272219, "ttft_s": 0.15997076034545898, "decode_tok_s": 52.699255680106525, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.2835001945495605, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390398.328628, "t_first": 1794390398.5692925, "t1": 1794390403.4535387, "ttft_s": 0.24066448211669922, "decode_tok_s": 52.20867135054537, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.2835001945495605, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390398.3289416, "t_first": 1794390398.6503673, "t1": 1794390403.5688982, "ttft_s": 0.3214256763458252, "decode_tok_s": 51.84474857601722, "label": "p2-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.2835001945495605, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390409.687131, "t_first": 1794390417.9170766, "t1": 1794390432.3520095, "ttft_s": 8.229945659637451, "decode_tok_s": 17.665478664394552, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.747854948043823, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390409.688037, "t_first": 1794390413.7983186, "t1": 1794390433.3696098, "ttft_s": 4.110281705856323, "decode_tok_s": 13.029288527079098, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.747854948043823, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390409.6887445, "t_first": 1794390426.1633098, "t1": 1794390431.073696, "ttft_s": 16.474565267562866, "decode_tok_s": 51.9307434404116, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.747854948043823, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390409.6893873, "t_first": 1794390422.0381072, "t1": 1794390433.4343345, "ttft_s": 12.348719835281372, "decode_tok_s": 22.375825959750575, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.747854948043823, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390433.4350615, "t_first": 1794390437.5404854, "t1": 1794390455.9365883, "ttft_s": 4.105423927307129, "decode_tok_s": 13.861631526691534, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.711756467819214, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390433.435593, "t_first": 1794390445.793769, "t1": 1794390456.9564064, "ttft_s": 12.358175992965698, "decode_tok_s": 22.844063567964582, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.711756467819214, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390433.4360118, "t_first": 1794390441.6655335, "t1": 1794390455.0715795, "ttft_s": 8.229521751403809, "decode_tok_s": 19.021268585950402, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.711756467819214, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390433.4362693, "t_first": 1794390449.9212224, "t1": 1794390457.1463287, "ttft_s": 16.48495316505432, "decode_tok_s": 35.29359867572554, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.711756467819214, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390457.1468756, "t_first": 1794390461.250726, "t1": 1794390479.6020606, "ttft_s": 4.103850364685059, "decode_tok_s": 13.895447167712714, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.66005277633667, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390457.1472714, "t_first": 1794390465.3784475, "t1": 1794390480.616523, "ttft_s": 8.231176137924194, "decode_tok_s": 16.734396682020897, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.66005277633667, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390457.14753, "t_first": 1794390469.5049443, "t1": 1794390478.7393825, "ttft_s": 12.357414245605469, "decode_tok_s": 27.61402426481992, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.66005277633667, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390457.1478891, "t_first": 1794390473.6337488, "t1": 1794390480.806601, "ttft_s": 16.485859632492065, "decode_tok_s": 35.55071122694097, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.66005277633667, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390480.8070164, "t_first": 1794390484.9114048, "t1": 1794390503.2783413, "ttft_s": 4.104388475418091, "decode_tok_s": 13.88364362017155, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.62861967086792, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390480.8074617, "t_first": 1794390493.178604, "t1": 1794390504.243642, "ttft_s": 12.371142148971558, "decode_tok_s": 23.045559833979365, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.62861967086792, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390480.8077075, "t_first": 1794390489.0449264, "t1": 1794390502.4158063, "ttft_s": 8.237218856811523, "decode_tok_s": 19.071295391611518, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.62861967086792, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390480.8081393, "t_first": 1794390497.3083832, "t1": 1794390504.4352107, "ttft_s": 16.50024390220642, "decode_tok_s": 35.7802964604572, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.62861967086792, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390510.3190467, "t_first": 1794390514.6001801, "t1": 1794390534.3336627, "ttft_s": 4.281133413314819, "decode_tok_s": 12.922199551820762, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.014883518218994, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390510.319401, "t_first": 1794390523.2119029, "t1": 1794390534.0241506, "ttft_s": 12.892501831054688, "decode_tok_s": 23.584365233017067, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.014883518218994, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390510.3195822, "t_first": 1794390527.5135322, "t1": 1794390534.1523519, "ttft_s": 17.193949937820435, "decode_tok_s": 38.41044217702222, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.014883518218994, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390510.3197162, "t_first": 1794390518.905423, "t1": 1794390534.262622, "ttft_s": 8.58570671081543, "decode_tok_s": 16.60459025185102, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.014883518218994, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390534.3340461, "t_first": 1794390538.611378, "t1": 1794390557.8514132, "ttft_s": 4.277331829071045, "decode_tok_s": 13.253613940085694, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.039554834365845, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390534.3344092, "t_first": 1794390542.915878, "t1": 1794390557.9815748, "ttft_s": 8.5814688205719, "decode_tok_s": 16.925868401689176, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.039554834365845, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390534.3347304, "t_first": 1794390547.2239428, "t1": 1794390558.3731778, "ttft_s": 12.889212369918823, "decode_tok_s": 22.87152434834502, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.039554834365845, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390534.335031, "t_first": 1794390551.5304947, "t1": 1794390558.2105536, "ttft_s": 17.19546365737915, "decode_tok_s": 38.17331578569043, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.039554834365845, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390558.3737862, "t_first": 1794390566.9424584, "t1": 1794390582.3712938, "ttft_s": 8.568672180175781, "decode_tok_s": 16.527495013152336, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.997813940048218, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390558.3741324, "t_first": 1794390562.6434617, "t1": 1794390582.1309185, "ttft_s": 4.269329309463501, "decode_tok_s": 13.085340105484077, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.997813940048218, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390558.3744383, "t_first": 1794390571.2459986, "t1": 1794390582.1906524, "ttft_s": 12.871560335159302, "decode_tok_s": 23.299046807437197, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.997813940048218, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390558.3749118, "t_first": 1794390575.5535417, "t1": 1794390582.3034923, "ttft_s": 17.178629875183105, "decode_tok_s": 37.77805399213637, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.997813940048218, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390582.37164, "t_first": 1794390590.9494867, "t1": 1794390606.405024, "ttft_s": 8.577846765518188, "decode_tok_s": 16.498941106595826, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.03377056121826, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390582.37189, "t_first": 1794390586.6471436, "t1": 1794390606.0253212, "ttft_s": 4.275253534317017, "decode_tok_s": 13.159132127909498, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.03377056121826, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390582.3723207, "t_first": 1794390595.250442, "t1": 1794390606.2185946, "ttft_s": 12.878121376037598, "decode_tok_s": 23.24912964734235, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.03377056121826, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390582.3725832, "t_first": 1794390599.5571828, "t1": 1794390606.2719443, "ttft_s": 17.18459963798523, "decode_tok_s": 37.9760323829024, "label": "p2-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.03377056121826, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par8.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par8.jsonl new file mode 100644 index 00000000000..f841d578e17 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p2-branch-par8.jsonl @@ -0,0 +1,128 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8006065, "t_first": 1794390636.065116, "t1": 1794390641.8933692, "ttft_s": 0.2645094394683838, "decode_tok_s": 43.752388275191805, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8012536, "t_first": 1794390636.6531706, "t1": 1794390642.9300225, "ttft_s": 0.851917028427124, "decode_tok_s": 40.62546071954579, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8014865, "t_first": 1794390636.7314422, "t1": 1794390642.8445356, "ttft_s": 0.9299557209014893, "decode_tok_s": 41.71374201389913, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.801774, "t_first": 1794390635.9431183, "t1": 1794390643.5193918, "ttft_s": 0.14134430885314941, "decode_tok_s": 33.657708103490826, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8020716, "t_first": 1794390636.537898, "t1": 1794390643.5197217, "ttft_s": 0.7358264923095703, "decode_tok_s": 36.52340872324651, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8023248, "t_first": 1794390636.420893, "t1": 1794390643.1592803, "ttft_s": 0.6185681819915771, "decode_tok_s": 37.84288241328854, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.802607, "t_first": 1794390636.2991772, "t1": 1794390641.7527492, "ttft_s": 0.4965701103210449, "decode_tok_s": 46.7583445072578, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390635.8029187, "t_first": 1794390636.180328, "t1": 1794390642.7466342, "ttft_s": 0.3774092197418213, "decode_tok_s": 38.83461817136108, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.7199482917785645, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.5205686, "t_first": 1794390643.5974126, "t1": 1794390649.1753466, "ttft_s": 0.0768439769744873, "decode_tok_s": 45.71585084702643, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.520988, "t_first": 1794390643.675561, "t1": 1794390650.2713835, "ttft_s": 0.1545729637145996, "decode_tok_s": 38.66083376092111, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.5213075, "t_first": 1794390643.7535627, "t1": 1794390650.271677, "ttft_s": 0.232255220413208, "decode_tok_s": 39.12174398192938, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.521492, "t_first": 1794390643.8315237, "t1": 1794390650.5959618, "ttft_s": 0.3100316524505615, "decode_tok_s": 37.697144132036705, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.521945, "t_first": 1794390643.9100578, "t1": 1794390650.7190645, "ttft_s": 0.38811278343200684, "decode_tok_s": 37.450396448844714, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.522489, "t_first": 1794390644.0665905, "t1": 1794390649.78161, "ttft_s": 0.5441014766693115, "decode_tok_s": 44.61927060516687, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.5226157, "t_first": 1794390643.9881964, "t1": 1794390649.4583344, "ttft_s": 0.46558070182800293, "decode_tok_s": 46.61673921178802, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390643.523268, "t_first": 1794390644.1448243, "t1": 1794390649.9157891, "ttft_s": 0.621556282043457, "decode_tok_s": 44.186718537655224, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.198932647705078, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7197618, "t_first": 1794390650.7962584, "t1": 1794390656.84713, "ttft_s": 0.07649660110473633, "decode_tok_s": 42.14268892295441, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7201536, "t_first": 1794390650.9524994, "t1": 1794390657.719066, "ttft_s": 0.2323458194732666, "decode_tok_s": 37.685286834304186, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7204254, "t_first": 1794390650.8743618, "t1": 1794390657.3300157, "ttft_s": 0.15393638610839844, "decode_tok_s": 39.50025879921963, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7211516, "t_first": 1794390651.0304341, "t1": 1794390657.9771683, "ttft_s": 0.3092825412750244, "decode_tok_s": 36.70789654907906, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7215266, "t_first": 1794390651.1087818, "t1": 1794390657.598461, "ttft_s": 0.3872551918029785, "decode_tok_s": 39.29316013075389, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.721991, "t_first": 1794390651.1868048, "t1": 1794390657.2422154, "ttft_s": 0.4648137092590332, "decode_tok_s": 42.11109961862307, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7226214, "t_first": 1794390651.3430698, "t1": 1794390656.0994627, "ttft_s": 0.6204483509063721, "decode_tok_s": 53.61205484297103, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390650.7228956, "t_first": 1794390651.2650018, "t1": 1794390657.1549163, "ttft_s": 0.5421061515808105, "decode_tok_s": 43.2943465398364, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.257917881011963, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.977892, "t_first": 1794390658.0552742, "t1": 1794390664.3584566, "ttft_s": 0.07738232612609863, "decode_tok_s": 40.455754774957036, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.9783874, "t_first": 1794390658.2138128, "t1": 1794390664.7622766, "ttft_s": 0.23542547225952148, "decode_tok_s": 38.94043045122144, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.9786015, "t_first": 1794390658.1345596, "t1": 1794390664.6323733, "ttft_s": 0.1559581756591797, "decode_tok_s": 39.24396908086892, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.979363, "t_first": 1794390658.292456, "t1": 1794390665.169079, "ttft_s": 0.3130929470062256, "decode_tok_s": 37.08215417669002, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.97958, "t_first": 1794390658.3714597, "t1": 1794390664.959889, "ttft_s": 0.3918797969818115, "decode_tok_s": 38.70421792093943, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.980656, "t_first": 1794390658.4501796, "t1": 1794390664.7225456, "ttft_s": 0.46952366828918457, "decode_tok_s": 40.65451507343145, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.980972, "t_first": 1794390658.528812, "t1": 1794390663.5616488, "ttft_s": 0.547839879989624, "decode_tok_s": 50.6672487811977, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794390657.9812744, "t_first": 1794390658.6067998, "t1": 1794390664.762432, "ttft_s": 0.6255254745483398, "decode_tok_s": 41.42547659355411, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.191784143447876, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.169749, "t_first": 1794390665.2489526, "t1": 1794390672.6355822, "ttft_s": 0.07920360565185547, "decode_tok_s": 34.52183396881456, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.170063, "t_first": 1794390665.3345811, "t1": 1794390672.8310323, "ttft_s": 0.16451811790466309, "decode_tok_s": 34.01609578405208, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.170302, "t_first": 1794390665.4168344, "t1": 1794390672.8311753, "ttft_s": 0.24653244018554688, "decode_tok_s": 34.39280725448582, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.1705623, "t_first": 1794390665.497524, "t1": 1794390673.564542, "ttft_s": 0.3269617557525635, "decode_tok_s": 31.610193380767896, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.1708508, "t_first": 1794390665.5784934, "t1": 1794390673.8560948, "ttft_s": 0.4076426029205322, "decode_tok_s": 30.80602522375716, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.1715243, "t_first": 1794390665.740199, "t1": 1794390673.7262259, "ttft_s": 0.5686748027801514, "decode_tok_s": 31.930772026984616, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.1718533, "t_first": 1794390665.6594741, "t1": 1794390673.0591905, "ttft_s": 0.48762083053588867, "decode_tok_s": 34.46078025148324, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390665.172375, "t_first": 1794390665.821271, "t1": 1794390672.9216754, "ttft_s": 0.6488959789276123, "decode_tok_s": 35.91344689805718, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.68681001663208, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.856666, "t_first": 1794390673.9356875, "t1": 1794390681.0242372, "ttft_s": 0.07902145385742188, "decode_tok_s": 35.97350852959747, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8570552, "t_first": 1794390674.2595856, "t1": 1794390681.0244935, "ttft_s": 0.4025304317474365, "decode_tok_s": 37.69452683575996, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8572614, "t_first": 1794390674.178733, "t1": 1794390681.1665766, "ttft_s": 0.3214716911315918, "decode_tok_s": 36.49194483359116, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8573768, "t_first": 1794390674.097501, "t1": 1794390682.0232282, "ttft_s": 0.24012422561645508, "decode_tok_s": 32.17370417251992, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8574986, "t_first": 1794390674.0165489, "t1": 1794390682.2352946, "ttft_s": 0.15905022621154785, "decode_tok_s": 31.02663217056852, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8580868, "t_first": 1794390674.340489, "t1": 1794390682.316559, "ttft_s": 0.48240208625793457, "decode_tok_s": 31.970631489514442, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.85839, "t_first": 1794390674.50244, "t1": 1794390682.5343354, "ttft_s": 0.644049882888794, "decode_tok_s": 31.74842142849319, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390673.8589215, "t_first": 1794390674.4213512, "t1": 1794390681.3484762, "ttft_s": 0.562429666519165, "decode_tok_s": 36.811808772406366, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.67802381515503, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.534911, "t_first": 1794390682.6957734, "t1": 1794390689.7351031, "ttft_s": 0.16086244583129883, "decode_tok_s": 36.225039660337686, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5352752, "t_first": 1794390682.6151402, "t1": 1794390689.5016615, "ttft_s": 0.0798649787902832, "decode_tok_s": 37.02885498088157, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5355415, "t_first": 1794390683.0193727, "t1": 1794390689.92074, "ttft_s": 0.48383116722106934, "decode_tok_s": 36.949200509409934, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5357947, "t_first": 1794390683.1004763, "t1": 1794390690.835481, "ttft_s": 0.5646815299987793, "decode_tok_s": 32.967013091067734, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.536067, "t_first": 1794390682.7766147, "t1": 1794390691.5877073, "ttft_s": 0.24054765701293945, "decode_tok_s": 28.940792151270358, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5365798, "t_first": 1794390682.857517, "t1": 1794390690.5122607, "ttft_s": 0.3209371566772461, "decode_tok_s": 33.31267655011994, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5369232, "t_first": 1794390682.9385595, "t1": 1794390690.5520315, "ttft_s": 0.40163636207580566, "decode_tok_s": 33.49326043452686, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390682.5372446, "t_first": 1794390683.181178, "t1": 1794390689.7354963, "ttft_s": 0.6439335346221924, "decode_tok_s": 38.90564855453658, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.053433656692505, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.588729, "t_first": 1794390691.830074, "t1": 1794390699.0774407, "ttft_s": 0.24134516716003418, "decode_tok_s": 35.1851937019229, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.5889776, "t_first": 1794390691.6684792, "t1": 1794390698.3134296, "ttft_s": 0.07950162887573242, "decode_tok_s": 38.37500433246928, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.5892344, "t_first": 1794390691.7491758, "t1": 1794390698.7482278, "ttft_s": 0.1599414348602295, "decode_tok_s": 36.433505317726926, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.5894873, "t_first": 1794390691.9107614, "t1": 1794390700.019501, "ttft_s": 0.3212740421295166, "decode_tok_s": 31.447550682775525, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.5898662, "t_first": 1794390691.9917562, "t1": 1794390700.1881778, "ttft_s": 0.4018900394439697, "decode_tok_s": 31.111137484349133, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.590147, "t_first": 1794390692.2342553, "t1": 1794390700.0194561, "ttft_s": 0.6441082954406738, "decode_tok_s": 32.754453665134015, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.5903769, "t_first": 1794390692.0726602, "t1": 1794390699.4460294, "ttft_s": 0.482283353805542, "decode_tok_s": 34.58391849073237, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794390691.590504, "t_first": 1794390692.1534684, "t1": 1794390699.0317485, "ttft_s": 0.5629644393920898, "decode_tok_s": 37.07322091628452, "label": "p2-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.600172281265259, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2666793, "t_first": 1794390714.4938037, "t1": 1794390748.3556843, "ttft_s": 8.227124452590942, "decode_tok_s": 7.530591801964219, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2669046, "t_first": 1794390722.7451696, "t1": 1794390749.436014, "ttft_s": 16.478265047073364, "decode_tok_s": 9.553837906309822, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.267083, "t_first": 1794390726.872488, "t1": 1794390746.8280392, "ttft_s": 20.60540509223938, "decode_tok_s": 12.778399259217911, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2672696, "t_first": 1794390710.3734117, "t1": 1794390750.7358172, "ttft_s": 4.106142044067383, "decode_tok_s": 6.317760217645941, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2674837, "t_first": 1794390730.9997296, "t1": 1794390750.5760784, "ttft_s": 24.732245922088623, "decode_tok_s": 13.025922394673685, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2678628, "t_first": 1794390735.1278775, "t1": 1794390750.9890513, "ttft_s": 28.86001467704773, "decode_tok_s": 16.076994182100282, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2681873, "t_first": 1794390739.2564983, "t1": 1794390748.9730678, "ttft_s": 32.98831105232239, "decode_tok_s": 26.243830397451102, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390706.2685041, "t_first": 1794390718.6176648, "t1": 1794390748.356415, "ttft_s": 12.34916067123413, "decode_tok_s": 8.57467103086673, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.72297382354736, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9897442, "t_first": 1794390755.1008217, "t1": 1794390793.203183, "ttft_s": 4.111077547073364, "decode_tok_s": 6.692498626174613, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9901335, "t_first": 1794390767.4909108, "t1": 1794390795.0558949, "ttft_s": 16.50077724456787, "decode_tok_s": 9.250866941571708, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9904394, "t_first": 1794390771.6196942, "t1": 1794390791.6854193, "ttft_s": 20.629254817962646, "decode_tok_s": 12.70823749852828, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9907527, "t_first": 1794390759.227363, "t1": 1794390795.0547335, "ttft_s": 8.236610412597656, "decode_tok_s": 7.117463467623332, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9911094, "t_first": 1794390763.358374, "t1": 1794390795.276037, "ttft_s": 12.367264747619629, "decode_tok_s": 7.989306771200252, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.991631, "t_first": 1794390775.7499526, "t1": 1794390795.4659932, "ttft_s": 24.758321523666382, "decode_tok_s": 12.933631301929639, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.9919834, "t_first": 1794390779.8832796, "t1": 1794390793.6737638, "ttft_s": 28.89129614830017, "decode_tok_s": 18.4910113732734, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390750.992386, "t_first": 1794390784.015479, "t1": 1794390792.9298823, "ttft_s": 33.0230929851532, "decode_tok_s": 28.605392225889272, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.47680616378784, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.466696, "t_first": 1794390799.568136, "t1": 1794390839.8295147, "ttft_s": 4.101439952850342, "decode_tok_s": 6.333613200077584, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.466987, "t_first": 1794390816.1057847, "t1": 1794390839.956278, "ttft_s": 20.638797760009766, "decode_tok_s": 10.691602701501516, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4674928, "t_first": 1794390803.696651, "t1": 1794390836.1983209, "ttft_s": 8.229158163070679, "decode_tok_s": 7.845750723339475, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4678, "t_first": 1794390807.8336415, "t1": 1794390839.6621547, "ttft_s": 12.365841627120972, "decode_tok_s": 8.011684329542078, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4682212, "t_first": 1794390824.364218, "t1": 1794390837.3709898, "ttft_s": 28.895996809005737, "decode_tok_s": 19.605172126038333, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4683576, "t_first": 1794390820.2347941, "t1": 1794390838.930166, "ttft_s": 24.76643657684326, "decode_tok_s": 13.639739387086806, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4684696, "t_first": 1794390811.9678392, "t1": 1794390838.189291, "ttft_s": 16.499369621276855, "decode_tok_s": 9.724862007656977, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390795.4688754, "t_first": 1794390828.498027, "t1": 1794390838.1900206, "ttft_s": 33.02915167808533, "decode_tok_s": 26.31037677220927, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.48999524116516, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.956823, "t_first": 1794390844.0689406, "t1": 1794390884.2452798, "ttft_s": 4.112117528915405, "decode_tok_s": 6.347019300371761, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.9571073, "t_first": 1794390856.481022, "t1": 1794390884.3720913, "ttft_s": 16.523914575576782, "decode_tok_s": 9.14271146190513, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.9573832, "t_first": 1794390848.2107606, "t1": 1794390880.6290576, "ttft_s": 8.253377437591553, "decode_tok_s": 7.865928293147409, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.957726, "t_first": 1794390860.6176033, "t1": 1794390884.0783978, "ttft_s": 20.65987730026245, "decode_tok_s": 10.869197143171423, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.9581394, "t_first": 1794390852.3457966, "t1": 1794390881.7982364, "ttft_s": 12.387657165527344, "decode_tok_s": 8.658026359155437, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.9585032, "t_first": 1794390864.7505422, "t1": 1794390883.3467577, "ttft_s": 24.792038917541504, "decode_tok_s": 13.712467474081222, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.958681, "t_first": 1794390873.0187528, "t1": 1794390882.6175997, "ttft_s": 33.06007170677185, "decode_tok_s": 26.565690892622698, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794390839.9594069, "t_first": 1794390868.8853347, "t1": 1794390882.617031, "ttft_s": 28.925927877426147, "decode_tok_s": 18.570174665958756, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.415769815444946, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.256174, "t_first": 1794390894.5373495, "t1": 1794390934.7030733, "ttft_s": 4.281175374984741, "decode_tok_s": 6.348696746149887, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.2564347, "t_first": 1794390898.8375309, "t1": 1794390933.4508002, "ttft_s": 8.581096172332764, "decode_tok_s": 7.367116858442211, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.2570212, "t_first": 1794390903.1437953, "t1": 1794390934.7650836, "ttft_s": 12.886774063110352, "decode_tok_s": 8.064187568333319, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.2572315, "t_first": 1794390916.0579166, "t1": 1794390934.0131073, "ttft_s": 25.800685167312622, "decode_tok_s": 14.202021290055091, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.2573676, "t_first": 1794390911.7543857, "t1": 1794390935.145204, "ttft_s": 21.497018098831177, "decode_tok_s": 10.901713488728358, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.257475, "t_first": 1794390907.4476106, "t1": 1794390934.9667702, "ttft_s": 17.190135717391968, "decode_tok_s": 9.266271358553759, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.2575986, "t_first": 1794390920.3619328, "t1": 1794390934.3595066, "ttft_s": 30.104334115982056, "decode_tok_s": 18.217442728744366, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390890.257962, "t_first": 1794390924.6679654, "t1": 1794390935.796383, "ttft_s": 34.410003423690796, "decode_tok_s": 22.914309261430176, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.54052138328552, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7968946, "t_first": 1794390948.6946626, "t1": 1794390979.3028948, "ttft_s": 12.897768020629883, "decode_tok_s": 8.331092035501946, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7971876, "t_first": 1794390944.38615, "t1": 1794390979.3021626, "ttft_s": 8.588962316513062, "decode_tok_s": 7.303239396884521, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7973533, "t_first": 1794390940.0781908, "t1": 1794390981.5285308, "ttft_s": 4.280837535858154, "decode_tok_s": 6.151939882750904, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7977717, "t_first": 1794390953.000567, "t1": 1794390981.6605997, "ttft_s": 17.202795267105103, "decode_tok_s": 8.897407837307208, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.797968, "t_first": 1794390957.3036642, "t1": 1794390981.1115792, "ttft_s": 21.505696296691895, "decode_tok_s": 10.710723736061318, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7983823, "t_first": 1794390965.9194524, "t1": 1794390979.8422976, "ttft_s": 30.12107014656067, "decode_tok_s": 18.31522204743098, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7986407, "t_first": 1794390970.2297368, "t1": 1794390979.1651354, "ttft_s": 34.43109607696533, "decode_tok_s": 28.538178544096183, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390935.7989795, "t_first": 1794390961.6101215, "t1": 1794390979.304104, "ttft_s": 25.811141967773438, "decode_tok_s": 14.41167914244469, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.8643274307251, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6617, "t_first": 1794390990.23851, "t1": 1794391026.3461096, "ttft_s": 8.576809883117676, "decode_tok_s": 7.062225178900105, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6622224, "t_first": 1794390994.538767, "t1": 1794391024.469316, "ttft_s": 12.876544713973999, "decode_tok_s": 8.51972347042729, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6625178, "t_first": 1794390985.9362147, "t1": 1794391027.274434, "ttft_s": 4.2736968994140625, "decode_tok_s": 6.168625636883741, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.662856, "t_first": 1794390998.8422682, "t1": 1794391025.3820808, "ttft_s": 17.179412126541138, "decode_tok_s": 9.608206515283754, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6634057, "t_first": 1794391007.4531689, "t1": 1794391025.8675165, "ttft_s": 25.78976321220398, "decode_tok_s": 13.847897566933451, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6635497, "t_first": 1794391003.1425617, "t1": 1794391026.6146936, "ttft_s": 21.47901201248169, "decode_tok_s": 10.863947099163989, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.6636682, "t_first": 1794391016.0564723, "t1": 1794391024.7499795, "ttft_s": 34.39280414581299, "decode_tok_s": 29.33223545967371, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794390981.663984, "t_first": 1794391011.7575326, "t1": 1794391026.783928, "ttft_s": 30.09354853630066, "decode_tok_s": 16.970137851055615, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.6135458946228, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.275157, "t_first": 1794391031.5491414, "t1": 1794391071.5404677, "ttft_s": 4.273984432220459, "decode_tok_s": 6.376382665642358, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.275617, "t_first": 1794391061.6748393, "t1": 1794391070.4054635, "ttft_s": 34.3992223739624, "decode_tok_s": 29.207533641378337, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.2758422, "t_first": 1794391053.0681653, "t1": 1794391072.3589296, "ttft_s": 25.792323112487793, "decode_tok_s": 13.218760833618727, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.2759733, "t_first": 1794391040.1537251, "t1": 1794391071.541132, "ttft_s": 12.87775182723999, "decode_tok_s": 8.12427740250947, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.2761106, "t_first": 1794391035.8528404, "t1": 1794391070.8927388, "ttft_s": 8.576729774475098, "decode_tok_s": 7.277418362390841, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.2762852, "t_first": 1794391057.3698936, "t1": 1794391072.5309653, "ttft_s": 30.093608379364014, "decode_tok_s": 16.819391382412974, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.2764537, "t_first": 1794391044.458717, "t1": 1794391070.2650452, "ttft_s": 17.182263374328613, "decode_tok_s": 9.881297309112927, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391027.276704, "t_first": 1794391048.7624326, "t1": 1794391072.7271652, "ttft_s": 21.48572850227356, "decode_tok_s": 10.640636127961878, "label": "p2-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.452308654785156, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1-greedy.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1-greedy.jsonl new file mode 100644 index 00000000000..045e56683df --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1-greedy.jsonl @@ -0,0 +1,2 @@ +{"ok": true, "token_sha256": "5d721308b699d401dae7698a19eb8af0418c8a4ab835f68c3c71c394b8e9102f", "text_sha256": "ef79dee7153a363aadcf383ed572fbe239fe1f0074f21a92400f0b7efab01337", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391102.0834396, "t_first": 1794391102.170267, "t1": 1794391104.1665876, "ttft_s": 0.08682751655578613, "decode_tok_s": 127.73500135850499, "label": "p3-branch-par1-greedy", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 2.0838348865509033, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "356fb0b3163a59e43a18c611211d279e96191c0ab6e4f01e8eb13b7445e099f6", "text_sha256": "5d3300bf0d0b7e170a26c73e967ef7ef9a3319996f826e21759a8b4143449b62", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391104.1672163, "t_first": 1794391104.246111, "t1": 1794391107.5572522, "ttft_s": 0.07889461517333984, "decode_tok_s": 77.01272176356265, "label": "p3-branch-par1-greedy", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 3.3904616832733154, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1.jsonl new file mode 100644 index 00000000000..5a23f2ab2b5 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par1.jsonl @@ -0,0 +1,16 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391107.5935802, "t_first": 1794391107.6760538, "t1": 1794391109.3319938, "ttft_s": 0.0824735164642334, "decode_tok_s": 153.99108144016947, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7390506267547607, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391109.3328137, "t_first": 1794391109.4102323, "t1": 1794391111.0176766, "ttft_s": 0.07741856575012207, "decode_tok_s": 158.63691336985008, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6854441165924072, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391111.0181768, "t_first": 1794391111.0948627, "t1": 1794391112.7029922, "ttft_s": 0.07668590545654297, "decode_tok_s": 158.5693190673247, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.6851537227630615, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391112.7037659, "t_first": 1794391112.7812123, "t1": 1794391114.389048, "ttft_s": 0.07744646072387695, "decode_tok_s": 158.59828771876545, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.685682773590088, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391114.3895702, "t_first": 1794391114.469016, "t1": 1794391117.7354052, "ttft_s": 0.07944583892822266, "decode_tok_s": 78.06785711392124, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.3464229106903076, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391117.7361708, "t_first": 1794391117.8154233, "t1": 1794391120.9807289, "ttft_s": 0.07925248146057129, "decode_tok_s": 80.56094136192333, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2449533939361572, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391120.9812765, "t_first": 1794391121.0607965, "t1": 1794391124.2263598, "ttft_s": 0.07951998710632324, "decode_tok_s": 80.55438233651557, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2454824447631836, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391124.2268443, "t_first": 1794391124.3058045, "t1": 1794391127.4717152, "ttft_s": 0.07896018028259277, "decode_tok_s": 80.54554360065283, "label": "p3-branch-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2453222274780273, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391133.550009, "t_first": 1794391137.6439414, "t1": 1794391141.643246, "ttft_s": 4.093932390213013, "decode_tok_s": 63.7610859327117, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.093852281570435, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391141.643968, "t_first": 1794391145.7400439, "t1": 1794391149.6390793, "ttft_s": 4.096075773239136, "decode_tok_s": 65.40079027794253, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.9955689907073975, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391149.6395824, "t_first": 1794391153.737605, "t1": 1794391157.636821, "ttft_s": 4.098022699356079, "decode_tok_s": 65.39776307397287, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.997596263885498, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391157.6372542, "t_first": 1794391161.7358513, "t1": 1794391165.6352313, "ttft_s": 4.098597049713135, "decode_tok_s": 65.39501204052415, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.998507022857666, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391171.523905, "t_first": 1794391175.7902498, "t1": 1794391180.0414162, "ttft_s": 4.266344785690308, "decode_tok_s": 59.98353848904507, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.51811408996582, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391180.0419896, "t_first": 1794391184.3177822, "t1": 1794391188.5033972, "ttft_s": 4.275792598724365, "decode_tok_s": 60.92294589428348, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.46173357963562, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391188.50395, "t_first": 1794391192.775358, "t1": 1794391196.9615479, "ttft_s": 4.271407842636108, "decode_tok_s": 60.9145802522623, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.458035707473755, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391196.9620404, "t_first": 1794391201.2327232, "t1": 1794391205.4184644, "ttft_s": 4.2706828117370605, "decode_tok_s": 60.92111018336411, "label": "p3-branch-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.456809043884277, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par4.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par4.jsonl new file mode 100644 index 00000000000..0c5d37efb29 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par4.jsonl @@ -0,0 +1,64 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391234.812673, "t_first": 1794391235.2203789, "t1": 1794391238.250783, "ttft_s": 0.40770578384399414, "decode_tok_s": 84.14719369186076, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.39432430267334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391234.8132179, "t_first": 1794391234.9563825, "t1": 1794391239.1206234, "ttft_s": 0.14316463470458984, "decode_tok_s": 61.23565134089526, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.39432430267334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391234.813533, "t_first": 1794391235.0907571, "t1": 1794391238.9532843, "ttft_s": 0.277224063873291, "decode_tok_s": 66.01895372724476, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.39432430267334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391234.813847, "t_first": 1794391235.2989204, "t1": 1794391239.2065797, "ttft_s": 0.4850733280181885, "decode_tok_s": 65.25645685324344, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.39432430267334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391239.2071302, "t_first": 1794391239.3640418, "t1": 1794391242.252935, "ttft_s": 0.15691161155700684, "decode_tok_s": 88.26910126157722, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.300867319107056, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391239.2075284, "t_first": 1794391239.2849197, "t1": 1794391242.9165745, "ttft_s": 0.07739138603210449, "decode_tok_s": 70.21592587943591, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.300867319107056, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391239.2080536, "t_first": 1794391239.4433656, "t1": 1794391242.751639, "ttft_s": 0.23531198501586914, "decode_tok_s": 77.0794839745216, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.300867319107056, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391239.208266, "t_first": 1794391239.5224478, "t1": 1794391243.5075765, "ttft_s": 0.3141818046569824, "decode_tok_s": 63.9878967439774, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.300867319107056, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391243.5081012, "t_first": 1794391243.5846672, "t1": 1794391246.5292423, "ttft_s": 0.07656598091125488, "decode_tok_s": 86.59993167856408, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.17292857170105, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391243.5085325, "t_first": 1794391243.7418787, "t1": 1794391247.391678, "ttft_s": 0.23334622383117676, "decode_tok_s": 69.86685452035123, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.17292857170105, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391243.5087142, "t_first": 1794391243.6635861, "t1": 1794391247.0248017, "ttft_s": 0.15487194061279297, "decode_tok_s": 75.86541031468383, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.17292857170105, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391243.508935, "t_first": 1794391243.8199866, "t1": 1794391247.6807268, "ttft_s": 0.311051607131958, "decode_tok_s": 66.04951066249255, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.17292857170105, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391247.6812007, "t_first": 1794391247.7580051, "t1": 1794391250.693895, "ttft_s": 0.07680439949035645, "decode_tok_s": 86.85611638446112, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.161702394485474, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391247.6815689, "t_first": 1794391247.8363853, "t1": 1794391251.552908, "ttft_s": 0.1548163890838623, "decode_tok_s": 68.61252332369315, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.161702394485474, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391247.6818364, "t_first": 1794391247.9150743, "t1": 1794391251.189149, "ttft_s": 0.23323798179626465, "decode_tok_s": 77.88460395745439, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.161702394485474, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391247.6822615, "t_first": 1794391247.9935067, "t1": 1794391251.8425066, "ttft_s": 0.3112452030181885, "decode_tok_s": 66.25097467299675, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.161702394485474, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391251.843069, "t_first": 1794391251.9222503, "t1": 1794391257.3287344, "ttft_s": 0.07918119430541992, "decode_tok_s": 47.16558747013089, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.486417055130005, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391251.8434906, "t_first": 1794391252.0346136, "t1": 1794391257.0067704, "ttft_s": 0.19112300872802734, "decode_tok_s": 51.28559137427626, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.486417055130005, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391251.8436034, "t_first": 1794391252.2004812, "t1": 1794391257.179414, "ttft_s": 0.35687780380249023, "decode_tok_s": 51.215794086315874, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.486417055130005, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391251.8438756, "t_first": 1794391252.116271, "t1": 1794391257.329181, "ttft_s": 0.27239537239074707, "decode_tok_s": 48.917016232089885, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.486417055130005, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391257.3295074, "t_first": 1794391257.408701, "t1": 1794391262.68192, "ttft_s": 0.0791935920715332, "decode_tok_s": 48.357558210508934, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.352698087692261, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391257.329767, "t_first": 1794391257.489441, "t1": 1794391262.3523345, "ttft_s": 0.15967392921447754, "decode_tok_s": 52.437914943450465, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.352698087692261, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391257.3299248, "t_first": 1794391257.5704048, "t1": 1794391262.4775171, "ttft_s": 0.2404799461364746, "decode_tok_s": 51.96538845912391, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.352698087692261, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391257.3303308, "t_first": 1794391257.651212, "t1": 1794391262.591834, "ttft_s": 0.3208811283111572, "decode_tok_s": 51.61293361201953, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.352698087692261, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391262.6825967, "t_first": 1794391262.7633498, "t1": 1794391268.1035502, "ttft_s": 0.08075308799743652, "decode_tok_s": 47.75101676796546, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.421396255493164, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391262.6829748, "t_first": 1794391262.844575, "t1": 1794391267.6699202, "ttft_s": 0.16160011291503906, "decode_tok_s": 52.84595926718585, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.421396255493164, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391262.6834726, "t_first": 1794391262.9252138, "t1": 1794391267.7952738, "ttft_s": 0.24174118041992188, "decode_tok_s": 52.36075155660448, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.421396255493164, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391262.6840127, "t_first": 1794391263.0061302, "t1": 1794391267.9876778, "ttft_s": 0.32211756706237793, "decode_tok_s": 51.18891171561384, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.421396255493164, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391268.1039975, "t_first": 1794391268.1831307, "t1": 1794391273.4151993, "ttft_s": 0.07913327217102051, "decode_tok_s": 48.73789364866147, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.311557292938232, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391268.1043825, "t_first": 1794391268.2641761, "t1": 1794391273.0904794, "ttft_s": 0.15979361534118652, "decode_tok_s": 52.835469950253874, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.311557292938232, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391268.1045682, "t_first": 1794391268.4261537, "t1": 1794391273.2165473, "ttft_s": 0.32158541679382324, "decode_tok_s": 53.231534144284744, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.311557292938232, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391268.1046562, "t_first": 1794391268.3452759, "t1": 1794391273.3301008, "ttft_s": 0.24061965942382812, "decode_tok_s": 51.15525727129271, "label": "p3-branch-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.311557292938232, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391279.4902217, "t_first": 1794391283.5886374, "t1": 1794391302.0146756, "ttft_s": 4.0984156131744385, "decode_tok_s": 13.839111605515866, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.67427134513855, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391279.4907184, "t_first": 1794391287.7088385, "t1": 1794391302.9722316, "ttft_s": 8.218120098114014, "decode_tok_s": 16.706639032713113, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.67427134513855, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391279.4911766, "t_first": 1794391295.9481204, "t1": 1794391301.1382267, "ttft_s": 16.45694375038147, "decode_tok_s": 49.13194080137502, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.67427134513855, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391279.4915147, "t_first": 1794391291.8285768, "t1": 1794391303.1641216, "ttft_s": 12.337062120437622, "decode_tok_s": 22.495610395947008, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.67427134513855, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391303.1646638, "t_first": 1794391307.2640524, "t1": 1794391325.6100335, "ttft_s": 4.099388599395752, "decode_tok_s": 13.899501930002073, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.629738330841064, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391303.1651828, "t_first": 1794391311.3891354, "t1": 1794391326.6652815, "ttft_s": 8.223952531814575, "decode_tok_s": 16.69269180225163, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.629738330841064, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391303.1655905, "t_first": 1794391315.516192, "t1": 1794391324.7475512, "ttft_s": 12.350601434707642, "decode_tok_s": 27.62323437715938, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.629738330841064, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391303.16609, "t_first": 1794391319.643088, "t1": 1794391326.7938535, "ttft_s": 16.47699809074402, "decode_tok_s": 35.66051814848013, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.629738330841064, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391326.7947614, "t_first": 1794391330.894367, "t1": 1794391349.2369606, "ttft_s": 4.099605560302734, "decode_tok_s": 13.902068845289444, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.653218269348145, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391326.7955208, "t_first": 1794391335.0147138, "t1": 1794391350.2573466, "ttft_s": 8.21919298171997, "decode_tok_s": 16.729393290733643, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.653218269348145, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391326.7961488, "t_first": 1794391339.1402385, "t1": 1794391348.374234, "ttft_s": 12.34408974647522, "decode_tok_s": 27.615348277198994, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.653218269348145, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391326.7964847, "t_first": 1794391343.269468, "t1": 1794391350.447528, "ttft_s": 16.472983360290527, "decode_tok_s": 35.52491989810331, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.653218269348145, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391350.4479218, "t_first": 1794391362.8082647, "t1": 1794391373.0845299, "ttft_s": 12.360342979431152, "decode_tok_s": 24.814462882971423, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.777941703796387, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391350.4482126, "t_first": 1794391366.942235, "t1": 1794391374.160886, "ttft_s": 16.494022369384766, "decode_tok_s": 35.325159508550605, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.777941703796387, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391350.4485059, "t_first": 1794391354.5511715, "t1": 1794391371.8189745, "ttft_s": 4.102665662765503, "decode_tok_s": 14.767367955462106, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.777941703796387, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391350.448698, "t_first": 1794391358.6782715, "t1": 1794391374.2254937, "ttft_s": 8.229573488235474, "decode_tok_s": 16.40164382714641, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.777941703796387, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391380.1174567, "t_first": 1794391397.2987394, "t1": 1794391404.1833813, "ttft_s": 17.18128275871277, "decode_tok_s": 37.03896357013564, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.066285371780396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391380.117735, "t_first": 1794391384.3974433, "t1": 1794391403.81018, "ttft_s": 4.279708385467529, "decode_tok_s": 13.13570593066063, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.066285371780396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391380.118102, "t_first": 1794391388.6940637, "t1": 1794391403.9382312, "ttft_s": 8.575961589813232, "decode_tok_s": 16.72770906584189, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.066285371780396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391380.1184947, "t_first": 1794391392.9968123, "t1": 1794391404.0474021, "ttft_s": 12.878317594528198, "decode_tok_s": 23.075691399091333, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.066285371780396, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391404.1839907, "t_first": 1794391408.4636118, "t1": 1794391427.695816, "ttft_s": 4.279621124267578, "decode_tok_s": 13.259010634642518, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.032854557037354, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391404.184671, "t_first": 1794391412.7673016, "t1": 1794391427.824231, "ttft_s": 8.582630634307861, "decode_tok_s": 16.93572401611259, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.032854557037354, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391404.1851807, "t_first": 1794391417.0727396, "t1": 1794391428.2163308, "ttft_s": 12.887558937072754, "decode_tok_s": 22.883107986632922, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.032854557037354, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391404.1856513, "t_first": 1794391421.3762128, "t1": 1794391428.0533001, "ttft_s": 17.190561532974243, "decode_tok_s": 38.190304885420964, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.032854557037354, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391428.2169187, "t_first": 1794391432.4849453, "t1": 1794391451.6854534, "ttft_s": 4.26802659034729, "decode_tok_s": 13.280898528161853, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.9593026638031, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391428.2174008, "t_first": 1794391436.7852786, "t1": 1794391451.8142052, "ttft_s": 8.567877769470215, "decode_tok_s": 16.967279606932475, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.9593026638031, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391428.2178762, "t_first": 1794391445.3975537, "t1": 1794391452.1757777, "ttft_s": 17.179677486419678, "decode_tok_s": 37.62047408344135, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.9593026638031, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391428.218217, "t_first": 1794391441.0873315, "t1": 1794391452.0437503, "ttft_s": 12.869114637374878, "decode_tok_s": 23.27402828938531, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.9593026638031, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391452.1763334, "t_first": 1794391456.4514256, "t1": 1794391475.651448, "ttft_s": 4.275092124938965, "decode_tok_s": 13.281234464393474, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 23.96488308906555, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391452.1766574, "t_first": 1794391460.7538385, "t1": 1794391475.780042, "ttft_s": 8.577181100845337, "decode_tok_s": 16.97035460753217, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 23.96488308906555, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391452.1772604, "t_first": 1794391465.0592773, "t1": 1794391476.1408186, "ttft_s": 12.882016897201538, "decode_tok_s": 23.011239420652004, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 23.96488308906555, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391452.1774309, "t_first": 1794391469.3649688, "t1": 1794391476.0092633, "ttft_s": 17.187537908554077, "decode_tok_s": 38.37879250935233, "label": "p3-branch-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 23.96488308906555, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par8.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par8.jsonl new file mode 100644 index 00000000000..e93e6fcb53d --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p3-branch-par8.jsonl @@ -0,0 +1,128 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.524968, "t_first": 1794391506.4324303, "t1": 1794391511.6249845, "ttft_s": 0.9074623584747314, "decode_tok_s": 49.10877930916591, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.525518, "t_first": 1794391506.5110738, "t1": 1794391512.7901895, "ttft_s": 0.98555588722229, "decode_tok_s": 40.61081418501761, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5258367, "t_first": 1794391505.9250329, "t1": 1794391512.5639582, "ttft_s": 0.39919614791870117, "decode_tok_s": 38.409831100855854, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5261128, "t_first": 1794391505.7992861, "t1": 1794391513.2886465, "ttft_s": 0.27317333221435547, "decode_tok_s": 34.04830168122694, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5264506, "t_first": 1794391506.0503945, "t1": 1794391513.075831, "ttft_s": 0.5239439010620117, "decode_tok_s": 36.29667759149818, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5266452, "t_first": 1794391505.6699245, "t1": 1794391512.605387, "ttft_s": 0.1432793140411377, "decode_tok_s": 36.76755528931154, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5268078, "t_first": 1794391506.1727276, "t1": 1794391512.242651, "ttft_s": 0.6459197998046875, "decode_tok_s": 42.010414820568705, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391505.5271604, "t_first": 1794391506.2983391, "t1": 1794391512.3818204, "ttft_s": 0.7711787223815918, "decode_tok_s": 41.91678858377714, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.764539003372192, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2895095, "t_first": 1794391513.4445517, "t1": 1794391519.9603863, "ttft_s": 0.15504217147827148, "decode_tok_s": 39.13543188723086, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.289742, "t_first": 1794391513.366736, "t1": 1794391520.360591, "ttft_s": 0.07699394226074219, "decode_tok_s": 36.460578610321534, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2898982, "t_first": 1794391513.7585373, "t1": 1794391519.916675, "ttft_s": 0.4686391353607178, "decode_tok_s": 41.40862194899381, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2902014, "t_first": 1794391513.6794658, "t1": 1794391520.3600957, "ttft_s": 0.3892643451690674, "decode_tok_s": 38.17005300351781, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2902882, "t_first": 1794391513.5229604, "t1": 1794391520.3598175, "ttft_s": 0.23267221450805664, "decode_tok_s": 37.297839782085674, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2904556, "t_first": 1794391513.6010559, "t1": 1794391519.638859, "ttft_s": 0.31060028076171875, "decode_tok_s": 42.233904069208876, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2905731, "t_first": 1794391513.8363063, "t1": 1794391519.3639414, "ttft_s": 0.5457332134246826, "decode_tok_s": 46.131843998740194, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391513.2908425, "t_first": 1794391513.914387, "t1": 1794391519.5468872, "ttft_s": 0.623544454574585, "decode_tok_s": 45.27296799438615, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.071725845336914, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3613493, "t_first": 1794391520.441008, "t1": 1794391526.5633562, "ttft_s": 0.07965874671936035, "decode_tok_s": 41.65068648146545, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3616223, "t_first": 1794391520.519109, "t1": 1794391527.3608432, "ttft_s": 0.1574866771697998, "decode_tok_s": 37.27125223369288, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3619678, "t_first": 1794391520.596992, "t1": 1794391526.9668415, "ttft_s": 0.23502421379089355, "decode_tok_s": 40.03234334883465, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.362231, "t_first": 1794391520.753116, "t1": 1794391527.6595592, "ttft_s": 0.3908848762512207, "decode_tok_s": 36.92204319959839, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3623405, "t_first": 1794391520.8309557, "t1": 1794391527.2368522, "ttft_s": 0.4686152935028076, "decode_tok_s": 39.807075087099925, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3624263, "t_first": 1794391520.908935, "t1": 1794391526.7868106, "ttft_s": 0.5465087890625, "decode_tok_s": 43.383021146975025, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3625429, "t_first": 1794391520.6750498, "t1": 1794391525.7887502, "ttft_s": 0.31250691413879395, "decode_tok_s": 49.86604230970178, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391520.3631856, "t_first": 1794391520.9870687, "t1": 1794391526.6990047, "ttft_s": 0.6238830089569092, "decode_tok_s": 44.643357371916615, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.298856258392334, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6603577, "t_first": 1794391528.1308308, "t1": 1794391534.1234283, "ttft_s": 0.470473051071167, "decode_tok_s": 42.5524985780657, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6605978, "t_first": 1794391527.737697, "t1": 1794391534.396721, "ttft_s": 0.07709908485412598, "decode_tok_s": 38.29390012614048, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6609643, "t_first": 1794391527.816378, "t1": 1794391534.4809053, "ttft_s": 0.15541386604309082, "decode_tok_s": 38.26227925801164, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.661227, "t_first": 1794391528.0518603, "t1": 1794391534.85202, "ttft_s": 0.39063334465026855, "decode_tok_s": 37.49911936205455, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6613379, "t_first": 1794391527.9734614, "t1": 1794391534.5985436, "ttft_s": 0.31212353706359863, "decode_tok_s": 38.49008815404017, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6614382, "t_first": 1794391527.8950531, "t1": 1794391534.31174, "ttft_s": 0.23361492156982422, "decode_tok_s": 39.74013521449338, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6615922, "t_first": 1794391528.2872624, "t1": 1794391533.4745872, "ttft_s": 0.6256701946258545, "decode_tok_s": 49.15828710997367, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391527.6618462, "t_first": 1794391528.208762, "t1": 1794391533.9871647, "ttft_s": 0.5469157695770264, "decode_tok_s": 44.12984151344727, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.192138671875, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8526387, "t_first": 1794391534.931592, "t1": 1794391542.3235, "ttft_s": 0.07895326614379883, "decode_tok_s": 34.497182919740865, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8531408, "t_first": 1794391535.0165088, "t1": 1794391542.5186527, "ttft_s": 0.16336798667907715, "decode_tok_s": 33.99028394593424, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.853394, "t_first": 1794391535.0988593, "t1": 1794391542.519049, "ttft_s": 0.24546527862548828, "decode_tok_s": 34.365698599513, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8535063, "t_first": 1794391535.1796384, "t1": 1794391543.2505226, "ttft_s": 0.32613205909729004, "decode_tok_s": 31.595051149804934, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8538537, "t_first": 1794391535.260701, "t1": 1794391543.5428169, "ttft_s": 0.4068472385406494, "decode_tok_s": 30.7892333265933, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8540468, "t_first": 1794391535.3415406, "t1": 1794391543.4133723, "ttft_s": 0.48749375343322754, "decode_tok_s": 31.59134250771716, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.8541248, "t_first": 1794391535.4226835, "t1": 1794391542.746648, "ttft_s": 0.5685586929321289, "decode_tok_s": 34.81720817525765, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391534.854583, "t_first": 1794391535.5034256, "t1": 1794391542.6095717, "ttft_s": 0.6488425731658936, "decode_tok_s": 35.88442969123282, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.690826654434204, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.543502, "t_first": 1794391543.6228275, "t1": 1794391550.8210154, "ttft_s": 0.07932543754577637, "decode_tok_s": 35.425582951005765, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5437453, "t_first": 1794391543.7038827, "t1": 1794391551.0095499, "ttft_s": 0.16013741493225098, "decode_tok_s": 34.90440973391294, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5440226, "t_first": 1794391543.7869766, "t1": 1794391551.0093899, "ttft_s": 0.24295401573181152, "decode_tok_s": 35.306758192330726, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5442605, "t_first": 1794391543.8679776, "t1": 1794391551.7265122, "ttft_s": 0.3237171173095703, "decode_tok_s": 32.4487978747543, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5443556, "t_first": 1794391543.9488008, "t1": 1794391552.0447235, "ttft_s": 0.40444517135620117, "decode_tok_s": 31.497336274210607, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5448773, "t_first": 1794391544.110579, "t1": 1794391551.917027, "ttft_s": 0.5657017230987549, "decode_tok_s": 32.665304446046704, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.545151, "t_first": 1794391544.0294235, "t1": 1794391551.23312, "ttft_s": 0.48427248001098633, "decode_tok_s": 35.398493034452045, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391543.5452764, "t_first": 1794391544.191515, "t1": 1794391551.0988731, "ttft_s": 0.6462385654449463, "decode_tok_s": 36.917153235794, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.50186824798584, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0456536, "t_first": 1794391552.124952, "t1": 1794391559.3181856, "ttft_s": 0.07929849624633789, "decode_tok_s": 35.44998231391293, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0460427, "t_first": 1794391552.2055318, "t1": 1794391559.5058692, "ttft_s": 0.15948915481567383, "decode_tok_s": 34.929892826982666, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0462654, "t_first": 1794391552.2863479, "t1": 1794391559.5060112, "ttft_s": 0.2400825023651123, "decode_tok_s": 35.320206292542736, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0464406, "t_first": 1794391552.6911457, "t1": 1794391560.2216053, "ttft_s": 0.644705057144165, "decode_tok_s": 33.862474816793785, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.046543, "t_first": 1794391552.367451, "t1": 1794391560.5095596, "ttft_s": 0.3209080696105957, "decode_tok_s": 31.318668180320397, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0466495, "t_first": 1794391552.4484327, "t1": 1794391560.382349, "ttft_s": 0.4017832279205322, "decode_tok_s": 32.140495233726746, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0468824, "t_first": 1794391552.5293827, "t1": 1794391559.7292693, "ttft_s": 0.4825003147125244, "decode_tok_s": 35.417224682553076, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391552.0473616, "t_first": 1794391552.6100638, "t1": 1794391559.5952225, "ttft_s": 0.5627021789550781, "decode_tok_s": 36.50597096124262, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.464651584625244, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5103898, "t_first": 1794391560.5892754, "t1": 1794391567.7874818, "ttft_s": 0.07888555526733398, "decode_tok_s": 35.42549142860436, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5106218, "t_first": 1794391560.670224, "t1": 1794391567.9754763, "ttft_s": 0.15960216522216797, "decode_tok_s": 34.90639187434884, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5110471, "t_first": 1794391560.751232, "t1": 1794391567.9761755, "ttft_s": 0.24018478393554688, "decode_tok_s": 35.29439297826232, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5113454, "t_first": 1794391560.9935677, "t1": 1794391568.6918135, "ttft_s": 0.482222318649292, "decode_tok_s": 33.124429620032444, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.511456, "t_first": 1794391560.8317049, "t1": 1794391568.9798796, "ttft_s": 0.3202488422393799, "decode_tok_s": 31.295352324364504, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5116398, "t_first": 1794391560.9126017, "t1": 1794391568.851926, "ttft_s": 0.40096187591552734, "decode_tok_s": 32.11860201549913, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.5124102, "t_first": 1794391561.0745451, "t1": 1794391568.1988373, "ttft_s": 0.5621349811553955, "decode_tok_s": 35.79302970167409, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391560.512588, "t_first": 1794391561.155323, "t1": 1794391568.064839, "ttft_s": 0.6427350044250488, "decode_tok_s": 36.90562482984313, "label": "p3-branch-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.470040559768677, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.06035, "t_first": 1794391579.1667776, "t1": 1794391617.7544405, "ttft_s": 4.1064276695251465, "decode_tok_s": 6.608329725172612, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.060589, "t_first": 1794391583.2909148, "t1": 1794391618.6756427, "ttft_s": 8.230325698852539, "decode_tok_s": 7.20649881285703, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.060754, "t_first": 1794391587.4121044, "t1": 1794391615.5347154, "ttft_s": 12.3513503074646, "decode_tok_s": 9.06743686012555, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.0609143, "t_first": 1794391591.5380886, "t1": 1794391619.1393805, "ttft_s": 16.477174282073975, "decode_tok_s": 9.238697991777691, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.0610526, "t_first": 1794391599.7876182, "t1": 1794391617.755261, "ttft_s": 24.72656559944153, "decode_tok_s": 14.192178855280389, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.061226, "t_first": 1794391595.6631532, "t1": 1794391619.3958921, "ttft_s": 20.601927280426025, "decode_tok_s": 10.74465110428105, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.061397, "t_first": 1794391603.911544, "t1": 1794391618.2141345, "ttft_s": 28.850147008895874, "decode_tok_s": 17.828938213296706, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391575.061838, "t_first": 1794391608.0409827, "t1": 1794391617.8118474, "ttft_s": 32.97914481163025, "decode_tok_s": 26.0979971756853, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.33608889579773, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3966243, "t_first": 1794391635.8997502, "t1": 1794391660.838836, "ttft_s": 16.5031259059906, "decode_tok_s": 10.224913729510249, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.396866, "t_first": 1794391623.5044556, "t1": 1794391663.3874896, "ttft_s": 4.107589483261108, "decode_tok_s": 6.393696127993635, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3970847, "t_first": 1794391644.1590748, "t1": 1794391659.9879448, "ttft_s": 24.761990070343018, "decode_tok_s": 16.109804367884106, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3973684, "t_first": 1794391627.636176, "t1": 1794391663.8961189, "ttft_s": 8.238807678222656, "decode_tok_s": 7.032553846470672, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3975372, "t_first": 1794391631.7664227, "t1": 1794391663.2229004, "ttft_s": 12.368885517120361, "decode_tok_s": 8.106438454477454, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3977523, "t_first": 1794391640.0296001, "t1": 1794391662.8879142, "ttft_s": 20.631847858428955, "decode_tok_s": 11.155678392712456, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.398141, "t_first": 1794391652.4233785, "t1": 1794391662.1494532, "ttft_s": 33.02523756027222, "decode_tok_s": 26.2181823583667, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391619.3983107, "t_first": 1794391648.2902896, "t1": 1794391662.556136, "ttft_s": 28.891978979110718, "decode_tok_s": 17.874859681482985, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.50002145767212, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.8969772, "t_first": 1794391668.0020766, "t1": 1794391705.665071, "ttft_s": 4.105099439620972, "decode_tok_s": 6.770571595952164, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.897479, "t_first": 1794391672.1305776, "t1": 1794391707.3897784, "ttft_s": 8.23309850692749, "decode_tok_s": 7.232154845598596, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.898128, "t_first": 1794391676.2668226, "t1": 1794391703.8087966, "ttft_s": 12.368694543838501, "decode_tok_s": 9.258595602962384, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.8986008, "t_first": 1794391680.3968635, "t1": 1794391707.3907104, "ttft_s": 16.498262643814087, "decode_tok_s": 9.446597256324832, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.8990874, "t_first": 1794391688.6601262, "t1": 1794391706.7175014, "ttft_s": 24.761038780212402, "decode_tok_s": 14.121653744222147, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.8996024, "t_first": 1794391684.5284214, "t1": 1794391708.572133, "ttft_s": 20.62881898880005, "decode_tok_s": 10.605683664054, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.900058, "t_first": 1794391696.9253347, "t1": 1794391707.84453, "ttft_s": 33.02527666091919, "decode_tok_s": 23.353369029611827, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391663.900487, "t_first": 1794391692.7928514, "t1": 1794391708.0040605, "ttft_s": 28.892364501953125, "decode_tok_s": 16.763953411916393, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.67588520050049, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5731416, "t_first": 1794391712.6766033, "t1": 1794391750.293822, "ttft_s": 4.103461742401123, "decode_tok_s": 6.778810571059722, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5737386, "t_first": 1794391716.8050606, "t1": 1794391751.9876392, "ttft_s": 8.231322050094604, "decode_tok_s": 7.2479053670946705, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5741599, "t_first": 1794391720.9389694, "t1": 1794391748.4365754, "ttft_s": 12.364809513092041, "decode_tok_s": 9.273534562895914, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5747454, "t_first": 1794391725.0665374, "t1": 1794391751.988385, "ttft_s": 16.49179196357727, "decode_tok_s": 9.471861068398118, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5754197, "t_first": 1794391741.5800166, "t1": 1794391751.3157709, "ttft_s": 33.00459694862366, "decode_tok_s": 26.192115517011224, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5757399, "t_first": 1794391729.1927457, "t1": 1794391753.171474, "ttft_s": 20.617005825042725, "decode_tok_s": 10.634425515378336, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5763066, "t_first": 1794391733.3206909, "t1": 1794391752.442563, "ttft_s": 24.744384288787842, "decode_tok_s": 13.335514300628237, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794391708.5772827, "t_first": 1794391737.452623, "t1": 1794391752.6039307, "ttft_s": 28.875340223312378, "decode_tok_s": 16.83023030143688, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 44.599140644073486, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0278852, "t_first": 1794391763.3038554, "t1": 1794391802.2791412, "ttft_s": 4.275970220565796, "decode_tok_s": 6.542607577390333, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0282373, "t_first": 1794391767.6069455, "t1": 1794391804.7877872, "ttft_s": 8.578708171844482, "decode_tok_s": 6.8583708288506084, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0284066, "t_first": 1794391771.9065313, "t1": 1794391804.5256302, "ttft_s": 12.878124713897705, "decode_tok_s": 7.817505957723739, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0285628, "t_first": 1794391784.8097494, "t1": 1794391803.5994093, "ttft_s": 25.78118658065796, "decode_tok_s": 13.57129401557522, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0287204, "t_first": 1794391776.2066433, "t1": 1794391803.4655342, "ttft_s": 17.17792296409607, "decode_tok_s": 9.354745988822472, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0290496, "t_first": 1794391780.5089784, "t1": 1794391803.1219234, "ttft_s": 21.479928731918335, "decode_tok_s": 11.276726631585497, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0293138, "t_first": 1794391789.1129184, "t1": 1794391802.4874976, "ttft_s": 30.08360457420349, "decode_tok_s": 19.06602042235696, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391759.0297232, "t_first": 1794391793.415603, "t1": 1794391802.210612, "ttft_s": 34.38587975502014, "decode_tok_s": 28.99371632832408, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.7605299949646, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7887309, "t_first": 1794391809.0670683, "t1": 1794391850.1687074, "ttft_s": 4.278337478637695, "decode_tok_s": 6.204132146633134, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7893226, "t_first": 1794391817.6895587, "t1": 1794391848.605061, "ttft_s": 12.900236129760742, "decode_tok_s": 8.248289076615567, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7897108, "t_first": 1794391813.3785708, "t1": 1794391848.051714, "ttft_s": 8.588860034942627, "decode_tok_s": 7.354395270957818, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7903845, "t_first": 1794391830.6006968, "t1": 1794391848.5425382, "ttft_s": 25.810312271118164, "decode_tok_s": 14.212588040878398, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7907643, "t_first": 1794391826.2980378, "t1": 1794391848.265205, "ttft_s": 21.50727343559265, "decode_tok_s": 11.608233250370262, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.791385, "t_first": 1794391821.9950843, "t1": 1794391849.99617, "ttft_s": 17.203699350357056, "decode_tok_s": 9.106789722439256, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.791748, "t_first": 1794391834.906578, "t1": 1794391848.9695294, "ttft_s": 30.114830017089844, "decode_tok_s": 18.13275137501436, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391804.7920983, "t_first": 1794391839.210795, "t1": 1794391850.4344437, "ttft_s": 34.418696641922, "decode_tok_s": 22.719884134801205, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.64615845680237, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4351132, "t_first": 1794391854.7055395, "t1": 1794391895.6631138, "ttft_s": 4.270426273345947, "decode_tok_s": 6.225954635687584, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.435609, "t_first": 1794391859.0114765, "t1": 1794391894.4344537, "ttft_s": 8.575867414474487, "decode_tok_s": 7.198717332391674, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.436109, "t_first": 1794391876.2365613, "t1": 1794391896.0247943, "ttft_s": 25.80045223236084, "decode_tok_s": 12.886446175452827, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4363325, "t_first": 1794391863.317137, "t1": 1794391894.5645156, "ttft_s": 12.880804538726807, "decode_tok_s": 8.160684560598327, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4367294, "t_first": 1794391867.6221285, "t1": 1794391896.154422, "ttft_s": 17.185399055480957, "decode_tok_s": 8.937241567368604, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4372656, "t_first": 1794391871.924475, "t1": 1794391894.093995, "ttft_s": 21.48720932006836, "decode_tok_s": 11.502278731934576, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4376016, "t_first": 1794391884.841359, "t1": 1794391894.0945346, "ttft_s": 34.40375733375549, "decode_tok_s": 27.558106242639905, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391850.4381862, "t_first": 1794391880.5380387, "t1": 1794391893.8157518, "ttft_s": 30.099852561950684, "decode_tok_s": 19.20511452841418, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.72009086608887, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.155569, "t_first": 1794391909.0455086, "t1": 1794391940.3970025, "ttft_s": 12.889939546585083, "decode_tok_s": 8.133583724539173, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1558661, "t_first": 1794391904.7373946, "t1": 1794391939.2312105, "ttft_s": 8.581528425216675, "decode_tok_s": 7.392629471538604, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1560657, "t_first": 1794391900.4330916, "t1": 1794391941.8913662, "ttft_s": 4.277025938034058, "decode_tok_s": 6.150762482098669, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1563234, "t_first": 1794391921.956484, "t1": 1794391939.7185445, "ttft_s": 25.8001606464386, "decode_tok_s": 14.3564425636737, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.156613, "t_first": 1794391917.654451, "t1": 1794391940.265546, "ttft_s": 21.497837781906128, "decode_tok_s": 11.277649218523157, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1568844, "t_first": 1794391930.561786, "t1": 1794391941.6475978, "ttft_s": 34.4049015045166, "decode_tok_s": 23.00237487086606, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1570985, "t_first": 1794391913.3502617, "t1": 1794391939.160082, "ttft_s": 17.1931631565094, "decode_tok_s": 9.879960259844989, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794391896.1572886, "t_first": 1794391926.2592142, "t1": 1794391941.696881, "ttft_s": 30.10192561149597, "decode_tok_s": 16.51804004888443, "label": "p3-branch-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.736451864242554, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1-greedy.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1-greedy.jsonl new file mode 100644 index 00000000000..8a59734e958 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1-greedy.jsonl @@ -0,0 +1,2 @@ +{"ok": true, "token_sha256": "5d721308b699d401dae7698a19eb8af0418c8a4ab835f68c3c71c394b8e9102f", "text_sha256": "ef79dee7153a363aadcf383ed572fbe239fe1f0074f21a92400f0b7efab01337", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391971.2864752, "t_first": 1794391971.3783002, "t1": 1794391973.3742533, "ttft_s": 0.09182500839233398, "decode_tok_s": 127.75851404875081, "label": "p4-main-par1-greedy", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 2.0882558822631836, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "356fb0b3163a59e43a18c611211d279e96191c0ab6e4f01e8eb13b7445e099f6", "text_sha256": "5d3300bf0d0b7e170a26c73e967ef7ef9a3319996f826e21759a8b4143449b62", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391973.374844, "t_first": 1794391973.453484, "t1": 1794391976.7676027, "ttft_s": 0.07863998413085938, "decode_tok_s": 76.94353430014817, "label": "p4-main-par1-greedy", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": null, "greedy": true, "wave_wall_s": 3.3933281898498535, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1.jsonl new file mode 100644 index 00000000000..bd968dbab72 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par1.jsonl @@ -0,0 +1,16 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391976.8059692, "t_first": 1794391976.888714, "t1": 1794391978.6020093, "ttft_s": 0.08274483680725098, "decode_tok_s": 148.8359955864678, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7966687679290771, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391978.6026912, "t_first": 1794391978.6800094, "t1": 1794391980.3470032, "ttft_s": 0.07731819152832031, "decode_tok_s": 152.96996987505077, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7448978424072266, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391980.3475785, "t_first": 1794391980.4253757, "t1": 1794391982.0919318, "ttft_s": 0.07779717445373535, "decode_tok_s": 153.0101488646064, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.7446770668029785, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794391982.0926764, "t_first": 1794391982.169295, "t1": 1794391983.836123, "ttft_s": 0.07661867141723633, "decode_tok_s": 152.9851986423471, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 1.743828296661377, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391983.8365228, "t_first": 1794391983.9160113, "t1": 1794391987.1977694, "ttft_s": 0.07948851585388184, "decode_tok_s": 77.70225426782193, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.3616933822631836, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391987.1985395, "t_first": 1794391987.2780125, "t1": 1794391990.4586377, "ttft_s": 0.07947301864624023, "decode_tok_s": 80.17291694042558, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.2604877948760986, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391990.4591784, "t_first": 1794391990.5387328, "t1": 1794391993.72017, "ttft_s": 0.07955431938171387, "decode_tok_s": 80.15245300948035, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.261536121368408, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794391993.7207267, "t_first": 1794391993.79999, "t1": 1794391996.981763, "ttft_s": 0.07926321029663086, "decode_tok_s": 80.14399651473404, "label": "p4-main-par1", "parallel": 1, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 3.261561155319214, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392003.0910134, "t_first": 1794392007.184129, "t1": 1794392011.2116983, "ttft_s": 4.093115568161011, "decode_tok_s": 63.31362203535816, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.121087312698364, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392011.2121813, "t_first": 1794392015.3088803, "t1": 1794392019.2350135, "ttft_s": 4.096698999404907, "decode_tok_s": 64.94940183621017, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.023354530334473, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392019.2357948, "t_first": 1794392023.334561, "t1": 1794392027.2603333, "ttft_s": 4.098766326904297, "decode_tok_s": 64.9553737844107, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.025152206420898, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392027.2608821, "t_first": 1794392031.3593075, "t1": 1794392035.2863472, "ttft_s": 4.098425388336182, "decode_tok_s": 64.93440974967334, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.025826692581177, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392041.2171795, "t_first": 1794392045.4859648, "t1": 1794392049.7614985, "ttft_s": 4.268785238265991, "decode_tok_s": 59.64167734722929, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.544881343841553, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392049.762189, "t_first": 1794392054.0320053, "t1": 1794392058.2364, "ttft_s": 4.2698163986206055, "decode_tok_s": 60.65082503856501, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.474693775177002, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392058.2369258, "t_first": 1794392062.5036552, "t1": 1794392066.7112148, "ttft_s": 4.266729354858398, "decode_tok_s": 60.60520233021891, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.474853277206421, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392066.7118886, "t_first": 1794392070.9821253, "t1": 1794392075.1878185, "ttft_s": 4.2702367305755615, "decode_tok_s": 60.63209681475396, "label": "p4-main-par1", "parallel": 1, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.476491689682007, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par4.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par4.jsonl new file mode 100644 index 00000000000..8b21fcfcd89 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par4.jsonl @@ -0,0 +1,64 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392104.618835, "t_first": 1794392104.8982935, "t1": 1794392108.3845046, "ttft_s": 0.27945852279663086, "decode_tok_s": 73.14531320771957, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.822338104248047, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392104.6193106, "t_first": 1794392105.023483, "t1": 1794392109.3500972, "ttft_s": 0.404172420501709, "decode_tok_s": 58.93754138049891, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.822338104248047, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392104.6196237, "t_first": 1794392104.7617483, "t1": 1794392109.165088, "ttft_s": 0.14212465286254883, "decode_tok_s": 57.91059099477528, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.822338104248047, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392104.6198242, "t_first": 1794392105.1027918, "t1": 1794392109.4404829, "ttft_s": 0.4829676151275635, "decode_tok_s": 58.787035767257656, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.822338104248047, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392109.4411542, "t_first": 1794392109.5183926, "t1": 1794392112.8162122, "ttft_s": 0.07723832130432129, "decode_tok_s": 77.32381688972096, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.64756178855896, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392109.4415283, "t_first": 1794392109.5976422, "t1": 1794392113.7883098, "ttft_s": 0.156113862991333, "decode_tok_s": 60.84949286377249, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.64756178855896, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392109.4417813, "t_first": 1794392109.6761608, "t1": 1794392113.3696864, "ttft_s": 0.23437952995300293, "decode_tok_s": 69.03972812917621, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.64756178855896, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392109.4420877, "t_first": 1794392109.7547529, "t1": 1794392114.0883331, "ttft_s": 0.3126652240753174, "decode_tok_s": 58.84280086329749, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.64756178855896, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392114.0887747, "t_first": 1794392114.3228152, "t1": 1794392117.4496973, "ttft_s": 0.2340404987335205, "decode_tok_s": 81.55088480494307, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.711841583251953, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392114.0890105, "t_first": 1794392114.1664946, "t1": 1794392118.2344677, "ttft_s": 0.077484130859375, "decode_tok_s": 62.68477972158059, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.711841583251953, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392114.0891922, "t_first": 1794392114.4007115, "t1": 1794392118.0035415, "ttft_s": 0.3115193843841553, "decode_tok_s": 70.7776955144486, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.711841583251953, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392114.089451, "t_first": 1794392114.244576, "t1": 1794392118.8001175, "ttft_s": 0.15512490272521973, "decode_tok_s": 55.975782273249536, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.711841583251953, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392118.8008652, "t_first": 1794392118.9576201, "t1": 1794392122.1287088, "ttft_s": 0.1567549705505371, "decode_tok_s": 80.41402322166594, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 4.667291879653931, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392118.8010626, "t_first": 1794392118.878467, "t1": 1794392122.9081693, "ttft_s": 0.07740449905395508, "decode_tok_s": 63.280110587064236, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 4.667291879653931, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392118.801336, "t_first": 1794392119.1150625, "t1": 1794392122.6826382, "ttft_s": 0.31372642517089844, "decode_tok_s": 71.47710992958397, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 4.667291879653931, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392118.801682, "t_first": 1794392119.036257, "t1": 1794392123.4677079, "ttft_s": 0.2345750331878662, "decode_tok_s": 57.54323109690657, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 4.667291879653931, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392123.4682426, "t_first": 1794392123.743608, "t1": 1794392129.5164661, "ttft_s": 0.27536535263061523, "decode_tok_s": 44.172226943720844, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 6.048620939254761, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392123.4684489, "t_first": 1794392123.548237, "t1": 1794392129.044223, "ttft_s": 0.0797882080078125, "decode_tok_s": 46.397498229642096, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 6.048620939254761, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392123.468678, "t_first": 1794392123.8262234, "t1": 1794392129.4285011, "ttft_s": 0.3575453758239746, "decode_tok_s": 45.51720052417143, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 6.048620939254761, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392123.4689085, "t_first": 1794392123.6606975, "t1": 1794392129.3882315, "ttft_s": 0.191788911819458, "decode_tok_s": 44.52177804962815, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 6.048620939254761, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392129.516981, "t_first": 1794392129.5961301, "t1": 1794392135.382691, "ttft_s": 0.07914924621582031, "decode_tok_s": 44.067626689827755, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.86618185043335, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392129.5173113, "t_first": 1794392129.6769907, "t1": 1794392135.0768414, "ttft_s": 0.15967941284179688, "decode_tok_s": 47.2235286793475, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.86618185043335, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392129.5175986, "t_first": 1794392129.7578828, "t1": 1794392135.217252, "ttft_s": 0.24028420448303223, "decode_tok_s": 46.70869316062264, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.86618185043335, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392129.5179803, "t_first": 1794392129.8389964, "t1": 1794392135.3405364, "ttft_s": 0.3210160732269287, "decode_tok_s": 46.350658637647605, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.86618185043335, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392135.3833733, "t_first": 1794392135.4629889, "t1": 1794392141.2394912, "ttft_s": 0.07961559295654297, "decode_tok_s": 44.144359965556134, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.902246713638306, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392135.3839893, "t_first": 1794392135.6250985, "t1": 1794392141.0154216, "ttft_s": 0.24110913276672363, "decode_tok_s": 47.30699669250544, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.902246713638306, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392135.3843231, "t_first": 1794392135.7058985, "t1": 1794392141.1541781, "ttft_s": 0.321575403213501, "decode_tok_s": 46.80376519233261, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.902246713638306, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392135.384569, "t_first": 1794392135.5440824, "t1": 1794392141.2851698, "ttft_s": 0.1595134735107422, "decode_tok_s": 44.4166724183598, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.902246713638306, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392141.2855654, "t_first": 1794392141.3650532, "t1": 1794392147.1399107, "ttft_s": 0.07948780059814453, "decode_tok_s": 44.156933581509456, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 5.854609489440918, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392141.2858372, "t_first": 1794392141.4458275, "t1": 1794392146.8341467, "ttft_s": 0.1599903106689453, "decode_tok_s": 47.324590096330354, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 5.854609489440918, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392141.2859905, "t_first": 1794392141.5267894, "t1": 1794392146.9738708, "ttft_s": 0.2407989501953125, "decode_tok_s": 46.81406145259833, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 5.854609489440918, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392141.286266, "t_first": 1794392141.6076574, "t1": 1794392147.097578, "ttft_s": 0.32139134407043457, "decode_tok_s": 46.448759067636985, "label": "p4-main-par4", "parallel": 4, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 5.854609489440918, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392153.2462409, "t_first": 1794392169.7079031, "t1": 1794392176.393191, "ttft_s": 16.46166229248047, "decode_tok_s": 38.143457965423124, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.32186770439148, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392153.246664, "t_first": 1794392157.3478303, "t1": 1794392177.5023353, "ttft_s": 4.101166248321533, "decode_tok_s": 12.652258133730403, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.32186770439148, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392153.2470162, "t_first": 1794392161.465461, "t1": 1794392175.0152893, "ttft_s": 8.21844482421875, "decode_tok_s": 18.819426676463245, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.32186770439148, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392153.2473605, "t_first": 1794392165.589602, "t1": 1794392177.5676982, "ttft_s": 12.342241525650024, "decode_tok_s": 21.288858825945823, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.32186770439148, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392177.5682657, "t_first": 1794392181.665257, "t1": 1794392200.5143893, "ttft_s": 4.096991300582886, "decode_tok_s": 13.528474199727643, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.192678689956665, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392177.5687044, "t_first": 1794392185.7894504, "t1": 1794392201.5682402, "ttft_s": 8.220746040344238, "decode_tok_s": 16.160935274499536, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.192678689956665, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392177.5693252, "t_first": 1794392189.9118834, "t1": 1794392199.5827658, "ttft_s": 12.342558145523071, "decode_tok_s": 26.367810896638066, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.192678689956665, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392177.5696743, "t_first": 1794392194.0380666, "t1": 1794392201.7606113, "ttft_s": 16.468392372131348, "decode_tok_s": 33.02020394742935, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.192678689956665, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392201.7610714, "t_first": 1794392214.1223998, "t1": 1794392224.823387, "ttft_s": 12.361328363418579, "decode_tok_s": 23.829577365407136, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.248197078704834, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392201.7614093, "t_first": 1794392209.9921741, "t1": 1794392225.943367, "ttft_s": 8.230764865875244, "decode_tok_s": 15.986265247035789, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.248197078704834, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392201.7617638, "t_first": 1794392205.861939, "t1": 1794392223.4623623, "ttft_s": 4.100175142288208, "decode_tok_s": 14.488287874189975, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.248197078704834, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392201.7621634, "t_first": 1794392218.2503867, "t1": 1794392226.008859, "ttft_s": 16.48822331428528, "decode_tok_s": 32.86729568505538, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.248197078704834, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392226.009373, "t_first": 1794392230.1077013, "t1": 1794392248.9337354, "ttft_s": 4.098328351974487, "decode_tok_s": 13.545072693726143, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.168325185775757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392226.0100307, "t_first": 1794392234.2363272, "t1": 1794392249.9852135, "ttft_s": 8.226296424865723, "decode_tok_s": 16.19162106986299, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.168325185775757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392226.0103126, "t_first": 1794392238.3628285, "t1": 1794392248.0036647, "ttft_s": 12.352515935897827, "decode_tok_s": 26.44998770668096, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.168325185775757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392226.010471, "t_first": 1794392242.497845, "t1": 1794392250.1772583, "ttft_s": 16.48737382888794, "decode_tok_s": 33.20566160714968, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.168325185775757, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392256.0985143, "t_first": 1794392260.3742964, "t1": 1794392280.5965202, "ttft_s": 4.275782108306885, "decode_tok_s": 12.609889151796443, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.498387575149536, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392256.0987494, "t_first": 1794392273.2692335, "t1": 1794392280.2671247, "ttft_s": 17.17048406600952, "decode_tok_s": 36.43954916723742, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.498387575149536, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392256.0989523, "t_first": 1794392264.6735296, "t1": 1794392280.475469, "ttft_s": 8.574577331542969, "decode_tok_s": 16.137259619454003, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.498387575149536, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392256.0992496, "t_first": 1794392268.9707372, "t1": 1794392280.5301714, "ttft_s": 12.871487617492676, "decode_tok_s": 22.05990329013325, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.498387575149536, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392280.5971587, "t_first": 1794392284.866487, "t1": 1794392304.5911858, "ttft_s": 4.269328355789185, "decode_tok_s": 12.92795407517846, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.54017663002014, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392280.597618, "t_first": 1794392289.171017, "t1": 1794392304.7286298, "ttft_s": 8.57339882850647, "decode_tok_s": 16.390689349657684, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.54017663002014, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392280.5979128, "t_first": 1794392293.4711974, "t1": 1794392305.136856, "ttft_s": 12.873284578323364, "decode_tok_s": 21.859031391791902, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.54017663002014, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392280.598332, "t_first": 1794392297.7696052, "t1": 1794392304.9728594, "ttft_s": 17.171273231506348, "decode_tok_s": 35.40066643634363, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.54017663002014, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392305.137321, "t_first": 1794392309.4030447, "t1": 1794392329.0657022, "ttft_s": 4.265723705291748, "decode_tok_s": 12.968745451061482, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.44575071334839, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392305.137647, "t_first": 1794392313.7007754, "t1": 1794392329.2036731, "ttft_s": 8.563128471374512, "decode_tok_s": 16.448537833785522, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.44575071334839, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392305.1382203, "t_first": 1794392322.298222, "t1": 1794392329.5827336, "ttft_s": 17.160001754760742, "decode_tok_s": 35.00577872434464, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.44575071334839, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392305.138487, "t_first": 1794392317.9977963, "t1": 1794392329.4500098, "ttft_s": 12.859309196472168, "decode_tok_s": 22.266437787432732, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.44575071334839, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392329.5832012, "t_first": 1794392333.850678, "t1": 1794392353.5252519, "ttft_s": 4.267476797103882, "decode_tok_s": 12.960890605200529, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 24.458947896957397, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392329.5836341, "t_first": 1794392338.1481764, "t1": 1794392353.6628463, "ttft_s": 8.564542293548584, "decode_tok_s": 16.43605708164963, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 24.458947896957397, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392329.5839984, "t_first": 1794392342.4479148, "t1": 1794392354.0418394, "ttft_s": 12.863916397094727, "decode_tok_s": 21.994278081363245, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 24.458947896957397, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392329.58445, "t_first": 1794392346.754432, "t1": 1794392353.908905, "ttft_s": 17.169981956481934, "decode_tok_s": 35.64203787418936, "label": "p4-main-par4", "parallel": 4, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 24.458947896957397, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par8.jsonl b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par8.jsonl new file mode 100644 index 00000000000..a0c51bb5236 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/runs/p4-main-par8.jsonl @@ -0,0 +1,128 @@ +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4636848, "t_first": 1794392384.1252313, "t1": 1794392390.1127968, "ttft_s": 0.6615464687347412, "decode_tok_s": 42.58826049717146, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4641275, "t_first": 1794392384.4420633, "t1": 1794392391.4097025, "ttft_s": 0.977935791015625, "decode_tok_s": 36.59776179470872, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4643955, "t_first": 1794392383.990341, "t1": 1794392391.1584308, "ttft_s": 0.5259454250335693, "decode_tok_s": 35.57433078327105, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.464669, "t_first": 1794392383.8662357, "t1": 1794392391.9518685, "ttft_s": 0.401566743850708, "decode_tok_s": 31.537420295254982, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4648519, "t_first": 1794392383.7332387, "t1": 1794392391.730945, "ttft_s": 0.2683868408203125, "decode_tok_s": 31.884141130378076, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4653323, "t_first": 1794392383.6060648, "t1": 1794392391.2043948, "ttft_s": 0.1407325267791748, "decode_tok_s": 33.56000585634521, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.4655018, "t_first": 1794392384.3635843, "t1": 1794392390.800232, "ttft_s": 0.8980824947357178, "decode_tok_s": 39.61689589427548, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392383.465813, "t_first": 1794392384.249081, "t1": 1794392390.955023, "ttft_s": 0.7832679748535156, "decode_tok_s": 38.02597668554785, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.488821029663086, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9526854, "t_first": 1794392392.0301647, "t1": 1794392398.2658231, "ttft_s": 0.07747936248779297, "decode_tok_s": 40.893837241806274, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9530826, "t_first": 1794392392.4232776, "t1": 1794392399.5024607, "ttft_s": 0.47019505500793457, "decode_tok_s": 36.02110530809963, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.953354, "t_first": 1794392392.1869886, "t1": 1794392399.4067433, "ttft_s": 0.23363471031188965, "decode_tok_s": 35.319759568158425, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9535213, "t_first": 1794392392.1087341, "t1": 1794392400.024029, "ttft_s": 0.1552128791809082, "decode_tok_s": 32.216108645904306, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9538598, "t_first": 1794392392.3446755, "t1": 1794392399.5900588, "ttft_s": 0.39081573486328125, "decode_tok_s": 35.1948255539607, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9540915, "t_first": 1794392392.2654216, "t1": 1794392399.3046038, "ttft_s": 0.31133008003234863, "decode_tok_s": 36.22579914220306, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.954581, "t_first": 1794392392.5019548, "t1": 1794392397.8499026, "ttft_s": 0.5473737716674805, "decode_tok_s": 47.681841301285964, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392391.9550152, "t_first": 1794392392.580653, "t1": 1794392399.4585977, "ttft_s": 0.6256377696990967, "decode_tok_s": 37.075029072013564, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 8.071866035461426, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0245717, "t_first": 1794392400.104353, "t1": 1794392406.097262, "ttft_s": 0.07978129386901855, "decode_tok_s": 42.55028767013093, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0247128, "t_first": 1794392400.183128, "t1": 1794392407.2268121, "ttft_s": 0.1584153175354004, "decode_tok_s": 36.20264619938861, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0250695, "t_first": 1794392400.3403192, "t1": 1794392407.4764354, "ttft_s": 0.3152496814727783, "decode_tok_s": 35.73372272618249, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0252907, "t_first": 1794392400.2612512, "t1": 1794392407.8811076, "ttft_s": 0.2359604835510254, "decode_tok_s": 33.46519777193951, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.025528, "t_first": 1794392400.4190097, "t1": 1794392407.9669166, "ttft_s": 0.3934817314147949, "decode_tok_s": 33.78420060056448, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0260816, "t_first": 1794392400.497918, "t1": 1794392407.521032, "ttft_s": 0.4718363285064697, "decode_tok_s": 36.30867910990215, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0263033, "t_first": 1794392400.5761356, "t1": 1794392406.1473517, "ttft_s": 0.5498323440551758, "decode_tok_s": 45.77097623378648, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392400.0267394, "t_first": 1794392400.6543162, "t1": 1794392406.9735334, "ttft_s": 0.6275768280029297, "decode_tok_s": 40.35309939913339, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.942804574966431, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e991a43fdbfac3977e73b0347384aa847608d3f40e4fe1413887fe64c0508ac1", "text_sha256": "cf4c1d202503c28c831917d3a6c85c2ecc6203fa125985d58b0ab276ba7db1a1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9676933, "t_first": 1794392408.0443976, "t1": 1794392414.223302, "ttft_s": 0.07670426368713379, "decode_tok_s": 41.269452936450605, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "179a079ec3edc4017b49b65cea8a3d32706f87b3ebc79deb33fb81dd88fa03b9", "text_sha256": "34331c2149d88b9b34e4c6457e1183c057b4b5e271b76cdb8f1f5424161e725e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9681885, "t_first": 1794392408.3578959, "t1": 1794392415.4491653, "ttft_s": 0.3897073268890381, "decode_tok_s": 35.95971077506124, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "dd6c564fb781eeaf80db90c247a4e13852fffda5bcdb45b1a6a699830a07eb63", "text_sha256": "5fcaff0a45c475319f412fc17cac8044db1a625c8349593e1995d3fdee71c0a7", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9684093, "t_first": 1794392408.2016296, "t1": 1794392415.3569655, "ttft_s": 0.23322033882141113, "decode_tok_s": 35.63773992596343, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "87b9721851b8eaaa123b6e1144ec071875e0e1bf2c621822858de48b63c2d311", "text_sha256": "d034686f52de381f31016f53e1ed8375c649a05a3f979ce1ef8defc8fc75c0d3", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9687295, "t_first": 1794392408.1235266, "t1": 1794392415.9656725, "ttft_s": 0.15479707717895508, "decode_tok_s": 32.51660994424721, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "c0d67dce1c0ee9fa6aedda1d94715f3058b623dcd532ac74c163a56aa076110d", "text_sha256": "add1d52c4238656f2fbcf77f11abc96c462d3d4f10dfe6074e526f119e210fd1", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9696467, "t_first": 1794392408.279716, "t1": 1794392415.5353355, "ttft_s": 0.31006932258605957, "decode_tok_s": 35.145172523091766, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "acadb39783d45018e0269c60db6cdfb3c7b69077e0c497d8829f20eec7ec0018", "text_sha256": "e16e24b72536eef5c6641787d3f3db077883e499e40a9de5652e050e002a5035", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9705331, "t_first": 1794392408.4360073, "t1": 1794392415.2552326, "ttft_s": 0.46547412872314453, "decode_tok_s": 37.39427696841441, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "8df8c677104212f0fdd74167cd83d4ef88b2c36704319d903b0187850ba3ca2c", "text_sha256": "d87c8654f4e75e77b344aeb0aa00042c57c46623994d4d5834b7fdd2a6f7e88e", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9709077, "t_first": 1794392408.5142539, "t1": 1794392413.8047876, "ttft_s": 0.5433461666107178, "decode_tok_s": 48.199295298576075, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "e3edfc74a0fe83e69bf1ee08fc209e5f0a9455b244159dd2fe5d3b416153b274", "text_sha256": "534f2a3388488f4e0dc2be9de06590704e11791f20c2953a8bded20681fb7c42", "prompt_tokens": 34, "completion_tokens": 256, "t0": 1794392407.9711015, "t_first": 1794392408.592294, "t1": 1794392415.4053855, "ttft_s": 0.621192455291748, "decode_tok_s": 37.42794286303588, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 7.998692989349365, "prompt_sha256": "cf916455e20cf2403af880683fced6dc205579919c1bb77f3550a99a01bfe504"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9664297, "t_first": 1794392416.241241, "t1": 1794392424.410872, "ttft_s": 0.2748112678527832, "decode_tok_s": 31.21316003926467, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9666371, "t_first": 1794392416.04629, "t1": 1794392423.552258, "ttft_s": 0.07965278625488281, "decode_tok_s": 33.972966153184686, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9669955, "t_first": 1794392416.1585689, "t1": 1794392424.042457, "ttft_s": 0.1915733814239502, "decode_tok_s": 32.344446304616895, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9672537, "t_first": 1794392416.4841976, "t1": 1794392425.4778512, "ttft_s": 0.5169439315795898, "decode_tok_s": 28.35332704153375, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.967385, "t_first": 1794392416.3223612, "t1": 1794392425.6501873, "ttft_s": 0.35497617721557617, "decode_tok_s": 27.337559616619455, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9675357, "t_first": 1794392416.4031954, "t1": 1794392425.4777617, "ttft_s": 0.43565964698791504, "decode_tok_s": 28.100516296130287, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.9676368, "t_first": 1794392416.5650568, "t1": 1794392424.829494, "ttft_s": 0.5974199771881104, "decode_tok_s": 30.855095618851866, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392415.967722, "t_first": 1794392416.6458368, "t1": 1794392424.3592422, "ttft_s": 0.6781148910522461, "decode_tok_s": 33.059328240187185, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.684205055236816, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.650757, "t_first": 1794392425.730616, "t1": 1794392433.7289767, "ttft_s": 0.07985901832580566, "decode_tok_s": 31.881533188289485, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.651011, "t_first": 1794392425.8114395, "t1": 1794392433.9383178, "ttft_s": 0.16042852401733398, "decode_tok_s": 31.37736185934425, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.6512327, "t_first": 1794392425.9732685, "t1": 1794392433.9385295, "ttft_s": 0.3220357894897461, "decode_tok_s": 32.01401693677275, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.651434, "t_first": 1794392426.0542328, "t1": 1794392434.7757683, "ttft_s": 0.4027988910675049, "decode_tok_s": 29.237970954740128, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.651541, "t_first": 1794392426.2973874, "t1": 1794392435.0775805, "ttft_s": 0.6458463668823242, "decode_tok_s": 29.042641474215557, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.651638, "t_first": 1794392425.8924134, "t1": 1794392434.9512007, "ttft_s": 0.24077534675598145, "decode_tok_s": 28.14946308633687, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.65192, "t_first": 1794392426.2163332, "t1": 1794392434.1866622, "ttft_s": 0.5644130706787109, "decode_tok_s": 31.993660301891268, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392425.6522813, "t_first": 1794392426.1354976, "t1": 1794392434.0372095, "ttft_s": 0.4832162857055664, "decode_tok_s": 32.27148773728899, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.427495241165161, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.078291, "t_first": 1794392435.1574252, "t1": 1794392443.0950391, "ttft_s": 0.07913422584533691, "decode_tok_s": 32.12552300400633, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0785308, "t_first": 1794392435.2383533, "t1": 1794392443.3042448, "ttft_s": 0.1598224639892578, "decode_tok_s": 31.614608238214636, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0787141, "t_first": 1794392435.3192623, "t1": 1794392443.3043227, "ttft_s": 0.24054813385009766, "decode_tok_s": 31.934636123004662, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0792181, "t_first": 1794392435.7240267, "t1": 1794392444.1053622, "ttft_s": 0.6448085308074951, "decode_tok_s": 30.424745566412618, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.079317, "t_first": 1794392435.400123, "t1": 1794392444.4050236, "ttft_s": 0.32080578804016113, "decode_tok_s": 28.317913619294576, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0794096, "t_first": 1794392435.4810941, "t1": 1794392444.278579, "ttft_s": 0.4016845226287842, "decode_tok_s": 28.985557080365098, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0796027, "t_first": 1794392435.6428752, "t1": 1794392443.5527298, "ttft_s": 0.5632724761962891, "decode_tok_s": 32.23826622199227, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392435.0797698, "t_first": 1794392435.5620189, "t1": 1794392443.4032984, "ttft_s": 0.48224902153015137, "decode_tok_s": 32.520202829481605, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.327149391174316, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "12f8ae1fd61cd4e0da4660ad99b39f0ed978d9db99e65eb4b26a4f67d7a155b7", "text_sha256": "79c30873b1236118c236ac570e5d9883e0a108c02a18378bbc1826e07715174f", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.405672, "t_first": 1794392444.4848354, "t1": 1794392452.437943, "ttft_s": 0.0791633129119873, "decode_tok_s": 32.062938535634494, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "a3a364b7c17a1cd59c7c4ba4db593c5eb03637fcb03cc73a7ea14ee1f02a9b25", "text_sha256": "c3f29779ea8df233a1593965f6d6e05cc7ab55390a87e18189eb46be61b235e0", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4060616, "t_first": 1794392444.565709, "t1": 1794392452.6481397, "ttft_s": 0.15964746475219727, "decode_tok_s": 31.549915190693287, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "41ea9f2ab97fc46ec012c55b3ddeba7f4a27461c3603e083abbe256136f41a55", "text_sha256": "31e13e357cc6dce5f8693261e892a596f3e0c8cf34323427eaa96b66085dd58d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4062974, "t_first": 1794392444.6467881, "t1": 1794392452.6479912, "ttft_s": 0.24049067497253418, "decode_tok_s": 31.870207277955874, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "4a1b10188a6953821380eb57d9b6dc629840afcfd46a95dac009fe59780760c1", "text_sha256": "0fdfced1a23fa0176f3ecfc8b19b226358f06cb095752b32ba9b239be407941a", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4071212, "t_first": 1794392444.7276356, "t1": 1794392453.451966, "ttft_s": 0.320514440536499, "decode_tok_s": 29.22860409569241, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "ab235454607b9d3cc0a69602b0cae6c2dde59376c47072999f4bb236adbbde73", "text_sha256": "c22b87c3abaf699ec60a5fc51879c1881beedc8dce3f6ab4275a9ce03dcde492", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4074066, "t_first": 1794392444.973199, "t1": 1794392453.7506647, "ttft_s": 0.5657923221588135, "decode_tok_s": 29.05166539183645, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "8902265f4cb88cddadc9e936f74ae37f2ab0138997c99a584386d7d7543d4d22", "text_sha256": "1f0ed7ef2faa1ad2b546a905643fd38e875842d89ed8d6fb8876a31f7b3b6408", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4075255, "t_first": 1794392444.892291, "t1": 1794392453.624444, "ttft_s": 0.48476552963256836, "decode_tok_s": 29.202420272061087, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "954f743ad1e1d12e7f73474780e42403f899e07dc934e26ca1a8bc87e6b371e9", "text_sha256": "8e8c0496af203ffa2883a744bc0024ac43926f3f2b5d6829307288a20a8d009d", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4078696, "t_first": 1794392445.0545032, "t1": 1794392452.8965259, "ttft_s": 0.6466336250305176, "decode_tok_s": 32.51712104651408, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "817e5f453c511ee1ba2527b215853c07e5a6a453287ff8b7d2eb79798c20f58f", "text_sha256": "00173e7f2a429d79374b9bf6006c1184776b974baee80ea1e07e6e626acd0e1c", "prompt_tokens": 29, "completion_tokens": 256, "t0": 1794392444.4079592, "t_first": 1794392444.808924, "t1": 1794392452.7470703, "ttft_s": 0.40096473693847656, "decode_tok_s": 32.12336843740407, "label": "p4-main-par8", "parallel": 8, "depth": 0, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 9.345508098602295, "prompt_sha256": "210aaa314aa68a680f38d68ef498bb601df4906d2aedf7863fdf4d7fc2198898"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.858271, "t_first": 1794392463.9542167, "t1": 1794392505.0184062, "ttft_s": 4.095945835113525, "decode_tok_s": 6.209790172761751, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.858662, "t_first": 1794392472.1892183, "t1": 1794392505.083761, "ttft_s": 12.330556392669678, "decode_tok_s": 7.752045753346213, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.8590536, "t_first": 1794392468.070902, "t1": 1794392501.1050363, "ttft_s": 8.211848497390747, "decode_tok_s": 7.719288141337978, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.8594317, "t_first": 1794392476.3096442, "t1": 1794392504.838646, "ttft_s": 16.450212478637695, "decode_tok_s": 8.938272799275637, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.8595977, "t_first": 1794392484.5539436, "t1": 1794392502.3722148, "ttft_s": 24.694345951080322, "decode_tok_s": 14.311152732406875, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.8599005, "t_first": 1794392480.4310577, "t1": 1794392504.0559804, "ttft_s": 20.571157217025757, "decode_tok_s": 10.79368608620348, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.8602757, "t_first": 1794392488.6784914, "t1": 1794392503.2616615, "ttft_s": 28.8182156085968, "decode_tok_s": 17.485909917412133, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392459.86057, "t_first": 1794392492.8062828, "t1": 1794392503.2622974, "ttft_s": 32.94571280479431, "decode_tok_s": 24.387877116281157, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.226202964782715, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.084499, "t_first": 1794392517.4312992, "t1": 1794392548.1728787, "ttft_s": 12.346800327301025, "decode_tok_s": 8.294954386757885, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.084706, "t_first": 1794392509.182997, "t1": 1794392548.2739518, "ttft_s": 4.098290920257568, "decode_tok_s": 6.52324818954513, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.0852168, "t_first": 1794392529.8120842, "t1": 1794392545.3631368, "ttft_s": 24.72686743736267, "decode_tok_s": 16.397603882215886, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.085345, "t_first": 1794392513.3053267, "t1": 1794392550.5948052, "ttft_s": 8.219981670379639, "decode_tok_s": 6.838390076267455, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.085504, "t_first": 1794392525.681696, "t1": 1794392549.8424113, "ttft_s": 20.596191883087158, "decode_tok_s": 10.554323263818185, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.0856507, "t_first": 1794392533.9374042, "t1": 1794392549.4151597, "ttft_s": 28.85175347328186, "decode_tok_s": 16.475256973322146, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.085837, "t_first": 1794392521.5570567, "t1": 1794392550.4012074, "ttft_s": 16.471219778060913, "decode_tok_s": 8.840613888427912, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392505.0861392, "t_first": 1794392538.065067, "t1": 1794392547.3661237, "ttft_s": 32.97892785072327, "decode_tok_s": 27.416239930939266, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.51080298423767, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5956047, "t_first": 1794392562.9541347, "t1": 1794392592.991178, "ttft_s": 12.358530044555664, "decode_tok_s": 8.489517332732646, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5959516, "t_first": 1794392554.7015533, "t1": 1794392594.1629114, "ttft_s": 4.105601787567139, "decode_tok_s": 6.462017844019584, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5964646, "t_first": 1794392558.8260477, "t1": 1794392591.811225, "ttft_s": 8.229583024978638, "decode_tok_s": 7.730745172197897, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5969744, "t_first": 1794392567.0812097, "t1": 1794392595.9149382, "ttft_s": 16.484235286712646, "decode_tok_s": 8.843809413732918, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5973666, "t_first": 1794392571.2121208, "t1": 1794392594.8814878, "ttft_s": 20.61475419998169, "decode_tok_s": 10.773418621307247, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5975971, "t_first": 1794392579.4694893, "t1": 1794392595.4371011, "ttft_s": 28.87189221382141, "decode_tok_s": 15.969827132472961, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5978506, "t_first": 1794392575.343217, "t1": 1794392594.9469345, "ttft_s": 24.74536633491516, "decode_tok_s": 13.007736881921424, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392550.5980902, "t_first": 1794392583.5988004, "t1": 1794392594.228087, "ttft_s": 33.000710248947144, "decode_tok_s": 23.99032139523753, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.31992554664612, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9c1e40f259eb1e2b0edfe512b7414db2995c52e0847472a62b44e37c4f2f10a0", "text_sha256": "4d25e06e263156d865630c375130bdb0225fe63d7a7b602096911a43b2731617", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9157383, "t_first": 1794392600.0118423, "t1": 1794392638.3029919, "ttft_s": 4.09610390663147, "decode_tok_s": 6.659502327708646, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1b5022e3b122b023e51917939f78c95405d7bd962b8afc4730e59328a706131a", "text_sha256": "c2cde787c707f5a1640d8f0a082b8cdf565140b39a727920dc0d1e5aaf8789b2", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9161208, "t_first": 1794392604.1410866, "t1": 1794392640.1299, "ttft_s": 8.224965810775757, "decode_tok_s": 7.085535084579842, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "9f4d001ceb7e6c5203b84914c6143268ad080ece682303a9dce41c4cd12c9768", "text_sha256": "bcbba884a608acb9376c2ef93f1ae71118ac8a6457a9e6da2b29d7c738ffbda7", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9164395, "t_first": 1794392612.3984833, "t1": 1794392636.3045971, "ttft_s": 16.482043743133545, "decode_tok_s": 10.666727409625592, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b9fea01112d31d80954e7bb8469dbaf6883f009f3e43971053cfd58630e24fdd", "text_sha256": "8f449ddf5ed026e421a23740551f640c75b16ff8fab2302c7b932ffdc1421fe1", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9167323, "t_first": 1794392608.268469, "t1": 1794392640.1305366, "ttft_s": 12.351736783981323, "decode_tok_s": 8.003247131154193, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "b64df43a853b98f870f97d3192abcbce29f7d6e661f8fb8e4a0c1efa362a34c0", "text_sha256": "3345de6e945ebdef4f6c2d2fe877eaef0795e09458423e3ef1ceb01c0d07fc8a", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.917203, "t_first": 1794392616.531539, "t1": 1794392639.4078312, "ttft_s": 20.614336013793945, "decode_tok_s": 11.146911284867125, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "961446d8b69265d48fecadbe3e5ee6543c694818434224db6d5a222ae9e5d075", "text_sha256": "75818eca26dd818910490a26ddee5ac1979914bfb20594dea160cb41e0fc2153", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9175937, "t_first": 1794392624.796013, "t1": 1794392641.3658962, "ttft_s": 28.878419399261475, "decode_tok_s": 15.389366257794864, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "1643157a3ac8fc09d7afb3dd83ef024fef1f94fed56c1c3361f04036d8290db5", "text_sha256": "88aba3d3c46140d2bce4b99038f8abd84c8a2fabfe358c4d05d0593daad6a08d", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9182122, "t_first": 1794392620.6609085, "t1": 1794392640.6232924, "ttft_s": 24.742696285247803, "decode_tok_s": 12.774025396213972, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "620261d45dcd35fd31fad26b921401eec0b2be5f029a798ad65ac69c2232d488", "text_sha256": "5028bcc6f9b32a5e4503dcfba9e12684434721abc1ec19c4591ab1b28190b768", "prompt_tokens": 7588, "completion_tokens": 256, "t0": 1794392595.9186616, "t_first": 1794392628.92816, "t1": 1794392640.7968266, "ttft_s": 33.00949835777283, "decode_tok_s": 21.485142985660573, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "code", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 45.450767040252686, "prompt_sha256": "829dddadac0f329f368008ab5291dee91863a9d6eae58966f093c194eed2b57f"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2537134, "t_first": 1794392655.8381197, "t1": 1794392692.428564, "ttft_s": 8.58440637588501, "decode_tok_s": 6.969032617513537, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2541, "t_first": 1794392651.5314732, "t1": 1794392690.3916657, "ttft_s": 4.2773730754852295, "decode_tok_s": 6.561984986440486, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2544792, "t_first": 1794392660.1463883, "t1": 1794392693.282074, "ttft_s": 12.891909122467041, "decode_tok_s": 7.6956306999326, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2546003, "t_first": 1794392664.4534988, "t1": 1794392692.56947, "ttft_s": 17.198898553848267, "decode_tok_s": 9.069578254941428, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2550857, "t_first": 1794392668.7592404, "t1": 1794392692.6316977, "ttft_s": 21.504154682159424, "decode_tok_s": 10.681765901189436, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.255339, "t_first": 1794392673.0632713, "t1": 1794392692.5699766, "ttft_s": 25.807932376861572, "decode_tok_s": 13.072427982372183, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2555826, "t_first": 1794392681.676469, "t1": 1794392692.1292372, "ttft_s": 34.420886516571045, "decode_tok_s": 24.395451794984123, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392647.2560153, "t_first": 1794392677.3730657, "t1": 1794392692.948894, "ttft_s": 30.117050409317017, "decode_tok_s": 16.371520978670684, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 0, "warmup": true, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.02883005142212, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2826552, "t_first": 1794392697.5518084, "t1": 1794392737.150821, "ttft_s": 4.269153118133545, "decode_tok_s": 6.439554503295277, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2829525, "t_first": 1794392701.8619256, "t1": 1794392739.8421235, "ttft_s": 8.578973054885864, "decode_tok_s": 6.7140250460990405, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2831645, "t_first": 1794392706.1682713, "t1": 1794392739.5751703, "ttft_s": 12.885106801986694, "decode_tok_s": 7.6331538640562515, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2832794, "t_first": 1794392714.7783039, "t1": 1794392738.5841753, "ttft_s": 21.49502444267273, "decode_tok_s": 10.711643139922536, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2834065, "t_first": 1794392710.4719257, "t1": 1794392738.4460194, "ttft_s": 17.18851923942566, "decode_tok_s": 9.115576824649654, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.2836583, "t_first": 1794392727.6775959, "t1": 1794392738.0777733, "ttft_s": 34.39393758773804, "decode_tok_s": 24.51881234911972, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.283986, "t_first": 1794392719.0777, "t1": 1794392737.373643, "ttft_s": 25.793713808059692, "decode_tok_s": 13.937516076461348, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392693.284103, "t_first": 1794392723.3767993, "t1": 1794392737.0768003, "ttft_s": 30.09269642829895, "decode_tok_s": 18.61313732566317, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 1, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.55985760688782, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8427746, "t_first": 1794392744.1152375, "t1": 1794392785.6887548, "ttft_s": 4.272462844848633, "decode_tok_s": 6.133712430960091, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8432233, "t_first": 1794392752.722988, "t1": 1794392783.3425574, "ttft_s": 12.879764556884766, "decode_tok_s": 8.328007344018388, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8433747, "t_first": 1794392757.0287583, "t1": 1794392786.301318, "ttft_s": 17.185383558273315, "decode_tok_s": 8.711230008981902, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8434834, "t_first": 1794392748.4178936, "t1": 1794392783.115136, "ttft_s": 8.574410200119019, "decode_tok_s": 7.3492872456357725, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8438203, "t_first": 1794392761.3366058, "t1": 1794392783.4858768, "ttft_s": 21.492785453796387, "decode_tok_s": 11.512794252655112, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8442817, "t_first": 1794392765.6543126, "t1": 1794392786.1032233, "ttft_s": 25.810030937194824, "decode_tok_s": 12.470101883492847, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.844591, "t_first": 1794392769.9613552, "t1": 1794392783.4863915, "ttft_s": 30.116764307022095, "decode_tok_s": 18.853923470820835, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392739.8451197, "t_first": 1794392774.263795, "t1": 1794392786.048866, "ttft_s": 34.41867518424988, "decode_tok_s": 21.63754440582453, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 2, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.45909595489502, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "39502a04a167660f21b6df410529ed63e26c9000764a4cec647b6e6e1d8f8056", "text_sha256": "f2bd7f73f611c2ddfc85e94c6c0504976c44ce959593089548119f3db51e8b30", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3020012, "t_first": 1794392790.5762744, "t1": 1794392830.4805527, "ttft_s": 4.274273157119751, "decode_tok_s": 6.390292244386851, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 0, "seed": 1000, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8640facfacc780f8b242afaac20482b98a70cc6c7822e152e120ebb5ab8bc095", "text_sha256": "2ce0cf4c5e9ab1a387547c9e3b8bbb03a1ac64ee8bfddf966644c65751443809", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3023677, "t_first": 1794392794.8967547, "t1": 1794392833.1000314, "ttft_s": 8.59438705444336, "decode_tok_s": 6.674820132355147, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 1, "seed": 1001, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "df65877f1d4e9f248aaba6ce0fe9da28e0d4f8e1d4d6785d74f33ff583ea689a", "text_sha256": "30d175a8c08e7cc6d9e8bf2614d4615b5ea32e320f5ea3b90e35c9172855be2a", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3026202, "t_first": 1794392799.2064831, "t1": 1794392832.7062128, "ttft_s": 12.903862953186035, "decode_tok_s": 7.61200173228509, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 2, "seed": 1002, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "93ede33993d06ee31aa2910122a9ab7e1b0c7019ab945324a9c9680508fea711", "text_sha256": "68303b2a7096ce4b2076d8165ac3c7a68ce03a0d39a4057f891c81e6a32c002e", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3030581, "t_first": 1794392803.5100868, "t1": 1794392831.1421878, "ttft_s": 17.20702862739563, "decode_tok_s": 9.228397053698307, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 3, "seed": 1003, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "8d9a57d93de4455ede9e6c1944b9a8be0f8b0f75deebf2f65745a6ae9a0ef0e5", "text_sha256": "bc771e30bf93d0cb3058649cc2eda5914b531030485419b0637869d9c4e6c584", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3032873, "t_first": 1794392807.8131526, "t1": 1794392831.000757, "ttft_s": 21.509865283966064, "decode_tok_s": 10.997255054918952, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 4, "seed": 1004, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "25e23a2000891e9ba0c66ce70f5056339575f43b1c1111f1d117cad5b0616f95", "text_sha256": "d2f19fb60b5eb0d8cfb0022f37bb373e54538595d5da378a9955c0c758125ab5", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3034282, "t_first": 1794392820.7248945, "t1": 1794392831.65398, "ttft_s": 34.42146635055542, "decode_tok_s": 23.332235818017693, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 5, "seed": 1005, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "57c3529bf810371d96f225657a9a07467ff21b704a2bbd5cbd6c19e14008b106", "text_sha256": "dd75cfddda0aa6f3b4775c858a87a93e14a15f1b5220ccf8d952c505e3b7f8af", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.3035874, "t_first": 1794392816.4231315, "t1": 1794392830.407569, "ttft_s": 30.11954402923584, "decode_tok_s": 18.234555421055283, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 6, "seed": 1006, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} +{"ok": true, "token_sha256": "4e442dc2f4afebeb3d16f32eae53f8070044259ef4cdc08227e4e987309cc2a7", "text_sha256": "55877e8f064e0ba5386b254946cf85aa3885b5372428a0a9854391845e10ce03", "prompt_tokens": 7912, "completion_tokens": 256, "t0": 1794392786.304075, "t_first": 1794392812.1199899, "t1": 1794392830.1775832, "ttft_s": 25.81591486930847, "decode_tok_s": 14.121483141137418, "label": "p4-main-par8", "parallel": 8, "depth": 8192, "kind": "text", "rep": 3, "warmup": false, "stream": 7, "seed": 1007, "greedy": false, "wave_wall_s": 46.79853343963623, "prompt_sha256": "e3d7f520de97d4c3950473b49c861d55ec5dbb088c4dd05c0a4249185c148cea"} diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/bench_topk.py b/docs/receipts/xpu-qwen27-sampled-topk/scripts/bench_topk.py new file mode 100644 index 00000000000..4eedb8f2585 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/bench_topk.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +"""Sampled served decode, P streams a wave; env CELLS, GREEDY, SEED0. usage: bench_topk.py URL LABEL OUTDIR P [reps]""" +import hashlib, json, os, sys, threading, time, urllib.request + +URL, LABEL, OUT, P = sys.argv[1], sys.argv[2], sys.argv[3], int(sys.argv[4]) +REPS = int(sys.argv[5]) if len(sys.argv) > 5 else 3 +CELLS = [(int(c.split(":")[0]), c.split(":")[1].split(",")) for c in os.environ.get("CELLS", "0:code,text;8192:code,text").split(";")] +GREEDY = os.environ.get("GREEDY") == "1" +SEED0 = int(os.environ.get("SEED0", "1000")) +H = os.path.dirname(os.path.abspath(__file__)) +os.makedirs(OUT, exist_ok=True) +CORP = {k: open(f"{H}/inputs/corp_{k}.txt", errors="ignore").read() for k in ("code", "text")} +ASK = {"code": "Review the code above in detail, then write one new, complete Python function in the same style.", + "text": "Write a detailed, well structured summary of the documentation above."} +SHORT = {"code": "Write a complete Python function that parses a CSV file and prints the average of each numeric column, " + "with comments.", + "text": "Write a detailed essay of about two hundred words on why local inference matters for privacy."} + + +def post(content, seed): + body = {"model": "m", "messages": [{"role": "user", "content": content}], "max_tokens": 256, "stream": True, + "stream_options": {"include_usage": True}, "chat_template_kwargs": {"enable_thinking": False}} + if GREEDY: + body["temperature"] = 0 + else: + body["seed"] = seed + req = urllib.request.Request(URL + "/v1/chat/completions", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"}) + t0, first, text, usage, tsha = time.time(), None, [], None, None + with urllib.request.urlopen(req, timeout=3600) as r: + for line in r: + line = line.decode().strip() + if not line.startswith("data: {"): + continue + d = json.loads(line[6:]) + if d.get("usage"): + usage = d["usage"] + tf = d.get("tensorfold") or (d.get("usage") or {}).get("tensorfold") or {} + if tf.get("token_sha256"): + tsha = tf["token_sha256"] + c = (d.get("choices") or [{}])[0].get("delta", {}).get("content") + if c: + first = first or time.time() + text.append(c) + t1, s = time.time(), "".join(text) + n = (usage or {}).get("completion_tokens", 0) + return {"ok": bool(text and usage and tsha), "token_sha256": tsha, "text_sha256": hashlib.sha256(s.encode()).hexdigest(), + "prompt_tokens": (usage or {}).get("prompt_tokens"), "completion_tokens": n, "t0": t0, "t_first": first or t1, "t1": t1, + "ttft_s": (first or t1) - t0, "decode_tok_s": (n - 1) / (t1 - first) if first and t1 > first and n > 1 else None} + + +tpc = {} + + +def prompt(kind, depth): + if depth == 0: + return SHORT[kind] + if kind not in tpc: + r = post(CORP[kind][:20000], 1) + tpc[kind] = 20000 / (r["prompt_tokens"] - 15) + return "Here is the material:\n\n" + CORP[kind][:int((depth - 300) * tpc[kind])] + "\n\n" + ASK[kind] + + +failed = 0 +with open(f"{OUT}/{LABEL}.jsonl", "a") as out: + for depth, kinds in CELLS: + for kind in kinds: + content = prompt(kind, depth) + psha = hashlib.sha256(content.encode()).hexdigest() + for rep in range(REPS + 1): + res = [None] * P + + def go(i): + try: + res[i] = post(content, SEED0 + i) + except Exception as e: + res[i] = {"ok": False, "error": repr(e)} + ts = [threading.Thread(target=go, args=(i,)) for i in range(P)] + w0 = time.time() + [t.start() for t in ts] + [t.join() for t in ts] + wall = time.time() - w0 + for i, r in enumerate(res): + r.update(label=LABEL, parallel=P, depth=depth, kind=kind, rep=rep, warmup=rep == 0, stream=i, + seed=None if GREEDY else SEED0 + i, greedy=GREEDY, wave_wall_s=wall, prompt_sha256=psha) + out.write(json.dumps(r) + "\n") + failed += not r["ok"] + out.flush() + oks = [r for r in res if r["ok"]] + tot = sum(r["completion_tokens"] for r in oks) + mean = sum(r["decode_tok_s"] or 0 for r in oks) / max(1, len(oks)) + print(f"{LABEL} P={P} d={depth} {kind} rep{rep}: n={tot} wall={wall:.1f}s per-stream={mean:.2f} tok/s " + f"tsha0={(res[0].get('token_sha256') or 'NONE')[:16]}", flush=True) +print("FINI failed=%d" % failed, flush=True) +sys.exit(1 if failed else 0) diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/build_corp_code.sh b/docs/receipts/xpu-qwen27-sampled-topk/scripts/build_corp_code.sh new file mode 100755 index 00000000000..5ce6a89fab8 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/build_corp_code.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Rebuild the historical corpus with build_corp_code.sh OUTFILE; source and expected hash are in the receipt. +set -e +python3 -I - "$1" <<"PY" +import hashlib, os, re, sys +root = "/usr/lib/python3.14" +names = sorted((f for f in os.listdir(root) if f.endswith(".py")), key=lambda f: (re.sub("[^a-z0-9]", "", f.lower()), f)) +data = b"".join(open(os.path.join(root, f), "rb").read() for f in names)[:1500000] +open(sys.argv[1], "wb").write(data) +print(hashlib.sha256(data).hexdigest(), len(data), "bytes from", len(names), "files") +PY diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/compare_topk.py b/docs/receipts/xpu-qwen27-sampled-topk/scripts/compare_topk.py new file mode 100644 index 00000000000..4052698d41e --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/compare_topk.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Compare exact token hashes and A-B-B-A top-k rates; usage: compare_topk.py RUNS_DIR.""" +import glob, json, os, re, statistics as st, sys +from collections import defaultdict + +rows = [] +for f in sorted(glob.glob(os.path.join(sys.argv[1], "p*.jsonl"))): + for line in open(f): + r = json.loads(line) + m = re.match(r"p(\d)-(main|branch)-par(\d+)", r["label"]) + r["pass"], r["side"] = int(m.group(1)), m.group(2) + rows.append(r) + +# (a) exactness: one token_sha256 for a (mode, parallel, depth, kind, stream) over every pass, side and wave +key = lambda r: (("greedy" if r["greedy"] else "sampled"), r["parallel"], r["depth"], r["kind"], r["stream"]) +sha = defaultdict(lambda: defaultdict(set)) +for r in rows: + if not r["ok"]: + print("NOT OK:", r["label"], r["depth"], r["kind"], r["stream"], r.get("error")) + continue + sha[key(r)]["all"].add(r["token_sha256"]) + sha[key(r)][r["side"]].add(r["token_sha256"]) + sha[key(r)]["n"].add(r["completion_tokens"]) +bad_cells = [k for k, v in sha.items() if len(v["all"]) != 1] +print(f"streams checked: {len(sha)} (mode, streams, depth, kind, stream); requests: {len(rows)}") +print("MISMATCH main/branch/passes/waves (distinct token_sha256 != 1):", len(bad_cells)) +for k in bad_cells: + print(" ", k, {s: len(v) for s, v in sha[k].items()}) +short = [k for k, v in sha.items() if v["n"] != {256}] +print("streams not at 256 tokens:", len(short), [(k, sorted(sha[k]["n"])) for k in short][:5]) +for mode in ("sampled", "greedy"): + ks = [k for k in sha if k[0] == mode] + print(f"{mode}: {len(ks)} streams, {len({next(iter(sha[k]['all'])) for k in ks if len(sha[k]['all']) == 1})} distinct hashes") + +# (c) a stream drawn in a shared round equals the same request (seed, prompt) drawn alone or in a round of another width +alone = defaultdict(set) +for r in rows: + if r["ok"]: + alone[(("greedy" if r["greedy"] else "sampled"), r["depth"], r["kind"], r["stream"])].add(r["token_sha256"]) +diff = [k for k, v in alone.items() if len(v) != 1] +print("MISMATCH across 1, 4 and 8 streams (same prompt and seed, distinct token_sha256 != 1):", len(diff), "of", len(alone), "(prompt, seed) pairs") + +# (b) speed per pass and cell: per-stream decode tok/s (median of 3 waves) and the wave's tok/s (prefill included) +cell = defaultdict(lambda: defaultdict(list)) +for r in rows: + if r["greedy"] or r["warmup"] or not r["ok"]: + continue + cell[(r["parallel"], r["depth"], r["kind"])][(r["pass"], r["side"], r["rep"])].append(r) +speed = {} +for c, waves in cell.items(): + per = defaultdict(lambda: ([], [], [])) + for (p, side, rep), rs in waves.items(): + mean = sum(r["decode_tok_s"] for r in rs) / len(rs) + agg = sum(r["completion_tokens"] for r in rs) / rs[0]["wave_wall_s"] + per[(p, side)][0].append(mean) + per[(p, side)][1].append(agg) + per[(p, side)][2].append(rs[0]["wave_wall_s"]) + for (p, side), (m, a, w) in per.items(): + speed[(c, p, side)] = (st.median(m), st.median(a), st.median(w)) +print() +print("cell (streams, prompt tokens, kind) | per-stream tok/s main / branch = ratio (pairs) | aggregate tok/s main / branch = ratio (pairs)") +for c in sorted({k[0] for k in speed}): + def pair(idx): + # passes 1 (main) 2 (branch) 3 (branch) 4 (main): pairs (1,2) and (4,3) + m = [speed[(c, 1, "main")][idx], speed[(c, 4, "main")][idx]] + b = [speed[(c, 2, "branch")][idx], speed[(c, 3, "branch")][idx]] + r1, r2 = b[0] / m[0], b[1] / m[1] + mm, bm = sum(m) / 2, sum(b) / 2 + return f"{mm:.2f} / {bm:.2f} = {bm / mm:.3f} ({r1:.3f}, {r2:.3f}; gap {abs(r1 - r2):.3f})" + print(f"{c[0]} streams, {c[1] or 'short'} {c[2]}: {pair(0)} | {pair(1)}") diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/driver.sh b/docs/receipts/xpu-qwen27-sampled-topk/scripts/driver.sh new file mode 100755 index 00000000000..feae475e5fb --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/driver.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# A-B-B-A: main, branch, branch, main +o=0 +for SIDE in main branch branch main; do + o=$((o+1)) + $WORK/scripts/run_pass.sh $o $SIDE || { echo "$(date +%T) driver: STOP at pass $o $SIDE" >> $WORK/journal; exit 1; } +done +echo "$(date +%T) driver: ALL DONE" >> $WORK/journal +echo done > $WORK/driver.done diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/run-tests.sh b/docs/receipts/xpu-qwen27-sampled-topk/scripts/run-tests.sh new file mode 100755 index 00000000000..ae2e2822a54 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/run-tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Checks: contracts/limits, individual card tests on card 0, then zig build test. +export ZE_AFFINITY_MASK=0 LC_ALL=C +R=$WORK; T=$R/tests; mkdir -p $T +cd $TREE +Z=$ZIG +F="-Doptimize=ReleaseFast -Dxpu-dpas=true -Dngen-include=$NGEN" +step() { echo "$(date +%T) tests: $*" >> $R/journal; } +step "contract build" +$Z build tf-xpu-contract-run -Dxpu-contract=true $F > $T/contract-build.out 2>&1 || { step "contract build FAILED"; exit 1; } +step "contract run" +./zig-out/bin/tf-xpu-contract-run --device 0 2>&1 | tr -d '\000' > $T/contract-run.out +step "contract rc=${PIPESTATUS[0]}" +$Z build xpu-kernel-contract-limits -Dxpu-contract=true $F > $T/limits.out 2>&1; step "limits rc=$?" +step "device tests build" +$Z build xpu-qwen27-tests $F > $T/qwen27-tests-build.out 2>&1 || { step "device tests build FAILED"; exit 1; } +MP=$MODELS/Qwen3.8-27B-GPTQ-Int4-sym-G128-MTP-BF16 +for X in means seam close; do + step "$X start" + timeout 1800 ./zig-out/bin/tf-xpu-qwen27-$X-test $MP > $T/branch-$X.out 2>&1; rc=$? + step "$X rc=$rc" + sync; echo 3 | sudo -n tee /proc/sys/vm/drop_caches >/dev/null +done +step "zig build test start" +$Z build test $F > $T/zig-build-test.out 2>&1; rc=$? +step "zig build test rc=$rc" +echo $rc > $T/zig-build-test.rc +step "ALL DONE" diff --git a/docs/receipts/xpu-qwen27-sampled-topk/scripts/run_pass.sh b/docs/receipts/xpu-qwen27-sampled-topk/scripts/run_pass.sh new file mode 100755 index 00000000000..c59e6cd6b33 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/scripts/run_pass.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# run_pass.sh ORDER(1..4) SIDE(main|branch): card 0, 1/4/8 streams, bf16 KV. +ORD=$1; SIDE=$2 +R=$WORK; RUNS=$R/runs; mkdir -p $RUNS +export ZE_AFFINITY_MASK=0 LC_ALL=C +unset XPU_KV_INT8 +BIN=$R/bin-$SIDE/tensorfold-native +MP=$MODELS/Qwen3.8-27B-GPTQ-Int4-sym-G128-MTP-BF16 +PORT=8091 +J=$R/journal +step() { echo "$(date +%T) pass $ORD $SIDE: $*" >> $J; } +for P in 1 4 8; do + N=p$ORD-$SIDE-par$P + ss -ltn | grep -qE ":$PORT\b" && { step "port $PORT busy"; exit 1; } + step "par$P server" + $BIN serve $MP --drafter $MODELS/Qwen3.8-27B-DFlash2 --context 10240 --parallel $P --host 127.0.0.1 --port $PORT --name m --no-update-check --prompt-cache-gib 0 > $RUNS/$N.server.log 2>&1 & + SP=$! + for i in $(seq 150); do curl -sf localhost:$PORT/health >/dev/null && break; kill -0 $SP 2>/dev/null || break; sleep 2; done + kill -0 $SP 2>/dev/null && curl -sf localhost:$PORT/health >/dev/null || { step "par$P server KO"; exit 1; } + step "par$P ready pid $SP" + ( while kill -0 $SP 2>/dev/null; do sleep 240; kill -0 $SP 2>/dev/null && step "par$P running: $(tail -n1 $RUNS/$N.bench.log | cut -c1-120)"; done ) & + HB=$! + if [ $P = 1 ]; then + GREEDY=1 CELLS="0:code,text" python3 -I $R/scripts/bench_topk.py http://127.0.0.1:$PORT $N-greedy $RUNS $P 0 > $RUNS/$N-greedy.bench.log 2>&1; RCG=$? + step "par$P greedy rc=$RCG" + fi + python3 -I $R/scripts/bench_topk.py http://127.0.0.1:$PORT $N $RUNS $P 3 > $RUNS/$N.bench.log 2>&1; RC=$? + step "par$P bench rc=$RC" + kill $HB 2>/dev/null + kill -INT $SP; for i in $(seq 90); do kill -0 $SP 2>/dev/null || break; sleep 1; done; kill -0 $SP 2>/dev/null && kill -9 $SP + sync; echo 3 | sudo -n tee /proc/sys/vm/drop_caches >/dev/null + step "par$P stopped, page cache dropped" + [ $RC = 0 ] || { step "FAILED"; exit 1; } +done diff --git a/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-close.out b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-close.out new file mode 100644 index 00000000000..ac53357287e --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-close.out @@ -0,0 +1,28 @@ + layers loaded: 8/64 + layers loaded: 16/64 + layers loaded: 24/64 + layers loaded: 32/64 + layers loaded: 40/64 + layers loaded: 48/64 + layers loaded: 56/64 + layers loaded: 64/64 +round 0: 32606 MiB free before the first runner, 29999 MiB after this one closed + layers loaded: 8/64 + layers loaded: 16/64 + layers loaded: 24/64 + layers loaded: 32/64 + layers loaded: 40/64 + layers loaded: 48/64 + layers loaded: 56/64 + layers loaded: 64/64 +round 1: 32606 MiB free before the first runner, 30000 MiB after this one closed + layers loaded: 8/64 + layers loaded: 16/64 + layers loaded: 24/64 + layers loaded: 32/64 + layers loaded: 40/64 + layers loaded: 48/64 + layers loaded: 56/64 + layers loaded: 64/64 +round 2: 32606 MiB free before the first runner, 29998 MiB after this one closed +ok diff --git a/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-means.out b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-means.out new file mode 100644 index 00000000000..64beba6e327 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-means.out @@ -0,0 +1,2 @@ +group means: worst error / Σ|terms|: prompt 4.19e-7, decode 2.80e-7 (bound 2e-6) +ok diff --git a/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-seam.out b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-seam.out new file mode 100644 index 00000000000..faa72b881b1 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/tests/branch-seam.out @@ -0,0 +1,11 @@ + layers loaded: 8/64 + layers loaded: 16/64 + layers loaded: 24/64 + layers loaded: 32/64 + layers loaded: 40/64 + layers loaded: 48/64 + layers loaded: 56/64 + layers loaded: 64/64 +cut at 64: 0 of 248320 logits differ from the whole prompt +cut at 1024: 0 of 248320 logits differ from the whole prompt +ok diff --git a/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.out b/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.out new file mode 100644 index 00000000000..b39059b39d1 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.out @@ -0,0 +1,378 @@ +test ++- test-gemma4-attention-backward-host + +- run test w +GEMMA_BACKWARD_COORD f64 ring=false probes=528 absolute=3.64061833e-9 relative=4.53574179e-8 +GEMMA_BACKWARD_COORD f64 ring=true probes=528 absolute=5.46947088e-9 relative=6.09718296e-7 +GEMMA_BACKWARD_COORD f32 ring=false probes=528 absolute=3.95812094e-8 relative=2.23293772e-6 +GEMMA_BACKWARD_COORD f32 ring=true probes=528 absolute=7.24321580e-8 relative=3.06041068e-5 +GEMMA_BACKWARD_DIRECTION f64 heads=32 kv=16 width=256 keys=1024 ring=true absolute=1.92214333e-12 +GEMMA_BACKWARD_DIRECTION f32 heads=32 kv=16 width=256 keys=1024 ring=true absolute=4.54335236e-10 +GEMMA_BACKWARD_DIRECTION f64 heads=32 kv=4 width=512 keys=129 ring=false absolute=2.63458163e-10 +GEMMA_BACKWARD_DIRECTION f32 heads=32 kv=4 width=512 keys=129 ring=false absolute=7.14385351e-9 +GEMMA_BACKWARD_DIRECTION f64 heads=16 kv=8 width=256 keys=1025 ring=false absolute=1.78777837e-12 +GEMMA_BACKWARD_DIRECTION f32 heads=16 kv=8 width=256 keys=1025 ring=false absolute=3.40492079e-11 +GEMMA_BACKWARD_DIRECTION f64 heads=16 kv=1 width=512 keys=129 ring=false absolute=1.49084216e-9 +GEMMA_BACKWARD_DIRECTION f32 heads=16 kv=1 width=512 keys=129 ring=false absolute=3.41651685e-9 +failed command: ./.zig-cache/o/95e04f41f4c3513bdfa98b51676e4b63/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +[default] (warn): glm: lane cost identity exceeds its buffer; skipping the lane cost cache +failed command: ./.zig-cache/o/1174e6cb70799b7ee11f4337006a32ae/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +[default] (warn): TF_GLM_L2PF: layer 0's site n reads 0x10000000, which starts no weight buffer; prefetch off +failed command: ./.zig-cache/o/805560af67ca4a2897f37d4b3a890c94/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +GLM snapshot sizing rank=0 world=2 at=2048 bytes=257949696 arena=7088302592 +GLM snapshot sizing rank=0 world=2 at=34816 bytes=698351616 arena=7088302592 +GLM snapshot sizing rank=0 world=2 at=266240 bytes=3720347648 arena=7088302592 +failed command: ./.zig-cache/o/25130ed9b4bfe4945e540f9f55175c78/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=-inf lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=-inf lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=second-stream len=2053 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=false +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=2 cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=null lse=null cache=own input=not_captured scores=masked row_finite=false +failed command: ./.zig-cache/o/fda98d3a95599029c5a239294ec921fc/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- run test w +[default] (warn): lane host: a packed decision failed (DeviceLost) +failed command: ./.zig-cache/o/64c39f784f0d855fa275c925adb38898/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- run test w +[default] (warn): lane host: a packed decision failed (DeviceLost) +failed command: ./.zig-cache/o/027803a4b0bf19e9faaa87e41fe23de3/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=nan lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=false input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream len=2051 cap=4096 top=1 lse=2 cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=-inf lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=-inf lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=second-stream len=2053 cap=4096 top=-inf lse=nan cache=own batched=true input=head_streams input_finite=true row_finite=true +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=nan cache=own input=not_captured scores=raw row_finite=false +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=1 rows=2 len=2051 cap=4096 top=1 lse=2 cache=own input=not_captured scores=raw row_finite=null +Flash Next ProposalNonfinite stream=fixture-stream kind=verify row=0 rows=1 len=2051 cap=4096 top=null lse=null cache=own input=not_captured scores=masked row_finite=false +failed command: ./.zig-cache/o/cc46b24ce41842dbbd962514a8b148ae/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +FIXTURE case=13 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=15 refused=this server accepts text parts only; image, audio and video inputs are unsupported +FIXTURE case=26 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=47 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=63 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=78 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=84 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=96 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=119 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=135 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=139 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=143 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=146 refused=this server accepts text parts only; image, audio and video inputs are unsupported +FIXTURE case=161 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=174 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=190 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=203 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=211 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=216 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=229 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=230 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=235 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=242 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=261 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=275 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE total=328 accepted=78 equal=50 qualified=3 refused=25 + +====== expected this output: ========= +b4cfdbdcffc07986f211a0b06658c220e5e4b8479088a0dd3735d6aa3817da8f␃ + +======== instead found this: ========= +97e8b46f1ecd9e656de312b81cc417c5ee5eb08c69bbad10372cb06e3bb97b2d␃ + +====================================== +First difference occurs on line 1: +expected: +b4cfdbdcffc07986f211a0b06658c220e5e4b8479088a0dd3735d6aa3817da8f +^ ('\x62') +found: +97e8b46f1ecd9e656de312b81cc417c5ee5eb08c69bbad10372cb06e3bb97b2d +^ ('\x39') + +====== expected this output: ========= +d8e86eef6c2ab57d119e862b266fafd247c84ee0bdebbd9175f77716f0fdc720␃ + +======== instead found this: ========= +38139122ede11ae61ca23a9537ad3926ffa9538659e5c06ac7406bcb221c6ae4␃ + +====================================== +First difference occurs on line 1: +expected: +d8e86eef6c2ab57d119e862b266fafd247c84ee0bdebbd9175f77716f0fdc720 +^ ('\x64') +found: +38139122ede11ae61ca23a9537ad3926ffa9538659e5c06ac7406bcb221c6ae4 +^ ('\x33') + +====== expected this output: ========= +8b5aad89ce0dd3960142a2adc00784ca946838fa4bc801be99044cef9f88448e␃ + +======== instead found this: ========= +460ace0beeb72eaa7263940df2bd00625f4e63c2bc4dca30e120c01b11e6b7df␃ + +====================================== +First difference occurs on line 1: +expected: +8b5aad89ce0dd3960142a2adc00784ca946838fa4bc801be99044cef9f88448e +^ ('\x38') +found: +460ace0beeb72eaa7263940df2bd00625f4e63c2bc4dca30e120c01b11e6b7df +^ ('\x34') +DEEPSEEK_CHAT_GOLDENS 234 committed encoding.py cases (56 with a response_format) +failed command: ./.zig-cache/o/d21ea30f02208020ee969d66630785b1/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +1/7 qwen_cuda_weights_test.test.Qwen tower weights: existing MLX names and every byte match HF in one shard...OK +2/7 qwen_cuda_weights_test.test.Qwen tower weights: indexed MLX fallback and sharded HF preserve every tensor...OK +3/7 qwen_cuda_weights_test.test.Qwen tower weights: malformed selected shape and dtype fail without a fallback...model.visual.patch_embed.proj.weight: f16 { 2, 3, 2, 16, 16 }, expected bf16 { 2, 3, 2, 16, 16 } +model.visual.patch_embed.proj.weight: bf16 { 2, 3, 2, 8, 32 }, expected bf16 { 2, 3, 2, 16, 16 } +vision_tower.patch_embed.proj.weight: f16 { 2, 2, 16, 16, 3 }, expected bf16 { 2, 2, 16, 16, 3 } +vision_tower.patch_embed.proj.weight: bf16 { 2, 2, 16, 8, 6 }, expected bf16 { 2, 2, 16, 16, 3 } +OK +4/7 qwen_cuda_weights_test.test.Qwen tower weights: missing selected tensor and unused selected tensors fail closed...checkpoint has no tensor vision_tower.blocks.0.mlp.linear_fc1.bias +unused checkpoint tensor vision_tower.extra +checkpoint has no tensor model.visual.blocks.0.mlp.linear_fc1.bias +unused checkpoint tensor model.visual.extra +OK +5/7 qwen_cuda_weights_test.test.Qwen tower weights: HF patch keeps the authored precedence when both namespaces exist...OK +6/7 qwen_cuda_weights_test.test.Qwen tower weights: every copy refusal and MLX retry release their host owners...OK +7/7 qwen_cuda_weights_test.test.Qwen tower weights: allocation failures balance the fallback reader and transpose scratch...OK +7 passed; 0 skipped; 0 failed. +test ++- test-cuda-host + +- run test w +release privacy: symlink refused +release privacy: symlink refused +release privacy: symlink refused +release privacy input directory is missing +failed command: ./.zig-cache/o/c6867f8cf0e235fc184a3f92d0c38b89/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +discovery verbs: retained through TLS, atexit and destructor; child exit 0 +discovery grammar: retained through TLS, atexit and destructor; child exit 0 +test ++- run test w +[default] (warn): Flash Next config.json: rope_parameters.rope_type asks for scaled RoPE (YaRN); this reader runs plain RoPE +[default] (warn): Flash Next config.json: rope_scaling asks for scaled RoPE (YaRN); this reader runs plain RoPE +failed command: ./.zig-cache/o/74d1eff08812341c5d20d23ff320372f/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-env-defaults-host + +- run test w +[default] (warn): TF_GLM_L2PF: layer 0's site n reads 0x10000000, which starts no weight buffer; prefetch off +failed command: ./.zig-cache/o/b130927226e2a7a87f4d89a6a6be25d1/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-flashnext-constraint-host + +- run test w +[default] (warn): lane host: a round failed (GpuFailed): the round's streams fail +failed command: ./.zig-cache/o/3610fdb7113b6ca00a670d21436bf521/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +[default] (warn): lane host: a packed decision failed (DeviceLost) +failed command: ./.zig-cache/o/d7e9f4ebca2fbab63e430d9eeac8e9ce/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-flashnext-constraint-host + +- run test w +[default] (warn): lane host: a round failed (GpuFailed): the round's streams fail +failed command: ./.zig-cache/o/5b1ff842b21c78575a37f491d3ee6814/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +N/A prompt attention tf_fa_wide_edge_f16 on gfx1151: not served there +N/A prompt attention tf_fa_wide_edge_bf16 on gfx1151: not served there +N/A prompt attention tf_fa_paged_edge_f16 on gfx1151: not served there +N/A prompt attention tf_fa_paged_edge_bf16 on gfx1151: not served there +N/A dense gemm dense_gemm_block on gfx1030: not served there +N/A dense gemm dense_wmma12_gemm on gfx1030: not served there +N/A dense gemm dense_wmma12_gemm on gfx1100: not served there +N/A dense gemm dense_wmma12_gemm on gfx1151: not served there +N/A dense gemm dense_wmma12_gemm on gfx1030: not served there +N/A dense gemm dense_wmma12_gemm on gfx1100: not served there +N/A dense gemm dense_wmma12_gemm on gfx1151: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1030: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1100: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1151: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1030: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1100: not served there +N/A dense gemm dense_wmma12_gemm_silu on gfx1151: not served there +N/A dense gemm tf_ref_wmma12_k32 on gfx1030: not served there +N/A dense gemm tf_ref_wmma12_k32 on gfx1100: not served there +N/A dense gemm tf_ref_wmma12_k32 on gfx1151: not served there +N/A wmma skew tile 4-bit on gfx1030: not served there +N/A wmma skew tile 4-bit on gfx1201: not served there +joint schema load: skipped, TF_CLEF_DIR names no clef-flash checkpoint +joint schema reference: FP64 vs torch FP64 max 6.217248937900877e-15; BF16 emulation vs torch BF16 max 0.0176 (2.25 steps at the largest logit); against FP64 (worst, mean): torch BF16 0.0132 0.0071, emulation 0.0143 0.0046 +joint schema reference: near-zero normalize and cosine, BF16 emulation within 0 BF16 ulp of torch +failed command: ./.zig-cache/o/54278bf5a5e70e8badfe20cd765d9d46/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- + +test ++- test-cuda-host + +- run test w +FIXTURE case=13 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=15 refused=this server accepts text parts only; image, audio and video inputs are unsupported +FIXTURE case=26 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=47 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=63 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=78 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=84 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=96 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=119 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=135 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=139 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=143 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=146 refused=this server accepts text parts only; image, audio and video inputs are unsupported +FIXTURE case=161 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=174 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=190 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=203 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=211 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=216 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=229 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=230 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=235 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=242 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE case=261 refused=response_format type must be text, json_object or json_schema, not 'string' +FIXTURE case=275 refused=response_format type must be text, json_object or json_schema, not 'object' +FIXTURE total=328 accepted=78 equal=50 qualified=3 refused=25 + +====== expected this output: ========= +b4cfdbdcffc07986f211a0b06658c220e5e4b8479088a0dd3735d6aa3817da8f␃ + +======== instead found this: ========= +97e8b46f1ecd9e656de312b81cc417c5ee5eb08c69bbad10372cb06e3bb97b2d␃ + +====================================== +First difference occurs on line 1: +expected: +b4cfdbdcffc07986f211a0b06658c220e5e4b8479088a0dd3735d6aa3817da8f +^ ('\x62') +found: +97e8b46f1ecd9e656de312b81cc417c5ee5eb08c69bbad10372cb06e3bb97b2d +^ ('\x39') + +====== expected this output: ========= +d8e86eef6c2ab57d119e862b266fafd247c84ee0bdebbd9175f77716f0fdc720␃ + +======== instead found this: ========= +38139122ede11ae61ca23a9537ad3926ffa9538659e5c06ac7406bcb221c6ae4␃ + +====================================== +First difference occurs on line 1: +expected: +d8e86eef6c2ab57d119e862b266fafd247c84ee0bdebbd9175f77716f0fdc720 +^ ('\x64') +found: +38139122ede11ae61ca23a9537ad3926ffa9538659e5c06ac7406bcb221c6ae4 +^ ('\x33') + +====== expected this output: ========= +8b5aad89ce0dd3960142a2adc00784ca946838fa4bc801be99044cef9f88448e␃ + +======== instead found this: ========= +460ace0beeb72eaa7263940df2bd00625f4e63c2bc4dca30e120c01b11e6b7df␃ + +====================================== +First difference occurs on line 1: +expected: +8b5aad89ce0dd3960142a2adc00784ca946838fa4bc801be99044cef9f88448e +^ ('\x38') +found: +460ace0beeb72eaa7263940df2bd00625f4e63c2bc4dca30e120c01b11e6b7df +^ ('\x34') +DEEPSEEK_CHAT_GOLDENS 234 committed encoding.py cases (56 with a response_format) +quoted markers: skipped, TF_TOKENIZER_DIRS names no tokenizer directories (quoted spellings) +quoted markers: skipped, TF_TOKENIZER_DIRS names no tokenizer directories (refusal) +Clef tokens: skipped, TF_CLEF_DIR names no clef-flash checkpoint (12 records pinned) +[default] (warn): libtfgrammar.so is required for structured output and required tool calls (HTTP 400 when missing); restore the matching release archive's lib/ directory or run zig build grammar -Dxgrammar=DIR; prepare DIR with git clone --branch v0.2.8 --recurse-submodules https://github.com/mlc-ai/xgrammar +[default] (warn): libtfgrammar.so is required for structured output and required tool calls (HTTP 400 when missing); restore the matching release archive's lib/ directory or run zig build grammar -Dxgrammar=DIR; prepare DIR with git clone --branch v0.2.8 --recurse-submodules https://github.com/mlc-ai/xgrammar +failed command: ./.zig-cache/o/c00ed70fddb5c5546c326fcdc196b22c/test --cache-dir=./.zig-cache --seed=0x76a3f02 --listen=- diff --git a/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.rc b/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.rc new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/docs/receipts/xpu-qwen27-sampled-topk/tests/zig-build-test.rc @@ -0,0 +1 @@ +0 diff --git a/docs/recipes/README.md b/docs/recipes/README.md index eee65d7b5c8..a628591f2f0 100644 --- a/docs/recipes/README.md +++ b/docs/recipes/README.md @@ -35,6 +35,7 @@ For agent-assisted contributions, read the [TensorFold contributor skill](SKILL. | Underdog Woof | [Native CPU speech on a Mac, int8, non-commercial licence](woof.md) | | Recursive Flint | [Native Metal, the publisher's affine 4-bit export, reasoning and tool calls](flint.md) | | Unlimited-OCR-2 | [Native Metal, the bf16 release: page images to structured text, 131k context](unlimited-ocr-metal.md) | +| Muse Spark Open | [EXL3 on CUDA, two-rank DGX Spark, plain decode](muse-spark.md) | [Persisted serving-state identities](persisted-serving-keys.md) lists the disk owners, their compatibility keys and stale-state host checks. diff --git a/docs/recipes/flash-next-cuda.md b/docs/recipes/flash-next-cuda.md index 8815ec610af..d31ccdf5247 100644 --- a/docs/recipes/flash-next-cuda.md +++ b/docs/recipes/flash-next-cuda.md @@ -91,7 +91,7 @@ tensorfold-native serve /path/to/checkpoint --temperature 0 - `--no-drafts` serves without the MTP head; `"draft": false` on a request does the same for that request. - `TF_FLASHNEXT_READOUT_ROWS` (default 64, `0` never) is the rows from which the hyper-connection read-out takes the prompt tiles. Same bits either way; `128` keeps 16-stream decode rounds on the row kernels, up to 7% quicker on a GB10. -- `TF_FLASHNEXT_CHUNK` (1 to 16,384, default 1,536) caps the rows of one prompt pass. Every pass reads the weights +- `TF_FLASHNEXT_CHUNK` (1 to 16,384, default 3,072) caps the rows of one prompt pass. Every pass reads the weights of every expert its rows route to, so fewer, larger passes cost less a token; but a pass runs to its end, so a stream decoding during a pass waits up to the whole pass for its next token. See [Prompt chunk size](#prompt-chunk-size). @@ -244,7 +244,7 @@ in one start of four on this machine. After the 131,072-token prompt the process ### Prompt chunk size `TF_FLASHNEXT_CHUNK` sets how many prompt rows one pass takes. A prompt of N rows runs in ceil(N / chunk) passes: a -1,922-row prompt is two passes at the default 1,536 and one at 8,192. +1,922-row prompt is two passes at 1,536 and one at the default 3,072 or at 8,192. - **For:** every pass reads the gate, up and down weights of each routed expert its rows route to (1.84 MB of gate and up weights an expert, 512 experts a layer). Fewer passes read each expert fewer times, so a prompt longer than one @@ -265,7 +265,7 @@ change the sums. Two costs remain: On one GB10 with `nvidia/Qwen3.8-Flash-Next-FP4-Local` and `--parallel 3 --context 40960 --no-drafts --prompt-cache-gib 0` (two fresh servers for each setting, medians): -| | unset (1,536) | `TF_FLASHNEXT_CHUNK_SOLO=4096` | `=8192` | +| | `TF_FLASHNEXT_CHUNK_SOLO` unset, chunk 1,536 | `TF_FLASHNEXT_CHUNK_SOLO=4096` | `=8192` | | --- | --- | --- | --- | | First token, one stream, at 1,927 / 8,320 / 31,736 tokens | 0.99 / 4.07 / 16.05 s | 0.91 / 3.88 / 14.94 s | 0.89 / 3.86 / 14.78 s | | Longest wait between a decoding stream's tokens while an 8k prompt runs | 0.81 s | 0.81 s | 0.85 s | diff --git a/docs/recipes/muse-spark.md b/docs/recipes/muse-spark.md new file mode 100644 index 00000000000..932a3ca950b --- /dev/null +++ b/docs/recipes/muse-spark.md @@ -0,0 +1,90 @@ +# Muse Spark Open + +The `muse_spark` family serves an EXL3 pack of Muse Spark Open's text model (exllamav3's `muse_spark` module, mul1 +codebook) on the native CUDA server, on two DGX Sparks (GB10, sm_121) as tensor-parallel ranks, with plain decode. +Package: `zig/src/families/muse_spark/`, kernels in `zig/kernels/cuda/muse_spark/`. There is no Python family for +this model, so the kernels are hand-written CUDA and the parity reference is exllamav3's forward. + +## The model + +- 62 layers of hidden size 8,192: 16 full-attention layers (no RoPE) and 46 sliding-window layers (2,047 keys, RoPE). +- Attention: head dim 64, 128 query heads and 16 KV heads, a sigmoid output gate per attention, gated residuals. +- MoE: a latent MoE (8,192 to 4,096 before the experts and back after), 8 routed experts a token from a sigmoid + router with a score bias, a norm on every expert's output. +- Head: 202,048 tokens (padded to 202,112 rows), softcapped. +- `config.zig` refuses configs the kernels do not handle (dense MLPs, shared experts, attention bias, tied + embeddings, head dim other than 64, GQA other than 8:1, non-default RoPE, codebooks other than mul1). + +## Checkpoints + +| | Repository | Revision | +|---|---|---| +| Pack (EXL3 mul1, 1.8 bpw) | `ajensenwaud/Muse-Spark-Open-816B-A42B-EXL3-1.8bpw` | `38ad2925945840c3a677bd3f213867d30368636c` (weights as of `efcdf2ec4222c4597e291f1b07edd19c3c02c652`; later commits change the card only) | +| Pack source | `amd/Muse-Spark-Open-816B-A42B-Quark-MXFP4` | `4885eb2a901c2638854ef35cf6833e6447622afb` | + +Licences: Muse Spark Open (`meta-models/Muse-Spark-Open-816B-A42B`), AMD's MXFP4 export and the EXL3 pack are under +Meta's Muse Model License and its Usage Policy (the pack ships it as `LICENSE.md`; it asks for "Built with Muse Spark +Open" and a separate agreement for large model-as-a-service use). exllamav3, the quantiser and the parity reference, +is MIT (Copyright (c) 2025 Turboderp). + +The drafter is not part of the served setup. The family reads a DFlash2 drafter (`--drafter`), written for RadixArk's +`RadixArk/Muse-Spark-Open-DFlash2`, but that repository states no licence on its card or in its files, and with no +licence all rights are reserved by default. Until it states one, this recipe serves plain decode, names no drafter +pack, and its figures are for plain decode unless they say otherwise. + +## Files + +| File | What it does | +|---|---| +| `config.zig`, `load.zig`, `pack.zig` | Config, a rank's TP cuts, the pack's load (EXL3 strips, norms, gates, router) | +| `exl3.zig` | EXL3 layers on the shared `cuda.exl3` linear and `cuda.exl3_experts` operators | +| `forward.zig`, `ops.zig` | The decode forward for windows of rows over any slots and positions, eager or graphed | +| `prompt.zig` | The prompt path: 1,024-row chunks, experts in 512-row windows, the head on the last row | +| `engine.zig`, `native.zig` | The model and TP session, the plan link's words, the lanes backend behind `serve` | +| `kept.zig` | The prompt cache's kept states (`snap_*`): full-layer rows pinned in the slot, rings copied | +| `dflash2*.zig` | The DFlash2 drafter (`--drafter`, not served here), split over the ranks like the target | +| `m1_main.zig`, `draft_main.zig`, `prompt_main.zig`, `pair.zig` | `tf-muse`: checks and `follow` (rank 1) | + +Kernels: the EXL3 projections and routed experts run on the shared operators (`exl3_linear.cu`, `exl3_experts.cu`). +The family's own kernels: `attention.cu` (head dim 64 decode attention), `glue.cu` (norms, gated residuals, router, +top-k, expert norms and sums, softcap, argmax, RoPE tables), `linear_multi.cu` (q/k/v/gate in one launch and 32-row +passes over `exl3_decode.cuh`, the shared linear's bits), `experts2.cu` (32-member tiles of the shared grouped GEMM, +its bits; prompt windows), `dflash.cu` and `dflash2.cu` (the drafter). Every launch is registered for the kernel +contract's gate 5 (`core/contract/muse_cuda_records.zig`, sm_121); `muse_rms`, the linear forms and the 32-member +tiles also run gates 1-4 (`tests/cuda/contract_muse*.zig`), the last two as bit-equal replacements of the shared kernels. + +A row's bits do not depend on its window, its neighbours, the graph bucket or how a prompt is cut into chunks, so +graphed decode equals eager decode, the prompt path equals decode rows, and a resumed prompt equals a fresh one. + +## Serving + +- Two Sparks only: rank 1 runs `tf-muse follow PACK` with `TF_TP_WORLD=2 TF_TP_RANK=1 TF_TP_MASTER= + TF_TP_PORT=`; then rank 0 runs `tensorfold-native serve --model PACK` with the same `TF_TP_*` and + `TF_TP_RANK=0`. `TF_COMM_BACKEND` picks `roce` (the default) or `nccl` for the gathers; both give the same bytes. +- The release archive ships only `tensorfold-native`, so build rank 1's `tf-muse` from source on that Spark: + `zig build tf-muse -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=121 -Doptimize=ReleaseFast` (it lands in `zig-out/bin`). +- The family is admitted only as it was run: on a GB10 (sm_121) at two ranks. Any other GPU is refused + (`MuseSparkRequiresSm121`), and so is one rank or any other world size (`MuseSparkRequiresTwoRanks`), at admission + and in `tf-muse follow`; a malformed `TF_TP_*` is refused (`BadSetting`) rather than sized as one GPU. +- `--prompt-cache-gib N`: the prompt cache's budget a rank (`0` turns it off; 1 when not given). A kept state costs + about 0.2 GiB a rank whatever its length. +- Memory: at the 1.8 bpw pack a rank holds about 108 GiB serving (measured on two GB10s with a 24K-token prompt + running: 108.8 GiB a process, 5.5-5.9 GiB MemAvailable left a node; that run also held the drafter, 1.64 GiB a + rank, so plain decode holds that much less). The server's default reserve, a tenth of unified memory (12.2 GiB), + leaves no room for the caches beside it, so give the reserve explicitly, e.g. `TENSORFOLD_MEMORY_RESERVE_GIB=3` on + both ranks. +- The KV cache is fp16. +- The embedding stays in host memory (rows are copied from the pack's mapping each window), the load uses 64 MiB + arena blocks, and each layer's pages leave the page cache once uploaded. + +## Checks (`tf-muse`) + +- `tf-muse m1 MODEL IN_DIR OUT_DIR`: teacher-forced decode rows over each text's ids (`IN_DIR/names.txt`, + `.ids` int32), then greedy rows; writes `.logits.f32` and `.greedy.i32`. Knobs: `MUSE_ROWS`, + `MUSE_SLOTS`, `MUSE_LAYERS`, `MUSE_CONTEXT`, `MUSE_GREEDY`, `MUSE_CAPTURE`, `MUSE_TEACHER`, `MUSE_GRAPHS`, + `MUSE_PAIR=1` (both ranks on one GPU). At TP=2 set `TF_TP_*` on both nodes; rank 0 writes the outputs. +- `tf-muse prompt MODEL IN_DIR OUT_DIR`: each chunk plan of `MUSE_PROMPT_PLANS` against decode rows, byte for byte. +- `tf-muse dflash|drafted MODEL IN_DIR OUT_DIR`: the drafter's fixed protocol and drafted == plain greedy + (`MUSE_DRAFTER` names a DFlash2 pack, `MUSE_DRAFT_TAPS` overrides its taps on truncated packs); they need a + drafter, which is not part of the served setup (see Checkpoints). +- Graphs against eager: `m1` with `MUSE_GRAPHS=1` against an eager run; the logits files must be byte-equal. diff --git a/docs/recipes/qwen3.8-27b.md b/docs/recipes/qwen3.8-27b.md index 76485984510..661c04ad506 100644 --- a/docs/recipes/qwen3.8-27b.md +++ b/docs/recipes/qwen3.8-27b.md @@ -232,6 +232,12 @@ This section is the Python engine's (0.6.6). The native CUDA engine reads the ML NVFP4 and FP8 exports, and turboderp's EXL3 packs through the shared EXL3 module of #832; its own measurements are not the ones below. +### Native engine on sm_110 (development build) + +On NVIDIA Thor (sm_110), build the native CUDA engine with `-Dsm=110`. This is a development target; `-Dgpu=sm_110` is not a product target yet. The measured path uses the MLX affine 4-bit/group-64 checkpoint, one GPU, BF16 KV and prompt activations, and the DFlash2 drafter. Text and PNG image requests were checked against `"draft": false` with greedy and seeded sampling, solo and concurrent streams, cancelled requests and resumed prompts. The device receipt belongs to the commit and checkpoint hashes recorded with the test run; it does not qualify other checkpoints or image decoders. + +The SM110 Qwen loader refuses `--slide`, DSpine `--drafter`, `TF_DSPINE_WINDOW`, `--kv-cache fp8`, `--prompt-precision int8`, `--rope-yarn`, `TF_QWEN_KV_PAGES`, `TF_QWEN_KV_PAGES_ALL=1`, `TF_QWEN_KV_SHARE`, `TF_QWEN_REQUEST_STARTS=1`, `TF_QWEN_KV_PAGE_TEST`, `TF_QWEN_KEEP_LATE=1`, `TF_NO_TREES` and `TF_DRAFT_NODES` when they would change the default serving path. Their other-GPU behavior is unchanged. Unset or explicit off values for the `TF_QWEN_*` switches keep the default path; `TF_NO_TREES` and `TF_DRAFT_NODES` must be unset. + On CUDA the 27B serves NVFP4 and EXL3 checkpoints, and the MLX 4-bit checkpoint as the portable option: the same files a Mac serves, and the only format two ranks read. `tensorfold serve` loads the checkpoint you name; it picks none by itself. Use the [CUDA container setup](https://github.com/ashhart/TensorFold/blob/v0.6.6/RUNBOOK.md#nvidia-gpus) diff --git a/docs/run-guide.md b/docs/run-guide.md index fb07bcc3018..cdc1e02938d 100644 --- a/docs/run-guide.md +++ b/docs/run-guide.md @@ -105,6 +105,7 @@ The binary's `capabilities --json` response lists its supported flags and platfo | `--api-key-file FILE` | Read keys from a restricted-permission file; a key can be limited to [some routes](api.md#key-scopes). | | `--metrics-open` | Allow `/metrics`, `/v1/metrics` and `/v1/load` without a key when API authentication is enabled. | | `--dashboard` | Enable the local `/dashboard` page and `/stats` endpoint. | +| `--log-json` | Write the access, `ended` and `refused` lines as one JSON object each, with `event` set to `access`, `ended` or `refused`. `access` is written when the response starts, with the HTTP status and the request id once assigned. `ended` is written only when the client left or the reply failed, with `prompt` and `tokens`. `refused` is written for an error reply, before its `access` line. Long fields are cut so each line still parses. Off keeps the text lines. | | `--max-inflight N`, `--max-inflight-per-key N` | Refuse model requests past N in progress at once, overall or per key, with 429; 0, the default, is off. See [admission](api.md#admission). | | `--max-connections N`, `--max-connections-per-address N`, `--trusted-proxy ADDRESS` | Open connections at most (default 128); from three quarters full, one address's share (default a quarter, 0 off); addresses never counted for that share, as loopback is not, such as a reverse proxy or Docker's bridge gateway. See [admission](api.md#admission). | | `--requests-per-second N`, `--request-burst N` | Refuse a key's model requests past N a second, after a burst; 0, the default, is off. | diff --git a/docs/supported-models.md b/docs/supported-models.md index fb81ddcda14..2858ab7028c 100644 --- a/docs/supported-models.md +++ b/docs/supported-models.md @@ -11,6 +11,8 @@ These are the native release's serving paths. A recipe may also describe the old use its native section and the current [changes](../CHANGELOG.md) together. Hardware below records the documented scope, not an unmeasured minimum. Context, parallel requests, prompt caches and drafters need memory beyond the weights. `tensorfold info REPO` reports the checkpoint's memory floor. +`tensorfold models` lists this table's chat checkpoints that fit your machine, largest first, with the memory each +needs, a quality score and a rough one-stream speed; `tensorfold models --all` adds the rest and what each needs. Where no RAM capacity is published, inspect that floor before serving a large checkpoint. CUDA release images include sm_80, sm_86, sm_120 and sm_121. The A100 (sm_80) has kernel-check evidence ([#846](https://github.com/ashhart/TensorFold/pull/846)), but no served checkpoint on record, so it is not model-qualified. @@ -81,8 +83,12 @@ tensorfold rm TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit `pull` downloads a checkpoint into the Hugging Face cache and checks what it downloads against the Hub: large files by sha256, small files by their git blob sha1. Large files come down in pieces over up to 16 connections, and an interrupted pull resumes with the pieces it lacks. -It refuses a checkpoint whose `model_type` has no native family, and fetches the 27B's DFlash2 drafter for `--drafter`. `models` lists the cached checkpoints with a model type it knows, and `info` shows one checkpoint's family, format, context and memory floor. -`models --json` prints the same list as one document for programs: `schema` 1, and each checkpoint's `repo`, `family` and `model_type`; `family` is a display title and `model_type` is the key to match on. +It refuses a checkpoint whose `model_type` has no native family, and fetches the 27B's DFlash2 drafter for `--drafter`. `info` shows one checkpoint's family, format, context and memory floor. +`models` reads this machine's chip, memory, GPU limit and memory bandwidth, then lists the chat checkpoints from [Pick a model](#pick-a-model) that fit, largest first. +Each line gives the memory the engine keeps (weights, any drafter and a 2 GiB margin; context and caches take more) and a one-stream speed with drafts as shipped: measured on this chip, or `~` estimated from a measurement on another chip of the same backend, scaled by memory bandwidth. +Quality is the share of TensorFold Web's 228-item quality suite the checkpoint answers right, greedy with thinking off, measured once a checkpoint with `tools/quality_suite.py`; each score's receipt is in [quality receipts](receipts/quality-suite/README.md), and `-` means not rated yet. +The line under it installs the checkpoint. `--all` also lists what needs more memory, two machines or the other backend. Last come the cached checkpoints with a model type it knows. +`models --json` prints one document for programs: `schema` 1 and `models`, each cached checkpoint's `repo`, `family` and `model_type` (`family` is a display title and `model_type` is the key to match on), plus `machine` and `catalog`, each entry's `need_bytes`, `fit`, `tok_s` (null when unmeasured), `quality` (passed, items, share, suite digest and receipt; null when unrated), `on_disk` and `install`. `tensorfold serve REPO` serves a cached checkpoint by its repository name. `rm REPO` removes a cached checkpoint with all its snapshots, blobs and refs, and then the repo's folder. `rm REPO@REVISION` removes one snapshot, named by a ref such as `main` or by its commit, and the refs that name it. Blobs another snapshot still links to stay. diff --git a/docs/web.md b/docs/web.md index b630c9b9a37..4f496c6610d 100644 --- a/docs/web.md +++ b/docs/web.md @@ -13,7 +13,7 @@ For example, a binary built with `-Dversion=1.2.0` prints: uv tool install "tensorfold-web @ git+https://github.com/ashhart/TensorFold@v1.2.0#subdirectory=web" ``` -After installation, the launcher checks PATH and then `uv tool dir --bin` for the executable. +The launcher checks PATH first, then `uv tool dir --bin` if uv is available. It repeats the lookup after a successful install. On systems where process replacement is available it execs the application; on Windows it waits for the child. The application's exit status is retained. diff --git a/tools/pdl_early_loads.py b/tools/pdl_early_loads.py new file mode 100644 index 00000000000..40ac296db15 --- /dev/null +++ b/tools/pdl_early_loads.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +"""pdl_early_loads.py CUOBJDUMP IMAGE...: global reads a dependent-launch kernel issues before its wait (sm_90 on). + +ptxas may schedule a non-coherent load (const __restrict__, __ldg) above griddepcontrol.wait (ACQBULK); under a +dependent launch that reads the predecessor's data early. Every function compiled for sm_90 or later must issue no +global read before its first ACQBULK, and wait at all unless it is a plain-only entry (PLAIN); only the +weight-first bodies (qmmf_kernel, glm_mm's matmuls) may start their weights' async copies there. The wait must hold +on every path: no predicated ACQBULK, and no branch before it to past it except to an EXIT. Exit 1 on any early +read, a failed disassembly, or images with no such function. +""" +import re +import subprocess +import sys + +READ = re.compile(r"\b(LDG|LD|ULDG|TEX|TLD|TLD4|TXD|TMML|SULD)\b(?=[.\s])") +ASYNC = re.compile(r"\b(LDGSTS|UBLKCP|UTMALDG|UBLKPF)\b") +WEIGHT_FIRST = re.compile(r"qmmf_kernel|^glm_mm\d+_(\d+|rows)$") +ADDR = re.compile(r"/\*([0-9a-f]{4,})\*/") +BRANCH = re.compile(r"\b(BRA|BRX|BRXU|JMP|JMX|JMXU|CALL)\b(\S*)\s+(.*?);") +PLAIN = re.compile(r"qmmf_prompt_k32_kernel|^tf_qmmf_shared|^tf_qmmf_native_fp4_check$") # launched plain only + + +def scan(text): + """Problems in one `cuobjdump -sass` dump, and how many sm_90+ functions it checked (plain-only entries are not).""" + problems, functions = [], 0 + arch, fn, waited, early, at, wait_at, jumps, code = 0, None, False, [], 0, 0, [], {} + + def close(): + nonlocal functions + if fn is None or arch < 90 or PLAIN.search(fn): + return + functions += 1 + if not waited: + problems.append(f"sm_{arch} {fn}: no dependency wait, yet not a plain-only entry") + return + problems.extend(early) + for src, target in jumps: + if target is None or (target > wait_at and code.get(target, "").split(";")[0].strip() != "EXIT"): + where = "an indirect branch" if target is None else f"a branch to {target:#x}" + problems.append(f"sm_{arch} {fn}: {where} at {src:#x} passes the wait at {wait_at:#x}") + + for line in text.splitlines(): + m = re.search(r"code for sm_(\d+)", line) + if m: + close() + arch, fn = int(m.group(1)), None + continue + m = re.search(r"Function : (\S+)", line) + if m: + close() + fn, waited, early, jumps, code = m.group(1), False, [], [], {} + continue + if fn is None or arch < 90: + continue + m = ADDR.search(line) + if not m: + continue + at = int(m.group(1), 16) + code[at] = line[m.end():].strip() + if waited: + continue + if "ACQBULK" in line: + waited, wait_at = True, at + if code[at].startswith("@"): + early.append(f"sm_{arch} {fn}: a predicated wait at {at:#x}: {' '.join(line.split())[:80]}") + elif (b := BRANCH.search(line)) is not None: + t = re.search(r"0x([0-9a-f]+)\s*$", b.group(3).strip()) + jumps.append((at, int(t.group(1), 16) if t and b.group(1) in ("BRA", "JMP", "CALL") else None)) + elif READ.search(line): + early.append(f"sm_{arch} {fn}: global read before the wait: {' '.join(line.split())[:80]}") + elif ASYNC.search(line) and not WEIGHT_FIRST.search(fn): + what = "async copy before the wait outside a weight-first body" + early.append(f"sm_{arch} {fn}: {what}: {' '.join(line.split())[:80]}") + close() + return problems, functions + + +def main(argv): + if len(argv) < 3: + print("usage: pdl_early_loads.py CUOBJDUMP IMAGE...", file=sys.stderr) + return 2 + tool, images = argv[1], argv[2:] + problems, functions = [], 0 + for img in images: + r = subprocess.run([tool, "-sass", img], capture_output=True, text=True) + if r.returncode != 0: + print(f"{img}: {tool} failed: {r.stderr.strip()[:200]}", file=sys.stderr) + return 1 + p, n = scan(r.stdout) + if n == 0: + print(f"{img}: no sm_90 or later function to check", file=sys.stderr) + return 1 + problems += [f"{img.split('/')[-1]} {x}" for x in dict.fromkeys(p)] + functions += n + for x in problems: + print("EARLY", x) + print(f"{len(problems)} early read(s) in {functions} function(s) of {len(images)} image(s)") + return 1 if problems else 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/tools/quality_suite.py b/tools/quality_suite.py new file mode 100644 index 00000000000..2edd3a7635d --- /dev/null +++ b/tools/quality_suite.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""quality_suite.py URL OUT: TensorFold Web's quality suite against one served model, scored as its Bench scores it.""" +# Each suite item runs once, greedy, with thinking off when the server advertises that switch. +from __future__ import annotations + +import argparse +import json +import pathlib +import sys +import time +import urllib.error +import urllib.request + +WEB = pathlib.Path(__file__).resolve().parent.parent / "web" +sys.path.insert(0, str(WEB)) +from tensorfold_web import quality # noqa: E402 + +OFF = {"chat_template_kwargs": {"enable_thinking": False}} + + +def call(url: str, body: dict | None = None, timeout: float = 30) -> dict: + data = None if body is None else json.dumps(body).encode() + req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"}) + with urllib.request.urlopen(req, timeout=timeout) as r: + return json.loads(r.read()) + + +def ask(base: str, model: str, it: dict, off: dict, timeout: float) -> dict: + """One item: the reply's verdict, or an unscored error as the Bench keeps a failed request apart.""" + body = {"model": model, "messages": it["messages"], "max_tokens": it["max_tokens"], "temperature": 0.0, + "top_p": 1.0, "stream": False, **off} + try: + choice = call(base + "/v1/chat/completions", body, timeout)["choices"][0] + except (urllib.error.URLError, OSError, KeyError, IndexError, ValueError) as e: + return {"category": it["category"], "id": it["id"], "passed": None, "read": f"error: {e}"[:200], "text": ""} + text = choice.get("message", {}).get("content") or "" + passed, read = quality.score(it["category"], it["item"], text) + if not passed and choice.get("finish_reason") == "length": + read = f"cut at {it['max_tokens']} tokens ({read})" + return {"category": it["category"], "id": it["id"], "passed": passed, "read": read, "text": text[:2000]} + + +def summary(data: dict, results: list[dict]) -> dict: + """The Bench's quality summary: graded items and passes, overall and per category; errors counted apart.""" + graded = [r for r in results if r["passed"] is not None] + cats = {c: [r for r in graded if r["category"] == c] for c in data["categories"]} + return {"overall": {"items": len(graded), "passed": sum(r["passed"] for r in graded), + "unscored": len(results) - len(graded)}, + "categories": {c: {"items": len(v), "passed": sum(r["passed"] for r in v)} for c, v in cats.items()}} + + +def main(argv: list[str] | None = None) -> int: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("url", help="the server, for example http://127.0.0.1:8080") + p.add_argument("out", help="the receipt to write (JSON)") + p.add_argument("--checkpoint", default="", help="REPO@REVISION served, kept in the receipt") + p.add_argument("--engine", default="", help="the engine commit served, kept in the receipt") + p.add_argument("--machine", default="", help="the chip it ran on, kept in the receipt") + p.add_argument("--timeout", type=float, default=900, help="seconds a request may take (900)") + a = p.parse_args(argv) + base = a.url.rstrip("/") + entry = call(base + "/v1/models")["data"][0] + off = OFF if (entry.get("capabilities") or {}).get("thinking_switch") else {} + data = quality.load() + water = json.loads((WEB / "tensorfold_web" / "data" / "suites.json").read_text(encoding="utf-8"))["passages"]["water"] + work = quality.items(data, water + "\n\n") + started, results = time.time(), [] + for i, it in enumerate(work, 1): + results.append(ask(base, entry["id"], it, off, a.timeout)) + print(f"{i}/{len(work)} {it['category']} {it['id']}: {results[-1]['read']}", file=sys.stderr, flush=True) + q = summary(data, results) + receipt = {"suite": {"quality": data["version"], "digest": data["digest"]}, + "protocol": {"temperature": 0.0, "top_p": 1.0, "concurrency": 1, + "thinking": "off: chat_template_kwargs.enable_thinking" if off else "model default"}, + "model": entry["id"], "checkpoint": a.checkpoint, "engine": a.engine, "machine": a.machine, + "seconds": round(time.time() - started, 1), "quality": q, "items": results} + pathlib.Path(a.out).write_text(json.dumps(receipt, indent=1) + "\n", encoding="utf-8") + o = q["overall"] + cats = ", ".join(f"{c} {v['passed']}/{v['items']}" for c, v in q["categories"].items()) + print(f"quality {o['passed']}/{o['items']} ({100 * o['passed'] / max(1, o['items']):.1f}%); {cats}; " + f"unscored {o['unscored']}") + return 0 if o["unscored"] == 0 else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/test_pdl_early_loads.py b/tools/test_pdl_early_loads.py new file mode 100644 index 00000000000..a99a948061a --- /dev/null +++ b/tools/test_pdl_early_loads.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Fixtures for pdl_early_loads.py: early reads and waits a path can skip fail; later reads and weight copies pass.""" +import os +import sys +import unittest + +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import pdl_early_loads as p # noqa: E402 + + +COPY = "LDGSTS.E.BYPASS.128 [R7], desc[UR10][R4.64]" + + +def dump(arch, fn, *lines): + body = "\n".join(f" /*{i * 16:04x}*/ {x} ;" for i, x in enumerate(lines)) + return f"\tcode for sm_{arch}\n\t\tFunction : {fn}\n{body}\n" + + +class Scan(unittest.TestCase): + def check(self, text, problems, functions=1): + got, n = p.scan(text) + self.assertEqual(len(got), problems, got) + self.assertEqual(n, functions) + + def test_read_after_wait_passes(self): + self.check(dump(121, "tf_glm_a", "ACQBULK", "LDG.E.CONSTANT R4, desc[UR14][R2.64]"), 0) + + def test_constant_load_before_wait_fails(self): + self.check(dump(121, "tf_glm_a", "LDG.E.CONSTANT R4, desc[UR14][R2.64]", "ACQBULK"), 1) + + def test_generic_load_before_wait_fails(self): + self.check(dump(121, "tf_glm_a", "LD.E R4, desc[UR4][R2.64]", "ACQBULK"), 1) + + def test_texture_load_before_wait_fails(self): + self.check(dump(121, "tf_glm_a", "TLD.SCR.LZ R0, R2, R4", "ACQBULK"), 1) + + def test_shared_and_constant_bank_loads_pass(self): + banks = ("LDS R4, [R2]", "LDC R1, c[0x0][0x37c]", "ULDC UR4, c[0x0][0x208]") + self.check(dump(121, "tf_glm_a", *banks, "ACQBULK"), 0) + + def test_weight_first_copies_pass(self): + self.check(dump(121, "_ZN7tf_qmmf11qmmf_kernelILi2E", COPY, "ACQBULK"), 0) + self.check(dump(121, "glm_mm16_rows", COPY, "ACQBULK"), 0) + + def test_copies_elsewhere_fail(self): + self.check(dump(121, "glm_mm_reduce", COPY, "ACQBULK"), 1) + + def test_plain_only_kernels_skipped(self): + self.check(dump(121, "tf_qmmf_shared64", COPY, "LDG.E R4, desc[UR4][R2.64]"), 0, 0) + + def test_a_dependent_kernel_without_its_wait_fails(self): + self.check(dump(121, "glm_mm16_16", COPY, "LDG.E R4, desc[UR4][R2.64]"), 1) + + def test_predicated_wait_fails(self): + self.check(dump(121, "tf_glm_a", "@P0 ACQBULK", "LDG.E R4, desc[UR4][R2.64]"), 1) + + def test_branch_past_the_wait_fails(self): + self.check(dump(121, "tf_glm_a", "@P0 BRA 0x30", "ACQBULK", "NOP", "LDG.E R4, desc[UR4][R2.64]"), 1) + self.check(dump(121, "glm_mm16_rows", COPY, "BRA.U !UP0, 0x30", "ACQBULK", "LDG.E R4, desc[UR4][R2.64]"), 1) + + def test_indirect_branch_before_the_wait_fails(self): + self.check(dump(121, "tf_glm_a", "BRX R4 -0x20", "ACQBULK"), 1) + + def test_branch_to_exit_or_within_the_prologue_passes(self): + self.check(dump(121, "tf_glm_a", "@P0 BRA 0x20", "ACQBULK", "EXIT"), 0) + self.check(dump(121, "glm_mm16_rows", COPY, "BRA.U UP0, 0x0", "ACQBULK", "LDG.E R4, desc[UR4][R2.64]"), 0) + + def test_pre_pdl_targets_skipped(self): + self.check(dump(80, "tf_glm_a", "LDG.E R4, desc[UR4][R2.64]"), 0, 0) + + +class Main(unittest.TestCase): + def test_no_images_is_usage(self): + self.assertEqual(p.main(["pdl_early_loads.py", "cuobjdump"]), 2) + + def test_failed_tool_fails(self): + self.assertEqual(p.main(["pdl_early_loads.py", "/bin/false", "x.fatbin"]), 1) + + def test_empty_dump_fails(self): + self.assertEqual(p.main(["pdl_early_loads.py", "/bin/true", "x.fatbin"]), 1) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/tests/test_bench_quality_suite.py b/tools/tests/test_bench_quality_suite.py new file mode 100644 index 00000000000..d699b16729a --- /dev/null +++ b/tools/tests/test_bench_quality_suite.py @@ -0,0 +1,90 @@ +"""The quality suite runner against a stand-in server: the Bench's scoring, thinking off, and the receipt's counts.""" +import contextlib +import http.server +import io +import json +from pathlib import Path +import sys +import tempfile +import threading +import unittest + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import quality_suite +from tensorfold_web import quality + + +def server(answer, switch=True): + """A served model that answers each item through `answer(item)`; it keeps every request body it saw.""" + data = quality.load() + suites = json.loads((quality_suite.WEB / "tensorfold_web" / "data" / "suites.json").read_text(encoding="utf-8")) + by_prompt = {it["messages"][0]["content"]: it for it in quality.items(data, suites["passages"]["water"] + "\n\n")} + seen = [] + + class Handler(http.server.BaseHTTPRequestHandler): + def reply(self, obj): + body = json.dumps(obj).encode() + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def do_GET(self): + self.reply({"data": [{"id": "stand-in", "capabilities": {"thinking_switch": switch}}]}) + + def do_POST(self): + req = json.loads(self.rfile.read(int(self.headers["Content-Length"]))) + seen.append(req) + it = by_prompt[req["messages"][0]["content"]] + self.reply({"choices": [{"message": {"content": answer(it)}, "finish_reason": "stop"}]}) + + def log_message(self, format, *args): + pass + + httpd = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler) + threading.Thread(target=httpd.serve_forever, daemon=True).start() + return httpd, seen + + +def right(it): + if it["category"] == "gsm8k": + return f"Working.\nAnswer: {it['item']['answer']}" + if it["category"] in ("mmlu", "long_context"): + return str(it["item"]["answer"]) + return "no" + + +class QualitySuite(unittest.TestCase): + def run_suite(self, answer, switch=True): + httpd, seen = server(answer, switch) + self.addCleanup(httpd.server_close) + self.addCleanup(httpd.shutdown) + with tempfile.TemporaryDirectory() as d: + out = Path(d) / "receipt.json" + with contextlib.redirect_stderr(io.StringIO()), contextlib.redirect_stdout(io.StringIO()): + code = quality_suite.main([f"http://127.0.0.1:{httpd.server_address[1]}", str(out), + "--checkpoint", "Org/Model@rev"]) + return code, json.loads(out.read_text()), seen + + def test_right_answers_pass_by_the_benchs_scoring_and_thinking_is_turned_off(self): + code, receipt, seen = self.run_suite(right) + self.assertEqual(code, 0) + cats = receipt["quality"]["categories"] + self.assertEqual((cats["gsm8k"]["passed"], cats["mmlu"]["passed"], cats["long_context"]["passed"]), (100, 100, 8)) + self.assertEqual(receipt["quality"]["overall"]["items"], 228) + self.assertEqual(receipt["suite"]["digest"], quality.load()["digest"]) + self.assertEqual(receipt["checkpoint"], "Org/Model@rev") + self.assertEqual(len(seen), 228) + self.assertTrue(all(r["chat_template_kwargs"] == {"enable_thinking": False} and r["temperature"] == 0.0 for r in seen)) + + def test_wrong_answers_fail_and_a_model_without_a_switch_gets_no_off_field(self): + code, receipt, seen = self.run_suite(lambda it: "I am not sure.", switch=False) + self.assertEqual(code, 0) + self.assertEqual(receipt["quality"]["categories"]["mmlu"]["passed"], 0) + self.assertEqual(receipt["protocol"]["thinking"], "model default") + self.assertTrue(all("chat_template_kwargs" not in r for r in seen)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/zig/cuda_common_allowlist.json b/tools/zig/cuda_common_allowlist.json index 26cda5548b6..0d83d8a4f48 100644 --- a/tools/zig/cuda_common_allowlist.json +++ b/tools/zig/cuda_common_allowlist.json @@ -37,6 +37,10 @@ {"path":"zig/kernels/cuda/minimax_m3.cuh","kind":"definition:block_sum","fingerprint":"5cdf621633053e5319eafb758a82aa96a7b2716308018e821e84724de1c518dc","count":1,"reason":"Leading-sync serial block sum with no trailing sync; deliberate shape variant."}, {"path":"zig/kernels/cuda/mma4.cuh","kind":"asm:mma.sync.aligned.kind","fingerprint":"cea5639cb5e94ceb28aed8472552edc1482d9f5a5ced18af2b2881f657dae5ed","count":1,"reason":"This mma.sync.aligned.kind uses its own operand format and tile geometry; the shared BF16/FP16 MMA operators are not interchangeable."}, {"path":"zig/kernels/cuda/mma4.cuh","kind":"asm:mma.sync.aligned.m16n8k32.row.col.f32.e4m3.e4m3.f32","fingerprint":"97c48275070d92e8b2bb73f4ab7db26b8f496853bae34a5d092cd924ceb6f19c","count":1,"reason":"This mma.sync.aligned.m16n8k32.row.col.f32.e4m3.e4m3.f32 uses its own operand format and tile geometry; the shared BF16/FP16 MMA operators are not interchangeable."}, +{"path":"zig/kernels/cuda/muse_spark/attention.cu","kind":"definition:warp_sum","fingerprint":"b1e2e6674fdaea06eb6983ee2d7b90591b9e0baf642a267ef476218aafa94652","count":1,"reason":"Muse Spark's xor butterfly, offsets 16 down to 1, the order tf_common::warp_sum uses; the swap to the shared one needs the same machine code, checked with nvcc on the family's GB10 run."}, +{"path":"zig/kernels/cuda/muse_spark/dflash2.cu","kind":"definition:warp_sum","fingerprint":"b1e2e6674fdaea06eb6983ee2d7b90591b9e0baf642a267ef476218aafa94652","count":1,"reason":"Muse Spark's xor butterfly, offsets 16 down to 1, the order tf_common::warp_sum uses; the swap to the shared one needs the same machine code, checked with nvcc on the family's GB10 run."}, +{"path":"zig/kernels/cuda/muse_spark/glue.cu","kind":"definition:block_sum","fingerprint":"a3e6344f1ca705deae19d6525f7ea466f6abe8730afdcd7958145cc2733edf33","count":1,"reason":"Tree reduction owns shared scratch and broadcasts through total; shape differs from shared tree."}, +{"path":"zig/kernels/cuda/muse_spark/glue.cu","kind":"definition:warp_sum","fingerprint":"b1e2e6674fdaea06eb6983ee2d7b90591b9e0baf642a267ef476218aafa94652","count":1,"reason":"Muse Spark's xor butterfly, offsets 16 down to 1, the order tf_common::warp_sum uses; the swap to the shared one needs the same machine code, checked with nvcc on the family's GB10 run."}, {"path":"zig/kernels/cuda/norms_strided.cuh","kind":"definition:block_sum","fingerprint":"60fb3913be6c2ac761716e6e212e04931a283a81042888c2c4a2bcbcd7fc225e","count":1,"reason":"Explicit RN warp sums or red[0]-first serial block sum; unresolved order/shape variant."}, {"path":"zig/kernels/cuda/norms_strided.cuh","kind":"definition:warp_sum","fingerprint":"34fbe543927d3334d96d8046b34d5cccbfb6a7cd333b5517636454461ea1e767","count":1,"reason":"Explicit RN warp sums or red[0]-first serial block sum; unresolved order/shape variant."}, {"path":"zig/kernels/cuda/probe.cu","kind":"asm:griddepcontrol.launch_dependents","fingerprint":"09884533ac632c08ec1209b790aa3764cca31eebe838a69ba6482c36ab567db7","count":1,"reason":"The kernel or probe issues PDL at this dependency boundary; the inline instruction stays until a helper substitution preserves its compiler scheduling and machine code."}, diff --git a/tools/zig/inkling2_fixtures.py b/tools/zig/inkling2_fixtures.py new file mode 100644 index 00000000000..21af5106f97 --- /dev/null +++ b/tools/zig/inkling2_fixtures.py @@ -0,0 +1,199 @@ +"""Rebuild zig/src/families/inkling2/fixtures from the Inkling 2 Small release and tiny-random/inkling-2.""" +import argparse +import hashlib +import json +import struct +from importlib.metadata import version +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +FIXTURES = ROOT / "zig/src/families/inkling2/fixtures" +RELEASE = "thinkingmachines/Inkling-2-Small@2ad1157016e1aac77b6ff1b770e7c05229403134" +TINY = "tiny-random/inkling-2@0a57c72e4e5b68aafe1d983dbb62980344a5fcd7" +PINS = {"transformers": "5.20.0", "tokenizers": "0.23.3", "jinja2": "3.1.6"} +MERGES = 1500 + +HELLO = "Hello, I'll go 12345 times!" +UNICODE = "Caf\u00e9 na\u00efve \u2014 \u4f60\u597d \U0001f30d \u00f1and\u00fa" +CODE = "def f(x):\n return x**2 # square\n\n\tprint(f(3))\n" +EXPLAIN = "Explain MoE routing in two sentences." +TERSE = "You are terse." +EFFORTS = ("minimal", "low", "medium", "high", "xhigh", "max", 0.5, 0.99, 0.1, 0) +USERS = (HELLO, UNICODE, CODE, "It's 1234567 DON'T stop; we'll see ...\r\nnext?", "a", " two spaces and trailing ", EXPLAIN, + "Literal markers: <|end_message|> and <|message_user|> inside text.", "x" * 50 + " word" * 40 + " ") +CHAT = ([{"user": u} for u in USERS] + + [{"user": u, "effort": "none"} for u in (HELLO, UNICODE, CODE)] + + [{"user": HELLO, "effort": e} for e in EFFORTS] + + [{"user": EXPLAIN, "system": TERSE}, {"user": EXPLAIN, "system": TERSE, "effort": "none"}]) +RAW = ("Hello world", "I'll 12345 \u00c4\u00d6\u00dc", "\n\n \t x", "<|endoftext|>plain", "\u65e5\u672c\u8a9e\u306e\u30c6\u30ad\u30b9\u30c8", + "e\u0301 combining") +MINI = (HELLO, "I'LL DON'T it's we've", UNICODE, CODE, " two spaces and trailing ", "a\r\nb\n\n\nc", "1234567890", + "CamelCaseWord \u00c0\u00c9\u00ce \u01c5", "x" * 20, "<|message_user|><|content_text|>hi<|end_message|>", + "e\u0301 combining \u01c6", "...!!!???///\n", "word's 'quoted' text", "") + + +def dump(value, depth=0): + """JSON with one space of indent per level and every list of integers on one line.""" + pad = " " * (depth + 1) + if isinstance(value, dict): + rows = [f"{pad}{json.dumps(k, ensure_ascii=False)}: {dump(v, depth + 1)}" for k, v in value.items()] + return "{\n" + ",\n".join(rows) + "\n" + " " * depth + "}" + if isinstance(value, list) and all(isinstance(x, int) for x in value): + return "[" + ", ".join(str(x) for x in value) + "]" + if isinstance(value, list): + return "[\n" + ",\n".join(pad + dump(v, depth + 1) for v in value) + "\n" + " " * depth + "]" + return json.dumps(value, ensure_ascii=False) + + +def read_header(path): + """The tensors of a safetensors file as {name: (dtype tag, shape)}, read from its first bytes only.""" + with open(path, "rb") as f: + (length,) = struct.unpack(" 1: + raise SystemExit(f"{name}: more than one layer index") + layer = int(parts[at[0]]) if at else None + if at: + parts[at[0]] = "{L}" + dtype, dims = tensors[name] + groups.setdefault((".".join(parts), dtype, shape(dims)), []).append(layer) + lines = [f"{tag} {len(names)} {digest}"] + for (pattern, dtype, dims), layers in sorted(groups.items()): + lines.append(f"{pattern} {dtype} {dims}" + ("" if layers == [None] else " " + spans(layers))) + return "\n".join(lines) + "\n" + + +def byte_alphabet(): + """The 256 characters a byte-level tokenizer spells its bytes with (GPT-2's table).""" + printable = list(range(ord("!"), ord("~") + 1)) + list(range(0xA1, 0xAD)) + list(range(0xAE, 0x100)) + chars = printable + [256 + i for i, b in enumerate(b for b in range(256) if b not in printable)] + return {chr(c) for c in chars} + + +def cut_tokenizer(full): + """tokenizer.json cut to its added tokens, its byte alphabet and the first MERGES merges with their parts.""" + model = full["model"] + merges = model["merges"][:MERGES] + keep = byte_alphabet() | {x for pair in merges for x in pair} | {a + b for a, b in merges} + vocab = {t: i for t, i in sorted(model["vocab"].items(), key=lambda kv: kv[1]) if t in keep} + return {**full, "model": {**model, "vocab": vocab, "merges": merges}} + + +def mini_cases(cut_text): + """Ids and decoded text of MINI under the cut tokenizer, from the tokenizers library.""" + from tokenizers import Tokenizer + tok = Tokenizer.from_str(cut_text) + cases = [] + for text in MINI: + ids = tok.encode(text, add_special_tokens=False).ids + cases.append({"text": text, "ids": ids, "decoded": tok.decode(ids, skip_special_tokens=False)}) + reference = (f"tokenizers {PINS['tokenizers']} on mini_tokenizer.json (the checkpoint's tokenizer.json cut to its added " + f"tokens, its byte alphabet and the first {MERGES} merges)") + return {"reference": reference, "cases": cases} + + +def prompt_cases(release): + """Rendered prompts, ids and decoded text of CHAT and RAW, from transformers loading the release's files.""" + from transformers import AutoTokenizer + tok = AutoTokenizer.from_pretrained(str(release), local_files_only=True) + chat = [] + for case in CHAT: + messages = [{"role": "system", "content": case["system"]}] if "system" in case else [] + messages.append({"role": "user", "content": case["user"]}) + extra = {"reasoning_effort": case["effort"]} if "effort" in case else {} + prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, **extra) + ids = tok(prompt, add_special_tokens=False)["input_ids"] + decoded = tok.decode(ids) + if decoded != prompt: + raise SystemExit(f"decoded text differs from the prompt for {case}") + chat.append({"user": case["user"], "prompt": prompt, "ids": ids, "decoded": decoded, + **{k: case[k] for k in ("system", "effort") if k in case}}) + raw = [] + for text in RAW: + ids = tok(text, add_special_tokens=False)["input_ids"] + decoded = tok.decode(ids) + if decoded != text: + raise SystemExit(f"decoded text differs from the input for {text!r}") + raw.append({"text": text, "ids": ids, "decoded": decoded}) + reference = { + "transformers": PINS["transformers"], "tokenizers": PINS["tokenizers"], "jinja2": PINS["jinja2"], + "files": f"{RELEASE}: tokenizer.json, tokenizer_config.json, chat_template.jinja", + "call": "apply_chat_template(messages, tokenize=False, add_generation_prompt=True[, reasoning_effort=E]); " + "tok(prompt, add_special_tokens=False)", + } + return {"reference": reference, "chat": chat, "raw": raw} + + +def build(release, tiny): + """Every fixture file as bytes.""" + full = json.loads((release / "tokenizer.json").read_text(encoding="utf-8")) + cut = json.dumps(cut_tokenizer(full), separators=(",", ":"), ensure_ascii=False) + "\n" + return { + "config.json": (release / "config.json").read_bytes(), + "chat_template.jinja": (release / "chat_template.jinja").read_bytes(), + "tiny_config.json": (tiny / "config.json").read_bytes(), + "mini_tokenizer.json": cut.encode("utf-8"), + "mini_cases.json": (dump(mini_cases(cut)) + "\n").encode("utf-8"), + "prompt_cases.json": (dump(prompt_cases(release)) + "\n").encode("utf-8"), + "tiny_model_header.txt": fold("inkling2-tiny-model", read_header(tiny / "model.safetensors")).encode("utf-8"), + "tiny_mtp_header.txt": fold("inkling2-tiny-mtp", read_header(tiny / "mtp.safetensors")).encode("utf-8"), + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--release", type=Path, required=True, + help=f"{RELEASE}: config.json, chat_template.jinja, tokenizer.json, tokenizer_config.json") + parser.add_argument("--tiny", type=Path, required=True, help=f"{TINY}: config.json, model.safetensors, mtp.safetensors") + parser.add_argument("--out", type=Path, default=FIXTURES, help="the fixtures directory to write or compare") + parser.add_argument("--check", action="store_true", help="write nothing; exit 1 if a file differs from the one in --out") + args = parser.parse_args() + for name, want in PINS.items(): + if version(name) != want: + raise SystemExit(f"{name} {version(name)} is installed, {want} is pinned") + files = build(args.release, args.tiny) + differ = 0 + if not args.check: + args.out.mkdir(parents=True, exist_ok=True) + for name, data in sorted(files.items()): + path = args.out / name + if args.check: + same = path.is_file() and path.read_bytes() == data + differ += not same + print(("same " if same else "DIFFERS ") + name) + else: + path.write_bytes(data) + print(f"wrote {name}, {len(data)} bytes") + return 1 if differ else 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tools/zig/template_parity.py b/tools/zig/template_parity.py index 9dae96b7a1a..e3f21ff875d 100644 --- a/tools/zig/template_parity.py +++ b/tools/zig/template_parity.py @@ -212,6 +212,15 @@ def assistant(text, **extra): "{{ 1|float(2, 3) }}", "{{ 1|float(boolean=true) }}", "{{ undefined_name|float }}", + "{{ ''.format('X') }}|{{ '{}{}'.format(1, 'z') }}|{{ '{1}{0}'.format('a','b') }}|{{ '{{}}{}'.format(none) }}|{{ 'x'.format() }}", + "{{ '{}'.format(true) }}|{{ '{}'.format(1.5) }}|{{ '{0}{0}'.format('q') }}|{{ '{00}'.format('z') }}", + "{{ '{}{}'.format(1) }}", + "{{ '{0}{}'.format(1,2) }}", + "{{ '{'.format() }}", + "{{ '}'.format() }}", + "{{ '{+0}'.format(1) }}", + "{{ '{-0}'.format(1) }}", + "{{ '{0_0}'.format(1) }}", ] # Jinja2 features the native engine refuses on purpose; parity here means the native render fails loudly. UNSUPPORTED = [ diff --git a/tools/zig/zig_cache_restat_test.py b/tools/zig/zig_cache_restat_test.py index 4c46a9b9b3f..da557cf4bf9 100644 --- a/tools/zig/zig_cache_restat_test.py +++ b/tools/zig/zig_cache_restat_test.py @@ -1,4 +1,5 @@ """A restored build cache stays cached when only file ids changed, and still misses when contents changed.""" +import ast import os import re from pathlib import Path @@ -50,9 +51,11 @@ def setUp(self): (self.root / "build.zig").write_text(BUILD, newline="\n") for path, text in SOURCES.items(): (self.root / path).write_text(text, newline="\n") - lib = Path(self.zig).resolve().parent / "lib" + info = self.run_zig([self.zig, "env"]) + lib = re.search(r'^\s*\.lib_dir = ("(?:[^"\\]|\\.)*"),$', info, re.MULTILINE) + self.assertIsNotNone(lib, "zig env did not report .lib_dir") self.restat_command = [self.zig, "run", "-OReleaseFast", "-mcpu=baseline", str(TOOL), "--", str(self.cache), - str(lib)] + ast.literal_eval(lib[1])] def run_zig(self, command): result = subprocess.run(command, cwd=self.root, env=self.env, capture_output=True, text=True, timeout=300) diff --git a/zig/build/cuda.zig b/zig/build/cuda.zig index 711a1bfbab9..ad2a5dbe48b 100644 --- a/zig/build/cuda.zig +++ b/zig/build/cuda.zig @@ -75,6 +75,12 @@ pub fn targets(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu } if (image.*) |file| fatbin_step.dependOn(&b.addInstallFile(file, b.fmt("fatbin/{s}.fatbin", .{k.name})).step); } + // check-pdl-loads: no global read above a dependent launch's wait (tools/pdl_early_loads.py) + if (nvcc) |tool| { + const check = b.addSystemCommand(&.{ "python3", "tools/pdl_early_loads.py", b.pathJoin(&.{ std.fs.path.dirname(tool) orelse ".", "cuobjdump" }) }); + for (kernels, images) |k, image| if (image) |file| if (std.mem.startsWith(u8, k.name, "glm_") or std.mem.eql(u8, k.name, "qmmf")) check.addFileArg(file); + b.step("check-pdl-loads", "No global read before a dependent launch's wait in the GLM images and qmmf (needs -Dnvcc)").dependOn(&check.step); + } // MiniMax H3's kernel image: its library and the contract's runner take it const h3_image = if (nvcc) |tool| fatbin(b, tool, version orelse blk: { const run = b.addSystemCommand(&.{ tool, "--version" }); @@ -123,6 +129,9 @@ pub fn targets(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu for ([_]struct { []const u8, *std.Build.Module }{ .{ "kolibri1", kolibri1Module(b, target, optimize, cuda, mods.core, mods.lanes) }, .{ "dory", @import("dory.zig").module(b, target, optimize, cuda, mods.core, mods.lanes) }, .{ "idol_cuda", @import("idol_cuda.zig").targets(b, target, optimize, strip, cuda, mods.core) } }) |m| runner.addImport(m[0], m[1]); runner.addImport("gemma4_cuda", @import("gemma4_cuda.zig").module(b, target, optimize, cuda, mods.core, mods.lanes)); runner.addImport("spark25", @import("spark25.zig").module(b, target, optimize, cuda, mods.core, mods.lanes)); + // the served family and its engine, for the dots runner + const dots = native.engines.import_table.get("dots_mocr_cuda").?; + for ([_]struct { []const u8, *std.Build.Module }{ .{ "dots_mocr_cuda", dots }, .{ "cuda_dense", dots.import_table.get("cuda_dense").? } }) |m| runner.addImport(m[0], m[1]); runner.addImport("moss_image_cuda", b.createModule(.{ .root_source_file = b.path("zig/src/families/moss_image/cuda_kernels.zig"), .target = target, .optimize = optimize, .link_libc = true, .imports = &.{.{ .name = "cuda", .module = cuda }} })); runner.addImport("prompt_pages", b.createModule(.{ .root_source_file = b.path("zig/src/native/cuda_prompt_pages.zig"), .target = target, .optimize = optimize, .link_libc = true, .imports = &.{ .{ .name = "engine_api", .module = mods.api }, .{ .name = "core", .module = mods.core } } })); // TF_KV_SHARE's store, for the pages checks const runner_exe = b.addExecutable(.{ .name = "tf-cuda-test", .root_module = runner }); @@ -130,6 +139,7 @@ pub fn targets(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu // tf-cuda-limits: kernel-contract-limits alone, built without the contracts' test sources const limits_exe = b.addExecutable(.{ .name = "tf-cuda-limits", .root_module = b.createModule(.{ .root_source_file = b.path("zig/tests/cuda/limits_main.zig"), .target = target, .optimize = optimize, .link_libc = true, .strip = strip, .imports = &.{ .{ .name = "cuda", .module = cuda }, .{ .name = "core", .module = mods.core } } }) }); b.step("tf-cuda-limits", "Build kernel-contract-limits alone: the fatbins' launches against their records, no GPU").dependOn(&b.addInstallArtifact(limits_exe, .{}).step); + @import("muse.zig").tool(b, @import("muse.zig").module(b, target, optimize, cuda, mods.core, mods.lanes), strip); // tf-muse: rank 1 and checks // tf-tp-watch-check: the ranks' lines with no GPU or NCCL; a failing or dying rank stops every rank b.installArtifact(b.addExecutable(.{ .name = "tf-tp-watch-check", .root_module = b.createModule(.{ .root_source_file = b.path("zig/tests/cuda/tp_watch_check.zig"), .target = target, .optimize = optimize, .link_libc = true, .strip = strip, .imports = &.{.{ .name = "cuda", .module = cuda }} }) })); @import("living_dense.zig").target(b, target, optimize, cuda, mods.qwen35); @@ -209,6 +219,7 @@ pub fn hostTests(b: *std.Build, draft_ids: *std.Build.Module, build_options: *st all.dependOn(step); @import("release_version.zig").tests(b, step); @import("environment.zig").tests(b, step); + @import("machine.zig").tests(b, step); const flags = b.addRunArtifact(b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("zig/build/cuda_release_flags.zig"), .target = b.graph.host, @@ -366,7 +377,11 @@ pub fn hostTests(b: *std.Build, draft_ids: *std.Build.Module, build_options: *st b.step("test-trainer-close-host", "Actual native close and real Flash Next trainer ownership sentinels").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = native, .filters = &.{"Save recovery:"} })).step); const template, const server_tests = @import("cuda_server_host.zig").steps(b, host, cuda, mods, native_modules, build_options, windows_port, step, server_steps); // the tokenizer's own tests (memo, steps, regex, unicode) run here: no other test binary reaches them - for ([_]*std.Build.Module{ cuda, mods.core, mods.lanes, mods.nemotron, mods.qwen35, mods.qwen_vision, flashnextModule(b, host, .debug, cuda, mods.core, mods.lanes, mods.qwen_vision, mods.api), lfm2Module(b, host, .debug, cuda, mods.core), mods.radio, mods.nemo_audio, mods.heat, mods.tokenizer, native_modules.api, native, stagger(b, host, .debug) }) |m| step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); + for ([_]*std.Build.Module{ cuda, mods.core, mods.lanes, mods.nemotron, mods.qwen35, mods.qwen_vision, flashnextModule(b, host, .debug, cuda, mods.core, mods.lanes, mods.qwen_vision, mods.api), lfm2Module(b, host, .debug, cuda, mods.core), mods.radio, mods.nemo_audio, mods.heat, mods.tokenizer, native_modules.api, native, stagger(b, host, .debug) }) |m| { + // The native root compiles every family's open, including Muse's POSIX TP session. + if (host.result.os.tag == .windows and m == native) continue; + step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); + } const selected = b.option([]const u8, "modelopt-host-filter", "One portable ModelOpt regression") orelse "modelopt host:"; const run = b.addRunArtifact(b.addTest(.{ .root_module = mods.nemotron, .filters = &.{selected} })); run.has_side_effects = true; diff --git a/zig/build/cuda_engines.zig b/zig/build/cuda_engines.zig index b59e8c4c696..171cf9ce913 100644 --- a/zig/build/cuda_engines.zig +++ b/zig/build/cuda_engines.zig @@ -20,8 +20,6 @@ pub fn glmCudaShared(b: *std.Build, target: std.Build.ResolvedTarget, optimize: m.addImport("mesh", @import("mesh.zig").module(b, target, optimize, canon)); // shares declared over that canon m.addImport("lanes", lanes); m.addImport("heat", heat); - m.addImport("tp", @import("tp.zig").module(b, target, optimize, cuda)); // over the engine's own cuda module - m.addImport("engine_api", api); // TF_KV_SHARE's prompt_radix store: family()'s, the server's m.addImport("tp", @import("tp.zig").moduleWith(b, target, optimize, cuda, verbs)); // over the engine's own cuda module m.addImport("engine_api", api); // TF_GLM_KV_SHARE's prompt_radix store: family()'s, the server's return m; @@ -91,6 +89,7 @@ pub fn engines(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu .{ .name = "dory", .module = @import("dory.zig").module(b, target, optimize, cuda, core, lanes) }, .{ .name = "woof", .module = @import("woof.zig").module(b, target, optimize, core) }, .{ .name = "dots_mocr_cuda", .module = @import("dots_mocr_cuda.zig").module(b, target, optimize, cuda, core, lanes, @import("cuda_dense.zig").module(b, target, optimize, cuda, core, lanes)) }, + .{ .name = "muse_spark", .module = @import("muse.zig").moduleOver(b, target, optimize, cuda, core, lanes, @import("tp.zig").moduleWith(b, target, optimize, cuda, verbs)) }, }, }); mod.addImport("qwen4", @import("qwen4.zig").module(b, target, optimize, core)); diff --git a/zig/build/cuda_family_host.zig b/zig/build/cuda_family_host.zig index f96afd6fd21..6ff1050aafd 100644 --- a/zig/build/cuda_family_host.zig +++ b/zig/build/cuda_family_host.zig @@ -3,6 +3,9 @@ const std = @import("std"); pub fn steps(b: *std.Build, cuda: *std.Build.Module, mods: anytype, step: *std.Build.Step) void { const host = b.graph.host; + const sm110 = b.addRunArtifact(b.addTest(.{ .root_module = mods.qwen35, .filters = &.{"SM110"} })); + b.step("test-qwen35-sm110-host", "SM110 startup refusals without device or weight loading").dependOn(&sm110.step); + step.dependOn(&sm110.step); @import("prefill_widths_cuda.zig").tests(b, cuda, mods, step); const metal_scope = b.addRunArtifact(b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("zig/src/families/qwen3_5/config.zig"), .target = host }), .filters = &.{ "Metal 2B format scope:", "admit the affine 2B", "admit untied heads" } })); b.step("test-qwen35-metal-scope-host", "Metal 2B format admission without device or Metal compiler").dependOn(&metal_scope.step); @@ -86,6 +89,7 @@ pub fn steps(b: *std.Build, cuda: *std.Build.Module, mods: anytype, step: *std.B step.dependOn(&rules_run.step); @import("glm_contract_host.zig").host(b, cuda, mods.core, step); @import("dory.zig").host(b, @import("dory.zig").module(b, host, .debug, cuda, mods.core, mods.lanes), step); + @import("muse.zig").host(b, @import("muse.zig").module(b, host, .debug, cuda, mods.core, mods.lanes), step); const attention = b.addRunArtifact(b.addTest(.{ .root_module = mods.qwen35, .filters = &.{"Qwen attention path:"} })); b.step("test-qwen35-attention-path-host", "Contiguous and paged CUDA attention selection and graph identity without devices").dependOn(&attention.step); step.dependOn(&attention.step); diff --git a/zig/build/cuda_kernels.zig b/zig/build/cuda_kernels.zig index 2d63d3b0dbc..9e8947a7280 100644 --- a/zig/build/cuda_kernels.zig +++ b/zig/build/cuda_kernels.zig @@ -166,6 +166,12 @@ pub const kernels = [_]Kernel{ .{ .name = "roce_gather", .src = "roce_gather", .flags = &.{"-O3"} }, // b12x's one-shot RoCE all-gather, any world on a mesh .{ .name = "l2pf", .src = "deepseek_v41/l2pf", .flags = &.{"-O3"} }, // DeepSeek V4.1's L2 prefetch of a weight table, as GLM's too (records: glm_l2pf_pending.zig) .{ .name = "l2pace", .src = "deepseek_v41/l2pace", .flags = &.{"-O3"} }, // and its paced form + .{ .name = "muse_dflash", .src = "muse_spark/dflash", .flags = glue }, // Muse Spark: DFlash2 drafter glue + .{ .name = "muse_glue", .src = "muse_spark/glue", .flags = glue }, // Muse Spark: norms, gates, router, expert sums, head + .{ .name = "muse_attention", .src = "muse_spark/attention", .flags = &.{"-O3"} }, // Muse Spark: head_dim 64 decode attention + .{ .name = "muse_dflash2", .src = "muse_spark/dflash2", .flags = glue }, // Muse Spark: DFlash2 convs, top-k, selector walk + .{ .name = "muse_experts2", .src = "muse_spark/experts2", .flags = &.{"-O3"} }, // Muse Spark: 32-member expert tiles + .{ .name = "muse_linear", .src = "muse_spark/linear_multi", .flags = &.{ "-O3", "--expt-relaxed-constexpr" } }, // Muse Spark: q/k/v/gate in one launch .{ .name = "drama3_staged_gemv", .flags = glue }, .{ .name = "drama3", .flags = &.{"-O3"} }, .{ .name = "drama3_fp8", .flags = &.{"-O3"} }, diff --git a/zig/build/cuda_server_host.zig b/zig/build/cuda_server_host.zig index 42986c3230d..74ff61c018c 100644 --- a/zig/build/cuda_server_host.zig +++ b/zig/build/cuda_server_host.zig @@ -15,6 +15,10 @@ pub fn steps(b: *std.Build, host: std.Build.ResolvedTarget, cuda: *std.Build.Mod .imports = &.{ .{ .name = "engine_api", .module = native_modules.api }, .{ .name = "tokenizer", .module = mods.tokenizer }, .{ .name = "template", .module = template }, .{ .name = "living", .module = mods.living }, .{ .name = "core", .module = mods.core } }, }); const server_json = @import("server.zig").addTo(b, server_tests, host, .debug); + b.step("test-responses-owner-host", "Stored and running Responses stay with their creating API key").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{ "Responses owner:", "a whole response keeps", "the cancel route's path", "a held name", "with API keys only", "auth scopes:" } })).step); + const owner_socket = b.addTest(.{ .root_module = server_tests, .filters = &.{"Responses owner socket:"} }); + b.step("check-responses-owner-socket-host", "Compile authenticated Responses transport tests without listening").dependOn(&owner_socket.step); + b.step("test-responses-owner-socket-host", "Authenticated Responses ownership over local HTTP and WebSocket sockets").dependOn(&b.addRunArtifact(owner_socket).step); const startup_receipt = b.step("test-startup-receipt-host", "Monotonic startup receipts and fail-closed readiness without devices"); const startup_spans = b.createModule(.{ .root_source_file = b.path("zig/src/core/startup_receipt.zig"), .target = host, .link_libc = true }); startup_receipt.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = startup_spans, .filters = &.{"startup receipt:"} })).step); @@ -67,6 +71,7 @@ pub fn steps(b: *std.Build, host: std.Build.ResolvedTarget, cuda: *std.Build.Mod media_gate.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{ "image", "video" } })).step); media_gate.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = mods.core, .filters = &.{ "qwen_vl", "video" } })).step); b.step("test-http-limits-host", "Total HTTP read deadlines and connection admission without shaders").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"HTTP limits:"} })).step); + b.step("test-request-log-host", "Default text and opt-in JSON access, ended and refused log lines without a GPU").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{ "default request log:", "json request log:" } })).step); b.step("test-server-recovery-host", "Incomplete replies, token allocation and bounded SSE storage without shaders").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"Server recovery:"} })).step); b.step("test-request-journal-host", "The request journal's records, rotation and crash quarantine on a fake engine").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"request journal:"} })).step); b.step("test-prompt-interior-host", "Last-user metadata excludes later messages without shaders").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"interior prompt:"} })).step); @@ -81,6 +86,7 @@ pub fn steps(b: *std.Build, host: std.Build.ResolvedTarget, cuda: *std.Build.Mod b.step("test-benchmark-publication-host", "Benchmark command publication boundaries with inert effects").dependOn(&publication.step); b.step("test-benchmark-routing-host", "Benchmark command routing from explicit model capabilities").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"benchmark routing:"} })).step); b.step("test-benchmark-cancel-host", "A cancelled local benchmark saves its receipt, exits 130 and never publishes").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"a cancelled local run"} })).step); + b.step("test-chat-cli-host", "tensorfold chat's flags, stream, history, Ctrl-C and serve child against a fake server").dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = server_tests, .filters = &.{"chat CLI:"} })).step); const server_step = b.step( "test-server-cpu", "The HTTP server's unit tests (routes, templates, tool parsing) without a GPU", diff --git a/zig/build/dsv41_metal.zig b/zig/build/dsv41_metal.zig index ba1a6593f31..58e64db8b7f 100644 --- a/zig/build/dsv41_metal.zig +++ b/zig/build/dsv41_metal.zig @@ -55,7 +55,7 @@ pub fn steps(b: *std.Build, metal: *std.Build.Module, sources: *std.Build.Module const run = b.addRunArtifact(b.addTest(.{ .root_module = tests })); run.has_side_effects = true; // a device run: never cached step.dependOn(&run.step); - // the served engine over the tiny model: LaneHost replies, drafts, the prompt cache, seeds, cancels + // the served tiny model: serve_test.zig, whose test block brings in steps_test.zig (prompts in steps) const serve = b.createModule(.{ .root_source_file = b.path("zig/tests/dsv41_metal/serve_test.zig"), .target = b.graph.host, @@ -67,7 +67,7 @@ pub fn steps(b: *std.Build, metal: *std.Build.Module, sources: *std.Build.Module const serve_run = b.addRunArtifact(b.addTest(.{ .root_module = serve })); serve_run.has_side_effects = true; step.dependOn(&serve_run.step); - const serve_step = b.step("test-dsv41-metal-serve", "DeepSeek-V4.1 Metal served through LaneHost: concurrent, drafted, cached, seeded, cancelled"); + const serve_step = b.step("test-dsv41-metal-serve", "DeepSeek-V4.1 Metal served through LaneHost: concurrent, drafted, cached, seeded, cancelled, in steps"); serve_step.dependOn(&serve_run.step); // the release-checkpoint steps (TF_DSV41_REAL) stay opt-in, so the umbrella holds the default device suites const all = b.step("test-dsv41-metal-all", "DeepSeek-V4.1 Metal: every device test step on this GPU (layer, served)"); diff --git a/zig/build/glm_pdl_scan.zig b/zig/build/glm_pdl_scan.zig new file mode 100644 index 00000000000..3262653c874 --- /dev/null +++ b/zig/build/glm_pdl_scan.zig @@ -0,0 +1,32 @@ +//! test-glm-pdl-scan: the GLM kernel sources copied beside the scan test, which embeds each one (no GPU, no nvcc). +const std = @import("std"); + +pub fn add(b: *std.Build) void { + const files = b.addWriteFiles(); + var names: std.ArrayList(u8) = .empty; + const io = b.graph.io; + var dir = std.Io.Dir.cwd().openDir(io, "zig/kernels/cuda", .{ .iterate = true }) catch @panic("zig/kernels/cuda"); + defer dir.close(io); + var found: std.ArrayList([]const u8) = .empty; + var it = dir.iterate(); + while (it.next(io) catch null) |e| { + if (e.kind != .file or !std.mem.startsWith(u8, e.name, "glm_")) continue; + if (!std.mem.endsWith(u8, e.name, ".cu") and !std.mem.endsWith(u8, e.name, ".cuh")) continue; + found.append(b.allocator, b.dupe(e.name)) catch @panic("OOM"); + } + std.mem.sort([]const u8, found.items, {}, struct { + fn less(_: void, x: []const u8, y: []const u8) bool { + return std.mem.lessThan(u8, x, y); + } + }.less); + for (found.items) |name| { + _ = files.addCopyFile(b.path(b.pathJoin(&.{ "zig/kernels/cuda", name })), name); + names.appendSlice(b.allocator, name) catch @panic("OOM"); + names.append(b.allocator, '\n') catch @panic("OOM"); + } + _ = files.addCopyFile(b.path("zig/kernels/cuda/qmmf_body.cuh"), "qmmf_body.cuh"); // qmmf's weight-first prologue + _ = files.add("files.txt", names.items); + const root = files.addCopyFile(b.path("zig/tests/glm_pdl_scan.zig"), "main.zig"); + const test_ = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = root, .target = b.graph.host, .optimize = .debug }) }); + b.step("test-glm-pdl-scan", "Every GLM kernel opens with the dependency wait (dependent launches stay safe)").dependOn(&b.addRunArtifact(test_).step); +} diff --git a/zig/build/gpt_oss_host.zig b/zig/build/gpt_oss_host.zig new file mode 100644 index 00000000000..770a3c88955 --- /dev/null +++ b/zig/build/gpt_oss_host.zig @@ -0,0 +1,35 @@ +//! gpt-oss slice 1: pure host metadata and arithmetic, with the server's existing Harmony splitter. +const std = @import("std"); + +pub fn tests(b: *std.Build, all: *std.Build.Step) void { + for ([_]std.builtin.OptimizeMode{ .debug, .fast }) |mode| { + const st = b.createModule(.{ + .root_source_file = b.path("zig/src/core/safetensors.zig"), + .target = b.graph.host, + .link_libc = true, + }); + const mx = b.createModule(.{ + .root_source_file = b.path("zig/src/core/mxfp4.zig"), + .target = b.graph.host, + .optimize = mode, + .imports = &.{.{ .name = "safetensors", .module = st }}, + }); + const reply = b.createModule(.{ + .root_source_file = b.path("zig/src/server/reply_text.zig"), + .target = b.graph.host, + .optimize = mode, + .imports = &.{.{ .name = "json", .module = @import("server.zig").json(b, b.graph.host, mode) }}, + }); + const root = b.createModule(.{ + .root_source_file = b.path("zig/src/families/gpt_oss/host_test.zig"), + .target = b.graph.host, + .optimize = mode, + .link_libc = true, + .imports = &.{ .{ .name = "safetensors", .module = st }, .{ .name = "mxfp4", .module = mx }, .{ .name = "reply_text", .module = reply } }, + }); + const run = b.addRunArtifact(b.addTest(.{ .root_module = root })); + const step = b.step(if (mode == .fast) "test-gpt-oss-fast" else "test-gpt-oss-host", "gpt-oss config, real headers, sinks, routing, exact MXFP4 and shared Harmony; no GPU"); + step.dependOn(&run.step); + all.dependOn(step); + } +} diff --git a/zig/build/hip.zig b/zig/build/hip.zig index 558f908831a..fe6e8172a29 100644 --- a/zig/build/hip.zig +++ b/zig/build/hip.zig @@ -278,14 +278,14 @@ pub fn steps(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil .imports = &.{ .{ .name = "hip", .module = gpu.hip }, .{ .name = "core", .module = gpu.hip.import_table.get("core").? }, .{ .name = "lighton_ocr", .module = gpu.lighton } }, }) }); b.step("tf-lighton-hip-capture", "Capture native HIP LightOnOCR stages against a local reference fixture").dependOn(&b.addInstallArtifact(lighton_capture, .{}).step); - const qwen_capture_host = captureQwen(b, b.graph.host, host); + const qwen_capture_host = @import("lighton_hip.zig").captureQwen(b, b.graph.host, host); b.step("check-qwen-hip-capture-host", "Compile the Qwen HIP fixture capture without device execution").dependOn(&qwen_capture_host.step); - const qwen_capture_gpu = captureQwen(b, target, gpu); + const qwen_capture_gpu = @import("lighton_hip.zig").captureQwen(b, target, gpu); b.step("tf-qwen-hip-capture", "Capture native Qwen HIP stages against local reference fixtures").dependOn(&b.addInstallArtifact(qwen_capture_gpu, .{}).step); for ([_][]const u8{ "lighton", "qwen" }) |family_name| { - const exact_host = exactTool(b, b.graph.host, host, family_name); + const exact_host = @import("lighton_hip.zig").exactTool(b, b.graph.host, host, family_name); b.step(b.fmt("check-{s}-hip-exact-host", .{family_name}), "Compile native HIP image consistency checks without execution").dependOn(&exact_host.step); - const exact_gpu = exactTool(b, target, gpu, family_name); + const exact_gpu = @import("lighton_hip.zig").exactTool(b, target, gpu, family_name); b.step(b.fmt("tf-{s}-hip-exact", .{family_name}), "Build native HIP image consistency checks").dependOn(&b.addInstallArtifact(exact_gpu, .{}).step); } const native = server(b, target, gpu, build_options); @@ -478,25 +478,6 @@ pub fn server(b: *std.Build, target: std.Build.ResolvedTarget, e: Engine, build_ _ = @import("server.zig").addTo(b, exe.root_module, target, .ReleaseSafe); return exe; } -fn captureQwen(b: *std.Build, target: std.Build.ResolvedTarget, e: Engine) *std.Build.Step.Compile { - return b.addExecutable(.{ .name = "tf-qwen-hip-capture", .root_module = b.createModule(.{ - .root_source_file = b.path("zig/tests/lighton_hip/qwen_capture.zig"), - .target = target, - .optimize = .ReleaseSafe, - .link_libc = true, - .imports = &.{ .{ .name = "hip", .module = e.hip }, .{ .name = "core", .module = e.hip.import_table.get("core").? }, .{ .name = "qwen3_5", .module = e.family }, .{ .name = "lanes", .module = e.lanes }, .{ .name = "qwen_hip_vision", .module = e.family.import_table.get("qwen_hip_vision").? } }, - }) }); -} -fn exactTool(b: *std.Build, target: std.Build.ResolvedTarget, e: Engine, family_name: []const u8) *std.Build.Step.Compile { - const file = if (std.mem.eql(u8, family_name, "lighton")) "exact.zig" else "qwen_exact.zig"; - return b.addExecutable(.{ .name = b.fmt("tf-{s}-hip-exact", .{family_name}), .root_module = b.createModule(.{ - .root_source_file = b.path(b.fmt("zig/tests/lighton_hip/{s}", .{file})), - .target = target, - .optimize = .ReleaseSafe, - .link_libc = true, - .imports = &.{ .{ .name = "hip", .module = e.hip }, .{ .name = "core", .module = e.hip.import_table.get("core").? }, .{ .name = "lighton_ocr", .module = e.lighton }, .{ .name = "qwen3_5", .module = e.family }, .{ .name = "lanes", .module = e.lanes }, .{ .name = "qwen_hip_vision", .module = e.family.import_table.get("qwen_hip_vision").? } }, - }) }); -} /// A group's source and whether it compiles with IEEE arithmetic (`strict`: -O2 -fno-fast-math, IEEE denormals). const Source = struct { path: []const u8, strict: bool = false }; /// The model-free kernels' source groups, in zig/src/hip/kernels.zig's Group order. @@ -517,6 +498,7 @@ const groups = [_]Source{ .{ .path = "lighton_ocr.hip", .strict = true }, .{ .path = "qwen_vision.hip", .strict = true }, .{ .path = "draft/draft.hip" }, + .{ .path = "exl3/exl3.hip" }, }; /// What the group sources include, so an edit to one rebuilds them. const headers = [_][]const u8{ diff --git a/zig/build/inkling2_host.zig b/zig/build/inkling2_host.zig new file mode 100644 index 00000000000..423dd15b0fc --- /dev/null +++ b/zig/build/inkling2_host.zig @@ -0,0 +1,17 @@ +//! Inkling 2 family host checks (no GPU). +const std = @import("std"); + +fn module(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, root: []const u8) *std.Build.Module { + const m = b.createModule(.{ .root_source_file = b.path(root), .target = target, .optimize = optimize, .link_libc = true }); + const dir = "zig/src/core/"; + m.addImport("tokenizer", b.createModule(.{ .root_source_file = b.path(dir ++ "tokenizer/tokenizer.zig"), .target = target, .optimize = optimize, .link_libc = true })); + m.addImport("safetensors", b.createModule(.{ .root_source_file = b.path(dir ++ "safetensors.zig"), .target = target, .optimize = optimize, .link_libc = true })); + m.addImport("template", b.createModule(.{ .root_source_file = b.path(dir ++ "template/template.zig"), .target = target, .optimize = optimize, .link_libc = true })); + return m; +} + +pub fn tests(b: *std.Build, target: std.Build.ResolvedTarget, test_step: *std.Build.Step) void { + const run = b.addRunArtifact(b.addTest(.{ .root_module = module(b, target, .Debug, "zig/src/families/inkling2/host_test.zig") })); + b.step("test-inkling2-host", "Inkling 2 family package: config, weight map, layer plan, chat template and tokenizer").dependOn(&run.step); + test_step.dependOn(&run.step); +} diff --git a/zig/build/lighton_hip.zig b/zig/build/lighton_hip.zig index 2d576f552b4..3e6846d0dfa 100644 --- a/zig/build/lighton_hip.zig +++ b/zig/build/lighton_hip.zig @@ -1,5 +1,6 @@ -//! HIP LightOnOCR module construction and host checks, using the native server's shared engine types. +//! HIP LightOnOCR modules, host checks and the zig/tests/lighton_hip tools, on the server's shared engine types. const std = @import("std"); +const Engine = @import("hip.zig").Engine; pub fn module(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, hip: *std.Build.Module, core: *std.Build.Module, lanes: *std.Build.Module, api: *std.Build.Module, serve: *std.Build.Module) *std.Build.Module { return b.createModule(.{ .root_source_file = b.path("zig/src/families/lighton_ocr/hip.zig"), .target = target, .optimize = optimize, .link_libc = true, .imports = &.{ .{ .name = "hip", .module = hip }, .{ .name = "core", .module = core }, .{ .name = "lanes", .module = lanes }, .{ .name = "engine_api", .module = api }, .{ .name = "hip_serve", .module = serve } } }); @@ -14,3 +15,24 @@ pub fn host(b: *std.Build, m: *std.Build.Module, step: *std.Build.Step) void { b.step("test-lighton-hip-host", "LightOnOCR HIP image, state and admission tests without devices").dependOn(&run.step); step.dependOn(&run.step); } + +pub fn captureQwen(b: *std.Build, target: std.Build.ResolvedTarget, e: Engine) *std.Build.Step.Compile { + return b.addExecutable(.{ .name = "tf-qwen-hip-capture", .root_module = b.createModule(.{ + .root_source_file = b.path("zig/tests/lighton_hip/qwen_capture.zig"), + .target = target, + .optimize = .ReleaseSafe, + .link_libc = true, + .imports = &.{ .{ .name = "hip", .module = e.hip }, .{ .name = "core", .module = e.hip.import_table.get("core").? }, .{ .name = "qwen3_5", .module = e.family }, .{ .name = "lanes", .module = e.lanes }, .{ .name = "qwen_hip_vision", .module = e.family.import_table.get("qwen_hip_vision").? } }, + }) }); +} + +pub fn exactTool(b: *std.Build, target: std.Build.ResolvedTarget, e: Engine, family_name: []const u8) *std.Build.Step.Compile { + const file = if (std.mem.eql(u8, family_name, "lighton")) "exact.zig" else "qwen_exact.zig"; + return b.addExecutable(.{ .name = b.fmt("tf-{s}-hip-exact", .{family_name}), .root_module = b.createModule(.{ + .root_source_file = b.path(b.fmt("zig/tests/lighton_hip/{s}", .{file})), + .target = target, + .optimize = .ReleaseSafe, + .link_libc = true, + .imports = &.{ .{ .name = "hip", .module = e.hip }, .{ .name = "core", .module = e.hip.import_table.get("core").? }, .{ .name = "lighton_ocr", .module = e.lighton }, .{ .name = "qwen3_5", .module = e.family }, .{ .name = "lanes", .module = e.lanes }, .{ .name = "qwen_hip_vision", .module = e.family.import_table.get("qwen_hip_vision").? } }, + }) }); +} diff --git a/zig/build/machine.zig b/zig/build/machine.zig new file mode 100644 index 00000000000..236caf47aea --- /dev/null +++ b/zig/build/machine.zig @@ -0,0 +1,9 @@ +//! The machine facts host step: chip bandwidth, GPU limits and the nvidia-smi and ioreg readers, without a GPU. +const std = @import("std"); + +pub fn tests(b: *std.Build, parent: *std.Build.Step) void { + const machine = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("zig/src/platform/machine.zig"), .target = b.graph.host, .link_libc = true }) }); + const step = b.step("test-machine-host", "Chip bandwidth, GPU limits and the machine readers without a GPU"); + step.dependOn(&b.addRunArtifact(machine).step); + parent.dependOn(step); +} diff --git a/zig/build/muse.zig b/zig/build/muse.zig new file mode 100644 index 00000000000..82446e5f55d --- /dev/null +++ b/zig/build/muse.zig @@ -0,0 +1,35 @@ +//! Muse Spark (families/muse_spark) on the maintained CUDA runtime: the family module, tf-muse and its host tests. +const std = @import("std"); + +/// Its forward, prompt path, DFlash2 drafter and native lane backend, over TP sessions with the RoCE mailbox kernel. +pub fn module(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, cuda: *std.Build.Module, core: *std.Build.Module, lanes: *std.Build.Module) *std.Build.Module { + return moduleOver(b, target, optimize, cuda, core, lanes, @import("tp.zig").module(b, target, optimize, cuda)); +} + +/// Same, over the caller's `tp` (the engines' binary passes GLM's, over the verbs its fabric shares). +pub fn moduleOver(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, cuda: *std.Build.Module, core: *std.Build.Module, lanes: *std.Build.Module, tp: *std.Build.Module) *std.Build.Module { + const m = b.createModule(.{ .root_source_file = b.path("zig/src/families/muse_spark/root.zig"), .target = target, .optimize = optimize, .link_libc = true }); + m.addImport("cuda", cuda); + m.addImport("core", core); + m.addImport("lanes", lanes); + m.addImport("tp", tp); + m.addImport("tp_kernel", @import("tp.zig").mailboxModule(b)); + return m; +} + +/// tf-muse: rank 1 behind the server (`follow`) and the family's device checks; installed, and its own step. +pub fn tool(b: *std.Build, m: *std.Build.Module, strip: ?bool) void { + const root = b.createModule(.{ .root_source_file = b.path("zig/src/families/muse_spark/m1_main.zig"), .target = m.resolved_target, .optimize = m.optimize, .link_libc = true, .strip = strip }); + for ([_][]const u8{ "cuda", "core", "tp", "tp_kernel" }) |name| root.addImport(name, m.import_table.get(name).?); + root.addImport("muse_spark", m); + const exe = b.addExecutable(.{ .name = "tf-muse", .root_module = root }); + b.installArtifact(exe); + b.step("tf-muse", "Muse Spark's rank 1 (follow) and device checks").dependOn(&b.addInstallArtifact(exe, .{}).step); +} + +/// The host parts: config, rank cuts, hello words, prompt chunk plans, slot choice, sampling. +pub fn host(b: *std.Build, m: *std.Build.Module, all: *std.Build.Step) void { + const run = b.addRunArtifact(b.addTest(.{ .root_module = m })); + b.step("test-muse", "Muse Spark family host tests").dependOn(&run.step); + all.dependOn(&run.step); +} diff --git a/zig/build/options.zig b/zig/build/options.zig index 28735940bfc..8b7f55bc0a4 100644 --- a/zig/build/options.zig +++ b/zig/build/options.zig @@ -48,9 +48,14 @@ pub const Tp = struct { fatbin: ?[]const u8, }; +var tp_options: ?Tp = null; + +/// Read once: tp.zig's runner and every family that embeds the mailbox kernel share them. pub fn tp(b: *std.Build) Tp { - return .{ + if (tp_options) |o| return o; + tp_options = .{ .nvcc = b.option([]const u8, "tp-nvcc", "nvcc that builds the TP mailbox kernel"), .fatbin = b.option([]const u8, "tp-fatbin", "absolute path of a prebuilt tp_mailbox.fatbin to embed"), }; + return tp_options.?; } diff --git a/zig/build/qwen27.zig b/zig/build/qwen27.zig index 38b5d10d49a..0117dd5c427 100644 --- a/zig/build/qwen27.zig +++ b/zig/build/qwen27.zig @@ -107,7 +107,7 @@ pub fn targets(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu const family: []const std.Build.Module.Import = &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "core", .module = qwen_core }, .{ .name = "metal", .module = metal } }; _ = program(b, "tf-qwen27-run", "Build the native greedy, chunk and prompt-speed check on real weights", "zig/tests/qwen27/run.zig", target, true, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "core", .module = qwen_core }, .{ .name = "metal", .module = metal }, .{ .name = "core_lane", .module = core_lane }, .{ .name = "qwen_runtime_sources", .module = s.runtime_sources }, .{ .name = "qwen_gdn_source", .module = s.gdn_source } }); - _ = program(b, "tf-qwen27-attention-fused", "Build the fused-chain versus tail-kernel attention byte check on this Mac's tensor units, no models", "zig/tests/qwen27/attention_fused.zig", target, false, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "metal", .module = metal }, .{ .name = "qwen_runtime_sources", .module = s.runtime_sources } }); + _ = program(b, "tf-qwen27-attention-fused", "Build the fused-chain versus tail-kernel attention byte check on this Mac's GPU, no models", "zig/tests/qwen27/attention_fused.zig", target, false, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "metal", .module = metal }, .{ .name = "qwen_runtime_sources", .module = s.runtime_sources } }); _ = program(b, "tf-qwen27-attention-pages", "Build the KV-page attention kernels against main's, bit for bit through shuffled pages, no models", "zig/tests/qwen27/attention_pages.zig", target, false, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "metal", .module = metal } }); _ = program(b, "tf-qwen27-attention-share", "Build the KV-page attention timed with streams on one prefix's pages against copies, no models", "zig/tests/qwen27/attention_share.zig", target, false, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "metal", .module = metal } }); _ = program(b, "tf-qwen27-attention-precision", "Build decode attention's error against a float64 reference on this Mac, no models", "zig/tests/qwen27/attention_precision.zig", target, false, &.{ .{ .name = "qwen27", .module = qwen27 }, .{ .name = "metal", .module = metal }, .{ .name = "qwen_runtime_sources", .module = s.runtime_sources } }); diff --git a/zig/build/qwen35_layers.zig b/zig/build/qwen35_layers.zig index 94726eb6c08..85cb17b48dd 100644 --- a/zig/build/qwen35_layers.zig +++ b/zig/build/qwen35_layers.zig @@ -1,4 +1,4 @@ -//! The std-only shared modules (`qwen35_layers`, `qwen35_rules`, `rope_config`) for every build consumer. +//! The std-only shared modules (`qwen35_layers`, `qwen35_rules`, `rope_config`, `config_fields`, `checkpoint_eos`). const std = @import("std"); @@ -24,6 +24,18 @@ const shared = [_]Shared{ .step = "test-rope-config", .about = "A tower's RoPE keys: rope_parameters, the legacy rope_scaling and the top-level keys, read one way", }, + .{ + .name = "config_fields", + .path = "core/config_fields.zig", + .step = "test-config-fields", + .about = "Typed config.json field reads whose refusals name the source and the field", + }, + .{ + .name = "checkpoint_eos", + .path = "core/tokenizer/eos.zig", + .step = "test-checkpoint-eos", + .about = "Checkpoint EOS ids by a named policy per family: order, nesting, most ids, none refused", + }, }; /// Each module's test step under `parent`, then the modules for every module the declared steps compile. diff --git a/zig/build/tp.zig b/zig/build/tp.zig index b0a7e21077a..004f63ced0a 100644 --- a/zig/build/tp.zig +++ b/zig/build/tp.zig @@ -17,16 +17,24 @@ pub fn verbsModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: st return b.createModule(.{ .root_source_file = b.path("zig/src/fabric/verbs.zig"), .target = target, .optimize = optimize, .link_libc = true }); } -/// The `tp` module over `cuda` (an engine passes its own runtime module); verbs (zig/src/fabric/verbs.zig) for RoCE. +var tp_verbs: std.AutoHashMapUnmanaged(*std.Build.Module, *std.Build.Module) = .empty; +var tp_modules: std.AutoHashMapUnmanaged(struct { cuda: *std.Build.Module, verbs: *std.Build.Module }, *std.Build.Module) = .empty; + +/// The `tp` module over `cuda` (an engine passes its own runtime module), one per cuda module; verbs for RoCE. pub fn module(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, cuda: *std.Build.Module) *std.Build.Module { - return moduleWith(b, target, optimize, cuda, verbsModule(b, target, optimize)); + const verbs = tp_verbs.getOrPut(b.allocator, cuda) catch @panic("OOM"); + if (!verbs.found_existing) verbs.value_ptr.* = verbsModule(b, target, optimize); + return moduleWith(b, target, optimize, cuda, verbs.value_ptr.*); } -/// Same as `module`, using a verbs module the caller already owns. +/// Same as `module`, using a verbs module the caller already owns; one per (cuda, verbs), so families share it. pub fn moduleWith(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, cuda: *std.Build.Module, verbs: *std.Build.Module) *std.Build.Module { + const slot = tp_modules.getOrPut(b.allocator, .{ .cuda = cuda, .verbs = verbs }) catch @panic("OOM"); + if (slot.found_existing) return slot.value_ptr.*; const m = b.createModule(.{ .root_source_file = b.path("zig/src/fabric/tp/tp.zig"), .target = target, .optimize = optimize, .link_libc = true }); m.addImport("cuda", cuda); m.addImport("verbs", verbs); + slot.value_ptr.* = m; return m; } @@ -50,6 +58,22 @@ fn kernelModule(b: *std.Build, image: ?std.Build.LazyPath) *std.Build.Module { return b.createModule(.{ .root_source_file = wf.add("tp_kernel.zig", "pub const mailbox: []const u8 = \"\";\n") }); } +var mailbox_image: ?std.Build.LazyPath = null; +var mailbox_module: ?*std.Build.Module = null; + +/// The mailbox fatbin (-Dtp-nvcc / -Dtp-fatbin), built once for every runner that embeds it; null without either. +fn mailboxImage(b: *std.Build, opts: @import("options.zig").Tp) ?std.Build.LazyPath { + if (mailbox_image == null) mailbox_image = if (opts.fatbin) |p| b.graph.cwdRelativePath(p) else if (opts.nvcc) |tool| mailboxFatbin(b, tool) else null; + return mailbox_image; +} + +/// `tp_kernel`: the mailbox fatbin's bytes (or empty), one module for every runner on RoCE. +pub fn mailboxModule(b: *std.Build) *std.Build.Module { + if (mailbox_module) |m| return m; + mailbox_module = kernelModule(b, mailboxImage(b, @import("options.zig").tp(b))); + return mailbox_module.?; +} + pub fn add(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, test_step: *std.Build.Step, opts: @import("options.zig").Tp) void { const host = b.graph.host; const suite_cuda = runtime(b, host, .debug); @@ -104,14 +128,12 @@ pub fn add(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builti tests.step.dependOn(&object.step); if (host.result.os.tag == .windows) test_step.dependOn(&object.step); if (target.result.os.tag != .linux) return; - const nvcc = opts.nvcc; - const prebuilt = opts.fatbin; - const image: ?std.Build.LazyPath = if (prebuilt) |p| b.graph.cwdRelativePath(p) else if (nvcc) |tool| mailboxFatbin(b, tool) else null; + const image = mailboxImage(b, opts); const cuda = runtime(b, target, optimize); const runner = b.createModule(.{ .root_source_file = b.path("zig/src/fabric/tp/gpu_main.zig"), .target = target, .optimize = optimize, .link_libc = true }); runner.addImport("cuda", cuda); runner.addImport("tp", module(b, target, optimize, cuda)); - runner.addImport("tp_kernel", kernelModule(b, image)); + runner.addImport("tp_kernel", mailboxModule(b)); const exe = b.addExecutable(.{ .name = "tf-tp-test", .root_module = runner }); if (host.result.os.tag == .linux and target.query.isNative()) { const cli = @import("../src/fabric/tp/gpu_cli.zig"); diff --git a/zig/build/windows_host.zig b/zig/build/windows_host.zig index 9e140bd5daa..b98e44a701e 100644 --- a/zig/build/windows_host.zig +++ b/zig/build/windows_host.zig @@ -17,5 +17,13 @@ pub fn steps(b: *std.Build, cuda: *std.Build.Module, api: *std.Build.Module) *st .link_libc = true, }); b.step("compile-http-limits-windows-host", "Compile production Winsock connection admission without linking or running").dependOn(&b.addObject(.{ .name = "http-limits-windows", .root_module = limits }).step); + const chat = b.createModule(.{ + .root_source_file = b.path("zig/chat_windows_compile.zig"), + .target = limits.resolved_target.?, + .optimize = .debug, + .link_libc = true, + .imports = &.{.{ .name = "json", .module = @import("server.zig").json(b, limits.resolved_target.?, .debug) }}, + }); + b.step("check-chat-windows-host", "Compile tensorfold chat's --url path for Windows without linking or running").dependOn(&b.addObject(.{ .name = "chat-windows", .root_module = chat }).step); return step; } diff --git a/zig/build/xpu.zig b/zig/build/xpu.zig index 85a9f272760..6195dc84e04 100644 --- a/zig/build/xpu.zig +++ b/zig/build/xpu.zig @@ -25,6 +25,7 @@ pub fn steps(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil .{ "gemm128", "zig/kernels/xpu/qwen27/gemm.cl", " -DGSZ=128" }, .{ "gdn", "zig/kernels/xpu/qwen27/gdn_chunk.cl", "" }, .{ "drafter", "zig/kernels/xpu/qwen27/drafter.cl", "" }, + .{ "tp", "zig/kernels/xpu/tp.cl", "" }, .{ "glue_g4s", "zig/kernels/xpu/gemma4/glue_g4.cl", " -I zig/kernels/xpu/gemma4" }, .{ "glue_g4g", "zig/kernels/xpu/gemma4/glue_g4.cl", " -DHD=512 -I zig/kernels/xpu/gemma4" }, .{ "rows_g4s", "zig/kernels/xpu/gemma4/glue_g4.cl", " -I zig/kernels/xpu/gemma4" }, @@ -94,9 +95,22 @@ pub fn steps(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil \\ ) }); const ze_mod = zeModule(b, target, optimize); + const tp_mod = b.createModule(.{ .root_source_file = b.path("zig/src/xpu/tp.zig"), .target = target, .optimize = optimize, .link_libc = true }); + tp_mod.addImport("ze", ze_mod); // one `core` for these trees: the Gemma 4 config, the safetensors readers, Nemotron, the CLI and server const core = b.createModule(.{ .root_source_file = b.path("zig/src/core/root.zig"), .target = target, .optimize = .ReleaseSafe, .link_libc = true }); core.addImport("gpu_memory", @import("gpu_memory.zig").module(b, target)); + { + const embedded_tp = b.createModule(.{ .root_source_file = files.add("xpu_tp_kernels.zig", + \\pub const tp align(8) = @embedFile("tp.bin").*; + \\ + ) }); + const tpb = b.createModule(.{ .root_source_file = b.path("zig/src/xpu/tp_bench.zig"), .target = target, .optimize = optimize, .link_libc = true }); + tpb.addImport("xpu_tp_kernels", embedded_tp); + tpb.addImport("ze", ze_mod); + const tpb_exe = b.addExecutable(.{ .name = "tf-xpu-tp-bench", .root_module = tpb }); + b.step("xpu-tp-bench", "Build the multi-GPU Level Zero P2P TP=2/4 collective benchmark").dependOn(&b.addInstallArtifact(tpb_exe, .{}).step); + } { const g4 = b.createModule(.{ .root_source_file = b.path("zig/src/families/gemma4/xpu_main.zig"), .target = target, .optimize = optimize, .link_libc = true }); g4.addImport("xpu_gemma4_kernels", embedded_g4); diff --git a/zig/build/xpu_contract.zig b/zig/build/xpu_contract.zig index c2c336df7a4..87e7389a606 100644 --- a/zig/build/xpu_contract.zig +++ b/zig/build/xpu_contract.zig @@ -24,6 +24,12 @@ pub fn steps(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil for ([_][]const u8{ "glue_attn.cl", "glue_quant.cl" }) |part| glue.addFileInput(b.path(b.fmt("zig/kernels/xpu/qwen27/{s}", .{part}))); const glue_dir = glue.addOutputDirectoryArg("ocloc-glue"); _ = files.addCopyFile(glue_dir.path(b, "glue.bin"), b.fmt("{s}/glue.bin", .{device})); + const tp_obj = b.addSystemCommand(&.{ ocloc, "compile", "-q", "-file" }); + tp_obj.addFileArg(b.path("zig/kernels/xpu/tp.cl")); + tp_obj.addArgs(&.{ "-device", device, "-options", opts, "-output_no_suffix", "-output", "tp", "-out_dir" }); + tp_obj.setCwd(b.path(".")); + const tp_dir = tp_obj.addOutputDirectoryArg("ocloc-tp"); + _ = files.addCopyFile(tp_dir.path(b, "tp.bin"), b.fmt("{s}/tp.bin", .{device})); const ctl = b.addSystemCommand(&.{ ocloc, "compile", "-q", "-file" }); ctl.addFileArg(b.path("zig/kernels/xpu/contract_controls.cl")); ctl.addArgs(&.{ "-device", device, "-options", opts, "-output_no_suffix", "-output", "contract_controls", "-out_dir" }); @@ -58,7 +64,7 @@ pub fn runner(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui const files = b.addWriteFiles(); if (prebuilt) |dir| { - for ([_][]const u8{ "glue", "contract_controls", "contract_gate_controls" }) |name| { + for ([_][]const u8{ "glue", "tp", "contract_controls", "contract_gate_controls" }) |name| { _ = files.addCopyFile(.{ .cwd_relative = b.fmt("{s}/{s}.bin", .{ dir, name }) }, b.fmt("{s}.bin", .{name})); } } else { @@ -70,17 +76,22 @@ pub fn runner(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui for ([_][]const u8{ "glue_attn.cl", "glue_quant.cl" }) |part| glue.addFileInput(b.path(b.fmt("zig/kernels/xpu/qwen27/{s}", .{part}))); const glue_dir = glue.addOutputDirectoryArg("ocloc-glue-run"); _ = files.addCopyFile(glue_dir.path(b, "glue.bin"), "glue.bin"); - for ([_][]const u8{ "contract_controls", "contract_gate_controls" }) |name| { + for ([_][2][]const u8{ + .{ "tp", "zig/kernels/xpu/tp.cl" }, + .{ "contract_controls", "zig/kernels/xpu/contract_controls.cl" }, + .{ "contract_gate_controls", "zig/kernels/xpu/contract_gate_controls.cl" }, + }) |pair| { const run = b.addSystemCommand(&.{ ocloc, "compile", "-q", "-file" }); - run.addFileArg(b.path(b.fmt("zig/kernels/xpu/{s}.cl", .{name}))); - run.addArgs(&.{ "-device", device, "-options", opts, "-output_no_suffix", "-output", name, "-out_dir" }); + run.addFileArg(b.path(pair[1])); + run.addArgs(&.{ "-device", device, "-options", opts, "-output_no_suffix", "-output", pair[0], "-out_dir" }); run.setCwd(b.path(".")); - const dir = run.addOutputDirectoryArg(b.fmt("ocloc-{s}-run", .{name})); - _ = files.addCopyFile(dir.path(b, b.fmt("{s}.bin", .{name})), b.fmt("{s}.bin", .{name})); + const dir = run.addOutputDirectoryArg(b.fmt("ocloc-{s}-run", .{pair[0]})); + _ = files.addCopyFile(dir.path(b, b.fmt("{s}.bin", .{pair[0]})), b.fmt("{s}.bin", .{pair[0]})); } } const images = b.createModule(.{ .root_source_file = files.add("xpu_contract_images.zig", \\pub const glue align(8) = @embedFile("glue.bin").*; + \\pub const tp align(8) = @embedFile("tp.bin").*; \\pub const controls align(8) = @embedFile("contract_controls.bin").*; \\pub const gate_controls align(8) = @embedFile("contract_gate_controls.bin").*; ), .target = target, .optimize = optimize }); diff --git a/zig/chat_windows_compile.zig b/zig/chat_windows_compile.zig new file mode 100644 index 00000000000..a60732c456b --- /dev/null +++ b/zig/chat_windows_compile.zig @@ -0,0 +1,7 @@ +//! Compile tensorfold chat for Windows, where it builds only its --url path, without linking or running it. +const chat = @import("src/server/chat_cli.zig"); + +comptime { + _ = &chat.command; + _ = &chat.main; +} diff --git a/zig/dense_serving_test.zig b/zig/dense_serving_test.zig index 52ca01e701e..d1bf5b0a06c 100644 --- a/zig/dense_serving_test.zig +++ b/zig/dense_serving_test.zig @@ -16,7 +16,8 @@ test "dense serving: owned CUDA images retain their reviewed lane and decode byt const group = @embedFile("kernels/cuda/qmm_group.cu"); try std.testing.expectEqualStrings("ceff4ee13e97b5aa93cbe7a1edc9a524c78aaa145dd1e5c82dcb05a3011aae23", &hash(group[0..16095])); try std.testing.expectEqualStrings("8780fd710be3ce2f04e53fa1e69eb062809d3bec6391d9bd49983d0588e374d0", &hash(group)); - try std.testing.expectEqualStrings("45ab2be277c7c17e6cdc6041db45611f2554c6e88f09a295e88751b1c51be1f5", &hash(@embedFile("kernels/cuda/qmm_prefill.cu"))); + // #2825 hoists copy addresses before the K loop; copy order and math match prefill_kernel. + try std.testing.expectEqualStrings("e3724114b87cae6f6f761b2f86357f05b1693d84a0233e4d58ce46349fa853f6", &hash(@embedFile("kernels/cuda/qmm_prefill.cu"))); // the join variant's bytes: tf_q35_attn_rows_join for streams on shared pages; main's kernels' SASS unchanged try std.testing.expectEqualStrings("77ac41e5764a79cca2313ecd09664479b8b4736747c79188e1ad5cae29fd03e4", &hash(@embedFile("kernels/cuda/qwen35.cu"))); // #1879's bytes: a comment names cuda_scratch.zig, where max_chunks moved; the code is unchanged diff --git a/zig/gemma4_shared_host.zig b/zig/gemma4_shared_host.zig index 442dbe0664e..b619ae04ceb 100644 --- a/zig/gemma4_shared_host.zig +++ b/zig/gemma4_shared_host.zig @@ -281,7 +281,7 @@ test "Gemma shared: ring restore precedes forced snapshot eviction in reservatio const expected = reply(try fill(&f, &teach)); f.release(&teach); f.store.?.store.limit(.{ .pages = 128, .snaps = 1 }); - try t.expectEqual(@as(u32, 2048), f.store.?.store.find(.of(ids)).?.end); + try t.expectEqual(@as(u32, 2048), f.store.?.store.find(.of(ids)).?.at()); var blocker = try stream(&.{ 99, 98, 97 }); defer blocker.deinit(a); _ = try fill(&f, &blocker); diff --git a/zig/glm_image_cache_host.zig b/zig/glm_image_cache_host.zig index 3e15623cf4c..a8201e1a5ef 100644 --- a/zig/glm_image_cache_host.zig +++ b/zig/glm_image_cache_host.zig @@ -285,6 +285,8 @@ const Device = struct { d.api.cuEventQuery = eventDone; d.api.cuEventDestroy_v2 = eventDestroy; d.api.cuLaunchKernel = launch; + d.api.cuLaunchKernelEx = @import("glm").pdl.forwardEx(launch); + d.func_name = null; return d; } }; diff --git a/zig/glm_kv_uncached_host.zig b/zig/glm_kv_uncached_host.zig index ba29f545b24..e16984089dc 100644 --- a/zig/glm_kv_uncached_host.zig +++ b/zig/glm_kv_uncached_host.zig @@ -38,6 +38,8 @@ test "GLM host KV uncached: a 32-row call invalidates every old cached layer bef var d: cuda.Driver = .{ .lib = undefined, .api = undefined }; d.api.cuModuleGetFunction = Recording.function; d.api.cuLaunchKernel = Recording.launch; + d.api.cuLaunchKernelEx = @import("glm").pdl.forwardEx(Recording.launch); + d.func_name = null; d.api.cuMemsetD32Async = Recording.set; var n: u32 = 0; var g: Gather = undefined; diff --git a/zig/glm_lane_costs_host.zig b/zig/glm_lane_costs_host.zig index 9a626876b0a..76518cdb770 100644 --- a/zig/glm_lane_costs_host.zig +++ b/zig/glm_lane_costs_host.zig @@ -103,6 +103,8 @@ test "GLM load prices: an oversized NCCL setting disables the cache without reje e.checkpoint_digest = @splat(1); e.share.world = 2; e.m.experts.nvfp4.warps = 4; + e.m.mm.pdl = true; + e.m.dsel = true; e.drafter = null; var shape: [512]u8 = undefined; var name: [256]u8 = undefined; diff --git a/zig/glm_link_transport_host.zig b/zig/glm_link_transport_host.zig index 8074f68615c..8cdccc3e778 100644 --- a/zig/glm_link_transport_host.zig +++ b/zig/glm_link_transport_host.zig @@ -100,6 +100,8 @@ const Recording = struct { test "GLM link transport: waited uploads and unwaited puts carry zero, 48 and 49 ids byte for byte" { var d: cuda.Driver = .{ .lib = undefined, .api = undefined }; d.api.cuLaunchKernel = Recording.launch; + d.api.cuLaunchKernelEx = @import("glm").pdl.forwardEx(Recording.launch); + d.func_name = null; d.api.cuMemcpyHtoDAsync_v2 = Recording.upload; d.api.cuMemHostAlloc = Recording.hostAlloc; d.api.cuMemFreeHost = Recording.hostFree; diff --git a/zig/glm_prompt_logprobs_host.zig b/zig/glm_prompt_logprobs_host.zig index 38a6451ec8a..c20dbc2c3f9 100644 --- a/zig/glm_prompt_logprobs_host.zig +++ b/zig/glm_prompt_logprobs_host.zig @@ -113,6 +113,7 @@ const Heads = struct { } fn score(d: *cuda.Driver, output: Output, rank_: usize) !void { d.api.cuLaunchKernel = launch; + d.api.cuLaunchKernelEx = glm.pdl.forwardEx(launch); d.api.cuMemcpyDtoDAsync_v2 = copy; d.api.cuMemcpy2DAsync_v2 = copy2d; var lib: cuda.nccl.Library = undefined; diff --git a/zig/kernels/cuda/glm_dflash.cu b/zig/kernels/cuda/glm_dflash.cu index 02b68ebcd6a..3d06def9e28 100644 --- a/zig/kernels/cuda/glm_dflash.cu +++ b/zig/kernels/cuda/glm_dflash.cu @@ -2,6 +2,7 @@ #include #include +#include "glm_pdl.cuh" namespace { constexpr int D = 4096; @@ -47,6 +48,7 @@ __device__ __forceinline__ void normRope(const __nv_bfloat16* x, const __nv_bflo // A target layer's residual, its 4 streams' mean (TF_GLM_DFLASH2_TAP=s0: stream 0), into column block ``slot``. extern "C" __global__ void df_tap(const __nv_bfloat16* __restrict__ x, __nv_bfloat16* __restrict__ out, int slot, int mode) { + glm_pdl::enter(); const int r = blockIdx.x; const __nv_bfloat16* xr = x + (long long)r * 4 * D; __nv_bfloat16* o = out + (long long)r * 5 * D + (long long)slot * D; @@ -64,6 +66,7 @@ extern "C" __global__ void df_tap(const __nv_bfloat16* __restrict__ x, __nv_bflo extern "C" __global__ void df_block_qkv(const __nv_bfloat16* __restrict__ qkv, int ldq, const __nv_bfloat16* __restrict__ qn, const __nv_bfloat16* __restrict__ kn, const int* __restrict__ pos, float eps, float theta, __nv_bfloat16* __restrict__ q, __nv_bfloat16* __restrict__ kb, __nv_bfloat16* __restrict__ vb) { + glm_pdl::enter(); __shared__ float red[2]; const int r = blockIdx.x, h = blockIdx.y; const __nv_bfloat16* row = qkv + (long long)r * ldq; @@ -83,6 +86,7 @@ extern "C" __global__ void df_block_qkv(const __nv_bfloat16* __restrict__ qkv, i extern "C" __global__ void df_ctx_kv(const __nv_bfloat16* __restrict__ kv, const __nv_bfloat16* __restrict__ kn, const long long* __restrict__ pos, const uint64_t* __restrict__ rings, int layer, float eps, float theta) { + glm_pdl::enter(); __shared__ float red[2]; const int r = blockIdx.x, kh = blockIdx.y; const long long p = pos[r]; @@ -97,6 +101,7 @@ extern "C" __global__ void df_ctx_kv(const __nv_bfloat16* __restrict__ kv, const // Two-tap dynamic causal conv over a block: y[t] = sum_o (base[o] + dyn[t][o][c / 16]) * z[t - o]; add or store. extern "C" __global__ void df_conv(const __nv_bfloat16* __restrict__ z, const __nv_bfloat16* __restrict__ dyn, int which, const __nv_bfloat16* __restrict__ base, __nv_bfloat16* __restrict__ out, int add) { + glm_pdl::enter(); const int r = blockIdx.x, t = r % BLOCK; const __nv_bfloat16* dr = dyn + (long long)r * 4 * GROUPS + which * 2 * GROUPS; for (int c = blockIdx.y * 1024 + threadIdx.x; c < (blockIdx.y + 1) * 1024; c += blockDim.x) { @@ -110,6 +115,7 @@ extern "C" __global__ void df_conv(const __nv_bfloat16* __restrict__ z, const __ // SwiGLU over [gate | up] rows (width F each): bf16(bf16(silu(g)) * u). grid (R, ceil(F / 1024)), 256 threads. extern "C" __global__ void df_swiglu(const __nv_bfloat16* __restrict__ gu, __nv_bfloat16* __restrict__ out, int F) { + glm_pdl::enter(); const int r = blockIdx.x; const __nv_bfloat16* g = gu + (long long)r * 2 * F; for (int c = blockIdx.y * 1024 + threadIdx.x; c < (blockIdx.y + 1) * 1024 && c < F; c += blockDim.x) { @@ -120,10 +126,11 @@ extern "C" __global__ void df_swiglu(const __nv_bfloat16* __restrict__ gu, __nv_ } // Each block's 8 rows attend to their ring's window (max(from, p - 2047) .. start - 1) and all 8 block keys. -extern "C" __global__ void __launch_bounds__(256) df_attn(const __nv_bfloat16* __restrict__ q, const __nv_bfloat16* __restrict__ kb, - const __nv_bfloat16* __restrict__ vb, const uint64_t* __restrict__ rings, - const long long* __restrict__ starts, const long long* __restrict__ froms, +extern "C" __global__ void __launch_bounds__(256) df_attn(const __nv_bfloat16* q, const __nv_bfloat16* kb, + const __nv_bfloat16* vb, const uint64_t* rings, + const long long* starts, const long long* froms, int layer, float scale, __nv_bfloat16* __restrict__ o) { + glm_pdl::enter(); const int s = blockIdx.x, kh = blockIdx.y; const int j = threadIdx.x >> 5, lane = threadIdx.x & 31; const int r = s * BLOCK + j; @@ -180,6 +187,7 @@ extern "C" __global__ void __launch_bounds__(256) df_attn_part(const __nv_bfloat const __nv_bfloat16* __restrict__ vb, const uint64_t* __restrict__ rings, const long long* __restrict__ starts, const long long* __restrict__ froms, int layer, float scale, float* __restrict__ pm, float* __restrict__ pl, float* __restrict__ pacc) { + glm_pdl::enter(); const int s = blockIdx.x, kh = blockIdx.y, c = blockIdx.z; const int j = threadIdx.x >> 5, lane = threadIdx.x & 31; const int r = s * BLOCK + j; @@ -240,6 +248,7 @@ extern "C" __global__ void __launch_bounds__(256) df_attn_part(const __nv_bfloat // The chunks' partials of row r, head h into o[r][h] (bf16). grid (R, QH), 128 threads (a thread a dim). extern "C" __global__ void df_attn_merge(const float* __restrict__ pm, const float* __restrict__ pl, const float* __restrict__ pacc, __nv_bfloat16* __restrict__ o) { + glm_pdl::enter(); const int r = blockIdx.x, h = blockIdx.y, d = threadIdx.x; const long long base = ((long long)r * QH + h) * CH; float m = -INFINITY; @@ -255,6 +264,7 @@ extern "C" __global__ void df_attn_merge(const float* __restrict__ pm, const flo // x += y (bf16 rows of D). grid (R, D / 1024), 256 threads. extern "C" __global__ void df_add(__nv_bfloat16* __restrict__ x, const __nv_bfloat16* __restrict__ y) { + glm_pdl::enter(); const long long r = blockIdx.x; for (int c = blockIdx.y * 1024 + threadIdx.x; c < (blockIdx.y + 1) * 1024; c += blockDim.x) x[r * D + c] = tobf(bf(x[r * D + c]) + bf(y[r * D + c])); @@ -262,6 +272,7 @@ extern "C" __global__ void df_add(__nv_bfloat16* __restrict__ x, const __nv_bflo // The split down's fp32 partials g[world][R][D] summed in rank order into bf16 out[R][D] (grid (R, D / 1024)). extern "C" __global__ void df_sumn(const float* __restrict__ g, __nv_bfloat16* __restrict__ out, int R, int world) { + glm_pdl::enter(); const long long r = blockIdx.x; for (int c = blockIdx.y * 1024 + threadIdx.x; c < (blockIdx.y + 1) * 1024; c += blockDim.x) { const long long i = r * D + c; @@ -306,6 +317,7 @@ __device__ void takeBest(float* sv, int* si, int n, float* rv, int* ri, float* o extern "C" __global__ void __launch_bounds__(256) df_top16_part(const __nv_bfloat16* __restrict__ logits, int cols, int offset, float* __restrict__ pv, int* __restrict__ pi) { + glm_pdl::enter(); __shared__ float sv[CHUNK_COLS]; __shared__ int si[CHUNK_COLS]; __shared__ float rv[8]; @@ -323,6 +335,7 @@ extern "C" __global__ void __launch_bounds__(256) df_top16_part(const __nv_bfloa extern "C" __global__ void __launch_bounds__(256) df_top16_merge(const float* __restrict__ pv, const int* __restrict__ pi, int chunks, int* __restrict__ out) { + glm_pdl::enter(); __shared__ float sv[64 * TOP]; __shared__ int si[64 * TOP]; __shared__ float rv[8]; @@ -344,6 +357,7 @@ extern "C" __global__ void __launch_bounds__(256) df_top16_merge(const float* __ // A row's sums over each 64-column group (qmm's xs for a 4-bit linear's input), fp32 [rows][k / 64]. extern "C" __global__ void df_gsum(const __nv_bfloat16* __restrict__ x, int ldx, int k, float* __restrict__ xs) { + glm_pdl::enter(); const int r = blockIdx.x, groups = k / 64; const __nv_bfloat16* xr = x + (long long)r * ldx; for (int g = threadIdx.x; g < groups; g += blockDim.x) { diff --git a/zig/kernels/cuda/glm_glue_attn.cuh b/zig/kernels/cuda/glm_glue_attn.cuh index 6f5cf97dbdc..11fe779be0a 100644 --- a/zig/kernels/cuda/glm_glue_attn.cuh +++ b/zig/kernels/cuda/glm_glue_attn.cuh @@ -1,6 +1,8 @@ // latent.py's MLA attention and sparse.py's index scores by hand: the chunk kernels' online softmax, the chunk merge. #pragma once +#include "glm_pdl.cuh" + #include "glm_glue_router.cuh" #include #include "common/mla.cuh" @@ -10,6 +12,7 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_chunks_16(const __nv_bfloat16* qa, const __nv_bfloat16* lc, const int* pos, const int* tok, const int* cnt, float* po, float* pm, float* pl, int64_t rows, int64_t heads, int64_t w, float scale, int sparse, const int* pt, int64_t pstep) { + glm_pdl::enter(); glm_attn::chunks_wide<16>(qa, lc, pos, tok, cnt, po, pm, pl, rows, heads, w, scale, sparse, pt, pstep); } @@ -17,6 +20,7 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_chunks_32(const __nv_bfloat16* qa, const __nv_bfloat16* lc, const int* pos, const int* tok, const int* cnt, float* po, float* pm, float* pl, int64_t rows, int64_t heads, int64_t w, float scale, int sparse, const int* pt, int64_t pstep) { + glm_pdl::enter(); glm_attn::chunks_wide<32>(qa, lc, pos, tok, cnt, po, pm, pl, rows, heads, w, scale, sparse, pt, pstep); } @@ -25,6 +29,7 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_chunks_16_fp8(const __nv_bfloat16* qa, const unsigned char* lc, const float* scales, const int* pos, const int* tok, const int* cnt, float* po, float* pm, float* pl, int64_t rows, int64_t heads, int64_t w, float scale, int sparse) { + glm_pdl::enter(); glm_attn::chunks_wide<16, true>(qa, reinterpret_cast(lc), pos, tok, cnt, po, pm, pl, rows, heads, w, scale, sparse, nullptr, 0, scales); } @@ -32,6 +37,7 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_chunks_32_fp8(const __nv_bfloat16* qa, const unsigned char* lc, const float* scales, const int* pos, const int* tok, const int* cnt, float* po, float* pm, float* pl, int64_t rows, int64_t heads, int64_t w, float scale, int sparse) { + glm_pdl::enter(); glm_attn::chunks_wide<32, true>(qa, reinterpret_cast(lc), pos, tok, cnt, po, pm, pl, rows, heads, w, scale, sparse, nullptr, 0, scales); } @@ -40,6 +46,7 @@ extern "C" __global__ void __launch_bounds__(256) extern "C" __global__ void __launch_bounds__(128) tf_glm_merge(const float* po, const float* pm, const float* pl, __nv_bfloat16* out, const int* cnt, int64_t rows, int64_t heads, int nch, int sparse) { + glm_pdl::enter(); constexpr int LW = glm_attn::LW; const int64_t r = blockIdx.x, h = blockIdx.y; if (sparse && cnt[r] == 0) return; @@ -69,6 +76,7 @@ extern "C" __global__ void __launch_bounds__(128) tf_glm_scores(const __nv_bfloat16* qi, const __nv_bfloat16* wts, int64_t w_stride, const __nv_bfloat16* pk, float* out, const int* pos, int64_t np, int64_t nb, float scale, float wscale, int64_t heads, int loop, const int* pt, int64_t ps) { + glm_pdl::enter(); constexpr int D = 128, HP = 32, BP = 64; __shared__ __align__(16) __nv_bfloat16 sm[4 * 2 * 16 * D]; // q's 32 rows, then each warp's two 16-pool buffers auto at = [](int row, int u) { return row * D + ((u ^ (row & 7)) << 3); }; diff --git a/zig/kernels/cuda/glm_glue_bmm.cuh b/zig/kernels/cuda/glm_glue_bmm.cuh index d5f3d659d93..8932166b787 100644 --- a/zig/kernels/cuda/glm_glue_bmm.cuh +++ b/zig/kernels/cuda/glm_glue_bmm.cuh @@ -1,6 +1,8 @@ // qmm._bmm and qmm._bmm_rows by hand (the BF16 matmuls): out [m][n] = x rows . w rows over K slices. #pragma once +#include "glm_pdl.cuh" + #include "glm_glue_router.cuh" #include "common/router_mma.cuh" @@ -286,6 +288,7 @@ __device__ void bmm_tiles(const __nv_bfloat16* x, const __nv_bfloat16* w, void* extern "C" __global__ void __launch_bounds__(256) tf_glm_bmm_tile(const __nv_bfloat16* x, const __nv_bfloat16* w, void* out, int64_t m, int64_t x_stride, int64_t n, int64_t k, int sk, int f32) { + glm_pdl::enter(); glm_bmm::bmm_tiles<128, 64, 64, 3, 2, 4, true>(x, w, out, m, x_stride, n, k, sk, f32); } @@ -293,6 +296,7 @@ extern "C" __global__ void __launch_bounds__(256) extern "C" __global__ void __launch_bounds__(256, 2) tf_glm_bmm_tile1(const __nv_bfloat16* x, const __nv_bfloat16* w, void* out, int64_t m, int64_t x_stride, int64_t n, int64_t k, int sk, int f32) { + glm_pdl::enter(); glm_bmm::bmm_tiles<128, 128, 32, 3, 2, 4, false>(x, w, out, m, x_stride, n, k, sk, f32); } @@ -300,6 +304,7 @@ extern "C" __global__ void __launch_bounds__(256, 2) extern "C" __global__ void __launch_bounds__(128) tf_glm_router_tile(const __nv_bfloat16* x, const __nv_bfloat16* w, float* part, int64_t rows, int64_t x_stride, int64_t d, int64_t ne, int ks) { + glm_pdl::enter(); tf_router_mma::logits<4, 2, 64, 4, false, true>(x, static_cast(x_stride), w, part, static_cast(rows), static_cast(d), static_cast(ne), ks); } @@ -308,6 +313,7 @@ extern "C" __global__ void __launch_bounds__(128) extern "C" __global__ void __launch_bounds__(128) tf_glm_bmm_decode(const __nv_bfloat16* x, const __nv_bfloat16* w, void* out, float* part, int64_t m, int64_t x_stride, int64_t n, int64_t k, int sk, int f32) { + glm_pdl::enter(); glm_bmm::bmm<16, 64, 64, 1, 4>(x, w, out, part, m, x_stride, n, k, sk, 0, f32); } @@ -323,7 +329,7 @@ __device__ __forceinline__ void dec_tile(const __nv_bfloat16* x, const __nv_bflo #define TF_GLM_DEC_TILE(name, BN, ST) \ extern "C" __global__ void __launch_bounds__(128) \ name(const __nv_bfloat16* x, const __nv_bfloat16* w, void* out, float* part, int64_t m, int64_t x_stride, \ - int64_t n, int64_t k, int sk, int f32) { \ + int64_t n, int64_t k, int sk, int f32) { glm_pdl::enter(); \ glm_bmm::dec_tile(x, w, out, part, m, x_stride, n, k, sk, f32); \ } TF_GLM_DEC_TILE(tf_glm_bmm_d32s1, 32, 1) @@ -336,5 +342,6 @@ TF_GLM_DEC_TILE(tf_glm_bmm_d64s2, 64, 2) extern "C" __global__ void __launch_bounds__(128) tf_glm_bmm_rows(const __nv_bfloat16* x, const __nv_bfloat16* w, void* out, int64_t m, int64_t x_stride, int64_t n, int64_t k, int sk, int f32) { + glm_pdl::enter(); glm_bmm::bmm<128, 64, 32, 2, 2>(x, w, out, nullptr, m, x_stride, n, k, sk, 1, f32); } diff --git a/zig/kernels/cuda/glm_glue_hc.cuh b/zig/kernels/cuda/glm_glue_hc.cuh index 48e203a902d..f15fe6849f3 100644 --- a/zig/kernels/cuda/glm_glue_hc.cuh +++ b/zig/kernels/cuda/glm_glue_hc.cuh @@ -1,6 +1,8 @@ // glue._hc_partial and glue._hc_finish by hand (hyper-connections' pre side, 4 streams of 4096). #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" using namespace glm_triton; @@ -9,6 +11,7 @@ using namespace glm_triton; extern "C" __global__ void __launch_bounds__(128) tf_glm_hc_partial( const __nv_bfloat16* x, const __nv_bfloat16* fn, float* part, int64_t wide, int nb, int64_t rows) { + glm_pdl::enter(); constexpr int R = 4; __shared__ float smem[R][4]; const int64_t r0 = (int64_t)blockIdx.x * R, b = blockIdx.y, kb = wide / nb; @@ -58,6 +61,7 @@ extern "C" __global__ void __launch_bounds__(128) // The same for decode windows (16 blocks a row): 8 steps of 128 at once, a 128-thread group each; same ops, same order. extern "C" __global__ void __launch_bounds__(1024) tf_glm_hc_partial8(const __nv_bfloat16* x, const __nv_bfloat16* fn, float* part, int64_t wide, int nb) { + glm_pdl::enter(); __shared__ float dots[8][24]; __shared__ float smem[4]; const int64_t r = blockIdx.x, b = blockIdx.y, kb = wide / nb; @@ -228,6 +232,7 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_hc_finish(const __nv_bfloat16* x, const float* part, const float* base, const float* scale, const __nv_bfloat16* nw, __nv_bfloat16* out, float* xs, float* post, float* comb, float eps, float hc_eps, int nb, int iters) { + glm_pdl::enter(); glm_hc::finish(x, part, base, scale, nw, out, xs, post, comb, eps, hc_eps, nb, iters); } @@ -236,5 +241,6 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_hc_finish_f32w(const __nv_bfloat16* x, const float* part, const float* base, const float* scale, const float* nw, __nv_bfloat16* out, float* xs, float* post, float* comb, float eps, float hc_eps, int nb, int iters) { + glm_pdl::enter(); glm_hc::finish(x, part, base, scale, nw, out, xs, post, comb, eps, hc_eps, nb, iters); } diff --git a/zig/kernels/cuda/glm_glue_index.cuh b/zig/kernels/cuda/glm_glue_index.cuh index 00473d4db59..5f5cdb75beb 100644 --- a/zig/kernels/cuda/glm_glue_index.cuh +++ b/zig/kernels/cuda/glm_glue_index.cuh @@ -1,6 +1,8 @@ // sparse.py's DSA indexer glue by hand: the index key write, the 4-token pools and the per-row top-512 pools. #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" using namespace glm_triton; @@ -9,6 +11,7 @@ using namespace glm_triton; extern "C" __global__ void __launch_bounds__(32) tf_glm_index_write(const __nv_bfloat16* kr, int64_t k_stride, const float* gr, const __nv_bfloat16* lnw, const __nv_bfloat16* lnb, __nv_bfloat16* ik, __nv_bfloat16* ig, const int* pos, float eps) { + glm_pdl::enter(); constexpr int D = 128; const int64_t r = blockIdx.x, at = (int64_t)pos[0] + r; const int d0 = threadIdx.x * 4; @@ -38,6 +41,7 @@ extern "C" __global__ void __launch_bounds__(32) extern "C" __global__ void __launch_bounds__(32) tf_glm_pool_keys(const __nv_bfloat16* ik, const __nv_bfloat16* ig, const __nv_bfloat16* ape, __nv_bfloat16* pk, const int* pos, int64_t rows, const int* pt, int64_t ps) { + glm_pdl::enter(); constexpr int D = 128; const int64_t P = pos[0], p = P / 4 + blockIdx.x; if (4 * p + 3 > P + rows - 1) return; @@ -194,11 +198,13 @@ __device__ __forceinline__ void select_row(const float* scores, int64_t* out, in // sparse._select_rows (VISIBLE), a row per 4-warp block: K best visible pools by 8-bit radix select, ties to lower. extern "C" __global__ void __launch_bounds__(128) tf_glm_select_rows(const float* scores, int64_t* out, int64_t np, const int* pos, int k) { + glm_pdl::enter(); glm_index::select_row<128>(scores, out, np, pos, k); } // tf_glm_select_rows a row per 1,024-thread block, for a few rows over many pools (a decode step's): its bytes. extern "C" __global__ void __launch_bounds__(1024) tf_glm_select_rows_wide(const float* scores, int64_t* out, int64_t np, const int* pos, int k) { + glm_pdl::enter(); glm_index::select_row<1024>(scores, out, np, pos, k); } diff --git a/zig/kernels/cuda/glm_glue_latent.cuh b/zig/kernels/cuda/glm_glue_latent.cuh index 2abdd9610dd..241b66add5a 100644 --- a/zig/kernels/cuda/glm_glue_latent.cuh +++ b/zig/kernels/cuda/glm_glue_latent.cuh @@ -1,6 +1,8 @@ // latent.py's BF16 absorb, expand and cache write by hand (the MLA layers' 512-wide latent, 256-wide heads). #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" using namespace glm_triton; @@ -9,6 +11,7 @@ using namespace glm_triton; extern "C" __global__ void __launch_bounds__(128) tf_glm_absorb_q(const __nv_bfloat16* q, const __nv_bfloat16* wk, __nv_bfloat16* qa, int64_t rows, int64_t heads, int64_t rb) { + glm_pdl::enter(); constexpr int D = 256, LW = 512; __shared__ float smem[128]; const int t = threadIdx.x, k0 = t >> 2, nq = t & 3, warp = t >> 5; @@ -39,6 +42,7 @@ extern "C" __global__ void __launch_bounds__(128) extern "C" __global__ void __launch_bounds__(128) tf_glm_expand_v(const __nv_bfloat16* ol, const __nv_bfloat16* wv, __nv_bfloat16* out, int64_t rows, int64_t heads, int64_t rb) { + glm_pdl::enter(); constexpr int DV = 256, LW = 512; __shared__ float smem[32]; const int t = threadIdx.x, lane = t & 31, warp = t >> 5, kb = (warp & 1) * 256 + lane * 8, nb = warp >> 1; @@ -79,6 +83,7 @@ __device__ __forceinline__ int64_t at(const int* pt, int64_t page_elems, int64_t // latent._lat_write (BF16 cache): row r of `lat` into cache slot pos + r (on pages, through the stream's table). extern "C" __global__ void tf_glm_lat_write(const __nv_bfloat16* lat, int64_t lat_stride, __nv_bfloat16* cache, const int* pos, int64_t lw, const int* pt, int64_t ps) { + glm_pdl::enter(); const int64_t r = blockIdx.x, at = glm_pages::at<512>(pt, ps / 2, (int64_t)pos[0] + r, lw); for (int64_t k = threadIdx.x; k < lw; k += blockDim.x) cache[at + k] = lat[r * lat_stride + k]; } @@ -88,6 +93,7 @@ extern "C" __global__ void tf_glm_lat_write(const __nv_bfloat16* lat, int64_t la // One 512-wide latent row as E4M3 and its FP32 scale, with the same row-wise rounding as other FP8 caches. extern "C" __global__ void __launch_bounds__(512) tf_glm_lat_write_fp8(const __nv_bfloat16* lat, int64_t stride, unsigned char* cache, float* scales, const int* pos) { + glm_pdl::enter(); const int64_t r = blockIdx.x, at = (int64_t)pos[0] + r; const int d = threadIdx.x; __shared__ float red[16]; diff --git a/zig/kernels/cuda/glm_glue_moe.cuh b/zig/kernels/cuda/glm_glue_moe.cuh index 682d5cf0332..3926c03f52f 100644 --- a/zig/kernels/cuda/glm_glue_moe.cuh +++ b/zig/kernels/cuda/glm_glue_moe.cuh @@ -1,6 +1,8 @@ // GLM's MLP and MoE glue by hand: glue._topk and qmm._group_sums (SwiGLU: glm_swiglu.cuh; router dot: glm_glue_router). #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" using namespace glm_triton; @@ -12,6 +14,7 @@ TF_GLM_SWIGLU_64(tf_glm_swiglu_64, false) // qmm._group_sums: row blockIdx.x's 64-input sums, 8 lanes a group of 8 consecutive inputs each, 16 groups a block. extern "C" __global__ void __launch_bounds__(128) tf_glm_group_sums(const __nv_bfloat16* x, float* xs, int64_t x_stride, int64_t kg) { + glm_pdl::enter(); const int64_t m = blockIdx.x, g = blockIdx.y * 16 + threadIdx.x / 8; float q[8]; for (int j = 0; j < 8; ++j) q[j] = g < kg ? bf(x[m * x_stride + g * 64 + (threadIdx.x & 7) * 8 + j]) : 0.0f; @@ -23,6 +26,7 @@ extern "C" __global__ void __launch_bounds__(128) extern "C" __global__ void __launch_bounds__(32) tf_glm_topk(const float* logits, const float* bias, int* pick, float* wts, float scale, int ne, int top_k, int norm) { + glm_pdl::enter(); constexpr int MAXE = 16; // 512 experts a row const int64_t r = blockIdx.x; const int lane = threadIdx.x; diff --git a/zig/kernels/cuda/glm_glue_norm.cuh b/zig/kernels/cuda/glm_glue_norm.cuh index 92db977daa1..4c2fad9cd2d 100644 --- a/zig/kernels/cuda/glm_glue_norm.cuh +++ b/zig/kernels/cuda/glm_glue_norm.cuh @@ -1,6 +1,8 @@ // glue._rmsnorm by hand (glm_glue.cu's first group): see glm_triton.cuh for the Triton ops it keeps. #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" namespace glm_glue { @@ -137,7 +139,7 @@ __device__ void rmsnorm(const __nv_bfloat16* x, int64_t x_stride, const W* w, __ #define RMSNORM(D, BLOCK, NW, S) \ extern "C" __global__ void __launch_bounds__(NW * 32) \ tf_glm_rmsnorm_##D(const __nv_bfloat16* x, int64_t x_stride, const __nv_bfloat16* w, __nv_bfloat16* out, \ - int64_t o_stride, float* xs, float eps, int sums) { \ + int64_t o_stride, float* xs, float eps, int sums) { glm_pdl::enter(); \ glm_glue::rmsnorm(x, x_stride, w, out, o_stride, xs, eps, sums); \ } @@ -150,5 +152,6 @@ RMSNORM(512, 512, 4, 4) extern "C" __global__ void __launch_bounds__(256) tf_glm_rmsnorm_4096_f32w(const __nv_bfloat16* x, int64_t x_stride, const float* w, __nv_bfloat16* out, int64_t o_stride, float* xs, float eps, int sums) { + glm_pdl::enter(); glm_glue::rmsnorm<4096, 4096, 8, 8, float>(x, x_stride, w, out, o_stride, xs, eps, sums); } diff --git a/zig/kernels/cuda/glm_glue_rows.cuh b/zig/kernels/cuda/glm_glue_rows.cuh index f708771a766..d141895f540 100644 --- a/zig/kernels/cuda/glm_glue_rows.cuh +++ b/zig/kernels/cuda/glm_glue_rows.cuh @@ -1,6 +1,8 @@ // GLM's element-wise glue by hand: each output value alone, in the Triton kernel's order of fp32 ops. #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" namespace glm_glue { @@ -46,6 +48,7 @@ using namespace glm_triton; // glue._residual_add: xout = bf16(x + bf16(the partials summed rank 0 first)), 8 columns a thread. extern "C" __global__ void tf_glm_residual_add(const __nv_bfloat16* x, __nv_bfloat16* xout, const float* g, int64_t rs, int64_t d, int world) { + glm_pdl::enter(); const int64_t c = glm_glue::col8(); if (c >= d) return; const int64_t i = blockIdx.x * d + c; @@ -58,6 +61,7 @@ extern "C" __global__ void tf_glm_residual_add(const __nv_bfloat16* x, __nv_bflo // glue._stream_mean: bf16 of the s streams' sum over s (div.full, as Triton divides), 8 columns a thread. extern "C" __global__ void tf_glm_stream_mean(const __nv_bfloat16* x, __nv_bfloat16* out, int64_t d, int s) { + glm_pdl::enter(); const int64_t c = glm_glue::col8(); if (c >= d) return; const __nv_bfloat16* row = x + blockIdx.x * s * d + c; @@ -75,6 +79,7 @@ extern "C" __global__ void tf_glm_stream_mean(const __nv_bfloat16* x, __nv_bfloa // glue._rank_sum: bf16 of the partials summed rank 0 first, `me` from `own`, others from `peers`, 8 columns a thread. extern "C" __global__ void tf_glm_rank_sum(const float* own, const float* peers, __nv_bfloat16* out, int64_t rs, int64_t d, int world, int me) { + glm_pdl::enter(); const int64_t c = glm_glue::col8(); if (c >= d) return; const int64_t i = blockIdx.x * d + c; @@ -91,6 +96,7 @@ extern "C" __global__ void tf_glm_rank_sum(const float* own, const float* peers, // glue._hc_post: stream s = bf16(post[s] branch + sum_t comb[t][s] x[t]) in LLVM's fma order; x may be xout. extern "C" __global__ void tf_glm_hc_post(const __nv_bfloat16* x, __nv_bfloat16* xout, const float* g, const float* post, const float* comb, int64_t rs, int64_t d, int world) { + glm_pdl::enter(); const int64_t c = glm_glue::col8(); if (c >= d) return; const int64_t r = blockIdx.x; @@ -116,6 +122,7 @@ extern "C" __global__ void tf_glm_hc_post(const __nv_bfloat16* x, __nv_bfloat16* // glue._combine: fp32 sum over slots in order of y[r][k] wts[r][k] (fma from 0), y fp32 or bf16, 8 columns a thread. extern "C" __global__ void tf_glm_combine( const void* y, int y_f32, const float* wts, float* out, int64_t d, int slots) { + glm_pdl::enter(); const int64_t c = glm_glue::col8(); if (c >= d) return; const int64_t r = blockIdx.x; @@ -137,6 +144,7 @@ extern "C" __global__ void tf_glm_combine( // glue._router_sum and qmm._reduce: ks slices of `total` fp32 added in order (fp32 or bf16 out), 8 values a thread. extern "C" __global__ void tf_glm_slice_sum(const float* part, void* out, int64_t total, int ks, int f32) { + glm_pdl::enter(); const int64_t i0 = ((int64_t)blockIdx.x * blockDim.x + threadIdx.x) * 8; if (i0 >= total) return; const bool aligned = ((reinterpret_cast(out) | reinterpret_cast(part)) & 15) == 0; @@ -170,6 +178,7 @@ extern "C" __global__ void tf_glm_slice_sum(const float* part, void* out, int64_ // glue._embed_b16: token ids[r]'s bf16 row into `copies` streams of d. extern "C" __global__ void tf_glm_embed_b16(const int* ids, const __nv_bfloat16* w, __nv_bfloat16* out, int64_t d, int copies) { + glm_pdl::enter(); const int64_t c = glm_glue::col(); if (c >= d) return; const int64_t r = blockIdx.x; @@ -180,6 +189,7 @@ extern "C" __global__ void tf_glm_embed_b16(const int* ids, const __nv_bfloat16* // forward._conv_shift: layer blockIdx.x's 3-row window takes rows keep .. keep + 2 of [window; projection rows]. extern "C" __global__ void tf_glm_conv_shift(__nv_bfloat16* conv, const __nv_bfloat16* proj, int64_t keep, int64_t conv_layer, int64_t proj_layer, int64_t proj_row, int64_t c) { + glm_pdl::enter(); const int64_t k = glm_glue::col(); if (k >= c) return; const int64_t l = blockIdx.x; @@ -235,11 +245,13 @@ __device__ __forceinline__ void glm_top1(const unsigned short* logits, int64_t n } extern "C" __global__ void __launch_bounds__(1024) tf_glm_top1(const unsigned short* logits, int64_t n, unsigned lo, unsigned* out) { + glm_pdl::enter(); glm_top1(logits, n, lo, out); } // The pick with its slice's softmax sum in out[2]: an MTP draft's chance (--mtp-confidence) across the ranks. extern "C" __global__ void __launch_bounds__(1024) tf_glm_top1_sums(const unsigned short* logits, int64_t n, unsigned lo, unsigned* out) { + glm_pdl::enter(); glm_top1(logits, n, lo, out); } @@ -248,5 +260,6 @@ struct tf_glm_words { unsigned w[96]; }; extern "C" __global__ void tf_glm_put_words(unsigned* dst, unsigned n, tf_glm_words v) { + glm_pdl::enter(); for (unsigned i = threadIdx.x; i < n; i += blockDim.x) dst[i] = v.w[i]; } diff --git a/zig/kernels/cuda/glm_index_decode.cuh b/zig/kernels/cuda/glm_index_decode.cuh index a3e7fa88dfc..3275a682e92 100644 --- a/zig/kernels/cuda/glm_index_decode.cuh +++ b/zig/kernels/cuda/glm_index_decode.cuh @@ -1,6 +1,8 @@ // GLM-5.3-Flash DSA indexer: a decode window's top-512 pools of long rows on many CTAs, tf_glm_select_rows' bytes. #pragma once +#include "glm_pdl.cuh" + #include #include @@ -191,8 +193,9 @@ struct Merge { // tf_glm_dsel_scan, grid (cdiv(the last row's NP, SPAN), R): a span's pools above (gt) and at (eq) the row's floor. extern "C" __global__ void __launch_bounds__(glm_dsel::T1) - tf_glm_dsel_scan(const float* __restrict__ S, int64_t np, const int* __restrict__ pos, int K, int target, + tf_glm_dsel_scan(const float* S, int64_t np, const int* pos, int K, int target, uint32_t* __restrict__ bits, int64_t words) { + glm_pdl::enter(); using namespace glm_dsel; __shared__ int hist[256]; __shared__ uint32_t sh_prefix; @@ -255,8 +258,9 @@ extern "C" __global__ void __launch_bounds__(glm_dsel::T1) // tf_glm_dsel_merge, a CTA a row: scores [R][np] into out [R][K] int64 ascending; PATH null or [R] int32, each path. extern "C" __global__ void __launch_bounds__(glm_dsel::T2) - tf_glm_dsel_merge(const float* __restrict__ S, int64_t* __restrict__ OUT, int64_t np, const int* __restrict__ pos, - int K, const uint32_t* __restrict__ bits, int64_t words, int* __restrict__ PATH) { + tf_glm_dsel_merge(const float* S, int64_t* __restrict__ OUT, int64_t np, const int* pos, + int K, const uint32_t* bits, int64_t words, int* __restrict__ PATH) { + glm_pdl::enter(); using namespace glm_dsel; __shared__ Merge sm; const int64_t r = blockIdx.x; diff --git a/zig/kernels/cuda/glm_index_pools.cuh b/zig/kernels/cuda/glm_index_pools.cuh index 4882b760ceb..2a8969878ea 100644 --- a/zig/kernels/cuda/glm_index_pools.cuh +++ b/zig/kernels/cuda/glm_index_pools.cuh @@ -1,6 +1,8 @@ // GLM-5.3-Flash DSA indexer, a prompt chunk's top-K pools in one pass: a sampled floor, the survivors, a radix select. #pragma once +#include "glm_pdl.cuh" + #include #include @@ -171,8 +173,9 @@ __device__ uint32_t sample_floor(Smem& sm, const float* row, int NP, int TARGET, // tf_glm_select_rows' pools for scores [R][np]; CAP (<= 4096), TARGET speed only; PATH null or [R] int32; grid (R). extern "C" __global__ void __launch_bounds__(glm_index::T) - tf_glm_index_pools(const float* __restrict__ S, int64_t* __restrict__ OUT, int64_t np, const int* __restrict__ pos, + tf_glm_index_pools(const float* S, int64_t* __restrict__ OUT, int64_t np, const int* pos, int K, int CAP, int TARGET, int* __restrict__ PATH) { + glm_pdl::enter(); using namespace glm_index; __shared__ Smem sm; CAP = min(CAP, CAP_MAX); diff --git a/zig/kernels/cuda/glm_index_scores.cuh b/zig/kernels/cuda/glm_index_scores.cuh index 5f734e463a0..50bea137e89 100644 --- a/zig/kernels/cuda/glm_index_scores.cuh +++ b/zig/kernels/cuda/glm_index_scores.cuh @@ -1,6 +1,8 @@ // GLM-5.3-Flash DSA indexer, a prompt chunk's pool scores: tf_glm_scores' arithmetic with each key tile staged once. #pragma once +#include "glm_pdl.cuh" + #include #include #include @@ -44,6 +46,7 @@ extern "C" __global__ void __launch_bounds__(glm_index::RB * 32) tf_glm_index_scores(const __nv_bfloat16* qi, const __nv_bfloat16* wts, int64_t w_stride, const __nv_bfloat16* pk, float* out, const int* pos, int64_t rows, int64_t np, int64_t nb, float scale, float wscale, int64_t heads, int loop, const int* pt, int64_t ps) { + glm_pdl::enter(); using namespace glm_index; __shared__ __align__(16) __nv_bfloat16 tile[2][BP * D]; // two key tiles const int lane = threadIdx.x & 31, warp = threadIdx.x >> 5, g = lane >> 2, q = lane & 3; diff --git a/zig/kernels/cuda/glm_kda.cu b/zig/kernels/cuda/glm_kda.cu index 0be432ea831..4cc6b1a14a1 100644 --- a/zig/kernels/cuda/glm_kda.cu +++ b/zig/kernels/cuda/glm_kda.cu @@ -1,5 +1,6 @@ // GLM keeps its existing image, entry points, bounds and compiler flags. #include "common/kda.cuh" +#include "glm_pdl.cuh" extern "C" __global__ void __launch_bounds__(1024) tf_glm_kda_chain( int H, const __nv_bfloat16* __restrict__ P, int p_stride, int b_off, const __nv_bfloat16* __restrict__ A, @@ -8,6 +9,7 @@ extern "C" __global__ void __launch_bounds__(1024) tf_glm_kda_chain( const float* __restrict__ dt_bias, const __nv_bfloat16* __restrict__ norm_w, float eps, float lower, int rows, __nv_bfloat16* __restrict__ out, float* __restrict__ state_out, float* __restrict__ k_save, __nv_bfloat16* __restrict__ v_save, float* __restrict__ g_save, float* __restrict__ b_save) { + glm_pdl::enter(); chain_kernel_body( H, P, p_stride, b_off, A, a_stride, G, g_stride, cs, cw, state_in, a_log, dt_bias, norm_w, eps, lower, rows, out, state_out, k_save, v_save, g_save, b_save); @@ -17,6 +19,7 @@ extern "C" __global__ void __launch_bounds__(1024) tf_glm_kda_replay( int H, const float* __restrict__ state_in, const float* __restrict__ k_save, const __nv_bfloat16* __restrict__ v_save, const float* __restrict__ g_save, const float* __restrict__ b_save, int rows, float* __restrict__ state_out) { + glm_pdl::enter(); replay_kernel_body(H, state_in, k_save, v_save, g_save, b_save, rows, state_out); } @@ -24,6 +27,7 @@ extern "C" __global__ void __launch_bounds__(1024) tf_glm_kda_replay_layers( int H, const float* __restrict__ state_in, size_t state_stride, const float* __restrict__ k_save, const __nv_bfloat16* __restrict__ v_save, const float* __restrict__ g_save, const float* __restrict__ b_save, size_t kv_stride, size_t b_stride, int rows, float* __restrict__ state_out) { + glm_pdl::enter(); replay_layers_kernel_body( H, state_in, state_stride, k_save, v_save, g_save, b_save, kv_stride, b_stride, rows, state_out); } @@ -34,6 +38,7 @@ extern "C" __global__ void __launch_bounds__(512) tf_glm_kda_prep( const float* __restrict__ a_log, const float* __restrict__ dt_bias, float lower, float* __restrict__ q_out, float* __restrict__ k_save, __nv_bfloat16* __restrict__ v_save, float* __restrict__ g_save, float* __restrict__ b_save) { + glm_pdl::enter(); prep_kernel_body( H, P, p_stride, b_off, A, a_stride, cs, cw, a_log, dt_bias, lower, q_out, k_save, v_save, g_save, b_save); } @@ -42,11 +47,13 @@ extern "C" __global__ void __launch_bounds__(256) tf_glm_kda_step( int H, const float* __restrict__ state_in, const float* __restrict__ q_in, const float* __restrict__ k_save, const __nv_bfloat16* __restrict__ v_save, const float* __restrict__ g_save, const float* __restrict__ b_save, int rows, __nv_bfloat16* __restrict__ y_out, float* __restrict__ state_out) { + glm_pdl::enter(); step_kernel_body<8, 16>(H, state_in, q_in, k_save, v_save, g_save, b_save, rows, y_out, state_out); } extern "C" __global__ void __launch_bounds__(128) tf_glm_kda_out( int H, const __nv_bfloat16* __restrict__ y_in, const __nv_bfloat16* __restrict__ G, int g_stride, const __nv_bfloat16* __restrict__ norm_w, float eps, __nv_bfloat16* __restrict__ out) { + glm_pdl::enter(); out_kernel_body(H, y_in, G, g_stride, norm_w, eps, out); } diff --git a/zig/kernels/cuda/glm_mm.cu b/zig/kernels/cuda/glm_mm.cu index 942431e4378..e0824852a87 100644 --- a/zig/kernels/cuda/glm_mm.cu +++ b/zig/kernels/cuda/glm_mm.cu @@ -5,6 +5,7 @@ #include #include "common/qmm_frag.cuh" +#include "glm_pdl.cuh" namespace { @@ -220,7 +221,7 @@ __device__ __forceinline__ void mm_kernel(const __nv_bfloat16* __restrict__ x, l // The K slices' partials added in slice order, then rounded once. extern "C" __global__ void glm_mm_reduce(const float* __restrict__ part, void* __restrict__ out, long long total, int SK, int f32) { - qmm_frag::grid_launch(); + glm_pdl::enter(); const long long i = (long long)blockIdx.x * blockDim.x + threadIdx.x; if (i >= total) return; float acc = part[i]; @@ -277,12 +278,22 @@ __device__ __forceinline__ void tile_packed(const uint32_t* __restrict__ src, co if (lane < 8) ds[(tg * 8) + lane] = ss[(long long)(tt * 8 + lane) * KG + g]; } -extern "C" __global__ void glm_mm_tile4(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { tile_packed<4>(src, ss, dst, ds, N, K); } -extern "C" __global__ void glm_mm_tile6(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { tile_packed<6>(src, ss, dst, ds, N, K); } -extern "C" __global__ void glm_mm_tile8(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { tile_packed<8>(src, ss, dst, ds, N, K); } +extern "C" __global__ void glm_mm_tile4(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { + glm_pdl::enter_weights(); + tile_packed<4>(src, ss, dst, ds, N, K); +} +extern "C" __global__ void glm_mm_tile6(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { + glm_pdl::enter_weights(); + tile_packed<6>(src, ss, dst, ds, N, K); +} +extern "C" __global__ void glm_mm_tile8(const uint32_t* src, const __half* ss, uint32_t* dst, __half* ds, int N, int K) { + glm_pdl::enter_weights(); + tile_packed<8>(src, ss, dst, ds, N, K); +} // bf16 rows [N][K] -> the tiled chunks (16 bf16 a chunk, in pair order) extern "C" __global__ void glm_mm_tile16(const __nv_bfloat16* __restrict__ src, __nv_bfloat16* __restrict__ dst, int N, int K) { + glm_pdl::enter_weights(); const int KG = K >> 6, N8 = N >> 3; const long long c = (long long)blockIdx.x * blockDim.x + threadIdx.x; if (c >= (long long)N8 * KG * 32) return; diff --git a/zig/kernels/cuda/glm_ops.cu b/zig/kernels/cuda/glm_ops.cu index b2fbee106c8..2da3d8b7ba6 100644 --- a/zig/kernels/cuda/glm_ops.cu +++ b/zig/kernels/cuda/glm_ops.cu @@ -2,13 +2,15 @@ #include #include +#include "glm_pdl.cuh" constexpr long long PAGE = 512; // rows a KV page holds // sparse.select_tokens' assembly, a block a row: K pools' 4 tokens, then the tail; on pages each token's row in them. -extern "C" __global__ void tf_glm_dsa_tokens(const long long* __restrict__ pools, const int* __restrict__ pos, int K, +extern "C" __global__ void tf_glm_dsa_tokens(const long long* pools, const int* pos, int K, int* __restrict__ tokens, int* __restrict__ counts, - const int* __restrict__ pt, long long page_rows) { + const int* pt, long long page_rows) { + glm_pdl::enter(); const int r = blockIdx.x; const long long q = static_cast(*pos) + r; const long long npool = (q + 1) / 4; @@ -30,12 +32,14 @@ extern "C" __global__ void tf_glm_dsa_tokens(const long long* __restrict__ pools // pos_dev + a (sparse.select_tokens' at = pos_dev + a for a row block past the first): one int32 on the device. extern "C" __global__ void tf_glm_add_i32(const int* __restrict__ x, int a, int* __restrict__ out) { + glm_pdl::enter(); if (threadIdx.x == 0 && blockIdx.x == 0) *out = *x + a; } // forward.shared_expert's b.ey[:, slot].copy_(b.sy): fp32 rows into slot `slot`, as is or bf16 round-to-nearest-even. extern "C" __global__ void tf_glm_put_slot(const float* __restrict__ src, void* __restrict__ dst, int rows, int d, int slots, int slot, int bf16) { + glm_pdl::enter(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= static_cast(rows) * d) return; const long long r = i / d, c = i % d; @@ -48,6 +52,7 @@ extern "C" __global__ void tf_glm_put_slot(const float* __restrict__ src, void* extern "C" __global__ void tf_glm_copy_rows(const unsigned char* __restrict__ src, long long src_pitch, unsigned char* __restrict__ dst, long long dst_pitch, int rows, int row_bytes) { + glm_pdl::enter(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= static_cast(rows) * row_bytes) return; const long long r = i / row_bytes, c = i % row_bytes; @@ -58,6 +63,7 @@ extern "C" __global__ void tf_glm_copy_rows(const unsigned char* __restrict__ sr extern "C" __global__ void tf_glm_kvh_mark(const int* __restrict__ tokens, const int* __restrict__ counts, int width, long long total, int* slot_of, int* list, int* n, int cap, volatile int* over) { + glm_pdl::enter(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= total) return; if (static_cast(i % width) >= counts[i / width]) return; @@ -74,8 +80,9 @@ extern "C" __global__ void tf_glm_kvh_mark(const int* __restrict__ tokens, const } // copy: slot s gets row list[s] (row_vec 16-byte words a row), one warp a row. -extern "C" __global__ void tf_glm_kvh_copy(const uint4* __restrict__ lc, const int* __restrict__ list, - const int* __restrict__ n, uint4* __restrict__ slots, int row_vec, int cap) { +extern "C" __global__ void tf_glm_kvh_copy(const uint4* lc, const int* list, + const int* n, uint4* __restrict__ slots, int row_vec, int cap) { + glm_pdl::enter(); const long long s = static_cast(blockIdx.x) * (blockDim.x / 32) + threadIdx.x / 32; if (s >= min(*n, cap)) return; const long long t = list[s]; @@ -85,6 +92,7 @@ extern "C" __global__ void tf_glm_kvh_copy(const uint4* __restrict__ lc, const i // remap: the call's token lists name slots instead of rows (same order, so the attention sums are unchanged). extern "C" __global__ void tf_glm_kvh_remap(int* tokens, const int* __restrict__ counts, int width, long long total, const int* __restrict__ slot_of) { + glm_pdl::enter(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= total) return; if (static_cast(i % width) >= counts[i / width]) return; @@ -93,15 +101,17 @@ extern "C" __global__ void tf_glm_kvh_remap(int* tokens, const int* __restrict__ } // reset: the rows this call marked are unseen again. -extern "C" __global__ void tf_glm_kvh_reset(const int* __restrict__ list, const int* __restrict__ n, int* slot_of, int cap) { +extern "C" __global__ void tf_glm_kvh_reset(const int* list, const int* n, int* slot_of, int cap) { + glm_pdl::enter(); const long long s = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (s < min(*n, cap)) slot_of[list[s]] = -1; } // rows: a sequence's rows 0 .. *pos + rows (at most max_rows) into slots in position order, through its page table. -extern "C" __global__ void tf_glm_kvh_rows(const uint4* __restrict__ lc, const int* __restrict__ pt, long long page_rows, - const int* __restrict__ pos, int rows, uint4* __restrict__ slots, int row_vec, +extern "C" __global__ void tf_glm_kvh_rows(const uint4* lc, const int* pt, long long page_rows, + const int* pos, int rows, uint4* __restrict__ slots, int row_vec, int max_rows) { + glm_pdl::enter(); const long long s = static_cast(blockIdx.x) * (blockDim.x / 32) + threadIdx.x / 32; if (s >= min(static_cast(*pos) + rows, static_cast(max_rows))) return; const long long t = pt ? pt[s / PAGE] * page_rows + s % PAGE : s; @@ -109,9 +119,10 @@ extern "C" __global__ void tf_glm_kvh_rows(const uint4* __restrict__ lc, const i } // prev_mark: prev_of[row] = its slot in the layer's row cache, except rows this call writes (rejected drafts' rows). -extern "C" __global__ void tf_glm_kvh_prev_mark(const int* __restrict__ prev_rows, const int* __restrict__ prev_n, - int* prev_of, const int* __restrict__ pt, long long page_rows, - const int* __restrict__ pos, int rows) { +extern "C" __global__ void tf_glm_kvh_prev_mark(const int* prev_rows, const int* prev_n, + int* prev_of, const int* pt, long long page_rows, + const int* pos, int rows) { + glm_pdl::enter(); const int i = blockIdx.x * blockDim.x + threadIdx.x; if (i >= *prev_n) return; const int t = prev_rows[i]; @@ -123,10 +134,11 @@ extern "C" __global__ void tf_glm_kvh_prev_mark(const int* __restrict__ prev_row } // copy_cached: as copy, from the layer's cache where the row is there, else from host memory. -extern "C" __global__ void tf_glm_kvh_copy_cached(const uint4* __restrict__ lc, const int* __restrict__ list, - const int* __restrict__ n, uint4* __restrict__ slots, int row_vec, - int cap, const int* __restrict__ prev_of, - const uint4* __restrict__ cache) { +extern "C" __global__ void tf_glm_kvh_copy_cached(const uint4* lc, const int* list, + const int* n, uint4* __restrict__ slots, int row_vec, + int cap, const int* prev_of, + const uint4* cache) { + glm_pdl::enter(); const long long s = static_cast(blockIdx.x) * (blockDim.x / 32) + threadIdx.x / 32; if (s >= min(*n, cap)) return; const long long t = list[s]; @@ -136,9 +148,10 @@ extern "C" __global__ void tf_glm_kvh_copy_cached(const uint4* __restrict__ lc, } // keep: the call's gathered rows become the layer's cache (the first cache_rows of them), one warp a row. -extern "C" __global__ void tf_glm_kvh_keep(const uint4* __restrict__ slots, const int* __restrict__ list, - const int* __restrict__ n, uint4* __restrict__ cache, int* prev_rows, +extern "C" __global__ void tf_glm_kvh_keep(const uint4* slots, const int* list, + const int* n, uint4* __restrict__ cache, int* prev_rows, int* prev_n, int row_vec, int cache_rows) { + glm_pdl::enter(); const long long s = static_cast(blockIdx.x) * (blockDim.x / 32) + threadIdx.x / 32; const int m = min(*n, cache_rows); if (s == 0 && threadIdx.x == 0) *prev_n = m; @@ -148,9 +161,10 @@ extern "C" __global__ void tf_glm_kvh_keep(const uint4* __restrict__ slots, cons } // unmark: the previous call's rows (old_rows, old_n) and this call's (list, n) are unseen again. -extern "C" __global__ void tf_glm_kvh_unmark(const int* __restrict__ old_rows, const int* __restrict__ old_n, - int* prev_of, const int* __restrict__ list, const int* __restrict__ n, +extern "C" __global__ void tf_glm_kvh_unmark(const int* old_rows, const int* old_n, + int* prev_of, const int* list, const int* n, int* slot_of, int cap) { + glm_pdl::enter(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i < *old_n) prev_of[old_rows[i]] = -1; if (i < min(*n, cap)) slot_of[list[i]] = -1; diff --git a/zig/kernels/cuda/glm_pdl.cuh b/zig/kernels/cuda/glm_pdl.cuh new file mode 100644 index 00000000000..fcd1bcc5450 --- /dev/null +++ b/zig/kernels/cuda/glm_pdl.cuh @@ -0,0 +1,33 @@ +// GLM kernels as dependent launches: each one lets the next kernel in, then waits for the one before (sm_90 on). +#pragma once + +#ifdef __CUDACC__ // the host emulator (tools/glm_index_emulate) compiles GLM kernels without CUDA headers +#include "common/qmm_frag.cuh" +#endif + +namespace glm_pdl { + +// The next grid may launch once every CTA of this one has run this (or ended). +__device__ __forceinline__ void trigger() { +#ifdef __CUDACC__ + qmm_frag::grid_launch(); +#endif +} + +// Returns once the grid before has completed and its writes are visible; read those coherently (no const __restrict__). +__device__ __forceinline__ void wait() { +#ifdef __CUDACC__ + qmm_frag::grid_wait(); +#endif +} + +// Every GLM kernel's first statement: a dependent launch then reads and writes exactly as a plain one. +__device__ __forceinline__ void enter() { + trigger(); + wait(); +} + +// A kernel that writes weights waits but lets no dependent in early: qmmf and glm_mm read weights before their wait. +__device__ __forceinline__ void enter_weights() { wait(); } + +} // namespace glm_pdl diff --git a/zig/kernels/cuda/glm_quant.cu b/zig/kernels/cuda/glm_quant.cu index 866b5ade815..53c0d4faeb8 100644 --- a/zig/kernels/cuda/glm_quant.cu +++ b/zig/kernels/cuda/glm_quant.cu @@ -3,6 +3,7 @@ #include #include #include +#include "glm_pdl.cuh" namespace tf_glm_quant { @@ -36,6 +37,7 @@ using tf_glm_quant::widen8; // experts._quantize's per-expert scale, a block per expert: g[e] = clamp_min(amax |w[e]| * fp32(1 / 2688), 1e-30). extern "C" __global__ void tf_glm_nvfp4_amax( const __nv_bfloat16* __restrict__ w, long long per, float* __restrict__ g) { + glm_pdl::enter_weights(); const uint4* src = reinterpret_cast(w + blockIdx.x * per); float m = 0.0f; for (long long i = threadIdx.x; i < per / 8; i += blockDim.x) { @@ -59,6 +61,7 @@ extern "C" __global__ void tf_glm_nvfp4_amax( extern "C" __global__ void tf_glm_nvfp4_quantize(const __nv_bfloat16* __restrict__ w, const float* __restrict__ g, long long per, long long total, uint8_t* __restrict__ codes, uint8_t* __restrict__ scales) { + glm_pdl::enter_weights(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= total) return; const float ge = g[i / per]; @@ -90,6 +93,7 @@ extern "C" __global__ void tf_glm_nvfp4_quantize(const __nv_bfloat16* __restrict extern "C" __global__ void tf_glm_quantize4(const __nv_bfloat16* __restrict__ w, long long groups, int32_t* __restrict__ words, __nv_bfloat16* __restrict__ scales, __nv_bfloat16* __restrict__ biases) { + glm_pdl::enter_weights(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= groups) return; const uint4* src = reinterpret_cast(w) + 8 * i; diff --git a/zig/kernels/cuda/glm_swiglu.cuh b/zig/kernels/cuda/glm_swiglu.cuh index a6c60f72060..52336a7eb83 100644 --- a/zig/kernels/cuda/glm_swiglu.cuh +++ b/zig/kernels/cuda/glm_swiglu.cuh @@ -1,6 +1,8 @@ // glue._swiglu's rows by hand: silu with the clamp before it (GLM) or after it (Ling), and the 64-value group sums. #pragma once +#include "glm_pdl.cuh" + #include "glm_triton.cuh" using namespace glm_triton; @@ -32,7 +34,7 @@ __device__ __forceinline__ float swiglu1(float g, float u, float limit) { // glue._swiglu with BLOCK 512 (128 threads, 4 values each, 64-group sums over 16 lanes), column block blockIdx.y. #define TF_GLM_SWIGLU_512(NAME, AFTER) \ extern "C" __global__ void __launch_bounds__(128) \ - NAME(const __nv_bfloat16* gu, __nv_bfloat16* out, float* xs, float limit, int64_t w) { \ + NAME(const __nv_bfloat16* gu, __nv_bfloat16* out, float* xs, float limit, int64_t w) { glm_pdl::enter(); \ const int64_t r = blockIdx.x, d0 = blockIdx.y * 512 + threadIdx.x * 4; \ const uint2 gv = *reinterpret_cast(gu + r * 2 * w + d0); \ const uint2 uv = *reinterpret_cast(gu + r * 2 * w + w + d0); \ @@ -53,7 +55,7 @@ __device__ __forceinline__ float swiglu1(float g, float u, float limit) { // glue._swiglu with BLOCK 64 (the TP=3 shared expert's 704): one value a thread, the warp's butterfly, then 2 warps. #define TF_GLM_SWIGLU_64(NAME, AFTER) \ extern "C" __global__ void __launch_bounds__(64) \ - NAME(const __nv_bfloat16* gu, __nv_bfloat16* out, float* xs, float limit, int64_t w) { \ + NAME(const __nv_bfloat16* gu, __nv_bfloat16* out, float* xs, float limit, int64_t w) { glm_pdl::enter(); \ __shared__ float smem[2]; \ const int64_t r = blockIdx.x, d = blockIdx.y * 64 + threadIdx.x; \ const float a = glm_moe::swiglu1(bf(gu[r * 2 * w + d]), bf(gu[r * 2 * w + w + d]), limit); \ diff --git a/zig/kernels/cuda/glm_vision.cu b/zig/kernels/cuda/glm_vision.cu index d144113051d..9887b23f457 100644 --- a/zig/kernels/cuda/glm_vision.cu +++ b/zig/kernels/cuda/glm_vision.cu @@ -2,6 +2,7 @@ #include #include +#include "glm_pdl.cuh" namespace { __device__ __forceinline__ float bf(__nv_bfloat16 x) { return __bfloat162float(x); } @@ -34,6 +35,7 @@ __device__ __forceinline__ float limited_swiglu(float g, float u, float limit) { // dst[i] = bf16(src[i]) (the processor's fp32 patches) extern "C" __global__ void glm_vis_to_bf16(const float* __restrict__ src, __nv_bfloat16* __restrict__ dst, long long n) { + glm_pdl::enter(); for (long long i = blockIdx.x * (long long)blockDim.x + threadIdx.x; i < n; i += (long long)gridDim.x * blockDim.x) dst[i] = tobf(src[i]); } @@ -41,6 +43,7 @@ extern "C" __global__ void glm_vis_to_bf16(const float* __restrict__ src, __nv_b // out[r, c] = bf16(acc[r, c] + bias[c]) (bias may be null); with x32: x32[r, c] += that bf16 value (a residual add) extern "C" __global__ void glm_vis_bias(const float* __restrict__ acc, const __nv_bfloat16* __restrict__ bias, __nv_bfloat16* __restrict__ out, float* __restrict__ x32, long long n, int cols) { + glm_pdl::enter(); for (long long i = blockIdx.x * (long long)blockDim.x + threadIdx.x; i < n; i += (long long)gridDim.x * blockDim.x) { const float v = acc[i] + (bias ? bf(bias[i % cols]) : 0.f); const __nv_bfloat16 h = tobf(v); @@ -52,6 +55,7 @@ extern "C" __global__ void glm_vis_bias(const float* __restrict__ acc, const __n // x32[i] = acc[i] + bias[i % cols] (the patch embedding: the residual stream's first value, in fp32) extern "C" __global__ void glm_vis_embed32(const float* __restrict__ acc, const __nv_bfloat16* __restrict__ bias, float* __restrict__ x32, long long n, int cols) { + glm_pdl::enter(); for (long long i = blockIdx.x * (long long)blockDim.x + threadIdx.x; i < n; i += (long long)gridDim.x * blockDim.x) x32[i] = bf(tobf(acc[i] + bf(bias[i % cols]))); } @@ -59,6 +63,7 @@ extern "C" __global__ void glm_vis_embed32(const float* __restrict__ acc, const // RMSNorm of fp32 rows: y = bf16(x rsqrt(mean(x^2) + eps) w), a block a row extern "C" __global__ void glm_vis_rmsnorm(const float* __restrict__ x, const __nv_bfloat16* __restrict__ w, __nv_bfloat16* __restrict__ y, int cols, float eps) { + glm_pdl::enter(); const float* row = x + (long long)blockIdx.x * cols; float s = 0.f; for (int c = threadIdx.x; c < cols; c += blockDim.x) s += row[c] * row[c]; @@ -72,6 +77,7 @@ extern "C" __global__ void glm_vis_qkv(const __nv_bfloat16* __restrict__ qkv, co const float* __restrict__ inv_freq, __nv_bfloat16* __restrict__ qh, __nv_bfloat16* __restrict__ kh, __nv_bfloat16* __restrict__ vt, int N, int seg, int H, float eps) { + glm_pdl::enter(); const long long item = blockIdx.x * (long long)(blockDim.x >> 5) + (threadIdx.x >> 5); if (item >= (long long)N * H) return; const int lane = threadIdx.x & 31; @@ -105,6 +111,7 @@ extern "C" __global__ void glm_vis_qkv(const __nv_bfloat16* __restrict__ qkv, co // A scores row's softmax: pr = bf16(exp(scale (s - max))) and its sum (of the bf16 values), a block a row extern "C" __global__ void glm_vis_softmax(const float* __restrict__ sc, __nv_bfloat16* __restrict__ pr, float* __restrict__ sums, int n, float scale) { + glm_pdl::enter(); const float* row = sc + (long long)blockIdx.x * n; __shared__ float mx_s[32]; __shared__ float mx; @@ -132,6 +139,7 @@ extern "C" __global__ void glm_vis_softmax(const float* __restrict__ sc, __nv_bf // att[r, h * 64 + d] = bf16(oh[r, d] / sums[r]) (a head's values product, normalized, into its columns) extern "C" __global__ void glm_vis_head_out(const float* __restrict__ oh, const float* __restrict__ sums, __nv_bfloat16* __restrict__ att, int rows, int H, int h) { + glm_pdl::enter(); const int i = blockIdx.x * blockDim.x + threadIdx.x; if (i >= rows * 64) return; const int r = i / 64, d = i % 64; @@ -142,6 +150,7 @@ extern "C" __global__ void glm_vis_head_out(const float* __restrict__ oh, const extern "C" __global__ void glm_vis_swiglu(const float* __restrict__ g, const float* __restrict__ u, const __nv_bfloat16* __restrict__ gb, const __nv_bfloat16* __restrict__ ub, __nv_bfloat16* __restrict__ out, long long n, int cols, float limit) { + glm_pdl::enter(); for (long long i = blockIdx.x * (long long)blockDim.x + threadIdx.x; i < n; i += (long long)gridDim.x * blockDim.x) { const int c = (int)(i % cols); const float gv = bf(tobf(g[i] + (gb ? bf(gb[c]) : 0.f))); @@ -154,6 +163,7 @@ extern "C" __global__ void glm_vis_swiglu(const float* __restrict__ g, const flo extern "C" __global__ void glm_vis_ln_gelu(const float* __restrict__ acc, const __nv_bfloat16* __restrict__ w, const __nv_bfloat16* __restrict__ b, __nv_bfloat16* __restrict__ y, int cols, float eps) { + glm_pdl::enter(); const float* row = acc + (long long)blockIdx.x * cols; float s = 0.f; for (int c = threadIdx.x; c < cols; c += blockDim.x) s += bf(tobf(row[c])); @@ -173,6 +183,7 @@ extern "C" __global__ void glm_vis_ln_gelu(const float* __restrict__ acc, const // Placeholder rows take the tower's rows in every stream: row r takes feature row map[r] (map[r] < 0: kept). extern "C" __global__ void glm_vis_inject(const __nv_bfloat16* __restrict__ feats, __nv_bfloat16* __restrict__ out, const int* __restrict__ map, int rows, int d, int copies) { + glm_pdl::enter(); const int r = blockIdx.x; if (r >= rows || map[r] < 0) return; const __nv_bfloat16* src = feats + (long long)map[r] * d; diff --git a/zig/kernels/cuda/muse_spark/attention.cu b/zig/kernels/cuda/muse_spark/attention.cu new file mode 100644 index 00000000000..3acc5dbc0bd --- /dev/null +++ b/zig/kernels/cuda/muse_spark/attention.cu @@ -0,0 +1,184 @@ +// Muse Spark's decode attention, head_dim 64, GQA 8:1: QK prep and cache write, chunked rows, merge and gate. + +#include +#include +#include + +namespace { + +__device__ __forceinline__ float warp_sum(float v) { +#pragma unroll + for (int o = 16; o > 0; o >>= 1) v += __shfl_xor_sync(0xffffffffu, v, o); + return v; +} +__device__ __forceinline__ float warp_max(float v) { +#pragma unroll + for (int o = 16; o > 0; o >>= 1) v = fmaxf(v, __shfl_xor_sync(0xffffffffu, v, o)); + return v; +} + +constexpr int HD = 64; // head dim +constexpr int G = 8; // query heads a KV head +constexpr int TILE = 32; // keys a tile +constexpr int KP = 33; // K tile row stride in 32-bit words (64 halves + 2): conflict-free row-per-lane reads + +} // namespace + +// Grid (rows, H + HK), a warp a head (q heads, then KV heads); cache row pos % LEN of [slots, LEN, HK, 64]. +extern "C" __global__ void muse_qk_prep(const __half* __restrict__ q, const __half* __restrict__ k, + const __half* __restrict__ v, const float* __restrict__ cos_t, + const float* __restrict__ sin_t, int rope, const int32_t* __restrict__ pos, + const int32_t* __restrict__ slot, __half* __restrict__ qo, + __half* __restrict__ kc, __half* __restrict__ vc, int LEN, int H, int HK, + float eps) { + const int r = blockIdx.x, h = blockIdx.y, lane = threadIdx.x; + const bool is_q = h < H; + const int kh = h - H; + const __half* src = is_q ? q + ((int64_t)r * H + h) * HD : k + ((int64_t)r * HK + kh) * HD; + const float x0 = __half2float(src[lane]), x1 = __half2float(src[lane + 32]); + const float rs = rsqrtf(warp_sum(x0 * x0 + x1 * x1) / (float)HD + eps); + float a = x0 * rs, b = x1 * rs; + const int p = pos[r]; + if (rope) { + const float c = cos_t[(int64_t)p * 32 + lane], s = sin_t[(int64_t)p * 32 + lane]; + const float a2 = a * c - b * s, b2 = b * c + a * s; + a = a2; + b = b2; + } + if (is_q) { + __half* o = qo + ((int64_t)r * H + h) * HD; + o[lane] = __float2half_rn(a); + o[lane + 32] = __float2half_rn(b); + return; + } + const int64_t at = (((int64_t)slot[r] * LEN + p % LEN) * HK + kh) * HD; + kc[at + lane] = __float2half_rn(a); + kc[at + lane + 32] = __float2half_rn(b); + const __half* vs = v + ((int64_t)r * HK + kh) * HD; + vc[at + lane] = vs[lane]; + vc[at + lane + 32] = vs[lane + 32]; +} + +// A full layer's chunk keys for a row at p: 256 up to a 16K bucket, then bucket / 64 rounded up to 256. +__device__ __forceinline__ int muse_chunk_keys(int p, int full) { + int b = 4096; + while (b < p + 1) b <<= 1; + b = min(full, b); + return max(256, ((b + 63) / 64 + 255) / 256 * 256); +} + +// Grid (rows, HK, NCH): keys [max(0, pos - win), pos] in chunks of ck (CK <= 0: each row's own width). +extern "C" __global__ void __launch_bounds__(256) + muse_attn_rows(const __half* __restrict__ qo, const __half* __restrict__ kc, const __half* __restrict__ vc, + const int32_t* __restrict__ pos, const int32_t* __restrict__ slot, float* __restrict__ po, + float* __restrict__ pm, float* __restrict__ pl, int LEN, int NCH, int CK, int win, int H, int HK, + float scale) { + __shared__ uint32_t ks[TILE * KP]; + __shared__ __half2 vs[TILE * 32]; + __shared__ float qs[G][HD]; + const int r = blockIdx.x, kvh = blockIdx.y, c = blockIdx.z; + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int h = kvh * G + warp; + const int p = pos[r]; + const int lo = win > 0 ? max(0, p - win) : 0; + const int ck = CK > 0 ? CK : muse_chunk_keys(p, -CK); + const int start = lo + c * ck; + const int end = min(start + ck, p + 1); + const int64_t out = ((int64_t)r * H + h) * NCH + c; + if (start >= end) { + if (lane == 0) { + pm[out] = -CUDART_INF_F; + pl[out] = 0.f; + } + po[out * HD + lane] = 0.f; + po[out * HD + lane + 32] = 0.f; + return; + } + { + const __half* qr = qo + ((int64_t)r * H + h) * HD; + qs[warp][lane] = __half2float(qr[lane]) * scale; + qs[warp][lane + 32] = __half2float(qr[lane + 32]) * scale; + } + const int64_t base = (int64_t)slot[r] * LEN; + float m = -CUDART_INF_F, l = 0.f, o0 = 0.f, o1 = 0.f; + for (int t0 = start; t0 < end; t0 += TILE) { + __syncthreads(); + { + const int row = threadIdx.x >> 3, part = threadIdx.x & 7; // a key row is 8 x 16 bytes + if (t0 + row < end) { + const int64_t at = ((base + (t0 + row) % LEN) * HK + kvh) * HD + part * 8; + const uint4 kk = *(const uint4*)(kc + at), vv = *(const uint4*)(vc + at); + uint32_t* kd = ks + row * KP + part * 4; + kd[0] = kk.x; + kd[1] = kk.y; + kd[2] = kk.z; + kd[3] = kk.w; + *(uint4*)(vs + row * 32 + part * 4) = vv; + } + } + __syncthreads(); + const int nk = min(TILE, end - t0); + float s = -CUDART_INF_F; + if (lane < nk) { + float acc = 0.f; + const uint32_t* kr = ks + lane * KP; +#pragma unroll 8 + for (int w = 0; w < 32; ++w) { + const uint32_t u = kr[w]; + const float2 kf = __half22float2(*(const __half2*)&u); + acc += qs[warp][2 * w] * kf.x + qs[warp][2 * w + 1] * kf.y; + } + s = acc; + } + const float mt = warp_max(s); + const float mn = fmaxf(m, mt); + const float corr = expf(m - mn); // m = -inf on the first tile: 0 + const float pj = lane < nk ? expf(s - mn) : 0.f; + l = l * corr + warp_sum(pj); + o0 *= corr; + o1 *= corr; + for (int j = 0; j < nk; ++j) { + const float pb = __shfl_sync(0xffffffffu, pj, j); + const float2 vf = __half22float2(vs[j * 32 + lane]); + o0 += pb * vf.x; + o1 += pb * vf.y; + } + m = mn; + } + if (lane == 0) { + pm[out] = m; + pl[out] = l; + } + po[out * HD + 2 * lane] = o0; + po[out * HD + 2 * lane + 1] = o1; +} + +// Grid (rows, H / 8), a warp a head: merged chunks, o_norm, then o * sigmoid(g) (half on sliding layers). +extern "C" __global__ void muse_attn_merge(const float* __restrict__ po, const float* __restrict__ pm, + const float* __restrict__ pl, int NCH, const __half* __restrict__ g, + __half* __restrict__ out, int H, float eps, int gate_mode) { + const int r = blockIdx.x, h = blockIdx.y * 8 + (threadIdx.x >> 5), lane = threadIdx.x & 31; + const int64_t b = ((int64_t)r * H + h) * NCH; + float M = -CUDART_INF_F; + for (int c = 0; c < NCH; ++c) M = fmaxf(M, pm[b + c]); + float L = 0.f, o0 = 0.f, o1 = 0.f; + for (int c = 0; c < NCH; ++c) { + const float l = pl[b + c]; + if (l == 0.f) continue; + const float f = expf(pm[b + c] - M); + L += l * f; + o0 += po[(b + c) * HD + 2 * lane] * f; + o1 += po[(b + c) * HD + 2 * lane + 1] * f; + } + const float a0 = __half2float(__float2half_rn(o0 / L)), a1 = __half2float(__float2half_rn(o1 / L)); + const float rs = rsqrtf(warp_sum(a0 * a0 + a1 * a1) / (float)HD + eps); + const float n0 = __half2float(__float2half_rn(a0 * rs)), n1 = __half2float(__float2half_rn(a1 * rs)); + const int64_t at = ((int64_t)r * H + h) * HD + 2 * lane; + float s0 = 1.f / (1.f + expf(-__half2float(g[at]))), s1 = 1.f / (1.f + expf(-__half2float(g[at + 1]))); + if (gate_mode == 0) { + s0 = __half2float(__float2half_rn(s0)); + s1 = __half2float(__float2half_rn(s1)); + } + out[at] = __float2half_rn(n0 * s0); + out[at + 1] = __float2half_rn(n1 * s1); +} diff --git a/zig/kernels/cuda/muse_spark/dflash.cu b/zig/kernels/cuda/muse_spark/dflash.cu new file mode 100644 index 00000000000..3df257345fd --- /dev/null +++ b/zig/kernels/cuda/muse_spark/dflash.cu @@ -0,0 +1,158 @@ +// Muse Spark's DFlash2 drafter glue in fp32 (block embed, taps, q/k norm + RoPE, context rows, attention, argmax). + +#include +#include + +// x [S * B, D] fp32: row s * B = embed[tokens[s]] (bf16 -> fp32), rows s * B + 1 .. = mask_emb (fp32) +extern "C" __global__ void dr_block_embed(const uint16_t* __restrict__ embed, const float* __restrict__ mask_emb, + const int64_t* __restrict__ tokens, float* __restrict__ x, int B, int D) { + const int r = blockIdx.x, s = r / B, b = r % B; + const uint16_t* row = embed + tokens[s] * (int64_t)D; + for (int d = threadIdx.x; d < D; d += blockDim.x) + x[(int64_t)r * D + d] = b == 0 ? __uint_as_float(((uint32_t)row[d]) << 16) : mask_emb[d]; +} + +// res fp32 [n, D] -> taps fp16 [n, NT * D] column block j (torch.cat(taps, -1).to(fp16)) +extern "C" __global__ void dr_tap(const float* __restrict__ res, __half* __restrict__ taps, int D, int NT, int j) { + const int r = blockIdx.x; + for (int d = threadIdx.x; d < D; d += blockDim.x) + taps[((int64_t)r * NT + j) * D + d] = __float2half_rn(res[(int64_t)r * D + d]); +} + +// _head_rms then _rope: a block per (row, head), 128 threads (head_dim 128). x = in.float(); y = x * rsqrt(mean(x^2) + + +// eps) * w; the first ROT dims rotate NEOX-style with cos / sin at the row's position. Out: fp32 [n, NH, 128] when + +// out32, else fp16 into the cache at (slot, pos % ring). +extern "C" __global__ void dr_norm_rope(const __half* __restrict__ in, const float* __restrict__ w, + const float* __restrict__ cos_t, const float* __restrict__ sin_t, + const int32_t* __restrict__ pos, const int32_t* __restrict__ slot, + float* __restrict__ out32, __half* __restrict__ cache, int NH, int ROT, + int ring, float eps) { + __shared__ float y[128]; + __shared__ float part[4]; + const int r = blockIdx.x, h = blockIdx.y, d = threadIdx.x; + const float x = __half2float(in[((int64_t)r * NH + h) * 128 + d]); + float sq = x * x; + for (int o = 16; o > 0; o >>= 1) sq += __shfl_xor_sync(0xffffffff, sq, o); + if ((d & 31) == 0) part[d >> 5] = sq; + __syncthreads(); + const float mean = (part[0] + part[1] + part[2] + part[3]) / 128.0f; + y[d] = x * rsqrtf(mean + eps) * w[d]; + __syncthreads(); + const int half = ROT / 2; + const int p = pos[r]; + float v = y[d]; + if (d < ROT) { + const int j = d % half; + const float c = cos_t[(int64_t)p * half + j], s = sin_t[(int64_t)p * half + j]; + v = d < half ? y[d] * c - y[d + half] * s : y[d] * c + y[d - half] * s; + } + if (out32) out32[((int64_t)r * NH + h) * 128 + d] = v; + else cache[(((int64_t)slot[r] * ring + p % ring) * NH + h) * 128 + d] = __float2half_rn(v); +} + +// v rows fp16 [n, NH * 128] into the cache at (slot, pos % ring) +extern "C" __global__ void dr_store(const __half* __restrict__ in, const int32_t* __restrict__ pos, + const int32_t* __restrict__ slot, __half* __restrict__ cache, int NH, int ring) { + const int r = blockIdx.x; + const int64_t at = ((int64_t)slot[r] * ring + pos[r] % ring) * NH * 128; + for (int i = threadIdx.x; i < NH * 128; i += blockDim.x) cache[at + i] = in[(int64_t)r * NH * 128 + i]; +} + +// Draft attention: a block per (row r = s * B + b, KV head), one warp per query head of the group (H / KV, <= 8). Keys + +// pos0[s] - (W - 1) + t, t < W - 1 + B, visible when >= 0 and > the query's position - W (and within the block: all + +// are); scores q.K * scale; the head's sink logit as one more column; softmax; out fp16 [S * B, H * 128] = (p @ + +// V).to(fp16). Keys and values come through shared memory 32 at a time, read once for the group's heads; the softmax + +// runs online (max / sum rescaled per tile), so its rounding differs from torch's two-pass softmax. +#define DR_TILE 32 +extern "C" __global__ void __launch_bounds__(256) dr_attn(const float* __restrict__ q, const __half* __restrict__ kc, + const __half* __restrict__ vc, const float* __restrict__ sinks, + const int32_t* __restrict__ pos0, const int32_t* __restrict__ slot, + __half* __restrict__ out, int B, int W, int ring, int H, int KV, float scale) { + __shared__ float qs[8][128]; + __shared__ __half ks[DR_TILE][130]; // padded rows: lane j reads row j, conflict-free + __shared__ __half vs[DR_TILE][128]; + const int r = blockIdx.x, kvh = blockIdx.y, s = r / B, b = r % B; + const int G = H / KV, warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int span = W - 1 + B; + const int p0 = pos0[s], qpos = p0 + b; + const int64_t base = (int64_t)slot[s] * ring; + const int h = kvh * G + warp; + const bool active = warp < G; + for (int i = threadIdx.x; i < G * 128; i += blockDim.x) qs[i / 128][i % 128] = q[((int64_t)r * H + kvh * G + i / 128) * 128 + i % 128]; + float m = -INFINITY, l = 0.0f; + float o[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + // the first key any query of this row sees: past kp < 0 and past qpos - W + int t_first = (W - 1) - p0; // kp >= 0 + if (t_first < 0) t_first = 0; + const int t_vis = qpos - W + 1 - (p0 - (W - 1)); // kp > qpos - W + if (t_vis > t_first) t_first = t_vis; + for (int t0 = t_first - (t_first % DR_TILE); t0 < span; t0 += DR_TILE) { + __syncthreads(); + for (int i = threadIdx.x; i < DR_TILE * 64; i += blockDim.x) { // 64 half2 a row + const int j = i / 64, d2 = i % 64; + const int kp = p0 - (W - 1) + t0 + j; + __half2 kv = __float2half2_rn(0.0f), vv = __float2half2_rn(0.0f); + if (t0 + j < span && kp >= 0) { + const int64_t at = ((base + kp % ring) * KV + kvh) * 128 + 2 * d2; + kv = *reinterpret_cast(kc + at); + vv = *reinterpret_cast(vc + at); + } + ks[j][2 * d2] = __low2half(kv); + ks[j][2 * d2 + 1] = __high2half(kv); + *reinterpret_cast<__half2*>(&vs[j][2 * d2]) = vv; + } + __syncthreads(); + if (!active) continue; + const int t = t0 + lane; + const int kp = p0 - (W - 1) + t; + float sc = -INFINITY; + if (t < span && kp >= 0 && kp > qpos - W) { + float acc = 0.0f; +#pragma unroll 8 + for (int d = 0; d < 128; ++d) acc += qs[warp][d] * __half2float(ks[lane][d]); + sc = acc * scale; + } + float tm = sc; + for (int k = 16; k > 0; k >>= 1) tm = fmaxf(tm, __shfl_xor_sync(0xffffffff, tm, k)); + if (tm == -INFINITY) continue; // nothing visible in this tile for this query + const float mn = fmaxf(m, tm); + const float corr = m == -INFINITY ? 0.0f : expf(m - mn); + const float p = sc == -INFINITY ? 0.0f : expf(sc - mn); + float ps = p; + for (int k = 16; k > 0; k >>= 1) ps += __shfl_xor_sync(0xffffffff, ps, k); + l = l * corr + ps; +#pragma unroll + for (int e = 0; e < 4; ++e) o[e] *= corr; + for (int j = 0; j < DR_TILE; ++j) { + const float pj = __shfl_sync(0xffffffff, p, j); + if (pj != 0.0f) { +#pragma unroll + for (int e = 0; e < 4; ++e) o[e] += pj * __half2float(vs[j][lane * 4 + e]); + } + } + m = mn; + } + if (!active) return; + if (sinks) { + const float sk = sinks[h]; + const float mn = fmaxf(m, sk); + const float corr = m == -INFINITY ? 0.0f : expf(m - mn); + l = l * corr + expf(sk - mn); +#pragma unroll + for (int e = 0; e < 4; ++e) o[e] *= corr; + } +#pragma unroll + for (int e = 0; e < 4; ++e) out[((int64_t)r * H + h) * 128 + lane * 4 + e] = __float2half_rn(o[e] / l); +} + +// rows s * B + 1 .. s * B + B - 1 of x fp16 [S * B, D] -> [S * (B - 1), D] +extern "C" __global__ void dr_take(const __half* __restrict__ x, __half* __restrict__ out, int B, int D) { + const int r = blockIdx.x, s = r / (B - 1), b = r % (B - 1) + 1; + for (int d = threadIdx.x; d < D; d += blockDim.x) out[(int64_t)r * D + d] = x[((int64_t)s * B + b) * D + d]; +} diff --git a/zig/kernels/cuda/muse_spark/dflash2.cu b/zig/kernels/cuda/muse_spark/dflash2.cu new file mode 100644 index 00000000000..be9a2edb6b8 --- /dev/null +++ b/zig/kernels/cuda/muse_spark/dflash2.cu @@ -0,0 +1,202 @@ +// Muse Spark's DFlash2 drafter ops past dflash.cu's: dense rows, causal convs, SiLU-mul, top 16, selector walk. + +#include +#include +#include + +namespace { + +__device__ __forceinline__ float warp_sum(float v) { +#pragma unroll + for (int o = 16; o > 0; o >>= 1) v += __shfl_xor_sync(0xffffffffu, v, o); + return v; +} + +__device__ __forceinline__ float w16(const uint16_t* p, int64_t i, int bf16) { + const uint16_t b = p[i]; + return bf16 ? __uint_as_float(((uint32_t)b) << 16) : __half2float(__ushort_as_half(b)); +} + +constexpr int TOPK = 16; + +// a beats b: the larger value, ties to the lower id +__device__ __forceinline__ bool beats(float va, int ia, float vb, int ib) { return va > vb || (va == vb && ia < ib); } + +} // namespace + +// out[r, j] = sum_k x[r, k] * W[j, k] (W fp16 or bf16 [N, K]); grid (N / 8, n / 8), a warp an output. +extern "C" __global__ void dfl_dense(const __half* __restrict__ x, const uint16_t* __restrict__ W, int w_bf16, + void* __restrict__ out, int out_f32, int n, int K, int N) { + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int j = blockIdx.x * 8 + warp, r0 = blockIdx.y * 8; + if (j >= N) return; + float acc[8]; +#pragma unroll + for (int i = 0; i < 8; ++i) acc[i] = 0.f; + for (int k = lane; k < K; k += 32) { + const float w = w16(W, (int64_t)j * K + k, w_bf16); +#pragma unroll + for (int i = 0; i < 8; ++i) + if (r0 + i < n) acc[i] += w * __half2float(x[(int64_t)(r0 + i) * K + k]); + } +#pragma unroll + for (int i = 0; i < 8; ++i) { + const float s = warp_sum(acc[i]); + if (lane == 0 && r0 + i < n) { + if (out_f32) ((float*)out)[(int64_t)(r0 + i) * N + j] = s; + else ((__half*)out)[(int64_t)(r0 + i) * N + j] = __float2half_rn(s); + } + } +} + +// GroupedDynamicCausalConv.prepare: out[r, c] = fp16(sum_t (base[t, c] + dyn[r, 0, t, c / gs]) * h[r - t, c]). +extern "C" __global__ void dfl_conv_prep(const __half* __restrict__ h, const __half* __restrict__ dyn, + const float* __restrict__ base, __half* __restrict__ out, int B, int D, int KT, + int gs) { + const int r = blockIdx.x, b = r % B, G = D / gs; + const __half* dr = dyn + (int64_t)r * 2 * KT * G; + for (int c = threadIdx.x; c < D; c += blockDim.x) { + float acc = 0.f; + for (int t = 0; t < KT && t <= b; ++t) { + const float w = base[t * D + c] + __half2float(dr[t * G + c / gs]); + acc += w * __half2float(h[(int64_t)(r - t) * D + c]); + } + out[(int64_t)r * D + c] = __float2half_rn(acc); + } +} + +// GroupedDynamicCausalConv.finish into the residual: res += sum_t (base1[t, c] + dyn[r, 1, t, ...]) * y[r - t]. +extern "C" __global__ void dfl_conv_finish(float* __restrict__ res, const float* __restrict__ y0, + const float* __restrict__ y1, const __half* __restrict__ dyn, + const float* __restrict__ base, int B, int D, int KT, int gs) { + const int r = blockIdx.x, b = r % B, G = D / gs; + const __half* dr = dyn + (int64_t)r * 2 * KT * G + KT * G; + for (int c = threadIdx.x; c < D; c += blockDim.x) { + float acc = 0.f; + for (int t = 0; t < KT && t <= b; ++t) { + const int64_t at = (int64_t)(r - t) * D + c; + const float y = y1 ? y0[at] + y1[at] : y0[at]; + acc += (base[t * D + c] + __half2float(dr[t * G + c / gs])) * y; + } + res[(int64_t)r * D + c] += acc; + } +} + +// out = fp16(silu(g) * u), n elements (GatedMLP's interm in fp16). +extern "C" __global__ void dfl_silu_mul(const __half* __restrict__ g, const __half* __restrict__ u, + __half* __restrict__ out, int64_t n) { + for (int64_t i = blockIdx.x * (int64_t)blockDim.x + threadIdx.x; i < n; i += (int64_t)gridDim.x * blockDim.x) { + const float x = __half2float(g[i]); + out[i] = __float2half_rn(x / (1.f + expf(-x)) * __half2float(u[i])); + } +} + +// A rank's top 16 of each head-slice row: out [n, 32] = 16 values descending, then their global ids as bits. +extern "C" __global__ void __launch_bounds__(256) dfl_topk(const float* __restrict__ head, int w, int valid, int lo, + float* __restrict__ out) { + __shared__ float hv[256]; + __shared__ int hi[256]; + __shared__ int ht[256]; + const int r = blockIdx.x, t = threadIdx.x; + float v[TOPK]; + int id[TOPK]; +#pragma unroll + for (int k = 0; k < TOPK; ++k) { + v[k] = -CUDART_INF_F; + id[k] = 0x7fffffff; + } + const float* row = head + (int64_t)r * w; + for (int c = t; c < valid; c += 256) { + const float x = row[c]; + const int g = lo + c; + if (x != x) continue; // a NaN logit is never a candidate + if (!beats(x, g, v[TOPK - 1], id[TOPK - 1])) continue; + int k = TOPK - 1; + while (k > 0 && beats(x, g, v[k - 1], id[k - 1])) { + v[k] = v[k - 1]; + id[k] = id[k - 1]; + --k; + } + v[k] = x; + id[k] = g; + } + int ptr = 0; + for (int pick = 0; pick < TOPK; ++pick) { + hv[t] = ptr < TOPK ? v[ptr] : -CUDART_INF_F; + hi[t] = ptr < TOPK ? id[ptr] : 0x7fffffff; + ht[t] = t; + __syncthreads(); + for (int o = 128; o > 0; o >>= 1) { + if (t < o && beats(hv[t + o], hi[t + o], hv[t], hi[t])) { + hv[t] = hv[t + o]; + hi[t] = hi[t + o]; + ht[t] = ht[t + o]; + } + __syncthreads(); + } + if (t == 0) { + out[(int64_t)r * 2 * TOPK + pick] = hv[0]; + out[(int64_t)r * 2 * TOPK + TOPK + pick] = __int_as_float(hi[0]); + } + const int won = ht[0]; + __syncthreads(); + if (t == won) ++ptr; + } +} + +// CandidateSelector.select, greedy: a block a stream over the ranks' merged top 16s; the first maximum wins. +extern "C" __global__ void __launch_bounds__(512) dfl_walk(const float* __restrict__ recv, int W, int n1, + const __half* __restrict__ gate, int R, + const uint16_t* __restrict__ pcb, + const uint16_t* __restrict__ scb, int cb_bf16, + const int64_t* __restrict__ anchors, int P, + int32_t* __restrict__ out) { + __shared__ float cv[TOPK]; + __shared__ int cid[TOPK]; + __shared__ float sc[TOPK]; + __shared__ int pred; + const int s = blockIdx.x, warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + if (threadIdx.x == 0) pred = (int)anchors[s]; + for (int i = 0; i < P; ++i) { + const int row = s * P + i; + if (threadIdx.x == 0) { + float av[64]; + int ai[64]; + const int m = W * TOPK; + for (int q = 0; q < W; ++q) + for (int j = 0; j < TOPK; ++j) { + const float* src = recv + ((int64_t)q * n1 + row) * 2 * TOPK; + av[q * TOPK + j] = src[j]; + ai[q * TOPK + j] = __float_as_int(src[TOPK + j]); + } + for (int k = 0; k < TOPK; ++k) { + int best = -1; + for (int j = 0; j < m; ++j) + if (ai[j] >= 0 && ai[j] != 0x7fffffff && (best < 0 || beats(av[j], ai[j], av[best], ai[best]))) + best = j; + cv[k] = best < 0 ? -CUDART_INF_F : av[best]; // no valid id left (non-finite rows): no candidate + cid[k] = best < 0 ? -1 : ai[best]; + if (best >= 0) ai[best] = -1; + } + } + __syncthreads(); + if (warp < TOPK) { + const int c = cid[warp], a = pred; + const __half* g = gate + (int64_t)row * R; + float acc = 0.f; + for (int k = lane; c >= 0 && k < R; k += 32) + acc += (w16(pcb, (int64_t)a * R + k, cb_bf16) * __half2float(g[k])) * w16(scb, (int64_t)c * R + k, cb_bf16); + acc = warp_sum(acc); + if (lane == 0) sc[warp] = c >= 0 ? cv[warp] + acc : -CUDART_INF_F; + } + __syncthreads(); + if (threadIdx.x == 0) { + int best = 0; + for (int k = 1; k < TOPK; ++k) + if (sc[k] > sc[best]) best = k; + if (cid[best] >= 0) pred = cid[best]; // else the previous token again (the target rejects it) + out[row] = pred; + } + __syncthreads(); + } +} diff --git a/zig/kernels/cuda/muse_spark/experts2.cu b/zig/kernels/cuda/muse_spark/experts2.cu new file mode 100644 index 00000000000..b90606daa14 --- /dev/null +++ b/zig/kernels/cuda/muse_spark/experts2.cu @@ -0,0 +1,145 @@ +// exl3_experts.cu's tf_exl3_grouped_2 with 32-member tiles: trellis words decoded once for two 16-member groups. + +#include +#include + +#include "../exl3_decode.cuh" + +namespace muse_x2 { + +using namespace tf_exl3; + +constexpr int NT = 8, W = 4; // the shared grouped kernel's tile: 8 n tiles a block, 4 warps + +__device__ __forceinline__ uint32_t pair(const half* x, bool ok) { return ok ? *reinterpret_cast(x) : 0u; } + +// One warp's k tiles [kt0, kt0 + nkt) for both groups: tf_exl3's warp_tiles, the second group's mma beside the first. +template +__device__ __forceinline__ void warp_tiles2(const uint32_t* T, int ntiles, int kt0, int nkt, int nt0, + const half* const (&x0)[2], const half* const (&x1)[2], + const bool (&ok0)[2], const bool (&ok1)[2], bool two, int lane, + float (&acc)[2][NT][2][4]) { + constexpr int TW = tile_words(), LW = lane_words(); + const size_t kstride = (size_t)ntiles * TW; + for (int i = 0; i < nkt; ++i) { + const uint32_t* t0 = T + (size_t)(kt0 + i) * kstride + (size_t)nt0 * TW; + uint32_t w[NT][LW]; +#pragma unroll + for (int j = 0; j < NT; ++j) ldg_lane_words(t0 + j * TW, lane, w[j]); + const int k = (kt0 + i) * 16; + uint32_t a[2][4]; +#pragma unroll + for (int q = 0; q < 2; ++q) { + a[q][0] = pair(x0[q] + k, ok0[q]); + a[q][1] = pair(x1[q] + k, ok1[q]); + a[q][2] = pair(x0[q] + k + 8, ok0[q]); + a[q][3] = pair(x1[q] + k + 8, ok1[q]); + } +#pragma unroll + for (int j = 0; j < NT; ++j) { + uint32_t b0[2], b1[2]; + decode_lane(w[j], lane, b0, b1); + mma16816(acc[0][j][0], a[0], b0); + mma16816(acc[0][j][1], a[0], b1); + if (two) { + mma16816(acc[1][j][0], a[1], b0); + mma16816(acc[1][j][1], a[1], b1); + } + } + } +} + +} // namespace muse_x2 + +// Grid (nexp_max, N / 128, mats * SK * MT2), MT2 = (maxm + 31) / 32; Z as tf_exl3_grouped_2 writes it. +extern "C" __global__ void __launch_bounds__(128) muse_grouped2( + const half* __restrict__ X0, const half* __restrict__ X1, const int64_t* __restrict__ TP0, + const int64_t* __restrict__ TP1, const int* __restrict__ K2_0, const int* __restrict__ K2_1, + const int* __restrict__ uids, const int* __restrict__ ucount, const int* __restrict__ members, + float* __restrict__ Z, int K, int N, int P, int SK, int maxm, int slots) { + using namespace muse_x2; + const int u = blockIdx.x; + if (u >= ucount[0]) return; + const int MT = (maxm + 31) / 32; + const int mtile = blockIdx.z % MT; + const int split = (blockIdx.z / MT) % SK; + const int mat = blockIdx.z / MT / SK; + const half* X = mat ? X1 : X0; + const int e = uids[u]; + const uint32_t* T = reinterpret_cast(mat ? TP1[e] : TP0[e]); + const int k2 = mat ? K2_1[e] : K2_0[e]; + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int g = lane >> 2, t = lane & 3; + + __shared__ int rows_sh[32]; + if (threadIdx.x < 32) { + const int m = mtile * 32 + threadIdx.x; + const int code = m < maxm ? members[u * maxm + m] : -1; + rows_sh[threadIdx.x] = code >= 0 ? (code >> 5) * slots + (code & 31) : -1; + } + __syncthreads(); + if (rows_sh[0] < 0) return; // members come first, so this tile is empty + const bool two = rows_sh[16] >= 0; + const half* x0[2]; + const half* x1[2]; + bool ok0[2], ok1[2]; +#pragma unroll + for (int q = 0; q < 2; ++q) { + const int r0 = rows_sh[16 * q + g], r1 = rows_sh[16 * q + g + 8]; + x0[q] = X + (size_t)(r0 < 0 ? 0 : r0) * K + 2 * t; + x1[q] = X + (size_t)(r1 < 0 ? 0 : r1) * K + 2 * t; + ok0[q] = r0 >= 0; + ok1[q] = r1 >= 0; + } + const int per_warp = (K >> 4) / SK / W; + const int kt0 = split * (per_warp * W) + warp * per_warp; + const int nt0 = blockIdx.y * NT; + + float acc[2][NT][2][4]; +#pragma unroll + for (int q = 0; q < 2; ++q) +#pragma unroll + for (int i = 0; i < NT; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) +#pragma unroll + for (int c = 0; c < 4; ++c) acc[q][i][h][c] = 0.f; + + switch (k2) { +#define MUSE_X2_CASE(K2_) \ + case K2_: warp_tiles2(T, N >> 4, kt0, per_warp, nt0, x0, x1, ok0, ok1, two, lane, acc); break; + MUSE_X2_CASE(2) MUSE_X2_CASE(3) MUSE_X2_CASE(4) MUSE_X2_CASE(5) MUSE_X2_CASE(6) MUSE_X2_CASE(7) + MUSE_X2_CASE(8) MUSE_X2_CASE(9) MUSE_X2_CASE(10) MUSE_X2_CASE(11) MUSE_X2_CASE(12) MUSE_X2_CASE(13) + MUSE_X2_CASE(14) MUSE_X2_CASE(15) MUSE_X2_CASE(16) +#undef MUSE_X2_CASE + default: __trap(); + } + + // each group's warps' sums through shared memory, added in warp order (tf_exl3_grouped_2's) + __shared__ __align__(16) float red[W][16][NT * 16]; +#pragma unroll + for (int q = 0; q < 2; ++q) { + if (q == 1 && !two) break; + if (q) __syncthreads(); +#pragma unroll + for (int i = 0; i < NT; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) { + const int col = i * 16 + h * 8 + 2 * t; + red[warp][g][col] = acc[q][i][h][0]; + red[warp][g][col + 1] = acc[q][i][h][1]; + red[warp][g + 8][col] = acc[q][i][h][2]; + red[warp][g + 8][col + 1] = acc[q][i][h][3]; + } + __syncthreads(); + for (int idx = threadIdx.x; idx < 16 * NT * 16; idx += W * 32) { + const int row = idx / (NT * 16), col = idx % (NT * 16); + const int r = rows_sh[16 * q + row]; + if (r < 0) continue; + float s = red[0][row][col]; +#pragma unroll + for (int w = 1; w < W; ++w) s += red[w][row][col]; + Z[(((size_t)mat * SK + split) * P + r) * N + nt0 * 16 + col] = s; + } + } +} diff --git a/zig/kernels/cuda/muse_spark/glue.cu b/zig/kernels/cuda/muse_spark/glue.cu new file mode 100644 index 00000000000..cca8b53a864 --- /dev/null +++ b/zig/kernels/cuda/muse_spark/glue.cu @@ -0,0 +1,398 @@ +// Muse Spark's glue (norms, gates, router, expert sums, head), exllamav3's roundings; built with the glue flags. + +#include +#include +#include +#include +#include + +namespace { + +constexpr int kMaxPer = 16; // values a thread holds: rows up to 1024 * 16 wide + +__device__ __forceinline__ float bf16r(float x) { return __bfloat162float(__float2bfloat16_rn(x)); } + +__device__ __forceinline__ float warp_sum(float v) { +#pragma unroll + for (int o = 16; o > 0; o >>= 1) v += __shfl_xor_sync(0xffffffffu, v, o); + return v; +} + +// Sum over the block (blockDim.x a multiple of 32, at most 1024); every thread gets the total. +__device__ float block_sum(float v) { + __shared__ float part[32]; + __shared__ float total; + const int lane = threadIdx.x & 31, warp = threadIdx.x >> 5, nw = blockDim.x >> 5; + v = warp_sum(v); + __syncthreads(); + if (lane == 0) part[warp] = v; + __syncthreads(); + if (warp == 0) { + float s = lane < nw ? part[lane] : 0.f; + s = warp_sum(s); + if (lane == 0) total = s; + } + __syncthreads(); + return total; +} + +#if __CUDA_ARCH__ >= 900 +// block_sum over a cluster of 8 blocks of 128: the same warp sums read back in warp order, block_sum's bits. +__device__ __forceinline__ float cluster_sum(float v, float* part) { + namespace cg = cooperative_groups; + cg::cluster_group cl = cg::this_cluster(); + const int lane = threadIdx.x & 31, warp = threadIdx.x >> 5; + v = warp_sum(v); + if (lane == 0) part[warp] = v; + cl.sync(); + const float* rp = cl.map_shared_rank(part, lane >> 2); + return warp_sum(rp[lane & 3]); +} +#endif + +} // namespace + +// Clusters exist from sm_90; on the release fatbins' sm_80/86 the cluster forms trap (Muse never launches them there). +#if __CUDA_ARCH__ >= 900 +#define MUSE_CLUSTER8 __cluster_dims__(8, 1, 1) +#else +#define MUSE_CLUSTER8 +#endif + +// x = rms(embed[ids].float()) (Embedding then the weightless embed_norm, fp32 out). A block a row. +extern "C" __global__ void muse_embed_norm(const uint16_t* __restrict__ table, const int64_t* __restrict__ ids, + float* __restrict__ out, int D, float eps) { + const int64_t r = blockIdx.x; + const uint16_t* row = table + ids[r] * (int64_t)D; + float v[kMaxPer]; + float ss = 0.f; + int n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + v[n] = __uint_as_float(((uint32_t)row[d]) << 16); + ss += v[n] * v[n]; + } + const float rs = rsqrtf(block_sum(ss) / (float)D + eps); + n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) out[r * D + d] = v[n] * rs; +} + +// out = half(x * rsqrt(mean(x^2) + eps) * w); parts P: x holds the ranks' gathered column slices. +extern "C" __global__ void muse_rms(const void* __restrict__ x, int x_half, const float* __restrict__ w, + __half* __restrict__ out, int D, float eps, int parts) { + const int64_t r = blockIdx.x, rows = gridDim.x; + float v[kMaxPer]; + float ss = 0.f; + int n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + const int64_t at = parts ? ((int64_t)(d / parts) * rows + r) * parts + d % parts : r * D + d; + v[n] = x_half ? __half2float(((const __half*)x)[at]) : ((const float*)x)[at]; + ss += v[n] * v[n]; + } + const float rs = rsqrtf(block_sum(ss) / (float)D + eps); + n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + float y = v[n] * rs; + if (w) y = y * w[d]; + out[r * D + d] = __float2half_rn(y); + } +} + +// Sublayer end + next norm: res = res * alpha + rms(y) * beta; x = half(rms(res) * w_next), xf unrounded. +extern "C" __global__ void muse_gate_norm(float* __restrict__ res, const float* __restrict__ y, + const float* __restrict__ y2, const float* __restrict__ scale, + int round_bf16, float post_eps, const float* __restrict__ ab, + const float* __restrict__ w_next, float next_eps, __half* __restrict__ x, + float* __restrict__ xf, int D) { + const int64_t r = blockIdx.x; + float v[kMaxPer]; + float ss = 0.f; + int n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + float t = y[r * D + d]; + if (y2) t = t + y2[r * D + d]; + if (scale) { + t = t * scale[d]; + if (round_bf16) t = bf16r(t); + } + v[n] = t; + ss += t * t; + } + const float rs = rsqrtf(block_sum(ss) / (float)D + post_eps); + float ss2 = 0.f; + n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + const float yn = v[n] * rs; + const float h = res[r * D + d] * ab[d] + yn * ab[D + d]; + res[r * D + d] = h; + v[n] = h; + ss2 += h * h; + } + const float rs2 = rsqrtf(block_sum(ss2) / (float)D + next_eps); + n = 0; + for (int d = threadIdx.x; d < D; d += blockDim.x, ++n) { + const float o = v[n] * rs2 * w_next[d]; + x[r * D + d] = __float2half_rn(o); + if (xf) xf[r * D + d] = o; + } +} + +// muse_gate_norm on a cluster of 8 blocks of 128 threads a row: each thread's columns and sums, its bits. +extern "C" __global__ void MUSE_CLUSTER8 __launch_bounds__(128) + muse_gate_norm_c(float* __restrict__ res, const float* __restrict__ y, const float* __restrict__ y2, + const float* __restrict__ scale, int round_bf16, float post_eps, const float* __restrict__ ab, + const float* __restrict__ w_next, float next_eps, __half* __restrict__ x, + float* __restrict__ xf, int D) { +#if __CUDA_ARCH__ < 900 + __trap(); // no clusters before sm_90: the host never launches this +#else + __shared__ float part[2][4]; + const int64_t r = blockIdx.x >> 3; + const int t0 = cooperative_groups::this_cluster().block_rank() * 128 + threadIdx.x; + float v[kMaxPer]; + float ss = 0.f; + int n = 0; + for (int d = t0; d < D; d += 1024, ++n) { + float t = y[r * D + d]; + if (y2) t = t + y2[r * D + d]; + if (scale) { + t = t * scale[d]; + if (round_bf16) t = bf16r(t); + } + v[n] = t; + ss += t * t; + } + const float rs = rsqrtf(cluster_sum(ss, part[0]) / (float)D + post_eps); + float ss2 = 0.f; + n = 0; + for (int d = t0; d < D; d += 1024, ++n) { + const float yn = v[n] * rs; + const float h = res[r * D + d] * ab[d] + yn * ab[D + d]; + res[r * D + d] = h; + v[n] = h; + ss2 += h * h; + } + const float rs2 = rsqrtf(cluster_sum(ss2, part[1]) / (float)D + next_eps); + n = 0; + for (int d = t0; d < D; d += 1024, ++n) { + const float o = v[n] * rs2 * w_next[d]; + x[r * D + d] = __float2half_rn(o); + if (xf) xf[r * D + d] = o; + } + cooperative_groups::this_cluster().sync(); // no block leaves while another reads its partials +#endif +} + +// Router logits in fp32 (x . W[e], W bf16 or fp32): a warp an expert, a lane's columns d = lane + 32 j in order. +extern "C" __global__ void muse_router(const float* __restrict__ x, const void* __restrict__ W, int w_bf16, + float* __restrict__ out, int D, int E) { + const int r = blockIdx.y, warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int e = blockIdx.x * (blockDim.x >> 5) + warp; + if (e >= E) return; + const float* xr = x + (int64_t)r * D; + float acc = 0.f; + if (w_bf16) { + const uint16_t* wr = (const uint16_t*)W + (int64_t)e * D; + int d = lane; + for (; d + 224 < D; d += 256) { + uint16_t wv[8]; + float xv[8]; +#pragma unroll + for (int j = 0; j < 8; ++j) { + wv[j] = __ldg(wr + d + 32 * j); + xv[j] = xr[d + 32 * j]; + } +#pragma unroll + for (int j = 0; j < 8; ++j) acc += xv[j] * __uint_as_float(((uint32_t)wv[j]) << 16); + } + for (; d < D; d += 32) acc += xr[d] * __uint_as_float(((uint32_t)wr[d]) << 16); + } else { + const float* wr = (const float*)W + (int64_t)e * D; + for (int d = lane; d < D; d += 32) acc += xr[d] * wr[d]; + } + acc = warp_sum(acc); + if (lane == 0) out[(int64_t)r * E + e] = acc; +} + +// s = sigmoid(logits * mult), top K of s + bias, weights s / (sum + 1e-15) * scale, picks in expert-id order. +extern "C" __global__ void muse_topk(const float* __restrict__ logits, const float* __restrict__ bias, int E, int K, + float mult, float scale, int32_t* __restrict__ pick, float* __restrict__ wts) { + __shared__ float bv[1024]; + __shared__ int bi[1024]; + __shared__ int sel[32]; + __shared__ float sc[1024]; + const int r = blockIdx.x, t = threadIdx.x; + float c = -CUDART_INF_F; + if (t < E) { + const float s = 1.f / (1.f + expf(-(logits[(int64_t)r * E + t] * mult))); + sc[t] = s; + c = s + bias[t]; + } + for (int k = 0; k < K; ++k) { + bv[t] = c; + bi[t] = t; + __syncthreads(); + for (int o = blockDim.x >> 1; o > 0; o >>= 1) { + if (t < o) { + const float v = bv[t + o]; + const int i = bi[t + o]; + if (v > bv[t] || (v == bv[t] && i < bi[t])) { + bv[t] = v; + bi[t] = i; + } + } + __syncthreads(); + } + if (t == 0) sel[k] = bi[0]; + __syncthreads(); + if (t == sel[k]) c = -CUDART_INF_F; + __syncthreads(); + } + if (t == 0) { + float sum = 0.f; + for (int k = 0; k < K; ++k) sum += sc[sel[k]]; + const float den = sum + 1e-15f; + int ord[32]; + for (int k = 0; k < K; ++k) ord[k] = sel[k]; + for (int i = 1; i < K; ++i) { + const int v = ord[i]; + int j = i - 1; + while (j >= 0 && ord[j] > v) { + ord[j + 1] = ord[j]; + --j; + } + ord[j + 1] = v; + } + for (int k = 0; k < K; ++k) { + pick[r * K + k] = ord[k]; + wts[r * K + k] = (sc[ord[k]] / den) * scale; + } + } +} + +// Routed sum: per slot norm(bf16(y * (1 + w))) * weight, added in slot order; out = half(acc) columns. +extern "C" __global__ void muse_expert_sum(const float* __restrict__ y, const float* __restrict__ y2, + const float* __restrict__ wts, const float* __restrict__ scale, float eps, + __half* __restrict__ out, int L, int K, int out_lo, int out_w) { + const int64_t r = blockIdx.x; + float acc[kMaxPer]; + float v[kMaxPer]; + int n = 0; + for (int d = threadIdx.x; d < L; d += blockDim.x, ++n) acc[n] = 0.f; + for (int k = 0; k < K; ++k) { + const int64_t p = r * K + k; + float ss = 0.f; + n = 0; + for (int d = threadIdx.x; d < L; d += blockDim.x, ++n) { + float t = y[p * L + d]; + if (y2) t = t + y2[p * L + d]; + t = bf16r(t * scale[d]); + v[n] = t; + ss += t * t; + } + const float rs = rsqrtf(block_sum(ss) / (float)L + eps); + const float wk = wts[p]; + n = 0; + for (int d = threadIdx.x; d < L; d += blockDim.x, ++n) acc[n] = acc[n] + (v[n] * rs) * wk; + } + n = 0; + for (int d = threadIdx.x; d < L; d += blockDim.x, ++n) + if (d >= out_lo && d < out_lo + out_w) out[r * out_w + d - out_lo] = __float2half_rn(acc[n]); +} + +// muse_expert_sum on a cluster of 8 blocks of 128 threads a row, its bits (as muse_gate_norm_c); K <= 16. +extern "C" __global__ void MUSE_CLUSTER8 __launch_bounds__(128) + muse_expert_sum_c(const float* __restrict__ y, const float* __restrict__ y2, const float* __restrict__ wts, + const float* __restrict__ scale, float eps, __half* __restrict__ out, int L, int K, int out_lo, + int out_w) { +#if __CUDA_ARCH__ < 900 + __trap(); // no clusters before sm_90: the host never launches this +#else + __shared__ float part[16][4]; + const int64_t r = blockIdx.x >> 3; + const int t0 = cooperative_groups::this_cluster().block_rank() * 128 + threadIdx.x; + float acc[kMaxPer]; + float v[kMaxPer]; + int n = 0; + for (int d = t0; d < L; d += 1024, ++n) acc[n] = 0.f; + for (int k = 0; k < K; ++k) { + const int64_t p = r * K + k; + float ss = 0.f; + n = 0; + for (int d = t0; d < L; d += 1024, ++n) { + float t = y[p * L + d]; + if (y2) t = t + y2[p * L + d]; + t = bf16r(t * scale[d]); + v[n] = t; + ss += t * t; + } + const float rs = rsqrtf(cluster_sum(ss, part[k]) / (float)L + eps); + const float wk = wts[p]; + n = 0; + for (int d = t0; d < L; d += 1024, ++n) acc[n] = acc[n] + (v[n] * rs) * wk; + } + n = 0; + for (int d = t0; d < L; d += 1024, ++n) + if (d >= out_lo && d < out_lo + out_w) out[r * out_w + d - out_lo] = __float2half_rn(acc[n]); + cooperative_groups::this_cluster().sync(); +#endif +} + +// The head: x = x * mult, then cap * tanh(x / cap) when cap > 0 (Linear pre_scale, ext.softcap), in place. +extern "C" __global__ void muse_softcap(float* __restrict__ x, int64_t n, float mult, float cap) { + for (int64_t i = blockIdx.x * (int64_t)blockDim.x + threadIdx.x; i < n; i += (int64_t)gridDim.x * blockDim.x) { + float v = x[i] * mult; + if (cap > 0.f) v = tanhf(v / cap) * cap; + x[i] = v; + } +} + +// Argmax over the first `vocab` columns of both ranks' gathered head slices: the first maximum, NaN counts. +extern "C" __global__ void muse_argmax(const float* __restrict__ recv, int32_t* __restrict__ out, int w0, int w1, + int64_t part, int vocab) { + __shared__ float bv[256]; + __shared__ int bi[256]; + const int r = blockIdx.x, tid = threadIdx.x; + float best = -CUDART_INF_F; + int idx = 0x7fffffff; + for (int c = tid; c < vocab; c += 256) { + const float v = c < w0 ? recv[(int64_t)r * w0 + c] : recv[part + (int64_t)r * w1 + (c - w0)]; + const bool nan_v = v != v, nan_b = best != best; + if (idx == 0x7fffffff || (nan_v && !nan_b) || (!nan_b && v > best)) { + best = v; + idx = c; + } + } + bv[tid] = best; + bi[tid] = idx; + __syncthreads(); + for (int o = 128; o > 0; o >>= 1) { + if (tid < o) { + const float v = bv[tid + o], b = bv[tid]; + const int i = bi[tid + o]; + const bool nv = v != v, nb = b != b; + const bool take = i != 0x7fffffff && (bi[tid] == 0x7fffffff || (nv && !nb) || + (nv == nb && (nv ? i < bi[tid] : (v > b || (v == b && i < bi[tid]))))); + if (take) { + bv[tid] = v; + bi[tid] = i; + } + } + __syncthreads(); + } + if (tid == 0) out[r] = bi[0]; +} + +// RoPE tables (NeoX, full head): cos / sin [context, dim / 2] of p * theta ** (-2j / dim), in fp64 then fp32. +extern "C" __global__ void muse_rope_tables(float* __restrict__ cos_out, float* __restrict__ sin_out, int context, + double theta, int dim) { + const int half = dim / 2; + const int64_t n = (int64_t)context * half; + for (int64_t i = blockIdx.x * (int64_t)blockDim.x + threadIdx.x; i < n; i += (int64_t)gridDim.x * blockDim.x) { + const int j = (int)(i % half); + const int64_t p = i / half; + const double inv = 1.0 / pow(theta, (double)(2 * j) / (double)dim); + const double ang = (double)p * inv; + cos_out[i] = __double2float_rn(cos(ang)); + sin_out[i] = __double2float_rn(sin(ang)); + } +} diff --git a/zig/kernels/cuda/muse_spark/linear_multi.cu b/zig/kernels/cuda/muse_spark/linear_multi.cu new file mode 100644 index 00000000000..e9a12ada2dc --- /dev/null +++ b/zig/kernels/cuda/muse_spark/linear_multi.cu @@ -0,0 +1,423 @@ +// Muse Spark's EXL3 launch forms on exl3_decode.cuh: q/k/v/gate in one launch and 32-row passes, exl3_linear.cu's bits. + +#include +#include +#include + +#include "../exl3_decode.cuh" + +namespace muse_linear { + +using namespace tf_exl3; + +enum DType : int { F16 = 0, BF16 = 1, F32 = 2 }; + +__device__ __forceinline__ void load4(const void* p, int dtype, size_t i, float (&v)[4]) { + if (dtype == F32) { + const float4 u = *reinterpret_cast(static_cast(p) + i); + v[0] = u.x; v[1] = u.y; v[2] = u.z; v[3] = u.w; + } else { + const uint2 u = *reinterpret_cast(static_cast(p) + i); + const float2 a = __half22float2(*reinterpret_cast(&u.x)); + const float2 b = __half22float2(*reinterpret_cast(&u.y)); + v[0] = a.x; v[1] = a.y; v[2] = b.x; v[3] = b.y; + } +} + +__device__ __forceinline__ void store4(void* p, int dtype, size_t i, const float (&v)[4]) { + if (dtype == F32) { + *reinterpret_cast(static_cast(p) + i) = make_float4(v[0], v[1], v[2], v[3]); + } else { + half2 a = __floats2half2_rn(v[0], v[1]), b = __floats2half2_rn(v[2], v[3]); + uint2 u; + u.x = *reinterpret_cast(&a); + u.y = *reinterpret_cast(&b); + *reinterpret_cast(static_cast(p) + i) = u; + } +} + +// exl3_linear.cu's finish: H / sqrt(128), * svh, + bias. +__device__ __forceinline__ void finish(float (&v)[4], int lane, const half* svh, const half* bias, int col) { + fwht128(v, lane); +#pragma unroll + for (int j = 0; j < 4; ++j) { + v[j] = v[j] * HAD_SCALE * __half2float(__ldg(svh + col + j)); + const half bv = __ldg((bias ? bias : svh) + col + j); + if (bias) v[j] += __half2float(bv); + } +} + +// exl3_linear.cu's k step loads: 8 tiles back to back, each lane the same slice of every tile. +template +__device__ __forceinline__ void load_step(const uint32_t* step, int lane, uint32_t (&raw)[8 * lane_words()]) { + constexpr int TW = tile_words(), LW = lane_words(); + int word, offset; + lane_start(lane, word, offset); +#pragma unroll + for (int j = 0; j < 8; ++j) +#pragma unroll + for (int q = 0; q < LW; ++q) raw[j * LW + q] = __ldg(step + j * TW + (word + q) % TW); +} + +template +__device__ __forceinline__ void step_lane_words(const uint32_t (&raw)[8 * lane_words()], int j, + uint32_t (&w)[lane_words()]) { +#pragma unroll + for (int q = 0; q < lane_words(); ++q) w[q] = raw[j * lane_words() + q]; +} + +template +__device__ __forceinline__ void linear_body( + const half* __restrict__ xh, const uint32_t* __restrict__ T, long long stride_k, long long stride_nb, + const half* __restrict__ svh, const half* __restrict__ bias, void* __restrict__ y, int y_dtype, + float* __restrict__ Z, int* __restrict__ counters, int M, int K, int N, int SK, const int nb, const int split, + const int NB) { + constexpr int TW = tile_words(); + constexpr int LW = lane_words(); + extern __shared__ __align__(16) float red[]; // WK * RH * 128 floats + __shared__ int last; + const int RH = min(M, 8); // rows of red a warp + + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int g = lane >> 2, t = lane & 3; + const int per_warp = (K >> 4) / SK / WK; + const int kt0 = split * (per_warp * WK) + warp * per_warp; + const uint32_t* tiles = T + nb * stride_nb; + const int col0 = nb * 128; + + for (int m0 = 0, pass = 0; m0 < M; m0 += 16, ++pass) { + const int R = min(16, M - m0); + + float acc[8][2][4]; +#pragma unroll + for (int i = 0; i < 8; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) +#pragma unroll + for (int c = 0; c < 4; ++c) acc[i][h][c] = 0.f; + + // the walk's rows for the mma, clamped so rows past the pass read inside the buffer (their outputs are dropped) + const int r0 = m0 + (g < R ? g : R - 1), r1 = m0 + (g + 8 < R ? g + 8 : R - 1); + const half* x0 = xh + (size_t)r0 * K; + const half* x1 = xh + (size_t)r1 * K; + const uint32_t* tile = tiles + (size_t)kt0 * stride_k; + // up to 6 bits the next k step's words are loaded while this one is decoded; 7 and 8 bits load per tile + constexpr bool PF = K2 <= 12; + constexpr int SR = 8 * LW; + uint32_t cur[PF ? SR : 1], nxt[PF ? SR : 1]; + if constexpr (PF) load_step(tile, lane, cur); +#pragma unroll 1 + for (int i = 0; i < per_warp; ++i) { + const int kt = kt0 + i; + uint32_t a[4]; + a[0] = __ldg(reinterpret_cast(x0 + kt * 16 + 2 * t)); + a[1] = __ldg(reinterpret_cast(x1 + kt * 16 + 2 * t)); + a[2] = __ldg(reinterpret_cast(x0 + kt * 16 + 2 * t + 8)); + a[3] = __ldg(reinterpret_cast(x1 + kt * 16 + 2 * t + 8)); + if constexpr (PF) { + if (i + 1 < per_warp) load_step(tile + (size_t)(i + 1) * stride_k, lane, nxt); + } +#pragma unroll + for (int j = 0; j < 8; ++j) { + uint32_t w[LW]; + if constexpr (PF) step_lane_words(cur, j, w); + else ldg_lane_words(tile + (size_t)i * stride_k + j * TW, lane, w); + uint32_t b0[2], b1[2]; + decode_lane(w, lane, b0, b1); + mma16816(acc[j][0], a, b0); + mma16816(acc[j][1], a, b1); + } + if constexpr (PF) { +#pragma unroll + for (int q = 0; q < SR; ++q) cur[q] = nxt[q]; + } + } + + // the warps' sums, added in warp order, rows 0-7 of the pass and then rows 8-15 + for (int rlo = 0; rlo < R; rlo += 8) { + const int rn = min(R - rlo, 8); + __syncthreads(); // red is reused by every half and pass + if (g < RH) { +#pragma unroll + for (int i = 0; i < 8; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) { + const int col = i * 16 + h * 8 + 2 * t; + *reinterpret_cast(red + (warp * RH + g) * 128 + col) = + rlo ? make_float2(acc[i][h][2], acc[i][h][3]) : make_float2(acc[i][h][0], acc[i][h][1]); + } + } + __syncthreads(); + + if (SK == 1) { + for (int r = warp; r < rn; r += WK) { + float v[4]; + const float4 u = *reinterpret_cast(red + r * 128 + 4 * lane); + v[0] = u.x; v[1] = u.y; v[2] = u.z; v[3] = u.w; +#pragma unroll + for (int w = 1; w < WK; ++w) { + const float4 q = *reinterpret_cast(red + (w * RH + r) * 128 + 4 * lane); + v[0] += q.x; v[1] += q.y; v[2] += q.z; v[3] += q.w; + } + finish(v, lane, svh, bias, col0 + 4 * lane); + store4(y, y_dtype, (size_t)(m0 + rlo + r) * N + col0 + 4 * lane, v); + } + } else { + for (int idx = threadIdx.x; idx < rn * 32; idx += WK * 32) { + const int r = idx >> 5, c = 4 * (idx & 31); + float4 s = *reinterpret_cast(red + r * 128 + c); +#pragma unroll + for (int w = 1; w < WK; ++w) { + const float4 q = *reinterpret_cast(red + (w * RH + r) * 128 + c); + s.x += q.x; s.y += q.y; s.z += q.z; s.w += q.w; + } + *reinterpret_cast(Z + ((size_t)split * M + m0 + rlo + r) * N + col0 + c) = s; + } + } + } + if (SK > 1) { + __threadfence(); + __syncthreads(); + if (threadIdx.x == 0) last = atomicAdd(counters + pass * NB + nb, 1) == SK - 1; + __syncthreads(); + if (last) { + __threadfence(); + for (int r = warp; r < R; r += WK) { + const size_t at = ((size_t)m0 + r) * N + col0 + 4 * lane; + float4 s = __ldcg(reinterpret_cast(Z + at)); + for (int q = 1; q < SK; ++q) { + const float4 u = __ldcg(reinterpret_cast(Z + (size_t)q * M * N + at)); + s.x += u.x; s.y += u.y; s.z += u.z; s.w += u.w; + } + float v[4] = {s.x, s.y, s.z, s.w}; + finish(v, lane, svh, bias, col0 + 4 * lane); + store4(y, y_dtype, (size_t)(m0 + r) * N + col0 + 4 * lane, v); + } + if (threadIdx.x == 0) counters[pass * NB + nb] = 0; // every program of the block has arrived + } + } + __syncthreads(); // red is reused in the next pass + } +} + + +// linear_body with 32-row passes: weights decoded once for two 16-row groups, each group linear_body's bits. +template +__device__ __forceinline__ void linear_body2( + const half* __restrict__ xh, const uint32_t* __restrict__ T, long long stride_k, long long stride_nb, + const half* __restrict__ svh, const half* __restrict__ bias, void* __restrict__ y, int y_dtype, + float* __restrict__ Z, int* __restrict__ counters, int M, int K, int N, int SK, const int nb, const int split, + const int NB) { + constexpr int TW = tile_words(); + constexpr int LW = lane_words(); + extern __shared__ __align__(16) float red[]; // WK * RH * 128 floats + __shared__ int last; + const int RH = min(M, 8); // rows of red a warp + + const int warp = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int g = lane >> 2, t = lane & 3; + const int per_warp = (K >> 4) / SK / WK; + const int kt0 = split * (per_warp * WK) + warp * per_warp; + const uint32_t* tiles = T + nb * stride_nb; + const int col0 = nb * 128; + + for (int mb = 0; mb < M; mb += 32) { + const int ng = M - mb > 16 ? 2 : 1; // 16-row groups in this pass + float acc[2][8][2][4]; +#pragma unroll + for (int q = 0; q < 2; ++q) +#pragma unroll + for (int i = 0; i < 8; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) +#pragma unroll + for (int c = 0; c < 4; ++c) acc[q][i][h][c] = 0.f; + const half* x0[2]; + const half* x1[2]; +#pragma unroll + for (int q = 0; q < 2; ++q) { // linear_body's clamped rows; an empty second group reads row M - 1 (unused) + const int m0 = mb + 16 * q; + int r0 = M - 1, r1 = M - 1; + if (m0 < M) { + const int R = min(16, M - m0); + r0 = m0 + (g < R ? g : R - 1); + r1 = m0 + (g + 8 < R ? g + 8 : R - 1); + } + x0[q] = xh + (size_t)r0 * K; + x1[q] = xh + (size_t)r1 * K; + } + const uint32_t* tile = tiles + (size_t)kt0 * stride_k; + constexpr bool PF = K2 <= 12; + constexpr int SR = 8 * LW; + uint32_t cur[PF ? SR : 1], nxt[PF ? SR : 1]; + if constexpr (PF) load_step(tile, lane, cur); +#pragma unroll 1 + for (int i = 0; i < per_warp; ++i) { + const int kt = kt0 + i; + uint32_t a[2][4]; +#pragma unroll + for (int q = 0; q < 2; ++q) { + a[q][0] = __ldg(reinterpret_cast(x0[q] + kt * 16 + 2 * t)); + a[q][1] = __ldg(reinterpret_cast(x1[q] + kt * 16 + 2 * t)); + a[q][2] = __ldg(reinterpret_cast(x0[q] + kt * 16 + 2 * t + 8)); + a[q][3] = __ldg(reinterpret_cast(x1[q] + kt * 16 + 2 * t + 8)); + } + if constexpr (PF) { + if (i + 1 < per_warp) load_step(tile + (size_t)(i + 1) * stride_k, lane, nxt); + } +#pragma unroll + for (int j = 0; j < 8; ++j) { + uint32_t w[LW]; + if constexpr (PF) step_lane_words(cur, j, w); + else ldg_lane_words(tile + (size_t)i * stride_k + j * TW, lane, w); + uint32_t b0[2], b1[2]; + decode_lane(w, lane, b0, b1); + mma16816(acc[0][j][0], a[0], b0); + mma16816(acc[0][j][1], a[0], b1); + if (ng == 2) { + mma16816(acc[1][j][0], a[1], b0); + mma16816(acc[1][j][1], a[1], b1); + } + } + if constexpr (PF) { +#pragma unroll + for (int q = 0; q < SR; ++q) cur[q] = nxt[q]; + } + } + +#pragma unroll + for (int q = 0; q < 2; ++q) { + if (q >= ng) break; + const int m0 = mb + 16 * q, pass = m0 >> 4; + const int R = min(16, M - m0); + // the warps' sums, added in warp order, rows 0-7 of the group and then rows 8-15 (linear_body's) + for (int rlo = 0; rlo < R; rlo += 8) { + const int rn = min(R - rlo, 8); + __syncthreads(); + if (g < RH) { +#pragma unroll + for (int i = 0; i < 8; ++i) +#pragma unroll + for (int h = 0; h < 2; ++h) { + const int col = i * 16 + h * 8 + 2 * t; + *reinterpret_cast(red + (warp * RH + g) * 128 + col) = + rlo ? make_float2(acc[q][i][h][2], acc[q][i][h][3]) : make_float2(acc[q][i][h][0], acc[q][i][h][1]); + } + } + __syncthreads(); + if (SK == 1) { + for (int r = warp; r < rn; r += WK) { + float v[4]; + const float4 u = *reinterpret_cast(red + r * 128 + 4 * lane); + v[0] = u.x; v[1] = u.y; v[2] = u.z; v[3] = u.w; +#pragma unroll + for (int w = 1; w < WK; ++w) { + const float4 qq = *reinterpret_cast(red + (w * RH + r) * 128 + 4 * lane); + v[0] += qq.x; v[1] += qq.y; v[2] += qq.z; v[3] += qq.w; + } + finish(v, lane, svh, bias, col0 + 4 * lane); + store4(y, y_dtype, (size_t)(m0 + rlo + r) * N + col0 + 4 * lane, v); + } + } else { + for (int idx = threadIdx.x; idx < rn * 32; idx += WK * 32) { + const int r = idx >> 5, c = 4 * (idx & 31); + float4 sm = *reinterpret_cast(red + r * 128 + c); +#pragma unroll + for (int w = 1; w < WK; ++w) { + const float4 qq = *reinterpret_cast(red + (w * RH + r) * 128 + c); + sm.x += qq.x; sm.y += qq.y; sm.z += qq.z; sm.w += qq.w; + } + *reinterpret_cast(Z + ((size_t)split * M + m0 + rlo + r) * N + col0 + c) = sm; + } + } + } + if (SK > 1) { + __threadfence(); + __syncthreads(); + if (threadIdx.x == 0) last = atomicAdd(counters + pass * NB + nb, 1) == SK - 1; + __syncthreads(); + if (last) { + __threadfence(); + for (int r = warp; r < R; r += WK) { + const size_t at = ((size_t)m0 + r) * N + col0 + 4 * lane; + float4 sm = __ldcg(reinterpret_cast(Z + at)); + for (int qq = 1; qq < SK; ++qq) { + const float4 u = __ldcg(reinterpret_cast(Z + (size_t)qq * M * N + at)); + sm.x += u.x; sm.y += u.y; sm.z += u.z; sm.w += u.w; + } + float v[4] = {sm.x, sm.y, sm.z, sm.w}; + finish(v, lane, svh, bias, col0 + 4 * lane); + store4(y, y_dtype, (size_t)(m0 + r) * N + col0 + 4 * lane, v); + } + if (threadIdx.x == 0) counters[pass * NB + nb] = 0; + } + } + __syncthreads(); + } + } +} + +struct Job { + const half* xh; + const uint32_t* T; + long long stride_k, stride_nb; + const half* svh; + const half* bias; + void* y; + float* Z; + int* counters; + int y_dtype, K, N, SK, b0, pad; +}; +struct Batch { + Job j[4]; + int n, M, pad[2]; +}; +struct Rot { + const half* suh[4]; + half* xh[4]; +}; + +} // namespace muse_linear + +// One launch of up to 4 jobs: block b runs the job whose block range holds it, as exl3_linear's grid would. +#define MUSE_MULTI(K2) \ + extern "C" __global__ void __launch_bounds__(128) muse_linear_multi_k##K2(const muse_linear::Batch b) { \ + int ji = 0; \ + while (ji + 1 < b.n && (int)blockIdx.x >= b.j[ji + 1].b0) ++ji; \ + const muse_linear::Job& J = b.j[ji]; \ + const int NB = J.N / 128, local = blockIdx.x - J.b0; \ + muse_linear::linear_body(J.xh, J.T, J.stride_k, J.stride_nb, J.svh, J.bias, J.y, J.y_dtype, \ + J.Z, J.counters, b.M, J.K, J.N, J.SK, local % NB, local / NB, NB); \ + } +#define MUSE_LIN2(K2, WK) \ + extern "C" __global__ void __launch_bounds__(WK * 32) muse_linear2_k##K2##_w##WK( \ + const half* __restrict__ xh, const uint32_t* __restrict__ T, long long stride_k, long long stride_nb, \ + const half* __restrict__ svh, const half* __restrict__ bias, void* __restrict__ y, int y_dtype, \ + float* __restrict__ Z, int* __restrict__ counters, int M, int K, int N, int SK) { \ + muse_linear::linear_body2(xh, T, stride_k, stride_nb, svh, bias, y, y_dtype, Z, counters, M, \ + K, N, SK, blockIdx.x, blockIdx.y, gridDim.x); \ + } +#define MUSE_WIDTH(K2) MUSE_MULTI(K2) MUSE_LIN2(K2, 4) MUSE_LIN2(K2, 8) +MUSE_WIDTH(2) MUSE_WIDTH(3) MUSE_WIDTH(4) MUSE_WIDTH(5) MUSE_WIDTH(6) MUSE_WIDTH(8) +#undef MUSE_WIDTH +#undef MUSE_LIN2 +#undef MUSE_MULTI + +// exl3_linear.cu's tf_exl3_rot_in for 4 suh / xh pairs (grid z). +extern "C" __global__ void __launch_bounds__(128) muse_rot_multi(const void* __restrict__ x, int x_dtype, + const muse_linear::Rot r, int K) { + const int blk = blockIdx.x * 4 + (threadIdx.x >> 5), row = blockIdx.y, lane = threadIdx.x & 31; + if (blk * 128 >= K) return; + const half* suh = r.suh[blockIdx.z]; + half* xh = r.xh[blockIdx.z]; + const int k = blk * 128 + 4 * lane; + float v[4], s[4]; + muse_linear::load4(x, x_dtype, (size_t)row * K + k, v); + muse_linear::load4(suh, muse_linear::F16, k, s); +#pragma unroll + for (int j = 0; j < 4; ++j) v[j] *= s[j]; + tf_exl3::fwht128(v, lane); +#pragma unroll + for (int j = 0; j < 4; ++j) v[j] *= tf_exl3::HAD_SCALE; + muse_linear::store4(xh, muse_linear::F16, (size_t)row * K + k, v); +} diff --git a/zig/kernels/cuda/probe.cu b/zig/kernels/cuda/probe.cu index ca8f345e7b0..46f20220f2e 100644 --- a/zig/kernels/cuda/probe.cu +++ b/zig/kernels/cuda/probe.cu @@ -2,6 +2,8 @@ #include +#include "glm_pdl.cuh" + struct ProbeView { const float* src; int n; @@ -60,3 +62,29 @@ extern "C" __global__ void tf_probe_pdl_step(unsigned long long* counter, unsign asm volatile("griddepcontrol.launch_dependents;" ::: "memory"); #endif } + +// glm-pdl-order: lets the next grid in at once, spins about `spins` clocks, then copies `src` over `dst`. +extern "C" __global__ void tf_probe_pdl_slow_copy(const uint4* src, uint4* dst, long long n16, long long spins) { + glm_pdl::trigger(); + const long long t0 = clock64(); + while (clock64() - t0 < spins) { + } + for (long long i = blockIdx.x * (long long)blockDim.x + threadIdx.x; i < n16; i += (long long)gridDim.x * blockDim.x) + dst[i] = src[i]; +} + +// glm-pdl-order's planted control: reads `in` before its wait (no GLM kernel may), keeps what thread 0 saw in `seen`. +extern "C" __global__ void tf_probe_pdl_early_read(const unsigned* in, unsigned* out, unsigned* seen, int n) { + const int i = blockIdx.x * blockDim.x + threadIdx.x; + const unsigned v = i < n ? in[i] : 0u; + if (i == 0) seen[0] = v; + glm_pdl::wait(); + if (i < n) out[i] = v * 2u + 1u; +} + +// glm-pdl-order: the same read after glm_pdl::enter(), as every GLM kernel opens. +extern "C" __global__ void tf_probe_pdl_enter_read(const unsigned* in, unsigned* out, int n) { + glm_pdl::enter(); + const int i = blockIdx.x * blockDim.x + threadIdx.x; + if (i < n) out[i] = in[i] * 2u + 1u; +} diff --git a/zig/kernels/cuda/qmm_prefill.cu b/zig/kernels/cuda/qmm_prefill.cu index d79724d1342..46eb8e8f4a9 100644 --- a/zig/kernels/cuda/qmm_prefill.cu +++ b/zig/kernels/cuda/qmm_prefill.cu @@ -59,28 +59,41 @@ __device__ __forceinline__ void prefill_body( const int m0 = at.x, n0 = at.y; auto stage = [&](int s) { return buf + s * T::STAGE; }; + // Each thread's copies are addressed once: input chunk ch on rows r0 + i * RSTEP, weight chunks, one scale chunk. + constexpr int XC = BM * T::CHUNKS / T::THREADS, RSTEP = T::THREADS / T::CHUNKS; + static_assert(T::THREADS % T::CHUNKS == 0 && XC * T::THREADS == BM * T::CHUNKS, "whole input chunks a thread"); + static_assert(RSTEP % T::CHUNKS == 0, "rows r0 + i * RSTEP keep the swizzle phase of row r0"); + constexpr int TILE_BYTES = 64 * GS / 2; // one stored 64-column tile's group block + constexpr int WC = (T::W / 16 + T::THREADS - 1) / T::THREADS; + const int ch = tid % T::CHUNKS, r0 = tid / T::CHUNKS; + const int xdst = r0 * T::ROW + swz(r0, ch) * 16; + const __nv_bfloat16* xsrc = x + static_cast(m0 + r0) * ldx + ch * 8; + const unsigned char* wsrc[WC]; + bool wok[WC]; +#pragma unroll + for (int k = 0; k < WC; ++k) { + const int c = tid + k * T::THREADS, t = c / (TILE_BYTES / 16), off = c % (TILE_BYTES / 16); + wok[k] = c < T::W / 16 && n0 + t * 64 < npad; // a 256-wide block's last tiles may pass the padded columns + wsrc[k] = reinterpret_cast(w) + static_cast(n0 / 64 + t) * KG * TILE_BYTES + + off * 16; + } + const int s_which = tid / (T::S / 16), s_off = tid % (T::S / 16); + const bool sok = tid < 2 * (T::S / 16) && n0 + s_off * 8 < npad; + const __nv_bfloat16* ssrc = (s_which ? biases : scales) + n0 + s_off * 8; + const int sdst = s_which * T::S + s_off * 16; + static_assert(2 * (T::S / 16) <= T::THREADS, "one scale or bias chunk a thread"); auto load = [&](int s, int g) { unsigned char* p = stage(s); - for (int c = tid; c < BM * T::CHUNKS; c += T::THREADS) { - const int r = c / T::CHUNKS, ch = c % T::CHUNKS; - const int row = min(m0 + r, M - 1); - cp16z(p + r * T::ROW + swz(r, ch) * 16, x + static_cast(row) * ldx + g * GS + ch * 8, - m0 + r < M); +#pragma unroll + for (int i = 0; i < XC; ++i) { + const bool ok = m0 + r0 + i * RSTEP < M; + cp16z(p + xdst + i * RSTEP * T::ROW, ok ? xsrc + static_cast(i * RSTEP) * ldx + g * GS : x, ok); } unsigned char* pw = p + T::X; - constexpr int TILE_BYTES = 64 * GS / 2; // one stored 64-column tile's group block - for (int c = tid; c < T::W / 16; c += T::THREADS) { - const int t = c / (TILE_BYTES / 16), off = c % (TILE_BYTES / 16); - const size_t tile = static_cast(n0 / 64 + t) * KG + g; - if (n0 + t * 64 < npad) // a 256-wide block's last tiles may pass the padded columns - cp16(pw + c * 16, reinterpret_cast(w) + tile * TILE_BYTES + off * 16); - } - unsigned char* ps = pw + T::W; - for (int c = tid; c < 2 * (T::S / 16); c += T::THREADS) { - const int which = c / (T::S / 16), off = c % (T::S / 16); - const __nv_bfloat16* src = (which ? biases : scales) + static_cast(g) * npad + n0 + off * 8; - if (n0 + off * 8 < npad) cp16(ps + which * T::S + off * 16, src); - } +#pragma unroll + for (int k = 0; k < WC; ++k) + if (wok[k]) cp16(pw + (tid + k * T::THREADS) * 16, wsrc[k] + static_cast(g) * TILE_BYTES); + if (sok) cp16(pw + T::W + sdst, ssrc + static_cast(g) * npad); }; float acc[T::MT][T::NT][4]; @@ -278,7 +291,7 @@ __global__ void __launch_bounds__(WM * WN * 32) prefill_kernel( } // namespace tf_qmm_prefill -// One grid runs up to four projections through the shipped body with projection-local block indices. +// One grid runs up to four projections with the same copies and math as prefill_kernel. extern "C" __global__ __launch_bounds__(256) void tf_qmm_prefill_many( const __nv_bfloat16* __restrict__ x, const __grid_constant__ tf_qmm_prefill::PrefillParts parts, int M, int K, int ldx, int group) { diff --git a/zig/kernels/cuda/qmmf.cu b/zig/kernels/cuda/qmmf.cu index 25c091c1783..c08ad62af1f 100644 --- a/zig/kernels/cuda/qmmf.cu +++ b/zig/kernels/cuda/qmmf.cu @@ -65,7 +65,10 @@ __global__ void __launch_bounds__(WM * WN * 32) qmmf_kernel( const __nv_bfloat16* __restrict__ x, const unsigned char* __restrict__ w, const uint8_t* __restrict__ bs, float scale, void* __restrict__ out, float* __restrict__ part, int M, int N, int K, int SK, int npad, int ldx, int group) { + qmm_frag::grid_launch(); // a dependent launch: the body waits after its prologue's weight loads +#define TF_QMMF_WFIRST #include "qmmf_body.cuh" +#undef TF_QMMF_WFIRST } // The shared down has one K slice; only the output address changes from the existing BF16-weight product. @@ -85,6 +88,8 @@ TF_SHARED_DOWN(tf_qmmf_shared64, 64, 64) template __global__ void reduce_kernel(const float* __restrict__ part, void* __restrict__ out, long long total, int SK, float scale) { + qmm_frag::grid_launch(); + qmm_frag::grid_wait(); const long long i = static_cast(blockIdx.x) * blockDim.x + threadIdx.x; if (i >= total) return; float acc = part[i]; diff --git a/zig/kernels/cuda/qmmf_body.cuh b/zig/kernels/cuda/qmmf_body.cuh index 82ccec02604..f3dc2ee6cf8 100644 --- a/zig/kernels/cuda/qmmf_body.cuh +++ b/zig/kernels/cuda/qmmf_body.cuh @@ -36,8 +36,9 @@ #endif #endif auto stage = [&](int s) { return buf + s * T::STAGE; }; - auto load = [&](int s, int g) { + auto load = [&](int s, int g, int what = 3) { // what: 1 the input rows, 2 the weights and scales unsigned char* p = stage(s); + if (what & 1) for (int c = tid; c < BM * T::CHUNKS; c += T::THREADS) { const int r = c / T::CHUNKS, ch = c % T::CHUNKS; const int row = min(m0 + r, M - 1); @@ -49,6 +50,7 @@ m0 + r < M); #endif } + if (!(what & 2)) return; unsigned char* pw = p + T::X; constexpr int TILE_BYTES = MODE == FP4 ? 64 * GS / 2 : MODE == BF16 ? 64 * GS * 2 : 64 * GS; #if __CUDA_ARCH__ >= 1200 && !defined(TF_QMMF_STRIDED) @@ -111,11 +113,24 @@ for (int j = 0; j < T::NT; ++j) #pragma unroll for (int e = 0; e < 4; ++e) acc[i][j][e] = 0.0f; +#ifdef TF_QMMF_WFIRST + // weights stream in while the kernel before ends; its outputs (the input rows) only after the wait +#pragma unroll + for (int s = 0; s < STAGES - 1; ++s) + if (s < per) load(s, g0 + s, 2); + qmm_frag::grid_wait(); +#pragma unroll + for (int s = 0; s < STAGES - 1; ++s) { + if (s < per) load(s, g0 + s, 1); + commit(); + } +#else #pragma unroll for (int s = 0; s < STAGES - 1; ++s) { if (s < per) load(s, g0 + s); commit(); } +#endif for (int it = 0; it < per; ++it) { if constexpr (FUSE) { if (it > 0 && it % slice_groups == 0) { diff --git a/zig/kernels/hip/exl3/exl3.hip b/zig/kernels/hip/exl3/exl3.hip new file mode 100644 index 00000000000..065e151ba96 --- /dev/null +++ b/zig/kernels/hip/exl3/exl3.hip @@ -0,0 +1,332 @@ +// EXL3 projections for decode rows (CUDA's exl3_block/linear.cu): the input rotation, then the trellis linear (mul1). + +#include "ops/common.hpp" + +namespace { + +typedef _Float16 h2 __attribute__((ext_vector_type(2))); +typedef float f32x8 __attribute__((__vector_size__(8 * sizeof(float)))); + +constexpr float kHadScale = 0.08838834764831845f; // 1 / sqrt(128), CUDA's HAD_SCALE + +// An fp32 value the compiler cannot fold into the next conversion (fp16(a * b) would otherwise round once, not twice). +__device__ __forceinline__ float opaque(float x) { + asm volatile("" : "+v"(x)); + return x; +} + +// A pointer in the global address space, so its loads are not flat loads that an LDS wait would also wait for. +template +__device__ __forceinline__ const __attribute__((address_space(1))) T* gl(const T* p) { + return (const __attribute__((address_space(1))) T*)p; +} + +// The unscaled 128-point Walsh-Hadamard transform, 4 values a lane (4 lane + j), in CUDA's fwht128 butterfly order. +__device__ __forceinline__ void fwht128(float (&v)[4], int lane) { + const float a = v[0] + v[1], b = v[0] - v[1], c = v[2] + v[3], d = v[2] - v[3]; + v[0] = a + c; + v[1] = b + d; + v[2] = a - c; + v[3] = b - d; +#pragma unroll + for (int m = 1; m < 32; m <<= 1) { +#pragma unroll + for (int j = 0; j < 4; ++j) { + const float o = __shfl_xor(v[j], m, 32); + v[j] = (lane & m) ? o - v[j] : v[j] + o; + } + } +} + +// E(p): one past the last stream bit of value p's 16-bit window (exl3_format.zig streamEnds). +template +__host__ __device__ constexpr int stream_end(int p) { + return (K2 & 1) ? ((p + 1) * K2 - ((p + 1) & 1)) / 2 : (p + 1) * (K2 / 2); +} + +// Lane l (column c = l % 16, k half h = l / 16) decodes rows 8 h + 2 q, + 1 of column c: its windows' words, shift. +template +struct LaneWin { + static constexpr int TW = 4 * K2; + static constexpr int D = stream_end(1) - stream_end(0); + int hi[4], lo[4], sh[4]; + __device__ __forceinline__ explicit LaneWin(int lane) { + const int c = lane & 15, h = lane >> 4; +#pragma unroll + for (int q = 0; q < 4; ++q) { + const int p0 = 32 * (c & 7) + 8 * q + 4 * (c >> 3) + 2 * h; + const int s = (stream_end(p0) - 16 + 128 * K2) % (128 * K2); + const int o = s & 31; + hi[q] = s >> 5; + lo[q] = o ? (hi[q] + 1) % TW : hi[q]; + sh[q] = (32 - o) & 31; + } + } +}; + +// Two consecutive values from the 32 stream bits at the first window: fp16(0x6400 + bytesum(s * 0x83DCD12D)) fused. +template +__device__ __forceinline__ uint32_t decode_pair(uint32_t u) { + const uint32_t w0 = u >> 16; + const uint32_t w1 = __builtin_amdgcn_ubfe(u, 16 - D, 16); + const uint32_t s0 = __builtin_amdgcn_sad_u8(w0 * 0x83DCD12Du, 0u, 0x64006400u); + const uint32_t s = __builtin_amdgcn_sad_hi_u8(w1 * 0x83DCD12Du, 0u, s0); + h2 hv = __builtin_bit_cast(h2, s); + hv = __builtin_elementwise_fma(hv, __builtin_bit_cast(h2, 0x1eee1eeeu), __builtin_bit_cast(h2, 0xc931c931u)); + return __builtin_bit_cast(uint32_t, hv); +} + +// This lane's 8 values of the tile at `tw`, as four fp16 pairs (rows 8 h + 2 q, 8 h + 2 q + 1 of column c). +template +__device__ __forceinline__ void decode_own(const uint32_t* tw, const LaneWin& w, uint32_t (&own)[4]) { +#pragma unroll + for (int q = 0; q < 4; ++q) { + const uint32_t u = __builtin_amdgcn_alignbit(tw[w.hi[q]], tw[w.lo[q]], w.sh[q]); + own[q] = decode_pair::D>(u); + } +} + +__device__ __forceinline__ float dot2(uint32_t a, uint32_t b, float c) { + return __builtin_amdgcn_fdot2(__builtin_bit_cast(h2, a), __builtin_bit_cast(h2, b), c, false); +} + +__device__ __forceinline__ float partner(float x) { + const uint32_t u = __builtin_bit_cast(uint32_t, x); + return __builtin_bit_cast(float, __builtin_amdgcn_permlanex16(u, u, 0x76543210u, 0xfedcba98u, false, false)); +} + +__device__ __forceinline__ void lds_fence() { + __builtin_amdgcn_wave_barrier(); + asm volatile("s_waitcnt lgkmcnt(0)" ::: "memory"); +} + +// One wave's k tiles [kt0, kt0 + n) of a 128-column strip against one row: a lane's dot2 chain, then the half-waves'. +template +__device__ __forceinline__ void strip_1row(const uint32_t* tiles, long long step, int kt0, int n, const _Float16* xrow, + uint32_t* st, int lane, f32x8 (&acc)[8]) { + constexpr int TW = 4 * K2, LW = 8 * TW / 32; + if (n <= 0) return; + const LaneWin win(lane); + const int h = lane >> 4; + float s[8]; +#pragma unroll + for (int t = 0; t < 8; ++t) s[t] = 0.f; + uint32_t pf[LW]; + uint4 xa; + { + const uint32_t* p = tiles + (long long)kt0 * step; +#pragma unroll + for (int i = 0; i < LW; ++i) pf[i] = __builtin_nontemporal_load(gl(p) + i * 32 + lane); + xa = *gl(reinterpret_cast(xrow + 16 * kt0 + 8 * h)); + } + for (int j = 0; j < n; ++j) { +#pragma unroll + for (int i = 0; i < LW; ++i) st[i * 32 + lane] = pf[i]; + const uint4 x = xa; + if (j + 1 < n) { + const uint32_t* p = tiles + (long long)(kt0 + j + 1) * step; +#pragma unroll + for (int i = 0; i < LW; ++i) pf[i] = __builtin_nontemporal_load(gl(p) + i * 32 + lane); + xa = *gl(reinterpret_cast(xrow + 16 * (kt0 + j + 1) + 8 * h)); + } + lds_fence(); +#pragma unroll + for (int t = 0; t < 8; ++t) { + uint32_t own[4]; + decode_own(st + t * TW, win, own); + float a = dot2(own[0], x.x, s[t]); + a = dot2(own[1], x.y, a); + a = dot2(own[2], x.z, a); + s[t] = dot2(own[3], x.w, a); + } + __builtin_amdgcn_wave_barrier(); + } +#pragma unroll + for (int t = 0; t < 8; ++t) acc[t][0] += s[t] + partner(s[t]); +} + +// strip_1row's sums for up to RM rows, TT of the strip's tiles from t0, each tile decoded once for every row. +template +__device__ __forceinline__ void strip_rows_part(const uint32_t* tiles, long long step, int kt0, int n, + const _Float16* xlane, int R, uint32_t* st, uint4* xst, int lane, + f32x8 (&acc)[8]) { + constexpr int TW = 4 * K2, PW = TT * TW, RL = (PW + 31) / 32; + const LaneWin win(lane); + const int h = lane >> 4; + const bool xlive = (lane >> 1) < R; + const uint4* xl = reinterpret_cast(xlane + 8 * (lane & 1)); + const uint32_t* tp = tiles + t0 * TW; + float s[RM][TT]; +#pragma unroll + for (int r = 0; r < RM; ++r) +#pragma unroll + for (int t = 0; t < TT; ++t) s[r][t] = 0.f; + uint32_t pf[RL]; + uint4 xp = make_uint4(0u, 0u, 0u, 0u); + auto fetch = [&](int kt) { + const uint32_t* p = tp + (long long)kt * step; +#pragma unroll + for (int i = 0; i < RL; ++i) { + const int wi = i * 32 + lane; + pf[i] = wi < PW ? __builtin_nontemporal_load(gl(p) + wi) : 0u; + } + if (xlive) xp = *gl(xl + 2 * kt); + }; + fetch(kt0); + for (int j = 0; j < n; ++j) { +#pragma unroll + for (int i = 0; i < RL; ++i) { + const int wi = i * 32 + lane; + if (wi < PW) st[wi] = pf[i]; + } + xst[lane] = xp; + if (j + 1 < n) fetch(kt0 + j + 1); + lds_fence(); + uint32_t own[TT][4]; +#pragma unroll + for (int t = 0; t < TT; ++t) decode_own(st + t * TW, win, own[t]); +#pragma unroll + for (int r = 0; r < RM; ++r) { + if (r < R) { + const uint4 x = xst[2 * r + h]; +#pragma unroll + for (int t = 0; t < TT; ++t) { + float a = dot2(own[t][0], x.x, s[r][t]); + a = dot2(own[t][1], x.y, a); + a = dot2(own[t][2], x.z, a); + s[r][t] = dot2(own[t][3], x.w, a); + } + } + } + __builtin_amdgcn_wave_barrier(); + } + // lane l holds row 2 i + h of each pair as WMMA's C layout does: its half's sum plus its partner's, as strip_1row +#pragma unroll + for (int t = 0; t < TT; ++t) { + float v[8]; +#pragma unroll + for (int i = 0; i < 8; ++i) { + if (2 * i + 1 < RM) { + const float s0 = s[2 * i][t], s1 = s[2 * i + 1][t]; + const float o0 = partner(s0), o1 = partner(s1); + v[i] = h ? s1 + o1 : s0 + o0; + } else { + v[i] = 0.f; + } + } + acc[t0 + t] += (f32x8){v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]}; + } +} + +// Up to 8 rows take the strip's 8 tiles at once; 9 to 16 rows take them in two parts of 4 (the sums stay in registers). +template +__device__ __forceinline__ void strip_rows(const uint32_t* tiles, long long step, int kt0, int n, const _Float16* xlane, + int R, uint32_t* st, uint4* xst, int lane, f32x8 (&acc)[8]) { + if (n <= 0) return; + if (R <= 8) { + strip_rows_part(tiles, step, kt0, n, xlane, R, st, xst, lane, acc); + } else { + strip_rows_part(tiles, step, kt0, n, xlane, R, st, xst, lane, acc); + __builtin_amdgcn_wave_barrier(); + strip_rows_part(tiles, step, kt0, n, xlane, R, st, xst, lane, acc); + } +} + +// y = (xh @ W_q) H / sqrt(128) * svh for a 128-column block: wave w sums k tiles w K/16/WK on; rows in passes of 16. +template +__device__ __forceinline__ void linear_body(const __half* xh_, const uint32_t* T, long long stride_k, + long long stride_nb, const __half* svh, void* y, int y_kind, int M, int K, + int N) { + constexpr int TW = 4 * K2; + extern __shared__ __attribute__((aligned(16))) float red[]; // WK * min(M, 8) * 128 floats + __shared__ __attribute__((aligned(16))) uint32_t stage[WK][8 * TW]; + const _Float16* xh = reinterpret_cast(xh_); + const int RH = M < 8 ? M : 8; + const int nb = blockIdx.x, wave = threadIdx.x >> 5, lane = threadIdx.x & 31; + const int per_wave = (K >> 4) / WK, kt0 = wave * per_wave; + const uint32_t* tiles = T + nb * stride_nb; + const int col = nb * 128 + 4 * lane; + for (int m0 = 0; m0 < M; m0 += 16) { + const int R = min(16, M - m0); + f32x8 acc[8]; +#pragma unroll + for (int t = 0; t < 8; ++t) acc[t] = (f32x8){0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + // a row's sums are the same bits whatever rows share its pass; the rows' inputs stage in the wave's red floats + if (R == 1) { + strip_1row(tiles, stride_k, kt0, per_wave, xh + (size_t)m0 * K, stage[wave], lane, acc); + } else { + const int ar = m0 + min(lane >> 1, R - 1); + strip_rows(tiles, stride_k, kt0, per_wave, xh + (size_t)ar * K, R, stage[wave], + reinterpret_cast(red + wave * 128), lane, acc); + } +#pragma unroll + for (int hp = 0; hp < 2; ++hp) { + const int rlo = 8 * hp; + if (rlo >= R) break; + const int rn = min(R - rlo, 8); + __syncthreads(); +#pragma unroll + for (int t = 0; t < 8; ++t) +#pragma unroll + for (int i = 0; i < 4; ++i) { + const int rr = 2 * i + (lane >> 4); + if (rr < RH) red[(wave * RH + rr) * 128 + t * 16 + (lane & 15)] = acc[t][4 * hp + i]; + } + __syncthreads(); + // the waves' sums in wave order, then the output rotation and svh as CUDA's finish does them + for (int r = wave; r < rn; r += WK) { + const float4 u = *reinterpret_cast(red + r * 128 + 4 * lane); + float v[4] = {u.x, u.y, u.z, u.w}; +#pragma unroll + for (int w = 1; w < WK; ++w) { + const float4 q = *reinterpret_cast(red + (w * RH + r) * 128 + 4 * lane); + v[0] += q.x; + v[1] += q.y; + v[2] += q.z; + v[3] += q.w; + } + fwht128(v, lane); + const long long row = (long long)(m0 + rlo + r) * N + col; +#pragma unroll + for (int j = 0; j < 4; ++j) store(y, y_kind, row + j, v[j] * kHadScale * __half2float(svh[col + j])); + } + } + __syncthreads(); + } +} + +} // namespace + +// xh = fp16((x * suh) H / sqrt(128)) a 128-wide block a wave, four a workgroup, a row a grid row (CUDA's rot_in). +extern "C" __global__ void __launch_bounds__(128) +tf_exl3_rot_in(const void* x, int x_kind, const __half* suh, __half* xh, int K) { + const int blk = blockIdx.x * 4 + (threadIdx.x >> 5), lane = threadIdx.x & 31; + if (blk * 128 >= K) return; + const long long k = blk * 128 + 4 * lane, at = (long long)blockIdx.y * K + k; + float v[4]; +#pragma unroll + for (int j = 0; j < 4; ++j) v[j] = load(x, x_kind, at + j) * __half2float(suh[k + j]); + fwht128(v, lane); +#pragma unroll + for (int j = 0; j < 4; ++j) xh[at + j] = __float2half_rn(opaque(v[j] * kHadScale)); +} + +#define TF_EXL3_LINEAR(K2_, WK_) \ + extern "C" __global__ void __launch_bounds__(WK_ * 32) \ + tf_exl3_linear_k##K2_##_w##WK_(const __half* xh, const uint32_t* T, long long stride_k, long long stride_nb, \ + const __half* svh, void* y, int y_kind, int M, int K, int N) { \ + linear_body(xh, T, stride_k, stride_nb, svh, y, y_kind, M, K, N); \ + } +TF_EXL3_LINEAR(4, 4) +TF_EXL3_LINEAR(4, 8) +TF_EXL3_LINEAR(6, 4) +TF_EXL3_LINEAR(6, 8) +TF_EXL3_LINEAR(8, 4) +TF_EXL3_LINEAR(8, 8) +TF_EXL3_LINEAR(10, 4) +TF_EXL3_LINEAR(10, 8) +TF_EXL3_LINEAR(12, 4) +TF_EXL3_LINEAR(12, 8) +TF_EXL3_LINEAR(16, 4) +TF_EXL3_LINEAR(16, 8) +#undef TF_EXL3_LINEAR diff --git a/zig/kernels/metal/deepseek_v41/csa2_attn.metal b/zig/kernels/metal/deepseek_v41/csa2_attn.metal index dc6bb83fb98..e91efb61ba2 100644 --- a/zig/kernels/metal/deepseek_v41/csa2_attn.metal +++ b/zig/kernels/metal/deepseek_v41/csa2_attn.metal @@ -22,7 +22,7 @@ using namespace metal; #define TF_ATTN_KU 2u #define TF_ATTN_RR 2u #define TF_ATTN_HG 4u -#define TF_ATTN_TILE 16u +#define TF_ATTN_PH 2u #define TF_ATTN_NEG (-1e30f) struct TfAttnArgs { @@ -47,13 +47,15 @@ struct TfQ { float v[TF_ATTN_HS][16]; }; -// A chunk's softmax state: running max, sum, weighted sum, and how many keys it has met. -struct TfAcc { - float m[TF_ATTN_HS]; - float l[TF_ATTN_HS]; - float acc[TF_ATTN_HS][16]; +// A chunk's softmax state of HS heads: running max, sum, weighted sum, and how many keys it has met. +template +struct TfAccN { + float m[HS]; + float l[HS]; + float acc[HS][16]; uint n; }; +typedef TfAccN TfAcc; inline float tf_attn_lo(uint w) { return as_type(w << 16); } inline float tf_attn_hi(uint w) { return as_type(w & 0xFFFF0000u); } @@ -67,8 +69,9 @@ inline void tf_attn_x16(TfKey k, thread float* x) { } } -inline void tf_attn_zero(thread TfAcc& s) { - for (uint hh = 0; hh < TF_ATTN_HS; ++hh) { +template +inline void tf_attn_zero(thread TfAccN& s) { + for (uint hh = 0; hh < HS; ++hh) { s.m[hh] = TF_ATTN_NEG; s.l[hh] = 0.0f; for (uint i = 0; i < 16; ++i) s.acc[hh][i] = 0.0f; @@ -184,7 +187,7 @@ inline uint tf_attn_load_selected(thread TfKey* k, const device uint4* C, IP I, // Selected run `run` (0..3) into a zeroed state; PF loads the next step's keys before this step's math. -// `I` is the row's index list, in device memory (prompt) or staged in threadgroup memory (decode). +// `I` is the row's index list, staged in threadgroup memory. template inline void tf_attn_selected(thread TfAcc& s, thread const TfQ& q, const device uint4* C, IP I, thread const TfAttnMeta& m, uint run, float scale, uint lane) { @@ -236,7 +239,8 @@ inline void tf_attn_window(thread TfAcc& s, thread const TfQ& q, const device ui } // A chunk's (max, sum, weighted sum) joined to the running result of head hh: both rescaled to the larger max. -inline void tf_attn_join(thread TfAcc& t, uint hh, float mc, float lc, thread const float* ac) { +template +inline void tf_attn_join(thread TfAccN& t, uint hh, float mc, float lc, thread const float* ac) { const float nm = mc > t.m[hh] ? mc : t.m[hh]; const float a = precise::exp(t.m[hh] - nm); const float b = precise::exp(mc - nm); @@ -252,8 +256,8 @@ inline void tf_attn_join(thread TfAcc& t, uint hh, float mc, float lc, thread co } // Sink, normalisation, the inverse RoPE of the last 64 dims and the store of a head's row. -template -inline void tf_attn_store(thread TfAcc& s, uint hh, float sink, const device float* cs, device T* out, uint lane) { +template +inline void tf_attn_store(thread TfAccN& s, uint hh, float sink, const device float* cs, device T* out, uint lane) { const float m = s.m[hh]; const float top = sink > m ? sink : m; const float af = precise::exp(m - top); @@ -326,61 +330,97 @@ template if (TF_CTL == 4 && r == 0 && h0 == 0 && lane == 0) O[ulong(a.rows) * a.heads * TF_ATTN_D] = T(1.0f); } -// Prompt: a threadgroup is RR consecutive rows of one linear window buffer by HG head groups. +// Prompt: a threadgroup is RR consecutive rows by HG pairs of heads; a simdgroup is one row and PH heads. + +// A simdgroup's heads share each key's loads; keys come from device memory, a run's indices four at a time. + +// A key's 16 dims widened through the bfloat type: the values tf_attn_x16 makes. +inline void tf_attn_pwiden(TfKey k, thread float* x) { + for (uint j = 0; j < 4; ++j) { + const bfloat2 a = as_type(k.a[j]), b = as_type(k.b[j]); + x[2 * j] = float(a.x); + x[2 * j + 1] = float(a.y); + x[8 + 2 * j] = float(b.x); + x[8 + 2 * j + 1] = float(b.y); + } +} + +// One key for PH heads, lane l holding head l % PH's score: a head whose max rose is rescaled, then each head adds it. -// The window is staged in tiles of 16 keys at absolute positions, one barrier pair a tile. +// The steps and their order are tf_attn_update's, so each head's sums carry the decode kernel's bits. +inline void tf_attn_pkey(thread TfAccN& s, thread const float (*q)[16], TfKey k, float scale, uint lane) { + float x[16], v[TF_ATTN_PH]; + tf_attn_pwiden(k, x); + for (uint hh = 0; hh < TF_ATTN_PH; ++hh) { + v[hh] = 0.0f; + for (uint i = 0; i < 16; ++i) v[hh] = tf_attn_step(v[hh], q[hh][i], x[i]); + } + const float w = tf_attn_reduce2(v[0], v[1], lane) * scale; + if (TF_CTL == 1 && simd_any(w != w)) return; + const uint mine = lane % TF_ATTN_PH; + float mm = s.m[0]; + for (uint hh = 1; hh < TF_ATTN_PH; ++hh) mm = mine == hh ? s.m[hh] : mm; + const bool rise = w > mm; + if (simd_any(rise)) { + const float a = precise::exp(mm - w); + for (uint hh = 0; hh < TF_ATTN_PH; ++hh) + if (simd_broadcast(rise ? 1u : 0u, hh) != 0) { + const float ah = simd_broadcast(a, hh); + s.l[hh] = s.l[hh] * ah; + for (uint i = 0; i < 16; ++i) s.acc[hh][i] = s.acc[hh][i] * ah; + s.m[hh] = simd_broadcast(w, hh); + } + mm = rise ? w : mm; + } + const float p = precise::exp(w - mm); + for (uint hh = 0; hh < TF_ATTN_PH; ++hh) { + const float ph = simd_broadcast(p, hh); + s.l[hh] = s.l[hh] + ph; + for (uint i = 0; i < 16; ++i) s.acc[hh][i] = fma(ph, x[i], s.acc[hh][i]); + } + s.n += 1; +} -// Each row reads its own span of a tile, so its keys and their order do not depend on its chunk or the rows beside it. template [[kernel, max_total_threads_per_threadgroup(32 * TF_ATTN_RR * TF_ATTN_HG)]] void tf_dsv41_attn_pre( TF_ATTN_ARGS, uint2 tg [[threadgroup_position_in_grid]], uint sg [[simdgroup_index_in_threadgroup]], - uint lane [[thread_index_in_simdgroup]], uint tid [[thread_index_in_threadgroup]]) { - threadgroup uint4 tile[TF_ATTN_TILE * (TF_ATTN_D / 8)]; - const uint ra = sg / TF_ATTN_HG, r0 = tg.x * TF_ATTN_RR, r = r0 + ra; - const uint h0 = (tg.y * TF_ATTN_HG + sg % TF_ATTN_HG) * TF_ATTN_HS; - const bool on = r < a.rows && h0 < a.heads; - const TfAttnMeta m0 = M[r0]; - const int last = M[min(r0 + TF_ATTN_RR, a.rows) - 1].pos; - const int lo = max(m0.pos - int(TF_ATTN_WIN) + 1, 0); - const TfAttnMeta m = on ? M[r] : m0; + uint lane [[thread_index_in_simdgroup]]) { + const uint ra = sg / TF_ATTN_HG, r = tg.x * TF_ATTN_RR + ra; + const uint h0 = (tg.y * TF_ATTN_HG + sg % TF_ATTN_HG) * TF_ATTN_PH; + if (r >= a.rows || h0 >= a.heads) return; + const uint nh = min(TF_ATTN_PH, a.heads - h0); + const TfAttnMeta m = M[r]; const float scale = (TF_CTL == 5 && ra == 1) ? a.scale * 1.0000001f : a.scale; - TfQ q; - TfAcc s; - tf_attn_zero(s); - if (on) tf_attn_loadq(q, Q, r, h0, a.heads, lane); - for (int ti = lo / int(TF_ATTN_TILE); ti <= last / int(TF_ATTN_TILE); ++ti) { - const int base = ti * int(TF_ATTN_TILE); - threadgroup_barrier(mem_flags::mem_threadgroup); - for (uint u = 0; u < TF_ATTN_TILE * (TF_ATTN_D / 8) / (32 * TF_ATTN_RR * TF_ATTN_HG); ++u) { - const uint g = tid + 32 * TF_ATTN_RR * TF_ATTN_HG * u; - const int t = base + int(g / (TF_ATTN_D / 8)); - if (t >= lo && t <= last) tile[g] = W[ulong(m0.wofs + t - m0.wbase) * (TF_ATTN_D / 8) + g % (TF_ATTN_D / 8)]; - } - threadgroup_barrier(mem_flags::mem_threadgroup); - if (!on) continue; - const int ja = max(base, max(m.pos - int(TF_ATTN_WIN) + 1, 0)), jb = min(base + int(TF_ATTN_TILE) - 1, m.pos); - for (int j = ja; j <= jb; j += int(TF_ATTN_KU)) { - TfKey k[TF_ATTN_KU]; - uint valid = 0; - for (uint u = 0; u < TF_ATTN_KU; ++u) { - const bool ok = j + int(u) <= jb; - const uint at = uint((ok ? j + int(u) : ja) - base) * (TF_ATTN_D / 8) + 2 * lane; - k[u] = TfKey{tile[at], tile[at + 1]}; - valid |= (ok ? 1u : 0u) << u; - } - tf_attn_batch(s, q, k, valid, scale, lane); - } + float q[TF_ATTN_PH][16]; + for (uint hh = 0; hh < TF_ATTN_PH; ++hh) { + const ulong at = (ulong(r) * a.heads + h0 + min(hh, nh - 1)) * (TF_ATTN_D / 8) + 2 * lane; + tf_attn_pwiden(TfKey{Q[at], Q[at + 1]}, q[hh]); } - if (!on) return; + TfAccN s; + tf_attn_zero(s); + const int lo = max(m.pos - int(TF_ATTN_WIN) + 1, 0); + const device uint4* wk = W + ulong(m.wofs + lo - m.wbase) * (TF_ATTN_D / 8) + 2 * lane; + for (int t = lo; t <= m.pos; ++t, wk += TF_ATTN_D / 8) tf_attn_pkey(s, q, TfKey{wk[0], wk[1]}, scale, lane); + const device int4* ix = (const device int4*)(I + ulong(r) * TF_ATTN_SEL); + const device uint4* ck = C + ulong(m.cofs) * (TF_ATTN_D / 8) + 2 * lane; for (uint run = 0; run < TF_ATTN_NCH - 1; ++run) { if (int(run * TF_ATTN_RUN) >= m.ncomp) break; - TfAcc c; + const int end = min(m.ncomp, int((run + 1) * TF_ATTN_RUN)); + TfAccN c; tf_attn_zero(c); - tf_attn_selected(c, q, C, I + ulong(r) * TF_ATTN_SEL, m, run, scale, lane); + for (int j = int(run * TF_ATTN_RUN); j < end; j += 4) { + const int4 iv = ix[j / 4]; + for (uint u = 0; u < 4; ++u) { + const int jj = j + int(u); + if (jj >= end || iv[u] < 0 || (TF_CTL == 2 && jj == m.ncomp - 1)) continue; + const device uint4* kp = ck + uint(iv[u]) * (TF_ATTN_D / 8); + tf_attn_pkey(c, q, TfKey{kp[0], kp[1]}, scale, lane); + } + } if (c.n == 0) continue; - for (uint hh = 0; hh < TF_ATTN_HS; ++hh) tf_attn_join(s, hh, c.m[hh], c.l[hh], c.acc[hh]); + for (uint hh = 0; hh < TF_ATTN_PH; ++hh) tf_attn_join(s, hh, c.m[hh], c.l[hh], c.acc[hh]); } - for (uint hh = 0; hh < TF_ATTN_HS; ++hh) + for (uint hh = 0; hh < nh; ++hh) tf_attn_store(s, hh, SK[h0 + hh], CS + ulong(m.pos) * 64, O + (ulong(r) * a.heads + h0 + hh) * TF_ATTN_D, lane); } diff --git a/zig/kernels/xpu/contract_gate_controls.cl b/zig/kernels/xpu/contract_gate_controls.cl index 522a0d30ff1..edf1238a90c 100644 --- a/zig/kernels/xpu/contract_gate_controls.cl +++ b/zig/kernels/xpu/contract_gate_controls.cl @@ -90,3 +90,83 @@ KERNEL(256) void tf_ctl_fp16_sum(global const ushort *X, global const ushort *W, } if (lid == 0) Y[row] = (float)bv[0]; } + +// Gate 3: glue_quant.cl's topk_merge with a tie going to the higher id, so equal logits come out in the wrong order. +static void tf_best_high(float *v, int *i, local float *rv, local int *ri) { + float bv = sub_group_reduce_max(*v); + int bi = sub_group_reduce_max(*v == bv ? *i : -1); + if (get_sub_group_local_id() == 0) { rv[get_sub_group_id()] = bv; ri[get_sub_group_id()] = bi; } + barrier(CLK_LOCAL_MEM_FENCE); + bv = rv[0]; + bi = ri[0]; + for (int s = 1; s < 16; s++) + if (rv[s] > bv || (rv[s] == bv && ri[s] > bi)) { bv = rv[s]; bi = ri[s]; } + barrier(CLK_LOCAL_MEM_FENCE); + *v = bv; + *i = bi; +} + +KERNEL(256) void tf_ctl_topk_merge_ties(global const float *PV, global const int *PI, global const int *PF, int K, int NS, + global uint *OUT) { + local float rv[16]; + local int ri[16]; + const int lid = get_local_id(0), row = get_group_id(0); + const int live = lid < NS; + int ptr = 0; + if (lid == 0) { + int f = 0; + for (int s = 0; s < NS; s++) f |= PF[row * 256 + s]; + OUT[row * 132 + 128] = f; + } + for (int k = 0; k < min(K, 64); k++) { + float v = live && ptr < K ? PV[((long)row * 256 + lid) * 64 + ptr] : -INFINITY; + int i = live && ptr < K ? PI[((long)row * 256 + lid) * 64 + ptr] : -1; + float bv = v; + int bi = i; + tf_best_high(&bv, &bi, rv, ri); + if (i == bi) { + ptr++; + OUT[row * 132 + k] = as_uint(v); + OUT[row * 132 + 64 + k] = (uint)i; + } + } +} + +static void tf_best_low(float *v, int *i, local float *rv, local int *ri) { + float bv = sub_group_reduce_max(*v); + int bi = sub_group_reduce_min(*v == bv ? *i : 0x7fffffff); + if (get_sub_group_local_id() == 0) { rv[get_sub_group_id()] = bv; ri[get_sub_group_id()] = bi; } + barrier(CLK_LOCAL_MEM_FENCE); + bv = rv[0]; + bi = ri[0]; + for (int s = 1; s < 16; s++) + if (rv[s] > bv || (rv[s] == bv && ri[s] < bi)) { bv = rv[s]; bi = ri[s]; } + barrier(CLK_LOCAL_MEM_FENCE); + *v = bv; + *i = bi; +} + +// Gate 1: glue_quant.cl's topk_merge with the not-finite flag read off the merged candidates, not the whole row. +KERNEL(256) void tf_ctl_topk_merge_cand_flag(global const float *PV, global const int *PI, global const int *PF, int K, + int NS, global uint *OUT) { + local float rv[16]; + local int ri[16]; + const int lid = get_local_id(0), row = get_group_id(0); + const int live = lid < NS; + int ptr = 0; + int seen = 0; + for (int k = 0; k < min(K, 64); k++) { + float v = live && ptr < K ? PV[((long)row * 256 + lid) * 64 + ptr] : -INFINITY; + int i = live && ptr < K ? PI[((long)row * 256 + lid) * 64 + ptr] : 0x7fffffff; + float bv = v; + int bi = i; + tf_best_low(&bv, &bi, rv, ri); + seen |= !isfinite(bv); + if (i == bi) { + ptr++; + OUT[row * 132 + k] = as_uint(v); + OUT[row * 132 + 64 + k] = (uint)i; + } + } + if (lid == 0) OUT[row * 132 + 128] = seen; +} diff --git a/zig/kernels/xpu/qwen27/glue_quant.cl b/zig/kernels/xpu/qwen27/glue_quant.cl index e6e0a8227d0..e6576e5f3d8 100644 --- a/zig/kernels/xpu/qwen27/glue_quant.cl +++ b/zig/kernels/xpu/qwen27/glue_quant.cl @@ -212,6 +212,99 @@ KERNEL(256) void argmax(global const float *PV, global const int *PI, global int } } +// Top-K of fp16 logits rows [R, V] (K <= 64, V <= 262144), exact, ties to the lower id, in two kernels. +static inline int tk_better(float v, int i, float bv, int bi) { return v > bv || (v == bv && i < bi); } + +// Group-wide best (v, i) by value then lower id, the winner to all work-items; rv, ri: local float[16] and int[16]. +static void tk_best(float *v, int *i, local float *rv, local int *ri) { + float bv = sub_group_reduce_max(*v); + int bi = sub_group_reduce_min(*v == bv ? *i : 0x7fffffff); + if (get_sub_group_local_id() == 0) { rv[get_sub_group_id()] = bv; ri[get_sub_group_id()] = bi; } + barrier(CLK_LOCAL_MEM_FENCE); + bv = rv[0]; + bi = ri[0]; + for (int s = 1; s < 16; s++) + if (tk_better(rv[s], ri[s], bv, bi)) { bv = rv[s]; bi = ri[s]; } + barrier(CLK_LOCAL_MEM_FENCE); + *v = bv; + *i = bi; +} + +// topk_part, grid (ceil(V / 1024), R): K best of 1024 ids to PV, PI [R, 256, 64]; PF = 1 if any is not finite. +KERNEL(256) void topk_part(global const half *L, int V, int K, global float *PV, global int *PI, global int *PF) { + local float rv[16]; + local int ri[16]; + local int rf[16]; + const int lid = get_local_id(0), seg = get_group_id(0), row = get_group_id(1); + float v[4]; + int id[4]; + int bad = 0; + for (int j = 0; j < 4; j++) { + id[j] = seg * 1024 + lid + 256 * j; + v[j] = -INFINITY; + if (id[j] < V) { + const float x = (float)L[(long)row * V + id[j]]; + bad |= !isfinite(x); + v[j] = isnan(x) ? -INFINITY : x; + } else id[j] = 0x7fffffff; + } + for (int k = 0; k < min(K, 64); k++) { + float mv = v[0]; + int mi = id[0], mj = 0; + for (int j = 1; j < 4; j++) + if (tk_better(v[j], id[j], mv, mi)) { mv = v[j]; mi = id[j]; mj = j; } + float bv = mv; + int bi = mi; + tk_best(&bv, &bi, rv, ri); + if (mi == bi && (bi != 0x7fffffff || lid == 0)) { // a short group pads with (-inf, sentinel), from one item + v[mj] = -INFINITY; + id[mj] = 0x7fffffff; + PV[((long)row * 256 + seg) * 64 + k] = mv; + PI[((long)row * 256 + seg) * 64 + k] = mi; + } + } + const int any = sub_group_reduce_max(bad); + if (get_sub_group_local_id() == 0) rf[get_sub_group_id()] = any; + barrier(CLK_LOCAL_MEM_FENCE); + if (lid == 0) { + int f = 0; + for (int s = 0; s < 16; s++) f |= rf[s]; + PF[row * 256 + seg] = f; + } +} + +// topk_merge, grid (R): merges NS lists into OUT [R, 132] words: 64 values (fp32 bits), 64 ids, the not-finite flag. +KERNEL(256) void topk_merge(global const float *PV, global const int *PI, global const int *PF, int K, int NS, + global uint *OUT) { + local float rv[16]; + local int ri[16]; + local int rf[16]; + const int lid = get_local_id(0), row = get_group_id(0); + const int live = lid < NS; + int ptr = 0; + const int any = sub_group_reduce_max(live ? PF[row * 256 + lid] : 0); + if (get_sub_group_local_id() == 0) rf[get_sub_group_id()] = any; + barrier(CLK_LOCAL_MEM_FENCE); + if (lid == 0) { + int f = 0; + for (int s = 0; s < 16; s++) f |= rf[s]; + OUT[row * 132 + 128] = f; + } + barrier(CLK_LOCAL_MEM_FENCE); + for (int k = 0; k < min(K, 64); k++) { + float v = live && ptr < K ? PV[((long)row * 256 + lid) * 64 + ptr] : -INFINITY; + int i = live && ptr < K ? PI[((long)row * 256 + lid) * 64 + ptr] : 0x7fffffff; + float bv = v; + int bi = i; + tk_best(&bv, &bi, rv, ri); + if (i == bi) { + ptr++; + OUT[row * 132 + k] = as_uint(v); + OUT[row * 132 + 64 + k] = (uint)i; + } + } +} + // Taps for the drafter: TAPS[t][slot·D + e] = bf16(x + r) (the full hidden state after the layer), [T, 5 D]. KERNEL(256) void tap(global const float *X, global const half *R, global ushort *TAPS, int D, int slot) { const int t = get_group_id(1), e = get_global_id(0); diff --git a/zig/kernels/xpu/tp.cl b/zig/kernels/xpu/tp.cl new file mode 100644 index 00000000000..724f7378226 --- /dev/null +++ b/zig/kernels/xpu/tp.cl @@ -0,0 +1,154 @@ +// Level Zero P2P collectives for Intel Xe2: rank-ordered FP32 sums (#pragma OPENCL FP_CONTRACT OFF) for exact bits. +#pragma OPENCL FP_CONTRACT OFF +#pragma OPENCL EXTENSION cl_khr_fp16 : enable + +#define KERNEL(N) __attribute__((intel_reqd_sub_group_size(16))) __attribute__((reqd_work_group_size(N, 1, 1))) kernel + +static inline float bf2f(ushort h) { return as_float((uint)h << 16); } +static inline ushort f2bf(float f) { return intel_convert_bfloat16_as_ushort(f); } + +// 1-shot P2P AllReduce (FP16): out[i] = fp16_rte(p0[i] + p1[i]) +KERNEL(256) void tp2_allreduce_f16( + global const half *p0, + global const half *p1, + global half *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + const float4 s = convert_float4(vload4(idx, p0)) + convert_float4(vload4(idx, p1)); + vstore4(convert_half4_rte(s), idx, out); +} + +// 1-shot P2P AllReduce (FP16): out[i] = fp16_rte(((p0[i] + p1[i]) + p2[i]) + p3[i]) +KERNEL(256) void tp4_allreduce_f16( + global const half *p0, + global const half *p1, + global const half *p2, + global const half *p3, + global half *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + float4 s = convert_float4(vload4(idx, p0)) + convert_float4(vload4(idx, p1)); + s = s + convert_float4(vload4(idx, p2)); + s = s + convert_float4(vload4(idx, p3)); + vstore4(convert_half4_rte(s), idx, out); +} + +// 2-shot P2P ReduceScatter (FP16): sums slice [off4 .. off4 + slice_n4) into rs_out[0 .. slice_n4) +KERNEL(256) void tp2_rs_f16( + global const half *p0, + global const half *p1, + global half *rs_out, + int off4, + int slice_n4) +{ + const int idx = get_global_id(0); + if (idx >= slice_n4) return; + const int src = off4 + idx; + const float4 s = convert_float4(vload4(src, p0)) + convert_float4(vload4(src, p1)); + vstore4(convert_half4_rte(s), idx, rs_out); +} + +KERNEL(256) void tp4_rs_f16( + global const half *p0, + global const half *p1, + global const half *p2, + global const half *p3, + global half *rs_out, + int off4, + int slice_n4) +{ + const int idx = get_global_id(0); + if (idx >= slice_n4) return; + const int src = off4 + idx; + float4 s = convert_float4(vload4(src, p0)) + convert_float4(vload4(src, p1)); + s = s + convert_float4(vload4(src, p2)); + s = s + convert_float4(vload4(src, p3)); + vstore4(convert_half4_rte(s), idx, rs_out); +} + +// 1-shot P2P AllReduce (BF16) for BF16/FlashNext activations +KERNEL(256) void tp2_allreduce_bf16( + global const ushort *p0, + global const ushort *p1, + global ushort *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + const ushort4 a0 = vload4(idx, p0), a1 = vload4(idx, p1); + ushort4 r; + r.s0 = f2bf(bf2f(a0.s0) + bf2f(a1.s0)); + r.s1 = f2bf(bf2f(a0.s1) + bf2f(a1.s1)); + r.s2 = f2bf(bf2f(a0.s2) + bf2f(a1.s2)); + r.s3 = f2bf(bf2f(a0.s3) + bf2f(a1.s3)); + vstore4(r, idx, out); +} + +KERNEL(256) void tp4_allreduce_bf16( + global const ushort *p0, + global const ushort *p1, + global const ushort *p2, + global const ushort *p3, + global ushort *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + const ushort4 a0 = vload4(idx, p0), a1 = vload4(idx, p1), a2 = vload4(idx, p2), a3 = vload4(idx, p3); + ushort4 r; + r.s0 = f2bf(((bf2f(a0.s0) + bf2f(a1.s0)) + bf2f(a2.s0)) + bf2f(a3.s0)); + r.s1 = f2bf(((bf2f(a0.s1) + bf2f(a1.s1)) + bf2f(a2.s1)) + bf2f(a3.s1)); + r.s2 = f2bf(((bf2f(a0.s2) + bf2f(a1.s2)) + bf2f(a2.s2)) + bf2f(a3.s2)); + r.s3 = f2bf(((bf2f(a0.s3) + bf2f(a1.s3)) + bf2f(a2.s3)) + bf2f(a3.s3)); + vstore4(r, idx, out); +} + +// 1-shot P2P AllReduce (FP32) for FlashNext routed MoE / FP32 partials +KERNEL(256) void tp2_allreduce_f32( + global const float *p0, + global const float *p1, + global float *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + vstore4(vload4(idx, p0) + vload4(idx, p1), idx, out); +} + +KERNEL(256) void tp4_allreduce_f32( + global const float *p0, + global const float *p1, + global const float *p2, + global const float *p3, + global float *out, + int n4) +{ + const int idx = get_global_id(0); + if (idx >= n4) return; + float4 s = vload4(idx, p0) + vload4(idx, p1); + s = s + vload4(idx, p2); + s = s + vload4(idx, p3); + vstore4(s, idx, out); +} + +KERNEL(256) void tp4_rs_f32( + global const float *p0, + global const float *p1, + global const float *p2, + global const float *p3, + global float *rs_out, + int off4, + int slice_n4) +{ + const int idx = get_global_id(0); + if (idx >= slice_n4) return; + const int src = off4 + idx; + float4 s = vload4(src, p0) + vload4(src, p1); + s = s + vload4(src, p2); + s = s + vload4(src, p3); + vstore4(s, idx, rs_out); +} diff --git a/zig/qwen35_rules_host.zig b/zig/qwen35_rules_host.zig index 0316b391c3d..725dcb4541b 100644 --- a/zig/qwen35_rules_host.zig +++ b/zig/qwen35_rules_host.zig @@ -168,3 +168,41 @@ test "qwen35 rules: Metal 27B's parse refuses a nested tie disagreement and a ti try t.expectError(error.BadTiedHead, metal27.parse(t.allocator, try ties(a, base, "false", "true"), null)); try t.expectError(error.BadTiedHead, metal27.parse(t.allocator, try ties(a, base, "false", "1"), null)); } + +/// Each entry point's refusal of a head count of 0: its reader's word for a count below 1, HIP's by name. +fn zeroWord(b: rules.Backend) anyerror { + return switch (b) { + .metal27 => error.BadConfig, + .metal2b, .cuda => error.BadQwenConfig, + .hip => error.ZeroHeadCount, + }; +} + +/// The head counts the host divides by or groups with. +const head_counts = [_][]const u8{ "num_attention_heads", "num_key_value_heads", "linear_num_key_heads", "linear_num_value_heads" }; + +test "qwen35 rules: a head count of 0 is refused by name at every entry point, before any division" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var cases: std.EnumArray(rules.Backend, usize) = .initFill(0); + var derived: usize = 0; + for (try layers_host.reals(a)) |r| for ([_]bool{ true, false }) |declared| { + // without head_dim the width is hidden / num_attention_heads, the division a 0 reached on main + const base = if (declared) r.json else try variant(a, r.json, "head_dim", null); + for (std.enums.values(rules.Backend)) |b| { + entry(b, base) catch continue; // another backend's model, or a width this backend does not run + derived += @intFromBool(!declared); + for (head_counts) |key| { + const got = entry(b, try variant(a, base, key, "0")); + errdefer std.debug.print("{s} on {s}, head_dim {}: {s} = 0 gave {any}\n", .{ @tagName(b), r.file, declared, key, got }); + try t.expectError(zeroWord(b), got); + cases.getPtr(b).* += 1; + } + } + }; + errdefer std.debug.print("cases {any}, without head_dim {d}\n", .{ cases.values, derived }); + // four zeros on each admitted base: CUDA 7, Metal 27B 8, Metal 2B 1, HIP 18 (13 of all without head_dim) + try t.expectEqual([_]usize{ 4 * 7, 4 * 8, 4 * 1, 4 * 18 }, cases.values); + try t.expectEqual(@as(usize, 13), derived); +} diff --git a/zig/src/cli/catalog.zig b/zig/src/cli/catalog.zig new file mode 100644 index 00000000000..1a8e992ffb2 --- /dev/null +++ b/zig/src/cli/catalog.zig @@ -0,0 +1,166 @@ +//! The chat checkpoints the supported-models guide serves, with Hub sizes and the one-stream speeds our docs measured. +const std = @import("std"); +const Backend = @import("sys").machine.Backend; + +/// One stream's decode tok/s with drafts as shipped (or `plain`), on the chip it ran on, and the doc that records it. +pub const Speed = struct { backend: Backend, chip: []const u8, tok_s: f32, plain: bool = false, src: []const u8 }; + +/// TensorFold Web's quality suite on this checkpoint (tools/quality_suite.py): items passed of those graded. +pub const Quality = struct { passed: u16, items: u16, receipt: []const u8 }; + +/// The suite every quality figure here was measured with; a run under another digest is not comparable. +pub const quality_digest = "d21a62442423"; + +pub const Entry = struct { + title: []const u8, + format: []const u8, + repo: []const u8, + revision: ?[]const u8 = null, + drafter: ?[]const u8 = null, + drafter_revision: ?[]const u8 = null, + /// Installed with `hf download` into ~/models/DIR as its recipe does, not with `tensorfold pull`. + hf_dir: ?[]const u8 = null, + /// Safetensors bytes on the Hub, drafter included. + download: u64, + /// What the engine keeps resident, where the model guide documents a figure other than the download. + resident: ?u64 = null, + metal: bool = false, + cuda: bool = false, + /// Machines its recipe needs; GLM-5.3-Flash is served by a pair. + machines: u8 = 1, + /// `drafts`: M1-M4 serve it without its drafter (M5 tensor units); `only`: M1-M4 untested. + m5: enum { any, drafts, only } = .any, + speeds: []const Speed = &.{}, + quality: ?Quality = null, + recipe: []const u8, + + pub fn residentBytes(e: *const Entry) u64 { + return e.resident orelse e.download; + } +}; + +fn tenthsGib(t: u64) u64 { + return t * (1 << 30) / 10; +} + +const m = Backend.metal; +const c = Backend.cuda; + +pub const entries = [_]Entry{ + .{ .title = "Qwen3.5-2B", .format = "MLX 4-bit", .repo = "mlx-community/Qwen3.5-2B-MLX-4bit", .revision = "93760be4f1f69842a46bc13dbdc0f19e291392a3", .download = 1_722_271_785, .metal = true, .cuda = true, .quality = .{ .passed = 142, .items = 228, .receipt = "docs/receipts/quality-suite/mlx-community--Qwen3.5-2B-MLX-4bit.m5-ultra.json" }, .recipe = "docs/recipes/qwen3.5-2b-native.md" }, + .{ .title = "Qwen3.8-27B", .format = "MLX 4-bit + DFlash2", .repo = "TensorFold/Qwen3.8-27B-MLX-4bit", .drafter = "z-lab/Qwen3.8-27B-DFlash2", .download = 16_054_541_349 + 3_848_817_896, .metal = true, .cuda = true, .recipe = "docs/recipes/qwen3.8-27b.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 126, .src = "CHANGELOG 1.1.0" }, + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 77, .src = "CHANGELOG 1.2.6" }, + .{ .backend = m, .chip = "M5 Max", .tok_s = 64, .src = "CHANGELOG 1.0.3" }, + .{ .backend = m, .chip = "M5 Pro", .tok_s = 47.2, .src = "docs/recipes/qwen3.8-27b.md (1.2.1)" }, + .{ .backend = c, .chip = "GB10", .tok_s = 32.9, .src = "docs/receipts/qwen-cuda-first-token" }, + }, .quality = .{ .passed = 201, .items = 228, .receipt = "docs/receipts/quality-suite/TensorFold--Qwen3.8-27B-MLX-4bit.m5-ultra.json" } }, + .{ .title = "Nemotron 3.5 Lightning 30B-A3B", .format = "MLX 4-bit + MTP", .repo = "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit", .download = 18_527_064_363, .metal = true, .cuda = true, .recipe = "docs/recipes/nemotron-3.5.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 348, .src = "docs/recipes/nemotron-3.5.md" }, + .{ .backend = m, .chip = "M5 Max", .tok_s = 262.8, .src = "RELEASE-NOTES-1.0.0.md" }, + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 188, .src = "docs/recipes/nemotron-3.5.md" }, + .{ .backend = c, .chip = "GB10", .tok_s = 133, .src = "CHANGELOG 1.0.6" }, + .{ .backend = c, .chip = "RTX PRO 6000", .tok_s = 607, .src = "CHANGELOG 1.0.6" }, + .{ .backend = c, .chip = "RTX 3090", .tok_s = 252, .src = "CHANGELOG 1.0.3" }, + }, .quality = .{ .passed = 192, .items = 228, .receipt = "docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.m5-max.json" } }, + .{ .title = "Nemotron 3.5 Lightning 30B-A3B", .format = "oQ4", .repo = "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4", .download = 18_563_590_359, .metal = true, .quality = .{ .passed = 192, .items = 228, .receipt = "docs/receipts/quality-suite/TensorFold--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4.m5-ultra.json" }, .recipe = "docs/recipes/nemotron-3.5.md" }, + .{ .title = "Nemotron 3.5 Lightning 30B-A3B", .format = "oQ6", .repo = "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ6", .download = 25_964_450_050, .metal = true, .recipe = "docs/recipes/nemotron-3.5.md" }, + .{ .title = "Nemotron 3.5 Lightning 30B-A3B", .format = "oQ8", .repo = "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ8", .download = 33_559_963_986, .metal = true, .recipe = "docs/recipes/nemotron-3.5.md" }, + .{ .title = "Nemotron 3.5 Lightning 30B-A3B", .format = "NVFP4 + MTP", .repo = "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4", .download = 21_561_882_284, .cuda = true, .recipe = "docs/recipes/nemotron-3.5.md", .speeds = &.{ + .{ .backend = c, .chip = "GB10", .tok_s = 105, .src = "CHANGELOG 1.0.6" }, + }, .quality = .{ .passed = 196, .items = 228, .receipt = "docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4.gb10.json" } }, + .{ .title = "Nemotron 3.5 Super VL 120B-A12B", .format = "NVFP4", .repo = "nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4", .revision = "82d93699acd3be9e4617c53360fe5b3f5dbeb1b3", .download = 75_010_188_240, .cuda = true, .recipe = "docs/recipes/nemotron-3.5-super-vl.md", .speeds = &.{ + .{ .backend = c, .chip = "GB10", .tok_s = 38.2, .src = "docs/recipes/nemotron-3.5-super-vl.md" }, + }, .quality = .{ .passed = 207, .items = 228, .receipt = "docs/receipts/quality-suite/nvidia--NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4.gb10.json" } }, + .{ .title = "Nemotron 3.5 Bolt 74B-A9B", .format = "NVIDIA 24 GB", .repo = "nvidia/NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB", .download = 24_083_745_496, .cuda = true, .recipe = "docs/recipes/nemotron-omni-video.md" }, + .{ .title = "Qwen3.8 Flash Next", .format = "MLX 6-bit + MTP", .repo = "TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTP", .download = 158_080_738_442, .metal = true, .recipe = "docs/recipes/qwen3.8-flash-next.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 150, .src = "docs/recipes/speed-up-mode.md" }, + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 96, .src = "CHANGELOG 1.0.12" }, + } }, + .{ .title = "Qwen3.8 Flash Next", .format = "MLX 4-bit + MTP", .repo = "TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTP", .download = 113_209_682_735, .resident = tenthsGib(733), .metal = true, .cuda = true, .recipe = "docs/recipes/qwen3.8-flash-next.md", .speeds = &.{ + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 137.3, .src = "CHANGELOG 1.2.7" }, + .{ .backend = c, .chip = "GB10", .tok_s = 65.8, .src = "docs/receipts/flashnext-lanes" }, + }, .quality = .{ .passed = 209, .items = 228, .receipt = "docs/receipts/quality-suite/TensorFold--Qwen3.8-Flash-Next-MLX-4bit-MTP.m5-ultra.json" } }, + .{ .title = "GLM-5.3-Flash", .format = "MLX 4-bit + MTP", .repo = "TensorFold/GLM-5.3-Flash-MLX-4bit-MTP", .download = 181_709_451_790, .metal = true, .machines = 2, .recipe = "docs/recipes/glm-5.3-flash.md" }, + .{ .title = "GLM-5.3-Flash", .format = "NVFP4", .repo = "nvidia/GLM-5.3-Flash-NVFP4", .revision = "423acf37583782c51c142d145aef733d72943d93", .download = 204_439_103_396, .cuda = true, .machines = 2, .recipe = "docs/recipes/glm-5.3-flash-cuda.md" }, + .{ .title = "GLM-5.3-Flash", .format = "FP4-Local", .repo = "nvidia/GLM-5.3-Flash-FP4-Local", .revision = "76348ddb2be2e35e39ecfc00e75dc07703f4f3d5", .download = 177_463_841_024, .cuda = true, .machines = 2, .recipe = "docs/recipes/glm-5.3-flash-cuda.md" }, + .{ .title = "LFM2.5-24B-A2B", .format = "MLX 4-bit", .repo = "LiquidAI/LFM2.5-24B-A2B-MLX-4bit", .revision = "667408d494bde191c2cb9dd4f4549827816b9275", .download = 13_567_294_335, .metal = true, .cuda = true, .recipe = "docs/recipes/lfm2.5-24b-a2b.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 266.5, .src = "docs/recipes/lfm2.5-24b-a2b.md" }, + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 194, .src = "CHANGELOG 1.0.12" }, + .{ .backend = c, .chip = "GB10", .tok_s = 87, .src = "docs/recipes/lfm2.5-24b-a2b.md" }, + }, .quality = .{ .passed = 173, .items = 228, .receipt = "docs/receipts/quality-suite/LiquidAI--LFM2.5-24B-A2B-MLX-4bit.m5-ultra.json" } }, + .{ .title = "LFM2.5-24B-A2B", .format = "MLX 6-bit", .repo = "LiquidAI/LFM2.5-24B-A2B-MLX-6bit", .revision = "1deec53eb49571e21cdcbf82fd5839248f07ed88", .download = 19_493_321_709, .metal = true, .recipe = "docs/recipes/lfm2.5-24b-a2b.md", .speeds = &.{ + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 168, .src = "CHANGELOG 1.0.12" }, + } }, + .{ .title = "LFM2.5-24B-A2B", .format = "MLX 8-bit", .repo = "LiquidAI/LFM2.5-24B-A2B-MLX-8bit", .revision = "67ab417dd02d0c9545802a726df668620eae049d", .download = 25_484_884_997, .metal = true, .recipe = "docs/recipes/lfm2.5-24b-a2b.md", .speeds = &.{ + .{ .backend = m, .chip = "M3 Ultra", .tok_s = 160, .src = "CHANGELOG 1.0.12" }, + } }, + .{ .title = "Qwen3.6-35B-A3B", .format = "MLX 4-bit + MTP", .repo = "TensorFold/Qwen3.6-35B-A3B-MLX-4bit-MTP", .revision = "81169a9bc511a27c1b4eedb77a2cd98ced431847", .download = 20_877_599_118, .cuda = true, .recipe = "docs/recipes/qwen3.6-moe.md", .speeds = &.{ + .{ .backend = c, .chip = "GB10", .tok_s = 115.7, .src = "docs/recipes/qwen3.6-moe.md" }, + }, .quality = .{ .passed = 204, .items = 228, .receipt = "docs/receipts/quality-suite/TensorFold--Qwen3.6-35B-A3B-MLX-4bit-MTP.gb10.json" } }, + .{ .title = "Qwen3.6-35B-A3B", .format = "NVFP4 + MTP", .repo = "nvidia/Qwen3.6-35B-A3B-NVFP4", .revision = "1355db6a052410cfd62085d94b58866fd0f2c3c5", .download = 23_424_338_320, .resident = tenthsGib(209), .cuda = true, .recipe = "docs/recipes/qwen3.6-moe.md", .speeds = &.{ + .{ .backend = c, .chip = "GB10", .tok_s = 111.8, .src = "docs/recipes/qwen3.6-moe.md" }, + } }, + .{ .title = "Gemma 4 31B", .format = "MLX 4-bit + DFlash", .repo = "mlx-community/gemma-4-31B-it-4bit", .revision = "696d436c404745a59f30e4939a658162b0a9e57f", .drafter = "z-lab/gemma-4-31B-it-DFlash", .drafter_revision = "eabd648301ce28583cc14757912e5e0f84e152e1", .download = 18_412_016_676 + 3_071_941_240, .metal = true, .cuda = true, .m5 = .drafts, .recipe = "docs/recipes/gemma-4-native.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 150, .src = "docs/recipes/gemma-4-native.md" }, + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 51, .plain = true, .src = "docs/recipes/gemma-4-native.md" }, + .{ .backend = c, .chip = "GB10", .tok_s = 29.9, .src = "CHANGELOG 1.1.4" }, + } }, + .{ .title = "MiniMax-M3.1-Flash", .format = "3/4-bit, 32K window", .repo = "BobClawblaw/MiniMax-M3.1-Flash-MLX-mix34", .revision = "9524999057e0d277d26438606e033e2191fb465c", .hf_dir = "MiniMax-M3.1-Flash-MLX-mix34", .download = 218_737_136_413, .metal = true, .recipe = "docs/recipes/minimax-m3.1-flash.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 41.2, .src = "docs/recipes/minimax-m3.1-flash.md" }, + } }, + .{ .title = "MiniMax-M3.1-Flash", .format = "3/4-bit, 147K window", .repo = "BobClawblaw/MiniMax-M3.1-Flash-MLX-mix256k", .revision = "916e7ca1044f1c3e7566163096243c940327224d", .hf_dir = "MiniMax-M3.1-Flash-MLX-mix256k", .download = 203_109_159_689, .metal = true, .recipe = "docs/recipes/minimax-m3.1-flash.md", .speeds = &.{ + .{ .backend = m, .chip = "M5 Ultra", .tok_s = 44.0, .src = "docs/recipes/minimax-m3.1-flash.md" }, + } }, + .{ .title = "Recursive Flint 40B-A2.5B", .format = "MLX INT4", .repo = "RecursiveSI/flint-int4", .revision = "3b93f9053b530488405ae9fca51d4900d6ce21f0", .hf_dir = "flint-int4", .download = 22_568_912_600, .resident = tenthsGib(214), .metal = true, .m5 = .only, .recipe = "docs/recipes/flint.md" }, + .{ .title = "Kolibri-1", .format = "block FP8", .repo = "Aleph-Alpha/Kolibri-1", .revision = "e52eb4627d11516b0c01de49210ab5a4e4061444", .download = 78_841_467_208, .cuda = true, .recipe = "docs/recipes/kolibri-1.md", .speeds = &.{ + .{ .backend = c, .chip = "GB10", .tok_s = 49.8, .src = "docs/recipes/kolibri-1.md" }, + }, .quality = .{ .passed = 199, .items = 228, .receipt = "docs/receipts/quality-suite/Aleph-Alpha--Kolibri-1.gb10.json" } }, +}; + +test "every entry is in the supported-models guide, its docs exist, and its speeds are on its backends" { + const io = std.testing.io; + const guide = try std.Io.Dir.cwd().readFileAlloc(io, "docs/supported-models.md", std.testing.allocator, .limited(4 << 20)); + defer std.testing.allocator.free(guide); + for (entries) |e| { + if (std.mem.indexOf(u8, guide, e.repo) == null) std.debug.print("{s} is not in docs/supported-models.md\n", .{e.repo}); + try std.testing.expect(std.mem.indexOf(u8, guide, e.repo) != null); + try std.Io.Dir.cwd().access(io, e.recipe, .{}); + for (e.speeds) |s| if (std.mem.startsWith(u8, s.src, "docs/")) { + const end = std.mem.indexOfScalar(u8, s.src, ' ') orelse s.src.len; + try std.Io.Dir.cwd().access(io, s.src[0..end], .{}); + }; + } +} + +test "every quality figure matches its receipt: the suite digest, the checkpoint, and the passed and graded items" { + const io = std.testing.io; + for (entries) |e| { + const q = e.quality orelse continue; + const text = try std.Io.Dir.cwd().readFileAlloc(io, q.receipt, std.testing.allocator, .limited(1 << 20)); + defer std.testing.allocator.free(text); + var parsed = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, text, .{}); + defer parsed.deinit(); + const root = parsed.value.object; + try std.testing.expectEqualStrings(quality_digest, root.get("suite").?.object.get("digest").?.string); + const checkpoint = root.get("checkpoint").?.string; + try std.testing.expectEqualStrings(e.repo, checkpoint[0 .. std.mem.indexOfScalar(u8, checkpoint, '@') orelse checkpoint.len]); + const overall = root.get("quality").?.object.get("overall").?.object; + try std.testing.expectEqual(@as(i64, q.passed), overall.get("passed").?.integer); + try std.testing.expectEqual(@as(i64, q.items), overall.get("items").?.integer); + try std.testing.expectEqual(@as(i64, 0), overall.get("unscored").?.integer); + } +} + +test "every entry has a size and a backend, and speeds on that backend" { + for (entries) |e| { + try std.testing.expect(e.download > 0 and (e.metal or e.cuda)); + try std.testing.expect(std.mem.startsWith(u8, e.recipe, "docs/recipes/")); + try std.testing.expect(std.mem.indexOfScalar(u8, e.repo, '/') != null); + if (e.revision) |r| try std.testing.expectEqual(@as(usize, 40), r.len); + for (e.speeds) |s| { + try std.testing.expect(s.tok_s > 0); + try std.testing.expect(if (s.backend == .metal) e.metal else e.cuda); + } + } +} diff --git a/zig/src/cli/cli.zig b/zig/src/cli/cli.zig index fec58d8866a..848dfadbc7d 100644 --- a/zig/src/cli/cli.zig +++ b/zig/src/cli/cli.zig @@ -11,8 +11,8 @@ const lora_merge = @import("core").lora_merge; pub const onDisk = models.onDisk; const usage = - \\usage: tensorfold models [--json] - \\ tensorfold info MODEL + \\usage: tensorfold models [--all] [--json] + \\ tensorfold info MODEL [--context N] [--parallel N|auto] \\ tensorfold rm REPO[@REVISION] [--yes] [--dry-run] \\ tensorfold pull REPO[@REVISION] \\ tensorfold pull REPO[@REVISION] --exlr8 PROFILE --node R/N --dir DIR @@ -43,12 +43,18 @@ pub fn main(init: std.process.Init, argv: []const [:0]const u8) !u8 { for (args, argv) |*x, y| x.* = y; const env = init.environ_map; if (std.mem.eql(u8, args[0], "models")) { - const json = args.len == 2 and std.mem.eql(u8, args[1], "--json"); - if (args.len != 1 and !json) { - try err.interface.writeAll(usage); - return 2; + var opts: models.Options = .{}; + for (args[1..]) |flag| { + if (std.mem.eql(u8, flag, "--json")) { + opts.json = true; + } else if (std.mem.eql(u8, flag, "--all")) { + opts.all = true; + } else { + try err.interface.writeAll(usage); + return 2; + } } - return models.run(a, init.io, &out.interface, env, null, json); + return models.run(a, init.io, &out.interface, env, null, opts, null); } if (std.mem.eql(u8, args[0], "pull")) { if (args.len < 2) { @@ -90,11 +96,12 @@ pub fn main(init: std.process.Init, argv: []const [:0]const u8) !u8 { }; return lora_merge.run(init.gpa, init.io, &out.interface, &err.interface, m.dense, m.adapter, m.dest, m.shipped); } - if (args.len != 2) { + const start = if (args.len >= 2) info.parseStart(args[2..]) else null; + if (start == null) { try err.interface.writeAll(usage); return 2; } - return info.run(a, init.io, &out.interface, env, null, args[1]); + return info.runStart(a, init.io, &out.interface, env, null, args[1], start.?); } test "wants only the checkpoint subcommands" { diff --git a/zig/src/cli/hub.zig b/zig/src/cli/hub.zig index ae2461f77fa..892e90de9e5 100644 --- a/zig/src/cli/hub.zig +++ b/zig/src/cli/hub.zig @@ -136,7 +136,7 @@ pub fn configInt(a: Allocator, io: std.Io, dir: []const u8, key: []const u8) ?u6 return if (v == .integer and v.integer >= 0) @intCast(v.integer) else null; } -/// config.json's model_type as the registry names it; without one, Woof's weights make it "woof", else "unknown". +/// config.json's model_type as the registry names it, in `a`; without one, Woof's weights make it "woof", else "unknown". pub fn modelType(a: Allocator, io: std.Io, dir: []const u8) []const u8 { const text = @import("checkpoint_config").optional(a, io, dir) orelse { // the family's weights_file; Woof's HF download ships no config.json @@ -147,7 +147,7 @@ pub fn modelType(a: Allocator, io: std.Io, dir: []const u8) []const u8 { defer parsed.deinit(); if (parsed.value != .object) return "unknown"; const t = parsed.value.object.get("model_type") orelse return "unknown"; - return if (t == .string) @import("checkpoint_config").servedType(t.string) else "unknown"; + return if (t == .string) a.dupe(u8, @import("checkpoint_config").servedType(t.string)) catch "unknown" else "unknown"; } const ConfigDetails = struct { is_bolt: bool, modelopt_formats: ?[]const []const u8 = null }; diff --git a/zig/src/cli/info.zig b/zig/src/cli/info.zig index 964dfd395cc..35de28f6559 100644 --- a/zig/src/cli/info.zig +++ b/zig/src/cli/info.zig @@ -1,4 +1,4 @@ -//! The `info` command: one checkpoint's family, format, context, weights size and memory floor. +//! The `info` command: one checkpoint's family, format, context, weights size and memory floor or startup budget. const std = @import("std"); const Allocator = std.mem.Allocator; const hub = @import("hub.zig"); @@ -10,8 +10,39 @@ pub const GiB: u64 = 1 << 30; /// The same reserve the native residency and preflight bounds keep. pub const runtime_margin = @import("sys").memory_policy.margin; +/// A start `info` prices: --context and --parallel as `serve` reads them. +pub const Start = struct { context: ?i64 = null, streams: u32 = 8, fixed: bool = false }; + +/// `[--context N] [--parallel N|auto]`; null on anything else. +pub fn parseStart(args: []const []const u8) ?Start { + var s: Start = .{}; + var i: usize = 0; + while (i < args.len) : (i += 2) { + if (i + 1 == args.len) return null; + const v = std.mem.trim(u8, args[i + 1], " "); + if (std.mem.eql(u8, args[i], "--context")) { + s.context = std.fmt.parseInt(i64, v, 10) catch return null; + } else if (!std.mem.eql(u8, args[i], "--parallel")) { + return null; + } else if (std.ascii.eqlIgnoreCase(v, "auto")) { + s.streams = 8; + s.fixed = false; + } else { + const n = std.fmt.parseInt(i64, v, 10) catch return null; + s.streams = @intCast(@max(1, @min(n, 4096))); + s.fixed = true; + } + } + return s; +} + /// Prints what a Zig family would serve from `model` (a directory or a cached repo id); returns the process exit code. pub fn run(a: Allocator, io: std.Io, out: *std.Io.Writer, env: ?*const std.process.Environ.Map, override: ?[]const u8, model: []const u8) !u8 { + return runStart(a, io, out, env, override, model, .{}); +} + +/// `run`, with `serve`'s startup charge priced at `start` where the engine has one. +pub fn runStart(a: Allocator, io: std.Io, out: *std.Io.Writer, env: ?*const std.process.Environ.Map, override: ?[]const u8, model: []const u8, start: Start) !u8 { const dir: []const u8 = blk: { if (hub.isDir(io, model)) break :blk model; if (hub.isRepoIdLike(model)) { @@ -70,13 +101,50 @@ pub fn run(a: Allocator, io: std.Io, out: *std.Io.Writer, env: ?*const std.proce const plan = try memory.budget(weights, memory.trained, inventory, 0); try out.print("startup budget: {d:.2} GiB (conservative raw/packed text weights, both prompt planes/selectors, KV/state, keepalive and {d} GiB runtime reserve; trained window)\n", .{ @as(f64, @floatFromInt(plan.steady)) / GiB, runtime_margin >> 30 }); try out.print("cold pack budget: {d:.2} GiB (source pages, one output phase and conversion scratch; skipped with a validated pack; vision and requested storage are additional at load)\n", .{@as(f64, @floatFromInt(plan.building)) / GiB}); - } else try out.print("memory floor: {d:.2} GiB (weights plus a {d:.2} GiB runtime margin)\n", .{ + } else if (try qwen27(a, io, out, model_type, dir, weights, start)) |code| return code else try out.print("memory floor: {d:.2} GiB (weights plus a {d:.2} GiB runtime margin)\n", .{ @as(f64, @floatFromInt(weights + runtime_margin)) / GiB, @as(f64, @floatFromInt(runtime_margin)) / GiB, }); return 0; } +/// The Qwen3.8-27B-class startup lines from `serve`'s own charge; null where this build's engines have none. +fn qwen27(a: Allocator, io: std.Io, out: *std.Io.Writer, model_type: []const u8, dir: []const u8, weights: u64, s: Start) !?u8 { + const engines = @import("native_engines"); + if (comptime !@hasDecl(engines, "qwen27Budget")) return null; + var problem: []const u8 = ""; + const b = (engines.qwen27Budget(a, io, model_type, dir, weights, s.context, s.streams, s.fixed, &problem) catch |err| { + if (err == error.OutOfMemory) return err; + if (err == error.ContextFull) { + try out.writeAll("startup budget: not priced (--context is past this checkpoint's max_position_embeddings)\n"); + return 1; + } + // a checkpoint the engine can't price keeps the floor + try out.print("startup budget: not priced ({s})\n", .{@errorName(err)}); + return null; + }) orelse { + if (problem.len == 0) return null; + try out.print("startup budget: not priced ({s})\n", .{problem}); + return 1; + }; + const charged = if (b.slots == 0) b.streams else b.slots; + try out.print("startup budget: {d:.2} GiB at --context {d}: weights, {d} stream{s} of KV and state, {d}-row prompt scratch (no drafter or images)\n", .{ gib(b.total), b.context, charged, if (charged == 1) "" else "s", b.rows }); + const set = gib(b.working_set); + const margin = engines.qwen27_margin >> 30; + if (b.slots == b.streams) { + try out.print("this Mac: fits beside its {d:.1} GiB Metal working set and an {d} GiB margin\n", .{ set, margin }); + } else if (b.slots == 0) { + try out.print("this Mac: not one stream fits its {d:.1} GiB Metal working set with an {d} GiB margin; serve refuses: lower --context\n", .{ set, margin }); + } else if (s.fixed) { + try out.print("this Mac: {d} of --parallel {d} fit its {d:.1} GiB Metal working set with an {d} GiB margin; serve refuses: lower --parallel or --context\n", .{ b.slots, b.streams, set, margin }); + } else try out.print("this Mac: {d} of {d} streams fit its {d:.1} GiB Metal working set with an {d} GiB margin; serve starts {d}\n", .{ b.slots, b.streams, set, margin, b.slots }); + return 0; +} + +fn gib(bytes: u64) f64 { + return @as(f64, @floatFromInt(bytes)) / GiB; +} + test "info prints family, format, context, weights and floor for a cached checkpoint" { var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena_state.deinit(); @@ -256,3 +324,72 @@ test "issue 934: info reads the same large config and reports an oversized confi try std.testing.expectEqual(@as(u8, 1), try run(a, io, &out.writer, null, null, dir)); try std.testing.expect(has(out.written(), "config.json is 67108865 bytes, over the 67108864-byte limit")); } + +test "info --context and --parallel parse as serve reads them" { + const t = std.testing; + try t.expectEqualDeep(Start{}, parseStart(&.{}).?); + try t.expectEqualDeep(Start{ .context = 65536 }, parseStart(&.{ "--context", "65536" }).?); + try t.expectEqualDeep(Start{ .context = 8192, .streams = 2, .fixed = true }, parseStart(&.{ "--parallel", "2", "--context", "8192" }).?); + try t.expectEqualDeep(Start{ .streams = 1, .fixed = true }, parseStart(&.{ "--parallel", "0" }).?); + try t.expectEqualDeep(Start{}, parseStart(&.{ "--parallel", "AUTO" }).?); + for ([_][]const []const u8{ &.{"--context"}, &.{ "--context", "lots" }, &.{ "--parallel", "two" }, &.{ "--drafter", "x" } }) |bad| try t.expect(parseStart(bad) == null); +} + +/// Prices the 27B's config at `start` with the working set capped at `cap_gib`. +fn price27(a: Allocator, io: std.Io, dir: []const u8, cap_gib: u64, start: Start) !struct { code: u8, text: []const u8 } { + const env = @import("sys").env; + const cap = try std.fmt.allocPrintSentinel(a, "{d}", .{cap_gib << 30}, 0); + _ = env.setenv("TF_QWEN27_WORKING_SET_BYTES", cap, 1); + defer _ = env.unsetenv("TF_QWEN27_WORKING_SET_BYTES"); + var out: std.Io.Writer.Allocating = .init(a); + const code = try runStart(a, io, &out.writer, null, null, dir, start); + return .{ .code = code, .text = out.written() }; +} + +test "info prices a Qwen3.8-27B start from serve's charge: context, streams and the Mac's working set" { + if (comptime !@hasDecl(@import("native_engines"), "qwen27Budget")) return error.SkipZigTest; + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + const dir = try tmp.dir.realPathFileAlloc(io, ".", a); + try tmp.dir.writeFile(io, .{ .sub_path = "config.json", .data = + \\{"model_type":"qwen3_5","hidden_size":5120,"intermediate_size":17408,"num_hidden_layers":64,"vocab_size":248320,"num_attention_heads":24,"num_key_value_heads":4,"head_dim":256,"linear_num_key_heads":16,"linear_num_value_heads":48,"linear_key_head_dim":128,"linear_value_head_dim":128,"linear_conv_kernel_dim":4,"rms_norm_eps":0.000001,"partial_rotary_factor":0.25,"rope_theta":10000000,"full_attention_interval":4,"max_position_embeddings":262144,"eos_token_id":248046} + }); + const small = try price27(a, io, dir, 4096, .{ .context = 8192, .streams = 1, .fixed = true }); + try std.testing.expectEqual(@as(u8, 0), small.code); + try std.testing.expect(has(small.text, "startup budget: ")); + try std.testing.expect(has(small.text, " at --context 8192: weights, 1 stream of KV and state, ")); + try std.testing.expect(has(small.text, "this Mac: fits beside its ")); + try std.testing.expect(std.mem.indexOf(u8, small.text, "memory floor") == null); + const big = try price27(a, io, dir, 4096, .{ .context = 262144, .streams = 1, .fixed = true }); + // 16 attention layers of 4x256 K and V at 262,144 tokens + try std.testing.expect(gibOf(big.text) > gibOf(small.text) + 10); + const two = try price27(a, io, dir, 4096, .{ .context = 8192, .streams = 2, .fixed = true }); + try std.testing.expect(has(two.text, "2 streams of KV and state")); + try std.testing.expect(gibOf(two.text) > gibOf(small.text)); + const tight = try price27(a, io, dir, 8, .{ .context = 8192, .streams = 1, .fixed = true }); + try std.testing.expect(has(tight.text, "not one stream fits its 8.0 GiB Metal working set with an 8 GiB margin; serve refuses")); + const auto = try price27(a, io, dir, 4096, .{ .context = 8192 }); + try std.testing.expect(has(auto.text, "8 streams of KV and state")); + const past = try price27(a, io, dir, 4096, .{ .context = 300000 }); + try std.testing.expectEqual(@as(u8, 1), past.code); + try std.testing.expect(has(past.text, "--context 300000 is outside this Qwen checkpoint's 1 to 262,144 tokens")); + // a shape the engine refuses (16 query heads over 2 KV heads) keeps the floor + try tmp.dir.writeFile(io, .{ .sub_path = "config.json", .data = + \\{"model_type":"qwen3_5","hidden_size":5120,"intermediate_size":17408,"num_hidden_layers":64,"vocab_size":248320,"num_attention_heads":16,"num_key_value_heads":2,"head_dim":256,"linear_num_key_heads":16,"linear_num_value_heads":48,"linear_key_head_dim":128,"linear_value_head_dim":128,"linear_conv_kernel_dim":4,"rms_norm_eps":0.000001,"partial_rotary_factor":0.25,"rope_theta":10000000,"full_attention_interval":4,"max_position_embeddings":262144,"eos_token_id":248046} + }); + const refused = try price27(a, io, dir, 4096, .{}); + try std.testing.expectEqual(@as(u8, 0), refused.code); + try std.testing.expect(has(refused.text, "startup budget: not priced (")); + try std.testing.expect(has(refused.text, "memory floor: ")); +} + +/// The GiB figure of a "startup budget: X GiB" line. +fn gibOf(text: []const u8) f64 { + const at = (std.mem.indexOf(u8, text, "startup budget: ") orelse return 0) + "startup budget: ".len; + const end = std.mem.indexOfScalarPos(u8, text, at, ' ') orelse return 0; + return std.fmt.parseFloat(f64, text[at..end]) catch 0; +} diff --git a/zig/src/cli/models.zig b/zig/src/cli/models.zig index 48b3add191a..4c20c26e530 100644 --- a/zig/src/cli/models.zig +++ b/zig/src/cli/models.zig @@ -1,27 +1,186 @@ -//! The `models` command: the checkpoints on disk that a registered Zig family can serve. +//! The `models` command: the documented chat checkpoints that fit this machine with a rough speed, and those on disk. const std = @import("std"); const Allocator = std.mem.Allocator; const hub = @import("hub.zig"); +const catalog = @import("catalog.zig"); +const sys = @import("sys"); +const machine = sys.machine; +const Machine = machine.Machine; +const Entry = catalog.Entry; + +const gib = machine.gib; +/// Room past the floor for a context and caches before a fit counts as comfortable. +const room: u64 = 4 * gib; +/// What a Mac keeps for macOS once its GPU limit is raised. +const mac_reserve: u64 = 8 * gib; + +pub const Options = struct { json: bool = false, all: bool = false }; /// One listed checkpoint: the facts a line prints, and the fields of a `--json` entry. const Listed = struct { repo: []const u8, family: []const u8, model_type: []const u8 }; -/// The cache checkpoints a Zig family serves, as lines or as one JSON document. Returns the process exit code. -pub fn run(a: Allocator, io: std.Io, out: *std.Io.Writer, env: ?*const std.process.Environ.Map, override: ?[]const u8, json: bool) !u8 { +pub const Fit = enum { fits, tight, raise_limit, untested, too_big, pair, other_backend, unknown }; + +/// A speed shown for this machine: measured on its chip, or scaled from another chip by memory bandwidth. +pub const Estimate = struct { tok_s: f64, measured: bool, from: []const u8, plain: bool }; + +const Disk = enum { no, yes, drafter_missing }; +const Row = struct { e: *const Entry, need: u64, fit: Fit, speed: ?Estimate, disk: Disk }; + +/// The engine's floor: what it keeps resident plus the runtime margin `info` reports. +pub fn need(e: *const Entry) u64 { + return e.residentBytes() + sys.memory_policy.margin; +} + +pub fn fitOf(e: *const Entry, mc: *const Machine) Fit { + if (mc.backend == .none) return .unknown; + if (e.machines > 1) return .pair; + if (!(if (mc.backend == .metal) e.metal else e.cuda)) return .other_backend; + const n = need(e); + if (n > mc.gpu_limit) return if (mc.backend == .metal and n + mac_reserve <= mc.memory) .raise_limit else .too_big; + if (mc.backend == .metal and e.m5 == .only and !m5(mc.chip())) return .untested; + return if (n + room <= mc.gpu_limit) .fits else .tight; +} + +/// A measurement on this chip, else the nearest on this backend (same chip generation first) scaled by bandwidth. +pub fn estimate(e: *const Entry, mc: *const Machine) ?Estimate { + if (mc.backend == .none) return null; + const plain = mc.backend == .metal and e.m5 == .drafts and !m5(mc.chip()); + for (e.speeds) |s| if (s.backend == mc.backend and s.plain == plain and contains(mc.chip(), s.chip)) + return .{ .tok_s = s.tok_s, .measured = true, .from = s.chip, .plain = plain }; + if (mc.bandwidth == 0) return null; + const here: f64 = @floatFromInt(mc.bandwidth); + var best: ?catalog.Speed = null; + var best_score = std.math.inf(f64); + for (e.speeds) |s| { + if (s.backend != mc.backend or s.plain != plain) continue; + const bw = machine.bandwidthOf(s.chip); + if (bw == 0) continue; + const score = @abs(@log(@as(f64, @floatFromInt(bw)) / here)) + @as(f64, if (generation(s.chip) == generation(mc.chip())) 0 else 10); + if (score < best_score) { + best_score = score; + best = s; + } + } + const s = best orelse return null; + return .{ .tok_s = s.tok_s * here / @as(f64, @floatFromInt(machine.bandwidthOf(s.chip))), .measured = false, .from = s.chip, .plain = plain }; +} + +/// Lists the catalog against this machine (or `given`) and the cache's checkpoints; returns the process exit code. +pub fn run(a: Allocator, io: std.Io, out: *std.Io.Writer, env: ?*const std.process.Environ.Map, override: ?[]const u8, opts: Options, given: ?Machine) !u8 { const root = try hub.cacheDir(a, env, override); - const found = (try find(a, io, root)) orelse { - if (json) return printJson(out, &.{}); - try out.print("no checkpoints on disk: the Hugging Face cache at {s} does not exist yet; run: tensorfold pull OWNER/NAME\n", .{root}); - return 0; - }; - var listed: std.ArrayList(Listed) = .empty; - for (found) |f| try listed.append(a, f.listed); - if (json) return printJson(out, listed.items); - for (listed.items) |m| try out.print("{s}: {s} ({s})\n", .{ m.repo, m.family, m.model_type }); - if (listed.items.len == 0) try out.print("no checkpoints on disk that a registered Zig family can serve; run: tensorfold pull OWNER/NAME\n", .{}); + const listed = try cached(a, io, root); + const mc = given orelse machine.detect(a, io); + const rows = try a.alloc(Row, catalog.entries.len); + for (rows, &catalog.entries) |*r, *e| r.* = .{ .e = e, .need = need(e), .fit = fitOf(e, &mc), .speed = estimate(e, &mc), .disk = try diskOf(a, io, root, env, e) }; + std.mem.sort(Row, rows, {}, struct { + fn less(_: void, x: Row, y: Row) bool { + if (x.fit != y.fit) return @backingInt(x.fit) < @backingInt(y.fit); + return x.need > y.need; + } + }.less); + if (opts.json) return printJson(a, out, listed, &mc, rows); + try printMachine(out, &mc); + const shown = runnable(rows, mc.backend == .none or opts.all); + if (shown == 0) { + try out.writeAll("No catalog model fits here.\n"); + } else { + try out.print("{s}, largest first:\n", .{if (mc.backend == .none) "Every model and the memory it needs" else if (mc.backend == .metal) "Models that fit this Mac" else "Models that fit this machine"}); + try printRows(a, out, rows[0..shown], &mc, true); + } + if (opts.all and shown < rows.len and mc.backend != .none) { + try out.writeAll("\nThe rest, with what each needs:\n"); + try printRows(a, out, rows[shown..], &mc, false); + } + try out.print("\nMemory is the weights and any drafter the engine keeps, plus a {d} GiB margin; context and caches take more.\n", .{sys.memory_policy.margin >> 30}); + try out.writeAll("Speed is one stream with drafts as shipped: measured on that chip, or estimated from another by memory bandwidth.\n"); + try out.writeAll("Quality is the share of TensorFold Web's 228-item quality suite the checkpoint gets right (greedy, thinking off);\n" ++ + "each score's receipt is in docs/receipts/quality-suite, and - is not rated yet.\n"); + if (!opts.all and shown < rows.len) try out.print("{d} more need more memory, two machines or the other backend: tensorfold models --all\n", .{rows.len - shown}); + try printCached(out, root, listed); return 0; } +/// Rows sort runnable fits first; this counts them (every row when the machine is unknown). +fn runnable(rows: []const Row, every: bool) usize { + if (every and rows.len > 0 and rows[0].fit == .unknown) return rows.len; + var n: usize = 0; + for (rows) |r| { + if (@backingInt(r.fit) > @backingInt(Fit.untested)) break; + n += 1; + } + return n; +} + +fn printMachine(out: *std.Io.Writer, mc: *const Machine) !void { + const name = if (mc.chip().len > 0) mc.chip() else "This machine"; + if (mc.backend == .none) return out.print("{s}: no Metal or CUDA GPU found.\n\n", .{name}); + try out.writeAll(name); + if (mc.gpu_cores > 0) try out.print(", {d}-core GPU", .{mc.gpu_cores}); + if (mc.gpus > 1) try out.print(", {d} GPUs (one counted)", .{mc.gpus}); + if (mc.memory > 0) try out.print(", {d:.0} GiB memory", .{gibs(mc.memory)}); + try out.print(": {s} may hold {d:.1} GiB", .{ if (mc.backend == .metal) "Metal" else "CUDA", gibs(mc.gpu_limit) }); + if (mc.bandwidth > 0) try out.print(", {d} GB/s", .{mc.bandwidth / 1_000_000_000}); + try out.writeAll(".\n\n"); +} + +fn printRows(a: Allocator, out: *std.Io.Writer, rows: []const Row, mc: *const Machine, install: bool) !void { + var width: usize = 0; + for (rows) |r| width = @max(width, r.e.title.len + 2 + r.e.format.len); + try out.splatByteAll(' ', width + 4); + try out.print(" memory quality {s}\n", .{if (install) "speed, one stream" else "why not here"}); + for (rows) |r| { + const name = try std.fmt.allocPrint(a, "{s}, {s}", .{ r.e.title, r.e.format }); + try out.print(" {s}", .{name}); + try out.splatByteAll(' ', width - name.len + 2); + try out.print("{d:>6.1} GiB ", .{gibs(r.need)}); + if (r.e.quality) |q| try out.print("{d:>6.0}% ", .{share(q) * 100}) else try out.writeAll(" - "); + switch (r.fit) { + .too_big => try out.writeAll("more than the GPU may hold"), + .pair => try out.writeAll("served by two machines"), + .other_backend => try out.writeAll(if (mc.backend == .metal) "CUDA only" else "Metal only"), + else => try printSpeed(out, r, mc), + } + try out.writeAll(switch (r.disk) { + .yes => " [on disk]", + .drafter_missing => " [on disk, drafter missing]", + .no => "", + }); + try out.writeByte('\n'); + if (install) try out.print(" {s}\n", .{try installLine(a, r.e)}) else try out.print(" {s}\n", .{r.e.recipe}); + } +} + +fn printSpeed(out: *std.Io.Writer, r: Row, mc: *const Machine) !void { + if (r.speed) |s| { + try out.print("{s}{d:.0} tok/s", .{ if (s.measured) "" else "~", s.tok_s }); + if (s.measured) try out.print(", measured on {s}", .{s.from}) else try out.print(", est. from {s}", .{s.from}); + if (s.plain) try out.writeAll(", no drafts before M5"); + } else if (mc.backend != .none) try out.writeAll("speed not measured yet"); + try out.writeAll(switch (r.fit) { + .tight => "; little room for context", + .raise_limit => "; raise iogpu.wired_limit_mb (serve names the value)", + .untested => "; untested on M1-M4", + else => "", + }); +} + +/// The commands the supported-models guide gives: `tensorfold pull` with any drafter, or `hf download` into ~/models. +pub fn installLine(a: Allocator, e: *const Entry) ![]const u8 { + const main = if (e.hf_dir) |d| + try std.fmt.allocPrint(a, "hf download {s} --revision {s} --local-dir ~/models/{s}", .{ e.repo, e.revision.?, d }) + else + try std.fmt.allocPrint(a, "tensorfold pull {s}{s}{s}", .{ e.repo, if (e.revision != null) "@" else "", e.revision orelse "" }); + const d = e.drafter orelse return main; + return std.fmt.allocPrint(a, "{s} && tensorfold pull {s}{s}{s}", .{ main, d, if (e.drafter_revision != null) "@" else "", e.drafter_revision orelse "" }); +} + +fn printCached(out: *std.Io.Writer, root: []const u8, listed: []const Listed) !void { + if (listed.len == 0) return out.print("\nNo checkpoints a native family serves are in the Hugging Face cache at {s} yet.\n", .{root}); + try out.writeAll("\nIn the Hugging Face cache:\n"); + for (listed) |m| try out.print("{s}: {s} ({s})\n", .{ m.repo, m.family, m.model_type }); +} + const Found = struct { listed: Listed, snapshot: []const u8 }; /// The cache's checkpoints a Zig family serves, with their snapshot folders; null when the cache does not exist. @@ -51,13 +210,80 @@ pub fn onDisk(a: Allocator, io: std.Io, env: ?*const std.process.Environ.Map, ov return out; } -/// `{"schema": 1, "models": [...]}`: the same checkpoints the lines print, one object each, for programs. -fn printJson(out: *std.Io.Writer, listed: []const Listed) !u8 { - try std.json.Stringify.value(.{ .schema = 1, .models = listed }, .{}, out); +/// The same cached checkpoints as `onDisk`, without their snapshot sizes. +fn cached(a: Allocator, io: std.Io, root: []const u8) ![]const Listed { + const found = (try find(a, io, root)) orelse return &.{}; + const out = try a.alloc(Listed, found.len); + for (out, found) |*o, f| o.* = f.listed; + return out; +} + +fn diskOf(a: Allocator, io: std.Io, root: []const u8, env: ?*const std.process.Environ.Map, e: *const Entry) !Disk { + const home = if (env) |m| m.get("HOME") orelse m.get("USERPROFILE") else null; + const main = if (e.hf_dir) |d| + home != null and hub.isDir(io, try std.fs.path.join(a, &.{ home.?, "models", d })) + else + (try hub.cachedSnapshot(a, io, root, e.repo)) != null; + if (!main) return .no; + if (e.drafter) |d| if ((try hub.cachedSnapshot(a, io, root, d)) == null) return .drafter_missing; + return .yes; +} + +const JsonMachine = struct { chip: []const u8, backend: []const u8, gpu_cores: u32, gpus: u32, memory_bytes: u64, gpu_limit_bytes: u64, unified: bool, bandwidth_bytes_per_second: u64 }; +const JsonQuality = struct { passed: u16, items: u16, share: f64, digest: []const u8, receipt: []const u8 }; +const JsonEntry = struct { title: []const u8, format: []const u8, repo: []const u8, revision: ?[]const u8, drafter: ?[]const u8, need_bytes: u64, download_bytes: u64, fit: []const u8, tok_s: ?f64, tok_s_measured: ?bool, tok_s_from: ?[]const u8, quality: ?JsonQuality, on_disk: bool, install: []const u8, recipe: []const u8 }; + +/// The share of graded quality items passed, 0 to 1. +fn share(q: catalog.Quality) f64 { + return @as(f64, @floatFromInt(q.passed)) / @as(f64, @floatFromInt(q.items)); +} + +/// `{"schema": 1, "models": [...]}` as before (the cache), plus this machine and every catalog entry against it. +fn printJson(a: Allocator, out: *std.Io.Writer, listed: []const Listed, mc: *const Machine, rows: []const Row) !u8 { + const entries = try a.alloc(JsonEntry, rows.len); + for (entries, rows) |*j, r| j.* = .{ + .title = r.e.title, + .format = r.e.format, + .repo = r.e.repo, + .revision = r.e.revision, + .drafter = r.e.drafter, + .need_bytes = r.need, + .download_bytes = r.e.download, + .fit = @tagName(r.fit), + .tok_s = if (r.speed) |s| @round(s.tok_s * 10) / 10 else null, + .tok_s_measured = if (r.speed) |s| s.measured else null, + .tok_s_from = if (r.speed) |s| s.from else null, + .quality = if (r.e.quality) |q| .{ .passed = q.passed, .items = q.items, .share = @round(share(q) * 1000) / 1000, .digest = catalog.quality_digest, .receipt = q.receipt } else null, + .on_disk = r.disk == .yes, + .install = try installLine(a, r.e), + .recipe = r.e.recipe, + }; + const m: JsonMachine = .{ .chip = mc.chip(), .backend = @tagName(mc.backend), .gpu_cores = mc.gpu_cores, .gpus = mc.gpus, .memory_bytes = mc.memory, .gpu_limit_bytes = mc.gpu_limit, .unified = mc.unified, .bandwidth_bytes_per_second = mc.bandwidth }; + try std.json.Stringify.value(.{ .schema = 1, .models = listed, .machine = m, .catalog = entries }, .{}, out); try out.writeByte('\n'); return 0; } +fn gibs(bytes: u64) f64 { + return @as(f64, @floatFromInt(bytes)) / @as(f64, @floatFromInt(gib)); +} + +fn contains(haystack: []const u8, needle: []const u8) bool { + return std.mem.indexOf(u8, haystack, needle) != null; +} + +/// M5 GPUs have the tensor units some drafters need. +fn m5(chip: []const u8) bool { + return contains(chip, "M5"); +} + +/// An Apple chip's generation digit (M3 Ultra -> 3); 0 for other chips. +fn generation(chip: []const u8) u8 { + var i: usize = 0; + while (i + 1 < chip.len) : (i += 1) if (chip[i] == 'M' and std.ascii.isDigit(chip[i + 1])) return chip[i + 1] - '0'; + return 0; +} + /// models--Org--Name back to Org/Name: the first double dash separates them; other entries do not name a repo. fn repoFromDirName(a: Allocator, name: []const u8) !?[]const u8 { const prefix = "models--"; @@ -81,6 +307,18 @@ fn syntheticCache(a: Allocator, io: std.Io) ![]const u8 { return root; } +fn mac(chip: []const u8, cores: u32, memory: u64) Machine { + var m: Machine = .{ .backend = .metal, .unified = true, .gpu_cores = cores, .memory = memory, .gpu_limit = machine.defaultGpuLimit(memory) }; + m.setChip(chip); + m.bandwidth = machine.bandwidthFor(chip, cores); + return m; +} + +fn pick(repo: []const u8, format: []const u8) *const Entry { + for (&catalog.entries) |*e| if (std.mem.eql(u8, e.repo, repo) and std.mem.eql(u8, e.format, format)) return e; + unreachable; +} + test "models lists serve-able checkpoints and skips families Zig cannot serve" { var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena_state.deinit(); @@ -90,14 +328,86 @@ test "models lists serve-able checkpoints and skips families Zig cannot serve" { defer std.Io.Dir.cwd().deleteTree(io, root) catch {}; var out: std.Io.Writer.Allocating = .init(a); - const code = try run(a, io, &out.writer, null, root, false); + const code = try run(a, io, &out.writer, null, root, .{}, mac("Apple M5 Max", 40, 128 * gib)); try std.testing.expectEqual(@as(u8, 0), code); const listed = out.written(); - try std.testing.expect(std.mem.indexOf(u8, listed, "Org/Flash: Qwen3.8 Flash Next (qwen4_exp)") != null); + try std.testing.expect(has(listed, "Org/Flash: Qwen3.8 Flash Next (qwen4_exp)")); try std.testing.expect(std.mem.indexOf(u8, listed, "Org/Draft") == null); } -test "models --json prints the listed checkpoints as one document, and an absent cache as none" { +test "an M5 Max lists what fits largest first, measured and estimated speeds, and hides the rest without --all" { + var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena_state.deinit(); + const a = arena_state.allocator(); + const io = std.testing.io; + const missing = try std.fmt.allocPrint(a, ".tf-models-none-{d}", .{std.Io.Clock.awake.now(io).toNanoseconds()}); + + var out: std.Io.Writer.Allocating = .init(a); + try std.testing.expectEqual(@as(u8, 0), try run(a, io, &out.writer, null, missing, .{}, mac("Apple M5 Max", 40, 128 * gib))); + const text = out.written(); + try std.testing.expect(has(text, "Apple M5 Max, 40-core GPU, 128 GiB memory: Metal may hold 107.5 GiB, 614 GB/s.")); + try std.testing.expect(has(text, "Models that fit this Mac, largest first:")); + try std.testing.expect(has(text, "Qwen3.8-27B, MLX 4-bit + DFlash2")); + try std.testing.expect(has(text, "64 tok/s, measured on M5 Max")); + try std.testing.expect(has(text, " memory quality speed, one stream\n")); + try std.testing.expect(has(text, "19.3 GiB 84% 263 tok/s, measured on M5 Max")); // Lightning's receipt: 192 of 228 + try std.testing.expect(has(text, "GiB - speed not measured yet")); // an unrated, unmeasured checkpoint + try std.testing.expect(has(text, "Quality is the share of TensorFold Web's 228-item quality suite")); + try std.testing.expect(has(text, "tensorfold pull TensorFold/Qwen3.8-27B-MLX-4bit && tensorfold pull z-lab/Qwen3.8-27B-DFlash2")); + try std.testing.expect(has(text, "est. from M5 Ultra")); + try std.testing.expect(std.mem.indexOf(u8, text, "MLX 6-bit + MTP") == null); // 147 GiB of Flash Next does not fit + try std.testing.expect(std.mem.indexOf(u8, text, "NVFP4") == null); // CUDA only + try std.testing.expect(has(text, "more need more memory, two machines or the other backend: tensorfold models --all")); + try std.testing.expect(std.mem.indexOf(u8, text, "Qwen3.8 Flash Next, MLX 4-bit") == null or + std.mem.indexOf(u8, text, "Qwen3.8 Flash Next, MLX 4-bit").? < std.mem.indexOf(u8, text, "Qwen3.8-27B").?); // largest first + + var all: std.Io.Writer.Allocating = .init(a); + _ = try run(a, io, &all.writer, null, missing, .{ .all = true }, mac("Apple M5 Max", 40, 128 * gib)); + try std.testing.expect(has(all.written(), "The rest, with what each needs:")); + try std.testing.expect(has(all.written(), "MLX 6-bit + MTP")); + try std.testing.expect(has(all.written(), "served by two machines")); + try std.testing.expect(has(all.written(), "CUDA only")); + try std.testing.expect(has(all.written(), "more than the GPU may hold")); +} + +test "the fit rule: comfortable, tight, a raised Mac limit, too big, untested, and the other backend" { + const small = mac("Apple M4 Pro", 0, 24 * gib); // 16 GiB for the GPU + try std.testing.expectEqual(Fit.fits, fitOf(pick("mlx-community/Qwen3.5-2B-MLX-4bit", "MLX 4-bit"), &small)); + try std.testing.expectEqual(Fit.too_big, fitOf(pick("TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit", "MLX 4-bit + MTP"), &small)); // 19.3 GiB leaves macOS under 8 + try std.testing.expectEqual(Fit.too_big, fitOf(pick("TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTP", "MLX 6-bit + MTP"), &small)); + try std.testing.expectEqual(Fit.other_backend, fitOf(pick("Aleph-Alpha/Kolibri-1", "block FP8"), &small)); + try std.testing.expectEqual(Fit.pair, fitOf(pick("TensorFold/GLM-5.3-Flash-MLX-4bit-MTP", "MLX 4-bit + MTP"), &mac("Apple M5 Ultra", 0, 512 * gib))); + + const m32 = mac("Apple M5 Max", 32, 32 * gib); // 21.3 GiB for the GPU; the 27B's floor is 20.5 GiB + try std.testing.expectEqual(Fit.tight, fitOf(pick("TensorFold/Qwen3.8-27B-MLX-4bit", "MLX 4-bit + DFlash2"), &m32)); + try std.testing.expectEqual(Fit.raise_limit, fitOf(pick("mlx-community/gemma-4-31B-it-4bit", "MLX 4-bit + DFlash"), &m32)); // 22.0 GiB + try std.testing.expectEqual(Fit.untested, fitOf(pick("RecursiveSI/flint-int4", "MLX INT4"), &mac("Apple M3 Ultra", 0, 256 * gib))); + try std.testing.expectEqual(Fit.fits, fitOf(pick("RecursiveSI/flint-int4", "MLX INT4"), &mac("Apple M5 Max", 40, 128 * gib))); + + var spark: Machine = .{ .memory = 128 * gib }; + machine.applyNvidia(&spark, "NVIDIA GB10, [N/A]\n"); + try std.testing.expectEqual(Fit.fits, fitOf(pick("TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTP", "MLX 4-bit + MTP"), &spark)); + try std.testing.expectEqual(Fit.other_backend, fitOf(pick("TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTP", "MLX 6-bit + MTP"), &spark)); +} + +test "speeds: measured on this chip, scaled by bandwidth from the same generation, plain before M5, none unmeasured" { + const max = mac("Apple M5 Max", 40, 128 * gib); + const here = estimate(pick("TensorFold/Qwen3.8-27B-MLX-4bit", "MLX 4-bit + DFlash2"), &max).?; + try std.testing.expect(here.measured and here.tok_s == 64); + + const gemma = pick("mlx-community/gemma-4-31B-it-4bit", "MLX 4-bit + DFlash"); + const scaled = estimate(gemma, &max).?; // 150 on an M5 Ultra at 1,200 GB/s, here 614 + try std.testing.expect(!scaled.measured and !scaled.plain and std.math.approxEqAbs(f64, scaled.tok_s, 150.0 * 614.0 / 1200.0, 1e-6)); + const old = estimate(gemma, &mac("Apple M3 Ultra", 0, 256 * gib)).?; // drafts need M5: the plain 51 + try std.testing.expect(old.plain and std.math.approxEqAbs(f64, old.tok_s, 51.0 * 819.0 / 1200.0, 1e-6)); + + const lfm = estimate(pick("LiquidAI/LFM2.5-24B-A2B-MLX-4bit", "MLX 4-bit"), &max).?; + try std.testing.expectEqualStrings("M5 Ultra", lfm.from); // same generation beats the nearer M3 Ultra bandwidth + try std.testing.expectEqual(@as(?Estimate, null), estimate(pick("mlx-community/Qwen3.5-2B-MLX-4bit", "MLX 4-bit"), &max)); + try std.testing.expectEqual(@as(?Estimate, null), estimate(pick("TensorFold/Qwen3.8-27B-MLX-4bit", "MLX 4-bit + DFlash2"), &mac("Apple M9", 0, 64 * gib))); +} + +test "models --json keeps schema 1's cached checkpoints and adds the machine and the catalog" { var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena_state.deinit(); const a = arena_state.allocator(); @@ -106,7 +416,7 @@ test "models --json prints the listed checkpoints as one document, and an absent defer std.Io.Dir.cwd().deleteTree(io, root) catch {}; var out: std.Io.Writer.Allocating = .init(a); - try std.testing.expectEqual(@as(u8, 0), try run(a, io, &out.writer, null, root, true)); + try std.testing.expectEqual(@as(u8, 0), try run(a, io, &out.writer, null, root, .{ .json = true }, mac("Apple M5 Max", 40, 128 * gib))); var parsed = try std.json.parseFromSlice(std.json.Value, a, out.written(), .{}); defer parsed.deinit(); try std.testing.expectEqual(@as(i64, 1), parsed.value.object.get("schema").?.integer); @@ -115,11 +425,30 @@ test "models --json prints the listed checkpoints as one document, and an absent try std.testing.expectEqualStrings("Org/Flash", models[0].object.get("repo").?.string); try std.testing.expectEqualStrings("Qwen3.8 Flash Next", models[0].object.get("family").?.string); try std.testing.expectEqualStrings("qwen4_exp", models[0].object.get("model_type").?.string); + try std.testing.expectEqualStrings("metal", parsed.value.object.get("machine").?.object.get("backend").?.string); + const items = parsed.value.object.get("catalog").?.array.items; + try std.testing.expectEqual(catalog.entries.len, items.len); + try std.testing.expectEqualStrings("fits", items[0].object.get("fit").?.string); + var rated: usize = 0; + for (items) |item| switch (item.object.get("quality").?) { + .null => {}, + .object => |q| { + rated += 1; + try std.testing.expectEqualStrings(catalog.quality_digest, q.get("digest").?.string); + if (std.mem.eql(u8, item.object.get("repo").?.string, "TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit")) + try std.testing.expectEqual(@as(i64, 192), q.get("passed").?.integer); + }, + else => return error.TestUnexpectedResult, + }; + try std.testing.expect(rated > 0 and rated < items.len); var none: std.Io.Writer.Allocating = .init(a); const missing = try std.fs.path.join(a, &.{ root, "missing" }); - try std.testing.expectEqual(@as(u8, 0), try run(a, io, &none.writer, null, missing, true)); - try std.testing.expectEqualStrings("{\"schema\":1,\"models\":[]}\n", none.written()); + try std.testing.expectEqual(@as(u8, 0), try run(a, io, &none.writer, null, missing, .{ .json = true }, .{})); + var empty = try std.json.parseFromSlice(std.json.Value, a, none.written(), .{}); + defer empty.deinit(); + try std.testing.expectEqual(@as(usize, 0), empty.value.object.get("models").?.array.items.len); + try std.testing.expectEqualStrings("unknown", empty.value.object.get("catalog").?.array.items[0].object.get("fit").?.string); } test "onDisk sizes the checkpoints models lists, and an absent cache has none" { diff --git a/zig/src/cli/tests.zig b/zig/src/cli/tests.zig index cf33273d9bf..690d429bf8a 100644 --- a/zig/src/cli/tests.zig +++ b/zig/src/cli/tests.zig @@ -2,6 +2,7 @@ test { _ = @import("hub.zig"); _ = @import("models.zig"); + _ = @import("catalog.zig"); _ = @import("info.zig"); _ = @import("pull.zig"); _ = @import("plan.zig"); diff --git a/zig/src/cluster/node.zig b/zig/src/cluster/node.zig index e978b120b25..e565543278e 100644 --- a/zig/src/cluster/node.zig +++ b/zig/src/cluster/node.zig @@ -82,27 +82,11 @@ pub const Inventory = struct { } }; -/// macOS GPU limit when iogpu.wired_limit_mb is 0: fit to 107.5 of 128 GiB and 222.7 of 256 GiB, two thirds below that. -pub fn defaultGpuLimit(memory: u64) u64 { - const fit = memory / 10 * 9 -| 768 * gib / 100; - return @max(memory / 3 * 2, fit); -} - -/// The GPU limit a wired-limit setting gives: the setting itself when non-zero, else macOS's default. -pub fn gpuLimitFor(memory: u64, wired_limit_mb: u64) u64 { - return if (wired_limit_mb == 0) defaultGpuLimit(memory) else wired_limit_mb << 20; -} +const machine = @import("sys").machine; -/// Nominal memory bandwidth (bytes a second) for the chips we serve; 0 when unknown (the engine measures it). -pub fn bandwidthOf(chip: []const u8) u64 { - const table = [_]struct { []const u8, u64 }{ - .{ "M3 Ultra", 819 }, .{ "M2 Ultra", 800 }, .{ "M1 Ultra", 800 }, .{ "M4 Max", 546 }, .{ "M3 Max", 400 }, - .{ "M2 Max", 400 }, .{ "M1 Max", 400 }, .{ "M4 Pro", 273 }, .{ "GB10", 273 }, .{ "RTX PRO 6000", 1792 }, - .{ "RTX 5090", 1792 }, .{ "RTX 4090", 1008 }, .{ "RTX 3090", 936 }, - }; - for (table) |row| if (std.mem.indexOf(u8, chip, row[0]) != null) return row[1] * 1_000_000_000; - return 0; -} +pub const defaultGpuLimit = machine.defaultGpuLimit; +pub const gpuLimitFor = machine.gpuLimitFor; +pub const bandwidthOf = machine.bandwidthOf; /// A stable node id from a platform UUID (never zero). pub fn idFrom(uuid: []const u8) NodeId { diff --git a/zig/src/core/config_fields.zig b/zig/src/core/config_fields.zig new file mode 100644 index 00000000000..a0ece5aea76 --- /dev/null +++ b/zig/src/core/config_fields.zig @@ -0,0 +1,118 @@ +//! Typed config.json field reads (no defaults or pins): each refusal names its source and field. +const std = @import("std"); +const Value = std.json.Value; +pub const Object = std.json.ObjectMap; + +pub const Error = error{BadConfigField}; + +/// Why the last read refused, e.g. "config.json text_config: hidden_size is missing", in the caller's storage. +pub const Problem = struct { + bytes: [256]u8 = undefined, + len: usize = 0, + + pub fn text(p: *const Problem) []const u8 { + return p.bytes[0..p.len]; + } + + fn refuse(p: *Problem, at: At, comptime why: []const u8, args: anytype) Error { + var w: std.Io.Writer = .fixed(&p.bytes); + w.print("{s}: {s} " ++ why, .{ at.source, at.key } ++ args) catch {}; // full: the text is cut, not refused + p.len = w.end; + return error.BadConfigField; + } +}; + +/// Where a value came from: the document part (`config.json text_config`) and the key. +pub const At = struct { source: []const u8, key: []const u8 }; + +/// An integer's inclusive bounds, checked before any narrowing. +pub const Ints = struct { min: i64 = 0, max: i64 = std.math.maxInt(i64) }; + +/// What a present `null` means for an optional key: refused, or the same as an absent key. +pub const Nulls = enum { refused, absent }; + +/// The JSON kind a refusal names. +fn kind(v: Value) []const u8 { + return switch (v) { + .null => "null", + .bool => "a bool", + .integer => "an integer", + .float => "a float", + .number_string => "a number past 64 bits", + .string => "a string", + .array => "an array", + .object => "an object", + }; +} + +/// An integer-tagged value inside `range`, then cast to `T`; a float, string or bool is refused, never truncated. +pub fn int(comptime T: type, v: Value, range: Ints, at: At, p: *Problem) Error!T { + if (v != .integer) return p.refuse(at, "is {s}, not an integer", .{kind(v)}); + const n = v.integer; + if (n < range.min or n > range.max) return p.refuse(at, "is {d}, outside {d}..{d}", .{ n, range.min, range.max }); + return std.math.cast(T, n) orelse p.refuse(at, "is {d}, past {s}", .{ n, @typeName(T) }); +} + +/// An integer or float as f64 (std.json keeps 1e999 a number string, refused here, so the result is finite). +pub fn float(v: Value, at: At, p: *Problem) Error!f64 { + return switch (v) { + .integer => |n| @floatFromInt(n), + .float => |f| f, + else => p.refuse(at, "is {s}, not a number", .{kind(v)}), + }; +} + +/// A JSON bool; 0 and 1 are not bools here. +pub fn flag(v: Value, at: At, p: *Problem) Error!bool { + return if (v == .bool) v.bool else p.refuse(at, "is {s}, not a bool", .{kind(v)}); +} + +/// One object's fields, read under one source name into one Problem. +pub const Reader = struct { + object: Object, + source: []const u8, + problem: *Problem, + + pub fn at(r: Reader, key: []const u8) At { + return .{ .source = r.source, .key = key }; + } + + /// The key's value; absent is refused by name. + pub fn value(r: Reader, key: []const u8) Error!Value { + return r.object.get(key) orelse r.problem.refuse(r.at(key), "is missing", .{}); + } + + /// The key's value, null when absent (and when `null` with `.absent`); a `null` with `.refused` is refused. + pub fn optional(r: Reader, key: []const u8, nulls: Nulls) Error!?Value { + const v = r.object.get(key) orelse return null; + if (v != .null) return v; + return if (nulls == .absent) null else r.problem.refuse(r.at(key), "is null", .{}); + } + + pub fn requiredInt(r: Reader, comptime T: type, key: []const u8, range: Ints) Error!T { + return int(T, try r.value(key), range, r.at(key), r.problem); + } + + pub fn requiredFloat(r: Reader, key: []const u8) Error!f64 { + return float(try r.value(key), r.at(key), r.problem); + } + + pub fn optionalInt(r: Reader, comptime T: type, key: []const u8, nulls: Nulls, range: Ints) Error!?T { + const v = try r.optional(key, nulls) orelse return null; + return try int(T, v, range, r.at(key), r.problem); + } + + pub fn optionalFloat(r: Reader, key: []const u8, nulls: Nulls) Error!?f64 { + const v = try r.optional(key, nulls) orelse return null; + return try float(v, r.at(key), r.problem); + } + + pub fn optionalFlag(r: Reader, key: []const u8, nulls: Nulls) Error!?bool { + const v = try r.optional(key, nulls) orelse return null; + return try flag(v, r.at(key), r.problem); + } +}; + +test { + _ = @import("config_fields_test.zig"); +} diff --git a/zig/src/core/config_fields_test.zig b/zig/src/core/config_fields_test.zig new file mode 100644 index 00000000000..33cdd171711 --- /dev/null +++ b/zig/src/core/config_fields_test.zig @@ -0,0 +1,72 @@ +//! The field layer: every reader's admitted values, and each refusal by the source, field and reason it names. +const std = @import("std"); +const f = @import("config_fields.zig"); +const t = std.testing; + +fn doc(a: std.mem.Allocator, text: []const u8) !f.Object { + return (try std.json.parseFromSliceLeaky(std.json.Value, a, text, .{})).object; +} + +const fixture = + \\{"hidden_size":5120,"eps":1e-06,"theta":10000000,"wide":1e999,"flag":true,"none":null, + \\ "zero":0,"neg":-1,"big":4294967296,"huge":99999999999999999999,"text":"5","real":128.9,"list":[1]} +; + +test "field layer: a fixture's admitted values, read once each" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + var p: f.Problem = .{}; + const r: f.Reader = .{ .object = try doc(arena.allocator(), fixture), .source = "config.json", .problem = &p }; + try t.expectEqual(@as(usize, 5120), try r.requiredInt(usize, "hidden_size", .{ .min = 1 })); + try t.expectEqual(@as(u32, 0), try r.requiredInt(u32, "zero", .{})); + try t.expectEqual(@as(f64, 1e-6), try r.requiredFloat("eps")); + try t.expectEqual(@as(f64, 10000000), try r.requiredFloat("theta")); // an integer reads as a number + try t.expectEqual(@as(?usize, null), try r.optionalInt(usize, "absent", .refused, .{})); + try t.expectEqual(@as(?usize, null), try r.optionalInt(usize, "none", .absent, .{})); + try t.expectEqual(@as(?f64, null), try r.optionalFloat("none", .absent)); + try t.expectEqual(@as(?bool, true), try r.optionalFlag("flag", .refused)); + try t.expectEqual(@as(?bool, null), try r.optionalFlag("absent", .refused)); + try t.expectEqual(@as(usize, 0), p.len); // nothing refused, nothing written +} + +/// One read's refusal: BadConfigField, and the Problem's exact text. +fn refused(want: []const u8, got: anytype, p: *f.Problem) !void { + try t.expectError(error.BadConfigField, got); + try t.expectEqualStrings(want, p.text()); + p.len = 0; +} + +test "field layer: each malformed value is refused by source, field and reason; nothing is truncated or coerced" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + var p: f.Problem = .{}; + const r: f.Reader = .{ .object = try doc(arena.allocator(), fixture), .source = "config.json text_config", .problem = &p }; + const u32_range: f.Ints = .{ .min = 1, .max = std.math.maxInt(u32) }; + try refused("config.json text_config: absent is missing", r.requiredInt(usize, "absent", .{}), &p); + try refused("config.json text_config: none is null, not an integer", r.requiredInt(usize, "none", .{}), &p); + try refused("config.json text_config: none is null", r.optionalInt(usize, "none", .refused, .{}), &p); + try refused("config.json text_config: text is a string, not an integer", r.requiredInt(usize, "text", .{}), &p); + try refused("config.json text_config: real is a float, not an integer", r.requiredInt(usize, "real", .{}), &p); + try refused("config.json text_config: eps is a float, not an integer", r.optionalInt(usize, "eps", .absent, .{}), &p); + try refused("config.json text_config: flag is a bool, not an integer", r.requiredInt(usize, "flag", .{}), &p); + try refused("config.json text_config: list is an array, not an integer", r.requiredInt(usize, "list", .{}), &p); + try refused("config.json text_config: huge is a number past 64 bits, not an integer", r.requiredInt(u64, "huge", .{}), &p); + try refused("config.json text_config: zero is 0, outside 1..4294967295", r.requiredInt(usize, "zero", u32_range), &p); + try refused("config.json text_config: neg is -1, outside 0..9223372036854775807", r.requiredInt(usize, "neg", .{}), &p); + try refused("config.json text_config: big is 4294967296, outside 1..4294967295", r.requiredInt(usize, "big", u32_range), &p); + try refused("config.json text_config: big is 4294967296, past u32", r.requiredInt(u32, "big", .{}), &p); + try refused("config.json text_config: text is a string, not a number", r.requiredFloat("text"), &p); + try refused("config.json text_config: none is null, not a number", r.requiredFloat("none"), &p); + try refused("config.json text_config: none is null", r.optionalFloat("none", .refused), &p); + try refused("config.json text_config: wide is a number past 64 bits, not a number", r.requiredFloat("wide"), &p); + try refused("config.json text_config: zero is an integer, not a bool", r.optionalFlag("zero", .refused), &p); + try refused("config.json text_config: none is null", r.optionalFlag("none", .refused), &p); +} + +test "field layer: a long source and key are cut at the Problem's end, never past it" { + var p: f.Problem = .{}; + const long: [300]u8 = @splat('k'); + try t.expectError(error.BadConfigField, f.int(usize, .{ .string = "x" }, .{}, .{ .source = &long, .key = &long }, &p)); + try t.expectEqual(p.bytes.len, p.len); + try t.expectEqualStrings(long[0..256], p.text()); +} diff --git a/zig/src/core/contract/dsv41_attn_records.zig b/zig/src/core/contract/dsv41_attn_records.zig index 9170380c25b..5a4e038cf67 100644 --- a/zig/src/core/contract/dsv41_attn_records.zig +++ b/zig/src/core/contract/dsv41_attn_records.zig @@ -6,8 +6,8 @@ pub const records = [_]M{ .{ .name = "dsv41 attn decode bf16 tf_dsv41_attn_dec_bf16", .threads = 160, .tg_memory = 12352, .reserved = 160 }, .{ .name = "dsv41 attn decode prefetch f32 tf_dsv41_attn_dec_pf_f32", .threads = 160, .tg_memory = 12352, .reserved = 160 }, .{ .name = "dsv41 attn decode prefetch bf16 tf_dsv41_attn_dec_pf_bf16", .threads = 160, .tg_memory = 12352, .reserved = 160 }, - .{ .name = "dsv41 attn prompt f32 tf_dsv41_attn_pre_f32", .threads = 256, .tg_memory = 16384, .reserved = 256 }, - .{ .name = "dsv41 attn prompt bf16 tf_dsv41_attn_pre_bf16", .threads = 256, .tg_memory = 16384, .reserved = 256 }, + .{ .name = "dsv41 attn prompt f32 tf_dsv41_attn_pre_f32", .threads = 256, .tg_memory = 0, .reserved = 256 }, + .{ .name = "dsv41 attn prompt bf16 tf_dsv41_attn_pre_bf16", .threads = 256, .tg_memory = 0, .reserved = 256 }, }; test "the DeepSeek V4.1 attention launches fit every Apple family" { diff --git a/zig/src/core/contract/glm_cuda_records.zig b/zig/src/core/contract/glm_cuda_records.zig index fcf81aedc2d..1b29f5a27b6 100644 --- a/zig/src/core/contract/glm_cuda_records.zig +++ b/zig/src/core/contract/glm_cuda_records.zig @@ -46,19 +46,19 @@ pub const cuda = [_]registry.CudaRecord{ .{ .launch = .{ .name = "glm_index tf_glm_index_pools", .symbol = "tf_glm_index_pools", .image = "glm_index", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 62, .static = 33864, .bound = 256 }, .{ .regs = 64, .static = 33864, .bound = 256 }, .{ .regs = 64, .static = 33864, .bound = 256 }, .{ .regs = 59, .static = 33864, .bound = 256 }, .{ .regs = 59, .static = 33864, .bound = 256 } } }, .{ .launch = .{ .name = "glm_glue tf_glm_select_rows", .symbol = "tf_glm_select_rows", .image = "glm_glue", .threads = 128, .min_sm = 80 }, .usage = .{ .{ .regs = 45, .static = 1072, .bound = 128 }, .{ .regs = 54, .static = 1072, .bound = 128 }, .{ .regs = 54, .static = 1072, .bound = 128 }, .{ .regs = 48, .static = 1072, .bound = 128 }, .{ .regs = 48, .static = 1072, .bound = 128 } } }, .{ .launch = .{ .name = "glm_glue tf_glm_select_rows_wide", .symbol = "tf_glm_select_rows_wide", .image = "glm_glue", .threads = 1024, .min_sm = 80 }, .usage = .{ .{ .regs = 32, .static = 1296, .bound = 1024 }, .{ .regs = 61, .static = 1296, .bound = 1024 }, .{ .regs = 61, .static = 1296, .bound = 1024 }, .{ .regs = 54, .static = 1296, .bound = 1024 }, .{ .regs = 61, .static = 1296, .bound = 1024 } } }, - .{ .launch = .{ .name = "glm_glue tf_glm_dsel_scan", .symbol = "tf_glm_dsel_scan", .image = "glm_glue", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 58, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 } } }, + .{ .launch = .{ .name = "glm_glue tf_glm_dsel_scan", .symbol = "tf_glm_dsel_scan", .image = "glm_glue", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 60, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 60, .static = 1040, .bound = 256 }, .{ .regs = 60, .static = 1040, .bound = 256 } } }, .{ .launch = .{ .name = "glm_glue tf_glm_dsel_merge", .symbol = "tf_glm_dsel_merge", .image = "glm_glue", .threads = 1024, .min_sm = 80 }, .usage = .{ .{ .regs = 56, .static = 34064, .bound = 1024 }, .{ .regs = 64, .static = 34064, .bound = 1024 }, .{ .regs = 64, .static = 34064, .bound = 1024 }, .{ .regs = 64, .static = 34064, .bound = 1024 }, .{ .regs = 64, .static = 34064, .bound = 1024 } } }, .{ .launch = .{ .name = "glm_glue tf_glm_chunks_16", .symbol = "tf_glm_chunks_16", .image = "glm_glue", .threads = 256, .dynamic = 83328, .opt_in = true, .min_sm = 80 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 123, .static = 0, .bound = 256 }, .{ .regs = 123, .static = 0, .bound = 256 } } }, .{ .launch = .{ .name = "glm_glue tf_glm_chunks_32", .symbol = "tf_glm_chunks_32", .image = "glm_glue", .threads = 256, .dynamic = 101120, .opt_in = true, .min_sm = 80 }, .usage = .{ .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 130, .static = 0, .bound = 256 }, .{ .regs = 130, .static = 0, .bound = 256 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_dsa_tokens", .symbol = "tf_glm_dsa_tokens", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 24, .static = 0, .bound = 0 }, .{ .regs = 24, .static = 0, .bound = 0 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_kvh_mark", .symbol = "tf_glm_kvh_mark", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 18, .static = 0, .bound = 0 }, .{ .regs = 18, .static = 0, .bound = 0 }, .{ .regs = 18, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 } } }, - .{ .launch = .{ .name = "glm_ops tf_glm_kvh_copy", .symbol = "tf_glm_kvh_copy", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 } } }, + .{ .launch = .{ .name = "glm_ops tf_glm_kvh_copy", .symbol = "tf_glm_kvh_copy", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_kvh_remap", .symbol = "tf_glm_kvh_remap", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_kvh_reset", .symbol = "tf_glm_kvh_reset", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 10, .static = 0, .bound = 0 }, .{ .regs = 10, .static = 0, .bound = 0 }, .{ .regs = 10, .static = 0, .bound = 0 }, .{ .regs = 12, .static = 0, .bound = 0 }, .{ .regs = 12, .static = 0, .bound = 0 } } }, - .{ .launch = .{ .name = "glm_ops tf_glm_kvh_rows", .symbol = "tf_glm_kvh_rows", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 } } }, + .{ .launch = .{ .name = "glm_ops tf_glm_kvh_rows", .symbol = "tf_glm_kvh_rows", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 38, .static = 0, .bound = 0 }, .{ .regs = 38, .static = 0, .bound = 0 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_kvh_prev_mark", .symbol = "tf_glm_kvh_prev_mark", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 15, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 18, .static = 0, .bound = 0 }, .{ .regs = 18, .static = 0, .bound = 0 } } }, - .{ .launch = .{ .name = "glm_ops tf_glm_kvh_copy_cached", .symbol = "tf_glm_kvh_copy_cached", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 } } }, - .{ .launch = .{ .name = "glm_ops tf_glm_kvh_keep", .symbol = "tf_glm_kvh_keep", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 42, .static = 0, .bound = 0 } } }, + .{ .launch = .{ .name = "glm_ops tf_glm_kvh_copy_cached", .symbol = "tf_glm_kvh_copy_cached", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 42, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 46, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 } } }, + .{ .launch = .{ .name = "glm_ops tf_glm_kvh_keep", .symbol = "tf_glm_kvh_keep", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 30, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 }, .{ .regs = 34, .static = 0, .bound = 0 }, .{ .regs = 38, .static = 0, .bound = 0 }, .{ .regs = 38, .static = 0, .bound = 0 } } }, .{ .launch = .{ .name = "glm_ops tf_glm_kvh_unmark", .symbol = "tf_glm_kvh_unmark", .image = "glm_ops", .threads = 256, .min_sm = 80 }, .usage = .{ .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 }, .{ .regs = 16, .static = 0, .bound = 0 } } }, }; @@ -70,6 +70,11 @@ pub const cuda_132 = [_]registry.Override{ .{ .name = "df_block_qkv", .usage = .{ .{ .regs = 32, .static = 8, .bound = 0 }, .{ .regs = 30, .static = 8, .bound = 0 }, .{ .regs = 30, .static = 8, .bound = 0 }, .{ .regs = 32, .static = 8, .bound = 0 }, .{ .regs = 32, .static = 8, .bound = 0 } } }, .{ .name = "df_ctx_kv", .usage = .{ .{ .regs = 30, .static = 8, .bound = 0 }, .{ .regs = 30, .static = 8, .bound = 0 }, .{ .regs = 30, .static = 8, .bound = 0 }, .{ .regs = 28, .static = 8, .bound = 0 }, .{ .regs = 28, .static = 8, .bound = 0 } } }, .{ .name = "df_top16_merge", .usage = .{ .{ .regs = 23, .static = 8416, .bound = 256 }, .{ .regs = 23, .static = 8416, .bound = 256 }, .{ .regs = 23, .static = 8416, .bound = 256 }, .{ .regs = 28, .static = 8416, .bound = 256 }, .{ .regs = 28, .static = 8416, .bound = 256 } } }, + // qmmf's 16-row cluster tiles, as GLM's decode launches them + .{ .name = "qmmf FP4 16-row tile, cluster of 8", .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf FP4 fp32 out 16-row tile, cluster of 8", .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf MXFP8 16-row tile, cluster of 8", .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf MXFP8 fp32 out 16-row tile, cluster of 8", .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, }; /// nvcc 13.3's usage where it differs from 13.0's. @@ -79,7 +84,9 @@ pub const cuda_133 = [_]registry.Override{ .{ .name = "glm_index tf_glm_index_scores", .usage = .{ .{ .regs = 128, .static = 32768, .bound = 256 }, .{ .regs = 128, .static = 32768, .bound = 256 }, .{ .regs = 128, .static = 32768, .bound = 256 }, .{ .regs = 126, .static = 32768, .bound = 256 }, .{ .regs = 126, .static = 32768, .bound = 256 } } }, .{ .name = "glm_index tf_glm_index_pools", .usage = .{ .{ .regs = 62, .static = 33864, .bound = 256 }, .{ .regs = 64, .static = 33864, .bound = 256 }, .{ .regs = 64, .static = 33864, .bound = 256 }, .{ .regs = 54, .static = 33864, .bound = 256 }, .{ .regs = 54, .static = 33864, .bound = 256 } } }, .{ .name = "glm_glue tf_glm_select_rows_wide", .usage = .{ .{ .regs = 32, .static = 1296, .bound = 1024 }, .{ .regs = 61, .static = 1296, .bound = 1024 }, .{ .regs = 61, .static = 1296, .bound = 1024 }, .{ .regs = 62, .static = 1296, .bound = 1024 }, .{ .regs = 62, .static = 1296, .bound = 1024 } } }, - .{ .name = "glm_glue tf_glm_dsel_scan", .usage = .{ .{ .regs = 58, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 45, .static = 1040, .bound = 256 }, .{ .regs = 45, .static = 1040, .bound = 256 } } }, - .{ .name = "glm_glue tf_glm_chunks_32", .usage = .{ .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 128, .static = 0, .bound = 256 }, .{ .regs = 128, .static = 0, .bound = 256 } } }, + .{ .name = "glm_glue tf_glm_dsel_scan", .usage = .{ .{ .regs = 60, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 }, .{ .regs = 48, .static = 1040, .bound = 256 } } }, + .{ .name = "glm_glue tf_glm_chunks_16", .usage = .{ .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 64, .static = 0, .bound = 256 }, .{ .regs = 128, .static = 0, .bound = 256 }, .{ .regs = 128, .static = 0, .bound = 256 } } }, + .{ .name = "glm_glue tf_glm_chunks_32", .usage = .{ .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 150, .static = 0, .bound = 256 }, .{ .regs = 126, .static = 0, .bound = 256 }, .{ .regs = 126, .static = 0, .bound = 256 } } }, .{ .name = "glm_ops tf_glm_dsa_tokens", .usage = .{ .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 25, .static = 0, .bound = 0 }, .{ .regs = 22, .static = 0, .bound = 0 }, .{ .regs = 22, .static = 0, .bound = 0 } } }, + .{ .name = "df_sumn", .usage = .{ .{ .regs = 32, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 } } }, }; diff --git a/zig/src/core/contract/hip_records.zig b/zig/src/core/contract/hip_records.zig index a6e23c8ece4..8165561207e 100644 --- a/zig/src/core/contract/hip_records.zig +++ b/zig/src/core/contract/hip_records.zig @@ -493,7 +493,7 @@ const own_records = [own_count]Record{ .{ .vgprs = 36, .sgprs = 32, .lds = 50688, .private = 0, .bound = 1024, .wave = 32 }, }, }, -} ++ @import("hip_records_pair.zig").records ++ @import("hip_records_prompt.zig").records ++ @import("hip_records_draft.zig").records ++ +} ++ @import("hip_records_pair.zig").records ++ @import("hip_records_prompt.zig").records ++ @import("hip_records_draft.zig").records ++ @import("hip_records_exl3.zig").records ++ @import("hip_records_score.zig").records ++ @import("hip_records_embed.zig").records ++ @import("hip_records_tail.zig").records ++ @import("hip_records_tap.zig").records ++ @import("hip_records_sparse.zig").records; pub const records = own_records ++ @import("hip_records_stream.zig").records ++ @import("hip_records_router.zig").records ++ diff --git a/zig/src/core/contract/hip_records_exl3.zig b/zig/src/core/contract/hip_records_exl3.zig new file mode 100644 index 00000000000..bb3d3f48f57 --- /dev/null +++ b/zig/src/core/contract/hip_records_exl3.zig @@ -0,0 +1,43 @@ +//! Gate 5's records of EXL3's decode-row kernels (exl3.hip's tf_exl3_rot_in and tf_exl3_linear_k*_w*). +const std = @import("std"); +const limits = @import("limits.zig"); +const Record = @import("hip_records.zig").Record; + +const U = limits.HipUsage; + +/// An exl3.hip launch and its (VGPRs, SGPRs, LDS bytes) on each chip, wave32 with no scratch. +fn launch(comptime symbol: []const u8, threads: u32, dynamic: u32, u: [limits.rdna.len][3]u32) Record { + var usage: [limits.rdna.len]U = undefined; + for (&usage, u) |*x, v| x.* = .{ .vgprs = v[0], .sgprs = v[1], .lds = v[2], .bound = threads }; + const l: limits.HipLaunch = .{ + .name = "exl3 " ++ symbol, + .symbol = symbol, + .image = "exl3", + .threads = threads, + .dynamic = dynamic, + }; + return .{ .launch = l, .usage = usage }; +} + +/// The linear at `k2` half-bits and `wk` waves, its waves' sums for 8 rows in dynamic LDS: (VGPRs, SGPRs) a chip. +fn linear(comptime k2: u32, comptime wk: u32, u: [limits.rdna.len][2]u32) Record { + var with: [limits.rdna.len][3]u32 = undefined; + for (&with, u) |*x, v| x.* = .{ v[0], v[1], wk * k2 * 128 }; + return launch(std.fmt.comptimePrint("tf_exl3_linear_k{d}_w{d}", .{ k2, wk }), wk * 32, wk * 8 * 128 * 4, with); +} + +pub const records = [_]Record{ + launch("tf_exl3_rot_in", 128, 0, .{ .{ 16, 12, 0 }, .{ 16, 18, 0 }, .{ 16, 10, 0 }, .{ 16, 9, 0 } }), + linear(4, 4, .{ .{ 206, 45 }, .{ 205, 45 }, .{ 205, 45 }, .{ 205, 46 } }), + linear(4, 8, .{ .{ 214, 43 }, .{ 213, 43 }, .{ 213, 43 }, .{ 213, 44 } }), + linear(6, 4, .{ .{ 209, 45 }, .{ 208, 45 }, .{ 208, 45 }, .{ 208, 46 } }), + linear(6, 8, .{ .{ 217, 43 }, .{ 216, 43 }, .{ 216, 43 }, .{ 216, 44 } }), + linear(8, 4, .{ .{ 209, 45 }, .{ 208, 45 }, .{ 208, 45 }, .{ 208, 46 } }), + linear(8, 8, .{ .{ 217, 43 }, .{ 216, 43 }, .{ 216, 43 }, .{ 216, 44 } }), + linear(10, 4, .{ .{ 213, 45 }, .{ 212, 45 }, .{ 212, 45 }, .{ 212, 46 } }), + linear(10, 8, .{ .{ 221, 43 }, .{ 220, 43 }, .{ 220, 43 }, .{ 220, 44 } }), + linear(12, 4, .{ .{ 214, 45 }, .{ 213, 45 }, .{ 213, 45 }, .{ 213, 46 } }), + linear(12, 8, .{ .{ 222, 43 }, .{ 221, 43 }, .{ 221, 43 }, .{ 221, 44 } }), + linear(16, 4, .{ .{ 219, 45 }, .{ 218, 45 }, .{ 218, 45 }, .{ 218, 46 } }), + linear(16, 8, .{ .{ 227, 43 }, .{ 226, 43 }, .{ 226, 43 }, .{ 226, 44 } }), +}; diff --git a/zig/src/core/contract/hip_records_families.zig b/zig/src/core/contract/hip_records_families.zig index 3e37edecb4b..6db017bdc6e 100644 --- a/zig/src/core/contract/hip_records_families.zig +++ b/zig/src/core/contract/hip_records_families.zig @@ -24,6 +24,7 @@ test "HIP record counts stay pinned in their owning files" { @import("hip_records_dense_text.zig").records.len, @import("hip_records_draft.zig").records.len, @import("hip_records_embed.zig").records.len, + @import("hip_records_exl3.zig").records.len, @import("hip_records_gdn.zig").records.len, @import("hip_records_glm_ocr.zig").records.len, @import("hip_records_item.zig").records.len, diff --git a/zig/src/core/contract/lane_half_records.zig b/zig/src/core/contract/lane_half_records.zig index 24a2bb70243..e83e8f28bc9 100644 --- a/zig/src/core/contract/lane_half_records.zig +++ b/zig/src/core/contract/lane_half_records.zig @@ -2,12 +2,12 @@ const CudaRecord = @import("registry.zig").CudaRecord; pub const cuda = [_]CudaRecord{ - .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896 }, .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile, fp32 out", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile, fp32 out", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896 }, .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 16-row half tile, fp32 out, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi32ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 16896, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf BF16 16-row half tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 39, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf BF16 16-row half tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 16-row half tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf BF16 16-row half tile, fp32 out", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 39, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf BF16 16-row half tile, fp32 out", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 16-row half tile, fp32 out, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi32ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, }; diff --git a/zig/src/core/contract/modelopt_lane_records.zig b/zig/src/core/contract/modelopt_lane_records.zig index 09826b7d7e7..ae4c2ed0725 100644 --- a/zig/src/core/contract/modelopt_lane_records.zig +++ b/zig/src/core/contract/modelopt_lane_records.zig @@ -2,13 +2,13 @@ const CudaRecord = @import("registry.zig").CudaRecord; pub const cuda = [_]CudaRecord{ - .{ .launch = .{ .name = "qmmf FP4 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 17408 }, .usage = .{ .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 96, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf FP4 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 17408, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP4 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 17408 }, .usage = .{ .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP4 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 17408, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi32ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25600 }, .usage = .{ .{ .regs = 106, .static = 0, .bound = 128 }, .{ .regs = 106, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi32ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25600, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi64ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 41984 }, .usage = .{ .{ .regs = 148, .static = 0, .bound = 128 }, .{ .regs = 148, .static = 0, .bound = 128 }, .{ .regs = 180, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi0ELi64ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 41984, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf FP8 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP8 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi32ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 32768 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi32ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 32768, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, @@ -16,7 +16,7 @@ pub const cuda = [_]CudaRecord{ .{ .launch = .{ .name = "qmmf FP8 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi64ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 40960 }, .usage = .{ .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 40960, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf BF16 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf BF16 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi64ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 65536, .opt_in = true }, .usage = .{ .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 75, .static = 0, .bound = 128 }, .{ .regs = 75, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi64ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 65536, .opt_in = true, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, diff --git a/zig/src/core/contract/muse_cuda_records.zig b/zig/src/core/contract/muse_cuda_records.zig new file mode 100644 index 00000000000..35101186683 --- /dev/null +++ b/zig/src/core/contract/muse_cuda_records.zig @@ -0,0 +1,59 @@ +//! Muse Spark's CUDA launches for gate 5: the family is served on GB10, so its records start at sm_121. +const registry = @import("registry.zig"); +const U = @import("limits.zig").Usage; + +const off: U = .{ .regs = 0, .static = 0 }; + +fn rec(name: []const u8, symbol: []const u8, image: []const u8, threads: u32, dynamic: u32, cluster: u32, u: U) registry.CudaRecord { + return .{ .launch = .{ .name = name, .symbol = symbol, .image = image, .threads = threads, .dynamic = dynamic, .cluster = cluster, .min_sm = 121 }, .usage = .{ off, off, off, off, u } }; +} + +/// Each launch as the family makes it, with nvcc 13.3's sm_121 registers and static shared bytes. +pub const cuda = [_]registry.CudaRecord{ + rec("muse_glue muse_embed_norm", "muse_embed_norm", "muse_glue", 1024, 0, 1, .{ .regs = 17, .static = 132, .bound = 0 }), + rec("muse_glue muse_rms", "muse_rms", "muse_glue", 1024, 0, 1, .{ .regs = 21, .static = 132, .bound = 0 }), + rec("muse_glue muse_gate_norm", "muse_gate_norm", "muse_glue", 1024, 0, 1, .{ .regs = 26, .static = 132, .bound = 0 }), + rec("muse_glue muse_gate_norm_c", "muse_gate_norm_c", "muse_glue", 128, 0, 8, .{ .regs = 40, .static = 32, .bound = 128 }), + rec("muse_glue muse_router", "muse_router", "muse_glue", 64, 0, 1, .{ .regs = 40, .static = 0, .bound = 0 }), + rec("muse_glue muse_topk", "muse_topk", "muse_glue", 256, 0, 1, .{ .regs = 32, .static = 12416, .bound = 0 }), + rec("muse_glue muse_expert_sum", "muse_expert_sum", "muse_glue", 1024, 0, 1, .{ .regs = 29, .static = 132, .bound = 0 }), + rec("muse_glue muse_expert_sum_c", "muse_expert_sum_c", "muse_glue", 128, 0, 8, .{ .regs = 40, .static = 256, .bound = 128 }), + rec("muse_glue muse_softcap", "muse_softcap", "muse_glue", 256, 0, 1, .{ .regs = 29, .static = 0, .bound = 0 }), + rec("muse_glue muse_argmax", "muse_argmax", "muse_glue", 256, 0, 1, .{ .regs = 35, .static = 2048, .bound = 0 }), + rec("muse_glue muse_rope_tables", "muse_rope_tables", "muse_glue", 256, 0, 1, .{ .regs = 40, .static = 0, .bound = 0 }), + rec("muse_attention muse_qk_prep", "muse_qk_prep", "muse_attention", 32, 0, 1, .{ .regs = 20, .static = 0, .bound = 0 }), + rec("muse_attention muse_attn_rows", "muse_attn_rows", "muse_attention", 256, 0, 1, .{ .regs = 40, .static = 10368, .bound = 256 }), + rec("muse_attention muse_attn_merge", "muse_attn_merge", "muse_attention", 256, 0, 1, .{ .regs = 40, .static = 0, .bound = 0 }), + rec("muse_linear muse_linear_multi_k2", "muse_linear_multi_k2", "muse_linear", 128, 16384, 1, .{ .regs = 143, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k2_w4", "muse_linear2_k2_w4", "muse_linear", 128, 16384, 1, .{ .regs = 241, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k2_w8", "muse_linear2_k2_w8", "muse_linear", 256, 32768, 1, .{ .regs = 245, .static = 16, .bound = 256 }), + rec("muse_linear muse_linear_multi_k3", "muse_linear_multi_k3", "muse_linear", 128, 16384, 1, .{ .regs = 159, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k3_w4", "muse_linear2_k3_w4", "muse_linear", 128, 16384, 1, .{ .regs = 255, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k3_w8", "muse_linear2_k3_w8", "muse_linear", 256, 32768, 1, .{ .regs = 255, .static = 16, .bound = 256 }), + rec("muse_linear muse_linear_multi_k4", "muse_linear_multi_k4", "muse_linear", 128, 16384, 1, .{ .regs = 143, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k4_w4", "muse_linear2_k4_w4", "muse_linear", 128, 16384, 1, .{ .regs = 241, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k4_w8", "muse_linear2_k4_w8", "muse_linear", 256, 32768, 1, .{ .regs = 245, .static = 16, .bound = 256 }), + rec("muse_linear muse_linear_multi_k5", "muse_linear_multi_k5", "muse_linear", 128, 16384, 1, .{ .regs = 160, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k5_w4", "muse_linear2_k5_w4", "muse_linear", 128, 16384, 1, .{ .regs = 251, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k5_w8", "muse_linear2_k5_w8", "muse_linear", 256, 32768, 1, .{ .regs = 251, .static = 16, .bound = 256 }), + rec("muse_linear muse_linear_multi_k6", "muse_linear_multi_k6", "muse_linear", 128, 16384, 1, .{ .regs = 160, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k6_w4", "muse_linear2_k6_w4", "muse_linear", 128, 16384, 1, .{ .regs = 250, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k6_w8", "muse_linear2_k6_w8", "muse_linear", 256, 32768, 1, .{ .regs = 250, .static = 16, .bound = 256 }), + rec("muse_linear muse_linear_multi_k8", "muse_linear_multi_k8", "muse_linear", 128, 16384, 1, .{ .regs = 143, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k8_w4", "muse_linear2_k8_w4", "muse_linear", 128, 16384, 1, .{ .regs = 243, .static = 16, .bound = 128 }), + rec("muse_linear muse_linear2_k8_w8", "muse_linear2_k8_w8", "muse_linear", 256, 32768, 1, .{ .regs = 255, .static = 16, .bound = 256 }), + rec("muse_linear muse_rot_multi", "muse_rot_multi", "muse_linear", 128, 0, 1, .{ .regs = 23, .static = 0, .bound = 128 }), + rec("muse_experts2 muse_grouped2", "muse_grouped2", "muse_experts2", 128, 0, 1, .{ .regs = 209, .static = 32896, .bound = 128 }), + rec("muse_dflash dr_block_embed", "dr_block_embed", "muse_dflash", 256, 0, 1, .{ .regs = 24, .static = 0, .bound = 0 }), + rec("muse_dflash dr_tap", "dr_tap", "muse_dflash", 256, 0, 1, .{ .regs = 18, .static = 0, .bound = 0 }), + rec("muse_dflash dr_norm_rope", "dr_norm_rope", "muse_dflash", 128, 0, 1, .{ .regs = 21, .static = 528, .bound = 0 }), + rec("muse_dflash dr_store", "dr_store", "muse_dflash", 256, 0, 1, .{ .regs = 16, .static = 0, .bound = 0 }), + rec("muse_dflash dr_attn", "dr_attn", "muse_dflash", 256, 0, 1, .{ .regs = 60, .static = 20608, .bound = 256 }), + rec("muse_dflash dr_take", "dr_take", "muse_dflash", 256, 0, 1, .{ .regs = 16, .static = 0, .bound = 0 }), + rec("muse_dflash2 dfl_dense", "dfl_dense", "muse_dflash2", 256, 0, 1, .{ .regs = 48, .static = 0, .bound = 0 }), + rec("muse_dflash2 dfl_conv_prep", "dfl_conv_prep", "muse_dflash2", 256, 0, 1, .{ .regs = 40, .static = 0, .bound = 0 }), + rec("muse_dflash2 dfl_conv_finish", "dfl_conv_finish", "muse_dflash2", 256, 0, 1, .{ .regs = 42, .static = 0, .bound = 0 }), + rec("muse_dflash2 dfl_silu_mul", "dfl_silu_mul", "muse_dflash2", 256, 0, 1, .{ .regs = 25, .static = 0, .bound = 0 }), + rec("muse_dflash2 dfl_topk", "dfl_topk", "muse_dflash2", 256, 0, 1, .{ .regs = 20, .static = 3072, .bound = 256 }), + rec("muse_dflash2 dfl_walk", "dfl_walk", "muse_dflash2", 512, 0, 1, .{ .regs = 40, .static = 196, .bound = 512 }), +}; diff --git a/zig/src/core/contract/nvcc_133_records.zig b/zig/src/core/contract/nvcc_133_records.zig index f52ba3b2f17..ce97c349efe 100644 --- a/zig/src/core/contract/nvcc_133_records.zig +++ b/zig/src/core/contract/nvcc_133_records.zig @@ -2,6 +2,8 @@ const registry = @import("registry.zig"); pub const cuda_133 = [_]registry.Override{ + .{ .name = "qmmf FP8G fp32 out 16-row tile, cluster of 8", .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf FP8G fp32 out 32-row tile, cluster of 8", .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 } } }, .{ .name = "27B tf_gdn_scan_back", .usage = .{ .{ .regs = 99, .static = 9536, .bound = 256 }, .{ .regs = 99, .static = 9536, .bound = 256 }, .{ .regs = 99, .static = 9536, .bound = 256 }, .{ .regs = 102, .static = 9536, .bound = 256 }, .{ .regs = 102, .static = 9536, .bound = 256 } } }, .{ .name = "affine4 verify128 cluster of 8", .usage = .{ .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 252, .static = 0, .bound = 128 }, .{ .regs = 252, .static = 0, .bound = 128 } } }, .{ .name = "affine4 verify128 one CTA a tile", .usage = .{ .{ .regs = 242, .static = 0, .bound = 128 }, .{ .regs = 242, .static = 0, .bound = 128 }, .{ .regs = 242, .static = 0, .bound = 128 }, .{ .regs = 252, .static = 0, .bound = 128 }, .{ .regs = 252, .static = 0, .bound = 128 } } }, @@ -116,11 +118,11 @@ pub const cuda_133 = [_]registry.Override{ .{ .name = "mamba tf_nemo_scan", .usage = .{ .{ .regs = 138, .static = 41088, .bound = 128 }, .{ .regs = 144, .static = 41088, .bound = 128 }, .{ .regs = 144, .static = 41088, .bound = 128 }, .{ .regs = 115, .static = 41088, .bound = 128 }, .{ .regs = 115, .static = 41088, .bound = 128 } } }, .{ .name = "moe tf_moe_topk_sigmoid_warp", .usage = .{ .{ .regs = 63, .static = 0, .bound = 256 }, .{ .regs = 63, .static = 0, .bound = 256 }, .{ .regs = 63, .static = 0, .bound = 256 }, .{ .regs = 63, .static = 0, .bound = 256 }, .{ .regs = 63, .static = 0, .bound = 256 } } }, .{ .name = "nvfp4_experts tf_nvfp4_fact_down_f32", .usage = .{ .{ .regs = 185, .static = 0, .bound = 256 }, .{ .regs = 186, .static = 0, .bound = 256 }, .{ .regs = 178, .static = 0, .bound = 256 }, .{ .regs = 147, .static = 0, .bound = 256 }, .{ .regs = 147, .static = 0, .bound = 256 } } }, - .{ .name = "qmmf BF16 16-row half tile", .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .name = "qmmf BF16 16-row half tile, fp32 out", .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf BF16 16-row half tile", .usage = .{ .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf BF16 16-row half tile, fp32 out", .usage = .{ .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 71, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, .{ .name = "qmmf FP4 32-row tile, cluster of 8", .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 61, .static = 0, .bound = 128 }, .{ .regs = 61, .static = 0, .bound = 128 } } }, - .{ .name = "qmmf MXFP8 16-row half tile", .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, - .{ .name = "qmmf MXFP8 16-row half tile, fp32 out", .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf MXFP8 16-row half tile", .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, + .{ .name = "qmmf MXFP8 16-row half tile, fp32 out", .usage = .{ .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 70, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, .{ .name = "qwen35 tf_q35_conv_commit", .usage = .{ .{ .regs = 28, .static = 0, .bound = 0 }, .{ .regs = 28, .static = 0, .bound = 0 }, .{ .regs = 28, .static = 0, .bound = 0 }, .{ .regs = 24, .static = 0, .bound = 0 }, .{ .regs = 24, .static = 0, .bound = 0 } } }, .{ .name = "qwen35 tf_q35_gdn_pre", .usage = .{ .{ .regs = 36, .static = 0, .bound = 32 }, .{ .regs = 38, .static = 0, .bound = 32 }, .{ .regs = 38, .static = 0, .bound = 32 }, .{ .regs = 38, .static = 0, .bound = 32 }, .{ .regs = 38, .static = 0, .bound = 32 } } }, .{ .name = "qwen35 tf_q35_gdn_slots_1", .usage = .{ .{ .regs = 77, .static = 4096, .bound = 128 }, .{ .regs = 80, .static = 4096, .bound = 128 }, .{ .regs = 80, .static = 4096, .bound = 128 }, .{ .regs = 72, .static = 4096, .bound = 128 }, .{ .regs = 72, .static = 4096, .bound = 128 } } }, diff --git a/zig/src/core/contract/registry.zig b/zig/src/core/contract/registry.zig index 632643aaa7e..d6958fc3c2f 100644 --- a/zig/src/core/contract/registry.zig +++ b/zig/src/core/contract/registry.zig @@ -49,36 +49,36 @@ pub const cuda = @import("flashnext_cuda_records.zig").cuda ++ [_]CudaRecord{ .{ .launch = .{ .name = "prompt16 FP4 lean", .symbol = std.fmt.comptimePrint(lean_symbol, .{0}), .image = "prompt16", .threads = 256, .dynamic = 76848, .opt_in = true }, .usage = .{ .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 253, .static = 0, .bound = 256 }, .{ .regs = 253, .static = 0, .bound = 256 } } }, .{ .launch = .{ .name = "prompt16 FP4 lean fp32 out", .symbol = std.fmt.comptimePrint(lean_symbol, .{1}), .image = "prompt16", .threads = 256, .dynamic = 76848, .opt_in = true }, .usage = .{ .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 251, .static = 0, .bound = 256 }, .{ .regs = 251, .static = 0, .bound = 256 } } }, .{ .launch = .{ .name = "prompt16 FP4 lean SwiGLU pair", .symbol = std.fmt.comptimePrint(lean_symbol, .{2}), .image = "prompt16", .threads = 256, .dynamic = 76848, .opt_in = true }, .usage = .{ .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 255, .static = 0, .bound = 256 }, .{ .regs = 247, .static = 0, .bound = 256 }, .{ .regs = 247, .static = 0, .bound = 256 } } }, - .{ .launch = .{ .name = "qmmf FP4 fp32 out 16-row tile", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 16, 0, 0 }), .image = "qmmf", .threads = 128, .dynamic = 17408 }, .usage = .{ .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 96, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf FP4 fp32 out 16-row tile, cluster of 8", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 16, 1, 0 }), .image = "qmmf", .threads = 128, .dynamic = 17408, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP4 fp32 out 16-row tile", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 16, 0, 0 }), .image = "qmmf", .threads = 128, .dynamic = 17408 }, .usage = .{ .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 88, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP4 fp32 out 16-row tile, cluster of 8", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 16, 1, 0 }), .image = "qmmf", .threads = 128, .dynamic = 17408, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 fp32 out 32-row tile", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 32, 0, 0 }), .image = "qmmf", .threads = 128, .dynamic = 25600 }, .usage = .{ .{ .regs = 106, .static = 0, .bound = 128 }, .{ .regs = 106, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 fp32 out 32-row tile, cluster of 8", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 32, 1, 0 }), .image = "qmmf", .threads = 128, .dynamic = 25600, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 }, .{ .regs = 63, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 fp32 out 64-row tile", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 64, 0, 0 }), .image = "qmmf", .threads = 128, .dynamic = 41984 }, .usage = .{ .{ .regs = 148, .static = 0, .bound = 128 }, .{ .regs = 148, .static = 0, .bound = 128 }, .{ .regs = 180, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 fp32 out 64-row tile, cluster of 8", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 64, 1, 0 }), .image = "qmmf", .threads = 128, .dynamic = 41984, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP4 fp32 out fused slices", .symbol = std.fmt.comptimePrint(qmmf_f32_symbol, .{ 64, 0, 1 }), .image = "qmmf", .threads = 128, .dynamic = 41984 }, .usage = .{ .{ .regs = 182, .static = 0, .bound = 128 }, .{ .regs = 182, .static = 0, .bound = 128 }, .{ .regs = 228, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088 }, .usage = .{ .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280 }, .usage = .{ .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 57, .static = 0, .bound = 128 }, .{ .regs = 57, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 66, .static = 0, .bound = 128 }, .{ .regs = 66, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb0ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true }, .usage = .{ .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 108, .static = 0, .bound = 128 }, .{ .regs = 108, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb0ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 103, .static = 0, .bound = 128 }, .{ .regs = 103, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 64-row tile, fused slices", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb0ELb0ELb1EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true }, .usage = .{ .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 159, .static = 0, .bound = 128 }, .{ .regs = 159, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf reduce_kernel", .symbol = "_ZN7tf_qmmf13reduce_kernelILb0EEEvPKfPvxif", .image = "qmmf", .threads = 256 }, .usage = .{ .{ .regs = 32, .static = 0, .bound = 0 }, .{ .regs = 36, .static = 0, .bound = 0 }, .{ .regs = 36, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 }, .{ .regs = 40, .static = 0, .bound = 0 } } }, - .{ .launch = .{ .name = "qmmf FP8 fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP8 fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576 }, .usage = .{ .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 90, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 }, .{ .regs = 50, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi16ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 24576, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi32ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 32768 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi32ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 32768, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 126, .static = 0, .bound = 128 }, .{ .regs = 126, .static = 0, .bound = 128 }, .{ .regs = 126, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi64ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8 fp32 out 64-row tile, fused slices", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi1ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb1EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 179, .static = 0, .bound = 128 }, .{ .regs = 179, .static = 0, .bound = 128 }, .{ .regs = 179, .static = 0, .bound = 128 }, .{ .regs = 141, .static = 0, .bound = 128 }, .{ .regs = 141, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088 }, .usage = .{ .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 94, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 }, .{ .regs = 60, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi16ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25088, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 69, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280 }, .usage = .{ .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 128, .static = 0, .bound = 128 }, .{ .regs = 57, .static = 0, .bound = 128 }, .{ .regs = 57, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 66, .static = 0, .bound = 128 }, .{ .regs = 66, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi32ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33280, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 78, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true }, .usage = .{ .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 168, .static = 0, .bound = 128 }, .{ .regs = 108, .static = 0, .bound = 128 }, .{ .regs = 108, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 103, .static = 0, .bound = 128 }, .{ .regs = 103, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf MXFP8 fp32 out 64-row tile, fused slices", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi2ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb1EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49664, .opt_in = true }, .usage = .{ .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 229, .static = 0, .bound = 128 }, .{ .regs = 159, .static = 0, .bound = 128 }, .{ .regs = 159, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf FP8G fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25600 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 }, .{ .regs = 58, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf FP8G fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25600 }, .usage = .{ .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 92, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8G fp32 out 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi16ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 25600, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8G fp32 out 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi32ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33792 }, .usage = .{ .{ .regs = 116, .static = 0, .bound = 128 }, .{ .regs = 116, .static = 0, .bound = 128 }, .{ .regs = 116, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 }, .{ .regs = 56, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf FP8G fp32 out 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi32ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 33792, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, @@ -87,7 +87,7 @@ pub const cuda = @import("flashnext_cuda_records.zig").cuda ++ [_]CudaRecord{ .{ .launch = .{ .name = "qmmf FP8G fp32 out 64-row tile, fused slices", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi3ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb1EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 50176, .opt_in = true }, .usage = .{ .{ .regs = 196, .static = 0, .bound = 128 }, .{ .regs = 196, .static = 0, .bound = 128 }, .{ .regs = 196, .static = 0, .bound = 128 }, .{ .regs = 157, .static = 0, .bound = 128 }, .{ .regs = 157, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 fp32 out 16-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 40960 }, .usage = .{ .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 80, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 fp32 out 16-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi16ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 40960, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 }, .{ .regs = 40, .static = 0, .bound = 128 } } }, - .{ .launch = .{ .name = "qmmf BF16 fp32 out 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 }, .{ .regs = 55, .static = 0, .bound = 128 } } }, + .{ .launch = .{ .name = "qmmf BF16 fp32 out 32-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152 }, .usage = .{ .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 93, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 }, .{ .regs = 47, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 fp32 out 32-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi32ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 49152, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 }, .{ .regs = 48, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 fp32 out 64-row tile", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi64ELi64ELi1ELi4ELi4ELb1ELb0ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 65536, .opt_in = true }, .usage = .{ .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 124, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 }, .{ .regs = 72, .static = 0, .bound = 128 } } }, .{ .launch = .{ .name = "qmmf BF16 fp32 out 64-row tile, cluster of 8", .symbol = "_ZN7tf_qmmf11qmmf_kernelILi4ELi64ELi64ELi1ELi4ELi4ELb1ELb1ELb0EEEvPK13__nv_bfloat16PKhS5_fPvPfiiiiiii", .image = "qmmf", .threads = 128, .dynamic = 65536, .opt_in = true, .cluster = 8, .min_sm = 90 }, .usage = .{ .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 }, .{ .regs = 64, .static = 0, .bound = 128 } } }, diff --git a/zig/src/core/contract/registry_joins.zig b/zig/src/core/contract/registry_joins.zig index 603150b8e42..acac1a9edaa 100644 --- a/zig/src/core/contract/registry_joins.zig +++ b/zig/src/core/contract/registry_joins.zig @@ -92,7 +92,7 @@ pub const all_metal = @import("lane_q8_records.zig").records ++ @import("affine_gather_records.zig").records ++ @import("flint_records.zig").records ++ @import("uocr_records.zig").records; -pub const landed_cuda = registry.cuda ++ +pub const landed_cuda = registry.cuda ++ @import("muse_cuda_records.zig").cuda ++ @import("dory_cuda_records.zig").cuda ++ registry.gradient_pending ++ registry.qwen_learning_pending ++ diff --git a/zig/src/core/contract/xpu_records.zig b/zig/src/core/contract/xpu_records.zig index 50e8107ee3e..36c0c35d554 100644 --- a/zig/src/core/contract/xpu_records.zig +++ b/zig/src/core/contract/xpu_records.zig @@ -10,7 +10,7 @@ pub const Record = struct { launch: X, usage: [limits.xe.len]U, compiled: bool = const glue = limits.Format.native; -/// The six Qwen3.8-27B glue kernels that register first: row arithmetic, a stated rule and a row copy. +/// The eight Qwen3.8-27B glue kernels that register first: row arithmetic, stated rules and a row copy. pub const records = [_]Record{ .{ .launch = .{ .name = "add_rmsnorm", .symbol = "add_rmsnorm", .image = "glue", .format = glue, .threads = .{ 128, 1, 1 }, .slm = 10272, .sub_group = 16, .grf = 256 }, @@ -32,10 +32,54 @@ pub const records = [_]Record{ .launch = .{ .name = "argmax", .symbol = "argmax", .image = "glue", .format = glue, .threads = .{ 256, 1, 1 }, .slm = 2048, .sub_group = 16, .grf = 256 }, .usage = .{.{ .threads = .{ 256, 1, 1 }, .slm = 2048, .sub_group = 16, .grf = 256 }}, }, + .{ + .launch = .{ .name = "topk_part", .symbol = "topk_part", .image = "glue", .format = glue, .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "topk_merge", .symbol = "topk_merge", .image = "glue", .format = glue, .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .slm = 192, .sub_group = 16, .grf = 256 }}, + }, .{ .launch = .{ .name = "embed", .symbol = "embed", .image = "glue", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, }, + .{ + .launch = .{ .name = "tp2_allreduce_f16", .symbol = "tp2_allreduce_f16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp4_allreduce_f16", .symbol = "tp4_allreduce_f16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp2_rs_f16", .symbol = "tp2_rs_f16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp4_rs_f16", .symbol = "tp4_rs_f16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp2_allreduce_bf16", .symbol = "tp2_allreduce_bf16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp4_allreduce_bf16", .symbol = "tp4_allreduce_bf16", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp2_allreduce_f32", .symbol = "tp2_allreduce_f32", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp4_allreduce_f32", .symbol = "tp4_allreduce_f32", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, + .{ + .launch = .{ .name = "tp4_rs_f32", .symbol = "tp4_rs_f32", .image = "tp", .format = glue, .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }, + .usage = .{.{ .threads = .{ 256, 1, 1 }, .sub_group = 16, .grf = 256 }}, + }, }; /// Gate 5's planted XPU controls: one for each fit rule the audit must fire. diff --git a/zig/src/core/contract/xpu_ref.zig b/zig/src/core/contract/xpu_ref.zig index ae0c123abfb..c336f9dbec7 100644 --- a/zig/src/core/contract/xpu_ref.zig +++ b/zig/src/core/contract/xpu_ref.zig @@ -198,6 +198,28 @@ pub fn argmaxPick(row: []const f64) i32 { return at; } +/// The candidates glue_quant.cl's topk kernels keep: the `k` largest of a finite row, the lower id first at a tie. +pub fn topkPick(row: []const f64, k: usize, vals: []f64, ids: []u32) void { + var n: usize = 0; + for (row, 0..) |v, i| { + if (n == k and !(v > vals[k - 1])) continue; + var j = if (n < k) n else k - 1; + if (n < k) n += 1; + while (j > 0 and v > vals[j - 1]) : (j -= 1) { + vals[j] = vals[j - 1]; + ids[j] = ids[j - 1]; + } + vals[j] = v; + ids[j] = @intCast(i); + } +} + +/// Whether `row` holds a NaN or an infinity anywhere: the flag the topk kernels raise over the whole row. +pub fn hasNonfinite(row: []const f64) bool { + for (row) |v| if (!std.math.isFinite(v)) return true; + return false; +} + /// Every element of `row` that is a NaN, for the rule's check to see a planted row. pub fn hasNan(row: []const f64) bool { for (row) |v| if (std.math.isNan(v)) return true; @@ -351,3 +373,20 @@ test "the argmax rule skips a NaN, takes the lowest index on a tie, and picks 0x try std.testing.expectEqual(@as(i32, 1), argmaxPick(&high)); try std.testing.expect(hasNan(&row)); } + +test "the top-k rule keeps the largest by value, the lower id at a tie, and a signed zero ties with the other" { + const row = [_]f64{ 1, 4, -0.0, 4, 0.0, 9, 4 }; + var vals: [4]f64 = undefined; + var ids: [4]u32 = undefined; + topkPick(&row, 4, &vals, &ids); + try std.testing.expectEqualSlices(u32, &.{ 5, 1, 3, 6 }, &ids); + try std.testing.expectEqualSlices(f64, &.{ 9, 4, 4, 4 }, &vals); + topkPick(&row, 2, vals[0..2], ids[0..2]); + try std.testing.expectEqualSlices(u32, &.{ 5, 1 }, ids[0..2]); + const zeros = [_]f64{ 0.0, -0.0, -1, 0.0, -0.0 }; + topkPick(&zeros, 3, vals[0..3], ids[0..3]); + try std.testing.expectEqualSlices(u32, &.{ 0, 1, 3 }, ids[0..3]); + try std.testing.expect(std.math.signbit(vals[1])); + try std.testing.expect(hasNonfinite(&.{ 1, -std.math.inf(f64) }) and hasNonfinite(&.{std.math.nan(f64)})); + try std.testing.expect(!hasNonfinite(&zeros)); +} diff --git a/zig/src/core/kv_pool.zig b/zig/src/core/kv_pool.zig index 0179b930ff2..19784f68602 100644 --- a/zig/src/core/kv_pool.zig +++ b/zig/src/core/kv_pool.zig @@ -6,6 +6,7 @@ pub const retirement = @import("kv_pool_retire.zig"); test { _ = @import("kv_groups_test.zig"); + _ = @import("kv_pool_trim_cost_test.zig"); } /// A family's stream memory: a fixed part at any length, paged caches a token, and a kept snapshot's slot. diff --git a/zig/src/core/kv_pool_checks.zig b/zig/src/core/kv_pool_checks.zig index a938dcc392d..259e1c157b4 100644 --- a/zig/src/core/kv_pool_checks.zig +++ b/zig/src/core/kv_pool_checks.zig @@ -2,6 +2,7 @@ test { _ = @import("kv_pool_store_test.zig"); _ = @import("kv_pool_parts_test.zig"); + _ = @import("kv_pool_tail_test.zig"); _ = @import("kv_pool_host_test.zig"); _ = @import("kv_pool_ledger_test.zig"); } diff --git a/zig/src/core/kv_pool_retire.zig b/zig/src/core/kv_pool_retire.zig index d66b1c89c66..ea592e6de16 100644 --- a/zig/src/core/kv_pool_retire.zig +++ b/zig/src/core/kv_pool_retire.zig @@ -12,20 +12,24 @@ pub const Credit = struct { token: u64, lease: *Lease }; /// A pool's retired pages: each one's last reader, the readers done, pages waiting on them, promises owed. pub const Retired = struct { - /// A page's last reader's token, 0 for none; allocated at the pool's first retire. - tokens: []u64 = &.{}, - /// Pages whose token is not 0, and each one's place in this list (`slots[id]`). + /// Last-reader tokens parallel to marked: only pages with retirement bookkeeping. + tokens: std.ArrayList(u64) = .empty, marked: std.ArrayList(u32) = .empty, - slots: []u32 = &.{}, + slots: std.AutoHashMapUnmanaged(u32, usize) = .empty, /// Every reader up to this token is done. settled: u64 = 0, - /// Pages nobody holds whose readers are not done (room for every page, from the first retire). + /// Pages nobody holds whose readers are not done; room reserved before a new mark is published. pending: std.ArrayList(u32) = .empty, credits: std.ArrayList(Credit) = .empty, + pub fn token(r: *const Retired, id: usize) u64 { + const i = r.slots.get(@intCast(id)) orelse return 0; + return r.tokens.items[i]; + } + pub fn deinit(r: *Retired, gpa: std.mem.Allocator) void { - gpa.free(r.tokens); - gpa.free(r.slots); + r.tokens.deinit(gpa); + r.slots.deinit(gpa); r.marked.deinit(gpa); r.pending.deinit(gpa); r.credits.deinit(gpa); @@ -37,23 +41,21 @@ pub fn retire(p: *Pool, l: *Lease, i: usize, token: u64) error{OutOfMemory}!void const r = &p.retired; const id = l.ids.items[i]; if (id == none) std.debug.panic("kv pool: lease entry {d} retired twice", .{i}); - if (r.tokens.len == 0) { // the pool's first retire: room for a token, a mark and a pending slot a page - try r.pending.ensureTotalCapacity(p.gpa, p.total()); - try r.marked.ensureTotalCapacity(p.gpa, p.total()); - const slots = try p.gpa.alloc(u32, p.total()); - errdefer p.gpa.free(slots); - r.tokens = try p.gpa.alloc(u64, p.total()); - @memset(r.tokens, 0); - r.slots = slots; - } + try r.pending.ensureTotalCapacity(p.gpa, r.marked.items.len + 1); + try r.marked.ensureUnusedCapacity(p.gpa, 1); + try r.tokens.ensureUnusedCapacity(p.gpa, 1); + try r.slots.ensureUnusedCapacity(p.gpa, 1); try r.credits.ensureUnusedCapacity(p.gpa, 1); p.enter(); defer p.leave(); - if (r.tokens[id] == 0) { - r.slots[id] = @intCast(r.marked.items.len); + const entry = r.slots.getOrPutAssumeCapacity(id); + if (!entry.found_existing) { + entry.value_ptr.* = r.marked.items.len; r.marked.appendAssumeCapacity(id); + r.tokens.appendAssumeCapacity(0); } - r.tokens[id] = @max(r.tokens[id], token); + const reader = &r.tokens.items[entry.value_ptr.*]; + reader.* = @max(reader.*, token); l.ids.items[i] = none; p.unlease(id); r.credits.appendAssumeCapacity(.{ .token = token, .lease = l }); @@ -61,13 +63,13 @@ pub fn retire(p: *Pool, l: *Lease, i: usize, token: u64) error{OutOfMemory}!void /// Whether page `id` carries a retired page's token: not free to take, even when nobody holds it. pub fn held(p: *const Pool, id: usize) bool { - return p.retired.marked.items.len > 0 and p.retired.tokens[id] != 0; + return p.retired.token(id) != 0; } /// Whether any page of [start, start + k) carries a token. pub fn anyHeld(p: *const Pool, start: usize, k: usize) bool { if (p.retired.marked.items.len == 0) return false; - for (start..start + k) |i| if (p.retired.tokens[i] != 0) return true; + for (start..start + k) |i| if (p.retired.token(i) != 0) return true; return false; } @@ -79,7 +81,7 @@ pub fn idle(p: *const Pool) bool { /// A page nobody holds: free when its readers are done, else pending until `settle` passes its token. pub fn freeOrPend(p: *Pool, id: u32) void { const r = &p.retired; - if (r.marked.items.len > 0 and r.tokens[id] > r.settled) return r.pending.appendAssumeCapacity(id); // room: one a page + if (r.token(id) > r.settled) return r.pending.appendAssumeCapacity(id); // reserved before its mark clear(p, id); p.free[p.nfree] = id; p.nfree += 1; @@ -93,7 +95,7 @@ pub fn settle(p: *Pool, token: u64) error{LaneMemory}!void { r.settled = @max(r.settled, token); var keep: usize = 0; for (r.pending.items) |id| { - if (r.tokens[id] > r.settled) { + if (r.token(id) > r.settled) { r.pending.items[keep] = id; keep += 1; } else { @@ -111,20 +113,19 @@ pub fn settle(p: *Pool, token: u64) error{LaneMemory}!void { fn clear(p: *Pool, id: u32) void { const r = &p.retired; - if (r.tokens.len == 0 or r.tokens[id] == 0) return; - r.tokens[id] = 0; - const last = r.marked.pop().?; - if (last != id) { - r.marked.items[r.slots[id]] = last; - r.slots[last] = r.slots[id]; - } + if (r.token(id) == 0) return; + const i = r.slots.fetchRemove(id).?.value; + _ = r.tokens.swapRemove(i); + _ = r.marked.swapRemove(i); + if (i < r.marked.items.len) r.slots.getPtr(r.marked.items[i]).?.* = i; } /// Pages the store alone holds whose readers are not done: reclaiming them frees nothing until `settle`. pub fn waiting(p: *const Pool) usize { const r = &p.retired; var n: usize = 0; - for (r.marked.items) |id| n += @intFromBool(r.tokens[id] > r.settled and p.refs[id] == 1 and p.leased[id] == 0); + for (r.marked.items, r.tokens.items) |id, reader| + n += @intFromBool(reader > r.settled and p.refs[id] == 1 and p.leased[id] == 0); return n; } diff --git a/zig/src/core/kv_pool_tail_test.zig b/zig/src/core/kv_pool_tail_test.zig new file mode 100644 index 00000000000..55d1cc07ee2 --- /dev/null +++ b/zig/src/core/kv_pool_tail_test.zig @@ -0,0 +1,163 @@ +//! The store's writable tails (C4, #2444) over a real pool: the private copy from the stream's promise, reclaim first. +const std = @import("std"); +const kv = @import("kv_pool"); +const radix = @import("engine_api").prompt_radix; +const Pool = kv.Pool; +const Lease = kv.Lease; +const testing = std.testing; +const expect = testing.expect; +const expectEqual = testing.expectEqual; + +const page_bytes = 8; + +/// A family whose device memory is one word a page: copy_rows copies the word and logs the page it wrote. +const Family = struct { + pool: *Pool, + mem: [32]u32 = @splat(0), + wrote: [16]u32 = undefined, + nwrote: usize = 0, + + fn of(p: *anyopaque) *Family { + return @ptrCast(@alignCast(p)); + } + fn bytes(_: *anyopaque, _: u32, _: u32) u64 { + return 0; + } + fn copy(_: *anyopaque, _: ?*anyopaque, _: u32, _: u32, _: radix.Parts.Part) anyerror!void {} + fn restore(_: *anyopaque, _: ?*anyopaque, _: u32, _: radix.Parts.Part) anyerror!void {} + fn copyRows(p: *anyopaque, _: ?*anyopaque, _: u32, src: u32, dst: u32, _: u32) anyerror!void { + const f = of(p); + f.mem[dst] = f.mem[src]; + f.wrote[f.nwrote] = dst; + f.nwrote += 1; + } + fn fence(_: *anyopaque, _: ?*anyopaque) void {} + fn hooks(f: *Family) radix.PartHooks { + return .{ .ptr = f, .vtable = &.{ .bytes = bytes, .copy = copy, .restore = restore, .copy_rows = copyRows, .fence = fence } }; + } + fn snapBytes(_: *anyopaque, _: u32) u64 { + return 0; + } + fn save(_: *anyopaque, _: ?*anyopaque, _: u32) anyerror!radix.Saved { + return error.NoLegacy; + } + fn snapRestore(_: *anyopaque, _: ?*anyopaque, _: radix.Saved) anyerror!void {} + fn drop(_: *anyopaque, _: radix.Saved) void {} + fn snapshots(f: *Family) radix.Snapshots { + return .{ .ptr = f, .vtable = &.{ .bytes = snapBytes, .save = save, .restore = snapRestore, .drop = drop } }; + } + fn written(f: *const Family, id: u32) usize { + var n: usize = 0; + for (f.wrote[0..f.nwrote]) |w| n += @intFromBool(w == id); + return n; + } +}; + +const World = struct { + pool: Pool, + f: Family = undefined, + store: radix.Store = undefined, + + fn init(w: *World, pages: usize) !void { + w.pool = try Pool.init(testing.allocator, pages, page_bytes); + w.f = .{ .pool = &w.pool }; + const rules: radix.Rules = .{ .page = 4, .lookahead = 0, .min_gap = 1, .min_prompt = 0 }; + w.store = try radix.Store.initGroups(testing.allocator, w.f.snapshots(), radix.pagesOf(Pool, &w.pool, page_bytes), rules, .{ .legacy = false, .tails = true }, w.f.hooks()); + w.store.limit(.{ .pages = pages, .snaps = 4 }); + try w.pool.joinReclaim(.{ .ctx = &w.store, .call = reclaim }); + } + fn deinit(w: *World) void { + w.pool.leaveReclaim(&w.store); + w.store.deinit(); + expect(w.pool.idle() and w.pool.available() == w.pool.total()) catch @panic("pages left after close"); + w.pool.deinit(); + } + fn reclaim(ctx: *anyopaque, want: usize) bool { + const s: *radix.Store = @ptrCast(@alignCast(ctx)); + return s.reclaim(want); + } + /// A stream keeps a tail 2 rows into its second page; the store's copy is returned. + fn keepTail(w: *World, words: []const u32) !u32 { + var l: Lease = .{}; + defer w.pool.finish(&l); + try w.pool.promise(&l, 2); + try w.pool.cover(&l, 2, null); + w.f.mem[l.ids.items[1]] = 42; // the partial page's rows + var path: [1]u32 = undefined; + try expect(w.store.keep(.of(words), 6, null, l.ids.items, &path).held); + const edge = w.store.tree.root.kids.items[0]; + return edge.tails.items[0].tail.?.ids[0]; + } +}; + +const prompt = [_]u32{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + +test "a resume at a tail takes its private page from its promise, and the store's copy is never written" { + var w: World = .{ .pool = undefined }; + try w.init(16); + defer w.deinit(); + const tail_id = try w.keepTail(&prompt); + try expectEqual(@as(u32, 42), w.f.mem[tail_id]); + + var adopt: std.ArrayList(u32) = .empty; + defer adopt.deinit(testing.allocator); + const plan = try w.store.begin(testing.allocator, .of(&prompt), 10, &.{}, null, &adopt); + defer plan.deinit(testing.allocator); + try expectEqual(@as(u32, 6), plan.from); + var l: Lease = .{}; + try w.pool.promise(&l, 3 - adopt.items.len); // the request's three pages less the one it adopted + try w.pool.adopt(&l, adopt.items); + const promised = w.pool.census().promised; + const c = plan.copies[0]; + const own = try w.pool.take(&l); // the private copy: a page of its promise + try expectEqual(promised - 1, w.pool.census().promised); + try Family.copyRows(&w.f, null, c.group, c.src, own, c.rows); + try expectEqual(@as(usize, c.index), l.ids.items.len - 1); // mapped at the tail's logical page + w.store.finish(null, plan.copies); + try expectEqual(@as(u32, 42), w.f.mem[own]); + try expectEqual(@as(u32, 1), w.pool.holders(tail_id)); // the store's again alone + try expectEqual(@as(usize, 1), w.f.written(tail_id)); // the keep that made it, and nothing since + w.pool.finish(&l); +} + +test "a resume that fails after its take trims the page back to its promise and still ends its copies" { + var w: World = .{ .pool = undefined }; + try w.init(16); + defer w.deinit(); + const tail_id = try w.keepTail(&prompt); + var adopt: std.ArrayList(u32) = .empty; + defer adopt.deinit(testing.allocator); + const plan = try w.store.begin(testing.allocator, .of(&prompt), 10, &.{}, null, &adopt); + defer plan.deinit(testing.allocator); + var l: Lease = .{}; + try w.pool.promise(&l, 2); + try w.pool.adopt(&l, adopt.items); + const before = w.pool.census(); + _ = try w.pool.take(&l); + w.pool.trim(&l, adopt.items.len); // the copy failed: the page goes back to the promise + try expectEqual(before, w.pool.census()); + w.store.finish(null, plan.copies); + try expectEqual(@as(u32, 1), w.pool.holders(tail_id)); + w.pool.finish(&l); +} + +test "a promise that needs pages reclaims an idle tail; the path a stream maps stays mapped" { + var w: World = .{ .pool = undefined }; + try w.init(4); + defer w.deinit(); + _ = try w.keepTail(&prompt); // the path page and the tail's copy: 2 of 4 + var adopt: std.ArrayList(u32) = .empty; + defer adopt.deinit(testing.allocator); + var other = prompt; + other[5] = 99; // the page edge only: the path is mapped, the tail is idle + const plan = try w.store.begin(testing.allocator, .of(&other), 10, &.{}, null, &adopt); + defer plan.deinit(testing.allocator); + try expectEqual(@as(u32, 4), plan.from); + var l: Lease = .{}; + defer w.pool.finish(&l); + try w.pool.adopt(&l, adopt.items); + try w.pool.promise(&l, 3); // 2 free: the tail goes first + try expectEqual(@as(usize, 0), w.store.tree.snaps); + try expectEqual(@as(usize, 0), w.store.tree.heldPages()); // its path held no other state: pruned + try expectEqual(@as(u32, 1), w.pool.holders(adopt.items[0])); // still the stream's +} diff --git a/zig/src/core/kv_pool_trim_cost_test.zig b/zig/src/core/kv_pool_trim_cost_test.zig new file mode 100644 index 00000000000..db532543989 --- /dev/null +++ b/zig/src/core/kv_pool_trim_cost_test.zig @@ -0,0 +1,53 @@ +//! Retirement bookkeeping follows the four rows leaving a live window, independent of its reserved context. +const std = @import("std"); +const kv = @import("kv_pool.zig"); +const t = std.testing; + +fn firstTrim(context: usize, high: bool) !usize { + var counted = t.FailingAllocator.init(t.allocator, .{}); + var pool = try kv.Pool.init(counted.allocator(), context, 2); + defer pool.deinit(); + var lease: kv.Lease = .{}; + defer pool.finish(&lease); + const used = 8192; + const dropped = 4; + try pool.promise(&lease, used); + if (high) try pool.coverRun(&lease, used, 1, null) else try pool.cover(&lease, used, null); + const base: u32 = if (high) @intCast(context - used) else 0; + const before = counted.allocated_bytes; + for (used - dropped..used) |i| try kv.retirement.retire(&pool, &lease, i, 7); + pool.trim(&lease, used - dropped); + const bytes = counted.allocated_bytes - before; + std.debug.print("E98 trim context={d} used={d} dropped={d} high={any} allocated_bytes={d}\n", .{ context, used, dropped, high, bytes }); + try t.expectEqual(@as(usize, used - dropped), lease.ids.items.len); + try t.expectEqual(@as(usize, dropped), pool.census().pending); + for (lease.ids.items, 0..) |id, i| { + try t.expectEqual(base + @as(u32, @intCast(i)), id); + try t.expectEqual(@as(u32, 1), pool.holders(id)); + } + for (used - dropped..used) |i| { + try t.expect(kv.retirement.held(&pool, base + i)); + try t.expectEqual(@as(u32, 0), pool.holders(base + @as(u32, @intCast(i)))); + } + try kv.retirement.settle(&pool, 6); + try t.expectEqual(@as(usize, dropped), pool.census().pending); + try kv.retirement.settle(&pool, 7); + try t.expectEqual(@as(usize, 0), pool.census().pending); + try t.expectEqual(@as(usize, dropped), lease.promised); + for (0..dropped) |i| try t.expectEqual(base + @as(u32, @intCast(used - i - 1)), try pool.take(&lease)); + var hash = std.crypto.hash.sha2.Sha256.init(.{}); + for ([_][]const u32{ pool.refs, pool.leased, pool.free[0..pool.nfree], lease.ids.items }) |part| + hash.update(std.mem.sliceAsBytes(part)); + const digest = hash.finalResult(); + std.debug.print("E98 state context={d} high={any} sha256={s}\n", .{ context, high, std.fmt.bytesToHex(digest, .lower) }); + return bytes; +} + +test "rollback trim cost: four rows at 8K live do not allocate a context-sized retirement table" { + const small = try firstTrim(16_384, false); + const large = try firstTrim(262_144, false); + const high = try firstTrim(262_144, true); + try t.expect(small < 8192 and large < 8192 and high < 8192); + try t.expectEqual(large, high); + try t.expectEqual(small, large); +} diff --git a/zig/src/core/kv_pool_window_test.zig b/zig/src/core/kv_pool_window_test.zig index 9959e30493f..fb384024379 100644 --- a/zig/src/core/kv_pool_window_test.zig +++ b/zig/src/core/kv_pool_window_test.zig @@ -30,14 +30,15 @@ fn exact(p: *const kv.Pool) bool { alone += @intFromBool(r == 1 and l == 0); } const r = &p.retired; - for (r.pending.items) |id| if (p.refs[id] != 0 or r.tokens[id] <= r.settled) return false; + for (r.pending.items) |id| if (p.refs[id] != 0 or r.token(id) <= r.settled) return false; var marks: usize = 0; var waits: usize = 0; - for (r.tokens, 0..) |t, i| { + for (r.tokens.items, r.marked.items) |t, i| { marks += @intFromBool(t != 0); waits += @intFromBool(t > r.settled and p.refs[i] == 1 and p.leased[i] == 0); } - for (r.marked.items, 0..) |id, i| if (r.tokens[id] == 0 or r.slots[id] != i) return false; + for (r.marked.items, 0..) |id, i| if (r.token(id) == 0 or r.slots.get(id) != i) return false; + if (r.slots.count() != r.tokens.items.len or r.tokens.items.len != r.marked.items.len) return false; if (marks != r.marked.items.len or waits != kv.retirement.waiting(p)) return false; if (p.nfree < p.promised) return false; return free == p.nfree and diff --git a/zig/src/core/lanes/config.zig b/zig/src/core/lanes/config.zig index 3dff73e82f1..09df22cb2bd 100644 --- a/zig/src/core/lanes/config.zig +++ b/zig/src/core/lanes/config.zig @@ -29,6 +29,7 @@ pub const Model = struct { draft_prior: []const f64 = &.{}, // the head's acceptance by depth until a stream has its own depth_rate: f64 = 0, // the newest round's weight in a depth's acceptance estimate (0: the core's) plain_guard: bool = false, // plain rounds compete with drafted depths + copy_guard: bool = false, // a lone stream's copies compete with its own plain rounds (a family opts in) draft_confidence: ?f64 = null, floor_rates: bool = false, // Constants.floor_rates: a head whose steps cost more than the floor's cut saves drafts: u32 = 1, // head drafts a round at most @@ -76,6 +77,7 @@ pub const Config = struct { speculate_early: bool, pipelined: bool, plain_guard: bool, + copy_guard: bool = false, // Model.copy_guard: off unless the family sets it (lanes/lone_copy.zig) most_drafts: u32, draft_confidence: ?f64 = null, family_streams: bool, @@ -164,6 +166,7 @@ pub const Config = struct { .speculate_early = m.speculate_early and !(m.root_copies and m.copy_drafts), .pipelined = m.gpu_tokens, .plain_guard = m.plain_guard, + .copy_guard = m.copy_guard, .most_drafts = @min(m.drafts, @min(width - 1, max_draft)), .draft_confidence = m.draft_confidence, .family_streams = streams, diff --git a/zig/src/core/lanes/copy_price.zig b/zig/src/core/lanes/copy_price.zig new file mode 100644 index 00000000000..3974be7d6c8 --- /dev/null +++ b/zig/src/core/lanes/copy_price.zig @@ -0,0 +1,49 @@ +//! A lone copy window's price parts on its stream's own timed rounds: the copy's cost and the plain round it must beat. +const depth = @import("depth.zig"); +const Rule = depth.Rule; +const Who = depth.Who; +const Table = @import("table.zig").Table; + +/// A copy as timed, else on the line from plain to its nearest timed copy, else each row as plain's (no head step). +pub fn cost(r: *Rule, rows: i64, who: Who) !?f64 { + const timed = try copies(r, who); + if (timed.get(rows)) |v| return v; + const base = (try plain(r, who)) orelse return null; + const n: f64 = @floatFromInt(rows); + var near: ?i64 = null; + for (timed.slots, 0..) |slot, at| { + const d: i64 = @intCast(at); + if (slot == null or d == 0) continue; + if (near == null or @abs(d - rows) < @abs(near.? - rows)) near = d; + } + if (near) |d| return base + n * @max(0.0, (timed.get(d).? - base) / @as(f64, @floatFromInt(d))); + const one = r.family_costs.get(1) orelse return null; + const forward = r.family_costs.get(rows + 1) orelse return null; + return forward + (n + 1) * @max(0.0, base - one); +} + +/// The plain round a copy must beat: roundCost's under plain_guard, else its model on the stream's own rounds. +pub fn plain(r: *Rule, who: Who) !?f64 { + if (r.plain_guard) return r.roundCost(0, who); + return r.roundCostIn(try r.ownCosts(who), 0, true); +} + +/// A lone copy round's time by its copied rows; a stream's first round stays out, as in observeCost. +pub fn observeCopy(r: *Rule, rows: i64, ms: f64, initializing: bool, who: Who) !void { + if (rows <= 0 or initializing) return; + try r.blend(try copies(r, who), rows, ms); + who.state.*.?.copy_rounds += 1; +} + +/// A round the head's timing keeps out of the stream's own times (no plain_guard): plain's price reads it. +pub fn observeOwn(r: *Rule, drafts: i64, ms: f64, initializing: bool, who: Who) !void { + if (drafts < 0 or initializing) return; + try r.blend(try r.ownCosts(who), drafts, ms); +} + +fn copies(r: *Rule, who: Who) !*Table { + _ = try r.rates(who); + const st = &who.state.*.?; + if (st.copy_ms == null) st.copy_ms = .{}; + return &st.copy_ms.?; +} diff --git a/zig/src/core/lanes/copy_price_test.zig b/zig/src/core/lanes/copy_price_test.zig new file mode 100644 index 00000000000..bc585f34a93 --- /dev/null +++ b/zig/src/core/lanes/copy_price_test.zig @@ -0,0 +1,98 @@ +//! copy_price.zig's estimates of a lone copy's cost, and the plain round it must beat, on hand-timed rounds. +const std = @import("std"); +const depth = @import("depth.zig"); +const price = @import("copy_price.zig"); +const Table = @import("table.zig").Table; + +const gpa = std.testing.allocator; + +/// The forwards as timed at load on a short scratch context: 5 ms plus 0.2 ms a row. +fn startup() !Table { + var t: Table = .{}; + for (1..17) |w| try t.put(gpa, @intCast(w), 5 + 0.2 * @as(f64, @floatFromInt(w))); + return t; +} + +fn rule(forwards: *const Table, plain_guard: bool) depth.Rule { + return .{ .gpa = gpa, .prior = &.{0.8}, .most_drafts = 4, .family_costs = forwards, .shared_costs = forwards, .mtp_step_ms = 0.5, .plain_guard = plain_guard, .copy_guard = true, .node_probabilities = false, .batch_rows = 32 }; +} + +/// A plain round of `ms` into the stream's own times, as the round loop records it with or without plain_guard. +fn timePlain(r: *depth.Rule, ms: f64, who: depth.Who) !void { + if (r.plain_guard) try r.observeCost(0, ms, false, who) else try price.observeOwn(r, 0, ms, false, who); +} + +const eps = 1e-9; + +test "copy price: before any copy is timed, each of its n + 1 rows costs a forward row plus plain's excess" { + var forwards = try startup(); + defer forwards.deinit(gpa); + for ([_]bool{ true, false }) |plain_guard| { + var r = rule(&forwards, plain_guard); + defer r.deinit(); + var st: ?depth.State = null; + defer if (st) |*x| x.deinit(gpa); + const who: depth.Who = .{ .state = &st, .draft_room = 100, .finished = false, .forced = false }; + // nothing timed: plain is its forward, and a copy is its own forward + try std.testing.expectApproxEqAbs(5.2, (try price.plain(&r, who)).?, eps); + try std.testing.expectApproxEqAbs(forwards.get(4).?, (try price.cost(&r, 3, who)).?, eps); + // a 90 ms plain round: 84.8 ms past its forward, paid by each of the copy's n + 1 rows + try timePlain(&r, 90, who); + try std.testing.expectApproxEqAbs(90, (try price.plain(&r, who)).?, eps); + try std.testing.expectApproxEqAbs(forwards.get(4).? + 4 * (90 - 5.2), (try price.cost(&r, 3, who)).?, eps); + try std.testing.expectApproxEqAbs(forwards.get(16).? + 16 * (90 - 5.2), (try price.cost(&r, 15, who)).?, eps); + try std.testing.expectEqual(@as(?f64, null), try price.cost(&r, 16, who)); // past the forwards timed at load + } +} + +test "copy price: a timed width as timed, others on the line from plain to the nearest timed copy" { + var forwards = try startup(); + defer forwards.deinit(gpa); + for ([_]bool{ true, false }) |plain_guard| { + var r = rule(&forwards, plain_guard); + defer r.deinit(); + var st: ?depth.State = null; + defer if (st) |*x| x.deinit(gpa); + const who: depth.Who = .{ .state = &st, .draft_room = 100, .finished = false, .forced = false }; + try timePlain(&r, 90, who); + try price.observeCopy(&r, 3, 250, false, who); + try price.observeCopy(&r, 15, 690, false, who); + try price.observeCopy(&r, 7, 999, true, who); // a stream's first round stays out + try std.testing.expectApproxEqAbs(250, (try price.cost(&r, 3, who)).?, eps); + try std.testing.expectApproxEqAbs(690, (try price.cost(&r, 15, who)).?, eps); + try std.testing.expectApproxEqAbs(90 + 5 * 160.0 / 3.0, (try price.cost(&r, 5, who)).?, eps); // nearest: 3 + try std.testing.expectApproxEqAbs(90 + 12 * 40.0, (try price.cost(&r, 12, who)).?, eps); // nearest: 15 + try std.testing.expectApproxEqAbs(90 + 9 * 160.0 / 3.0, (try price.cost(&r, 9, who)).?, eps); // a tie: the narrower + // a timed copy repeats into a blend of its times (cost_rate), as head rounds do + try price.observeCopy(&r, 3, 350, false, who); + try std.testing.expectApproxEqAbs(250 + r.k.cost_rate * 100, (try price.cost(&r, 3, who)).?, eps); + } +} + +test "copy price: a timed copy cheaper than plain leaves no negative row cost" { + var forwards = try startup(); + defer forwards.deinit(gpa); + var r = rule(&forwards, true); + defer r.deinit(); + var st: ?depth.State = null; + defer if (st) |*x| x.deinit(gpa); + const who: depth.Who = .{ .state = &st, .draft_room = 100, .finished = false, .forced = false }; + try timePlain(&r, 90, who); + try price.observeCopy(&r, 2, 80, false, who); + try std.testing.expectApproxEqAbs(90, (try price.cost(&r, 4, who)).?, eps); +} + +test "copy price: without plain_guard, plain is roundCost's model on the stream's own head rounds" { + var forwards = try startup(); + defer forwards.deinit(gpa); + var r = rule(&forwards, false); + defer r.deinit(); + var st: ?depth.State = null; + defer if (st) |*x| x.deinit(gpa); + const who: depth.Who = .{ .state = &st, .draft_room = 100, .finished = false, .forced = false }; + // two rows of a 1-draft head round took 130 ms: 62 ms a row past its forward and head step + try price.observeOwn(&r, 1, 130, false, who); + try std.testing.expectApproxEqAbs(5.2 + (130 - 5.4 - 0.5) / 2.0, (try price.plain(&r, who)).?, eps); + // the head's own prices do not read them: they stay on the rule's greedy rounds without plain_guard + try std.testing.expectApproxEqAbs(forwards.get(2).? + 0.5, (try r.roundCost(1, who)).?, eps); +} diff --git a/zig/src/core/lanes/depth.zig b/zig/src/core/lanes/depth.zig index 47ed47343e5..5792d1d96c1 100644 --- a/zig/src/core/lanes/depth.zig +++ b/zig/src/core/lanes/depth.zig @@ -7,6 +7,7 @@ pub const pricedBatched = alloc.pricedBatched; pub const Constants = @import("depth_constants.zig").Constants; pub const HoldCost = @import("hold_price.zig").HoldCost; const holdMs = @import("hold_price.zig").holdMs; +const copy_price = @import("copy_price.zig"); /// A stream's acceptance by depth and probe counters (Python `_depth_state[stream]`). pub const State = struct { @@ -15,10 +16,16 @@ pub const State = struct { plain: ?u64 = null, wait: ?u64 = null, ms: ?Table = null, // plain_guard: the stream's own round times + copy_ms: ?Table = null, // a lone stream's copy rounds' times by copied rows (lanes/lone_copy.zig) + copy_plain: ?u64 = null, // copies priced off in a row, and how many before one is tried again + copy_wait: ?u64 = null, + copy_band: ?usize = null, // the context band its copy prices started from, where it leaves them (lanes/lone_copy.zig) + copy_rounds: u64 = 0, // its own timed copy rounds pub fn deinit(st: *State, gpa: Allocator) void { gpa.free(st.p); if (st.ms) |*t| t.deinit(gpa); + if (st.copy_ms) |*t| t.deinit(gpa); } }; @@ -54,6 +61,7 @@ pub const Rule = struct { mtp_step_ms: f64, draft_step_ms: f64 = 0, // a shared round's draft past a stream's first (budgets price it) plain_guard: bool, + copy_guard: bool = false, // a lone stream's copies compete with its own plain rounds (Config.copy_guard) node_probabilities: bool, granted_depth: bool = false, // node_probabilities: a stream drafts its last grant plus draft_slack, lone ones too confidence_floor: ?f64 = null, @@ -106,6 +114,11 @@ pub const Rule = struct { fn costs(r: *Rule, who: ?Who) !*Table { const w = who orelse return &r.round_ms; if (!r.plain_guard) return if (w.sampled) &r.round_ms else &r.greedy_ms; + return r.ownCosts(w); + } + + /// The stream's own round times by depth (plain_guard's, and a copy's plain price: lanes/copy_price.zig). + pub fn ownCosts(r: *Rule, w: Who) !*Table { _ = try r.rates(w); const st = &w.state.*.?; if (st.ms == null) st.ms = .{}; @@ -120,18 +133,22 @@ pub const Rule = struct { if (table == &r.greedy_ms) try r.blend(&r.round_ms, drafts, ms); // a greedy round counts for every stream too } - fn blend(r: *Rule, table: *Table, drafts: i64, ms: f64) !void { + pub fn blend(r: *Rule, table: *Table, drafts: i64, ms: f64) !void { const before = table.get(drafts); try table.put(r.gpa, drafts, if (before) |b| b + r.k.cost_rate * (ms - b) else ms); } /// Measured round time when there is one, else the load-time forward cost plus head steps. pub fn roundCost(r: *Rule, drafts: i64, who: ?Who) !?f64 { - const table = try r.costs(who); + return r.roundCostIn(try r.costs(who), drafts, r.plain_guard); + } + + /// roundCost on `table`; `with_floor`: an untimed depth also pays the least excess a timed round's row showed. + pub fn roundCostIn(r: *const Rule, table: *const Table, drafts: i64, with_floor: bool) ?f64 { if (table.get(drafts)) |v| return v; const forward = r.family_costs.get(drafts + 1) orelse return null; var modeled = forward + r.mtp_step_ms * @as(f64, @floatFromInt(drafts)); - if (r.plain_guard) { + if (with_floor) { // untimed: its model plus the least time a row of a timed round took beyond its model var least: ?f64 = null; for (table.slots, 0..) |slot, d| { @@ -156,48 +173,82 @@ pub const Rule = struct { const want: i64 = if (p[0] < 0.8) 1 else if (p[0] < 0.9) 2 else 3; return @max(1, @min(most, want)); } + var best = (try r.bestRows(who, p, most, false)).rows; + const st = &who.state.*.?; + st.rounds += 1; + if (best == 0) return @intFromBool(r.probePlain(st)); + st.plain = 0; + st.wait = r.k.depth_probe_every; + if (best < most and st.rounds % r.k.depth_probe_every == 0) best += 1; + return best; + } + + /// The rows with the most expected tokens a ms (0: plain) and the best of one or more, from each row's chance. + fn bestRows(r: *Rule, who: Who, chances: []const f64, most: i64, comptime copy: bool) !struct { rows: i64, drafted: i64 } { var best: i64 = 1; var best_rate: f64 = -1.0; - if (r.plain_guard) { - if (try r.roundCost(0, who)) |plain| { + if (copy or r.plain_guard) { + if (try (if (copy) copy_price.plain(r, who) else r.roundCost(0, who))) |plain| { if (plain != 0.0) { // a draft must beat plain by plain_margin: estimates near the line are noise best = 0; best_rate = r.k.plain_margin / plain; } } } + var drafted: i64 = 1; + var drafted_rate: f64 = -1.0; var expected: f64 = 1.0; var run: f64 = 1.0; var d: i64 = 1; while (d <= most) : (d += 1) { - const cost = (try r.roundCost(d, who)) orelse break; + const cost = (if (copy) try copy_price.cost(r, d, who) else try r.roundCost(d, who)) orelse break; const at: usize = @intCast(d - 1); - run *= if (at < p.len) p[at] else p[p.len - 1]; + run *= if (at < chances.len) chances[at] else chances[chances.len - 1]; expected += run; if (expected / cost > best_rate) { best = d; best_rate = expected / cost; } + if (expected / cost > drafted_rate) { + drafted = d; + drafted_rate = expected / cost; + } } - const st = &who.state.*.?; - st.rounds += 1; - if (best == 0) return @intFromBool(r.probePlain(st)); - st.plain = 0; - st.wait = r.k.depth_probe_every; - if (best < most and st.rounds % r.k.depth_probe_every == 0) best += 1; - return best; + return .{ .rows = best, .drafted = drafted }; } /// One draft after `wait` plain rounds in a row; each probe doubles the wait until drafting wins again. fn probePlain(r: *Rule, st: *State) bool { - st.plain = (st.plain orelse 0) + 1; - const wait = st.wait orelse r.k.depth_probe_every; - if (st.plain.? < wait) return false; - st.plain = 0; - st.wait = @min(2 * wait, r.k.plain_wait_most); + return r.backoff(&st.plain, &st.wait); + } + + /// True on the pass reaching `wait` passes in a row; the count restarts, the wait doubles (to plain_wait_most). + fn backoff(r: *const Rule, passes: *?u64, wait: *?u64) bool { + passes.* = (passes.* orelse 0) + 1; + const w = wait.* orelse r.k.depth_probe_every; + if (passes.*.? < w) return false; + passes.* = 0; + wait.* = @min(2 * w, r.k.plain_wait_most); return true; } + /// A lone copy's best prefix on its stream's own times, none while plain wins bar a backoff probe (`take` counts). + pub fn copyRows(r: *Rule, who: Who, chances: []const f64, rows: i64, take: bool) !i64 { + if (rows <= 0 or !r.copy_guard or r.family_costs.empty()) return rows; + if ((try copy_price.plain(r, who)) == null) return rows; + const best = try r.bestRows(who, chances, rows, true); + const st = &who.state.*.?; + if (best.rows > 0) { + if (take) { + st.copy_plain = 0; + st.copy_wait = r.k.depth_probe_every; + } + return best.rows; + } + const probe = if (take) r.backoff(&st.copy_plain, &st.copy_wait) else (st.copy_plain orelse 0) + 1 >= (st.copy_wait orelse r.k.depth_probe_every); + return if (probe) best.drafted else 0; + } + /// Drafts past a grant: none when it stopped short of the held drafts (the width did not bind), else grant_slack. fn slack(r: *const Rule, who: Who) i64 { return if (who.grant_short) r.k.short_slack else r.k.grant_slack; diff --git a/zig/src/core/lanes/engine.zig b/zig/src/core/lanes/engine.zig index c780bde3ff9..e29b22022c5 100644 --- a/zig/src/core/lanes/engine.zig +++ b/zig/src/core/lanes/engine.zig @@ -71,6 +71,7 @@ pub const Engine = struct { .mtp_step_ms = cfg.mtp_step_ms, .draft_step_ms = cfg.draft_step_ms, .plain_guard = cfg.plain_guard, + .copy_guard = cfg.copy_guard, .node_probabilities = cfg.node_probabilities, .granted_depth = cfg.granted_depth, .confidence_floor = cfg.draft_confidence, @@ -149,9 +150,7 @@ pub const Engine = struct { try e.roundStreams(chosen); } else { for (live.items) |s| { - // logprobs and grammars take verify windows: rows' logits are read, or bits made, before a forward - const windowed = (e.cfg.family_mtp and s.drafts) or !e.cfg.pipelined or s.logprobs != null or s.grammar != null; - const r = if (windowed) try e.familyRound(s, null) else try e.pipelinedRound(s); + const r = if (e.windowed(s)) try e.familyRound(s, null) else try e.pipelinedRound(s); s.min_rows = if (s.min_rows == 0) r.rows else @min(s.min_rows, r.rows); } } @@ -160,6 +159,12 @@ pub const Engine = struct { try trail.state(e); } + /// Whether a lone stream's rounds are verify windows, else one-token steps queued ahead (pipelinedRound). + pub fn windowed(e: *const Engine, s: *const Stream) bool { + // logprobs and grammars take verify windows: rows' logits are read, or bits made, before a forward + return (e.cfg.family_mtp and s.drafts) or !e.cfg.pipelined or s.logprobs != null or s.grammar != null; + } + /// Least recently served streams within the stream and row limits, never cutting pending or forced rows. fn takeTurns(e: *Engine, live: []*Stream) ![]*Stream { const a = e.arena.allocator(); @@ -219,6 +224,8 @@ pub const Engine = struct { const o = try e.conclude(s, plan, out[0].sampled, out[0].rows, tokens, parents, windows[0].positions); if (o.path.len < rows or plan.parents != null) try e.backend.keep(&windows, &.{o.path}); const held_levels = s.held_levels; + const timed_copy = e.cfg.family_mtp and s.drafts and @import("lone_copy.zig").records(e, s, plan.kind); + const verified: ?f64 = if (timed_copy) e.clock.elapsedMs(.cost) else null; // its read moves before the head drafts if (e.cfg.family_mtp and s.drafts) { if (early and o.cut == null) { var w = win.who(s); @@ -236,6 +243,7 @@ pub const Engine = struct { lone_costs.observe(s, plan.cost_probe_rows, rows, ms); } } + try @import("lone_copy.zig").time(e, s, plan.kind, rows, verified); if (e.cfg.timed and s.graft_room != null and s.rounds > 1) { // the stream's round time beyond its window and head levels, for the lane planner if (e.cfg.lane_costs.get(@intCast(rows))) |w| { @@ -529,6 +537,7 @@ pub const Engine = struct { pub fn release(e: *Engine, s: *Stream) void { e.late.cancel(s); if (e.cfg.lone_cost_tile > 0) lone_costs.keep(e.gpa, lone_costs.slot(&e.lone_kept, s), s) catch {}; + @import("lone_copy.zig").keep(e, s); if (s.inflight) |h| _ = e.backend.read(h) catch 0; // the handle frees the backend's ring slot s.dropRoundState(e.gpa); e.backend.release(s); diff --git a/zig/src/core/lanes/lanes.zig b/zig/src/core/lanes/lanes.zig index f9b284af8ae..3f7ebcd6e05 100644 --- a/zig/src/core/lanes/lanes.zig +++ b/zig/src/core/lanes/lanes.zig @@ -101,5 +101,8 @@ pub const learned_dirs = @import("learned_dirs.zig"); test { _ = @import("context_copy_price_test.zig"); + _ = @import("lone_copy_price_test.zig"); + _ = @import("lone_copy_sampled_test.zig"); + _ = @import("copy_price_test.zig"); _ = @import("sampling_row.zig"); } diff --git a/zig/src/core/lanes/lone_copy.zig b/zig/src/core/lanes/lone_copy.zig new file mode 100644 index 00000000000..c452dc5ca9b --- /dev/null +++ b/zig/src/core/lanes/lone_copy.zig @@ -0,0 +1,74 @@ +//! A lone stream's copy windows priced as its head's drafts are: the depth rule on the stream's own timed rounds. +const Engine = @import("engine.zig").Engine; +const Stream = @import("stream.zig").Stream; +const win = @import("windows.zig"); +const copy_price = @import("copy_price.zig"); +const lone_costs = @import("lone_costs.zig"); +const ev = @import("events.zig"); +const trail = @import("trail.zig"); +const f = ev.f; + +/// A lone stream whose copies compete with its plain rounds (copy_guard), timed, its head priced by the rule's chain. +pub fn enabled(e: *const Engine, s: *const Stream) bool { + const c = e.cfg; + return e.alone and s.drafts and c.timed and c.copy_guard and e.trim == null and !c.root_copies and + !c.context_copies and !c.node_probabilities and c.lone_cost_tile == 0 and !c.family_costs.empty() and e.windowed(s); +} + +/// The copy's rows to verify, a prefix (none: plain or the head's drafts take the round); `take`: the round's plan. +pub fn rows(e: *Engine, s: *Stream, copy: win.Copy, take: bool) !usize { + const n = copy.tokens.len; + if (n == 0 or !enabled(e, s)) return n; + try seed(e, s); + const rate = win.copiedRate(e, s, copy.recalled); + const kept: usize = @intCast(try e.rule.copyRows(win.who(s), &.{rate}, @intCast(n), take)); + if (take) try trail.event(e, &.{ f("ev", trail.str("copy-price")), f("stream", trail.str(s.id)), f("rows", trail.int(n)), f("keep", trail.int(kept)), f("rate", ev.bits(rate)) }); + return kept; +} + +/// Whether `time` records this round: its copy rounds, and the plain and head rounds the head's timing keeps out. +pub fn records(e: *const Engine, s: *const Stream, kind: win.Kind) bool { + if (!enabled(e, s)) return false; + // engine.zig's familyRound times a head's and plain rounds into the stream's own times only under plain_guard + return kind == .copy or ((kind == .none or kind == .head) and !(e.cfg.family_mtp and e.cfg.plain_guard)); +} + +/// A priced stream's round by its rows (`records`); `verified`: its time before the head drafted (a copy's verify). +pub fn time(e: *Engine, s: *Stream, kind: win.Kind, window_rows: usize, verified: ?f64) !void { + if (!records(e, s, kind)) return; + const own = kind != .copy; + try seed(e, s); + const ms = verified orelse e.clock.elapsedMs(.cost); + const first = s.rounds == 1; // a stream's first round carries the prefill-to-decode switch + try trail.event(e, &.{ f("ev", trail.str(if (own) "plain-cost" else "copy-cost")), f("stream", trail.str(s.id)), f("drafts", trail.int(window_rows - 1)), f("init", .{ .bool = first }), f("ms", ev.bits(ms)) }); + const drafts: i64 = @intCast(window_rows - 1); + if (own) return copy_price.observeOwn(&e.rule, drafts, ms, first, win.who(s)); + return copy_price.observeCopy(&e.rule, drafts, ms, first, win.who(s)); +} + +/// Copy rounds a stream times before its prices replace the kept ones: a reply of a few tokens times one at most. +const kept_rounds = 2; + +/// A stream's first priced round starts from the copy prices kept for its sampling mode and its context's band. +fn seed(e: *Engine, s: *Stream) !void { + if (s.prices_seeded) return; + s.prices_seeded = true; + _ = try e.rule.rates(win.who(s)); + const band = lone_costs.band(s.context.items.len); + s.depth.?.copy_band = band; + try lone_costs.seedCopies(e.gpa, slot(e, s, band).*, s); +} + +/// A finished stream's copy prices for the next one starting in its band; plain times too when only copies read them. +pub fn keep(e: *Engine, s: *const Stream) void { + if (!e.cfg.copy_guard or e.cfg.lone_cost_tile > 0) return; + const st = s.depth orelse return; + const band = st.copy_band orelse return; + if (st.copy_rounds < kept_rounds) return; + lone_costs.keepCopies(e.gpa, slot(e, s, band), s, !e.cfg.plain_guard) catch {}; +} + +/// The kept copy prices of a stream's sampling mode at a band: those of the band it started in, read and left. +fn slot(e: *Engine, s: *const Stream, band: usize) *?lone_costs.Kept { + return &e.lone_kept[@intFromBool(s.sampling != null)][band]; +} diff --git a/zig/src/core/lanes/lone_copy_price_test.zig b/zig/src/core/lanes/lone_copy_price_test.zig new file mode 100644 index 00000000000..66353440da0 --- /dev/null +++ b/zig/src/core/lanes/lone_copy_price_test.zig @@ -0,0 +1,554 @@ +//! A lone stream's copy windows priced from its own timed rounds (#3390): off where they lose, back once they land. +const std = @import("std"); +const cfgs = @import("config.zig"); +const Engine = @import("engine.zig").Engine; +const sm = @import("stream.zig"); +const fake = @import("fake.zig"); +const be = @import("backend.zig"); +const Proposer = @import("proposer.zig").Proposer; +const ev = @import("events.zig"); +const win = @import("windows.zig"); +const lone_copy = @import("lone_copy.zig"); +const copy_price = @import("copy_price.zig"); +const lone_costs = @import("lone_costs.zig"); + +const gpa = std.testing.allocator; + +/// The forwards as timed at load, on a short scratch context: 5 ms plus 0.2 ms a row. +const startup = blk: { + var c: [16]cfgs.Cost = undefined; + for (&c, 1..) |*x, w| x.* = .{ .width = w, .ms = 5 + 0.2 * @as(f64, @floatFromInt(w)) }; + break :blk c; +}; + +/// A round's ms: a fixed part plus each verified row's (at a long context each row walks the whole cache). +const long_context = [2]f64{ 50, 40 }; +const short_context = [2]f64{ 10, 0.1 }; + +const Clock = struct { + target: *const fake.Fake, + times: [2]f64, + draft_ms: f64 = 0, // each head drafting since the round started + drafts_at: usize = 0, + + fn clock(c: *Clock) be.Clock { + return .{ .ptr = c, .vtable = &.{ .start = start, .elapsed_ms = elapsed } }; + } + + fn start(ptr: *anyopaque) void { + const c: *Clock = @ptrCast(@alignCast(ptr)); + c.drafts_at = c.target.drafts_calls; + } + + fn elapsed(ptr: *anyopaque, _: be.Mark) f64 { + const c: *Clock = @ptrCast(@alignCast(ptr)); + const drafts: f64 = @floatFromInt(c.target.drafts_calls - c.drafts_at); + return c.times[0] + c.times[1] * @as(f64, @floatFromInt(c.target.last_rows)) + c.draft_ms * drafts; + } +}; + +/// The target's next 15 tokens at every ask: from context length `land_from` on they land, before it the first misses. +const Copier = struct { + out: [15]u32 = undefined, + land_from: usize = std.math.maxInt(usize), + quiet_until: usize = 0, // no proposal before this context length + + fn propose(ptr: *anyopaque, context: []const u32, most: i64) anyerror![]const u32 { + const c: *Copier = @ptrCast(@alignCast(ptr)); + if (most < 2 or context.len < c.quiet_until) return &.{}; + const history = try gpa.alloc(u32, context.len + c.out.len); + defer gpa.free(history); + @memcpy(history[0..context.len], context); + const n: usize = @intCast(@min(c.out.len, most)); + for (c.out[0..n], 0..) |*t, k| { + t.* = fake.next(history[0 .. context.len + k], null, 0); + history[context.len + k] = t.*; + } + if (context.len < c.land_from) c.out[0] = (c.out[0] + 1) % fake.vocab; + return c.out[0..n]; + } + + fn lastMatch(_: *anyopaque) i64 { + return 100; + } + + const vtable: Proposer.VTable = .{ .propose = propose, .last_match = lastMatch }; +}; + +/// Copy windows the target verified (no held drafts, host tokens), before and from the window position `split`. +const Watch = struct { + var inner: *const fn (*anyopaque, []const be.Window, []be.Verified) anyerror!void = undefined; + var split: u64 = std.math.maxInt(u64); + var windows: [2]u64 = @splat(0); + var copies: [2]u64 = @splat(0); + var copy_rows: u64 = 0; + var shared: [3]u64 = @splat(0); // shared rounds' windows, copy windows and copy rows + var first: ?usize = null; // the first copy window's rows + + fn verify(ptr: *anyopaque, ws: []const be.Window, out: []be.Verified) anyerror!void { + for (ws) |w| { + const late = @intFromBool(w.positions[0] >= split); + windows[late] += 1; + if (ws.len > 1) shared[0] += 1; + if (w.held > 0 or w.tokens.len == 0) continue; + if (first == null) first = w.tokens.len; + copies[late] += 1; + copy_rows += w.tokens.len; + if (ws.len > 1) { + shared[1] += 1; + shared[2] += w.tokens.len; + } + } + return inner(ptr, ws, out); + } +}; + +const Run = struct { + tokens: [4][160]u32 = undefined, + lens: [4]usize = @splat(0), + rounds: u64 = 0, + drafted: u64 = 0, + accepted: u64 = 0, + windows: [2]u64 = @splat(0), // Watch's counters for this run + copies: [2]u64 = @splat(0), + copy_rows: u64 = 0, + shared: [3]u64 = @splat(0), +}; + +const prompts = [_][]const u32{ &.{ 2, 7, 1, 8, 2, 8, 1, 8 }, &.{ 3, 1, 4, 1, 5, 9, 2, 6, 5 }, &.{ 1, 4, 1, 4, 2, 1, 3, 5 }, &.{ 1, 7, 3, 2, 0, 5, 0, 8, 1 } }; +const ids = [_][]const u8{ "a", "b", "c", "d" }; + +/// The engine's decision trail of the next run, when set. +var trail: ?*ev.Log = null; + +/// `streams` streams on one engine, each with its own copier when `copier` is set (drafts off without one). +fn run(m: cfgs.Model, times: [2]f64, copier: ?Copier, streams: usize, max_new: u32) !Run { + var cfg = try cfgs.Config.init(gpa, m, 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var backend = target.backend(); + var table = backend.vtable.*; + Watch.inner = table.verify; + table.verify = Watch.verify; + backend.vtable = &table; + Watch.windows = @splat(0); + Watch.copies = @splat(0); + Watch.copy_rows = 0; + Watch.shared = @splat(0); + var clock: Clock = .{ .target = &target, .times = times }; + var e = Engine.init(gpa, &cfg, backend, clock.clock()); + defer e.deinit(); + e.log = trail; + var copiers: [4]Copier = @splat(copier orelse .{}); + var ss: [4]sm.Stream = undefined; + for (ss[0..streams], copiers[0..streams], prompts[0..streams], ids[0..streams]) |*s, *c, p, id| s.* = try sm.Stream.init(gpa, .{ .id = id, .prompt = p, .max_new = max_new, .drafts = copier != null, .proposer = .{ .ptr = c, .vtable = &Copier.vtable } }); + defer for (ss[0..streams]) |*s| s.deinit(gpa); + for (ss[0..streams]) |*s| try e.addStream(s); + while (e.activeCount() > 0) try e.step(); + var out: Run = .{ .windows = Watch.windows, .copies = Watch.copies, .copy_rows = Watch.copy_rows, .shared = Watch.shared }; + for (ss[0..streams], 0..) |*s, i| { + out.lens[i] = s.emitted().len; + @memcpy(out.tokens[i][0..out.lens[i]], s.emitted()); + out.rounds += s.rounds; + out.drafted += s.drafted; + out.accepted += s.accepted; + } + return out; +} + +/// hip_lanes.zig facts in small: 16-row windows, timed forwards; plain rounds compete with a head, lone copies always. +fn hip(head: bool) cfgs.Model { + return .{ .exact_width = 16, .mtp = head, .speculate = head, .speculate_early = false, .drafts = 4, .plain_guard = head, .copy_guard = true, .window_costs = &startup, .mtp_step_ms = if (head) 0.5 else 0, .hidden_rows = true, .batch_rows = 32, .max_streams = 4 }; +} + +fn expectPlain(m: cfgs.Model, times: [2]f64, got: Run, streams: usize, max_new: u32) !void { + const plain = try run(m, times, null, streams, max_new); + for (0..streams) |i| try std.testing.expectEqualSlices(u32, plain.tokens[i][0..plain.lens[i]], got.tokens[i][0..got.lens[i]]); +} + +test "lone copy price: copies that lose at a long context are priced off, the head drafts, the reply as plain decode" { + const got = try run(hip(true), long_context, .{}, 1, 96); + try expectPlain(hip(true), long_context, got, 1, 96); + try std.testing.expect(got.copy_rows < got.lens[0]); // a few copies measure them, then a probe now and then + try std.testing.expect(got.drafted - got.copy_rows > got.lens[0] / 2); // the head's drafts take their rounds +} + +test "lone copy price: a copies-only stream times its rounds and prices its copies off the same way" { + const got = try run(hip(false), long_context, .{}, 1, 96); + try expectPlain(hip(false), long_context, got, 1, 96); + try std.testing.expect(got.copy_rows < got.lens[0]); + try std.testing.expect(got.copies[0] * 4 < got.windows[0]); +} + +test "lone copy price: copies priced off come back after a backoff once they land" { + for ([_]bool{ true, false }) |head| { + const land_from = prompts[0].len + 40; + Watch.split = land_from; + defer Watch.split = std.math.maxInt(u64); + const got = try run(hip(head), short_context, .{ .land_from = land_from }, 1, 144); + try expectPlain(hip(head), short_context, got, 1, 144); + try std.testing.expect(got.windows[0] >= got.copies[0] + 8); // missing copies left off for a backoff's wait at least + try std.testing.expect(got.windows[1] * 6 < got.lens[0] - 40); // landing ones carry the rest, many rows a round + } +} + +test "lone copy price: at a short context copies that land stay whole" { + for ([_]bool{ true, false }) |head| { + const got = try run(hip(head), short_context, .{ .land_from = 0 }, 1, 96); + try expectPlain(hip(head), short_context, got, 1, 96); + try std.testing.expect(got.rounds * 8 < got.lens[0]); + try std.testing.expect(got.copy_rows + 15 >= 15 * (got.copies[0] + got.copies[1])); + } +} + +/// What a run leaves that pricing could move: rounds, drafted and kept rows, copy windows and their rows. +fn digest(got: Run) [5]u64 { + return .{ got.rounds, got.drafted, got.accepted, got.copies[0] + got.copies[1], got.copy_rows }; +} + +/// Values from main e7e24243d, before lone copies were priced (the same configurations, clocks and copier). +fn pinned(expected: [5]u64, got: Run) !void { + try std.testing.expectEqual(expected, digest(got)); +} + +test "lone copy price: head windows without a copy proposed keep main's depths" { + var silent = hip(true); + silent.copy_drafts = false; // no copy is ever proposed + try pinned(.{ 40, 82, 55, 0, 0 }, try run(silent, long_context, .{}, 1, 96)); + try pinned(.{ 39, 138, 56, 0, 0 }, try run(silent, short_context, .{}, 1, 96)); +} + +test "lone copy price: root copies and GLM's own copy rates stay as on main" { + var root = hip(true); + root.root_copies = true; + try pinned(.{ 52, 424, 43, 26, 365 }, try run(root, long_context, .{}, 1, 96)); + var glm = root; // lanes/../glm/cuda_copy_policy.zig: root and context copies priced by each stream's own rate + glm.context_copies = true; + glm.own_copy_rates = true; + glm.copy_match = 4; + try pinned(.{ 28, 255, 67, 16, 229 }, try run(glm, long_context, .{ .land_from = prompts[0].len + 40 }, 1, 96)); +} + +test "lone copy price: context copies on a lone head window stay as on main" { + var context = hip(true); + context.context_copies = true; + try pinned(.{ 38, 562, 57, 38, 562 }, try run(context, long_context, .{ .land_from = prompts[0].len + 40 }, 1, 96)); +} + +test "lone copy price: shared rounds' copies stay as on main (the streams' lone rounds after one ends excluded)" { + // main e7e24243d: shared rounds' windows, copy windows and copy rows + for ([_]bool{ true, false }, [_][3]u64{ .{ 124, 122, 1644 }, .{ 126, 122, 1644 } }) |head, expected| { + const got = try run(hip(head), long_context, .{}, 2, 64); + try std.testing.expectEqual(expected, got.shared); + } +} + +/// A hash of the trail's lines up to the first step without a shared round, and how many lines that is. +fn sharedPhase(log: *ev.Log) ![2]u64 { + var end: usize = log.events.items.len; + var step: ?usize = null; + var turns = false; + for (log.events.items, 0..) |fields, i| { + const kind = for (fields) |x| { + if (std.mem.eql(u8, x.k, "ev")) break x.v.str; + } else ""; + if (std.mem.eql(u8, kind, "turns")) turns = true; + if (!std.mem.eql(u8, kind, "step")) continue; + if (step) |at| if (!turns) { + end = at; + break; + }; + step = i; + turns = false; + } else if (step) |at| if (!turns) { + end = at; // the run's last step was a lone one + }; + return hashed(log, end); +} + +/// A hash of the trail's first `end` lines, and `end`. +fn hashed(log: *ev.Log, end: usize) ![2]u64 { + var h = std.hash.Wyhash.init(0); + for (0..end) |i| { + const text = try log.line(gpa, i); + defer gpa.free(text); + h.update(text); + h.update("\n"); + } + return .{ h.final(), end }; +} + +test "lone copy price: HIP's facts without a head keep main's shared rounds, two and four streams" { + // main e7e24243d, its hip_lanes.zig facts without a head (no plain_guard): the shared phase's trail, hashed + const cases = [_]struct { streams: usize, copier: Copier, expected: [2]u64 }{ + .{ .streams = 2, .copier = .{}, .expected = .{ 12160614949009965908, 1276 } }, + .{ .streams = 2, .copier = .{ .land_from = 48 }, .expected = .{ 612887639395430184, 445 } }, + .{ .streams = 4, .copier = .{}, .expected = .{ 5045447432178392522, 1790 } }, + .{ .streams = 4, .copier = .{ .land_from = 80 }, .expected = .{ 5351245168654378449, 1104 } }, + }; + for (cases) |c| { + var log = ev.Log.init(gpa); + defer log.deinit(); + trail = &log; + defer trail = null; + _ = try run(hip(false), long_context, c.copier, c.streams, 128); + const got = try sharedPhase(&log); + try std.testing.expectEqual(c.expected, got); + } +} + +test "lone copy price: copy_guard is off unless a family opts in, whatever plain_guard says" { + for ([_]bool{ false, true }) |plain| { + var unset = try cfgs.Config.init(gpa, .{ .exact_width = 16, .plain_guard = plain }, 16, 15); + defer unset.deinit(gpa); + try std.testing.expectEqual(plain, unset.plain_guard); + try std.testing.expect(!unset.copy_guard); + for ([_]bool{ false, true }) |copy| { + var cfg = try cfgs.Config.init(gpa, .{ .exact_width = 16, .plain_guard = plain, .copy_guard = copy }, 16, 15); + defer cfg.deinit(gpa); + try std.testing.expectEqual(copy, cfg.copy_guard); + } + } +} + +test "lone copy price: a head without plain_guard prices copies against its own rounds, not the load-time forward" { + var m = hip(true); + m.plain_guard = false; // copy_guard alone: the head's depths keep the rule's greedy rounds, plain is never timed + const got = try run(m, long_context, .{ .land_from = 0 }, 1, 96); + try expectPlain(m, long_context, got, 1, 96); + try std.testing.expect(got.rounds * 8 < got.lens[0]); // landing copies stay on, many rows a round +} + +test "lone copy price: copyAhead reads the price the plan takes, backoff probes included, and counts nothing" { + var cfg = try cfgs.Config.init(gpa, hip(true), 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var clock: Clock = .{ .target = &target, .times = long_context }; + var e = Engine.init(gpa, &cfg, target.backend(), clock.clock()); + defer e.deinit(); + var c: Copier = .{}; + var s = try sm.Stream.init(gpa, .{ .id = "a", .prompt = prompts[0], .max_new = 96, .proposer = .{ .ptr = &c, .vtable = &Copier.vtable } }); + defer s.deinit(gpa); + // a 90 ms plain round and a 15-row copy of 690 ms at a long context, after eight copies that missed + try e.rule.observeCost(0, 90, false, win.who(&s)); + try copy_price.observeCopy(&e.rule, 15, 690, false, win.who(&s)); + for (0..8) |_| win.observeCopied(&e, &s, false, 0, 15); + var probes: [2]usize = .{ 0, 0 }; + var found: usize = 0; + for (1..41) |take| { + _ = e.arena.reset(.retain_capacity); + const w = win.who(&s); + const ahead = win.copyAhead(&e, &w); + try std.testing.expectEqual(ahead, win.copyAhead(&e, &w)); // a second read moves nothing + const kept = try lone_copy.rows(&e, &s, try win.copyProposal(&e, &s), true); + try std.testing.expectEqual(ahead, kept > 0); + if (kept == 0) continue; + try std.testing.expect(found < probes.len); + probes[found] = take; + found += 1; + } + try std.testing.expectEqualSlices(usize, &.{ 8, 24 }, &probes); // after 8, then 16 more, priced-off copies +} + +/// A request's reply, its first copy window's rows, and its copy windows and rows. +const Request = struct { tokens: [160]u32 = undefined, len: usize = 0, first: ?usize = null, copies: u64 = 0, copy_rows: u64 = 0 }; + +/// A request `serve` sends: its prompt, the tokens its copier stays quiet for, its reply's length and its round times. +const Ask = struct { prompt: []const u32, quiet: usize, max_new: u32, times: [2]f64, drafts: bool = true }; + +/// One engine serving `asks` as lone requests one after another, each with its own copier and clock. +fn serve(m: cfgs.Model, asks: []const Ask, out: []Request) !void { + var cfg = try cfgs.Config.init(gpa, m, 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var backend = target.backend(); + var table = backend.vtable.*; + Watch.inner = table.verify; + table.verify = Watch.verify; + backend.vtable = &table; + var clock: Clock = .{ .target = &target, .times = asks[0].times }; + var e = Engine.init(gpa, &cfg, backend, clock.clock()); + defer e.deinit(); + e.log = trail; + for (asks, out, ids[0..asks.len]) |ask, *r, id| { + clock.times = ask.times; + Watch.copies = @splat(0); + Watch.copy_rows = 0; + Watch.first = null; + var c: Copier = .{ .land_from = 0, .quiet_until = ask.prompt.len + ask.quiet }; + var s = try sm.Stream.init(gpa, .{ .id = id, .prompt = ask.prompt, .max_new = ask.max_new, .drafts = ask.drafts, .proposer = .{ .ptr = &c, .vtable = &Copier.vtable } }); + defer s.deinit(gpa); + try e.addStream(&s); + while (e.activeCount() > 0) try e.step(); + r.len = s.emitted().len; + @memcpy(r.tokens[0..r.len], s.emitted()); + r.first = Watch.first; + r.copies = Watch.copies[0] + Watch.copies[1]; + r.copy_rows = Watch.copy_rows; + } +} + +/// `out.len` requests of `prompts` in order on one engine, each copier quiet for its first `quiet` tokens. +fn sequential(m: cfgs.Model, times: [2]f64, quiet: usize, out: []Request, max_new: u32) !void { + var asks: [prompts.len]Ask = undefined; + for (asks[0..out.len], prompts[0..out.len]) |*ask, p| ask.* = .{ .prompt = p, .quiet = quiet, .max_new = max_new, .times = times }; + return serve(m, asks[0..out.len], out); +} + +test "lone copy price: a request's first copies are priced from the copy rounds the request before it timed" { + for ([_]bool{ false, true }) |head| { + var got: [2]Request = @splat(.{}); + try sequential(hip(head), short_context, 4, &got, 64); + const plain = try run(hip(head), short_context, null, 2, 64); + for (got, 0..) |r, i| try std.testing.expectEqualSlices(u32, plain.tokens[i][0..plain.lens[i]], r.tokens[0..r.len]); + // the second request starts from the first's timed copies: its first copy is whole, as the first's later ones + try std.testing.expectEqual(@as(?usize, 15), got[1].first); + // without a head the first request timed its plain rounds before any copy: the untimed price cut its first one + if (!head) try std.testing.expect(got[0].first.? < 15); + } +} + +test "lone copy price: kept copy prices need two timed copies on a lone stream, leave a head's times, keep a stream's own" { + for ([_]bool{ false, true }) |head| { + var cfg = try cfgs.Config.init(gpa, hip(head), 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var clock: Clock = .{ .target = &target, .times = short_context }; + var e = Engine.init(gpa, &cfg, target.backend(), clock.clock()); + defer e.deinit(); + var done = try sm.Stream.init(gpa, .{ .id = "a", .prompt = prompts[0], .max_new = 8 }); + defer done.deinit(gpa); + try copy_price.observeCopy(&e.rule, 15, 11.6, false, win.who(&done)); + try copy_price.observeOwn(&e.rule, 0, 10.1, false, win.who(&done)); + done.depth.?.copy_band = 0; // as its first priced round left it (lone_copy.zig's seed) + lone_copy.keep(&e, &done); + try std.testing.expect(e.lone_kept[0][0] == null); // one timed copy round, as a warm-up's few tokens: nothing kept + try copy_price.observeCopy(&e.rule, 15, 11.6, false, win.who(&done)); + done.shared_round = true; + lone_copy.keep(&e, &done); + try std.testing.expect(e.lone_kept[0][0] == null); // a round beside another stream: its times were not its own + done.shared_round = false; + lone_copy.keep(&e, &done); + var next = try sm.Stream.init(gpa, .{ .id = "b", .prompt = prompts[1], .max_new = 8 }); + defer next.deinit(gpa); + _ = try e.rule.rates(win.who(&next)); + try lone_costs.seedCopies(gpa, lone_costs.slot(&e.lone_kept, &next).*, &next); + try std.testing.expectEqual(@as(?f64, 11.6), next.depth.?.copy_ms.?.get(15)); + // a head's own round times are its depth rule's, never carried by copy pricing + try std.testing.expectEqual(@as(?f64, if (head) null else 10.1), if (next.depth.?.ms) |t| t.get(0) else null); + const long = try gpa.alloc(u32, 8192); + defer gpa.free(long); + @memset(long, 1); + var far = try sm.Stream.init(gpa, .{ .id = "c", .prompt = long, .max_new = 8 }); + defer far.deinit(gpa); + _ = try e.rule.rates(win.who(&far)); + try lone_costs.seedCopies(gpa, lone_costs.slot(&e.lone_kept, &far).*, &far); + try std.testing.expect(far.depth.?.copy_ms == null); // another context band starts unpriced + var timed = try sm.Stream.init(gpa, .{ .id = "d", .prompt = prompts[2], .max_new = 8 }); + defer timed.deinit(gpa); + try copy_price.observeCopy(&e.rule, 15, 30, false, win.who(&timed)); + try lone_costs.seedCopies(gpa, lone_costs.slot(&e.lone_kept, &timed).*, &timed); + try std.testing.expectEqual(@as(?f64, 30), timed.depth.?.copy_ms.?.get(15)); // its own copy times stay + try std.testing.expectEqual(@as(?f64, if (head) null else 10.1), if (timed.depth.?.ms) |t| t.get(0) else null); + } +} + +test "lone copy price: engines that leave copies unpriced decide two requests in a row as before" { + // e5478c4ab: the trail of two requests in a row on one engine, hashed, where the copy gate is off + var tile = hip(true); + tile.lone_cost_tile = 2; // CUDA's lone window prices, which keep their own calibration (lanes/lone_costs.zig) + var head = hip(true); + head.copy_guard = false; + var copies = hip(false); + copies.copy_guard = false; + const cases = [_]struct { m: cfgs.Model, expected: [2]u64 }{ + .{ .m = tile, .expected = .{ 14840352178686162370, 75 } }, + .{ .m = head, .expected = .{ 12942564931587194512, 69 } }, + .{ .m = copies, .expected = .{ 14652143946053147409, 62 } }, + }; + for (cases) |c| { + var log = ev.Log.init(gpa); + defer log.deinit(); + trail = &log; + defer trail = null; + var got: [2]Request = @splat(.{}); + try sequential(c.m, short_context, 4, &got, 64); + try std.testing.expectEqual(c.expected, try hashed(&log, log.events.items.len)); + } +} + +test "lone copy price: a request reads the copy prices of the one before that started in its band, not a short warm-up's" { + // a warm-up timing one copy at a long context's round times, then two from 8,150 tokens past 8,192 at a short one's + const long = try gpa.alloc(u32, 8150); + defer gpa.free(long); + for (long, 0..) |*t, i| t.* = @intCast(i % fake.vocab); + for ([_]bool{ false, true }) |head| { + var asks = [_]Ask{ + .{ .prompt = prompts[0], .quiet = 2, .max_new = 8, .times = long_context }, + .{ .prompt = long, .quiet = 4, .max_new = 64, .times = short_context }, + .{ .prompt = long, .quiet = 4, .max_new = 64, .times = short_context }, + }; + var got: [3]Request = @splat(.{}); + try serve(hip(head), &asks, &got); + try std.testing.expectEqual(@as(u64, 1), got[0].copies); + var alone: [2]Request = @splat(.{}); + try serve(hip(head), asks[1..], &alone); + for (&asks) |*ask| ask.drafts = false; + var plain: [3]Request = @splat(.{}); + try serve(hip(head), &asks, &plain); + for (got, plain) |r, p| try std.testing.expectEqualSlices(u32, p.tokens[0..p.len], r.tokens[0..r.len]); + // the warm-up's one timed copy replaces nothing: the long replies decide as on an engine that never served it + for (got[1..], alone) |r, x| try std.testing.expectEqual([3]u64{ x.first orelse 0, x.copies, x.copy_rows }, [3]u64{ r.first orelse 0, r.copies, r.copy_rows }); + // the second long reply starts from the first's timed copies: its first copy whole, as the first's later ones + try std.testing.expectEqual(@as(?usize, 15), got[2].first); + } +} + +test "lone copy price: a head stream's copy rounds are timed by their verify, without the head's next drafting" { + var cfg = try cfgs.Config.init(gpa, hip(true), 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var clock: Clock = .{ .target = &target, .times = short_context, .draft_ms = 30 }; // a slow head: 30 ms a drafting + var e = Engine.init(gpa, &cfg, target.backend(), clock.clock()); + defer e.deinit(); + var c: Copier = .{ .land_from = 0, .quiet_until = prompts[0].len + 4 }; + var s = try sm.Stream.init(gpa, .{ .id = "a", .prompt = prompts[0], .max_new = 64, .proposer = .{ .ptr = &c, .vtable = &Copier.vtable } }); + defer s.deinit(gpa); + try e.addStream(&s); + while (e.activeCount() > 0) try e.step(); + try std.testing.expect(target.drafts_calls > 0); + // the kept copy prices hold each whole copy's verify time, 10 ms plus 0.1 ms a row, and none of the drafting + const kept = e.lone_kept[0][lone_costs.band(prompts[0].len)] orelse return error.NothingKept; + try std.testing.expectEqual(@as(?f64, short_context[0] + short_context[1] * 16), kept.copy_ms.get(15)); +} + +/// A dense model's forwards: a row costs 11.6 ms past a 65 ms round, so a 15-row copy costs about three plain rounds. +const dense = blk: { + var c: [16]cfgs.Cost = undefined; + for (&c, 1..) |*x, w| x.* = .{ .width = w, .ms = 65 + 11.6 * @as(f64, @floatFromInt(w)) }; + break :blk c; +}; + +test "lone copy price: a request's first copy is priced at the landing rate the requests before it saw" { + var m = hip(false); + m.window_costs = &dense; + var asks = [_]Ask{ + .{ .prompt = prompts[0], .quiet = 0, .max_new = 64, .times = .{ 65, 11.6 } }, + .{ .prompt = prompts[1], .quiet = 0, .max_new = 64, .times = .{ 65, 11.6 } }, + }; + var got: [2]Request = @splat(.{}); + try serve(m, &asks, &got); + for (&asks) |*ask| ask.drafts = false; + var plain: [2]Request = @splat(.{}); + try serve(m, &asks, &plain); + for (got, plain) |r, p| try std.testing.expectEqualSlices(u32, p.tokens[0..p.len], r.tokens[0..r.len]); + // the first request's first copy meets the prior's landing rate: its expected rows stop paying for a full copy + try std.testing.expect(got[0].first.? < 15); + // the second starts at the rate the first's landed copies taught: its first copy is whole + try std.testing.expectEqual(@as(?usize, 15), got[1].first); +} diff --git a/zig/src/core/lanes/lone_copy_sampled_test.zig b/zig/src/core/lanes/lone_copy_sampled_test.zig new file mode 100644 index 00000000000..9818fbf63b3 --- /dev/null +++ b/zig/src/core/lanes/lone_copy_sampled_test.zig @@ -0,0 +1,201 @@ +//! A seeded sampled lone stream's copies priced short, off, and from kept prices: its reply is drafts-off decode's. +const std = @import("std"); +const cfgs = @import("config.zig"); +const Engine = @import("engine.zig").Engine; +const sm = @import("stream.zig"); +const fake = @import("fake.zig"); +const be = @import("backend.zig"); +const Proposer = @import("proposer.zig").Proposer; +const Sampling = @import("sampling.zig").Sampling; + +const gpa = std.testing.allocator; + +/// The forwards as timed at load, on a short scratch context: 5 ms plus 0.2 ms a row. +const startup = blk: { + var c: [16]cfgs.Cost = undefined; + for (&c, 1..) |*x, w| x.* = .{ .width = w, .ms = 5 + 0.2 * @as(f64, @floatFromInt(w)) }; + break :blk c; +}; + +/// A dense model's forwards: a row costs 11.6 ms past a 65 ms round, so a 15-row copy costs about three plain rounds. +const dense = blk: { + var c: [16]cfgs.Cost = undefined; + for (&c, 1..) |*x, w| x.* = .{ .width = w, .ms = 65 + 11.6 * @as(f64, @floatFromInt(w)) }; + break :blk c; +}; + +/// A round's ms: a fixed part plus each verified row's. +const long_context = [2]f64{ 50, 40 }; +const dense_rounds = [2]f64{ 65, 11.6 }; + +const Clock = struct { + target: *const fake.Fake, + times: [2]f64, + + fn clock(c: *Clock) be.Clock { + return .{ .ptr = c, .vtable = &.{ .start = start, .elapsed_ms = elapsed } }; + } + + fn start(_: *anyopaque) void {} + + fn elapsed(ptr: *anyopaque, _: be.Mark) f64 { + const c: *Clock = @ptrCast(@alignCast(ptr)); + return c.times[0] + c.times[1] * @as(f64, @floatFromInt(c.target.last_rows)); + } +}; + +/// The target's next 15 keyed draws at every ask: from context length `land_from` on they land, else the first misses. +const Copier = struct { + out: [15]u32 = undefined, + sampling: ?Sampling, + land_from: usize = 0, + + fn propose(ptr: *anyopaque, context: []const u32, most: i64) anyerror![]const u32 { + const c: *Copier = @ptrCast(@alignCast(ptr)); + if (most < 2) return &.{}; + const history = try gpa.alloc(u32, context.len + c.out.len); + defer gpa.free(history); + @memcpy(history[0..context.len], context); + const n: usize = @intCast(@min(c.out.len, most)); + for (c.out[0..n], 0..) |*t, k| { + t.* = fake.next(history[0 .. context.len + k], c.sampling, context.len + k); + history[context.len + k] = t.*; + } + if (context.len < c.land_from) c.out[0] = (c.out[0] + 1) % fake.vocab; + return c.out[0..n]; + } + + fn lastMatch(_: *anyopaque) i64 { + return 100; + } + + const vtable: Proposer.VTable = .{ .propose = propose, .last_match = lastMatch }; +}; + +/// Copy windows the target verified (no held drafts): how many, their rows, and the first one's rows. +const Watch = struct { + var inner: *const fn (*anyopaque, []const be.Window, []be.Verified) anyerror!void = undefined; + var copies: u64 = 0; + var copy_rows: u64 = 0; + var first: ?usize = null; + + fn verify(ptr: *anyopaque, ws: []const be.Window, out: []be.Verified) anyerror!void { + for (ws) |w| { + if (w.held > 0 or w.tokens.len == 0) continue; + if (first == null) first = w.tokens.len; + copies += 1; + copy_rows += w.tokens.len; + } + return inner(ptr, ws, out); + } +}; + +/// A request's reply, its first copy window's rows, and its copy windows and rows. +const Reply = struct { tokens: [160]u32 = undefined, len: usize = 0, first: ?usize = null, copies: u64 = 0, copy_rows: u64 = 0 }; + +/// A lone request: its prompt, sampling, whether it drafts, its reply's length and where its copier's copies land. +const Ask = struct { prompt: []const u32, sampling: ?Sampling, drafts: bool = true, max_new: u32, land_from: usize = 0 }; + +const prompts = [_][]const u32{ &.{ 2, 7, 1, 8, 2, 8, 1, 8 }, &.{ 3, 1, 4, 1, 5, 9, 2, 6, 5 } }; +const ids = [_][]const u8{ "a", "b" }; + +/// One engine serving `asks` as lone requests in turn; `kept`: whether band 0 kept prices, greedy then sampled. +fn serve(m: cfgs.Model, times: [2]f64, asks: []const Ask, out: []Reply, kept: ?*[2]bool) !void { + var cfg = try cfgs.Config.init(gpa, m, 16, 15); + defer cfg.deinit(gpa); + var target: fake.Fake = .{ .gpa = gpa }; + defer target.deinit(); + var backend = target.backend(); + var table = backend.vtable.*; + Watch.inner = table.verify; + table.verify = Watch.verify; + backend.vtable = &table; + var clock: Clock = .{ .target = &target, .times = times }; + var e = Engine.init(gpa, &cfg, backend, clock.clock()); + defer e.deinit(); + for (asks, out, ids[0..asks.len]) |ask, *r, id| { + Watch.copies = 0; + Watch.copy_rows = 0; + Watch.first = null; + var c: Copier = .{ .sampling = ask.sampling, .land_from = ask.land_from }; + const proposer: Proposer = .{ .ptr = &c, .vtable = &Copier.vtable }; + var s = try sm.Stream.init(gpa, .{ .id = id, .prompt = ask.prompt, .max_new = ask.max_new, .sampling = ask.sampling, .drafts = ask.drafts, .proposer = proposer }); + defer s.deinit(gpa); + try e.addStream(&s); + while (e.activeCount() > 0) try e.step(); + r.len = s.emitted().len; + @memcpy(r.tokens[0..r.len], s.emitted()); + r.first = Watch.first; + r.copies = Watch.copies; + r.copy_rows = Watch.copy_rows; + } + if (kept) |k| k.* = .{ e.lone_kept[0][0] != null, e.lone_kept[1][0] != null }; +} + +/// hip_lanes.zig facts in small (as lone_copy_price_test.zig's): 16-row windows, timed forwards, copies priced. +fn hip(head: bool, forwards: []const cfgs.Cost) cfgs.Model { + return .{ .exact_width = 16, .mtp = head, .speculate = head, .speculate_early = false, .drafts = 4, .plain_guard = head, .copy_guard = true, .window_costs = forwards, .mtp_step_ms = if (head) 0.5 else 0, .hidden_rows = true, .batch_rows = 32, .max_streams = 4 }; +} + +/// `asks` served drafts-off and with copies unpriced (main's path) give `got`'s replies, token for token. +fn expectSame(m: cfgs.Model, times: [2]f64, asks: []const Ask, got: []const Reply, unpriced: []Reply) !void { + var plain_asks: [prompts.len]Ask = undefined; + for (plain_asks[0..asks.len], asks) |*p, a| p.* = a; + for (plain_asks[0..asks.len]) |*p| p.drafts = false; + var plain: [prompts.len]Reply = @splat(.{}); + try serve(m, times, plain_asks[0..asks.len], plain[0..asks.len], null); + var off = m; + off.copy_guard = false; + try serve(off, times, asks, unpriced, null); + for (got, plain[0..asks.len], unpriced) |g, p, u| { + try std.testing.expectEqualSlices(u32, p.tokens[0..p.len], g.tokens[0..g.len]); + try std.testing.expectEqualSlices(u32, p.tokens[0..p.len], u.tokens[0..u.len]); + } +} + +test "sampled lone copy: shortened copies give the seeded reply of drafts-off decode" { + for ([_]bool{ false, true }) |head| { + const m = hip(head, &dense); + const asks = [_]Ask{.{ .prompt = prompts[0], .sampling = .{ .seed = 11, .temperature = 0.8 }, .max_new = 64 }}; + var got: [1]Reply = @splat(.{}); + try serve(m, dense_rounds, &asks, &got, null); + var unpriced: [1]Reply = @splat(.{}); + try expectSame(m, dense_rounds, &asks, &got, &unpriced); + try std.testing.expect(got[0].first.? < 15); // the untimed price at the prior's rate cuts it + try std.testing.expectEqual(@as(?usize, 15), unpriced[0].first); // unpriced, it is the whole proposal + var greedy: [1]Reply = @splat(.{}); + try serve(m, dense_rounds, &.{.{ .prompt = prompts[0], .sampling = null, .max_new = 64 }}, &greedy, null); + try std.testing.expect(!std.mem.eql(u32, greedy[0].tokens[0..greedy[0].len], got[0].tokens[0..got[0].len])); + } +} + +test "sampled lone copy: copies priced off give the seeded reply of drafts-off decode" { + for ([_]bool{ false, true }) |head| { + const m = hip(head, &startup); + const asks = [_]Ask{.{ .prompt = prompts[0], .sampling = .{ .seed = 23, .temperature = 0.8 }, .max_new = 96, .land_from = std.math.maxInt(usize) }}; + var got: [1]Reply = @splat(.{}); + try serve(m, long_context, &asks, &got, null); + var unpriced: [1]Reply = @splat(.{}); + try expectSame(m, long_context, &asks, &got, &unpriced); + try std.testing.expect(got[0].copy_rows < got[0].len); // a few copies measure them, then a probe now and then + try std.testing.expect(got[0].copy_rows * 4 < unpriced[0].copy_rows); + } +} + +test "sampled lone copy: a request's first copy reads the prices the sampled request before it kept" { + for ([_]bool{ false, true }) |head| { + const m = hip(head, &dense); + const asks = [_]Ask{ + .{ .prompt = prompts[0], .sampling = .{ .seed = 5, .temperature = 0.8 }, .max_new = 64 }, + .{ .prompt = prompts[1], .sampling = .{ .seed = 9, .temperature = 0.8 }, .max_new = 64 }, + }; + var got: [2]Reply = @splat(.{}); + var kept: [2]bool = undefined; + try serve(m, dense_rounds, &asks, &got, &kept); + var unpriced: [2]Reply = @splat(.{}); + try expectSame(m, dense_rounds, &asks, &got, &unpriced); + try std.testing.expectEqual([2]bool{ false, true }, kept); // filed under the sampled mode, not the greedy one + try std.testing.expect(got[0].first.? < 15); + try std.testing.expectEqual(@as(?usize, 15), got[1].first); // the first request's landed copies taught the rate + } +} diff --git a/zig/src/core/lanes/lone_costs.zig b/zig/src/core/lanes/lone_costs.zig index 5b6cd608e12..fd370bf2942 100644 --- a/zig/src/core/lanes/lone_costs.zig +++ b/zig/src/core/lanes/lone_costs.zig @@ -96,6 +96,9 @@ pub fn slot(kept: *[2][bands]?Kept, s: anytype) *?Kept { /// A finished lone stream's calibration, so the next stream starts priced instead of probing every width again. pub const Kept = struct { ms: Table = .{}, + copy_ms: Table = .{}, // a lone stream's copy rounds' times (keepCopies) + copied_landed: [2]f64 = .{ -1, -1 }, // and its copies' landing history, by source (Stream.copied_landed) + copied_broke: [2]f64 = .{ 0, 0 }, probes: [129]Cooldown = @splat(.{}), after: u64 = 8, spacing: u64 = 8, @@ -103,6 +106,7 @@ pub const Kept = struct { pub fn deinit(k: *Kept, gpa: std.mem.Allocator) void { k.ms.deinit(gpa); + k.copy_ms.deinit(gpa); } }; @@ -130,6 +134,42 @@ pub fn seed(gpa: std.mem.Allocator, kept: ?Kept, s: anytype) !void { s.cost_probe_spacing = @min(carry_most, k.spacing); } +/// A lone stream's copy prices (lanes/lone_copy.zig), kept as keep keeps a head's; `own_plain`: its plain times too. +pub fn keepCopies(gpa: std.mem.Allocator, kept: *?Kept, s: anytype, own_plain: bool) !void { + if (s.shared_round) return; + const state = s.depth orelse return; + const copies = state.copy_ms orelse return; + if (copies.empty()) return; + const copy_ms: Table = .{ .slots = try gpa.dupe(?f64, copies.slots) }; + errdefer gpa.free(copy_ms.slots); + const ms: Table = if (own_plain) .{ .slots = try gpa.dupe(?f64, observed(s).slots) } else .{}; + if (kept.*) |*k| k.deinit(gpa); + kept.* = .{ .ms = ms, .copy_ms = copy_ms, .copied_landed = s.copied_landed, .copied_broke = s.copied_broke, .rounds = s.rounds }; +} + +/// Start a stream's copy prices from the newest kept ones, each table only while the stream has timed none of its own. +pub fn seedCopies(gpa: std.mem.Allocator, kept: ?Kept, s: anytype) !void { + const k = kept orelse return; + const state = if (s.depth) |*d| d else return; + try fill(gpa, &state.copy_ms, k.copy_ms); + try fill(gpa, &state.ms, k.ms); + // the landing rate a copy's rows are priced by, a source's only while the stream has seen none of its own copies + for (&s.copied_landed, &s.copied_broke, k.copied_landed, k.copied_broke) |*landed, *broke, was, broken| { + if (landed.* >= 0 or was < 0) continue; + landed.* = was; + broke.* = broken; + } +} + +fn fill(gpa: std.mem.Allocator, own: *?Table, from: Table) !void { + if (from.empty()) return; + if (own.*) |*t| { + if (!t.empty()) return; + t.deinit(gpa); + } + own.* = .{ .slots = try gpa.dupe(?f64, from.slots) }; +} + pub const Trial = struct { rows: u32, expected: f64, diff --git a/zig/src/core/lanes/windows.zig b/zig/src/core/lanes/windows.zig index 75c1db8788b..c2ff650a4df 100644 --- a/zig/src/core/lanes/windows.zig +++ b/zig/src/core/lanes/windows.zig @@ -3,6 +3,7 @@ const std = @import("std"); const accept = @import("accept.zig"); const cut = @import("window_cut.zig"); const lone_costs = @import("lone_costs.zig"); +const lone_copy = @import("lone_copy.zig"); const alloc = @import("allocate.zig"); const be = @import("backend.zig"); const depth = @import("depth.zig"); @@ -77,10 +78,14 @@ pub fn plan(e: *Engine, s: *Stream, copied: ?Copy) !Plan { var copy: Copy = .{}; if (copied) |c| copy = c else if (s.drafts) copy = try copyProposal(e, s); const extend = !e.cfg.root_copies and e.alone and e.cfg.context_copies and !copy.recalled and queued != null and queued.?.count > 0; + // a lone stream's copy priced as its head's drafts are: a prefix, or none and the head's drafts take the round + const keep = if (extend) copy.tokens.len else try lone_copy.rows(e, s, copy, true); + if (keep == 0) copy = .{}; if (copy.tokens.len > 0 and !extend) { p.kind = .copy; p.recalled = copy.recalled; p.tokens = try a.dupe(u32, copy.tokens); + try cut.prefix(a, &p, @intCast(keep)); } else if (s.drafts and queued != null) { const q = queued.?; if (q.tokens) |t| { @@ -222,7 +227,8 @@ pub fn copyAhead(ptr: *anyopaque, w: *const depth.Who) bool { const s: *Stream = @ptrCast(@alignCast(w.stream.?)); if (e.cfg.root_copies) return false; const copied = copyProposal(e, s) catch return false; - return copied.tokens.len > 0; + // a copy its price leaves off takes no round: the head drafts its own depth + return (lone_copy.rows(e, s, copied, false) catch copied.tokens.len) > 0; } pub fn probe(e: *Engine) depth.Probe { @@ -434,7 +440,8 @@ pub fn observeCopied(e: *const Engine, s: *Stream, recalled: bool, kept: usize, if (recalled) { if (s.recall) |r| r.observe(@intCast(offered), @intCast(kept), s.rounds); } else if (s.proposer) |pr| pr.observe(@intCast(offered), @intCast(kept)); - if (!e.cfg.own_copy_rates) return; + // a lone priced stream keeps the history its copies' chances come from (lanes/lone_copy.zig) + if (!e.cfg.own_copy_rates and !lone_copy.enabled(e, s)) return; _ = copiedRate(e, s, recalled); const i = @intFromBool(recalled); s.copied_landed[i] = copy_decay * s.copied_landed[i] + @as(f64, @floatFromInt(kept)); diff --git a/zig/src/core/mxfp4.zig b/zig/src/core/mxfp4.zig new file mode 100644 index 00000000000..8f64c1a436a --- /dev/null +++ b/zig/src/core/mxfp4.zig @@ -0,0 +1,69 @@ +//! Host-only MXFP4: 32 E2M1 values in 16 bytes and one UE8M0 scale, with explicit nibble order. +const std = @import("std"); +const st = @import("safetensors"); + +pub const Order = enum { low_first, high_first }; +pub const group = 32; + +/// The finite UE8M0 code denotes 2^(code-127); 255 is the reserved NaN scale. +pub fn scale64(code: u8) error{BadMxfp4Scale}!f64 { + if (code == 255) return error.BadMxfp4Scale; + return @bitCast((@as(u64, code) + 896) << 52); +} + +fn code64(code: u8) f64 { + const magnitude = [8]f64{ 0, 0.5, 1, 1.5, 2, 3, 4, 6 }; + const value = magnitude[code & 7]; + return if (code & 8 != 0) -value else value; +} + +fn nibble(byte: u8, column: usize, order: Order) u8 { + const low = (column % 2 == 0) == (order == .low_first); + return if (low) byte & 15 else byte >> 4; +} + +/// Decode as FP64, preserving signed zero and finite products beyond FP32's range. No checkpoint is requantized. +pub fn decodeBlock(bytes: *const [16]u8, scale: u8, order: Order, out: *[32]f64) !void { + const factor = try scale64(scale); + for (out, 0..) |*value, i| value.* = code64(nibble(bytes[i / 2], i, order)) * factor; +} + +/// Borrowed stored tensors [E,N,K/32,16] and [E,N,K/32]; the caller retains their bytes. +pub const Host = struct { + blocks: []const u8, + scales: []const u8, + experts: usize, + rows: usize, + groups: usize, + order: Order, + + pub fn init(blocks: st.Tensor, scales: st.Tensor, order: Order) !Host { + if (blocks.dtype != .u8 or scales.dtype != .u8 or blocks.rank != 4 or scales.rank != 3 or + blocks.shape[3] != 16) return error.BadMxfp4Shape; + var count: usize = 1; + for (0..3) |i| { + if (blocks.shape[i] == 0 or blocks.shape[i] != scales.shape[i]) return error.BadMxfp4Shape; + count = std.math.mul(usize, count, blocks.shape[i]) catch return error.BadMxfp4Shape; + } + const size = std.math.mul(usize, count, 16) catch return error.BadMxfp4Shape; + _ = std.math.mul(usize, blocks.shape[2], group) catch return error.BadMxfp4Shape; + if (blocks.bytes.len != size or scales.bytes.len != count) return error.BadMxfp4Shape; + return .{ .blocks = blocks.bytes, .scales = scales.bytes, .experts = blocks.shape[0], .rows = blocks.shape[1], .groups = blocks.shape[2], .order = order }; + } + + pub fn columns(h: Host) usize { + return h.groups * group; + } + + pub fn value(h: Host, expert: usize, index: usize, column: usize) !f64 { + if (expert >= h.experts or index >= h.rows or column >= h.columns()) return error.BadMxfp4Index; + const block = (expert * h.rows + index) * h.groups + column / group; + const byte = h.blocks[block * 16 + (column % group) / 2]; + return code64(nibble(byte, column, h.order)) * try scale64(h.scales[block]); + } + + pub fn row(h: Host, expert: usize, index: usize, out: []f64) !void { + if (out.len != h.columns()) return error.BadMxfp4Shape; + for (out, 0..) |*v, column| v.* = try h.value(expert, index, column); + } +}; diff --git a/zig/src/core/profile.zig b/zig/src/core/profile.zig index e936bc46f5e..19f086d5a34 100644 --- a/zig/src/core/profile.zig +++ b/zig/src/core/profile.zig @@ -138,7 +138,7 @@ const nemotron: []const []const u8 = &.{ "nemotron_h", "nemotron_h_omni" }; const slide_cuda: []const []const u8 = &.{ "nemotron_h", "nemotron_h_omni", "qwen3_5" }; const flash: []const []const u8 = &.{"qwen4_exp"}; /// The CUDA families whose host prompt cache the generic CUDA host builds (cuda_keep_others_test.zig checks the list). -pub const cuda_cache: []const []const u8 = &.{ "nemotron_h", "nemotron_h_omni", "glm5_next", "minimax_m3_vl", "qwen3_5", "qwen3_5_moe", "qwen4_exp", "kolibri1", "gemma4", "gemma4_unified", "spark2_5", "dory", "lfm2_moe" }; +pub const cuda_cache: []const []const u8 = &.{ "nemotron_h", "nemotron_h_omni", "glm5_next", "minimax_m3_vl", "qwen3_5", "qwen3_5_moe", "qwen4_exp", "kolibri1", "gemma4", "gemma4_unified", "spark2_5", "dory", "lfm2_moe", "muse_spark" }; pub const entries = [_]Entry{ .{ .id = .TF_CACHE_EVICT, .families = cuda_cache, .backend = "multiple", .scopes = &.{ .{ .backend = "cuda", .families = cuda_cache }, .{ .backend = "metal", .families = &.{ "nemotron_h", "qwen3_5", "qwen3_5_moe", "qwen4_exp", "glm5_next", "glm_moe_dsa", "minimax_m3_vl", "gemma4", "gemma4_unified", "spark2_5", "llama", "lfm2_moe", "lfm3", "lfm3_vl", "step5_vl", "kimi_k3", "kimi_k31" } }, .{ .backend = "xpu", .families = &.{ "nemotron_h", "lfm3", "qwen3_5", "gemma4" } } }, .class = .experimental, .syntax = .present, .report_values = &.{"decayed_resume"}, .effect = "Opt into bounded resume credit for RAM snapshot eviction", .evidence = "#3241; synthetic host rows gate; default main unchanged" }, @@ -157,7 +157,7 @@ pub const entries = [_]Entry{ .{ .id = .TF_GLM_PROMPT_TAIL, .families = &.{"glm5_next"}, .class = .identical, .syntax = .one, .effect = "Keep a raw prompt's state at its last chunk start, from the chat states' budget", .evidence = "#2226" }, .{ .id = .TF_GLM_HOST_CACHE, .families = &.{"glm5_next"}, .class = .identical, .syntax = .one, .effect = "Keep kept prompt states in pinned host memory instead of on the device", .evidence = "#2370" }, .{ .id = .TF_GLM_VISION_HOST, .families = &.{"glm5_next"}, .class = .identical, .syntax = .one, .effect = "Keep the vision tower's weights in pinned host memory, staged a unit at a time", .evidence = "#2370" }, - .{ .id = .TF_GLM_PDL, .families = &.{"glm5_next"}, .class = .identical, .report_values = &.{"0"}, .effect = "Exact 0 turns off the matmuls' dependent launches", .evidence = "#2370" }, + .{ .id = .TF_GLM_PDL, .families = &.{"glm5_next"}, .class = .identical, .report_values = &.{"0"}, .effect = "Exact 0 turns off the forward's dependent launches", .evidence = "#2370" }, .{ .id = .TF_GLM_PROMPT_STEPS, .families = &.{"glm5_next"}, .class = .identical, .report_values = &.{"0"}, .effect = "Exact 0 runs rank 0's prompt passes whole, not in chunks", .evidence = "#2370" }, .{ .id = .TF_GLM_SHARED, .families = &.{"glm5_next"}, .class = .identical, .report_values = &.{"0"}, .effect = "Exact 0 runs each of rank 0's windows in its own forward", .evidence = "#2370" }, .{ .id = .TENSORFOLD_PROMPT_CACHE_KEEP_OTHERS, .families = cuda_cache, .class = .identical, .syntax = .one, .effect = "A new prompt state that fits only by evicting another conversation's is not kept", .evidence = "#2346" }, diff --git a/zig/src/core/prompt_radix.zig b/zig/src/core/prompt_radix.zig index 5c644beebb0..31e6aa2eaf3 100644 --- a/zig/src/core/prompt_radix.zig +++ b/zig/src/core/prompt_radix.zig @@ -5,6 +5,8 @@ const pc = @import("prompt_cache.zig"); const tree_mod = @import("prompt_radix_tree.zig"); const parts = @import("prompt_radix_parts.zig"); const make_mod = @import("prompt_radix_make.zig"); +const tail_mod = @import("prompt_radix_tail.zig"); +const evict_mod = @import("prompt_radix_evict.zig"); const sched = @import("prompt_radix_query.zig").Schedule(Query); const Allocator = std.mem.Allocator; @@ -16,6 +18,8 @@ pub const Node = tree_mod.Node; pub const Entry = tree_mod.Entry; pub const Tree = tree_mod.Tree; pub const Key = tree_mod.Key; +pub const Found = tree_mod.Found; +pub const Tail = tail_mod.Tail; pub const Groups = parts.Groups; /// The rules of prompt_cache.zig, paged: `page` set; a planned store cuts and resumes only on `grid`, a multiple of it. @@ -110,8 +114,10 @@ pub const Store = struct { decl: make_mod.Decl = .{}, /// Whether an entry holds a legacy snapshot. legacy: bool = true, - /// No checkpoint at all (pure full attention): any matched page edge resumes, and no entry is kept. + /// No checkpoint at all (pure full attention): any matched page edge resumes, and no entry is kept but a tail. page_only: bool = false, + /// Checkpoints inside a page (C4): any row on the request's schedule, the partial page a held copy. + tails: bool = false, const SHARED_KEYS = 64; @@ -127,15 +133,40 @@ pub const Store = struct { if (groups.parts.len > 0 and hooks == null) return error.PartsNeedHooks; if (groups.parts.len > 0 and pages.vtable.hold == null) return error.PartsNeedHold; // copies the store holds for (groups.parts) |spec| if (spec.make == .retained and spec.rows == 0) return error.RetainedRows; + if (groups.tails and hooks == null) return error.TailsNeedHooks; // copy_rows + if (groups.tails and pages.vtable.hold == null) return error.TailsNeedHold; return .{ .tree = try Tree.init(gpa, family, pages, rules.page, rules.lookahead, groups.prefixCount()), .rules = rules, .decl = .{ .specs = groups.parts, .hooks = hooks }, .legacy = groups.legacy, .page_only = groups.none(), + .tails = groups.tails, }; } + /// The rules a cut obeys: a page edge, or with tails any row, on the request's chunk schedule. + fn cuts(s: *const Store) Rules { + var r = s.rules; + if (s.tails) r.page = 1; + return r; + } + + /// Whether a keep at `at` adds a tail: off a page edge, where the store keeps entries. + fn addsTail(s: *const Store, at: u32) bool { + return at % s.rules.page != 0 and (!s.page_only or s.limits.snaps > 0); + } + + /// Ids a tail at `at` adds: one held copy a prefix group. + fn tailIds(s: *const Store, at: u32) usize { + return if (s.addsTail(at)) s.per() else 0; + } + + /// Copy and copy_rows number the prefix groups after the parts. + fn prefixGroup(s: *const Store) u32 { + return @intCast(s.decl.specs.len); + } + /// Page ids a logical page: one per prefix group. fn per(s: *const Store) usize { return s.tree.per; @@ -148,7 +179,7 @@ pub const Store = struct { /// Where `q` may resume: a page edge on its chunk schedule (the tree's walks take it). fn resumable(s: *const Store, q: Query) sched.Resumable { - return .{ .r = s.rules, .q = q }; + return .{ .r = s.cuts(), .q = q }; } /// Tokens a resume leaves past its state: the lookahead it read, and at least one to prefill. @@ -164,7 +195,7 @@ pub const Store = struct { /// The tree may hold `limits` from now on: what passes them goes first. pub fn limit(s: *Store, limits: Limits) void { s.limits = limits; - while (s.tree.snaps > limits.snaps) s.tree.evict(s.victim(.{ .tokens = &.{} }, null) orelse break); + while (s.tree.snaps > limits.snaps) s.tree.evictAt(evict_mod.victim(&s.tree, .{ .tokens = &.{} }, null) orelse break); while (s.tree.heldPages() > limits.pages) if (!s.tree.evictLeaf()) break; } @@ -175,16 +206,21 @@ pub const Store = struct { /// The least valuable thing to free: an entry, or for a store without entries an idle leaf; false when none. fn evictOne(s: *Store, k: Key, skip: ?*Node) bool { - if (s.page_only) return s.tree.evictLeaf(); - s.tree.evict(s.victim(k, skip) orelse return false); + if (s.page_only and s.tree.evictLeaf()) return true; + s.tree.evictAt(evict_mod.victim(&s.tree, k, skip) orelse return false); return true; } - /// The deepest node whose state `prompt` resumes exactly: its tokens and lookahead a prefix, a token left. - pub fn find(s: *const Store, q: Query) ?*Node { + /// The deepest state (an end or a tail) `prompt` resumes exactly: its words and lookahead a prefix, a token left. + pub fn find(s: *const Store, q: Query) ?Found { const prompt = q.key; if (!s.on() or prompt.len < s.past() + 1) return null; - return s.tree.deepest(keyOf(q, prompt.len), (prompt.len - s.past()) / s.rules.page * s.rules.page, s.resumable(q)); + const k = keyOf(q, prompt.len); + const limit_at = prompt.len - s.past(); + const end: ?Found = if (s.tree.deepest(k, limit_at / s.rules.page * s.rules.page, s.resumable(q))) |n| .{ .node = n } else null; + if (!s.tails) return end; + const tail = s.tree.deepestTail(k, limit_at, s.resumable(q)) orelse return end; + return if (end == null or tail.at() > end.?.at()) tail else end; } /// Restores the longest state `prompt` resumes into `owner`, its pages into `adopt` (held once more); plans marks. @@ -199,66 +235,83 @@ pub const Store = struct { if (s.page_only) return s.beginPages(a, q, history_len, shared, adopt); const found = s.find(q); if (found == null) s.tree.counts.misses += 1; - const resume_at: u32 = if (found) |n| n.end else 0; - const planned = try s.marks(a, q, resume_at, history_len, shared, if (found) |n| n.entry.?.last else &.{}); + const resume_at: u32 = if (found) |f| f.at() else 0; + const planned = try s.marks(a, q, resume_at, history_len, shared, if (found) |f| f.entry().last else &.{}); const marks_ = try s.fitting(a, planned); errdefer a.free(marks_); for (shared) |w| { // the shared cuts this pass keeps: their states serve other conversations too - const cut = sched.markAt(s.rules, q, w) orelse continue; + const cut = sched.markAt(s.cuts(), q, w) orelse continue; if (std.mem.indexOfScalar(u32, marks_, cut) != null) s.noteShared(keyOf(q, cut + s.rules.lookahead)); } - s.reserve(q, found, marks_); - var from: u32 = 0; + s.reserve(q, if (found) |f| f.node else null, marks_); var out: Plan = .{ .marks = marks_ }; - if (found) |n| { - const ok = if (s.restore(owner, n)) |_| true else |err| blk: { - note("restoring {d} tokens failed ({s}); prefilling from the start", .{ n.end, @errorName(err) }); + if (found) |f| { + const ok = if (s.restore(owner, f)) |_| true else |err| blk: { + note("restoring {d} tokens failed ({s}); prefilling from the start", .{ f.at(), @errorName(err) }); break :blk false; }; - if (ok) { - const had = adopt.items.len; - try s.tree.take(n, adopt); - from = n.end; - if (n.entry.?.parts.len > 0) { - const handed = s.decl.handOut(&s.tree, a, n.end, n.entry.?.parts) catch |err| { - for (adopt.items[had..]) |id| s.tree.pages.vtable.release(s.tree.pages.ptr, id); // this begin's - adopt.shrinkRetainingCapacity(had); - return err; - }; - out.parts = handed.parts; - out.copies = handed.copies; - } - } - s.resumed(n, prompt, ok); + if (ok) try s.hand(a, f, adopt, &out); + s.resumed(f, prompt, ok); } - out.from = from; return out; } + /// The path to `f` into `adopt` (held once more), its retained parts and copies (its tail's too) into `out`. + fn hand(s: *Store, a: Allocator, f: Found, adopt: *std.ArrayList(u32), out: *Plan) !void { + const had = adopt.items.len; + try s.tree.take(f.node, adopt); + out.from = f.at(); + const e = f.entry(); + if (e.parts.len == 0 and e.tail == null) return; + const extra = if (e.tail) |tl| tl.ids.len else 0; + const handed = s.decl.handOut(&s.tree, a, f.at(), e.parts, extra) catch |err| { + for (adopt.items[had..]) |id| s.tree.pages.vtable.release(s.tree.pages.ptr, id); // this begin's + adopt.shrinkRetainingCapacity(had); + out.from = 0; + return err; + }; + if (e.tail) |tl| tail_mod.handOut(&s.tree, tl, s.prefixGroup(), f.node.end / s.rules.page, handed.copies[handed.copies.len - extra ..]); + out.parts = handed.parts; + out.copies = handed.copies; + } + /// `begin` for a store with no checkpoint: the deepest matched page edge, its path adopted, nothing restored. fn beginPages(s: *Store, a: Allocator, q: Query, history_len: u32, shared: []const u32, adopt: *std.ArrayList(u32)) !Plan { const prompt = q.key; const limit_at = if (prompt.len < s.past() + 1) 0 else (prompt.len - s.past()) / s.rules.page * s.rules.page; const hit: ?tree_mod.Hit = if (limit_at == 0) null else s.tree.deepestPage(keyOf(q, prompt.len), limit_at, s.resumable(q)); - const from: u32 = if (hit) |h| h.at(&s.tree) else 0; - const planned = try s.marks(a, q, from, history_len, shared, &.{}); + var from: u32 = if (hit) |h| h.at(&s.tree) else 0; + // a tail past the deepest edge: it is an entry, so it resumes as one + const tail: ?Found = if (s.tails) s.find(q) else null; // a page-only store's entries are tails + const deeper = if (tail) |f| f.at() > from else false; + if (deeper) from = tail.?.at(); + const planned = try s.marks(a, q, from, history_len, shared, if (deeper) tail.?.entry().last else &.{}); const marks_ = try s.fitting(a, planned); errdefer a.free(marks_); - if (hit) |h| h.node.pins += 1; // the room made for the marks never prunes the path this pass resumes - s.reserve(q, null, marks_); - if (hit) |h| h.node.pins -= 1; + const pin: ?*Node = if (deeper) tail.?.node else if (hit) |h| h.node else null; + if (pin) |n| n.pins += 1; // the room made for the marks never prunes the path this pass resumes + s.reserve(q, if (deeper) pin else null, marks_); + if (pin) |n| n.pins -= 1; + var out: Plan = .{ .marks = marks_ }; + if (deeper) { + try s.hand(a, tail.?, adopt, &out); + s.resumed(tail.?, prompt, true); + return out; + } const h = hit orelse { s.tree.counts.misses += 1; - return .{ .marks = marks_ }; + return out; }; try s.tree.takeTo(h, adopt); s.tree.counts.hits += 1; - return .{ .from = from, .marks = marks_ }; + out.from = from; + return out; } - /// The entry at `n` into `owner`, snapshot then copied parts; pinned, so reclaim cannot evict its own source. - fn restore(s: *Store, owner: ?*anyopaque, n: *Node) !void { - const e = &n.entry.?; + /// The state `f` names into `owner`, snapshot then copied parts; pinned, so reclaim cannot evict its own source. + fn restore(s: *Store, owner: ?*anyopaque, f: Found) !void { + const n = f.node; + const e = f.entry(); n.pins += 1; defer n.pins -= 1; const family = s.tree.family; @@ -275,16 +328,16 @@ pub const Store = struct { } /// A restored state: it is now the prompt's (a failed restore drops it). - pub fn resumed(s: *Store, n: *Node, prompt: []const u32, ok: bool) void { + pub fn resumed(s: *Store, f: Found, prompt: []const u32, ok: bool) void { if (!ok) { s.tree.counts.failed += 1; - return s.tree.evict(n); + return s.tree.evictAt(f); } - const e = &n.entry.?; + const e = f.entry(); s.tree.clock += 1; e.used = s.tree.clock; e.hit = true; - e.branched = e.branched or superseded(n, e.born); // a turn several continuations share (re-sent, edited, forked) + e.branched = e.branched or evict_mod.supersededAt(f, e.born); // a turn several continuations share (re-sent, edited, forked) s.tree.counts.hits += 1; const last = s.tree.gpa.dupe(u32, prompt) catch return; s.tree.gpa.free(e.last); @@ -296,12 +349,16 @@ pub const Store = struct { const prompt = q.key; if (marks_.len == 0) return; const last = marks_[marks_.len - 1]; - var parts_ids: usize = 0; // each mark's parts, as far as they are known before the keep - for (marks_) |m| parts_ids += s.decl.planIds(&s.tree, m); + var parts_ids: usize = 0; // each mark's parts and tail, as far as they are known before the keep + var entries: usize = 0; + for (marks_) |m| { + parts_ids += s.decl.planIds(&s.tree, m) + s.tailIds(m); + entries += @intFromBool(!s.page_only or s.addsTail(m)); + } while (true) { const path_ids = (last / s.rules.page - s.tree.have(keyOf(q, last + s.rules.lookahead))) * s.per(); const new = path_ids + parts_ids; - if (s.tree.heldPages() + new <= s.limits.pages and (s.page_only or s.tree.snaps + marks_.len <= s.limits.snaps)) return; + if (s.tree.heldPages() + new <= s.limits.pages and s.tree.snaps + entries <= s.limits.snaps) return; if (!s.evictOne(keyOf(q, prompt.len), from)) return; } } @@ -311,10 +368,10 @@ pub const Store = struct { var cut = q; cut.key = q.key[0..@min(q.key.len, at + s.past())]; cut.prompt_len = @intCast(cut.key.len); - const n = s.find(cut) orelse return; - if (n.end != at) return; + const f = s.find(cut) orelse return; + if (f.at() != at) return; s.tree.counts.failed += 1; - s.tree.evict(n); + s.tree.evictAt(f); } /// A cut's identity: its words, and its namespace, frame and images, so one identity never flags another's state. @@ -342,7 +399,7 @@ pub const Store = struct { var out: std.ArrayList(u32) = .empty; errdefer out.deinit(a); for (marks_) |m| { - const ids = m / s.rules.page * s.per() + s.decl.planIds(&s.tree, m); // the path and the parts' known pages + const ids = m / s.rules.page * s.per() + s.decl.planIds(&s.tree, m) + s.tailIds(m); // the path, the parts' known pages, the tail if (ids <= s.limits.pages and (s.page_only or s.limits.snaps > 0)) try out.append(a, m) else { s.tree.counts.refused += 1; note("kept nothing at {d} tokens: {d} pages pass the limit of {d}", .{ m, ids, s.limits.pages }); @@ -367,7 +424,7 @@ pub const Store = struct { try want.appendSlice(a, shared); if (s.rules.tail and prompt.len > s.past()) try want.append(a, @intCast(prompt.len - s.past())); for (want.items, 0..) |w, k| { - const m = sched.markAt(s.rules, q, w) orelse continue; // its chunk start on a page edge + const m = sched.markAt(s.cuts(), q, w) orelse continue; // its chunk start on a page edge (any row with tails) if (m <= from or m >= prompt.len or m + s.rules.lookahead > prompt.len) continue; if (k > 0) { // the history's mark always; the others only away from it, each other and the resume point if (m - from < s.rules.min_gap) continue; @@ -387,64 +444,85 @@ pub const Store = struct { return s.keepParts(q, at, owner, mine, &.{}, path); } - /// `keep` with the retained groups' pages through `at` (one entry a declared part; copied ones empty). + /// `keep` with retained groups' pages through `at` (one entry a part); at a tail `mine` ends with its partial page. pub fn keepParts(s: *Store, q: Query, at: u32, owner: ?*anyopaque, mine: []const u32, retained: []const Retained, path: []u32) Kept { const prompt = q.key; const t = &s.tree; - const np = at / s.rules.page; // logical pages below `at` - if (!s.on() or !sched.keyed(q) or !sched.usable(s.rules, q, at) or at + s.rules.lookahead > prompt.len or mine.len != np * s.per() or path.len != mine.len) return .{ .held = false, .shared = 0 }; + const np = at / s.rules.page; // whole logical pages below `at` + const r = at % s.rules.page; // rows past them: a tail's (usable refuses them without tails) + const whole = np * s.per(); + if (!s.on() or !sched.keyed(q) or !sched.usable(s.cuts(), q, at) or at + s.rules.lookahead > prompt.len or mine.len != whole + @intFromBool(r > 0) * s.per() or path.len != whole) return .{ .held = false, .shared = 0 }; if (at + s.rules.lookahead > (q.prefilled orelse q.prompt_len)) { // only prefilled rows: decoded ones need decode spans note("kept nothing at {d} tokens: past the {d} rows this pass prefills", .{ at, q.prefilled orelse q.prompt_len }); return .{ .held = false, .shared = 0 }; } if (!s.decl.fits(at, retained)) return .{ .held = false, .shared = 0 }; t.clock += 1; - const tokens = prompt[0 .. at + s.rules.lookahead]; // a page past which the lookahead differs is another page - const flagged = std.mem.indexOfScalar(u64, s.shared_keys.items, sharedKey(keyOf(q, tokens.len))) != null; + const tailed = s.addsTail(at); + const entry_kept = !s.page_only or tailed; // a page-only store keeps only a tail's entry + const tokens = prompt[0 .. np * s.rules.page + s.rules.lookahead]; // a page past which the lookahead differs is another page + const full = keyOf(q, at + s.rules.lookahead); + const flagged = std.mem.indexOfScalar(u64, s.shared_keys.items, sharedKey(full)) != null; while (true) { var last: ?*Node = null; const got = t.heldPrefix(keyOf(q, tokens.len), np, path, &last); // a page-only store: the path is the tree's already - if (s.page_only and got == np) return .{ .held = true, .shared = mine.len }; - if (got == np and last != null and last.?.end == at and last.?.entry != null) { - const e = &last.?.entry.?; + if (!entry_kept and got == np) return .{ .held = r == 0, .shared = whole }; + const edge: ?*Node = if (got < np) null else if (np == 0) t.root else if (last.?.end == at - r) last else null; + if (if (edge) |n| same(n, r, full) else null) |e| { e.used = t.clock; // the same state again: no copy e.shared = e.shared or flagged; - t.touch(last.?); - return .{ .held = true, .shared = mine.len }; + t.touch(edge.?); + return .{ .held = true, .shared = whole }; } - const ids = (np - got) * s.per() + s.decl.ids(t, at, retained); // every id the keep adds to the holds - if (t.heldPages() + ids <= s.limits.pages and (s.page_only or t.snaps + 1 <= s.limits.snaps)) break; + // every id the keep adds to the holds + const ids = (np - got) * s.per() + s.decl.ids(t, at, retained) + s.tailIds(at); + if (t.heldPages() + ids <= s.limits.pages and (!entry_kept or t.snaps + 1 <= s.limits.snaps)) break; if (!s.evictOne(keyOf(q, prompt.len), null)) { t.counts.refused += 1; note("kept nothing at {d} tokens: no room", .{at}); return .{ .held = false, .shared = got * s.per() }; } } - const node = t.insert(keyOf(q, tokens.len), mine, path) catch |err| return s.fail(at, err, 0); - if (s.page_only) { + const node = t.insert(keyOf(q, tokens.len), mine[0..whole], path) catch |err| return s.fail(at, err, 0); + if (!entry_kept) { t.counts.kept += 1; - return .{ .held = true, .shared = mine.len }; + return .{ .held = r == 0, .shared = whole }; } node.pins += 1; // the parts' holds may reclaim: not this node, nor its path defer node.pins -= 1; + if (tailed) node.tails.ensureUnusedCapacity(t.gpa, 1) catch |err| return s.fail(at, err, whole); // the path stays whatever follows; the entry is published only whole - const made = s.decl.make(t, owner, at, retained) catch |err| return s.fail(at, err, mine.len); + const tl: ?Tail = if (tailed) tail_mod.make(t, s.decl.hooks.?, owner, s.prefixGroup(), full, node.end, r, mine[whole..]) catch |err| return s.fail(at, err, whole) else null; + const made = s.decl.make(t, owner, at, retained) catch |err| { + if (tl) |x| tail_mod.free(t, x); + return s.fail(at, err, whole); + }; const family = t.family; const saved: ?Saved = if (s.legacy) family.vtable.save(family.ptr, owner, at) catch |err| { t.dropParts(made); - return s.fail(at, err, mine.len); + if (tl) |x| tail_mod.free(t, x); + return s.fail(at, err, whole); } else null; const last = t.gpa.dupe(u32, prompt) catch { if (saved) |sv| family.vtable.drop(family.ptr, sv); t.dropParts(made); - return s.fail(at, error.OutOfMemory, mine.len); + if (tl) |x| tail_mod.free(t, x); + return s.fail(at, error.OutOfMemory, whole); }; const bytes = if (s.legacy) family.vtable.bytes(family.ptr, at) else 0; - node.entry = .{ .saved = saved, .parts = made, .bytes = bytes, .born = @intCast(prompt.len), .used = t.clock, .last = last, .shared = flagged }; + const e: Entry = .{ .saved = saved, .parts = made, .bytes = bytes, .born = @intCast(prompt.len), .used = t.clock, .last = last, .shared = flagged, .tail = tl }; + if (tailed) node.tails.appendAssumeCapacity(e) else node.entry = e; t.snaps += 1; t.counts.kept += 1; - return .{ .held = true, .shared = mine.len }; + return .{ .held = true, .shared = whole }; + } + + /// The entry `edge` already holds for a keep `r` rows past it under `full`: at its end, or the tail that matches. + fn same(edge: *Node, r: u32, full: Key) ?*Entry { + if (r == 0) return if (edge.entry) |*e| e else null; + for (edge.tails.items) |*e| if (e.tail.?.r == r and e.tail.?.matches(edge.end, full)) return e; + return null; } fn fail(s: *Store, at: u32, err: anyerror, shared: usize) Kept { @@ -453,78 +531,17 @@ pub const Store = struct { return .{ .held = false, .shared = shared }; } - /// Whether `a` is a less valuable entry than `b`: one never resumed before one that was, then the older. - fn worse(a: *const Node, b: *const Node) bool { - const x = a.entry.?; - const y = b.entry.?; - if (x.hit != y.hit) return !x.hit; - return x.used < y.used; - } - - /// Whether `k` repeats every word `n` and its parents hold, with their images and namespace: one conversation. - fn extends(n: *const Node, k: Key) bool { - const parent = n.parent orelse return true; - return Tree.repeats(n, k) and extends(parent, k); // its words, images and namespace: the same conversation - } - - /// Whether a later prompt kept a state below `n`. - fn superseded(n: *const Node, born: u32) bool { - for (n.kids.items) |k| { - if ((k.entry != null and k.entry.?.born > born) or superseded(k, born)) return true; - } - return false; - } - - fn pick(n: *Node, k: Key, skip: ?*Node, moved: *?*Node, oldest: *?*Node) void { - const prompt = k.tokens; - if (n.entry) |e| if (n != skip and n.pins == 0) { - // a state its conversation moved past goes first; a shared cut or a branch point only as the least valuable - const gone = !e.shared and !e.branched and ((prompt.len > e.born and prompt.len > n.end and extends(n, k)) or superseded(n, e.born)); - if (gone and (moved.* == null or e.used < moved.*.?.entry.?.used)) moved.* = n; - if (oldest.* == null or worse(n, oldest.*.?)) oldest.* = n; - }; - for (n.kids.items) |kid| pick(kid, k, skip, moved, oldest); - } - - /// The entry to free first, never `skip`: one a later prompt extends (no branch point), oldest first; else worst. - fn victim(s: *const Store, k: Key, skip: ?*Node) ?*Node { - var moved: ?*Node = null; - var oldest: ?*Node = null; - pick(s.tree.root, k, skip, &moved, &oldest); - return moved orelse oldest; - } - /// Evicts until `want` pool pages are free and not promised; false when the tree cannot give that many. pub fn reclaim(s: *Store, want: usize) bool { const pages = s.tree.pages; - // parts first: their path may be in use - if (s.decl.specs.len > 0) while (pages.vtable.available(pages.ptr) < want) { - s.tree.evict(s.partVictim() orelse break); + // parts and tails first: their path may be in use + if (s.decl.specs.len > 0 or s.tails) while (pages.vtable.available(pages.ptr) < want) { + s.tree.evictAt(evict_mod.partVictim(&s.tree) orelse break); }; while (pages.vtable.available(pages.ptr) < want) if (!s.tree.evictLeaf()) return false; return true; } - /// The least valuable entry with a part page only the store holds, never a pinned one. - fn partVictim(s: *const Store) ?*Node { - var best: ?*Node = null; - s.pickParts(s.tree.root, &best); - return best; - } - - fn pickParts(s: *const Store, n: *Node, best: *?*Node) void { - if (n.entry) |e| if (n.pins == 0 and s.freesPart(e) and (best.* == null or worse(n, best.*.?))) { - best.* = n; - }; - for (n.kids.items) |k| s.pickParts(k, best); - } - - fn freesPart(s: *const Store, e: Entry) bool { - const pages = s.tree.pages; - for (e.parts) |part| for (part.ids) |id| if (pages.vtable.holders(pages.ptr, id) == 1) return true; - return false; - } - /// One log line after a prompt pass: where it resumed, how many states it kept, and what the tree holds. pub fn report(s: *const Store, prompt: usize, from: u32, kept: u64) void { if (@import("builtin").is_test) return; @@ -545,4 +562,5 @@ test { _ = @import("prompt_radix_groups_test.zig"); _ = @import("prompt_radix_query.zig"); _ = @import("prompt_radix_query_test.zig"); + _ = @import("prompt_radix_tail_test.zig"); } diff --git a/zig/src/core/prompt_radix_evict.zig b/zig/src/core/prompt_radix_evict.zig new file mode 100644 index 00000000000..52f952578ea --- /dev/null +++ b/zig/src/core/prompt_radix_evict.zig @@ -0,0 +1,118 @@ +//! The radix store's eviction order: which kept state goes first, an entry at a node's end or one of its tails. +const std = @import("std"); +const tree_mod = @import("prompt_radix_tree.zig"); + +const Tree = tree_mod.Tree; +const Node = tree_mod.Node; +const Entry = tree_mod.Entry; +const Found = tree_mod.Found; +const Key = tree_mod.Key; + +/// Whether `x` is a less valuable state than `y`: one never resumed before one that was, then the older. +fn worse(x: *const Entry, y: *const Entry) bool { + if (x.hit != y.hit) return !x.hit; + return x.used < y.used; +} + +/// Whether `k` repeats every word `n` and its parents hold, with their images and namespace: one conversation. +fn extends(n: *const Node, k: Key) bool { + const parent = n.parent orelse return true; + return Tree.repeats(n, k) and extends(parent, k); // its words, images and namespace: the same conversation +} + +/// Whether a later prompt kept a state below `n`. +pub fn superseded(n: *const Node, born: u32) bool { + for (n.kids.items) |k| { + if (k.entry != null and k.entry.?.born > born) return true; + for (k.tails.items) |e| if (e.born > born) return true; + if (superseded(k, born)) return true; + } + return false; +} + +/// Whether a later prompt kept a state past `f`: below its node, or for a tail only where it repeats its key. +pub fn supersededAt(f: Found, born: u32) bool { + const n = f.node; + const own = n.tokens[n.end - (if (n.parent) |p| p.end else 0) ..]; // the `ahead` words past its end (none at the root) + const tl = f.entry().tail orelse { + for (n.tails.items) |o| if (o.born > born and std.mem.startsWith(u32, o.tail.?.key, own)) return true; // inside the next page + return superseded(n, born); + }; + for (n.tails.items) |o| if (o.tail.?.r > tl.r and o.born > born and repeats(tl, n.end, o.tail.?.key, o.tail.?.images, o.tail.?.ns)) return true; + for (n.kids.items) |k| { + if (!repeats(tl, n.end, k.tokens, k.images, k.ns)) continue; + if ((k.entry != null and k.entry.?.born > born) or superseded(k, born)) return true; + for (k.tails.items) |o| if (o.born > born) return true; + } + return false; +} + +/// Whether words from `at` (and their images and Ns) repeat tail `tl`'s key: its rows and the `ahead` words past them. +fn repeats(tl: tree_mod.Tail, at: usize, words: []const u32, images: []const tree_mod.Identity, ns: tree_mod.Ns) bool { + if (!std.meta.eql(ns, tl.ns) or !std.mem.startsWith(u32, words, tl.key)) return false; + return tree_mod.sameImages(images, tl.images, at, at + tl.key.len); +} + +/// Each state of `n` in order, its end's entry first, then its tails. +fn each(n: *Node, ctx: anytype, comptime f: fn (@TypeOf(ctx), Found) void) void { + if (n.entry != null) f(ctx, .{ .node = n }); + for (0..n.tails.items.len) |i| f(ctx, .{ .node = n, .tail = i }); +} + +const Pick = struct { + k: Key, + moved: ?Found = null, + oldest: ?Found = null, + + fn consider(p: *Pick, f: Found) void { + const e = f.entry(); + const prompt = p.k.tokens; + const along = if (e.tail) |tl| tl.matches(f.node.end, p.k) else true; // a tail: its own words too + // a state its conversation moved past goes first; a shared cut or a branch point only as the least valuable + const gone = !e.shared and !e.branched and ((prompt.len > e.born and prompt.len > f.at() and along and extends(f.node, p.k)) or supersededAt(f, e.born)); + if (gone and (p.moved == null or e.used < p.moved.?.entry().used)) p.moved = f; + if (p.oldest == null or worse(e, p.oldest.?.entry())) p.oldest = f; + } +}; + +fn pick(n: *Node, p: *Pick, skip: ?*Node) void { + if (n != skip and n.pins == 0) each(n, p, Pick.consider); + for (n.kids.items) |kid| pick(kid, p, skip); +} + +/// The state to free first, never at `skip`: one a later prompt extends (no branch point), oldest first; else worst. +pub fn victim(t: *const Tree, k: Key, skip: ?*Node) ?Found { + var p: Pick = .{ .k = k }; + pick(t.root, &p, skip); + return p.moved orelse p.oldest; +} + +const Parts = struct { + t: *const Tree, + best: ?Found = null, + + fn consider(p: *Parts, f: Found) void { + const e = f.entry(); + if (p.frees(e) and (p.best == null or worse(e, p.best.?.entry()))) p.best = f; + } + + /// Whether `e` has a part or tail page only the store holds. + fn frees(p: *const Parts, e: *const Entry) bool { + const pages = p.t.pages; + for (e.parts) |part| for (part.ids) |id| if (pages.vtable.holders(pages.ptr, id) == 1) return true; + if (e.tail) |tl| for (tl.ids) |id| if (pages.vtable.holders(pages.ptr, id) == 1) return true; + return false; + } +}; + +fn pickParts(n: *Node, p: *Parts) void { + if (n.pins == 0) each(n, p, Parts.consider); + for (n.kids.items) |k| pickParts(k, p); +} + +/// The least valuable state with a part or tail page only the store holds, never a pinned one. +pub fn partVictim(t: *const Tree) ?Found { + var p: Parts = .{ .t = t }; + pickParts(t.root, &p); + return p.best; +} diff --git a/zig/src/core/prompt_radix_make.zig b/zig/src/core/prompt_radix_make.zig index 173384f83cf..e43a8149ec9 100644 --- a/zig/src/core/prompt_radix_make.zig +++ b/zig/src/core/prompt_radix_make.zig @@ -127,8 +127,8 @@ pub const Decl = struct { for (d.specs, ps, 0..) |spec, part, g| if (spec.make == .copied) try h.vtable.restore(h.ptr, owner, @intCast(g), part); } - /// The retained parts a resume at `at` maps: whole pages held once for the stream, partial ones as copies to make. - pub fn handOut(d: Decl, t: *Tree, a: Allocator, at: u32, ps: []const Part) !struct { parts: []Retained, copies: []Copy } { + /// The retained parts a resume at `at` maps: whole pages held for the stream, partial ones and `extra` as copies. + pub fn handOut(d: Decl, t: *Tree, a: Allocator, at: u32, ps: []const Part, extra: usize) !struct { parts: []Retained, copies: []Copy } { var nr: usize = 0; var nc: usize = 0; for (d.specs) |spec| if (spec.make == .retained) { @@ -141,7 +141,7 @@ pub const Decl = struct { for (out[0..owned]) |r| a.free(r.ids); a.free(out); } - const copies = try a.alloc(Copy, nc); + const copies = try a.alloc(Copy, nc + extra); errdefer a.free(copies); nr = 0; for (d.specs, ps) |spec, part| if (spec.make == .retained) { diff --git a/zig/src/core/prompt_radix_parts.zig b/zig/src/core/prompt_radix_parts.zig index 39f6991a7a9..cf4c922f149 100644 --- a/zig/src/core/prompt_radix_parts.zig +++ b/zig/src/core/prompt_radix_parts.zig @@ -20,6 +20,8 @@ pub const Groups = struct { parts: []const PartSpec = &.{}, /// A legacy snapshot (the family's Snapshots) beside the parts. legacy: bool = true, + /// Checkpoints inside a page (C4): each keeps that page's rows as a held copy (needs copy_rows and Pages.hold). + tails: bool = false, /// Prefix groups: page ids a logical page on the tree's path. pub fn prefixCount(g: Groups) usize { @@ -38,7 +40,7 @@ pub const Part = struct { base: u32, ids: []u32, bytes: u64 }; /// A keep's input for one retained group: its pages from logical index `base`, the last partial if rows fall short. pub const Retained = struct { base: u32, ids: []const u32 }; -/// A copy a stream makes from a held page into one of its own: rows [0, rows) of `src` to the group's page `index`. +/// A held page's rows [0, rows) into the stream's page `index` of `group` (parts first, then the prefix groups). pub const Copy = struct { group: u32, index: u32, src: u32, rows: u32 }; /// What the store asks a family that declares parts: the bytes, and the device copies (each on the owner's stream). @@ -53,7 +55,7 @@ pub const PartHooks = struct { copy: *const fn (ptr: *anyopaque, owner: ?*anyopaque, group: u32, at: u32, dst: Part) anyerror!void, /// The held pages of `src` into the owner's live `group` (the next prompt chunk starts at its position). restore: *const fn (ptr: *anyopaque, owner: ?*anyopaque, group: u32, src: Part) anyerror!void, - /// Rows [0, rows) of every layer of `group` from page `src` into page `dst`. + /// Rows [0, rows) of every layer of `group` (numbered as in Copy) from page `src` into page `dst`. copy_rows: *const fn (ptr: *anyopaque, owner: ?*anyopaque, group: u32, src: u32, dst: u32, rows: u32) anyerror!void, /// Every copy queued for `owner` has completed, on every rank that runs it. fence: *const fn (ptr: *anyopaque, owner: ?*anyopaque) void, diff --git a/zig/src/core/prompt_radix_query_test.zig b/zig/src/core/prompt_radix_query_test.zig index 5387fc218cb..29ada0bd8ed 100644 --- a/zig/src/core/prompt_radix_query_test.zig +++ b/zig/src/core/prompt_radix_query_test.zig @@ -78,7 +78,7 @@ test "a request's own start off the grid is kept and resumed; without starts the var path: [3]u32 = undefined; try testing.expect(!s.keep(.of(&prompt), 12, null, &mine, &path).held); // 12 is off the grid of 8 try testing.expect(s.keep(with(&prompt, &.{12}), 12, null, &mine, &path).held); // the request's own start - try testing.expectEqual(@as(u32, 12), s.find(with(&prompt, &.{12})).?.end); + try testing.expectEqual(@as(u32, 12), s.find(with(&prompt, &.{12})).?.at()); try testing.expect(s.find(.of(&prompt)) == null); // a request on the grid never resumes inside its chunk at 12 } @@ -363,5 +363,5 @@ test "a shared cut planned in one namespace never flags another namespace's stat defer f.end(&mine); var path: [2]u32 = undefined; try testing.expect(s.keep(ns2, 8, null, &mine, &path).held); - try testing.expect(!s.find(ns2).?.entry.?.shared); // namespace 2's state is its own conversation's + try testing.expect(!s.find(ns2).?.entry().shared); // namespace 2's state is its own conversation's } diff --git a/zig/src/core/prompt_radix_tail.zig b/zig/src/core/prompt_radix_tail.zig new file mode 100644 index 00000000000..bde772f67a9 --- /dev/null +++ b/zig/src/core/prompt_radix_tail.zig @@ -0,0 +1,68 @@ +//! Writable tails (C4, #2444): a checkpoint inside a page keeps that page's valid rows as copies the store holds. +const std = @import("std"); +const parts = @import("prompt_radix_parts.zig"); +const tree_mod = @import("prompt_radix_tree.zig"); + +const Tree = tree_mod.Tree; +const Key = tree_mod.Key; +const Ns = tree_mod.Ns; +const Identity = tree_mod.Identity; + +/// A checkpoint's rows past its page edge: what it matches, and its partial page as one held copy a prefix group. +pub const Tail = struct { + /// Rows past the edge (1 to a page less one). + r: u32, + /// The words past the edge: its `r` rows and the tree's `ahead` more. + key: []u32, + /// The images overlapping them, at prompt positions. + images: []Identity, + /// The Ns its rows were computed under. + ns: Ns, + /// Page-major like a node's: one held copy a prefix group, its first `r` rows valid; never written again. + ids: []u32, + + /// Whether `k` repeats this tail past `edge`: its words, the `ahead` more, its images and its Ns. + pub fn matches(tl: Tail, edge: usize, k: Key) bool { + if (!std.meta.eql(tl.ns, k.ns) or k.tokens.len < edge + tl.key.len) return false; + if (!std.mem.eql(u32, tl.key, k.tokens[edge..][0..tl.key.len])) return false; + return tree_mod.sameImages(tl.images, k.images, edge, edge + tl.key.len); + } +}; + +/// The tail of a keep `r` rows past `edge`: a held page a prefix group, rows [0, r) copied from `partial`; fenced. +pub fn make(t: *Tree, hooks: parts.PartHooks, owner: ?*anyopaque, first: u32, k: Key, edge: usize, r: u32, partial: []const u32) !Tail { + std.debug.assert(partial.len == t.per and r > 0 and r < t.page); + const key = try t.gpa.dupe(u32, k.tokens[edge..][0 .. r + t.ahead]); + errdefer t.gpa.free(key); + const images = try t.gpa.dupe(Identity, tree_mod.overlapping(k.images, edge, edge + key.len)); + errdefer t.gpa.free(images); + const ids = try t.gpa.alloc(u32, t.per); + errdefer t.gpa.free(ids); + try t.holds.reserve(t.gpa, ids.len); + const hold = t.pages.vtable.hold orelse return error.NoCachePages; + if (!hold(t.pages.ptr, ids)) return error.NoCachePages; + for (ids) |id| t.holds.adoptHeldAssumeCapacity(id); + errdefer { + hooks.vtable.fence(hooks.ptr, owner); // queued copies into the pages complete before they go back + for (ids) |id| t.holds.drop(t.pages, id); + } + for (partial, ids, 0..) |src, dst, g| try hooks.vtable.copy_rows(hooks.ptr, owner, first + @as(u32, @intCast(g)), src, dst, r); + hooks.vtable.fence(hooks.ptr, owner); // the copies are the checkpoint's from now on + return .{ .r = r, .key = key, .images = images, .ns = k.ns, .ids = ids }; +} + +/// The tail's pages back to the tree's holds, and its slices freed. +pub fn free(t: *Tree, tl: Tail) void { + for (tl.ids) |id| t.holds.drop(t.pages, id); + t.gpa.free(tl.ids); + t.gpa.free(tl.key); + t.gpa.free(tl.images); +} + +/// A resume's tail copies into `out`, one a prefix group, to page `index`; each source held for the stream to `finish`. +pub fn handOut(t: *Tree, tl: Tail, first: u32, index: u32, out: []parts.Copy) void { + for (tl.ids, out, 0..) |id, *c, g| { + t.pages.vtable.retain(t.pages.ptr, id); + c.* = .{ .group = first + @as(u32, @intCast(g)), .index = index, .src = id, .rows = tl.r }; + } +} diff --git a/zig/src/core/prompt_radix_tail_test.zig b/zig/src/core/prompt_radix_tail_test.zig new file mode 100644 index 00000000000..e18744afc10 --- /dev/null +++ b/zig/src/core/prompt_radix_tail_test.zig @@ -0,0 +1,410 @@ +//! The store's writable tails (C4, #2444): a checkpoint inside a page, its rows a held copy never written again. +const std = @import("std"); +const radix = @import("prompt_radix.zig"); +const testing = std.testing; + +/// Counted holders (streams' pages from 0, the store's held ones from 32), a page of 4 tokens; copy_rows logged. +const Fake = struct { + refs: [64]u32 = @splat(0), + states: [16]u32 = @splat(0), + nstates: usize = 0, + restored: ?u32 = null, + /// Each copy_rows: group, src, dst, rows. + rows: [16][4]u32 = undefined, + nrows: usize = 0, + fences: u32 = 0, + fail_hold: bool = false, + fail_rows: bool = false, + queued: ?u32 = null, // the page the last copy_rows wrote, until a fence + held_at_fence: bool = true, + + fn of(p: *anyopaque) *Fake { + return @ptrCast(@alignCast(p)); + } + fn retain(p: *anyopaque, id: u32) void { + of(p).refs[id] += 1; + } + fn release(p: *anyopaque, id: u32) void { + of(p).refs[id] -= 1; + } + fn holders(p: *anyopaque, id: u32) u32 { + return of(p).refs[id]; + } + fn available(p: *anyopaque) usize { + var n: usize = 0; + for (of(p).refs) |r| n += @intFromBool(r == 0); + return n; + } + fn hold(p: *anyopaque, out: []u32) bool { + const f = of(p); + if (f.fail_hold) return false; + var n: usize = 0; + for (32..64) |id| if (n < out.len and f.refs[id] == 0) { + out[n] = @intCast(id); + n += 1; + }; + if (n < out.len) return false; + for (out) |id| f.refs[id] = 1; + return true; + } + fn bytes(_: *anyopaque, _: u32) u64 { + return 1; + } + fn save(p: *anyopaque, _: ?*anyopaque, at: u32) anyerror!radix.Saved { + const f = of(p); + f.states[f.nstates] = at; + f.nstates += 1; + return @ptrCast(&f.states[f.nstates - 1]); + } + fn restore(p: *anyopaque, _: ?*anyopaque, saved: radix.Saved) anyerror!void { + of(p).restored = @as(*u32, @ptrCast(@alignCast(saved))).*; + } + fn dropState(_: *anyopaque, _: radix.Saved) void {} + fn partBytes(_: *anyopaque, _: u32, _: u32) u64 { + return 0; + } + fn copy(_: *anyopaque, _: ?*anyopaque, _: u32, _: u32, _: radix.Parts.Part) anyerror!void {} + fn partRestore(_: *anyopaque, _: ?*anyopaque, _: u32, _: radix.Parts.Part) anyerror!void {} + fn copyRows(p: *anyopaque, _: ?*anyopaque, group: u32, src: u32, dst: u32, rows: u32) anyerror!void { + const f = of(p); + f.rows[f.nrows] = .{ group, src, dst, rows }; + f.nrows += 1; + f.queued = dst; + if (f.fail_rows) return error.CopyFailed; // after its work is queued + } + fn fence(p: *anyopaque, _: ?*anyopaque) void { + const f = of(p); + f.fences += 1; + if (f.queued) |id| f.held_at_fence = f.held_at_fence and f.refs[id] > 0; + f.queued = null; + } + + fn pages(f: *Fake) radix.Pages { + return .{ .ptr = f, .bytes = 1, .vtable = &.{ .retain = retain, .release = release, .holders = holders, .available = available, .hold = hold } }; + } + fn family(f: *Fake) radix.Snapshots { + return .{ .ptr = f, .vtable = &.{ .bytes = bytes, .save = save, .restore = restore, .drop = dropState } }; + } + fn hooks(f: *Fake) radix.PartHooks { + return .{ .ptr = f, .vtable = &.{ .bytes = partBytes, .copy = copy, .restore = partRestore, .copy_rows = copyRows, .fence = fence } }; + } + /// A stream's own pages: one holder more each. + fn take(f: *Fake, ids: []const u32) void { + for (ids) |id| f.refs[id] += 1; + } + fn end(f: *Fake, ids: []const u32) void { + for (ids) |id| f.refs[id] -= 1; + } + /// Times `id` was written by a copy. + fn writes(f: *const Fake, id: u32) usize { + var n: usize = 0; + for (f.rows[0..f.nrows]) |c| n += @intFromBool(c[2] == id); + return n; + } + fn refsTotal(f: *const Fake) usize { + var n: usize = 0; + for (f.refs) |r| n += r; + return n; + } +}; + +const unplanned: radix.Rules = .{ .page = 4, .lookahead = 0, .min_gap = 1, .min_prompt = 0 }; +const planned: radix.Rules = .{ .page = 4, .planned = true, .grid = 8, .lookahead = 0, .min_gap = 1, .min_prompt = 0 }; +const tails: radix.Groups = .{ .tails = true }; + +fn open(f: *Fake, rules: radix.Rules, groups: radix.Groups) !radix.Store { + var s = try radix.Store.initGroups(testing.allocator, f.family(), f.pages(), rules, groups, f.hooks()); + s.limit(.{ .pages = 16, .snaps = 4 }); + return s; +} + +fn seq(comptime n: usize) [n]u32 { + var out: [n]u32 = undefined; + for (&out, 0..) |*t, i| t.* = @intCast(i + 1); + return out; +} + +/// `begin`, its adopted pages and copies the stream's until it ends them. +const Resume = struct { + plan: radix.Plan, + adopt: std.ArrayList(u32) = .empty, + + fn of(s: *radix.Store, q: radix.Query) !Resume { + var r: Resume = .{ .plan = undefined }; + r.plan = try s.begin(testing.allocator, q, q.prompt_len, &.{}, null, &r.adopt); + return r; + } + fn end(r: *Resume, s: *radix.Store, f: *Fake) void { + f.end(r.adopt.items); + s.finish(null, r.plan.copies); + r.plan.deinit(testing.allocator); + r.adopt.deinit(testing.allocator); + } +}; + +test "the same off-page position marks a tail with tails, and its page edge without" { + var f: Fake = .{}; + var with = try open(&f, unplanned, tails); + defer with.deinit(); + var without = try radix.Store.initGroups(testing.allocator, f.family(), f.pages(), unplanned, .{}, null); + defer without.deinit(); + without.limit(.{ .pages = 16, .snaps = 4 }); + const prompt = seq(10); + const a = try with.marks(testing.allocator, .of(&prompt), 0, 6, &.{}, &.{}); + defer testing.allocator.free(a); + const b = try without.marks(testing.allocator, .of(&prompt), 0, 6, &.{}, &.{}); + defer testing.allocator.free(b); + try testing.expectEqualSlices(u32, &.{6}, a); + try testing.expectEqualSlices(u32, &.{4}, b); +} + +test "a tail keeps its rows as a held copy, and a prompt that diverges past them resumes there through a copy" { + var f: Fake = .{}; + var s = try open(&f, unplanned, tails); + defer s.deinit(); + const prompt = seq(10); + const mine = [_]u32{ 0, 1 }; // a whole page and the partial page + f.take(&mine); + var path: [1]u32 = undefined; + const kept = s.keep(.of(&prompt), 6, null, &mine, &path); + try testing.expect(kept.held); + try testing.expectEqual(@as(usize, 1), kept.shared); // the whole page only: the stream still writes its partial one + try testing.expectEqual(@as(usize, 2), s.tree.heldPages()); // the path page and the tail's copy + try testing.expectEqual(@as(usize, 1), f.nrows); + const tail_id = f.rows[0][2]; + try testing.expectEqualSlices(u32, &.{ 0, 1, tail_id, 2 }, &f.rows[0]); // prefix group 0, rows [0, 2) of page 1 + try testing.expectEqual(@as(u32, 1), f.refs[1]); // the stream's partial page stays the stream's alone + f.end(&mine); + const edge = s.tree.root.kids.items[0]; + try testing.expect(edge.entry == null); // a tail on an edge with no state of its own + try testing.expectEqual(@as(usize, 1), edge.tails.items.len); + + var diverged = seq(10); + diverged[6] = 99; // inside the tail's page, past its rows + var r = try Resume.of(&s, .of(&diverged)); + try testing.expectEqual(@as(u32, 6), r.plan.from); + try testing.expectEqual(@as(?u32, 6), f.restored); + try testing.expectEqualSlices(u32, &.{0}, r.adopt.items); + try testing.expectEqual(@as(usize, 1), r.plan.copies.len); + try testing.expectEqual(radix.Copy{ .group = 0, .index = 1, .src = tail_id, .rows = 2 }, r.plan.copies[0]); + try testing.expectEqual(@as(u32, 2), f.refs[tail_id]); // held for the stream until finish + r.end(&s, &f); + try testing.expectEqual(@as(u32, 1), f.refs[tail_id]); + + var other = seq(10); + other[5] = 99; // inside the tail's rows: only the page edge matches, which holds no state + var miss = try Resume.of(&s, .of(&other)); + try testing.expectEqual(@as(u32, 0), miss.plan.from); + miss.end(&s, &f); + try testing.expectEqual(@as(usize, 1), f.writes(tail_id)); // the keep that made it, and nothing since +} + +test "a tail inside the first page hangs on the root: kept, found, resumed and evicted" { + var f: Fake = .{}; + var s = try open(&f, unplanned, tails); + defer s.deinit(); + const prompt = seq(10); + const mine = [_]u32{0}; + f.take(&mine); + var path: [0]u32 = .{}; + try testing.expect(s.keep(.of(&prompt), 3, null, &mine, &path).held); + f.end(&mine); + try testing.expectEqual(@as(usize, 1), s.tree.root.tails.items.len); + const tail_id = s.tree.root.tails.items[0].tail.?.ids[0]; + var r = try Resume.of(&s, .of(&prompt)); + try testing.expectEqual(@as(u32, 3), r.plan.from); + try testing.expectEqual(@as(usize, 0), r.adopt.items.len); + try testing.expectEqual(radix.Copy{ .group = 0, .index = 0, .src = tail_id, .rows = 3 }, r.plan.copies[0]); + r.end(&s, &f); + s.limit(.{ .pages = 16, .snaps = 0 }); + try testing.expectEqual(@as(usize, 0), s.tree.snaps); + try testing.expectEqual(@as(u32, 0), f.refs[tail_id]); + try testing.expect(s.keep(.of(&prompt), 3, null, &mine, &path).held == false); // no state slot left + s.limit(.{ .pages = 16, .snaps = 4 }); + f.take(&mine); + try testing.expect(s.keep(.of(&prompt), 3, null, &mine, &path).held); + f.end(&mine); + try testing.expect(s.reclaim(64 - 0)); // the root's idle tail is reclaimed like a leaf's: every page back + try testing.expectEqual(@as(usize, 0), s.tree.heldPages()); +} + +test "the deepest usable tail on one edge wins: three tails, a request's starts and a diverging prompt" { + var f: Fake = .{}; + var s = try open(&f, planned, tails); + defer s.deinit(); + const prompt = seq(12); + for ([_]u32{ 5, 6, 7 }) |at| { + const mine = [_]u32{ 0, 1 }; + f.take(&mine); + var path: [1]u32 = undefined; + try testing.expect(s.keep(.{ .key = &prompt, .prompt_len = 12, .starts = &.{at} }, at, null, &mine, &path).held); + f.end(&mine); + } + try testing.expectEqual(@as(usize, 3), s.tree.root.kids.items[0].tails.items.len); + const both = radix.Query{ .key = &prompt, .prompt_len = 12, .starts = &.{ 5, 7 } }; + try testing.expectEqual(@as(u32, 7), s.find(both).?.at()); + var diverged = seq(12); + diverged[6] = 99; // the tail at 7 holds row 6 + const q = radix.Query{ .key = &diverged, .prompt_len = 12, .starts = &.{ 5, 7 } }; + try testing.expectEqual(@as(u32, 5), s.find(q).?.at()); // 6 is inside the chunk from 5, so not a resume point + const at6 = radix.Query{ .key = &diverged, .prompt_len = 12, .starts = &.{6} }; + try testing.expectEqual(@as(u32, 6), s.find(at6).?.at()); +} + +test "a tail at a grid row inside a request's chunk is refused, and so is one off the grid without a start" { + var f: Fake = .{}; + var s = try open(&f, planned, tails); + defer s.deinit(); + const prompt = seq(12); + const mine = [_]u32{ 0, 1, 2 }; + f.take(&mine); + defer f.end(&mine); + var path: [2]u32 = undefined; + try testing.expect(!s.keep(.{ .key = &prompt, .prompt_len = 12, .starts = &.{5} }, 8, null, mine[0..2], path[0..2]).held); + try testing.expect(!s.keep(.of(&prompt), 6, null, mine[0..2], path[0..1]).held); // the grid's start is 0 + try testing.expectEqual(@as(usize, 0), s.tree.snaps); +} + +test "a page-only store keeps whole pages without entries, and tails as entries only with state slots" { + var f: Fake = .{}; + var s = try open(&f, unplanned, .{ .legacy = false, .tails = true }); + defer s.deinit(); + s.limit(.{ .pages = 16, .snaps = 0 }); + const prompt = seq(10); + const mine = [_]u32{ 0, 1 }; + var path: [1]u32 = undefined; + f.take(&mine); + const pages_only = s.keep(.of(&prompt), 6, null, &mine, &path); + try testing.expect(!pages_only.held and pages_only.shared == 1); // its whole page, no tail + try testing.expectEqual(@as(usize, 1), s.tree.heldPages()); + s.limit(.{ .pages = 16, .snaps = 2 }); + try testing.expect(s.keep(.of(&prompt), 6, null, &mine, &path).held); + f.end(&mine); + try testing.expectEqual(@as(usize, 1), s.tree.snaps); + var r = try Resume.of(&s, .of(&prompt)); + try testing.expectEqual(@as(u32, 6), r.plan.from); + try testing.expectEqual(@as(usize, 1), r.plan.copies.len); + r.end(&s, &f); + var other = seq(10); + other[5] = 99; + var edge = try Resume.of(&s, .of(&other)); // the page edge: a page-only hit with no entry + try testing.expectEqual(@as(u32, 4), edge.plan.from); + try testing.expectEqual(@as(usize, 0), edge.plan.copies.len); + edge.end(&s, &f); +} + +test "a later prompt that diverges inside a tail's rows does not supersede it" { + var f: Fake = .{}; + var s = try open(&f, unplanned, tails); + defer s.deinit(); + const a = seq(10); + const mine = [_]u32{ 0, 1, 2 }; + f.take(&mine); + defer f.end(&mine); + var path: [2]u32 = undefined; + try testing.expect(s.keep(.of(&a), 6, null, mine[0..2], path[0..1]).held); + var r = try Resume.of(&s, .of(&a)); // resumed: worth more than a state nobody asked for + r.end(&s, &f); + var b = seq(12); + b[4] = 99; // past the tail's edge, inside its rows + try testing.expect(s.keep(.of(&b), 8, null, mine[0..2], path[0..2]).held); + s.limit(.{ .pages = 16, .snaps = 1 }); + try testing.expectEqual(@as(u32, 6), s.find(.of(&a)).?.at()); // the tail stays; b's state went +} + +test "a later tail supersedes one only under its Ns and its lookahead words" { + var f: Fake = .{}; + var s = try radix.Store.initGroups(testing.allocator, f.family(), f.pages(), .{ .page = 4, .lookahead = 1, .min_gap = 1, .min_prompt = 0 }, tails, f.hooks()); + defer s.deinit(); + s.limit(.{ .pages = 16, .snaps = 4 }); + const mine = [_]u32{ 0, 1 }; + f.take(&mine); + defer f.end(&mine); + var path: [1]u32 = undefined; + const a = seq(10); + try testing.expect(s.keep(.{ .key = &a, .prompt_len = 10, .namespace = 1 }, 2, null, mine[1..2], path[0..0]).held); + try testing.expect(s.keep(.of(&a), 6, null, &mine, &path).held); + for ([_]radix.Query{ .{ .key = &a, .prompt_len = 10, .namespace = 1 }, .of(&a) }) |q| { + var r = try Resume.of(&s, q); // each resumed once + r.end(&s, &f); + } + const b = seq(12); + try testing.expect(s.keep(.{ .key = &b, .prompt_len = 12, .namespace = 2 }, 3, null, mine[1..2], path[0..0]).held); // another Ns + var c = seq(12); + c[6] = 99; // the tail at 6 read row 6 as its lookahead + try testing.expect(s.keep(.of(&c), 7, null, &mine, &path).held); + s.limit(.{ .pages = 16, .snaps = 2 }); // the two never resumed go; neither of them superseded a resumed tail + try testing.expectEqual(@as(u32, 2), s.find(.{ .key = &a, .prompt_len = 10, .namespace = 1 }).?.at()); + try testing.expectEqual(@as(u32, 6), s.find(.of(&a)).?.at()); +} + +test "tails need copy_rows and a pool that holds pages for the store" { + var f: Fake = .{}; + try testing.expectError(error.TailsNeedHooks, radix.Store.initGroups(testing.allocator, f.family(), f.pages(), unplanned, tails, null)); + var no_hold = f.pages(); + no_hold.vtable = &.{ .retain = Fake.retain, .release = Fake.release, .holders = Fake.holders, .available = Fake.available }; + try testing.expectError(error.TailsNeedHold, radix.Store.initGroups(testing.allocator, f.family(), no_hold, unplanned, tails, f.hooks())); +} + +test "a window group with other rows a page copies its own partial rows, at a tail and at a page edge" { + var f: Fake = .{}; + const window = [_]radix.Parts.PartSpec{.{ .kind = .window, .make = .retained, .rows = 3 }}; + var s = try open(&f, unplanned, .{ .parts = &window, .tails = true }); + defer s.deinit(); + const prompt = seq(12); + const mine = [_]u32{ 0, 1, 2 }; + const win = [_]u32{ 10, 11, 12 }; // rows [0, 9): the last partial at 7 and at 8 + f.take(&mine); + f.take(&win); + var path: [2]u32 = undefined; + try testing.expect(s.keepParts(.of(&prompt), 7, null, mine[0..2], &.{.{ .base = 0, .ids = &win }}, path[0..1]).held); + try testing.expect(s.keepParts(.of(&prompt), 8, null, mine[0..2], &.{.{ .base = 0, .ids = &win }}, path[0..2]).held); + f.end(&mine); + f.end(&win); + // at 7: the tail's 3 rows of prefix page 1 (group 1, after the one part), the window's 1 row of its page 2 + var r = try Resume.of(&s, .of(prompt[0..8])); + defer r.end(&s, &f); + try testing.expectEqual(@as(u32, 7), r.plan.from); + try testing.expectEqual(@as(usize, 2), r.plan.copies.len); + try testing.expectEqual(@as(u32, 0), r.plan.copies[0].group); + try testing.expectEqual(@as(u32, 2), r.plan.copies[0].index); + try testing.expectEqual(@as(u32, 1), r.plan.copies[0].rows); + try testing.expectEqual(@as(u32, 1), r.plan.copies[1].group); + try testing.expectEqual(@as(u32, 1), r.plan.copies[1].index); + try testing.expectEqual(@as(u32, 3), r.plan.copies[1].rows); + var e = try Resume.of(&s, .of(&prompt)); // at 8: the edge, the window's 2 rows + defer e.end(&s, &f); + try testing.expectEqual(@as(u32, 8), e.plan.from); + try testing.expectEqual(@as(usize, 1), e.plan.copies.len); + try testing.expectEqual(@as(u32, 2), e.plan.copies[0].rows); +} + +test "a tail that fails to hold, to copy or to allocate takes nothing and leaves no state" { + var f: Fake = .{}; + var fa = std.testing.FailingAllocator.init(testing.allocator, .{}); + var s = try radix.Store.initGroups(fa.allocator(), f.family(), f.pages(), unplanned, tails, f.hooks()); + defer s.deinit(); + s.limit(.{ .pages = 16, .snaps = 4 }); + const prompt = seq(10); + const mine = [_]u32{ 0, 1 }; + f.take(&mine); + defer f.end(&mine); + var path: [1]u32 = undefined; + for ([_]bool{ true, false }) |fail_hold| { + f.fail_hold = fail_hold; + f.fail_rows = !fail_hold; + try testing.expect(!s.keep(.of(&prompt), 6, null, &mine, &path).held); + try testing.expectEqual(@as(usize, 0), s.tree.snaps); + try testing.expectEqual(mine.len + s.tree.heldPages(), f.refsTotal()); // the path stays; no copy is left held + try testing.expect(f.held_at_fence); // the failed copy completed before its page went back + } + f.fail_rows = false; + var k: usize = 0; + while (k < 32) : (k += 1) { + fa.fail_index = fa.alloc_index + k; + if (s.keep(.of(&prompt), 6, null, &mine, &path).held) break; + try testing.expectEqual(@as(usize, 0), s.tree.snaps); + try testing.expectEqual(mine.len + s.tree.heldPages(), f.refsTotal()); + } + try testing.expect(k >= 3 and k < 32); // the tail's key, its images, its ids and the entry each failed once +} diff --git a/zig/src/core/prompt_radix_test.zig b/zig/src/core/prompt_radix_test.zig index ec0eefad5be..45f38734501 100644 --- a/zig/src/core/prompt_radix_test.zig +++ b/zig/src/core/prompt_radix_test.zig @@ -178,8 +178,8 @@ test "a shared cut outlives the conversation that made it, and a state its conve f.leave(mine.items); try std.testing.expectEqual(@as(u32, 16), plan.from); try std.testing.expectEqual(@as(usize, 3), s.tree.snaps); - try std.testing.expectEqual(@as(u32, 16), s.find(.of(&p1)).?.end); - try std.testing.expectEqual(@as(u32, 64), s.find(.of(&p2)).?.end); + try std.testing.expectEqual(@as(u32, 16), s.find(.of(&p1)).?.at()); + try std.testing.expectEqual(@as(u32, 64), s.find(.of(&p2)).?.at()); try std.testing.expectEqual(@as(u64, 1), s.tree.counts.evicted); try std.testing.expectEqual(s.tree.snaps, f.live); } @@ -390,7 +390,7 @@ test "lookahead 1: a state resumes when the token past it repeats, and not when plan = try pass(&f, &s, a, &t3, 28, &.{}, &mine); try std.testing.expectEqual(@as(u32, 0), plan.from); f.leave(mine.items); - try std.testing.expectEqual(@as(u32, 20), s.find(.of(&seq(21, 0))).?.end); // its lookahead, the one token to prefill + try std.testing.expectEqual(@as(u32, 20), s.find(.of(&seq(21, 0))).?.at()); // its lookahead, the one token to prefill try std.testing.expect(s.find(.of(&seq(20, 0))) == null); // no token past the state: nothing to resume try std.testing.expectEqual(s.tree.snaps, f.live); } diff --git a/zig/src/core/prompt_radix_tree.zig b/zig/src/core/prompt_radix_tree.zig index 1de0ce9426d..4f05da9c405 100644 --- a/zig/src/core/prompt_radix_tree.zig +++ b/zig/src/core/prompt_radix_tree.zig @@ -5,12 +5,14 @@ const Allocator = std.mem.Allocator; const pc = @import("prompt_cache.zig"); const parts = @import("prompt_radix_parts.zig"); +const tail_mod = @import("prompt_radix_tail.zig"); pub const Saved = pc.Saved; pub const Snapshots = pc.Snapshots; pub const Pages = pc.Pages; pub const Counts = pc.Counts; pub const Identity = @import("cache_images.zig").Identity; +pub const Tail = tail_mod.Tail; /// What rows depend on beyond their key and images: a tree never shares a page between two of these. pub const Ns = struct { namespace: u64 = 0, frame: u32 = 0 }; @@ -23,7 +25,7 @@ pub const Key = struct { }; /// The images whose rows overlap [lo, hi), of a list in prompt order. -fn overlapping(ids: []const Identity, lo: usize, hi: usize) []const Identity { +pub fn overlapping(ids: []const Identity, lo: usize, hi: usize) []const Identity { var a: usize = 0; while (a < ids.len and ids[a].at + ids[a].tokens <= lo) a += 1; var b = a; @@ -32,7 +34,7 @@ fn overlapping(ids: []const Identity, lo: usize, hi: usize) []const Identity { } /// Whether the same images, exactly, overlap [lo, hi) in both lists. -fn sameImages(x: []const Identity, y: []const Identity, lo: usize, hi: usize) bool { +pub fn sameImages(x: []const Identity, y: []const Identity, lo: usize, hi: usize) bool { const a = overlapping(x, lo, hi); const b = overlapping(y, lo, hi); if (a.len != b.len) return false; @@ -59,6 +61,23 @@ pub const Entry = struct { hit: bool = false, /// Resumed again after a later prompt kept a state below it: a turn several continuations share, never superseded. branched: bool = false, + /// Its rows past its node's end (C4); null at the node's end. + tail: ?Tail = null, +}; + +/// A state the tree holds: a node's entry at its end, or one of its tails. +pub const Found = struct { + node: *Node, + tail: ?usize = null, + + pub fn entry(f: Found) *Entry { + return if (f.tail) |i| &f.node.tails.items[i] else &f.node.entry.?; + } + + /// The tokens below the state. + pub fn at(f: Found) u32 { + return f.node.end + if (f.tail) |i| f.node.tails.items[i].tail.?.r else 0; + } }; /// A matched position: `pages` logical pages into `node` (1 to its count). @@ -85,6 +104,8 @@ pub const Node = struct { ns: Ns = .{}, kids: std.ArrayList(*Node) = .empty, entry: ?Entry = null, + /// Entries past its end inside the next page (C4), each with its tail. + tails: std.ArrayList(Entry) = .empty, used: u64 = 0, /// A keep or a restore in progress here: no eviction or prune takes this node, its entry or its path. pins: u32 = 0, @@ -133,6 +154,8 @@ pub const Tree = struct { for (n.kids.items) |k| t.drop(k); n.kids.deinit(t.gpa); if (n.entry) |e| t.dropEntry(e); + for (n.tails.items) |e| t.dropEntry(e); + n.tails.deinit(t.gpa); for (n.pages) |id| t.holds.drop(t.pages, id); t.gpa.free(n.tokens); t.gpa.free(n.pages); @@ -191,6 +214,26 @@ pub const Tree = struct { return best; } + /// The deepest tail `k` repeats at a resume point at most `limit` rows in, on the root or a node it repeats whole. + pub fn deepestTail(t: *const Tree, k: Key, limit: usize, ok: anytype) ?Found { + var node = t.root; + var at: usize = 0; + var best: ?Found = null; + while (true) { + for (node.tails.items, 0..) |e, i| { + const pos = node.end + e.tail.?.r; + if (pos > limit or !ok.ok(@intCast(pos)) or !e.tail.?.matches(node.end, k)) continue; + if (best == null or pos > best.?.at()) best = .{ .node = node, .tail = i }; + } + if (at + t.page > limit) break; + const c = t.child(node, k, at) orelse break; + if (t.common(c, k, at, (limit - at) / t.page) < t.npages(c)) break; + at = c.end; + node = c; + } + return best; + } + /// The deepest page edge `prompt` repeats up to `limit_at`, inside a node too: where a page-only store resumes. pub fn deepestPage(t: *const Tree, k: Key, limit_at: usize, ok: anytype) ?Hit { var node = t.root; @@ -334,10 +377,11 @@ pub const Tree = struct { return up; } - /// An entry's snapshot, parts and prompt go. + /// An entry's snapshot, parts, tail and prompt go. fn dropEntry(t: *Tree, e: Entry) void { if (e.saved) |saved| t.family.vtable.drop(t.family.ptr, saved); t.dropParts(e.parts); + if (e.tail) |tl| tail_mod.free(t, tl); t.gpa.free(e.last); } @@ -366,11 +410,25 @@ pub const Tree = struct { t.prune(n); } + /// Frees the state `f` names, and the nodes below nothing keeps. + pub fn evictAt(t: *Tree, f: Found) void { + const i = f.tail orelse return t.evict(f.node); + std.debug.assert(f.node.pins == 0); // a keep or a restore in progress + t.dropTail(f.node, i); + t.prune(f.node); + } + + fn dropTail(t: *Tree, n: *Node, i: usize) void { + t.dropEntry(n.tails.orderedRemove(i)); + t.snaps -= 1; + t.counts.evicted += 1; + } + /// Removes `start` and its parents while they hold no state and have nothing below them. pub fn prune(t: *Tree, start: *Node) void { var n = start; while (n.parent) |parent| { - if (n.kids.items.len > 0 or n.entry != null or n.pins > 0) return; + if (n.kids.items.len > 0 or n.entry != null or n.tails.items.len > 0 or n.pins > 0) return; const slot = std.mem.indexOfScalar(*Node, parent.kids.items, n).?; _ = parent.kids.swapRemove(slot); t.drop(n); @@ -393,7 +451,8 @@ pub const Tree = struct { } fn weakestLeaf(t: *const Tree, n: *Node, best: *?*Node) void { - if (n.parent != null and n.kids.items.len == 0 and n.pins == 0 and t.idle(n) and (best.* == null or lessValuable(n, best.*.?))) best.* = n; + // the root is a leaf only for its tails + if ((n.parent != null or n.tails.items.len > 0) and n.kids.items.len == 0 and n.pins == 0 and t.idle(n) and (best.* == null or lessValuable(n, best.*.?))) best.* = n; for (n.kids.items) |k| t.weakestLeaf(k, best); } @@ -402,6 +461,7 @@ pub const Tree = struct { var best: ?*Node = null; t.weakestLeaf(t.root, &best); const n = best orelse return false; + while (n.tails.items.len > 0) t.dropTail(n, n.tails.items.len - 1); if (n.entry != null) t.evict(n) else t.prune(n); return true; } @@ -415,6 +475,7 @@ pub const Tree = struct { fn sum(n: *const Node, out: *u64) void { if (n.entry) |e| out.* += e.bytes; + for (n.tails.items) |e| out.* += e.bytes; for (n.kids.items) |k| sum(k, out); } }; diff --git a/zig/src/core/template/methods.zig b/zig/src/core/template/methods.zig index ea680ef2c6b..ee56bf6b680 100644 --- a/zig/src/core/template/methods.zig +++ b/zig/src/core/template/methods.zig @@ -311,6 +311,7 @@ fn strMethod(rt: *Rt, s: v.Str, name: []const u8, pos: []const Value, kw: []cons } return .{ .str = out.str() }; } + if (eq(u8, name, "format")) return @import("str_format.zig").format(rt, s, pos, kw.len); return rt.fail("str.{s}() is not supported", .{name}); } diff --git a/zig/src/core/template/provenance_test.zig b/zig/src/core/template/provenance_test.zig index 7be48df6405..0512129cc9b 100644 --- a/zig/src/core/template/provenance_test.zig +++ b/zig/src/core/template/provenance_test.zig @@ -147,7 +147,7 @@ test "provenance property covers every implemented filter" { try t.expectEqual(@as(usize, 31), filters.implemented.len); } -const str_supported = [_][]const u8{ "capitalize", "count", "endswith", "find", "index", "join", "lower", "lstrip", "removeprefix", "removesuffix", "replace", "rfind", "rindex", "rsplit", "rstrip", "split", "startswith", "strip", "upper" }; +const str_supported = [_][]const u8{ "capitalize", "count", "endswith", "find", "format", "index", "join", "lower", "lstrip", "removeprefix", "removesuffix", "replace", "rfind", "rindex", "rsplit", "rstrip", "split", "startswith", "strip", "upper" }; test "provenance property covers every exposed string dict and list method including refusals" { var arena = std.heap.ArenaAllocator.init(t.allocator); diff --git a/zig/src/core/template/str_format.zig b/zig/src/core/template/str_format.zig new file mode 100644 index 00000000000..8c2109a71fa --- /dev/null +++ b/zig/src/core/template/str_format.zig @@ -0,0 +1,50 @@ +//! str.format() for templates: "{}" and "{N}" fields and the "{{" "}}" escapes; every other field is refused. +const std = @import("std"); +const v = @import("value.zig"); +const Value = v.Value; +const Rt = v.Rt; +const Error = v.Error; + +const Numbering = enum { unset, auto, manual }; + +/// Python's str.format on `s` with positional `args`; a keyword, attribute, conversion or spec field fails by name. +pub fn format(rt: *Rt, s: v.Str, args: []const Value, keywords: usize) Error!Value { + if (keywords > 0) return rt.fail("str.format() keyword fields are not supported", .{}); + const t = s.s; + var out: v.Buffer = .{}; + var numbering: Numbering = .unset; + var next: usize = 0; + var from: usize = 0; + var i: usize = 0; + while (i < t.len) : (i += 1) { + if (t[i] != '{' and t[i] != '}') continue; + try out.append(rt.a, try s.part(rt.a, t[from..i])); + if (i + 1 < t.len and t[i + 1] == t[i]) { + try out.append(rt.a, try s.part(rt.a, t[i .. i + 1])); + i += 1; + from = i + 1; + continue; + } + if (t[i] == '}') return rt.fail("Single '}}' encountered in format string", .{}); + const close = std.mem.indexOfScalarPos(u8, t, i + 1, '}') orelse return rt.fail("Single '{{' encountered in format string", .{}); + const field = t[i + 1 .. close]; + var at = next; + if (field.len == 0) { + if (numbering == .manual) return rt.fail("cannot switch from manual field specification to automatic field numbering", .{}); + numbering = .auto; + next += 1; + } else { + // Python's index is decimal digits alone: '+0', '-0' and '0_0' are keyword names (parseInt takes them) + for (field) |ch| if (!std.ascii.isDigit(ch)) return rt.fail("str.format() field '{s}' is not supported", .{field}); + at = std.fmt.parseInt(usize, field, 10) catch return rt.fail("Too many decimal digits in format string", .{}); + if (numbering == .auto) return rt.fail("cannot switch from automatic field numbering to manual field specification", .{}); + numbering = .manual; + } + if (at >= args.len) return rt.fail("Replacement index {d} out of range for positional args tuple", .{at}); + try out.append(rt.a, try v.asStr(rt, args[at])); + i = close; + from = close + 1; + } + try out.append(rt.a, try s.part(rt.a, t[from..])); + return .{ .str = out.str() }; +} diff --git a/zig/src/core/template/tests.zig b/zig/src/core/template/tests.zig index 46da77e7b0f..a2e2049b835 100644 --- a/zig/src/core/template/tests.zig +++ b/zig/src/core/template/tests.zig @@ -104,6 +104,18 @@ const probes = [_]struct { []const u8, ?[]const u8, ?[]const u8 }{ .{ "{{ undefined_name|float }}", null, null }, }; +test "str.format: positional fields and escapes match Python, the fields it does not run are refused" { + const fields = "{{ ''.format('X') }}|{{ '{}{}'.format(1, 'z') }}|{{ '{1}{0}'.format('a','b') }}|{{ '{{}}{}'.format(none) }}|{{ 'x'.format() }}"; + try expect(fields, shared, .{ .text = "|1z|ba|{}None|x", .raised = null }); + try expect("{{ '{}'.format(true) }}|{{ '{}'.format(1.5) }}|{{ '{0}{0}'.format('q') }}|{{ '{00}'.format('z') }}", shared, .{ .text = "True|1.5|qq|z", .raised = null }); + // Python raises on these (the signed and underscored fields are keyword names it does not find) + for ([_][]const u8{ "{{ '{}{}'.format(1) }}", "{{ '{0}{}'.format(1,2) }}", "{{ '{'.format() }}", "{{ '}'.format() }}", "{{ '{+0}'.format(1) }}", "{{ '{-0}'.format(1) }}", "{{ '{0_0}'.format(1) }}" }) |source| + try expect(source, shared, .{ .text = null, .raised = null }); + // Python renders these; the engine refuses a spec, a keyword field and a conversion by name + for ([_][]const u8{ "{{ '{:>4}'.format(1) }}", "{{ '{a}'.format(a=1) }}", "{{ '{!r}'.format('s') }}" }) |source| + try expect(source, shared, .{ .text = null, .raised = null }); +} + test "feature probes match Python jinja2" { for (probes) |p| try expect(p[0], shared, .{ .text = p[1], .raised = p[2] }); } diff --git a/zig/src/core/tokenizer/eos.zig b/zig/src/core/tokenizer/eos.zig index e92896fac32..16d26121364 100644 --- a/zig/src/core/tokenizer/eos.zig +++ b/zig/src/core/tokenizer/eos.zig @@ -8,32 +8,108 @@ pub fn appendId(a: Allocator, out: *std.ArrayList(u32), id: u32, vocab: usize) ! if (std.mem.indexOfScalar(u32, out.items, id) == null) try out.append(a, id); } -fn addValue(a: Allocator, out: *std.ArrayList(u32), value: Value, vocab: usize) !void { - switch (value) { - .null => {}, - .integer => |n| try appendId(a, out, std.math.cast(u32, n) orelse return error.BadEos, vocab), - .array => |items| { - var seen: std.AutoHashMapUnmanaged(u32, void) = .empty; - defer seen.deinit(a); - for (out.items) |id| try seen.put(a, id, {}); - for (items.items) |item| { - if (item == .null) continue; - if (item != .integer) return error.BadEos; - const id = std.math.cast(u32, item.integer) orelse return error.BadEos; - if (id >= vocab) return error.BadEos; - if (seen.contains(id)) continue; - try seen.put(a, id, {}); - try out.append(a, id); - } - }, - else => return error.BadEos, - } +/// Where a family takes config.json's ids from; generation_config.json's are added after them in every order. +pub const Order = enum { + /// The root's ids; text_config's only when the root gave none. + text_if_root_empty, + /// The root's, text_config's and generation_config.json's, all of them. + every_source, + /// The root's key whenever it exists (a root `null` or `[]` hides text_config's), else text_config's. + root_key_else_text, +}; + +/// One family's EOS rule: the order, whether nested arrays hold more ids, the most ids, and whether none is refused. +pub const Policy = struct { + order: Order, + nested: bool, + max: ?usize, + required: bool, +}; + +/// `resolve`'s rule: the served stop set (server/hf_text.zig), dots_mocr, dory and kolibri1. +pub const served: Policy = .{ .order = .text_if_root_empty, .nested = false, .max = null, .required = false }; +/// Qwen3.5's HIP loader (families/qwen3_5/config_checks.zig): every source, at most 8 ids. +pub const qwen35_hip: Policy = .{ .order = .every_source, .nested = true, .max = 8, .required = true }; +/// qwen27 on Metal (families/qwen27/config.zig): root key else text_config, then generation, at most 8 ids. +pub const qwen27_metal: Policy = .{ .order = .root_key_else_text, .nested = true, .max = 8, .required = true }; + +/// BadEosValue: not a null, an id or an id array (a family names it); BadEos: an id at or past the vocabulary. +pub const BufferError = error{ BadEos, BadEosValue, TooManyEos, MissingEos }; +pub const Error = BufferError || error{OutOfMemory}; +/// `resolve` and `merge` name every refusal BadEos: `served` sets no most ids and allows none. +pub const ServedError = error{ BadEos, OutOfMemory }; + +fn servedError(e: Error) ServedError { + return switch (e) { + error.BadEos, error.BadEosValue => error.BadEos, + error.OutOfMemory => error.OutOfMemory, + error.TooManyEos, error.MissingEos => unreachable, + }; } -fn field(a: Allocator, out: *std.ArrayList(u32), doc: Value, vocab: usize) !void { - if (doc == .null) return; - if (doc != .object) return error.BadEos; - if (doc.object.get("eos_token_id")) |value| try addValue(a, out, value, vocab); +const Ids = struct { + list: std.ArrayList(u32), + /// null: the caller's fixed buffer. + a: ?Allocator, + policy: Policy, + vocab: usize, + + fn id(s: *Ids, n: i64) Error!void { + const v = std.math.cast(u32, n) orelse return error.BadEosValue; + if (v >= s.vocab) return error.BadEos; + if (std.mem.indexOfScalar(u32, s.list.items, v) != null) return; + if (s.policy.max) |m| if (s.list.items.len == m) return error.TooManyEos; + if (s.a) |a| try s.list.append(a, v) else s.list.appendBounded(v) catch return error.TooManyEos; + } + + fn add(s: *Ids, v: Value, in_array: bool) Error!void { + switch (v) { + .null => {}, + .integer => |n| try s.id(n), + .array => |items| { + if (in_array and !s.policy.nested) return error.BadEosValue; + for (items.items) |item| try s.add(item, true); + }, + else => return error.BadEosValue, + } + } + + /// A document's `eos_token_id`; a null document is none, any other non-object is refused. + fn field(s: *Ids, doc: Value) Error!void { + if (doc == .null) return; + if (doc != .object) return error.BadEosValue; + if (doc.object.get("eos_token_id")) |v| try s.add(v, false); + } + + fn gather(s: *Ids, root: Value, text: Value, generation: Value) Error!void { + switch (s.policy.order) { + .text_if_root_empty => { + try s.field(root); + if (s.list.items.len == 0) try s.field(text); + }, + .every_source => { + try s.field(root); + try s.field(text); + }, + .root_key_else_text => if (root == .object and root.object.contains("eos_token_id")) + try s.field(root) + else + try s.field(text), + } + try s.field(generation); + if (s.policy.required and s.list.items.len == 0) return error.MissingEos; + } +}; + +/// `policy`'s ids below `vocab` into `out`, each once; `out` holds at least `policy.max` ids. +pub fn collect(out: []u32, policy: Policy, root: Value, text: Value, generation: Value, vocab: usize) BufferError![]u32 { + std.debug.assert(out.len >= policy.max orelse out.len); + var s: Ids = .{ .list = .initBuffer(out), .a = null, .policy = policy, .vocab = vocab }; + s.gather(root, text, generation) catch |e| return switch (e) { + error.OutOfMemory => unreachable, // a fixed buffer refuses past its end with TooManyEos + else => |x| x, + }; + return s.list.items; } fn validVocab(vocab: usize) !void { @@ -53,26 +129,24 @@ pub fn vocabulary(model: Value, tokenizer_vocab: usize) !usize { return @min(tokenizer_vocab, declared); } -/// Model ids, with the existing top-level-before-text fallback, then every declared generation EOS. -pub fn resolve(a: Allocator, model: Value, generation: Value, vocab: usize) ![]u32 { +/// Model ids by the `served` policy, the root's before text_config's, then every declared generation EOS. +pub fn resolve(a: Allocator, model: Value, generation: Value, vocab: usize) ServedError![]u32 { const bound = try vocabulary(model, vocab); - var out: std.ArrayList(u32) = .empty; - errdefer out.deinit(a); - try field(a, &out, model, bound); - if (out.items.len == 0 and model == .object) if (model.object.get("text_config")) |text| - try field(a, &out, text, bound); - try field(a, &out, generation, bound); - return out.toOwnedSlice(a); + const text = if (model == .object) model.object.get("text_config") orelse .null else .null; + var s: Ids = .{ .list = .empty, .a = a, .policy = served, .vocab = bound }; + errdefer s.list.deinit(a); + s.gather(model, text, generation) catch |e| return servedError(e); + return s.list.toOwnedSlice(a); } /// Add generation EOS to an already parsed family's ids with the same validation and deduplication. -pub fn merge(a: Allocator, initial: []const u32, generation: Value, vocab: usize) ![]u32 { +pub fn merge(a: Allocator, initial: []const u32, generation: Value, vocab: usize) ServedError![]u32 { try validVocab(vocab); - var out: std.ArrayList(u32) = .empty; - errdefer out.deinit(a); - for (initial) |id| try appendId(a, &out, id, vocab); - try field(a, &out, generation, vocab); - return out.toOwnedSlice(a); + var s: Ids = .{ .list = .empty, .a = a, .policy = served, .vocab = vocab }; + errdefer s.list.deinit(a); + for (initial) |id| try appendId(a, &s.list, id, vocab); + s.field(generation) catch |e| return servedError(e); + return s.list.toOwnedSlice(a); } test "EOS policy: checkpoint EOS merges declared pad EOS but never infers an undeclared pad" { @@ -88,6 +162,10 @@ test "EOS policy: checkpoint EOS merges declared pad EOS but never infers an und try std.testing.expectEqualSlices(u32, direct, try merge(a, initial, generation, 128000)); } +test { + _ = @import("eos_policy_test.zig"); +} + test "EOS policy: checkpoint EOS retains nested fallback and rejects invalid explicit ids before casts" { var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); diff --git a/zig/src/core/tokenizer/eos_policy_test.zig b/zig/src/core/tokenizer/eos_policy_test.zig new file mode 100644 index 00000000000..39c33f1cae7 --- /dev/null +++ b/zig/src/core/tokenizer/eos_policy_test.zig @@ -0,0 +1,85 @@ +//! Each named EOS policy over one fixture set: the ids it admits, in order, or the refusal it names. +const std = @import("std"); +const eos = @import("eos.zig"); +const t = std.testing; + +/// config.json (with any text_config inside), generation_config.json ("" for none), and each policy's answer. +const Case = struct { config: []const u8, generation: []const u8, served: []const u8, hip: []const u8, metal: []const u8 }; + +// Answers are "1,3" for ids in order, "-" for none, or an error name. +const cases = [_]Case{ + .{ .config = "{\"eos_token_id\":1,\"text_config\":{\"eos_token_id\":2}}", .generation = "{\"eos_token_id\":[3]}", .served = "1,3", .hip = "1,2,3", .metal = "1,3" }, + .{ .config = "{\"text_config\":{\"eos_token_id\":2}}", .generation = "", .served = "2", .hip = "2", .metal = "2" }, + // a root null or [] hides text_config on qwen27 Metal only + .{ .config = "{\"eos_token_id\":null,\"text_config\":{\"eos_token_id\":2}}", .generation = "", .served = "2", .hip = "2", .metal = "MissingEos" }, + .{ .config = "{\"eos_token_id\":[],\"text_config\":{\"eos_token_id\":2}}", .generation = "", .served = "2", .hip = "2", .metal = "MissingEos" }, + .{ .config = "{\"eos_token_id\":[1,1]}", .generation = "", .served = "1", .hip = "1", .metal = "1" }, + .{ .config = "{\"eos_token_id\":[1,2,3,4,5,6,7,8]}", .generation = "{\"eos_token_id\":8}", .served = "1,2,3,4,5,6,7,8", .hip = "1,2,3,4,5,6,7,8", .metal = "1,2,3,4,5,6,7,8" }, + .{ .config = "{\"eos_token_id\":[1,2,3,4,5,6,7,8]}", .generation = "{\"eos_token_id\":9}", .served = "1,2,3,4,5,6,7,8,9", .hip = "TooManyEos", .metal = "TooManyEos" }, + .{ .config = "{\"eos_token_id\":[[1,2]]}", .generation = "", .served = "BadEosValue", .hip = "1,2", .metal = "1,2" }, + .{ .config = "{\"eos_token_id\":[1,null]}", .generation = "", .served = "1", .hip = "1", .metal = "1" }, + .{ .config = "{\"eos_token_id\":\"1\"}", .generation = "", .served = "BadEosValue", .hip = "BadEosValue", .metal = "BadEosValue" }, + .{ .config = "{\"eos_token_id\":1.0}", .generation = "", .served = "BadEosValue", .hip = "BadEosValue", .metal = "BadEosValue" }, + .{ .config = "{\"eos_token_id\":-1}", .generation = "", .served = "BadEosValue", .hip = "BadEosValue", .metal = "BadEosValue" }, + .{ .config = "{\"eos_token_id\":4294967296}", .generation = "", .served = "BadEosValue", .hip = "BadEosValue", .metal = "BadEosValue" }, + .{ .config = "{\"eos_token_id\":[1,true]}", .generation = "", .served = "BadEosValue", .hip = "BadEosValue", .metal = "BadEosValue" }, + .{ .config = "{\"eos_token_id\":10}", .generation = "", .served = "BadEos", .hip = "BadEos", .metal = "BadEos" }, + .{ .config = "{}", .generation = "{\"eos_token_id\":3}", .served = "3", .hip = "3", .metal = "3" }, + .{ .config = "{}", .generation = "{\"eos_token_id\":[9,10]}", .served = "BadEos", .hip = "BadEos", .metal = "BadEos" }, + .{ .config = "{}", .generation = "", .served = "-", .hip = "MissingEos", .metal = "MissingEos" }, + .{ .config = "{}", .generation = "{\"eos_token_id\":null}", .served = "-", .hip = "MissingEos", .metal = "MissingEos" }, +}; + +/// Ids as the fixture spells them. +fn spell(a: std.mem.Allocator, ids: []const u32) ![]const u8 { + if (ids.len == 0) return "-"; + var out: std.ArrayList(u8) = .empty; + for (ids, 0..) |id, i| try out.print(a, "{s}{d}", .{ if (i == 0) "" else ",", id }); + return out.items; +} + +/// The policy's answer as the fixture spells it. +fn answer(a: std.mem.Allocator, policy: eos.Policy, root: std.json.Value, generation: std.json.Value) ![]const u8 { + const text = if (root.object.get("text_config")) |v| v else root; + var buf: [16]u32 = undefined; + return spell(a, eos.collect(buf[0..], policy, root, text, generation, 10) catch |e| return @errorName(e)); +} + +fn parse(a: std.mem.Allocator, text: []const u8) !std.json.Value { + return if (text.len == 0) .null else std.json.parseFromSliceLeaky(std.json.Value, a, text, .{}); +} + +test "EOS policies: each fixture's ids or refusal under served, Qwen3.5 HIP and qwen27 Metal" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + for (cases) |c| { + const root = try parse(a, c.config); + const gen = try parse(a, c.generation); + errdefer std.debug.print("config {s} generation {s}\n", .{ c.config, c.generation }); + try t.expectEqualStrings(c.served, try answer(a, eos.served, root, gen)); + try t.expectEqualStrings(c.hip, try answer(a, eos.qwen35_hip, root, gen)); + try t.expectEqualStrings(c.metal, try answer(a, eos.qwen27_metal, root, gen)); + } +} + +test "EOS policies: resolve is the served policy, every malformed value named BadEos" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + for (cases) |c| { + const want = if (std.mem.eql(u8, c.served, "BadEosValue")) "BadEos" else c.served; + const ids = eos.resolve(a, try parse(a, c.config), try parse(a, c.generation), 10) catch |e| { + try t.expectEqualStrings(want, @errorName(e)); + continue; + }; + try t.expectEqualStrings(want, try spell(a, ids)); + } +} + +test "EOS policies: a source that is not an object is a malformed value under every policy" { + var buf: [8]u32 = undefined; + const root: std.json.Value = .{ .object = .empty }; + for ([_]eos.Policy{ eos.served, eos.qwen35_hip, eos.qwen27_metal }) |p| + try t.expectError(error.BadEosValue, eos.collect(&buf, p, root, root, .{ .integer = 1 }, 10)); +} diff --git a/zig/src/core/tokenizer/tokenizer.zig b/zig/src/core/tokenizer/tokenizer.zig index 3857825b194..c0b4de1583e 100644 --- a/zig/src/core/tokenizer/tokenizer.zig +++ b/zig/src/core/tokenizer/tokenizer.zig @@ -8,7 +8,7 @@ const models = @import("model.zig"); const qwen2_slow = @import("qwen2_slow.zig"); const Allocator = std.mem.Allocator; pub const Memo = @import("memo.zig").Memo; -pub const eos = @import("eos.zig"); +pub const eos = @import("checkpoint_eos"); // a shared module: std-only families read it too /// A digest of what ids mean as loaded (identity.zig): what Recall keys its record by. pub const identity = @import("identity.zig").identity; diff --git a/zig/src/cuda/affine4_kernels.zig b/zig/src/cuda/affine4_kernels.zig index 716d71a8d7b..9c3a597fdb0 100644 --- a/zig/src/cuda/affine4_kernels.zig +++ b/zig/src/cuda/affine4_kernels.zig @@ -368,7 +368,7 @@ pub const Affine4Kernels = struct { try launch_.launch(f, .{ .grid = .{ .x = u(grid), .y = 1, .z = 1 }, .block = .{ .x = threads }, .shared = smem }, s, &g); } - /// One GB10 launch over 2-4 affine-4 prompt projections, each retaining prompt()'s exact tile body. + /// One GB10 launch over 2-4 affine-4 prompt projections, with the same copies and math as prefill_kernel. pub fn promptMany(a: *const Affine4Kernels, s: Stream, x: u64, outs: []const Out, rows: usize) !void { if (!a.pdl or a.half_prompt) return error.UnsupportedPromptMany; if (outs.len < 2 or outs.len > segs_max) return error.TooManyParts; diff --git a/zig/src/cuda/kda.zig b/zig/src/cuda/kda.zig index 8592962f054..8165382757c 100644 --- a/zig/src/cuda/kda.zig +++ b/zig/src/cuda/kda.zig @@ -24,10 +24,12 @@ pub const Kernels = struct { prep: cuda.Function, step: cuda.Function, out: cuda.Function, + pdl: bool, // dependent launches (each entry opens with glm_pdl::enter()); the loader's caller opts in pub fn load(m: cuda.Module) !Kernels { var k: Kernels = undefined; inline for (.{ "chain", "replay", "replay_layers", "prep", "step", "out" }) |name| @field(k, name) = try m.function("tf_glm_kda_" ++ name); + k.pdl = false; return k; } }; @@ -63,6 +65,7 @@ pub fn chain(ks: *const Kernels, stream: cuda.Stream, c: Chain, rows: usize, s: try validate(c, rows); const h: c_int = @intCast(c.heads); if (wide) |w| { + const pdl = ks.pdl and rows < wide_rows; // a prompt chunk's chain launches plain: dependent, its first token comes later var a: cuda.Args = .{}; a.add(h); a.add(c.p); @@ -74,14 +77,14 @@ pub fn chain(ks: *const Kernels, stream: cuda.Stream, c: Chain, rows: usize, s: a.add(c.lower); for ([_]u64{ w.q, s.k, s.v, s.g, s.b }) |v| a.add(v); const grid: cuda.launch.Dim3 = .{ .x = @intCast(rows), .y = @intCast(c.heads) }; - try cuda.launch.launch(ks.prep, .{ .grid = grid, .block = .{ .x = 512 } }, stream, &a); + try cuda.launch.launch(ks.prep, .{ .grid = grid, .block = .{ .x = 512 }, .pdl = pdl }, stream, &a); var b: cuda.Args = .{}; b.add(h); for ([_]u64{ c.state_in, w.q, s.k, s.v, s.g, s.b }) |v| b.add(v); b.add(@as(c_int, @intCast(rows))); b.add(w.y); b.add(s.state_out); - try cuda.launch.launch(ks.step, .{ .grid = .{ .x = @intCast(c.heads), .y = dv / 4 / 8 }, .block = .{ .x = 8 * 32 } }, stream, &b); + try cuda.launch.launch(ks.step, .{ .grid = .{ .x = @intCast(c.heads), .y = dv / 4 / 8 }, .block = .{ .x = 8 * 32 }, .pdl = pdl }, stream, &b); var o: cuda.Args = .{}; o.add(h); o.add(w.y); @@ -90,7 +93,7 @@ pub fn chain(ks: *const Kernels, stream: cuda.Stream, c: Chain, rows: usize, s: o.add(c.norm_w); o.add(c.eps); o.add(s.out); - return cuda.launch.launch(ks.out, .{ .grid = grid, .block = .{ .x = dv } }, stream, &o); + return cuda.launch.launch(ks.out, .{ .grid = grid, .block = .{ .x = dv }, .pdl = pdl }, stream, &o); } var a: cuda.Args = .{}; a.add(h); @@ -106,7 +109,7 @@ pub fn chain(ks: *const Kernels, stream: cuda.Stream, c: Chain, rows: usize, s: a.add(c.lower); a.add(@as(c_int, @intCast(rows))); for ([_]u64{ s.out, s.state_out, s.k, s.v, s.g, s.b }) |v| a.add(v); - try cuda.launch.launch(ks.chain, .{ .grid = .{ .x = @intCast(c.heads) }, .block = .{ .x = 1024 } }, stream, &a); + try cuda.launch.launch(ks.chain, .{ .grid = .{ .x = @intCast(c.heads) }, .block = .{ .x = 1024 }, .pdl = ks.pdl }, stream, &a); } /// kda.replay: the state after the first `rows` saved rows, from state_in. @@ -117,7 +120,7 @@ pub fn replay(ks: *const Kernels, stream: cuda.Stream, state_in: u64, k: u64, v: for ([_]u64{ state_in, k, v, g, b }) |x| a.add(x); a.add(@as(c_int, @intCast(rows))); a.add(state_out); - try cuda.launch.launch(ks.replay, .{ .grid = .{ .x = @intCast(heads) }, .block = .{ .x = 1024 } }, stream, &a); + try cuda.launch.launch(ks.replay, .{ .grid = .{ .x = @intCast(heads) }, .block = .{ .x = 1024 }, .pdl = ks.pdl }, stream, &a); } /// The fixed kernel envelope; strides are elements, never bytes. Refuse before narrowing or launching. @@ -155,7 +158,7 @@ pub fn replayLayers(ks: *const Kernels, stream: cuda.Stream, s: Replay, rows: us a.add(s.b_stride); a.add(@as(c_int, @intCast(rows))); a.add(s.state_out); - try cuda.launch.launch(ks.replay_layers, .{ .grid = .{ .x = @intCast(layers * heads) }, .block = .{ .x = 1024 } }, stream, &a); + try cuda.launch.launch(ks.replay_layers, .{ .grid = .{ .x = @intCast(layers * heads) }, .block = .{ .x = 1024 }, .pdl = ks.pdl }, stream, &a); } test { diff --git a/zig/src/cuda/kda_test.zig b/zig/src/cuda/kda_test.zig index c316bca4cc6..1bbcbccf927 100644 --- a/zig/src/cuda/kda_test.zig +++ b/zig/src/cuda/kda_test.zig @@ -63,6 +63,7 @@ test "shared KDA: fused, wide, cuts and layered replay preserve every predecesso Capture.symbols = 0; const ks = try kda.Kernels.load(.{ .d = &d, .handle = null }); try std.testing.expectEqual(@as(usize, 6), Capture.symbols); + try std.testing.expect(!ks.pdl); // a default load launches plain (cuLaunchKernel, as captured below) const prev = cast(old.Kernels, ks); const s: kda.Saves = .{ .out = 0x100000001, .state_out = 0x200000002, .k = 0x300000003, .v = 0x400000004, .g = 0x500000005, .b = 0x600000006 }; const w: kda.Wide = .{ .q = 0x700000007, .y = 0x800000008 }; diff --git a/zig/src/cuda/kernels.zig b/zig/src/cuda/kernels.zig index 858f9deda06..b31b4b41419 100644 --- a/zig/src/cuda/kernels.zig +++ b/zig/src/cuda/kernels.zig @@ -114,6 +114,12 @@ pub const torch_pointwise: []const u8 = if (available) &Blob("fatbin_torch_point pub const torch_indexing: []const u8 = if (available) &Blob("fatbin_torch_indexing").bytes else &.{}; pub const torch_movement: []const u8 = if (available) &Blob("fatbin_torch_movement").bytes else &.{}; pub const torch_nemotron_constants: []const u8 = if (available) &Blob("fatbin_torch_nemotron_constants").bytes else &.{}; +pub const muse_dflash: []const u8 = if (available) &Blob("fatbin_muse_dflash").bytes else &.{}; +pub const muse_glue: []const u8 = if (available) &Blob("fatbin_muse_glue").bytes else &.{}; +pub const muse_attention: []const u8 = if (available) &Blob("fatbin_muse_attention").bytes else &.{}; +pub const muse_dflash2: []const u8 = if (available) &Blob("fatbin_muse_dflash2").bytes else &.{}; +pub const muse_experts2: []const u8 = if (available) &Blob("fatbin_muse_experts2").bytes else &.{}; +pub const muse_linear: []const u8 = if (available) &Blob("fatbin_muse_linear").bytes else &.{}; pub const nemotron_route: []const u8 = if (available) &Blob("fatbin_nemotron_route").bytes else &.{}; pub const nemotron_mamba: []const u8 = if (available) &Blob("fatbin_nemotron_mamba").bytes else &.{}; pub const nemotron_attention: []const u8 = if (available) &Blob("fatbin_nemotron_attention").bytes else &.{}; diff --git a/zig/src/cuda/memory.zig b/zig/src/cuda/memory.zig index 0363ac81eab..3685228a93e 100644 --- a/zig/src/cuda/memory.zig +++ b/zig/src/cuda/memory.zig @@ -134,12 +134,17 @@ pub const DeviceBuffer = struct { /// `len` bytes, 256-byte aligned (512 from an installed arena); zero bytes allocate nothing and hold address 0. pub fn alloc(d: *const Driver, len: usize) Error!DeviceBuffer { + return allocVia(d, len, alloc_hook); + } + + /// As alloc, through `hook` instead of the installed one (an owner's own sub-allocator; null: cuMemAlloc). + pub fn allocVia(d: *const Driver, len: usize, hook: ?Hook) Error!DeviceBuffer { try reserveAllocation(len); errdefer finishAllocation(null, len); var p: abi.DevicePtr = 0; var owner: ?Hook = null; if (len > 0) { - if (alloc_hook) |h| if (h.alloc(h.ctx, len)) |ptr| { + if (hook) |h| if (h.alloc(h.ctx, len)) |ptr| { p = ptr; owner = h; }; diff --git a/zig/src/cuda/nccl.zig b/zig/src/cuda/nccl.zig index c1248b72d71..f362f24d692 100644 --- a/zig/src/cuda/nccl.zig +++ b/zig/src/cuda/nccl.zig @@ -44,7 +44,7 @@ pub const Config = extern struct { graph_stream_ordering: c_int = std.math.minInt(c_int), }; -pub const Error = platform.optional_libraries.Failure || error{ LibraryUnavailable, MissingSymbol, NcclFailed, NcclVersion }; +pub const Error = platform.optional_libraries.Failure || platform.environment.Error || error{ LibraryUnavailable, MissingSymbol, NcclFailed, NcclVersion }; pub const in_progress: Result = 7; // ncclInProgress: a non-blocking communicator's call is still running @@ -76,8 +76,17 @@ pub const Library = struct { lib: platform.DynLib, api: Api, + /// TF_NCCL_LIB's value as the library to open: a path is kept as written; unset, empty and blank keep libnccl.so.2. + pub fn pathFrom(raw: ?[]const u8) platform.environment.Error![]const u8 { + return try platform.environment.path("TF_NCCL_LIB", raw) orelse "libnccl.so.2"; + } + + fn configuredPath() platform.environment.Error![]const u8 { + return pathFrom(platform.environment.Process.get(.{}, "TF_NCCL_LIB")); + } + pub fn open() Error!Library { - return openPath("libnccl.so.2"); + return openPath(try configuredPath()); } pub fn openPath(path: []const u8) Error!Library { @@ -145,6 +154,29 @@ pub const Library = struct { } }; +test "NCCL library: TF_NCCL_LIB overrides the default; unset and empty keep it" { + const name = "TF_NCCL_LIB"; + const saved = if (platform.getenv(name)) |v| try std.testing.allocator.dupeSentinel(u8, v, 0) else null; + defer if (saved) |v| { + _ = platform.env.setenv(name, v, 1); + std.testing.allocator.free(v); + } else { + _ = platform.env.unsetenv(name); + }; + try std.testing.expectEqual(@as(c_int, 0), platform.env.unsetenv(name)); + try std.testing.expectEqualStrings("libnccl.so.2", try Library.configuredPath()); + try std.testing.expectEqual(@as(c_int, 0), platform.env.setenv(name, "/fixture/nccl/libnccl.so.2", 1)); + try std.testing.expectEqualStrings("/fixture/nccl/libnccl.so.2", try Library.configuredPath()); + try std.testing.expectEqual(@as(c_int, 0), platform.env.setenv(name, " ./nccl/libnccl.so.2 ", 1)); + try std.testing.expectEqualStrings(" ./nccl/libnccl.so.2 ", try Library.configuredPath()); + try std.testing.expectEqual(@as(c_int, 0), platform.env.setenv(name, "", 1)); + try std.testing.expectEqualStrings("libnccl.so.2", try Library.configuredPath()); + try std.testing.expectEqual(@as(c_int, 0), platform.env.setenv(name, "libnccl.so.2\n", 1)); + try std.testing.expectError(error.InvalidEnvironment, Library.open()); + try std.testing.expectEqual(@as(c_int, 0), platform.env.setenv(name, " \t", 1)); + try std.testing.expectEqualStrings("libnccl.so.2", try Library.configuredPath()); +} + test "nonblocking communicator config preserves the public ABI defaults" { const c: Config = .{}; try std.testing.expectEqual(@as(usize, 96), @sizeOf(Config)); diff --git a/zig/src/cuda/proposal_head_test.zig b/zig/src/cuda/proposal_head_test.zig index fc404f8407d..7c6f817bbb6 100644 --- a/zig/src/cuda/proposal_head_test.zig +++ b/zig/src/cuda/proposal_head_test.zig @@ -81,6 +81,7 @@ test "proposal rows: qlinear packs exact selected BF16 bits and full view launch d.api.cuLaunchKernel = Trace.launch; var lane: qmmf.Lane = undefined; lane.clusters = false; + lane.pdl = false; for (&lane.fns) |*set| { for (set, 0..) |*f, i| f.* = Trace.function(&d, i + 1); } diff --git a/zig/src/cuda/qmmf.zig b/zig/src/cuda/qmmf.zig index 559f8db0998..5a5269ff9a8 100644 --- a/zig/src/cuda/qmmf.zig +++ b/zig/src/cuda/qmmf.zig @@ -189,6 +189,7 @@ pub const Lane = struct { prompt_k32: ?[2]Function = null, // Out; unsplit BF16 prompt calls, loadPrompt() fills it on sm_12x prompt_sms: usize = 0, // the device's SMs: the tile runs when its blocks fill more than half of them clusters: bool, // sm_90 on: slices meet in a cluster's shared memory + pdl: bool = false, // decode launches dependent (qmmf_kernel waits after its weight loads); weights fixed after load pub fn load(d: *const Driver, capability_major: u32) !Lane { if (!kernels.available) return error.BuiltWithoutKernels; @@ -307,6 +308,7 @@ pub const Lane = struct { .block = .{ .x = if (prompt) 256 else threads, .y = 1, .z = 1 }, .shared = if (k32) prompt_k32_shared else if (prompt) prompt_shared else if (half) halfShared(w.mode) else sharedBytes(w.mode, p.bm), .cluster = if (p.cluster) .{ .x = 1, .y = 1, .z = p.sk } else null, + .pdl = l.pdl and !prompt, // the prompt entries do not wait }, s, &args); if (p.reduce) { const total: usize = m * w.n; @@ -319,6 +321,7 @@ pub const Lane = struct { try launch_.launch(l.reduce[@backingInt(out)], .{ .grid = .{ .x = @intCast((total + 255) / 256), .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 }, + .pdl = l.pdl, }, s, &r); } } @@ -517,6 +520,42 @@ test "prompt dispatch changes CTA geometry and output instance without changing try std.testing.expectEqual(@as(i32, 4), Trace.sk); } +test "a dependent lane launches its decode tile and reduce dependent, its prompt tile plain" { + const Seen = struct { + var plain: usize = 0; + var dependent: usize = 0; + fn run(_: abi.Function, _: c_uint, _: c_uint, _: c_uint, _: c_uint, _: c_uint, _: c_uint, _: c_uint, _: abi.Stream, _: ?[*]?*anyopaque, _: ?[*]?*anyopaque) callconv(.c) abi.Result { + plain += 1; + return abi.success; + } + fn ex(c: *const abi.LaunchConfig, _: abi.Function, _: ?[*]?*anyopaque, _: ?[*]?*anyopaque) callconv(.c) abi.Result { + if (c.attrs) |attrs| for (attrs[0..c.num_attrs]) |at| if (at.id == .programmatic_stream_serialization and at.value.int == 1) { + dependent += 1; + return abi.success; + }; + plain += 1; + return abi.success; + } + }; + var d: Driver = .{ .lib = undefined, .api = undefined }; + d.api.cuLaunchKernel = Seen.run; + d.api.cuLaunchKernelEx = Seen.ex; + const f: Function = .{ .d = &d, .handle = @ptrFromInt(10) }; + var lane: Lane = .{ .mod = undefined, .fns = @splat(@splat(f)), .f32_fns = @splat(@splat(f)), .reduce = @splat(f), .half = @splat(@splat(@splat(f))), .half_below = 0, .prompt = .{ .{ f, f }, .{ f, f } }, .prompt_k32 = .{ f, f }, .clusters = false, .pdl = true }; + const s: Stream = .{ .d = &d, .handle = null }; + const w = try pinned(Weight{ .mode = .bf16, .codes = 0, .scales = 0, .n = 2560, .k = 6144, .npad = 2560 }, 4); + try lane.matmulOut(s, 0, w.k, 1, w, 0, .bf16, 0x1000); // a decode row: the 16-row tile's 4 slices, then their reduce + try std.testing.expectEqual(@as(usize, 2), Seen.dependent); + try std.testing.expectEqual(@as(usize, 0), Seen.plain); + try lane.matmulOut(s, 0, w.k, 4218, w, 0, .bf16, 0x1000); // the prompt tile does not wait: plain + try std.testing.expectEqual(@as(usize, 2), Seen.dependent); + try std.testing.expectEqual(@as(usize, 1), Seen.plain); + lane.pdl = false; + try lane.matmulOut(s, 0, w.k, 1, w, 0, .bf16, 0x1000); + try std.testing.expectEqual(@as(usize, 2), Seen.dependent); + try std.testing.expectEqual(@as(usize, 3), Seen.plain); +} + test "a cut weight pinned to the whole weight's K slices plans as the whole one at every row count" { const whole: Weight = .{ .mode = .bf16, .codes = 0, .scales = 0, .n = 16480, .k = 2560, .npad = 16512 }; var cut = whole; diff --git a/zig/src/cuda/qmmf_shared.zig b/zig/src/cuda/qmmf_shared.zig index 9b5ce784d58..c8812213db9 100644 --- a/zig/src/cuda/qmmf_shared.zig +++ b/zig/src/cuda/qmmf_shared.zig @@ -52,6 +52,7 @@ test "shared down stride: geometry, output address and stride match the contiguo d.api.cuLaunchKernel = Mock.run; var l: q.Lane = undefined; l.clusters = true; + l.pdl = false; l.half_below = 96; for (&l.shared_down, 0..) |*f, i| f.* = .{ .d = &d, .handle = @ptrFromInt(101 + i) }; const s: Stream = .{ .d = &d, .handle = null }; diff --git a/zig/src/cuda_dense/device_fail_test.zig b/zig/src/cuda_dense/device_fail_test.zig index 6bfba6aa0e0..49d947d6274 100644 --- a/zig/src/cuda_dense/device_fail_test.zig +++ b/zig/src/cuda_dense/device_fail_test.zig @@ -134,6 +134,7 @@ const tiny: Geometry = .{ .hidden = 256, .layers = 2, .heads = 4, .kv_heads = 2, pub fn lane() cuda.qmmf.Lane { var l: cuda.qmmf.Lane = undefined; l.clusters = false; // partBytes reads the tile plan alone + l.pdl = false; return l; } diff --git a/zig/src/fabric/tp/config.zig b/zig/src/fabric/tp/config.zig index 0771cef1c6a..b34309164c5 100644 --- a/zig/src/fabric/tp/config.zig +++ b/zig/src/fabric/tp/config.zig @@ -2,6 +2,7 @@ const std = @import("std"); const log = @import("log.zig"); const graph_cache = @import("cuda").graph_cache; +const nccl = @import("cuda").nccl; pub const Backend = enum { /// NCCL for everything (the default). @@ -116,7 +117,7 @@ pub const Config = struct { if (get("TF_TP_FAILFAST")) |v| c.failfast = !(std.mem.eql(u8, v, "0") or std.mem.eql(u8, v, "off")); c.grace_ns = try seconds(get, "TF_TP_FAILFAST_GRACE_S", 1.0, 0, 60); c.report_ns = try seconds(get, "TF_TP_PEER_MEM_S", 0.5, 0.01, 60); - if (get("TF_NCCL_LIB")) |p| c.nccl_lib = p; + c.nccl_lib = nccl.Library.pathFrom(get("TF_NCCL_LIB")) catch return error.BadSetting; c.roce_hca = get("TF_TP_ROCE_HCA"); c.link = get("TF_TP_LINK"); c.roce_hcas = try int(u8, get, "TF_TP_ROCE_HCAS", 2, 1, 2); @@ -265,6 +266,15 @@ test "defaults: the plan link 7 ports past the rendezvous, NCCL, fail-fast on" { try std.testing.expectEqual(std.time.ns_per_s / 2, c.report_ns); } +test "TF_NCCL_LIB follows the loader's rule: a path is kept, blank keeps libnccl.so.2, a control byte is refused" { + Fake.pairs = &.{.{ "TF_NCCL_LIB", "/fixture/nccl/libnccl.so.2" }}; + try std.testing.expectEqualStrings("/fixture/nccl/libnccl.so.2", (try Config.parse(&Fake.get)).nccl_lib); + Fake.pairs = &.{.{ "TF_NCCL_LIB", " \t" }}; + try std.testing.expectEqualStrings("libnccl.so.2", (try Config.parse(&Fake.get)).nccl_lib); + Fake.pairs = &.{.{ "TF_NCCL_LIB", "libnccl.so.2\n" }}; + try std.testing.expectError(error.BadSetting, Config.parse(&Fake.get)); +} + test "bad settings are refused and the digest ignores the rank" { Fake.pairs = &.{.{ "TF_TP_RANK", "2" }}; try std.testing.expectError(error.BadSetting, Config.parse(&Fake.get)); diff --git a/zig/src/families/deepseek_v41/draft/lane_steps.zig b/zig/src/families/deepseek_v41/draft/lane_steps.zig new file mode 100644 index 00000000000..c7feb7de614 --- /dev/null +++ b/zig/src/families/deepseek_v41/draft/lane_steps.zig @@ -0,0 +1,35 @@ +//! Backend.prefill_step over a target's begin / piece / finish (Options.steps): the lane host's rounds between steps. +const lanes = @import("lanes"); +const ln = @import("lanes.zig"); +const Stream = lanes.Stream; + +/// A prompt step: begun on the first call, a piece of the step's rows while more are left, else `finish` on the rest. +pub fn prefillStep(ptr: *anyopaque, s: *Stream, max_rows: u32) anyerror!bool { + const x: *ln.Lanes = @ptrCast(@alignCast(ptr)); + const st = x.state(s) orelse try begin(x, s); + // a failed step frees the slot here: the target abandons the prompt, the lane goes back to the free list + errdefer ln.Lanes.release(x, s); + if (s.isCancelled()) return error.Cancelled; + const ids = s.prompt(); + const rows: u64 = @max(1, if (max_rows > 0) max_rows else x.opts.step_rows); + try x.settle(); + if (ids.len - st.len > rows) { + try x.target.piece(st.slot, ids, st.len, st.len + rows, false); + st.len += rows; + s.fill_at.store(@intCast(st.len), .monotonic); + return false; + } + try x.finished(st, ids, try x.target.finish(st.slot, ids, s.sampling, ids.len)); + s.fill_at.store(@intCast(ids.len), .monotonic); + return true; +} + +/// The stream's slot and target prompt begun: its rows held so far are the kept ones the target restored. +fn begin(x: *ln.Lanes, s: *Stream) !*ln.St { + const b = try ln.Lanes.begin(x, s); + s.cached = @intCast(b.cached); + const st = x.state(s).?; + st.len = b.cached; + s.fill_at.store(@intCast(b.cached), .monotonic); + return st; +} diff --git a/zig/src/families/deepseek_v41/draft/lanes.zig b/zig/src/families/deepseek_v41/draft/lanes.zig index 70d176a0656..0388fcd0f1b 100644 --- a/zig/src/families/deepseek_v41/draft/lanes.zig +++ b/zig/src/families/deepseek_v41/draft/lanes.zig @@ -24,6 +24,8 @@ pub const Options = struct { slots: u32 = 4, // streams at once spec: spec_mod.Settings = .{}, // the speculative pass (TF_DSV41_SPEC_DRAFT / _SPEC_NUCLEUS) plain_streams_default: usize = 0, // depth.plain_streams when TF_DSV41_DRAFT_PLAIN_STREAMS is unset + steps: bool = false, // prompts a step at a time between rounds (lane_steps.zig), for a target with pieces + step_rows: u32 = 0, // a step's rows when the host sets no cap (the target's prompt chunk) }; /// A stream's slot and what the backend holds for it between rounds. @@ -83,6 +85,7 @@ pub const Lanes = struct { pub fn backend(x: *Lanes) be.Backend { const pieces = x.target.pieces(); + if (pieces and x.opts.steps) return .{ .ptr = x, .vtable = &vtable_steps, .chunk_invariant = true }; return .{ .ptr = x, .vtable = if (pieces) &vtable_pieces else &vtable }; } @@ -98,6 +101,13 @@ pub const Lanes = struct { v.finals = roundFinals; break :blk v; }; + /// Options.steps: the lane host fills prompts a step at a time over the pieces, other streams' rounds between + const vtable_steps: be.Backend.VTable = blk: { + var v = vtable_pieces; + v.prefill_step = @import("lane_steps.zig").prefillStep; + v.reports_fill = true; + break :blk v; + }; /// The speculative pass's counts on stderr when it is on (the gates' and the server's line). pub fn reportSpec(x: *const Lanes) void { @@ -188,7 +198,7 @@ pub const Lanes = struct { } /// A prompt in pieces (lane_host.zig `Rounds`): new slot, drafter context and depth reset, target admits/restores. - fn begin(ptr: *anyopaque, s: *Stream) anyerror!be.Backend.Begun { + pub fn begin(ptr: *anyopaque, s: *Stream) anyerror!be.Backend.Begun { const x = self(ptr); if (x.streams.get(s) != null) return error.StreamLive; @import("lane_retire.zig").recover(x); @@ -268,7 +278,7 @@ pub const Lanes = struct { return true; } - fn finished(x: *Lanes, st: *St, ids: []const u32, first_: u32) !void { + pub fn finished(x: *Lanes, st: *St, ids: []const u32, first_: u32) !void { st.first = first_; st.len = ids.len; _ = x.scratch.reset(.retain_capacity); @@ -557,7 +567,7 @@ pub const Lanes = struct { return st.n > 0; } - fn release(ptr: *anyopaque, s: *Stream) void { + pub fn release(ptr: *anyopaque, s: *Stream) void { const x = self(ptr); const kv = x.streams.fetchRemove(s) orelse return; const st = kv.value; diff --git a/zig/src/families/deepseek_v41/metal/boot.zig b/zig/src/families/deepseek_v41/metal/boot.zig index bdd3e60e783..80a1f863fb3 100644 --- a/zig/src/families/deepseek_v41/metal/boot.zig +++ b/zig/src/families/deepseek_v41/metal/boot.zig @@ -8,6 +8,7 @@ const dspark = @import("dspark.zig"); const rope = @import("rope.zig"); const scratch = @import("scratch.zig"); const forward = @import("forward.zig"); +const round_prof = @import("round_prof.zig"); const serve = @import("serve.zig"); const target_ = @import("target.zig"); @@ -30,8 +31,22 @@ pub const Options = struct { small: bool = false, /// Engram row shards (null: TF_DSV41_ENGRAM_DIR, else the config's engram_table_dir beside the checkpoint) engram_dir: ?[]const u8 = null, + /// prompts a chunk at a time between the other streams' rounds (serve.Options.steps) + steps: bool = false, + /// --decode-share (serve.Options.decode_share) + decode_share: ?f64 = null, }; +/// The family's queue: Metal 4 under TF_METAL4=1, or by default when `metal4` holds, else Metal 3; the same kernels. +pub fn openQueue(device: mtl.Device, metal4: bool) !mtl.Queue { + if (!try environment.read(bool, "TF_METAL4", metal4)) return device.queue(); + if (device.queue4()) |q| { + std.log.info("dsv41 metal: Metal 4 command queue", .{}); + return q; + } else |_| std.log.warn("dsv41 metal: TF_METAL4=1 but this Mac has no Metal 4 queue; Metal 3 it is", .{}); + return device.queue(); +} + /// Everything a served model borrows, owned here and closed after the model's target and pass. pub const Boot = struct { a: Allocator, @@ -61,7 +76,7 @@ pub const Boot = struct { const limit: u32 = @intCast(@min(o.context orelse 262144, c.rope.max_positions)); b.device = try mtl.Device.init(); errdefer b.device.deinit(); - b.queue = try b.device.queue(); + b.queue = try openQueue(b.device, b.device.hasMetal4()); errdefer b.queue.deinit(); b.p = try pipelines.Pipelines.load(a, b.device, c); errdefer b.p.deinit(); @@ -80,7 +95,7 @@ pub const Boot = struct { const r = b.w.report(); std.log.info("dsv41 metal: {d} layers, {d} shards ({d} MiB mapped, {d} MiB copied), {d} slots of {d} positions, DSpark {s}", .{ c.layers, r.shards, r.shard_bytes >> 20, r.arena_bytes >> 20, o.slots, limit, if (b.ds != null) "on" else "off" }); const env: target_.Env = .{ .device = b.device, .queue = b.queue, .c = c, .p = &b.p, .tables = &b.tables, .s = &b.s, .model = b.w.view(), .lookup = lookup }; - return serve.Metal.open(a, .{ .env = env, .top = &b.w.top, .dspark = if (b.ds) |*w| w else null, .owner = .{ .ctx = b, .close = close }, .resident = if (b.w.resident) |*wr| wr else null }, .{ .slots = o.slots, .limit = limit, .drafts = o.drafts, .cache_bytes = o.cache_bytes }); + return serve.Metal.open(a, .{ .env = env, .top = &b.w.top, .dspark = if (b.ds) |*w| w else null, .owner = .{ .ctx = b, .close = close }, .resident = if (b.w.resident) |*wr| wr else null }, .{ .slots = o.slots, .limit = limit, .drafts = o.drafts, .cache_bytes = o.cache_bytes, .steps = o.steps, .decode_share = o.decode_share }); } fn readConfig(a: Allocator, io: std.Io, dir: []const u8, small: bool) !Config { @@ -153,6 +168,7 @@ pub const Boot = struct { if (b.ds) |*w| w.deinit(); b.w.deinit(); b.p.deinit(); + round_prof.forget(); b.queue.deinit(); b.device.deinit(); b.a.destroy(b); diff --git a/zig/src/families/deepseek_v41/metal/csa2_attn.zig b/zig/src/families/deepseek_v41/metal/csa2_attn.zig index 9351a7c3d96..1664cb7041d 100644 --- a/zig/src/families/deepseek_v41/metal/csa2_attn.zig +++ b/zig/src/families/deepseek_v41/metal/csa2_attn.zig @@ -7,12 +7,12 @@ pub const head_dim = 512; pub const window = 128; pub const max_selected = 512; pub const rope_dims = 64; -/// Heads a simdgroup carries, and the groups of the two launch shapes. +/// Heads a simdgroup carries (decode, prompt), and the groups of the two launch shapes. pub const heads_per_sg = 1; +pub const prompt_heads_per_sg = 2; pub const chunks = 5; pub const prompt_rows = 2; pub const prompt_head_groups = 4; -pub const prompt_tile = 16; pub const Ref = struct { buf: mtl.Buffer, off: usize = 0 }; pub const Out = enum { f32, bf16 }; @@ -91,6 +91,6 @@ pub fn encodePrompt(p: *const Pipelines, e: mtl.ComputeEncoder, b: Bind, c: Call try check(c); e.setPipeline(p.pre[@backingInt(c.out)]); bind(e, b, c); - const per = heads_per_sg * prompt_head_groups; + const per = prompt_heads_per_sg * prompt_head_groups; e.dispatchGroups(mtl.Size.of((c.rows + prompt_rows - 1) / prompt_rows, (c.heads + per - 1) / per, 1), mtl.Size.of(32 * prompt_rows * prompt_head_groups, 1, 1)); } diff --git a/zig/src/families/deepseek_v41/metal/entry.zig b/zig/src/families/deepseek_v41/metal/entry.zig index 9efb4f120e8..b244bb199fd 100644 --- a/zig/src/families/deepseek_v41/metal/entry.zig +++ b/zig/src/families/deepseek_v41/metal/entry.zig @@ -9,6 +9,8 @@ const env = @import("sys").environment; const Allocator = std.mem.Allocator; pub const backends: []const []const u8 = &.{"metal"}; +/// This family submits through Metal 4 (where the Mac has it): the server compiles the wrapper's Metal 4 path in. +pub const metal4 = true; pub const families: []const api.Family = &.{.{ .model_type = "deepseek_v41", .formats = &.{"fp8"}, .raw_text = false }}; pub fn chip(_: Allocator) ?[]const u8 { @@ -25,12 +27,22 @@ pub fn open(a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]c problem.* = try std.fmt.allocPrint(a, "this build serves deepseek_v41 checkpoints only, not {s}", .{o.model_type}); return null; } + // --decode-share above 0 asks for replies beside prompts (prompts in steps); a malformed setting is refused by name + const steps = serve_lanes.stepsFor(o.decode_share) catch |e| { + problem.* = switch (e) { + error.BadDecodeShare => try std.fmt.allocPrint(a, "--decode-share {d}: expected a share from 0 to under 1", .{o.decode_share.?}), + else => try env.describe(a, "TF_DSV41_PREFILL_PIECES", env.Process.get(.{}, "TF_DSV41_PREFILL_PIECES") orelse ""), + }; + return null; + }; const opts: pkg.boot.Options = .{ .slots = @max(1, @min(o.lanes, 16)), .context = if (o.context) |c| @intCast(@max(c, 1)) else null, .drafts = o.drafts, .cache_bytes = if (o.prompt_cache_gib) |g| @intFromFloat(@max(g, 0) * (1 << 30)) else 4 << 30, .small = try env.read(bool, "TF_DSV41_SMALL", false), + .steps = steps, + .decode_share = o.decode_share, }; const m = pkg.boot.Boot.open(gpa, io, o.dir, opts) catch |e| { problem.* = try std.fmt.allocPrint(a, "the DeepSeek-V4.1 Metal engine cannot load {s} ({s})", .{ o.dir, @errorName(e) }); diff --git a/zig/src/families/deepseek_v41/metal/forward.zig b/zig/src/families/deepseek_v41/metal/forward.zig index 622ec616b42..55a4bbda3b8 100644 --- a/zig/src/families/deepseek_v41/metal/forward.zig +++ b/zig/src/families/deepseek_v41/metal/forward.zig @@ -12,6 +12,7 @@ const Ctx = ctx_.Ctx; const Ref = ctx_.Ref; const g = pipelines.glue; const cl = @import("calls.zig"); +const round_prof = @import("round_prof.zig"); const eng = pipelines.engram; const cv = ctx_.cv; const R = pipelines.max_rows; @@ -215,6 +216,9 @@ pub fn run(x: *const Ctx, q: mtl.Queue, m: Model, b: *const Bufs) !void { var cbs: [max_buffers]mtl.CommandBuffer = undefined; var n: usize = 0; defer for (cbs[0..n]) |cb| cb.release(); + const t0 = round_prof.begin(); + var name: [24]u8 = undefined; + q.roundBegin(std.fmt.bufPrint(&name, "decode {d} rows", .{x.rows}) catch "decode"); var lo: usize = 0; while (true) { const hi = chunkEnd(lo, m.layers.len); @@ -234,6 +238,8 @@ pub fn run(x: *const Ctx, q: mtl.Queue, m: Model, b: *const Bufs) !void { lo = hi; } cbs[n - 1].wait(); + q.roundEnd(); + if (t0) |t| round_prof.end(t, x.rows, cbs[0], cbs[n - 1]); for (cbs[0..n]) |cb| if (cb.failure()) |msg| { std.debug.print("dsv41 metal window failed: {s}\n", .{msg}); return error.CommandBufferFailed; diff --git a/zig/src/families/deepseek_v41/metal/metal.zig b/zig/src/families/deepseek_v41/metal/metal.zig index 619936fbf58..ec28981e711 100644 --- a/zig/src/families/deepseek_v41/metal/metal.zig +++ b/zig/src/families/deepseek_v41/metal/metal.zig @@ -17,6 +17,7 @@ pub const attn = @import("attn.zig"); pub const indexer = @import("indexer.zig"); pub const moe = @import("moe.zig"); pub const forward = @import("forward.zig"); +pub const round_prof = @import("round_prof.zig"); pub const prompt = @import("prompt.zig"); pub const prompt_layer = @import("prompt_layer.zig"); pub const prompt_scratch = @import("prompt_scratch.zig"); diff --git a/zig/src/families/deepseek_v41/metal/prompt.zig b/zig/src/families/deepseek_v41/metal/prompt.zig index a2b426881e1..d88d916385d 100644 --- a/zig/src/families/deepseek_v41/metal/prompt.zig +++ b/zig/src/families/deepseek_v41/metal/prompt.zig @@ -76,12 +76,16 @@ pub fn check(c: *const Config) !u32 { /// Where a prompt's encoder time went: host fills, host encoding, host waits, GPU time (TF_DSV41_PROMPT_PROF). pub const Prof = struct { prep_ns: u64 = 0, enc_ns: u64 = 0, stall_ns: u64 = 0, gpu_s: f64 = 0, chunks: u32 = 0 }; -fn now() u64 { +/// The monotonic clock in ns (the prompt's profile and wall time). +pub fn now() u64 { var t: std.c.timespec = undefined; _ = std.c.clock_gettime(.MONOTONIC, &t); return @as(u64, @intCast(t.sec)) * std.time.ns_per_s + @as(u64, @intCast(t.nsec)); } +/// A chunk's inputs prepared ahead into input set `set`: the tail (slot) they are for and the chunk's rows. +const Stage = struct { tail: *const Tail, a: u32, b: u32, set: usize }; + pub const Prompt = struct { o: Opts, d: u32, @@ -94,6 +98,10 @@ pub const Prompt = struct { head: u32 = 0, taps: u32 = 0, prof: Prof = .{}, + /// the next chunk's inputs an `encode` that stopped short of the prompt's end prepared for the next call + stage: ?Stage = null, + /// calls whose first chunk's inputs the previous call prepared (`stage`) + stage_hits: u64 = 0, pub fn init(device: mtl.Device, c: *const Config, o: Opts, limit: u32) !Prompt { const d = try check(c); @@ -112,16 +120,29 @@ pub const Prompt = struct { /// The whole prompt: positions [tail.end, hist.len) through the encoder, then the decoder's cone and the head. pub fn run(p: *Prompt, env: Env, slot: *const kv.Slot, tail: *Tail, hist: []const u32) !void { p.prof = .{}; + p.stage = null; const t0 = now(); try p.encode(env, slot, tail, hist, @intCast(hist.len)); try p.finish(env, slot, tail); + p.report(hist.len, now() - t0); + } + + /// The prompt's encoder profile and wall time on the log when TF_DSV41_PROMPT_PROF is set. + pub fn report(p: *const Prompt, rows: usize, wall_ns: u64) void { if (std.c.getenv("TF_DSV41_PROMPT_PROF") == null) return; const ms = struct { fn of(ns: u64) f64 { return @as(f64, @floatFromInt(ns)) / 1e6; } }.of; - std.log.scoped(.dsv41).info("prompt {d} rows: {d:.0} ms, encoder {d} chunks: gpu {d:.0} ms, host fill {d:.0} ms, host encode {d:.0} ms, host wait {d:.0} ms", .{ hist.len, ms(now() - t0), p.prof.chunks, p.prof.gpu_s * 1e3, ms(p.prof.prep_ns), ms(p.prof.enc_ns), ms(p.prof.stall_ns) }); + std.log.scoped(.dsv41).info("prompt {d} rows: {d:.0} ms, encoder {d} chunks: gpu {d:.0} ms, host fill {d:.0} ms, host encode {d:.0} ms, host wait {d:.0} ms", .{ rows, ms(wall_ns), p.prof.chunks, p.prof.gpu_s * 1e3, ms(p.prof.prep_ns), ms(p.prof.enc_ns), ms(p.prof.stall_ns) }); + } + + /// The prepared next chunk is dropped if it was `tail`'s (that slot's prompt ended or restarts). + pub fn forget(p: *Prompt, tail: *const Tail) void { + if (p.stage) |st| if (st.tail == tail) { + p.stage = null; + }; } /// Encoder chunks over [tail.end, upto): the next chunk fills ahead; an unstaged one between its command buffers. @@ -129,6 +150,13 @@ pub const Prompt = struct { if (upto > hist.len or upto < tail.end) return error.BadRows; var cur: usize = 0; var staged = false; + if (p.stage) |st| if (st.tail == tail and st.a == tail.end and tail.end < upto and st.b == try p.chunkEnd(tail.end, upto)) { + cur = st.set; + staged = true; + p.stage_hits += 1; + }; + p.stage = null; + const from = tail.end; while (tail.end < upto) { const a = tail.end; const b = try p.chunkEnd(a, upto); @@ -142,8 +170,12 @@ pub const Prompt = struct { var ch = try p.encoderChunk(env, slot, tail, a, b, cur, late); p.prof.enc_ns += (now() - te) - (p.prof.prep_ns - filled); var ahead: anyerror!void = {}; - if (b < upto) { - if (p.chunkEnd(b, upto)) |nb| { + // the next chunk of this call, else the next call's first, that call taking as many rows as this one + const lim: u32 = if (b < upto) upto else @intCast(@min(hist.len, b + (upto - from))); + var nb: u32 = b; + if (b < lim) { + if (p.chunkEnd(b, lim)) |e| { + nb = e; ahead = p.prepTimed(env, hist, b, nb, 1 - cur); staged = true; } else |err| ahead = err; @@ -156,6 +188,7 @@ pub const Prompt = struct { p.prof.chunks += 1; tail.end = b; try ahead; + if (b == upto and nb > b) p.stage = .{ .tail = tail, .a = b, .b = nb, .set = 1 - cur }; cur = 1 - cur; } } diff --git a/zig/src/families/deepseek_v41/metal/prompt_steps.zig b/zig/src/families/deepseek_v41/metal/prompt_steps.zig new file mode 100644 index 00000000000..c46eae55d28 --- /dev/null +++ b/zig/src/families/deepseek_v41/metal/prompt_steps.zig @@ -0,0 +1,81 @@ +//! A prompt in pieces between other slots' rounds (iface.Target begin / piece / finish) over the whole-prompt path. +const std = @import("std"); +const host = @import("dsv41"); +const target_ = @import("target.zig"); +const prompt = @import("prompt.zig"); + +const iface = host.iface; +const lanes = host.lanes; +const Target = target_.Target; +const Slot = target_.Slot; + +/// The slot cleared or a kept state restored, as `prefill` starts; rows from `at` follow in pieces, then `finish`. +pub fn begin(ptr: *anyopaque, slot: u32, ids: []const u32) anyerror!iface.Target.Begun { + const t = Target.self(ptr); + const st = try t.startPrompt(slot, ids); + const s = st.s; + if (st.hit) |e| if (e.ids.len == ids.len) { + s.hit.clearRetainingCapacity(); + try s.hit.appendSlice(t.a, e.logits.?); + s.hit_on = true; + }; + // the profile (TF_DSV41_PROMPT_PROF) counts every prompt's encoder chunks from here to this one's `finish` + t.pr.prof = .{}; + s.began = prompt.now(); + s.mark = t.stats.launches; + s.filling = true; + return .{ .at = s.resumed }; +} + +/// Prompt rows [start, end) through the encoder (its chunks from the begun position); the cone waits for `finish`. +pub fn piece(ptr: *anyopaque, slot: u32, ids: []const u32, start: u64, end: u64, save: bool) anyerror!void { + const t = Target.self(ptr); + const s = try begun(t, slot, ids); + errdefer abandon(t, s); + // a piece's end is never kept: a kept entry holds a state with the decoder's cone run (keepAt, `finish`) + if (start == end and save and start == s.tail.end) return; + if (start != s.tail.end or end <= start or end >= ids.len) return error.NotAChain; + if (start > s.resumed) t.stats.most_between = @max(t.stats.most_between, t.stats.launches - s.mark); + // the shorter states `prefill` keeps as the prompt passes them (Target.keepPoints), kept as the pieces pass them + for (t.keepPoints(s.hist.items, s.resumed)) |k| if (k > s.tail.end and k <= end) try t.keepAt(s, k); + t.pr.encode(t.promptEnv(), &s.kv, &s.tail, s.hist.items, @intCast(end)) catch |e| return t.fail(e); + t.stats.pieces += 1; + s.mark = t.stats.launches; +} + +/// The rows the pieces left, the decoder's cone once over the prompt's end, then `prefill`'s choice and keep. +pub fn finish(ptr: *anyopaque, slot: u32, ids: []const u32, smp: ?lanes.Sampling, draw: u64) anyerror!u32 { + const t = Target.self(ptr); + const s = try begun(t, slot, ids); + errdefer abandon(t, s); + const n: u32 = @intCast(ids.len); + if (s.hit_on) { + s.filling = false; + return t.endPrompt(s, s.hit.items, smp, draw); + } + for (t.keepPoints(s.hist.items, s.resumed)) |k| if (k > s.tail.end) try t.keepAt(s, k); + const env = t.promptEnv(); + t.pr.encode(env, &s.kv, &s.tail, s.hist.items, n) catch |e| return t.fail(e); + t.pr.finish(env, &s.kv, &s.tail) catch |e| return t.fail(e); + t.pr.report(n - s.resumed, prompt.now() - s.began); + s.filling = false; + return t.endPrompt(s, null, smp, draw); +} + +/// The slot's begun prompt, refused unless `ids` are the ones it began with. +fn begun(t: *Target, slot: u32, ids: []const u32) !*Slot { + if (slot >= t.slots.len) return error.NoSlot; + const s = &t.slots[slot]; + if (!s.filling) return error.NotBegun; + if (ids.len != s.hist.items.len) return error.NotAChain; + return s; +} + +/// A begun prompt ends unfinished (released, cancelled or failed): nothing of it is kept, the slot is free again. +pub fn abandon(t: *Target, s: *Slot) void { + t.pr.forget(&s.tail); + s.filling = false; + s.hit_on = false; + s.whole = false; + t.stats.abandoned += 1; +} diff --git a/zig/src/families/deepseek_v41/metal/round_prof.zig b/zig/src/families/deepseek_v41/metal/round_prof.zig new file mode 100644 index 00000000000..6d215bd011c --- /dev/null +++ b/zig/src/families/deepseek_v41/metal/round_prof.zig @@ -0,0 +1,66 @@ +//! TF_DSV41_ROUND_PROF=1: decode rounds' host (encode to last wait) and GPU milliseconds by rows, logged now and then. +const std = @import("std"); +const mtl = @import("metal"); + +const Sum = struct { n: u64 = 0, host: f64 = 0, gpu: f64 = 0, timed: u64 = 0 }; +const every = 1024; + +var state: enum { unread, off, on } = .unread; +var sums: [17]Sum = @splat(.{}); +var rounds: u64 = 0; + +/// The host clock at a round's start, or null when off. +pub fn begin() ?f64 { + if (state == .unread) state = if (@import("sys").environment.read(bool, "TF_DSV41_ROUND_PROF", false) catch false) .on else .off; + return if (state == .on) mtl.clock.seconds() else null; +} + +/// Metal 4 reports a command buffer's GPU times after its wait returns: a round's are read at the next round's end. +var pending: ?struct { first: mtl.CommandBuffer, last: mtl.CommandBuffer, rows: u32 } = null; + +/// A round of `rows` rows from `t0`, its command buffers' first and last. +pub fn end(t0: f64, rows: u32, first: mtl.CommandBuffer, last: mtl.CommandBuffer) void { + const s = &sums[@min(rows, sums.len - 1)]; + s.n += 1; + s.host += mtl.clock.seconds() - t0; + if (pending) |p| gpu(p.rows, p.first, p.last); + pending = null; + if (first.m4 != null) pending = .{ .first = first, .last = last, .rows = rows } else gpu(rows, first, last); + rounds += 1; + if (rounds % every == 0) log(); +} + +/// Reads and drops the pending round while its queue lives: an engine calls this before closing the queue. +pub fn forget() void { + if (pending) |p| gpu(p.rows, p.first, p.last); + pending = null; +} + +/// Whether a round's buffers wait to be read (tests). +pub fn holding() bool { + return pending != null; +} + +/// Turns the profiler on or off without the environment (tests). +pub fn force(on: bool) void { + state = if (on) .on else .off; +} + +fn gpu(rows: u32, first: mtl.CommandBuffer, last: mtl.CommandBuffer) void { + const s = &sums[@min(rows, sums.len - 1)]; + const a = first.gpuTimes() orelse return; + const b = last.gpuTimes() orelse return; + s.gpu += b[1] - a[0]; + s.timed += 1; +} + +fn log() void { + var buf: [1024]u8 = undefined; + var w: std.Io.Writer = .fixed(&buf); + for (sums, 0..) |s, rows| { + if (s.n == 0) continue; + const g = if (s.timed > 0) s.gpu / @as(f64, @floatFromInt(s.timed)) * 1e3 else 0; + w.print(" {d} rows: {d:.2} host, {d:.2} gpu ({d});", .{ rows, s.host / @as(f64, @floatFromInt(s.n)) * 1e3, g, s.n }) catch break; + } + std.log.info("dsv41 rounds, ms a round over {d}:{s}", .{ rounds, w.buffered() }); +} diff --git a/zig/src/families/deepseek_v41/metal/serve.zig b/zig/src/families/deepseek_v41/metal/serve.zig index da40fd79f9e..cd1248292a0 100644 --- a/zig/src/families/deepseek_v41/metal/serve.zig +++ b/zig/src/families/deepseek_v41/metal/serve.zig @@ -34,6 +34,10 @@ pub const Options = struct { drafts: bool = true, cache_bytes: u64 = 0, prompt: prompt.Opts = .{}, + /// prompts a chunk at a time between the other streams' rounds (serve_lanes.stepsFromEnv); false: whole prompts + steps: bool = false, + /// --decode-share (serve_lanes.Model.decode_share) + decode_share: ?f64 = null, }; /// A position's draft candidates the pass keeps (the shape the lanes size their buffers by). @@ -100,6 +104,8 @@ pub const Metal = struct { .close = close, // a cost table measured on this machine (TF_DSV41_CALIB_FILE), else the defaults: Metal has nothing to time .calib = if (host.calib_env.Knobs.fromEnv().file) |f| .{ .file = f } else .{ .mode = "default" }, + .steps = m.opt.steps, + .decode_share = m.opt.decode_share, }; } diff --git a/zig/src/families/deepseek_v41/metal/target.zig b/zig/src/families/deepseek_v41/metal/target.zig index 5bb25c9394e..7365a44b3ce 100644 --- a/zig/src/families/deepseek_v41/metal/target.zig +++ b/zig/src/families/deepseek_v41/metal/target.zig @@ -11,6 +11,7 @@ const prompt = @import("prompt.zig"); const pipelines = @import("pipelines.zig"); const snapshots = @import("snapshots.zig"); const tree_ = @import("tree.zig"); +const steps = @import("prompt_steps.zig"); const iface = host.iface; const lanes = host.lanes; @@ -43,8 +44,8 @@ pub const Options = struct { resident: ?*mtl.resident.Resident = null, }; -/// What the target did, for the tests and the logs. -pub const Stats = struct { prompts: u64 = 0, hits: u64 = 0, cached_rows: u64 = 0, windows: u64 = 0, rows: u64 = 0, rewinds: u64 = 0, launches: u64 = 0, history_rows: u64 = 0 }; +/// What the target did, for the tests and the logs; `most_between`: the most launches between two of a prompt's pieces. +pub const Stats = struct { prompts: u64 = 0, hits: u64 = 0, cached_rows: u64 = 0, windows: u64 = 0, rows: u64 = 0, rewinds: u64 = 0, launches: u64 = 0, history_rows: u64 = 0, pieces: u64 = 0, abandoned: u64 = 0, most_between: u64 = 0 }; /// A slot: its device state, prompt tail, ids (rows run, the last window's included until its keep) and taps. pub const Slot = struct { @@ -68,6 +69,15 @@ pub const Slot = struct { whole: bool = false, /// the rows the last prompt took from kept state resumed: u32 = 0, + /// a prompt begun in pieces (prompt_steps.zig) and not yet finished: its rows from `tail.end` are still to run + filling: bool = false, + /// a begun prompt's choice logits when a kept state held the whole prompt (its entry may go before `finish`) + hit: std.ArrayList(f32) = .empty, + hit_on: bool = false, + /// when the begun prompt began (its wall time on the profile line) + began: u64 = 0, + /// the target's launches when the begun prompt's last piece ran (Stats.most_between: other slots' rounds between) + mark: u64 = 0, }; pub const Target = struct { @@ -151,6 +161,7 @@ pub const Target = struct { s.ptaps.deinit(); a.free(s.ring); s.hist.deinit(a); + s.hit.deinit(a); } pub fn deinit(t: *Target) void { @@ -180,10 +191,10 @@ pub const Target = struct { } pub fn target(t: *Target) iface.Target { - return .{ .ptr = t, .vtable = &.{ .prefill = prefill, .window = window, .keep = keep, .taps = taps, .release = release, .resumed = resumedFn, .history = history } }; + return .{ .ptr = t, .vtable = &.{ .prefill = prefill, .window = window, .keep = keep, .taps = taps, .release = release, .resumed = resumedFn, .history = history, .begin = steps.begin, .piece = steps.piece, .finish = steps.finish } }; } - fn self(ptr: *anyopaque) *Target { + pub fn self(ptr: *anyopaque) *Target { return @ptrCast(@alignCast(ptr)); } @@ -208,10 +219,21 @@ pub const Target = struct { fn prefill(ptr: *anyopaque, slot: u32, ids: []const u32, smp: ?lanes.Sampling, draw: u64) anyerror!u32 { const t = self(ptr); + const st = try t.startPrompt(slot, ids); + const s = st.s; + if (st.hit) |e| if (e.ids.len == ids.len) return t.endPrompt(s, e.logits.?, smp, draw); + // states later prompts can resume from that share less than all of this one (kept as the prompt passes them) + for (t.keepPoints(ids, s.resumed)) |end| if (end > 0) try t.keepAt(s, end); + t.pr.run(t.promptEnv(), &s.kv, &s.tail, ids) catch |e| return t.fail(e); + return t.endPrompt(s, null, smp, draw); + } + + /// A prompt's start on a free slot: a kept state that starts it (restored), else the slot cleared; ids recorded. + pub fn startPrompt(t: *Target, slot: u32, ids: []const u32) !struct { s: *Slot, hit: ?*snapshots.Entry } { if (slot >= t.slots.len) return error.NoSlot; const s = &t.slots[slot]; const c = t.env.c; - if (s.live) return error.SlotLive; + if (s.live or s.filling) return error.SlotLive; if (ids.len == 0) return error.EmptyPrompt; if (ids.len >= t.opt.limit) return error.PastLimit; for (ids) |id| if (id >= c.vocab) return error.BadToken; @@ -219,6 +241,8 @@ pub const Target = struct { s.whole = false; s.open = false; s.rows = 0; + s.hit_on = false; + t.pr.forget(&s.tail); t.stats.prompts += 1; // a kept state that starts this prompt, else a cleared slot const hit = if (t.cache.on()) t.cache.best(ids) else null; @@ -234,33 +258,46 @@ pub const Target = struct { s.hist.clearRetainingCapacity(); try s.hist.appendSlice(t.a, ids); s.high = @max(at, ids.len); - const n: u32 = @intCast(ids.len); + return .{ .s = s, .hit = hit }; + } + + /// The prompt's rows to `end`, short of its end, with the decoder's cone there: its taps and that state kept. + pub fn keepAt(t: *Target, s: *Slot, end: u32) !void { + t.pr.run(t.promptEnv(), &s.kv, &s.tail, s.hist.items[0..end]) catch |e| return t.fail(e); + t.ringTaps(s, end); + t.cache.save(t.env.c, &s.kv, s.hist.items[0..end], s.ring, null) catch {}; + } + + /// The taps rows the last prompt run wrote, its rows before `end`, into the ring. + fn ringTaps(t: *const Target, s: *Slot, end: u32) void { + const c = t.env.c; + const tr = t.pr.tapRows(c); + for (0..t.pr.taps) |i| t.ringPut(s, end - t.pr.taps + i, tr[i * tapWidth(c) ..][0..tapWidth(c)]); + } + + /// The prompt's rows are in (`hit`: a kept state's logits, else the prompt head's): taps, choice, the slot live. + pub fn endPrompt(t: *Target, s: *Slot, hit: ?[]const f32, smp: ?lanes.Sampling, draw: u64) !u32 { + const c = t.env.c; + const n: u32 = @intCast(s.hist.items.len); const V: usize = c.vocab; var logits: []const f32 = undefined; - // states later prompts can resume from that share less than all of this one (kept as the prompt passes them) - const kp = t.keepPoints(ids, at); - if (at == n) logits = hit.?.logits.? else { - for ([3]u32{ kp[0], kp[1], n }) |end| { - if (end == 0) continue; - t.pr.run(t.promptEnv(), &s.kv, &s.tail, ids[0..end]) catch |e| return t.fail(e); - const tr = t.pr.tapRows(c); - for (0..t.pr.taps) |i| t.ringPut(s, end - t.pr.taps + i, tr[i * tapWidth(c) ..][0..tapWidth(c)]); - if (end < n) t.cache.save(c, &s.kv, ids[0..end], s.ring, null) catch {}; - } + if (hit) |l| logits = l else { const all = t.pr.logits(c); logits = all[(t.pr.head - 1) * V ..][0..V]; + t.ringTaps(s, n); } t.promptTaps(s, n); const choice = try t.choose(logits, draw, smp); s.base = n; s.live = true; s.whole = true; - if (t.cache.on() and at < n and kp[1] == 0) t.cache.save(c, &s.kv, ids, s.ring, logits) catch {}; + // a thinking prompt is kept short of its instead (keepPoints) + if (t.cache.on() and s.resumed < n and t.keepPoints(s.hist.items, s.resumed)[1] == 0) t.cache.save(c, &s.kv, s.hist.items, s.ring, logits) catch {}; return choice; } /// Extra kept states (0: none): before the first user turn, and before a thinking prompt's closing . - fn keepPoints(t: *const Target, ids: []const u32, at: u32) [2]u32 { + pub fn keepPoints(t: *const Target, ids: []const u32, at: u32) [2]u32 { const c = t.env.c; const n = ids.len; var out: [2]u32 = .{ 0, 0 }; @@ -274,7 +311,7 @@ pub const Target = struct { return out; } - fn promptEnv(t: *const Target) prompt.Env { + pub fn promptEnv(t: *const Target) prompt.Env { const e = t.env; return .{ .c = e.c, .p = e.p, .tables = e.tables, .model = e.model, .lookup = e.lookup, .queue = e.queue }; } @@ -499,6 +536,7 @@ pub const Target = struct { const t = self(ptr); if (slot >= t.slots.len) return; const s = &t.slots[slot]; + if (s.filling) steps.abandon(t, s); if (!s.live) return; t.tree.forget(slot); s.live = false; diff --git a/zig/src/families/deepseek_v41/metal/vision.zig b/zig/src/families/deepseek_v41/metal/vision.zig index a577a614d9a..24f058066cf 100644 --- a/zig/src/families/deepseek_v41/metal/vision.zig +++ b/zig/src/families/deepseek_v41/metal/vision.zig @@ -76,8 +76,9 @@ pub const Config = struct { } pub fn check(c: Config) !void { + // the zero counts first: headDim() divides by heads + if (c.heads == 0 or c.layers == 0 or c.ratio == 0 or c.patch == 0 or c.inter == 0) return error.UnsupportedVision; if (c.headDim() != 64 or c.dim % c.heads != 0) return error.UnsupportedVision; - if (c.layers == 0 or c.ratio == 0 or c.patch == 0 or c.inter == 0) return error.UnsupportedVision; } }; @@ -214,6 +215,10 @@ test "the release's vision_config parses to the defaults" { const c = (try Config.parse(std.testing.allocator, text, 5120)).?; try std.testing.expectEqual(Config{}, c); try std.testing.expect((try Config.parse(std.testing.allocator, "{}", 5120)) == null); + // a head count of 0: refused by name before headDim() divides by it + const zero = try std.mem.replaceOwned(u8, std.testing.allocator, text, "\"num_attention_heads\": 16", "\"num_attention_heads\": 0"); + defer std.testing.allocator.free(zero); + try std.testing.expectError(error.UnsupportedVision, Config.parse(std.testing.allocator, zero, 5120)); } test "the 2D RoPE table: row angles first, column angles after, position 0 is the identity" { diff --git a/zig/src/families/deepseek_v41/serve_lanes.zig b/zig/src/families/deepseek_v41/serve_lanes.zig index 79b8e3cd78f..7fb71969a11 100644 --- a/zig/src/families/deepseek_v41/serve_lanes.zig +++ b/zig/src/families/deepseek_v41/serve_lanes.zig @@ -62,8 +62,40 @@ pub const Model = struct { calib: ?calib_env.Knobs = null, /// the draft trees' knobs (null: TF_DSV41_TREE / _DUP_MS / _ROWS, as read at open) trees: ?tree.Settings = null, + /// prompts a `prefill_step` of rows at a time between the other streams' rounds (the target's pieces; stepsFromEnv) + steps: bool = false, + /// --decode-share: the replies' share of wall time beside a prompt's steps (null: `steps_decode_share` in steps) + decode_share: ?f64 = null, }; +/// The replies' share of wall time beside a prompt in steps when neither --decode-share nor the env names one. +pub const steps_decode_share = 0.25; + +/// LaneHost's prompt share in steps: the flag's (through Info, with its row cap), the env's, else the default above. +fn applyShare(h: *api.LaneHost, backend: Model) void { + // a blank TENSORFOLD_PREFILL_SHARE is unset, as LaneHost reads it + const env_share = @import("sys").environment.Process.get(.{}, "TENSORFOLD_PREFILL_SHARE") orelse ""; + if (!backend.steps or backend.decode_share != null or env_share.len > 0) return; + h.share.p = 1 - steps_decode_share; +} + +/// Prompt steps with `decode_share` (--decode-share, refused outside [0, 1)): above 0, or as `stepsFromEnv` says. +pub fn stepsFor(decode_share: ?f64) !bool { + if (decode_share) |x| { + if (!(x >= 0 and x < 1)) return error.BadDecodeShare; + if (x > 0) return true; + } + return stepsFromEnv(); +} + +/// Prompt steps for a target with pieces: TF_DSV41_PREFILL_PIECES=1, or LaneHost's srpt order or a prompt share set. +pub fn stepsFromEnv() !bool { + if (try @import("sys").environment.read(bool, "TF_DSV41_PREFILL_PIECES", false)) return true; + if (@FieldType(api.LaneHost, "srpt").fromEnv().on) return true; + const share = @FieldType(api.LaneHost, "share").fromEnv(); + return share.p < 1 or share.rows > 0 or share.policy != .stock; +} + pub const Served = struct { gpa: Allocator, io: std.Io, @@ -125,7 +157,7 @@ pub const Served = struct { } // draft trees (TF_DSV41_TREE / _DUP_MS / _ROWS; off by default): first-position siblings const trees = if (dspark_on) backend.trees orelse try tree.Settings.fromEnv() else tree.Settings{}; - s.x = try ln.Lanes.init(gpa, tgt, pass, s.costs, .{ .shape = backend.shape, .slots = backend.slots, .siblings = trees.siblings, .sib_rows = trees.sib_rows, .dup = trees.dup, .depth = try calib_env.depthSettings(&calib_env.env), .spec = if (dspark_on) try spec.Settings.fromEnv() else .{}, .plain_streams_default = 3 }); + s.x = try ln.Lanes.init(gpa, tgt, pass, s.costs, .{ .shape = backend.shape, .slots = backend.slots, .siblings = trees.siblings, .sib_rows = trees.sib_rows, .dup = trees.dup, .depth = try calib_env.depthSettings(&calib_env.env), .spec = if (dspark_on) try spec.Settings.fromEnv() else .{}, .plain_streams_default = 3, .steps = backend.steps, .step_rows = backend.prefill_step }); s.arena = std.heap.ArenaAllocator.init(gpa); s.cfg = try lanes.Config.init(gpa, try s.x.model(s.arena.allocator(), 64), 16, 15); s.x.policy.depth.forward_rows = backend.forward_rows; @@ -137,7 +169,9 @@ pub const Served = struct { s.clock = .{ .io = io }; s.core = lanes.Engine.init(gpa, &s.cfg, s.x.backend(), s.clock.clock()); s.x.attach(&s.core); - s.host = api.LaneHost.init(gpa, io, &s.core, .{ .name = backend.name, .lanes = backend.slots, .context_window = @intCast(window), .prefill_step = backend.prefill_step, .vision = backend.vision }); + s.host = api.LaneHost.init(gpa, io, &s.core, .{ .name = backend.name, .lanes = backend.slots, .context_window = @intCast(window), .prefill_step = backend.prefill_step, .vision = backend.vision, .decode_share = backend.decode_share }); + applyShare(&s.host, backend); + if (backend.steps) std.log.info("dsv41 prompts: {d} rows a step between the other streams' rounds, prompts {d:.2} of wall time beside replies", .{ backend.prefill_step, s.host.share.p }); s.host.info_.draft_sources = draftSources(dspark_on, s.cfg.max_copy > 0); // the lanes run on LaneHost's thread: a backend whose state is per thread binds it there s.host.on_thread = backend.on_thread; diff --git a/zig/src/families/deepseek_v41/serve_lanes_test.zig b/zig/src/families/deepseek_v41/serve_lanes_test.zig index 3e15b5412b8..a887ceece17 100644 --- a/zig/src/families/deepseek_v41/serve_lanes_test.zig +++ b/zig/src/families/deepseek_v41/serve_lanes_test.zig @@ -10,6 +10,10 @@ const serve_lanes = @import("serve_lanes.zig"); const gpa = std.testing.allocator; const io = std.testing.io; +test { + _ = @import("serve_steps_test.zig"); +} + /// A reply's tokens and finish, written on LaneHost's thread and read on the test's. const Box = struct { mutex: std.Io.Mutex = .init, diff --git a/zig/src/families/deepseek_v41/serve_steps_test.zig b/zig/src/families/deepseek_v41/serve_steps_test.zig new file mode 100644 index 00000000000..b9754d26a29 --- /dev/null +++ b/zig/src/families/deepseek_v41/serve_steps_test.zig @@ -0,0 +1,436 @@ +//! Prompts in steps (serve_lanes Model.steps, draft/lane_steps.zig) through LaneHost over a stepped CPU twin. +const std = @import("std"); +const api = @import("engine_api"); +const lanes = @import("lanes"); +const twin = @import("draft/twin.zig"); +const iface = @import("draft/iface.zig"); +const calib_env = @import("draft/calib_env.zig"); +const calib_lanes = @import("calib_lanes.zig"); +const serve_lanes = @import("serve_lanes.zig"); + +const gpa = std.testing.allocator; +const io = std.testing.io; +const step_rows = 16; + +/// The twin as a target with pieces: `begin` / `piece` record progress, `finish` runs the whole prompt on the twin. +const Stepped = struct { + t: *twin.Twin, + d: *twin.Drafter, + steps: bool, + /// ms a piece (and a whole prompt, per step's rows) takes, so other requests arrive while a prompt runs + delay_ms: u32 = 0, + /// the piece (counted over every slot, from 1) that fails with error.Planted; 0: none + fail_at: u64 = 0, + pieces: std.atomic.Value(u64) = .init(0), + prompts: std.atomic.Value(u64) = .init(0), + windows: std.atomic.Value(u64) = .init(0), + abandoned: u64 = 0, + /// decode rounds of other slots while each slot's prompt ran in pieces (begin to finish), the last one's + began_windows: [4]u64 = @splat(0), + between: u64 = 0, + /// decode rounds since a slot's last piece, and the most seen between two pieces of one prompt + mark: [4]u64 = @splat(0), + most_between: u64 = 0, + /// --decode-share as the model passes it + decode_share: ?f64 = null, + /// prompt lengths in the order their first choice was drawn + order: std.ArrayList(usize) = .empty, + at: [4]?u64 = @splat(null), + + fn model(x: *Stepped, slots: u32) serve_lanes.Model { + return .{ .ptr = x, .name = "dsv41-twin-steps", .slots = slots, .limit = 4096, .world = 1, .prefill_step = step_rows, .forward_rows = 16, .shape = x.d.shape, .target = targetFn, .pass = passFn, .calibrate = calibrate, .close = close, .calib = .{ .mode = "default" }, .steps = x.steps, .decode_share = x.decode_share }; + } + + fn of(p: *anyopaque) *Stepped { + return @ptrCast(@alignCast(p)); + } + + fn targetFn(ctx: *anyopaque) iface.Target { + return .{ .ptr = ctx, .vtable = &.{ .prefill = prefill, .window = window, .keep = keep, .taps = taps, .release = release, .begin = begin, .piece = piece, .finish = finish } }; + } + + fn passFn(ctx: *anyopaque) ?iface.Pass { + return of(ctx).d.pass(); + } + + fn calibrate(_: *anyopaque, _: std.mem.Allocator, _: std.Io, _: []const u8, _: calib_env.Knobs, _: calib_env.Shape) anyerror!calib_lanes.Boot { + return error.Unmeasured; + } + + fn close(_: *anyopaque) void {} + + fn inner(x: *Stepped) iface.Target { + return x.t.target(); + } + + fn wait(x: *const Stepped, rows: usize) void { + if (x.delay_ms > 0) std.Io.sleep(io, .fromMilliseconds(@intCast(x.delay_ms * (rows + step_rows - 1) / step_rows)), .awake) catch {}; + } + + fn prefill(p: *anyopaque, slot: u32, ids: []const u32, smp: ?lanes.Sampling, draw: u64) anyerror!u32 { + const x = of(p); + _ = x.prompts.fetchAdd(1, .monotonic); + x.wait(ids.len); + const c = try twinPrompt(x.inner(), slot, ids, smp, draw); + try x.order.append(gpa, ids.len); + return c; + } + + fn begin(p: *anyopaque, slot: u32, ids: []const u32) anyerror!iface.Target.Begun { + const x = of(p); + if (x.at[slot] != null or ids.len == 0) return error.SlotLive; + _ = x.prompts.fetchAdd(1, .monotonic); + x.at[slot] = 0; + x.began_windows[slot] = x.windows.load(.monotonic); + x.mark[slot] = x.began_windows[slot]; + return .{}; + } + + fn piece(p: *anyopaque, slot: u32, ids: []const u32, start: u64, end: u64, _: bool) anyerror!void { + const x = of(p); + const at = x.at[slot] orelse return error.NotBegun; + if (start != at or end <= start or end >= ids.len) return error.NotAChain; + const n = x.pieces.fetchAdd(1, .monotonic) + 1; + if (n == x.fail_at) return error.Planted; + const w = x.windows.load(.monotonic); + if (start > 0) x.most_between = @max(x.most_between, w - x.mark[slot]); + x.wait(end - start); + x.at[slot] = end; + x.mark[slot] = x.windows.load(.monotonic); + } + + fn finish(p: *anyopaque, slot: u32, ids: []const u32, smp: ?lanes.Sampling, draw: u64) anyerror!u32 { + const x = of(p); + const at = x.at[slot] orelse return error.NotBegun; + x.wait(ids.len - at); + x.at[slot] = null; + x.between = x.windows.load(.monotonic) - x.began_windows[slot]; + const c = try twinPrompt(x.inner(), slot, ids, smp, draw); + try x.order.append(gpa, ids.len); + return c; + } + + fn window(p: *anyopaque, segments: []const iface.Segment, choices: [][]u32) anyerror!void { + _ = of(p).windows.fetchAdd(1, .monotonic); + return of(p).inner().window(segments, choices); + } + + fn keep(p: *anyopaque, slot: u32, path: []const u32) anyerror!void { + return of(p).inner().keep(slot, path); + } + + fn taps(p: *anyopaque, slot: u32) iface.Taps { + return of(p).inner().taps(slot); + } + + fn release(p: *anyopaque, slot: u32) void { + const x = of(p); + if (x.at[slot] != null) x.abandoned += 1; + x.at[slot] = null; + x.inner().release(slot); + } +}; + +/// A reply's tokens, finish and first-token order, written on LaneHost's thread and read on the test's. +const Box = struct { + mutex: std.Io.Mutex = .init, + out: std.ArrayList(u32) = .empty, + done: bool = false, + reason: ?api.Reason = null, + + fn event(ctx: *anyopaque, _: api.Id, e: *const api.Event) void { + const b: *Box = @ptrCast(@alignCast(ctx)); + b.mutex.lockUncancelable(io); + defer b.mutex.unlock(io); + switch (e.*) { + .tokens => |ts| b.out.appendSlice(gpa, ts) catch {}, + .finished => |fin| { + b.done = true; + b.reason = fin.reason; + }, + else => {}, + } + } + + fn wait(b: *Box) !void { + for (0..60_000) |_| { + b.mutex.lockUncancelable(io); + const done = b.done; + b.mutex.unlock(io); + if (done) return; + std.Io.sleep(io, .fromMilliseconds(1), .awake) catch {}; + } + return error.Timeout; + } +}; + +/// A served stepped twin of `slots` slots; `x` holds the twin and the drafter for the caller to free. +const Rig = struct { + x: Stepped, + s: *serve_lanes.Served = undefined, + + fn open(r: *Rig, slots: u32, steps: bool) !void { + return r.openShared(slots, steps, null); + } + + fn openShared(r: *Rig, slots: u32, steps: bool, decode_share: ?f64) !void { + const t = try twin.Twin.init(gpa, .{}, slots); + errdefer t.deinit(); + const d = try twin.Drafter.init(gpa, t, slots); + errdefer d.deinit(); + r.x = .{ .t = t, .d = d, .steps = steps, .decode_share = decode_share }; + r.s = try serve_lanes.Served.open(gpa, io, r.x.model(slots), ".", null); + } + + fn close(r: *Rig) void { + serve_lanes.Served.close(r.s); + r.x.order.deinit(gpa); + r.x.d.deinit(); + r.x.t.deinit(); + } + + fn submit(r: *Rig, id: api.Id, req: *const api.Request, b: *Box) !void { + try r.s.engine().submit(id, req, .{ .ctx = b, .event = Box.event }); + } +}; + +fn prompt(n: usize, seed: u64) ![]u32 { + var prng = std.Random.DefaultPrng.init(seed); + const out = try gpa.alloc(u32, n); + for (out) |*v| v.* = prng.random().uintLessThan(u32, 48); + return out; +} + +/// The twin's prompt, its first rows a prefill and the rest in kept windows (a twin window holds 64 rows at most). +fn twinPrompt(t: iface.Target, slot: u32, ids: []const u32, smp: ?lanes.Sampling, draw: u64) !u32 { + const w = 48; + const first = @min(w, ids.len); + var c = try t.prefill(slot, ids[0..first], smp, if (first == ids.len) draw else first); + var at: usize = first; + var draws: [w]u64 = undefined; + var out: [w]u32 = undefined; + const path: [w]u32 = std.simd.iota(u32, w); + while (at < ids.len) { + const n = @min(w, ids.len - at); + for (draws[0..n], 0..) |*d, i| d.* = at + i + 1; + if (at + n == ids.len) draws[n - 1] = draw; + var cs = [_][]u32{out[0..n]}; + try t.window(&.{.{ .slot = slot, .start = at, .tokens = ids[at..][0..n], .parents = null, .draws = draws[0..n], .sampling = smp }}, &cs); + try t.keep(slot, path[0..n]); + c = out[n - 1]; + at += n; + } + return c; +} + +/// The twin's serial greedy reply: the prompt, then one row a step. +fn serial(p: []const u32, n: usize) ![]u32 { + const ref = try twin.Twin.init(gpa, .{}, 1); + defer ref.deinit(); + const t = ref.target(); + const out = try gpa.alloc(u32, n); + errdefer gpa.free(out); + var tok = try twinPrompt(t, 0, p, null, p.len); + for (out, 0..) |*o, i| { + o.* = tok; + const at: u64 = p.len + i; + var c: [1]u32 = undefined; + var cs = [_][]u32{&c}; + try t.window(&.{.{ .slot = 0, .start = at, .tokens = &.{tok}, .parents = null, .draws = &.{at + 1}, .sampling = null }}, &cs); + tok = c[0]; + } + return out; +} + +fn until(v: *const std.atomic.Value(u64), n: u64) !void { + for (0..60_000) |_| { + if (v.load(.monotonic) >= n) return; + std.Io.sleep(io, .fromMilliseconds(1), .awake) catch {}; + } + return error.Timeout; +} + +test "serve steps: a decoding reply and prompts in steps == serial; decode rounds ran between a prompt's pieces" { + const t = std.testing; + const p0 = try prompt(10, 1); + defer gpa.free(p0); + const p1 = try prompt(700, 2); + defer gpa.free(p1); + const w0 = try serial(p0, 120); + defer gpa.free(w0); + const w1 = try serial(p1, 40); + defer gpa.free(w1); + var r: Rig = undefined; + try r.open(4, true); + defer r.close(); + r.x.delay_ms = 1; + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.out.deinit(gpa); + const reqs = [2]api.Request{ .{ .prompt = p0, .max_tokens = 120 }, .{ .prompt = p1, .max_tokens = 40 } }; + try r.submit(1, &reqs[0], &boxes[0]); + try until(&r.x.windows, 1); + try r.submit(2, &reqs[1], &boxes[1]); + for (&boxes) |*b| try b.wait(); + try t.expectEqualSlices(u32, w0, boxes[0].out.items); + try t.expectEqualSlices(u32, w1, boxes[1].out.items); + // 700 rows in 16-row steps: 43 pieces, and the decoding reply's rounds between them + try t.expectEqual(@as(u64, 43), r.x.pieces.load(.monotonic)); + try t.expect(r.x.between > 0); +} + +test "serve steps: a short prompt arriving during a long one draws its first token first; whole prompts do not" { + const t = std.testing; + const long = try prompt(1600, 3); + defer gpa.free(long); + const short = try prompt(20, 4); + defer gpa.free(short); + for ([_]bool{ false, true }) |steps| { + var r: Rig = undefined; + try r.open(2, steps); + defer r.close(); + r.x.delay_ms = 2; + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.out.deinit(gpa); + const reqs = [2]api.Request{ .{ .prompt = long, .max_tokens = 4 }, .{ .prompt = short, .max_tokens = 4 } }; + try r.submit(1, &reqs[0], &boxes[0]); + if (steps) try until(&r.x.pieces, 3) else try until(&r.x.prompts, 1); + try r.submit(2, &reqs[1], &boxes[1]); + for (&boxes) |*b| try b.wait(); + const first: []const usize = if (steps) &.{ short.len, long.len } else &.{ long.len, short.len }; + try t.expectEqualSlices(usize, first, r.x.order.items); + } +} + +test "serve steps: a failed piece and a cancel mid-prompt free the slot; the next requests on it == serial" { + const t = std.testing; + const long = try prompt(600, 5); + defer gpa.free(long); + const p = try prompt(30, 6); + defer gpa.free(p); + const want = try serial(p, 20); + defer gpa.free(want); + var r: Rig = undefined; + try r.open(1, true); + defer r.close(); + r.x.fail_at = 3; + var failed: Box = .{}; + defer failed.out.deinit(gpa); + const rl: api.Request = .{ .prompt = long, .max_tokens = 8 }; + try r.submit(1, &rl, &failed); + try failed.wait(); + try t.expect(failed.reason.? == .failed); + r.x.delay_ms = 2; + var gone: Box = .{}; + defer gone.out.deinit(gpa); + const before = r.x.pieces.load(.monotonic); + try r.submit(2, &rl, &gone); + try until(&r.x.pieces, before + 3); + r.s.engine().cancel(2); + try gone.wait(); + try t.expect(gone.reason.? == .cancelled); + r.x.delay_ms = 0; + // one slot: a lane kept by either would leave the next request waiting forever + var next: Box = .{}; + defer next.out.deinit(gpa); + const rp: api.Request = .{ .prompt = p, .max_tokens = 20 }; + try r.submit(3, &rp, &next); + try next.wait(); + try t.expectEqualSlices(u32, want, next.out.items); + try t.expectEqual(@as(u64, 2), r.x.abandoned); +} + +test "serve steps: --decode-share 0.5 alone turns steps on at that share; out of range and a malformed switch refused" { + const t = std.testing; + const env = @import("sys").env; + const names = [_][:0]const u8{ "TF_DSV41_PREFILL_PIECES", "TENSORFOLD_PREFILL_ORDER", "TENSORFOLD_PREFILL_POLICY", "TENSORFOLD_PREFILL_SHARE", "TENSORFOLD_PREFILL_BUDGET" }; + for (names) |n| _ = env.unsetenv(n); + defer for (names) |n| { + _ = env.unsetenv(n); + }; + try t.expect(try serve_lanes.stepsFor(0.5)); + try t.expect(!try serve_lanes.stepsFor(0)); + try t.expect(!try serve_lanes.stepsFor(null)); + for ([_]f64{ 1, 1.5, -0.1, std.math.nan(f64) }) |x| try t.expectError(error.BadDecodeShare, serve_lanes.stepsFor(x)); + var r: Rig = undefined; + try r.openShared(2, try serve_lanes.stepsFor(0.5), 0.5); + defer r.close(); + try t.expectApproxEqAbs(@as(f64, 0.5), r.s.host.share.p, 1e-9); + try t.expect(r.s.host.decode_cap and r.s.backend.steps); + // the switch: blank keeps its default, malformed text stops the start (entry.zig names it) + _ = env.setenv(names[0], " ", 1); + try t.expect(!try serve_lanes.stepsFor(null)); + _ = env.setenv(names[0], "yes", 1); + try t.expectError(error.InvalidEnvironment, serve_lanes.stepsFor(null)); +} + +test "serve steps: TF_DSV41_PREFILL_PIECES, an srpt order or a prompt share turns steps on; nothing set keeps whole" { + const t = std.testing; + const env = @import("sys").env; + const names = [_][:0]const u8{ "TF_DSV41_PREFILL_PIECES", "TENSORFOLD_PREFILL_ORDER", "TENSORFOLD_PREFILL_POLICY", "TENSORFOLD_PREFILL_SHARE", "TENSORFOLD_PREFILL_BUDGET" }; + for (names) |n| _ = env.unsetenv(n); + defer for (names) |n| { + _ = env.unsetenv(n); + }; + try t.expect(!try serve_lanes.stepsFromEnv()); + const on = [_][2][:0]const u8{ .{ names[0], "1" }, .{ names[1], "srpt" }, .{ names[2], "fcfs" }, .{ names[3], "0.5" }, .{ names[4], "2048" } }; + for (on) |kv| { + _ = env.setenv(kv[0], kv[1], 1); + try t.expect(try serve_lanes.stepsFromEnv()); + _ = env.unsetenv(kv[0]); + } + // values LaneHost reads as its defaults keep whole prompts + const off = [_][2][:0]const u8{ .{ names[0], "0" }, .{ names[1], "fifo" }, .{ names[2], "stock" }, .{ names[3], "1" }, .{ names[4], "0" } }; + for (off) |kv| _ = env.setenv(kv[0], kv[1], 1); + try t.expect(!try serve_lanes.stepsFromEnv()); +} + +test "serve steps: a decode share gives a decoding reply rounds between a prompt's pieces; replies == serial" { + const t = std.testing; + const p0 = try prompt(10, 7); + defer gpa.free(p0); + const long = try prompt(800, 8); + defer gpa.free(long); + const w0 = try serial(p0, 400); + defer gpa.free(w0); + const w1 = try serial(long, 8); + defer gpa.free(w1); + // a share of 0: one round a step; 0.75: each 5 ms step owes the reply 15 ms of rounds + for ([_]f64{ 0, 0.75 }) |share| { + var r: Rig = undefined; + try r.openShared(2, true, share); + defer r.close(); + r.x.delay_ms = 5; + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.out.deinit(gpa); + const reqs = [2]api.Request{ .{ .prompt = p0, .max_tokens = 400, .drafts = false }, .{ .prompt = long, .max_tokens = 8 } }; + try r.submit(1, &reqs[0], &boxes[0]); + try until(&r.x.windows, 1); + try r.submit(2, &reqs[1], &boxes[1]); + for (&boxes) |*b| try b.wait(); + try t.expectEqualSlices(u32, w0, boxes[0].out.items); + try t.expectEqualSlices(u32, w1, boxes[1].out.items); + if (share > 0) try t.expect(r.x.most_between >= 3) else try t.expect(r.x.most_between <= 1); + } +} + +test "serve steps: the prompt share in steps is the flag's, else the env's, else 0.25 to replies; whole prompts keep 1" { + const t = std.testing; + const env = @import("sys").env; + _ = env.unsetenv("TENSORFOLD_PREFILL_SHARE"); + defer _ = env.unsetenv("TENSORFOLD_PREFILL_SHARE"); + const cases = [_]struct { steps: bool, flag: ?f64, env: ?[:0]const u8, p: f64, cap: bool }{ + .{ .steps = false, .flag = null, .env = null, .p = 1, .cap = false }, + .{ .steps = true, .flag = null, .env = null, .p = 1 - serve_lanes.steps_decode_share, .cap = false }, + .{ .steps = true, .flag = null, .env = "0.5", .p = 0.5, .cap = false }, + .{ .steps = true, .flag = null, .env = "", .p = 1 - serve_lanes.steps_decode_share, .cap = false }, + .{ .steps = true, .flag = 0.4, .env = "0.5", .p = 0.6, .cap = true }, + }; + for (cases) |c| { + if (c.env) |v| _ = env.setenv("TENSORFOLD_PREFILL_SHARE", v, 1) else _ = env.unsetenv("TENSORFOLD_PREFILL_SHARE"); + var r: Rig = undefined; + try r.openShared(2, c.steps, c.flag); + defer r.close(); + try t.expectApproxEqAbs(c.p, r.s.host.share.p, 1e-9); + try t.expectEqual(c.cap, r.s.host.decode_cap); + } +} diff --git a/zig/src/families/dots_mocr/cuda.zig b/zig/src/families/dots_mocr/cuda.zig index d8cc47cf33e..8a65b28c9f3 100644 --- a/zig/src/families/dots_mocr/cuda.zig +++ b/zig/src/families/dots_mocr/cuda.zig @@ -4,14 +4,26 @@ const dense = @import("cuda_dense"); const cfg = @import("config.zig"); const fixtures = @import("config_test.zig"); +pub const config = @import("config.zig"); pub const recipe = @import("cuda_recipe.zig"); pub const weights = @import("cuda_weights.zig"); pub const tower_weights = @import("cuda_tower_weights.zig"); +pub const tower = @import("cuda_tower.zig"); pub const kernels = @import("cuda_kernels.zig"); pub const native = dense.Native(recipe); +/// Three chat-templated prompts of our own (fixtures/own-prompts.json): the GB10 runner's dots-text pins their replies. +pub const OwnPrompts = struct { short: []const u32, page: []const u32, chunks: []const u32 }; + +/// The own prompts' ids, parsed from the embedded fixture; the caller deinits the result. +pub fn ownPrompts(gpa: std.mem.Allocator) !std.json.Parsed(OwnPrompts) { + return std.json.parseFromSlice(OwnPrompts, gpa, @embedFile("fixtures/own-prompts.json"), .{}); +} + test { std.testing.refAllDecls(tower_weights); + std.testing.refAllDecls(tower); + _ = @import("cuda_tower_test.zig"); } test "dots geometry from the released config: 12 query heads over 2 KV heads of 128, two query heads a pattn block" { @@ -36,7 +48,7 @@ test "dots text bytes: embedding, untied head, final norm and 28 layers, the tow try std.testing.expectEqual(want, try weights.textBytes(std.testing.allocator, c)); } -test "dots on CUDA: text only, no reasoning block, its config and tensor refusals worded" { +test "dots on CUDA: no reasoning block, its config and tensor refusals worded" { try std.testing.expect(!native.reasoning and native.keeps_no_prompts); // compiles the load and the layer const hooks = .{ &native.open, &native.attach, &native.fits, &native.ledgerPool, &native.textWeightBytes }; @@ -64,3 +76,19 @@ test "dots on CUDA reads its geometry from the checkpoint's files and refuses an try std.testing.expectError(error.UnsupportedDotsConfig, recipe.geometry(a, io, dir)); try std.testing.expect(native.explain(null, error.UnsupportedDotsConfig) != null); } + +test "dots own prompts: 18, 578 and 2,537 ids in the vocabulary, each one user turn up to the assistant's mark" { + const own = try ownPrompts(std.testing.allocator); + defer own.deinit(); + const c = try cfg.Config.parse(std.testing.allocator, fixtures.sample, fixtures.generation); + const vocab = recipe.geometryOf(c).vocab; + const prompts = [_][]const u32{ own.value.short, own.value.page, own.value.chunks }; + for (prompts, [_]usize{ 18, 578, 2537 }) |ids, n| { + try std.testing.expectEqual(n, ids.len); + for (ids) |id| try std.testing.expect(id < vocab); + try std.testing.expectEqual(@as(u32, 151670), ids[0]); // the template's opening user mark + // the turn's close and the reply's open + try std.testing.expectEqualSlices(u32, &.{ 151671, 151672 }, ids[n - 2 ..]); + try std.testing.expect(std.mem.indexOfScalar(u32, ids, tower.marks.image) == null); // text only + } +} diff --git a/zig/src/families/dots_mocr/cuda_recipe.zig b/zig/src/families/dots_mocr/cuda_recipe.zig index 3052c4d69a1..2344452a770 100644 --- a/zig/src/families/dots_mocr/cuda_recipe.zig +++ b/zig/src/families/dots_mocr/cuda_recipe.zig @@ -1,4 +1,4 @@ -//! dots.mocr's Qwen2 text decoder as a cuda_dense recipe: HIP's rounding points, its tower refused until it is built. +//! dots.mocr as a cuda_dense recipe: its Qwen2 text decoder in HIP's rounding points, and its image tower. const std = @import("std"); const cuda = @import("cuda"); const dense = @import("cuda_dense"); @@ -18,6 +18,8 @@ pub const reasoning = false; pub const Weights = wts.Weights; pub const Kernels = kern.Kernels; +/// The image tower --vision opens (cuda_tower.zig). +pub const Tower = @import("cuda_tower.zig").Tower; /// The engine's geometry of an admitted dots.mocr config. pub fn geometryOf(c: cfg.Config) dense.Geometry { diff --git a/zig/src/families/dots_mocr/cuda_tower.zig b/zig/src/families/dots_mocr/cuda_tower.zig new file mode 100644 index 00000000000..e12f4e1dfc2 --- /dev/null +++ b/zig/src/families/dots_mocr/cuda_tower.zig @@ -0,0 +1,338 @@ +//! dots.mocr's image tower on CUDA as the dense engine's Tower: merge-ordered patches to the decoder's rows. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const dense = @import("cuda_dense"); +const cfg = @import("config.zig"); +const image = @import("image.zig"); +const inventory = @import("weights.zig"); +const weights = @import("cuda_tower_weights.zig"); +const kern = @import("cuda_kernels.zig"); + +const vit = cuda.vit; +const bf16 = core.bf16_round; +const Allocator = std.mem.Allocator; +const Image = dense.recipe.Image; +const Tap = dense.recipe.Tap; + +/// The largest image one call admits: the processor's 11,289,600 pixels in 14 x 14 patches (HIP's max_patches). +pub const max_patches = 57600; +/// vit.Gemms' own workspace (cuda/vit.zig's workspace_bytes). +pub const workspace_bytes = 32 << 20; +/// The GEMM plans the tower keeps: each image size adds its own, so past this many they go. +pub const max_plans = 32; +/// The rotary's inverse frequencies: head dim 128 over (row, column), 32 an axis. +pub const rope_pairs = 32; + +pub const Marks = struct { open: u32, image: u32, close: u32 }; +/// tokenizer.json's <|img|>, <|imgpad|> (config's image_token_id) and <|endofimg|>. +pub const marks: Marks = .{ .open = 151666, .image = 151665, .close = 151667 }; +/// The marks the server checks are the tokenizer's added tokens. +pub const mark_ids: [3]u32 = .{ marks.open, marks.image, marks.close }; + +/// Transformers' own float32 rotary inv_freq for the tower (theta 10,000, dim 64), fixtures/README.md. +pub const inv_freq: [rope_pairs]f32 = blk: { + @setEvalBranchQuota(10_000); + const text = @embedFile("fixtures/vision_inv_freq.txt"); + var out: [rope_pairs]f32 = undefined; + var it = std.mem.tokenizeAny(u8, text, ", \n"); + for (&out) |*v| v.* = @bitCast(std.fmt.parseInt(u32, it.next().?, 0) catch unreachable); + if (it.next() != null) @compileError("fixtures/vision_inv_freq.txt holds more than 32 values"); + break :blk out; +}; + +/// One call's device buffers at `patches` rows, each 256-byte aligned in one allocation; the merger reuses them. +pub const Scratch = struct { + px: u64 = 0, // bf16 [P, patch_k]: the patches, the columns past 588 zero + hw: u64 = 0, // i32 [P, 2]: each patch's (row, column) + h: u64 = 0, // bf16 [P, hidden]: the residual; then the merger's LayerNorm rows + xn: u64 = 0, // bf16 [P, hidden]: a norm's rows + r: u64 = 0, // bf16 [P, hidden]: a branch's output; then the merger's GELU rows + qkv: u64 = 0, // bf16 [P, 3 hidden]; then the SwiGLU's rows [P, intermediate] + att: u64 = 0, // bf16 [P, hidden]: attention's rows; then the merger's first linear before its GELU + gu: u64 = 0, // bf16 [P, 2 intermediate]: fc1 | fc3; then the merger's f32 sums + inv: u64 = 0, // f32 [32]: inv_freq + bytes: u64 = 0, + + pub fn of(v: cfg.Vision, patches: u64) Scratch { + const h: u64 = v.hidden; + var s: Scratch = .{}; + const parts = [_]struct { *u64, u64 }{ + .{ &s.px, patches * weights.patch_k * 2 }, .{ &s.hw, patches * 8 }, + .{ &s.h, patches * h * 2 }, .{ &s.xn, patches * h * 2 }, + .{ &s.r, patches * h * 2 }, .{ &s.qkv, patches * 3 * h * 2 }, + .{ &s.att, patches * h * 2 }, .{ &s.gu, patches * 2 * @as(u64, v.intermediate) * 2 }, + .{ &s.inv, rope_pairs * 4 }, + }; + for (parts) |p| { + p[0].* = s.bytes; + s.bytes += std.mem.alignForward(u64, p[1], 256); + } + return s; + } + + /// The offsets as device addresses from `base`. + fn at(s: Scratch, base: u64) Scratch { + var out = s; + inline for (.{ "px", "hw", "h", "xn", "r", "qkv", "att", "gu", "inv" }) |f| @field(out, f) += base; + return out; + } +}; + +/// Each norm as Torch's RMSNorm rounds it, bf16(w bf16(x inv)), the residual sum rounded first. +const round: cuda.norms.Tail = .{ .round = true }; + +pub const Tower = struct { + pub const Limits = struct { image_tokens: u32, max_images: u32 }; + /// A request's image tokens over all its images (--vision-image-tokens): one largest image, as HIP. + pub const default_image_tokens: u32 = max_patches / 4; + /// The chat template writes each image's open and close marks itself. + pub const template_wraps = true; + /// The template's name for an image part. + pub const part_type = "image"; + + marks: Marks = marks, + mark_ids: [3]u32 = mark_ids, + limits: Limits, + width: usize, // the decoder's hidden size: the merger's rows + gpa: Allocator, + io: std.Io, + d: *const cuda.Driver, + s: cuda.Stream, // the engine's stream, the one every encode runs on + c: cfg.Vision, + processor: image.Processor, + w: weights.Tower, + k: dense.kernels.Kernels, // the engine's norms, vit glue and SwiGLU + own: kern.Kernels, // the vision rotary and patch bias + att: vit.Attention, + gemms: vit.Gemms, + scratch: cuda.DeviceBuffer, + at: Scratch, + encodes: u64 = 0, // images that passed the grid checks into encode (the GB10 runner's count) + + /// The processor, the weights, the kernels and one call's scratch at max_patches; zero limits refused first. + pub fn open(gpa: Allocator, io: std.Io, ctx: *const cuda.Context, s: cuda.Stream, dir: []const u8, limits: Limits) !*Tower { + if (limits.image_tokens == 0 or limits.max_images == 0) return error.DotsVisionLimits; + const c = try cfg.Config.read(gpa, io, dir); + if (c.image_token != marks.image) return error.UnsupportedDotsConfig; + const processor = try image.Processor.read(gpa, io, dir, c); + const d = ctx.d; + const t = try gpa.create(Tower); + errdefer gpa.destroy(t); + var w = try weights.load(gpa, io, d, dir); + errdefer w.deinit(); + var k = try dense.kernels.Kernels.load(ctx, @import("cuda_recipe.zig").geometryOf(c)); + errdefer k.deinit(); + var own = try kern.Kernels.load(ctx); + errdefer own.deinit(); + var att = try vit.Attention.load(d); + errdefer att.unload(); + var gemms = try vit.Gemms.init(gpa, d); + errdefer gemms.deinit(); + const plan = Scratch.of(c.vision, max_patches); + var scratch = try cuda.DeviceBuffer.alloc(d, plan.bytes); + errdefer scratch.free(); + // runs first on failure: an upload whose wait failed lands before the scratch goes + errdefer cuda.completion.drain(d, .{ .d = d, .handle = null }, "dots.mocr's tower upload did not drain before its scratch was freed"); + const at = plan.at(scratch.ptr); + try cuda.copy_source.synchronousCopy(d, at.inv, std.mem.sliceAsBytes(&inv_freq), gpa); + t.* = .{ .limits = limits, .width = c.hidden, .gpa = gpa, .io = io, .d = d, .s = s, .c = c.vision, .processor = processor, .w = w, .k = k, .own = own, .att = att, .gemms = gemms, .scratch = scratch, .at = at }; + return t; + } + + /// The scratch at max_patches and the GEMM workspace (open's bytes beside the weights). + pub fn openBytes(a: Allocator, io: std.Io, dir: []const u8) !u64 { + const c = try cfg.Config.read(a, io, dir); + return Scratch.of(c.vision, max_patches).bytes + workspace_bytes; + } + + /// The tower's weights on the device, once every shard's header is checked. + pub fn weightBytes(a: Allocator, io: std.Io, dir: []const u8) !u64 { + const c = try cfg.Config.read(a, io, dir); + _ = try inventory.inspect(a, io, dir, c); + return weights.deviceBytes(a, c); + } + + /// The server's processor (on the HTTP thread): the slow Qwen2VL one, at most `max_tokens` tokens. + pub fn prepare(t: *Tower, a: Allocator, bytes: []const u8, max_tokens: u32) !image.Prepared { + return t.processor.prepare(t.io, a, bytes, max_tokens); + } + + pub fn explain(err: anyerror) ?[]const u8 { + return switch (err) { + error.DotsImageSize => "dots.mocr reads images of at least 28 pixels a side", + error.DotsImageBudget => "the image takes more image tokens than the request's budget (--vision-image-tokens) or dots.mocr's 14,400 an image", + error.DotsGrid => "the image's patches do not fill its grid in whole 2 x 2 merge blocks", + error.DotsVisionLimits => "--vision: dots.mocr takes at least one image token and one image a request", + else => core.picture.patches.problem(err), + }; + } + + /// Waits for the engine's stream before the scratch and the weights go. + pub fn deinit(t: *Tower) void { + cuda.completion.drain(t.d, t.s, "dots.mocr's image tower work did not drain before its buffers were freed"); + t.scratch.free(); + t.gemms.deinit(); + t.att.unload(); + t.own.deinit(); + t.k.deinit(); + t.w.deinit(); + t.gpa.destroy(t); + } + + /// One image's patches to its tokens' rows [tokens, width] bf16 at `out` on `s`; `taps` sees each stage's rows. + pub fn encode(t: *Tower, s: cuda.Stream, im: *const Image, out: u64, taps: ?Tap) !void { + const n = try rowsOf(t.c, im); + t.encodes += 1; + const hw = try t.gpa.alloc([2]u32, n); + defer t.gpa.free(hw); + try image.fillPositions(hw, im.gh, im.gw, t.c.merge); + const px = try t.gpa.alloc(u16, n * weights.patch_k); + defer t.gpa.free(px); + patchRows(px, im.pixels, patchWidth(t.c)); + try t.trim(s); + const a = t.at; + try cuda.copy_source.enqueue(t.d, a.hw, std.mem.sliceAsBytes(hw), s); + try cuda.copy_source.enqueue(t.d, a.px, std.mem.sliceAsBytes(px), s); + const h: usize = t.c.hidden; + const m: usize = t.c.intermediate; + const heads: usize = t.c.heads; + const eps = t.c.eps; + const k = &t.k; + const tap: Taps = .{ .tap = taps, .n = n, .width = h }; + try t.gemms.run(s, a.px, t.w.patch, a.r, n, h, weights.patch_k, .bf16); + try t.own.patchBias(s, a.r, t.w.patch_bias, a.r, n, h); + try tap.at("vision-patch-bias", a.r); + try k.norms.addRmsTail(s, a.r, null, t.w.patch_norm, a.r, a.h, null, n, h, eps, round); + try tap.at("vision-patch", a.h); + const scale: f32 = @floatCast(1.0 / @sqrt(@as(f64, @floatFromInt(h / heads)))); + for (t.w.blocks, 0..) |b, i| { + // the last block's MLP joins the residual here, as norm1's input + try k.norms.addRmsTail(s, a.h, if (i == 0) null else a.r, b.norm1, a.h, a.xn, null, n, h, eps, round); + if (i > 0) try tap.block(i - 1, a.h); + try t.gemms.run(s, a.xn, b.qkv, a.qkv, n, 3 * h, h, .bf16); + try t.own.visionRope(s, a.qkv, a.hw, a.inv, n); + try t.att.full(s, a.qkv, a.att, n, heads, h / heads, scale); + try t.gemms.run(s, a.att, b.proj, a.r, n, h, h, .bf16); + try k.norms.addRmsTail(s, a.h, a.r, b.norm2, a.h, a.xn, null, n, h, eps, round); + try t.gemms.run(s, a.xn, b.fc13, a.gu, n, 2 * m, h, .bf16); + try k.siluMul(s, a.gu, a.qkv, n, m); + try t.gemms.run(s, a.qkv, b.fc2, a.r, n, h, m, .bf16); + } + try k.norms.addRmsTail(s, a.h, a.r, t.w.post_norm, a.h, a.xn, null, n, h, eps, round); + try tap.block(t.w.blocks.len - 1, a.h); + try tap.at("vision-norm", a.xn); + // the merger: LayerNorm, then each merge block's four adjacent rows as one [4 hidden] row + try k.vit.layerNorm(s, a.xn, t.w.ln_w, t.w.ln_b, a.h, n, h, 1e-6); + const rows = n / 4; + const wide: usize = t.c.merged(); + try vit.linearAct(&t.gemms, &k.vit, s, a.gu, a.h, t.w.mlp0, t.w.mlp0_b, a.att, rows, wide, wide, null, a.r, .gelu); + try vit.linear(&t.gemms, &k.vit, s, a.gu, a.r, t.w.mlp2, t.w.mlp2_b, out, rows, t.width, wide); + if (taps) |tp| try tp.at(tp.ctx, "vision-merged", out, rows, t.width); + } + + /// Past max_plans shapes, the stream drains and the GEMM plans go; the workspace stays. + fn trim(t: *Tower, s: cuda.Stream) !void { + if (t.gemms.plans.count() < max_plans) return; + try s.synchronize(); + var it = t.gemms.plans.valueIterator(); + while (it.next()) |l| l.deinit(); + t.gemms.plans.clearRetainingCapacity(); + } +}; + +/// A patch's values: 3 channels of patch x patch pixels (588). +fn patchWidth(v: cfg.Vision) usize { + return 3 * @as(usize, v.patch) * v.patch; +} + +/// The image's patch rows, refused by name: a grid of whole merge blocks whose pixels and tokens it fills. +pub fn rowsOf(v: cfg.Vision, im: *const Image) error{ DotsGrid, DotsImageBudget }!usize { + const n = @as(usize, im.gh) * im.gw; + const blocks = @as(usize, v.merge) * v.merge; + if (n == 0 or im.gh % v.merge != 0 or im.gw % v.merge != 0) return error.DotsGrid; + if (n > max_patches) return error.DotsImageBudget; + if (im.pixels.len != n * patchWidth(v) or im.tokens != n / blocks) return error.DotsGrid; + return n; +} + +/// Patches [n, k] f32 to bf16 rows of patch_k, rounded to nearest even, the columns past k zero. +pub fn patchRows(dst: []u16, src: []const f32, k: usize) void { + @memset(dst, 0); + for (0..dst.len / weights.patch_k) |r| for (0..k) |c| { + dst[r * weights.patch_k + c] = bf16.bits(src[r * k + c]); + }; +} + +/// The tap, when given, called with a stage's rows [n, width]. +const Taps = struct { + tap: ?Tap, + n: usize, + width: usize, + + fn at(x: Taps, stage: []const u8, rows: u64) !void { + if (x.tap) |tp| try tp.at(tp.ctx, stage, rows, x.n, x.width); + } + + /// Block i's output: the residual once its MLP has joined it. + fn block(x: Taps, i: usize, rows: u64) !void { + if (x.tap == null) return; + var name: [32]u8 = undefined; + try x.at(try std.fmt.bufPrint(&name, "vision-block{d}", .{i}), rows); + } +}; + +test "the GEMM plans: below max_plans shapes they stay; at it the stream drains first, then every plan goes" { + const lt = cuda.cublaslt; + const Fake = struct { + var waits: usize = 0; + var destroyed: usize = 0; + fn wait(_: cuda.abi.Stream) callconv(.c) cuda.abi.Result { + waits += 1; + return 0; + } + fn handle(_: lt.Handle) callconv(.c) lt.Status { + destroyed += 1; + return 0; + } + fn desc(_: lt.MatmulDesc) callconv(.c) lt.Status { + destroyed += 1; + return 0; + } + fn layout(_: lt.Layout) callconv(.c) lt.Status { + destroyed += 1; + return 0; + } + fn pref(_: lt.Preference) callconv(.c) lt.Status { + destroyed += 1; + return 0; + } + }; + const a = std.testing.allocator; + var d: cuda.Driver = .{ .lib = undefined, .api = undefined }; + d.api.cuStreamSynchronize = Fake.wait; + var lib: lt.Library = .{ .lib = undefined, .api = undefined }; + lib.api.cublasLtDestroy = Fake.handle; + lib.api.cublasLtMatmulDescDestroy = Fake.desc; + lib.api.cublasLtMatrixLayoutDestroy = Fake.layout; + lib.api.cublasLtMatmulPreferenceDestroy = Fake.pref; + var t: Tower = undefined; + t.gemms.gpa = a; + t.gemms.plans = .empty; + defer t.gemms.plans.deinit(a); + const s: cuda.Stream = .{ .d = &d, .handle = @ptrFromInt(0x1800) }; + for (0..max_plans) |i| { + var p: lt.Linear = undefined; + p.lt = &lib; + try t.gemms.plans.put(a, .{ i, 0, 0 }, p); + if (i + 1 < max_plans) { + try t.trim(s); // the control: under the bound, nothing drains and nothing goes + try std.testing.expect(Fake.waits == 0 and Fake.destroyed == 0 and t.gemms.plans.count() == i + 1); + } + } + try t.trim(s); + try std.testing.expectEqual(@as(usize, 1), Fake.waits); + try std.testing.expectEqual(@as(usize, max_plans * 6), Fake.destroyed); // handle, desc, three layouts, preference + try std.testing.expectEqual(@as(usize, 0), t.gemms.plans.count()); + cuda.copy_source.dropSpares(&d, cuda.copy_source.current()); +} diff --git a/zig/src/families/dots_mocr/cuda_tower_test.zig b/zig/src/families/dots_mocr/cuda_tower_test.zig new file mode 100644 index 00000000000..ac5ece4eafa --- /dev/null +++ b/zig/src/families/dots_mocr/cuda_tower_test.zig @@ -0,0 +1,148 @@ +//! dots.mocr's CUDA image tower on the host: its contract, bytes, inverse frequencies, refusals and patch rows. +const std = @import("std"); +const cuda = @import("cuda"); +const dense = @import("cuda_dense"); +const bf16 = @import("core").bf16_round; +const cfg = @import("config.zig"); +const fixtures = @import("config_test.zig"); +const image = @import("image.zig"); +const recipe = @import("cuda_recipe.zig"); +const tw = @import("cuda_tower.zig"); +const weights = @import("cuda_tower_weights.zig"); +const t = std.testing; + +const Tower = tw.Tower; +const native = dense.Native(recipe); + +fn config() !cfg.Config { + return cfg.Config.parse(t.allocator, fixtures.sample, fixtures.generation); +} + +const Dir = @import("sparse_checkpoint_test.zig").Dir; + +test "dots tower: the engine's contract, the host's vision decls, its marks and the template's own wrapping" { + comptime dense.recipe.checkTower(Tower); + try t.expect(comptime dense.recipe.towerProblem(Tower) == null); + try t.expect(comptime dense.recipe.towerOf(recipe).? == Tower); + try t.expect(@FieldType(native.Options, "vision") == ?Tower.Limits); + try t.expect(@FieldType(native.Loaded, "vision") == ?*Tower); + try t.expectEqual(@as(u32, 14400), native.default_image_tokens); + try t.expectEqual(tw.Marks{ .open = 151666, .image = 151665, .close = 151667 }, tw.marks); + try t.expectEqual([3]u32{ 151666, 151665, 151667 }, tw.mark_ids); + try t.expectEqual((try config()).image_token, tw.marks.image); + try t.expect(Tower.template_wraps and std.mem.eql(u8, Tower.part_type, "image")); +} + +test "dots tower: the largest image is the processor's own, 14,400 tokens of 2 x 2 patches" { + const c = try config(); + const p = try image.Processor.parse(t.allocator, @embedFile("fixtures/preprocessor_config.json"), c); + try t.expectEqual(@as(u64, tw.max_patches), p.patches.max_pixels / (@as(u64, c.vision.patch) * c.vision.patch)); + try t.expectEqual(@as(u32, tw.max_patches / 4), Tower.default_image_tokens); +} + +test "dots tower scratch: 39,592 bytes a patch, the merger's buffers inside the blocks' own" { + const v = (try config()).vision; + const one = tw.Scratch.of(v, 256); // 256 rows: every part a whole number of 256-byte blocks + try t.expectEqual(@as(u64, 256 * 39592 + 256), one.bytes); + const p = tw.max_patches; + const s = tw.Scratch.of(v, p); + const h: u64 = v.hidden; + try t.expectEqual(@as(u64, p * (592 * 2 + 8 + 4 * 1536 * 2 + 3 * 1536 * 2 + 2 * 4224 * 2) + 256), s.bytes); + try t.expectEqual(@as(u64, 2_280_499_456), s.bytes); + try t.expect(s.px == 0 and s.hw == p * 592 * 2 and s.inv == s.bytes - 256); + try t.expect(s.qkv + p * @as(u64, v.intermediate) * 2 <= s.att); // the SwiGLU's rows in q|k|v's + try t.expect(s.gu + p / 4 * @as(u64, v.merged()) * 4 <= s.inv); // the merger's f32 sums in fc1|fc3's + try t.expect(s.att + p / 4 * @as(u64, v.merged()) * 2 <= s.gu); // its first linear in attention's rows + try t.expect(s.r + p / 4 * @as(u64, v.merged()) * 2 <= s.qkv and s.h + p * h * 2 <= s.xn); +} + +test "dots tower bytes: weights 2,524,194,816 on the device, the scratch and workspace beside them, visionBytes their sum" { + const a = t.allocator; + const io = t.io; + var d = try Dir.init(true, null); + defer d.deinit(); + try t.expectEqual(@as(u64, 2_524_194_816), try Tower.weightBytes(a, io, d.path)); + const open = 57600 * 39592 + 256 + (32 << 20); + try t.expectEqual(@as(u64, 2_314_053_888), open); + try t.expectEqual(@as(u64, open), try Tower.openBytes(a, io, d.path)); + try t.expectEqual(@as(u64, 2_524_194_816 + open), try native.visionBytes(a, io, d.path)); + var bare = try Dir.init(false, null); // no shards: nothing to count + defer bare.deinit(); + try t.expectError(error.FileNotFound, Tower.weightBytes(a, io, bare.path)); + try t.expectEqual(@as(u64, open), try Tower.openBytes(a, io, bare.path)); + var short = try Dir.init(true, "vision_tower.merger.mlp.2.bias"); // the planted control: a tower tensor missing + defer short.deinit(); + try t.expectError(error.DotsTensorCount, Tower.weightBytes(a, io, short.path)); +} + +/// The first entry where two tables' bits differ. +fn firstDiff(x: []const f32, y: []const f32) ?usize { + for (x, y, 0..) |p, q, i| if (@as(u32, @bitCast(p)) != @as(u32, @bitCast(q))) return i; + return null; +} + +test "dots tower rotary: the fixture's 32 frequencies equal the float32 table 1 / 10000^(2i / 64) bit for bit" { + var host: [tw.rope_pairs]f32 = undefined; + dense.rope.inverse(10000, 64, &host); + try t.expectEqual(@as(?usize, null), firstDiff(&tw.inv_freq, &host)); + try t.expectEqual(@as(f32, 1), tw.inv_freq[0]); + var off = host; // the planted control: one entry an ulp away is seen + off[27] = @bitCast(@as(u32, @bitCast(off[27])) + 1); + try t.expectEqual(@as(?usize, 27), firstDiff(&tw.inv_freq, &off)); +} + +test "dots tower refusals: each new error worded through the engine's explain, an unknown one not" { + for ([_]anyerror{ error.DotsImageSize, error.DotsImageBudget, error.DotsGrid, error.DotsVisionLimits }) |e| { + try t.expect(Tower.explain(e) != null); + try t.expectEqualStrings(Tower.explain(e).?, native.explain(null, e).?); + } + try t.expect(std.mem.indexOf(u8, Tower.explain(error.DotsImageBudget).?, "(--vision-image-tokens)") != null); + try t.expectStringStartsWith(Tower.explain(error.AspectRatio).?, "its longer side"); + try t.expect(Tower.explain(error.DotsTowerUnheardOf) == null); // the control: not every error has words + try t.expect(native.explain(null, error.DotsShape) != null); // the weights' own refusals: the recipe's words +} + +fn grid(gh: u32, gw: u32, pixels: []const f32, tokens: u32) dense.recipe.Image { + return .{ .pixels = pixels, .gh = gh, .gw = gw, .at = 0, .tokens = tokens }; +} + +test "dots tower images: whole 2 x 2 merge blocks whose pixels and tokens fill the grid, at most 57,600 patches" { + const v = (try config()).vision; + const px = try t.allocator.alloc(f32, 4 * 6 * 588); + defer t.allocator.free(px); + try t.expectEqual(@as(usize, 24), try tw.rowsOf(v, &grid(4, 6, px, 6))); // the control: a whole grid passes + try t.expectError(error.DotsGrid, tw.rowsOf(v, &grid(3, 8, px, 6))); + try t.expectError(error.DotsGrid, tw.rowsOf(v, &grid(4, 6, px, 5))); + try t.expectError(error.DotsGrid, tw.rowsOf(v, &grid(4, 6, px[1..], 6))); + try t.expectError(error.DotsGrid, tw.rowsOf(v, &grid(0, 6, px, 0))); + const most: []const f32 = @as([*]const f32, @ptrFromInt(0x1000))[0 .. 240 * 240 * 588]; // its length alone is read + try t.expectEqual(@as(usize, 57600), try tw.rowsOf(v, &grid(240, 240, most, 14400))); + try t.expectError(error.DotsImageBudget, tw.rowsOf(v, &grid(240, 242, most, 14520))); +} + +test "dots tower patches: bf16 rows of 592, rounded to nearest even, the four columns past 588 zero" { + var src: [2 * 588]f32 = undefined; + for (&src, 0..) |*x, i| x.* = @as(f32, @floatFromInt(i)) * 0.001 - 0.5; + src[0] = 1.00390625; // half a bf16 step above 1: ties to even, to 1 + src[1] = 1.01171875; // half a step above 1.0078125: to 1.015625 + var dst: [2 * weights.patch_k]u16 = @splat(0xAAAA); + tw.patchRows(&dst, &src, 588); + try t.expectEqual(@as(u16, 0x3f80), dst[0]); + try t.expectEqual(@as(u16, 0x3f82), dst[1]); + for (0..2) |r| { + for (0..588) |c| try t.expectEqual(bf16.bits(src[r * 588 + c]), dst[r * weights.patch_k + c]); + for (588..weights.patch_k) |c| try t.expectEqual(@as(u16, 0), dst[r * weights.patch_k + c]); + } +} + +test "dots tower open: zero limits refused before the config is read; valid ones read the processor's file" { + const a = t.allocator; + var d = try Dir.init(false, null); // no preprocessor_config.json + defer d.deinit(); + const ctx: *const cuda.Context = undefined; // neither call reaches the device + const s: cuda.Stream = undefined; + try t.expectError(error.DotsVisionLimits, Tower.open(a, t.io, ctx, s, d.path, .{ .image_tokens = 0, .max_images = 1 })); + try t.expectError(error.DotsVisionLimits, Tower.open(a, t.io, ctx, s, d.path, .{ .image_tokens = 14400, .max_images = 0 })); + // the control + try t.expectError(error.FileNotFound, Tower.open(a, t.io, ctx, s, d.path, .{ .image_tokens = 14400, .max_images = 1 })); +} diff --git a/zig/src/families/dots_mocr/fixtures/README.md b/zig/src/families/dots_mocr/fixtures/README.md index a7da034f4a4..fc8e3646b26 100644 --- a/zig/src/families/dots_mocr/fixtures/README.md +++ b/zig/src/families/dots_mocr/fixtures/README.md @@ -57,6 +57,18 @@ head dim 128), dumped by the oracle's `text` mode (`rope-inv_freq.npy`). The CUDA recipe uploads them as they are, because Torch's CPU `powf` is not correctly rounded: entry 37 is one ulp from the correctly rounded value. +`vision_inv_freq.txt` holds the 32 float32 bit patterns of the tower's +rotary `inv_freq` (theta 10,000, dim 64) as the checkpoint's Transformers +model holds them on the GB10, dumped by the oracle as +`vision-rope-inv_freq.npy`. They equal the correctly rounded table, which +the host test checks bit for bit. + +`own-prompts.json` holds three prompts of our own as token ids +(`short`, `page` and `chunks`: 18, 578 and 2,537 ids), the GB10 runner's +`dots-text` input. Their text is our own `ownprompts.py` (in #2673's +description), each rendered as one user turn with the checkpoint's chat +template and tokenized by the pinned oracle (Transformers 4.57.6). + ## OCR reader fixtures The reader's prompt (`../prompt.txt`) and both test pages are written diff --git a/zig/src/families/dots_mocr/fixtures/own-prompts.json b/zig/src/families/dots_mocr/fixtures/own-prompts.json new file mode 100644 index 00000000000..fee7f444503 --- /dev/null +++ b/zig/src/families/dots_mocr/fixtures/own-prompts.json @@ -0,0 +1 @@ +{"short": [151670, 641, 1378, 22870, 11, 1128, 1558, 458, 80577, 1614, 653, 448, 264, 47448, 24615, 30, 151671, 151672], "page": [151670, 32, 2070, 5185, 389, 5290, 5567, 7586, 448, 264, 11129, 43558, 1614, 382, 785, 22881, 18010, 21189, 911, 35398, 5567, 7586, 264, 1899, 13, 8886, 1352, 702, 264, 16709, 4247, 448, 279, 27813, 594, 829, 11, 264, 5827, 315, 198, 2028, 14697, 369, 279, 3947, 943, 11, 2326, 98389, 5128, 369, 279, 2874, 315, 279, 3947, 11, 323, 264, 11957, 2504, 13, 576, 5570, 198, 265, 1313, 1449, 1352, 1119, 279, 7424, 1849, 11, 892, 4990, 4743, 311, 11627, 4420, 264, 1352, 323, 38919, 264, 19496, 1465, 304, 198, 1432, 398, 825, 1352, 700, 315, 29235, 13, 7496, 5975, 525, 56950, 18509, 304, 12713, 323, 4540, 5109, 382, 1654, 6679, 2326, 19827, 13, 576, 1156, 572, 264, 3811, 36052, 25, 432, 1730, 279, 14697, 553, 862, 16709, 23806, 323, 1349, 279, 198, 34155, 15423, 553, 25009, 6319, 15751, 13, 1084, 6439, 389, 4240, 42639, 323, 4641, 389, 7586, 429, 1030, 1012, 47035, 11, 1576, 279, 11555, 198, 1056, 27031, 279, 5827, 323, 6966, 1075, 264, 9341, 13, 576, 2086, 5486, 3208, 279, 4361, 2150, 311, 264, 4586, 6236, 1614, 323, 4588, 198, 1958, 279, 5043, 438, 4718, 13, 576, 11253, 1033, 57768, 11, 714, 279, 1614, 7025, 10199, 264, 2070, 429, 279, 8720, 1030, 2115, 4287, 345, 437, 432, 2581, 1053, 979, 432, 572, 42903, 13, 576, 4843, 5486, 1483, 264, 2613, 1614, 16176, 1172, 389, 9293, 13, 1084, 5927, 1817, 198, 1318, 2504, 448, 1181, 2309, 389, 279, 2150, 11, 8604, 4287, 5043, 4287, 11, 323, 21774, 279, 91709, 438, 5326, 11, 2670, 279, 198, 22722, 594, 1828, 42429, 382, 3838, 1865, 279, 4843, 5486, 5390, 572, 537, 13403, 7484, 13, 576, 9892, 1077, 279, 5570, 1779, 264, 2070, 553, 3330, 518, 279, 198, 24063, 7702, 389, 279, 8569, 11, 773, 264, 55514, 1410, 7683, 264, 4361, 1352, 304, 1212, 264, 9383, 13, 576, 1614, 594, 2550, 1083, 19613, 279, 198, 24063, 979, 279, 1852, 8569, 572, 3208, 10917, 11, 892, 80620, 369, 279, 24275, 1487, 25, 264, 3255, 429, 4344, 389, 264, 22683, 4157, 387, 198, 83837, 11, 1496, 979, 2176, 11253, 1401, 13276, 382, 785, 2783, 3108, 572, 4285, 311, 6629, 13, 576, 3811, 36052, 4362, 264, 1899, 315, 6505, 369, 1817, 501, 1352, 6789, 323, 14422, 198, 9309, 279, 27813, 312, 52213, 279, 1352, 448, 264, 90429, 4745, 13, 576, 4586, 6236, 1614, 4362, 902, 6505, 11, 714, 1449, 4226, 1030, 198, 983, 387, 1349, 304, 2480, 11, 1576, 1181, 20643, 6966, 1075, 4396, 1467, 13, 576, 2197, 1614, 4362, 902, 6505, 2987, 11, 323, 1181, 198, 78924, 2050, 1033, 8661, 311, 1490, 25, 264, 5786, 878, 15723, 7578, 4766, 264, 3745, 6693, 2309, 14283, 518, 279, 8569, 11, 773, 279, 55514, 6966, 198, 266, 825, 2613, 3082, 4518, 315, 279, 4361, 2150, 13, 6065, 1378, 5555, 279, 18010, 6781, 911, 3040, 5570, 4115, 264, 1899, 11, 323, 279, 1465, 198, 7698, 304, 279, 7424, 11052, 311, 825, 1352, 304, 52374, 382, 5002, 4755, 7146, 13, 23572, 304, 1378, 15459, 58117, 279, 5290, 1973, 11, 49212, 429, 3421, 16709, 1467, 525, 1349, 438, 949, 198, 1055, 432, 11, 323, 1602, 37578, 46118, 374, 35157, 2041, 894, 1841, 429, 2494, 572, 1052, 13, 362, 1795, 5239, 1265, 6629, 1246, 3545, 198, 9547, 1142, 8573, 389, 264, 2254, 315, 1931, 22881, 11, 1573, 894, 2297, 311, 279, 1614, 476, 279, 9934, 382, 7985, 264, 2805, 12126, 315, 419, 5185, 369, 264, 6645, 879, 702, 537, 1349, 432, 11, 304, 4236, 17432, 3501, 13, 151671, 151672], "chunks": [151670, 785, 1965, 3685, 374, 264, 5591, 1760, 504, 264, 2613, 25073, 13, 53573, 25, 1555, 11, 1509, 11, 2747, 11, 8153, 389, 1424, 11, 2400, 29994, 382, 91, 7083, 760, 5739, 760, 12911, 760, 35181, 760, 4504, 291, 9248, 91, 4421, 91, 4421, 91, 4421, 91, 4421, 91, 4421, 7360, 91, 220, 15, 15, 16, 760, 10464, 220, 15, 13, 23, 9465, 760, 7083, 220, 22, 760, 220, 19, 19, 20, 760, 220, 17, 18, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 17, 760, 14652, 18131, 220, 17, 15, 15, 760, 9590, 3054, 760, 220, 23, 23, 18, 760, 220, 16, 23, 13, 15, 18, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 18, 760, 18043, 220, 21, 15, 23, 760, 7083, 220, 18, 760, 220, 20, 18, 23, 760, 220, 16, 18, 13, 15, 18, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 19, 760, 2383, 6502, 760, 44101, 425, 760, 220, 20, 15, 23, 760, 220, 17, 18, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 20, 760, 14652, 18131, 220, 17, 15, 15, 760, 27167, 22708, 760, 220, 16, 21, 15, 760, 220, 15, 17, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 21, 760, 2383, 6502, 760, 44101, 425, 760, 220, 22, 24, 18, 760, 220, 17, 16, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 22, 760, 12327, 220, 16, 17, 9465, 760, 4787, 3553, 760, 220, 23, 16, 22, 760, 220, 16, 20, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 23, 760, 14652, 18131, 220, 17, 15, 15, 760, 7083, 220, 18, 760, 220, 17, 15, 19, 760, 220, 16, 24, 13, 16, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 15, 24, 760, 52892, 386, 21, 760, 7083, 220, 22, 760, 220, 21, 20, 21, 760, 220, 16, 19, 13, 15, 18, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 15, 760, 9979, 386, 23, 760, 27167, 22708, 760, 220, 17, 21, 17, 760, 220, 17, 15, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 16, 760, 31851, 220, 16, 17, 647, 760, 7083, 220, 18, 760, 220, 20, 21, 17, 760, 220, 16, 20, 13, 15, 24, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 17, 760, 31851, 220, 16, 17, 647, 760, 4787, 3553, 760, 220, 21, 23, 20, 760, 220, 16, 18, 13, 15, 18, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 18, 760, 14652, 18131, 220, 17, 15, 15, 760, 4787, 3553, 760, 220, 22, 15, 20, 760, 220, 16, 18, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 19, 760, 43129, 295, 220, 19, 87, 16, 15, 760, 7083, 220, 18, 760, 220, 22, 22, 18, 760, 220, 16, 20, 13, 16, 15, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 20, 760, 10464, 220, 15, 13, 23, 9465, 760, 44101, 425, 760, 220, 16, 23, 760, 220, 15, 18, 13, 16, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 21, 760, 75593, 220, 23, 15, 9465, 760, 9590, 3054, 760, 220, 22, 18, 15, 760, 220, 16, 18, 13, 15, 24, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 22, 760, 75593, 220, 23, 15, 9465, 760, 44101, 425, 760, 220, 19, 17, 24, 760, 220, 17, 18, 13, 15, 23, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 23, 760, 21966, 220, 19, 87, 19, 15, 760, 44101, 425, 760, 220, 20, 15, 15, 760, 220, 15, 22, 13, 15, 23, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 16, 24, 760, 21966, 220, 19, 87, 19, 15, 760, 7083, 220, 18, 760, 220, 21, 20, 22, 760, 220, 16, 24, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 15, 760, 18043, 220, 21, 15, 23, 760, 7083, 220, 18, 760, 220, 19, 15, 24, 760, 220, 17, 18, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 16, 760, 10464, 220, 15, 13, 23, 9465, 760, 7083, 220, 22, 760, 220, 23, 23, 18, 760, 220, 15, 24, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 17, 760, 18043, 220, 21, 15, 23, 760, 7083, 220, 18, 760, 220, 18, 17, 760, 220, 17, 18, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 18, 760, 12327, 220, 16, 17, 9465, 760, 7083, 220, 18, 760, 220, 18, 17, 16, 760, 220, 15, 17, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 19, 760, 31851, 220, 16, 17, 647, 760, 44101, 425, 760, 220, 18, 19, 22, 760, 220, 16, 20, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 20, 760, 75593, 220, 23, 15, 9465, 760, 27167, 22708, 760, 220, 19, 17, 24, 760, 220, 16, 17, 13, 15, 23, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 21, 760, 342, 9553, 220, 18, 17, 9465, 760, 44101, 425, 760, 220, 17, 18, 17, 760, 220, 17, 20, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 22, 760, 52892, 386, 21, 760, 7083, 220, 18, 760, 220, 21, 17, 16, 760, 220, 17, 16, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 23, 760, 21966, 220, 19, 87, 19, 15, 760, 27167, 22708, 760, 220, 16, 24, 22, 760, 220, 16, 16, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 17, 24, 760, 52892, 386, 21, 760, 4787, 3553, 760, 220, 19, 19, 22, 760, 220, 15, 21, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 15, 760, 14652, 18131, 220, 17, 15, 15, 760, 7083, 220, 18, 760, 220, 18, 17, 17, 760, 220, 17, 18, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 16, 760, 8983, 220, 18, 87, 16, 21, 760, 7083, 220, 22, 760, 220, 18, 19, 15, 760, 220, 17, 16, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 17, 760, 8983, 220, 18, 87, 16, 21, 760, 44101, 425, 760, 220, 19, 16, 15, 760, 220, 15, 19, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 18, 760, 18043, 220, 21, 15, 23, 760, 44101, 425, 760, 220, 22, 21, 17, 760, 220, 16, 16, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 19, 760, 31851, 220, 16, 17, 647, 760, 7083, 220, 22, 760, 220, 20, 17, 22, 760, 220, 15, 24, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 20, 760, 31702, 220, 20, 362, 760, 7083, 220, 18, 760, 220, 19, 19, 19, 760, 220, 17, 15, 13, 15, 23, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 21, 760, 8983, 220, 18, 87, 16, 21, 760, 7083, 220, 18, 760, 220, 16, 22, 17, 760, 220, 15, 20, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 22, 760, 52892, 386, 21, 760, 44101, 425, 760, 220, 23, 17, 15, 760, 220, 17, 15, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 23, 760, 25349, 220, 17, 15, 87, 18, 15, 760, 4787, 3553, 760, 220, 21, 18, 16, 760, 220, 17, 16, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 18, 24, 760, 25349, 220, 17, 15, 87, 18, 15, 760, 4787, 3553, 760, 220, 17, 24, 18, 760, 220, 15, 16, 13, 16, 15, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 15, 760, 21966, 220, 19, 87, 19, 15, 760, 9590, 3054, 760, 220, 19, 16, 18, 760, 220, 16, 23, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 16, 760, 10464, 220, 15, 13, 23, 9465, 760, 7083, 220, 22, 760, 220, 17, 17, 22, 760, 220, 17, 18, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 17, 760, 31842, 386, 21, 87, 17, 15, 760, 7083, 220, 18, 760, 220, 19, 24, 17, 760, 220, 16, 21, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 18, 760, 25349, 220, 17, 15, 87, 18, 15, 760, 44101, 425, 760, 220, 17, 20, 20, 760, 220, 16, 21, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 19, 760, 21966, 220, 19, 87, 19, 15, 760, 44101, 425, 760, 220, 22, 16, 760, 220, 17, 20, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 20, 760, 2383, 6502, 760, 27167, 22708, 760, 220, 21, 19, 23, 760, 220, 16, 19, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 21, 760, 342, 9553, 220, 18, 17, 9465, 760, 7083, 220, 18, 760, 220, 16, 15, 21, 760, 220, 16, 22, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 22, 760, 9979, 386, 23, 760, 4787, 3553, 760, 220, 20, 21, 23, 760, 220, 15, 17, 13, 16, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 23, 760, 31842, 386, 21, 87, 17, 15, 760, 7083, 220, 18, 760, 220, 20, 16, 23, 760, 220, 16, 22, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 19, 24, 760, 43129, 295, 220, 19, 87, 16, 15, 760, 27167, 22708, 760, 220, 22, 16, 760, 220, 17, 23, 13, 15, 19, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 15, 760, 8983, 220, 18, 87, 16, 21, 760, 9590, 3054, 760, 220, 22, 18, 17, 760, 220, 16, 23, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 16, 760, 21966, 220, 19, 87, 19, 15, 760, 9590, 3054, 760, 220, 16, 20, 18, 760, 220, 16, 21, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 17, 760, 9979, 386, 23, 760, 9590, 3054, 760, 220, 21, 17, 23, 760, 220, 16, 15, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 18, 760, 21966, 220, 19, 87, 19, 15, 760, 7083, 220, 18, 760, 220, 16, 17, 19, 760, 220, 16, 24, 13, 15, 21, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 19, 760, 14652, 18131, 220, 17, 15, 15, 760, 27167, 22708, 760, 220, 18, 760, 220, 17, 18, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 20, 760, 31702, 220, 20, 362, 760, 4787, 3553, 760, 220, 18, 18, 23, 760, 220, 15, 21, 13, 15, 24, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 21, 760, 31851, 220, 16, 17, 647, 760, 7083, 220, 22, 760, 220, 16, 22, 24, 760, 220, 17, 23, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 22, 760, 31851, 220, 16, 17, 647, 760, 7083, 220, 22, 760, 220, 16, 24, 24, 760, 220, 17, 16, 13, 15, 23, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 23, 760, 342, 9553, 220, 18, 17, 9465, 760, 7083, 220, 22, 760, 220, 17, 21, 24, 760, 220, 17, 15, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 20, 24, 760, 9979, 386, 23, 760, 4787, 3553, 760, 220, 19, 23, 24, 760, 220, 15, 24, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 15, 760, 31851, 220, 16, 17, 647, 760, 7083, 220, 18, 760, 220, 18, 17, 19, 760, 220, 17, 23, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 16, 760, 2383, 6502, 760, 7083, 220, 22, 760, 220, 21, 24, 21, 760, 220, 17, 19, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 17, 760, 2383, 6502, 760, 9590, 3054, 760, 220, 20, 17, 760, 220, 16, 16, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 18, 760, 12327, 220, 16, 17, 9465, 760, 44101, 425, 760, 220, 17, 17, 15, 760, 220, 15, 19, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 19, 760, 43129, 295, 220, 19, 87, 16, 15, 760, 7083, 220, 18, 760, 220, 17, 23, 21, 760, 220, 17, 15, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 20, 760, 12327, 220, 16, 17, 9465, 760, 4787, 3553, 760, 220, 17, 20, 20, 760, 220, 16, 18, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 21, 760, 10464, 220, 15, 13, 23, 9465, 760, 27167, 22708, 760, 220, 21, 15, 20, 760, 220, 17, 22, 13, 15, 22, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 22, 760, 14652, 18131, 220, 17, 15, 15, 760, 27167, 22708, 760, 220, 17, 21, 19, 760, 220, 15, 22, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 23, 760, 12327, 220, 16, 17, 9465, 760, 7083, 220, 22, 760, 220, 22, 20, 18, 760, 220, 17, 20, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 21, 24, 760, 18043, 220, 21, 15, 23, 760, 44101, 425, 760, 220, 18, 19, 21, 760, 220, 16, 18, 13, 15, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 15, 760, 342, 9553, 220, 18, 17, 9465, 760, 7083, 220, 18, 760, 220, 18, 19, 21, 760, 220, 17, 19, 13, 15, 20, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 16, 760, 31702, 220, 20, 362, 760, 7083, 220, 22, 760, 220, 19, 22, 15, 760, 220, 16, 17, 13, 15, 17, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 17, 760, 18043, 220, 21, 15, 23, 760, 44101, 425, 760, 220, 17, 20, 18, 760, 220, 15, 21, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 18, 760, 2383, 6502, 760, 7083, 220, 22, 760, 220, 24, 22, 760, 220, 16, 19, 13, 16, 15, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 19, 760, 31842, 386, 21, 87, 17, 15, 760, 27167, 22708, 760, 220, 23, 17, 16, 760, 220, 15, 21, 13, 15, 24, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 20, 760, 43129, 295, 220, 19, 87, 16, 15, 760, 44101, 425, 760, 220, 18, 20, 15, 760, 220, 17, 15, 13, 16, 16, 13, 17, 15, 17, 21, 9248, 91, 220, 15, 22, 21, 760, 31851, 220, 16, 17, 647, 760, 27167, 22708, 760, 220, 20, 17, 19, 760, 220, 16, 21, 13, 15, 20, 13, 17, 15, 17, 21, 35721, 852, 279, 2326, 6594, 448, 279, 1429, 8153, 304, 2790, 11, 1221, 829, 1449, 1509, 429, 702, 7168, 8153, 12379, 13, 151671, 151672]} \ No newline at end of file diff --git a/zig/src/families/dots_mocr/fixtures/vision_inv_freq.txt b/zig/src/families/dots_mocr/fixtures/vision_inv_freq.txt new file mode 100644 index 00000000000..0cb58993a24 --- /dev/null +++ b/zig/src/families/dots_mocr/fixtures/vision_inv_freq.txt @@ -0,0 +1 @@ +0x3f800000,0x3f3ff911,0x3f0ff59a,0x3ed7e89b,0x3ea1e89b,0x3e72d423,0x3e361887,0x3e088d77,0x3dcccccd,0x3d99940d,0x3d6655c2,0x3d2cba15,0x3d0186e3,0x3cc2434f,0x3c91ad39,0x3c5a7bf2,0x3c23d70a,0x3bf5b9b0,0x3bb8449c,0x3b8a2e77,0x3b4f3e38,0x3b1b690d,0x3ae91528,0x3aaec98e,0x3a83126f,0x3a44948c,0x3a136a16,0x39dd1725,0x39a5cb60,0x3978a815,0x393a7753,0x390bd472 diff --git a/zig/src/families/flashnext/cuda_batch.zig b/zig/src/families/flashnext/cuda_batch.zig index bd1b87e63fb..e1ce349aa16 100644 --- a/zig/src/families/flashnext/cuda_batch.zig +++ b/zig/src/families/flashnext/cuda_batch.zig @@ -583,9 +583,9 @@ pub fn Pass(comptime Tri: type) type { }; } -test "a pass's scratch at the dense cap stays near a gigabyte and a half" { +test "a pass's scratch at the default chunk stays under three gigabytes" { _ = @import("cuda_paging_batch_test.zig"); - try std.testing.expect(Scratch.bytes(default_chunk, .{ .head_rows = default_chunk }) < 2 << 30); + try std.testing.expect(Scratch.bytes(default_chunk, .{ .head_rows = default_chunk }) < 3 << 30); try std.testing.expect(Scratch.bytes(1, .{}) < Scratch.bytes(2, .{})); try std.testing.expect(Scratch.bytes(4096, .{ .lane_reduce = false }) < Scratch.bytes(4096, .{})); } diff --git a/zig/src/families/flashnext/cuda_batch_state.zig b/zig/src/families/flashnext/cuda_batch_state.zig index 959ced3b65b..80d3d073b76 100644 --- a/zig/src/families/flashnext/cuda_batch_state.zig +++ b/zig/src/families/flashnext/cuda_batch_state.zig @@ -53,7 +53,7 @@ pub const attn_lanes: usize = 32; pub const lanes_ptrs: usize = (wt.layers_n / 4) * attn_lanes * 4 * 8; pub const lanes_bytes: usize = lanes_ptrs + (4 * attn_lanes + att_rows) * 4; /// Rows a pass holds at most unless asked for more. -pub const default_chunk: usize = 1536; +pub const default_chunk: usize = 3072; /// The most rows TF_FLASHNEXT_CHUNK may ask for (the largest measured pass; its scratch is about 13 GiB more). pub const max_chunk: usize = 16384; const ratio = wt.index_ratio; diff --git a/zig/src/families/flashnext/cuda_chunk.zig b/zig/src/families/flashnext/cuda_chunk.zig index 65577d1f157..c6af34e07f5 100644 --- a/zig/src/families/flashnext/cuda_chunk.zig +++ b/zig/src/families/flashnext/cuda_chunk.zig @@ -44,7 +44,8 @@ pub fn readoutTileRows() usize { test "TF_FLASHNEXT_CHUNK takes 1 to the largest measured pass and refuses the rest" { try std.testing.expectEqual(batch.default_chunk, try parseChunk(null)); - try std.testing.expectEqual(@as(usize, 1536), try parseChunk("")); + try std.testing.expectEqual(batch.default_chunk, try parseChunk("")); + try std.testing.expectEqual(@as(usize, 1536), try parseChunk("1536")); try std.testing.expectEqual(@as(usize, 4096), try parseChunk("4096")); try std.testing.expectEqual(batch.max_chunk, try parseChunk("16384")); for ([_][]const u8{ "0", "16385", "-1", "4k" }) |bad| try std.testing.expectError(error.BadChunk, parseChunk(bad)); diff --git a/zig/src/families/flashnext/cuda_kv_arena.zig b/zig/src/families/flashnext/cuda_kv_arena.zig new file mode 100644 index 00000000000..2a31cc3b46a --- /dev/null +++ b/zig/src/families/flashnext/cuda_kv_arena.zig @@ -0,0 +1,529 @@ +//! The paged pool's arena as one reserved range of 256 MiB physical pieces, each mapped when a page in it is first used +const std = @import("std"); +const cuda = @import("cuda"); + +/// Bytes of one physical piece. +pub const piece_bytes: usize = 256 << 20; + +/// Maps pieces at chosen places through a backend whose next chunk lands where `seek` put it (cuda.arena.Vmm). +pub const Mapper = struct { + be: cuda.arena.Backend, + seek: *const fn (ctx: *anyopaque, at: u64) void, + + fn vmm(v: *cuda.arena.Vmm) Mapper { + return .{ .be = v.backend(), .seek = seekVmm }; + } + fn seekVmm(ctx: *anyopaque, at: u64) void { + const v: *cuda.arena.Vmm = @ptrCast(@alignCast(ctx)); + v.next = at; + } +}; + +/// A reserved range of `len` bytes whose pieces of `piece` bytes are mapped on first use; `mapped` one flag a piece. +pub const Lazy = struct { + base: u64, + len: usize, + piece: usize, + mapped: []bool, + + /// The pieces over [off, off + n) not mapped yet, mapped now; `zero` clears each new one. LaneMemory: no memory. + pub fn ensure(z: *Lazy, m: Mapper, off: u64, n: u64, zero: anytype) !void { + if (n == 0) return; + if (off + n > z.len) return error.LaneMemory; + var k: usize = @intCast(off / z.piece); + while (k * z.piece < off + n) : (k += 1) { + if (z.mapped[k]) continue; + try z.mapPiece(m, k, zero); + z.mapped[k] = true; + } + } + + /// Piece `k` mapped at its place and zeroed, not marked; whatever fails, it goes back. + fn mapPiece(z: *const Lazy, m: Mapper, k: usize, zero: anytype) !void { + const at = z.base + k * z.piece; + const len = @min(z.piece, z.len - k * z.piece); + m.seek(m.be.ctx, at); + const got = m.be.chunk(m.be.ctx, len) orelse return error.LaneMemory; + if (got != at) { // not at its place: the range would not hold the page + m.be.release(m.be.ctx, got, len); + return error.LaneMemory; + } + zero.piece(at, len) catch |err| { // not zeroed: it goes back, unmarked, as a piece that would not map + m.be.release(m.be.ctx, at, len); + return err; + }; + } + + /// Every mapped piece goes back. + pub fn unmapAll(z: *Lazy, m: Mapper) void { + for (z.mapped, 0..) |*f, k| if (f.*) { + m.be.release(m.be.ctx, z.base + k * z.piece, @min(z.piece, z.len - k * z.piece)); + f.* = false; + }; + } +}; + +/// One thread mapping the pieces `post` names off the caller's path; a piece it fails to map goes back unmarked. +pub const Ahead = struct { + gpa: std.mem.Allocator, + io: std.Io, + z: *Lazy, + m: Mapper, + hooks: Hooks, + queued: []bool, + failed: []bool, // pieces the thread could not map: an open waiting on them maps them itself, or fails as it would + busy: ?usize = null, // the piece the thread maps now + stop: bool = false, + mu: std.Io.Mutex = .init, // the flags, the queue, `busy` and `stop` + changed: std.Io.Condition = .init, + maps: std.Io.Mutex = .init, // one map at a time: the mapper's next address is shared + thread: ?std.Thread = null, + + /// The thread's side: `enter` once on it (false: it maps nothing), `zero` clears a new piece and waits, `leave`. + pub const Hooks = struct { + ctx: *anyopaque, + enter: *const fn (*anyopaque) bool, + zero: *const fn (*anyopaque, u64, usize) anyerror!void, + leave: *const fn (*anyopaque) void, + + fn piece(h: Hooks, at: u64, len: usize) !void { + return h.zero(h.ctx, at, len); + } + }; + + pub fn init(gpa: std.mem.Allocator, io: std.Io, z: *Lazy, m: Mapper, hooks: Hooks) !Ahead { + const queued = try gpa.alloc(bool, z.mapped.len); + errdefer gpa.free(queued); + const failed = try gpa.alloc(bool, z.mapped.len); + @memset(queued, false); + @memset(failed, false); + return .{ .gpa = gpa, .io = io, .z = z, .m = m, .hooks = hooks, .queued = queued, .failed = failed }; + } + + /// The thread stopped and joined, what it had queued left unmapped; before the pieces go back. + pub fn deinit(a: *Ahead) void { + if (a.thread) |t| { + a.mu.lockUncancelable(a.io); + a.stop = true; + a.changed.broadcast(a.io); + a.mu.unlock(a.io); + t.join(); + } + a.gpa.free(a.queued); + a.gpa.free(a.failed); + a.* = undefined; + } + + /// The pieces over [off, off + n) not mapped nor on their way, queued for the thread (started on the first post). + pub fn post(a: *Ahead, off: u64, n: u64) void { + _ = a.reach(off, n); + } + + /// An open's pieces: mapped; posted (the arena's thread maps them, the open waits); caller (it maps them itself). + pub const Reach = enum { mapped, posted, caller }; + + /// As post, and what an open over [off, off + n) meets; a piece the thread failed or cannot take is the caller's. + pub fn reach(a: *Ahead, off: u64, n: u64) Reach { + if (n == 0) return .mapped; + if (off + n > a.z.len) return .caller; + a.mu.lockUncancelable(a.io); + defer a.mu.unlock(a.io); + var any = false; + var waits = false; + var k: usize = @intCast(off / a.z.piece); + while (k * a.z.piece < off + n) : (k += 1) { + if (a.z.mapped[k]) continue; + if (a.failed[k]) return .caller; + waits = true; + if (a.queued[k] or a.busy == k) continue; + a.queued[k] = true; + any = true; + } + if (!waits) return .mapped; + if (a.thread == null) a.thread = std.Thread.spawn(.{}, run, .{a}) catch { + @memset(a.queued, false); + return .caller; + }; + if (any) a.changed.broadcast(a.io); + return .posted; + } + + /// As Lazy.ensure on the caller's thread: a piece the thread has in hand waited for, one still queued taken back. + pub fn ensure(a: *Ahead, off: u64, n: u64, zero: anytype) !void { + if (n == 0) return; + if (off + n > a.z.len) return error.LaneMemory; + a.mu.lockUncancelable(a.io); + defer a.mu.unlock(a.io); + var k: usize = @intCast(off / a.z.piece); + while (k * a.z.piece < off + n) : (k += 1) { + while (a.busy == k) a.changed.waitUncancelable(a.io, &a.mu); + if (a.z.mapped[k]) continue; + a.queued[k] = false; + a.maps.lockUncancelable(a.io); + defer a.maps.unlock(a.io); + try a.z.mapPiece(a.m, k, zero); + a.z.mapped[k] = true; + a.failed[k] = false; + } + } + + /// Waits until the thread has nothing queued or in hand. + pub fn settle(a: *Ahead) void { + a.mu.lockUncancelable(a.io); + defer a.mu.unlock(a.io); + while (a.busy != null or std.mem.indexOfScalar(bool, a.queued, true) != null) a.changed.waitUncancelable(a.io, &a.mu); + } + + fn run(a: *Ahead) void { + const bound = a.hooks.enter(a.hooks.ctx); + defer if (bound) a.hooks.leave(a.hooks.ctx); + a.mu.lockUncancelable(a.io); + defer a.mu.unlock(a.io); + while (!a.stop) { + const k = std.mem.indexOfScalar(bool, a.queued, true) orelse { + a.changed.waitUncancelable(a.io, &a.mu); + continue; + }; + a.queued[k] = false; + if (!bound) { // no context on this thread: the caller maps it when it needs it + a.failed[k] = true; + a.changed.broadcast(a.io); + continue; + } + a.busy = k; + a.mu.unlock(a.io); + const ok = blk: { + a.maps.lockUncancelable(a.io); + defer a.maps.unlock(a.io); + a.z.mapPiece(a.m, k, a.hooks) catch break :blk false; + break :blk true; + }; + a.mu.lockUncancelable(a.io); + a.busy = null; + if (ok) a.z.mapped[k] = true; + a.failed[k] = !ok; + a.changed.broadcast(a.io); + } + } +}; + +/// The pool's arena: `buf` a DeviceBuffer counted and freed as any other, a range mapped as used if `pieces` holds it. +pub const Arena = struct { + buf: cuda.DeviceBuffer, + pieces: ?*Pieces = null, + + pub const Pieces = struct { + gpa: std.mem.Allocator, + vmm: cuda.arena.Vmm, + lazy: ?Lazy = null, + io: ?std.Io = null, // null: no thread, every piece maps on the caller's + d: ?*const cuda.Driver = null, + context: cuda.abi.Context = null, // the caller's, current on the thread too + stream: cuda.abi.Stream = null, // the thread's own + ahead: ?Ahead = null, + + fn enter(ctx: *anyopaque) bool { + const s: *Pieces = @ptrCast(@alignCast(ctx)); + const d = s.d.?; + if (d.api.cuCtxSetCurrent(s.context) != cuda.abi.success) return false; + return d.api.cuStreamCreate(&s.stream, 1) == cuda.abi.success; // CU_STREAM_NON_BLOCKING + } + fn zero(ctx: *anyopaque, at: u64, len: usize) anyerror!void { + const s: *Pieces = @ptrCast(@alignCast(ctx)); + const d = s.d.?; + try d.check(d.api.cuMemsetD8Async(at, 0, len, s.stream), "cuMemsetD8Async"); + try d.check(d.api.cuStreamSynchronize(s.stream), "cuStreamSynchronize"); // zeroed before it is marked + } + fn leave(ctx: *anyopaque) void { + const s: *Pieces = @ptrCast(@alignCast(ctx)); + _ = s.d.?.api.cuStreamDestroy_v2(s.stream); + } + + fn hookAlloc(ctx: *anyopaque, len: usize) ?u64 { + const s: *Pieces = @ptrCast(@alignCast(ctx)); + if (len == 0) return null; + const piece = std.mem.alignForward(usize, piece_bytes, s.vmm.granularity); + const n = std.mem.alignForward(usize, len, s.vmm.granularity); + const mapped = s.gpa.alloc(bool, (n + piece - 1) / piece) catch return null; + @memset(mapped, false); + s.lazy = .{ .base = s.vmm.va, .len = n, .piece = piece, .mapped = mapped }; + return s.vmm.va; + } + + fn hook(s: *Pieces) cuda.memory.Hook { + return .{ .ctx = s, .alloc = hookAlloc, .free = hookFree }; + } + + fn hookFree(ctx: *anyopaque, p: u64) bool { + const s: *Pieces = @ptrCast(@alignCast(ctx)); + const z = if (s.lazy) |*z| z else return false; + if (p != z.base) return false; + z.unmapAll(Mapper.vmm(&s.vmm)); + s.gpa.free(z.mapped); + s.lazy = null; + return true; + } + }; + + /// The pieces open libcuda.so.1 through std.DynLib: Linux only; elsewhere the arena is one cuMemAlloc, as before. + const pieces_os = @import("builtin").os.tag == .linux; + + /// `len` bytes reserved as pieces on `device` (`ensure` maps them; with `io` a thread too); else one cuMemAlloc. + pub fn alloc(gpa: std.mem.Allocator, d: *const cuda.Driver, len: usize, device: ?cuda.abi.Device, io: ?std.Io) !Arena { + const dev = device orelse return .{ .buf = try cuda.DeviceBuffer.alloc(d, len) }; + if (comptime !pieces_os) return .{ .buf = try cuda.DeviceBuffer.alloc(d, len) }; + if (len <= piece_bytes) return .{ .buf = try cuda.DeviceBuffer.alloc(d, len) }; + const s: ?*Pieces = blk: { + const vmm = cuda.arena.Vmm.open(d, dev, len) catch break :blk null; + const s = gpa.create(Pieces) catch { + var v = vmm; + v.close(); + break :blk null; + }; + s.* = .{ .gpa = gpa, .vmm = vmm, .io = io, .d = d }; + break :blk s; + }; + const p = s orelse return .{ .buf = try cuda.DeviceBuffer.alloc(d, len) }; + // the range through its own hook, the installed one untouched: the bytes are counted as every device buffer's + const buf = cuda.DeviceBuffer.allocVia(d, len, p.hook()); + var a: Arena = .{ .buf = buf catch |err| { + destroy(p); + return err; + }, .pieces = p }; + if (a.buf.owner == null) { // the hook declined, cuMemAlloc served it: no range to keep + destroy(p); + a.pieces = null; + } + return a; + } + + /// Bytes [off, off + n) of the arena backed by memory, new pieces zeroed on `stream`; one cuMemAlloc: always. + pub fn ensure(a: *Arena, off: u64, n: u64, stream: cuda.abi.Stream) !void { + const s = a.pieces orelse return; + const Zero = struct { + d: *const cuda.Driver, + stream: cuda.abi.Stream, + fn piece(z: @This(), at: u64, len: usize) !void { + try z.d.check(z.d.api.cuMemsetD8Async(at, 0, len, z.stream), "cuMemsetD8Async"); + } + }; + const zero: Zero = .{ .d = a.buf.d, .stream = stream }; + if (s.ahead) |*x| return x.ensure(off, n, zero); + try s.lazy.?.ensure(Mapper.vmm(&s.vmm), off, n, zero); + } + + /// Bytes [off, off + n) mapped ahead on the arena's thread, the caller's context current on it; no io: nothing. + pub fn post(a: *Arena, off: u64, n: u64) void { + _ = a.reach(off, n); + } + + /// As post, and what an open over [off, off + n) meets (Ahead.reach); one buffer: mapped; no thread: caller. + pub fn reach(a: *Arena, off: u64, n: u64) Ahead.Reach { + const s = a.pieces orelse return .mapped; + const io = s.io orelse return .caller; + if (s.ahead == null) { + if (s.d.?.api.cuCtxGetCurrent(&s.context) != cuda.abi.success or s.context == null) return .caller; + s.ahead = Ahead.init(s.gpa, io, &s.lazy.?, Mapper.vmm(&s.vmm), .{ .ctx = s, .enter = Pieces.enter, .zero = Pieces.zero, .leave = Pieces.leave }) catch return .caller; + } + return s.ahead.?.reach(off, n); + } + + /// Whether the arena maps its pieces on first use (else every byte is there from the start). + pub fn lazy(a: *const Arena) bool { + return a.pieces != null; + } + + /// The thread stopped, the buffer (its pieces unmapped), then the virtual range. + pub fn free(a: *Arena) void { + if (a.pieces) |p| if (p.ahead) |*x| { + x.deinit(); + p.ahead = null; + }; + a.buf.free(); + if (a.pieces) |p| destroy(p); + a.* = undefined; + } + + fn destroy(p: *Pieces) void { + if (comptime pieces_os) p.vmm.close(); + p.gpa.destroy(p); + } +}; + +const Fake = struct { + next: u64 = 0, + chunks: u32 = 0, + released: u64 = 0, + fail_at: ?u32 = null, // the chunk call that returns null + gap_at: ?u32 = null, // the chunk call that lands one granule past its place + zeroed: u64 = 0, + fail_zero: bool = false, + slow: bool = false, // a chunk call takes 50 ms + entered: std.atomic.Value(u32) = .init(0), // chunk calls begun + mapped_by: ?std.Thread.Id = null, // the thread of the last chunk call + + fn mapper(f: *Fake) Mapper { + return .{ .be = .{ .ctx = f, .granularity = 2 << 20, .chunk = chunk, .release = release, .name = "fake" }, .seek = seek }; + } + fn seek(ctx: *anyopaque, at: u64) void { + const f: *Fake = @ptrCast(@alignCast(ctx)); + f.next = at; + } + fn chunk(ctx: *anyopaque, _: usize) ?u64 { + const f: *Fake = @ptrCast(@alignCast(ctx)); + _ = f.entered.fetchAdd(1, .release); + f.mapped_by = std.Thread.getCurrentId(); + if (f.slow) std.testing.io.sleep(.fromMilliseconds(50), .awake) catch {}; + defer f.chunks += 1; + if (f.fail_at == f.chunks) return null; + if (f.gap_at == f.chunks) f.next += 2 << 20; + return f.next; + } + fn release(ctx: *anyopaque, _: u64, len: usize) void { + const f: *Fake = @ptrCast(@alignCast(ctx)); + f.released += len; + } + fn piece(f: *Fake, _: u64, len: usize) !void { + if (f.fail_zero) return error.CudaFailed; + f.zeroed += len; + } + fn hooks(f: *Fake) Ahead.Hooks { + const H = struct { + fn enter(_: *anyopaque) bool { + return true; + } + fn zero(ctx: *anyopaque, at: u64, len: usize) anyerror!void { + const g: *Fake = @ptrCast(@alignCast(ctx)); + return g.piece(at, len); + } + fn leave(_: *anyopaque) void {} + }; + return .{ .ctx = f, .enter = H.enter, .zero = H.zero, .leave = H.leave }; + } +}; + +test "a posted piece maps on the arena's thread, and ensure waits for the one it has in hand, never mapping it twice" { + var f: Fake = .{ .slow = true }; + var flags: [8]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags }; + var a = try Ahead.init(std.testing.allocator, std.testing.io, &z, f.mapper(), f.hooks()); + defer a.deinit(); + a.post(0, 1); + while (f.entered.load(.acquire) == 0) std.Thread.yield() catch {}; // the thread is mapping piece 0 + try a.ensure(0, 1, &f); // needs it now: waits + try std.testing.expect(flags[0] and !flags[1]); + try std.testing.expectEqual(@as(u32, 1), f.chunks); + try std.testing.expectEqual(@as(u64, piece_bytes), f.zeroed); + try std.testing.expect(f.mapped_by.? != std.Thread.getCurrentId()); + a.post(0, piece_bytes + 1); // piece 0 mapped, piece 1 queued + a.settle(); + try std.testing.expect(flags[1] and f.chunks == 2 and f.mapped_by.? != std.Thread.getCurrentId()); +} + +test "a piece the arena's thread fails to map goes back unmarked, and ensure maps it on the caller's thread" { + var f: Fake = .{ .fail_at = 0 }; + var flags: [8]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags }; + var a = try Ahead.init(std.testing.allocator, std.testing.io, &z, f.mapper(), f.hooks()); + defer a.deinit(); + a.post(0, 1); + a.settle(); + try std.testing.expect(!flags[0] and f.chunks == 1 and f.zeroed == 0); + try a.ensure(0, 1, &f); + try std.testing.expect(flags[0] and f.chunks == 2); + try std.testing.expectEqual(@as(u64, piece_bytes), f.zeroed); + try std.testing.expectEqual(std.Thread.getCurrentId(), f.mapped_by.?); +} + +test "reach: unmapped pieces go to the arena's thread at once; mapped: mapped; a piece it failed: the caller's" { + var f: Fake = .{ .slow = true }; + var flags: [8]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags }; + var a = try Ahead.init(std.testing.allocator, std.testing.io, &z, f.mapper(), f.hooks()); + defer a.deinit(); + try std.testing.expectEqual(Ahead.Reach.posted, a.reach(0, piece_bytes + 1)); // returns before a 50 ms map + try std.testing.expectEqual(@as(u32, 0), f.chunks); + try std.testing.expectEqual(Ahead.Reach.posted, a.reach(0, 1)); // still on its way: posted, not twice + a.settle(); + try std.testing.expect(flags[0] and flags[1] and f.chunks == 2 and f.mapped_by.? != std.Thread.getCurrentId()); + try std.testing.expectEqual(Ahead.Reach.mapped, a.reach(0, piece_bytes + 1)); + f.fail_at = f.chunks; // the next map fails on the thread + try std.testing.expectEqual(Ahead.Reach.posted, a.reach(2 * piece_bytes, 1)); + a.settle(); + try std.testing.expect(!flags[2]); + try std.testing.expectEqual(Ahead.Reach.caller, a.reach(2 * piece_bytes, 1)); // no endless wait + try a.ensure(2 * piece_bytes, 1, &f); // the caller maps it, and it is a plain piece again + try std.testing.expectEqual(Ahead.Reach.mapped, a.reach(2 * piece_bytes, 1)); +} + +test "a 6 GiB range maps only the pieces its pages use, each once, zeroed, and every mapped piece goes back" { + var f: Fake = .{}; + var flags: [24]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 6 << 30, .piece = piece_bytes, .mapped = &flags }; + try z.ensure(f.mapper(), 0, 7 << 20, &f); // a page at the bottom: piece 0 + try z.ensure(f.mapper(), (6 << 30) - (360 << 20), 360 << 20, &f); // a run at the top: pieces 22 and 23 + try z.ensure(f.mapper(), (255 << 20), 2 << 20, &f); // across the edge of piece 0 and 1: piece 1 new + try z.ensure(f.mapper(), 0, 7 << 20, &f); // again: nothing new + try std.testing.expectEqual(@as(u32, 4), f.chunks); + try std.testing.expectEqual(@as(u64, 4 * piece_bytes), f.zeroed); + try std.testing.expect(flags[0] and flags[1] and flags[22] and flags[23] and !flags[2] and !flags[21]); + z.unmapAll(f.mapper()); + try std.testing.expectEqual(@as(u64, 4 * piece_bytes), f.released); + try std.testing.expect(std.mem.allEqual(bool, &flags, false)); + try std.testing.expectError(error.LaneMemory, z.ensure(f.mapper(), 6 << 30, 1, &f)); // past the range +} + +test "a piece that fails or lands apart is not marked, and the pieces before it stay mapped" { + var f: Fake = .{ .fail_at = 1 }; + var flags: [8]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags }; + try std.testing.expectError(error.LaneMemory, z.ensure(f.mapper(), 0, 2 * piece_bytes, &f)); + try std.testing.expect(flags[0] and !flags[1]); + var g: Fake = .{ .gap_at = 0 }; + var flags2: [8]bool = @splat(false); + var y: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags2 }; + try std.testing.expectError(error.LaneMemory, y.ensure(g.mapper(), 0, 1, &g)); + try std.testing.expect(!flags2[0]); + try std.testing.expectEqual(@as(u64, piece_bytes), g.released); // the stray one went back +} + +test "a piece whose zeroing fails goes back unmarked, so it is never read as zeroed nor kept mapped" { + var f: Fake = .{ .fail_zero = true }; + var flags: [8]bool = @splat(false); + var z: Lazy = .{ .base = 1 << 40, .len = 2 << 30, .piece = piece_bytes, .mapped = &flags }; + try std.testing.expectError(error.CudaFailed, z.ensure(f.mapper(), 0, 1, &f)); + try std.testing.expect(!flags[0]); + try std.testing.expectEqual(@as(u64, piece_bytes), f.released); +} + +test "the arena's range comes through its own hook: the installed hook is untouched, a declined one is cuMemAlloc" { + var d = cuda.paging_test_device.Device.driver(); + const installed = cuda.memory.currentHook(); + var p: Arena.Pieces = .{ .gpa = std.testing.allocator, .vmm = undefined }; + p.vmm.granularity = 2 << 20; + p.vmm.va = 1 << 40; + var b = try cuda.DeviceBuffer.allocVia(&d, 3 * piece_bytes, p.hook()); + try std.testing.expectEqual(@as(u64, 1 << 40), b.ptr); // the range, not a driver allocation + try std.testing.expect(b.owner != null and p.lazy != null); + try std.testing.expectEqual(installed, cuda.memory.currentHook()); + b.free(); // through its owner: the flags go, nothing was mapped to unmap + try std.testing.expect(p.lazy == null); + var failing: std.testing.FailingAllocator = .init(std.testing.allocator, .{ .fail_index = 0 }); + var q: Arena.Pieces = .{ .gpa = failing.allocator(), .vmm = undefined }; + q.vmm.granularity = 2 << 20; + q.vmm.va = 1 << 40; + var c = try cuda.DeviceBuffer.allocVia(&d, 3 * piece_bytes, q.hook()); // no room for its flags: the hook declines + try std.testing.expect(c.owner == null and q.lazy == null and c.ptr != 1 << 40); + c.free(); +} + +test "without a device, or for one piece or less, the arena is one cuMemAlloc and every byte is there from the start" { + var d = cuda.paging_test_device.Device.driver(); + var a = try Arena.alloc(std.testing.allocator, &d, 3 * piece_bytes, null, null); + try std.testing.expect(!a.lazy()); + try a.ensure(0, 3 * piece_bytes, cuda.paging_test_device.Device.stream); // nothing to map + a.free(); + var b = try Arena.alloc(std.testing.allocator, &d, piece_bytes, 0, null); + try std.testing.expect(!b.lazy()); + b.free(); +} diff --git a/zig/src/families/flashnext/cuda_kv_init_test.zig b/zig/src/families/flashnext/cuda_kv_init_test.zig index 3906302b86e..2470b0a02ca 100644 --- a/zig/src/families/flashnext/cuda_kv_init_test.zig +++ b/zig/src/families/flashnext/cuda_kv_init_test.zig @@ -151,3 +151,159 @@ test "kv safety: Flash Next page IDs and arena size refuse before allocation" { try std.testing.expectEqual(@as(usize, 0), Device.allocs); try Device.released(); } + +/// A VMM whose cuMemCreate fails: every piece the arena reaches will not map. +const NoMemory = struct { + var creates: usize = 0; + fn create(_: *u64, _: usize, _: *const cuda.arena.Vmm.Prop, _: c_ulonglong) callconv(.c) cuda.abi.Result { + creates += 1; + return 2; // CUDA_ERROR_OUT_OF_MEMORY + } +}; + +test "kv safety: Flash Next open whose arena piece will not map returns LaneMemory and leaves the pool idle" { + const arena = @import("cuda_kv_arena.zig"); + var d = Device.driver(); + var e = engine(&d); + defer finish(&d, e.stream.*); + const pool = try pages.Pool.init(gpa, &e, layout, 64, null, 2, 8); + var live = true; + defer if (live) { + pool.arena.pieces = null; + pool.deinit(); + }; + // the arena as pieces mapped on first use, none mapped yet, through the failing VMM + var mapped = [_]bool{false}; + var s: arena.Arena.Pieces = .{ .gpa = gpa, .vmm = undefined, .d = &d }; + s.vmm.va = pool.arena.buf.ptr; + s.vmm.va_len = arena.piece_bytes; + s.vmm.next = s.vmm.va; + s.vmm.granularity = 2 << 20; + s.vmm.device = 0; + s.vmm.prop = .{}; + s.vmm.failed = null; + s.vmm.api.create = NoMemory.create; + s.lazy = .{ .base = pool.arena.buf.ptr, .len = pool.arena.buf.len, .piece = arena.piece_bytes, .mapped = &mapped }; + pool.arena.pieces = &s; + NoMemory.creates = 0; + const before = pool.pool.census(); + + try std.testing.expectError(error.LaneMemory, pool.open(64)); + try std.testing.expectEqual(@as(usize, 1), NoMemory.creates); // the open reached the piece + try std.testing.expect(!mapped[0]); + for (pool.lanes) |x| try std.testing.expect(!x.used); + try std.testing.expectEqualDeep(before, pool.pool.census()); // promised 0, every page free again + try std.testing.expect(pool.fits(64)); // a free lane, the pages and a run: the run went back too + + pool.arena.pieces = null; + live = false; + pool.deinit(); + try Device.released(); +} + +/// A VMM whose cuMemCreate takes 50 ms, noting the thread of each, and the driver calls the arena's thread makes. +const Slow = struct { + var on_caller: std.atomic.Value(u32) = .init(0); // pieces created on the test's (the engine's) thread + var created: std.atomic.Value(u32) = .init(0); + var caller: std.Thread.Id = 0; + fn create(h: *u64, _: usize, _: *const cuda.arena.Vmm.Prop, _: c_ulonglong) callconv(.c) cuda.abi.Result { + std.testing.io.sleep(.fromMilliseconds(50), .awake) catch {}; + if (std.Thread.getCurrentId() == caller) _ = on_caller.fetchAdd(1, .monotonic); + h.* = created.fetchAdd(1, .monotonic) + 1; + return 0; + } + fn ok64(_: u64) callconv(.c) cuda.abi.Result { + return 0; + } + fn map(_: u64, _: usize, _: usize, _: u64, _: c_ulonglong) callconv(.c) cuda.abi.Result { + return 0; + } + fn unmap(_: u64, _: usize) callconv(.c) cuda.abi.Result { + return 0; + } + fn access(_: u64, _: usize, _: *const anyopaque, _: usize) callconv(.c) cuda.abi.Result { + return 0; + } + fn getCurrent(c: *cuda.abi.Context) callconv(.c) cuda.abi.Result { + c.* = @ptrFromInt(29); + return 0; + } + fn setCurrent(_: cuda.abi.Context) callconv(.c) cuda.abi.Result { + return 0; + } + fn streamCreate(s: *cuda.abi.Stream, _: c_uint) callconv(.c) cuda.abi.Result { + s.* = Device.stream; + return 0; + } + fn streamDestroy(_: cuda.abi.Stream) callconv(.c) cuda.abi.Result { + return 0; + } +}; + +test "kv safety: Flash Next open into unmapped pieces beside a running stream waits for the arena's thread, not on a map" { + const arena = @import("cuda_kv_arena.zig"); + var d = Device.driver(); + d.api.cuCtxGetCurrent = Slow.getCurrent; + d.api.cuCtxSetCurrent = Slow.setCurrent; + d.api.cuStreamCreate = Slow.streamCreate; + d.api.cuStreamDestroy_v2 = Slow.streamDestroy; + var e = engine(&d); + e.round_graph = .{}; + defer finish(&d, e.stream.*); + // 96 pages of 16 MiB: six pieces; runs of 8 pages from the top; 64 rows take 4 pages, 320 rows 20 + const big: kv.Layout = .{ .fixed_bytes = 0, .token_bytes = 1 << 20, .page_tokens = 16, .snap_bytes = 0, .run_bytes = 128 << 20 }; + const pool = try pages.Pool.init(gpa, &e, big, 512, null, 2, 96); + var s: arena.Arena.Pieces = .{ .gpa = gpa, .vmm = undefined, .d = &d, .io = std.testing.io }; + var live = true; + defer if (live) { + if (s.ahead) |*x| x.deinit(); + pool.arena.pieces = null; + pool.deinit(); + }; + s.vmm.va = pool.arena.buf.ptr; + s.vmm.va_len = 6 * arena.piece_bytes; + s.vmm.next = s.vmm.va; + s.vmm.granularity = 2 << 20; + s.vmm.device = 0; + s.vmm.prop = .{}; + s.vmm.failed = null; + s.vmm.api.create = Slow.create; + s.vmm.api.release = Slow.ok64; + s.vmm.api.map = Slow.map; + s.vmm.api.unmap = Slow.unmap; + s.vmm.api.setAccess = @ptrCast(&Slow.access); + var mapped: [6]bool = @splat(false); + s.lazy = .{ .base = pool.arena.buf.ptr, .len = pool.arena.buf.len, .piece = arena.piece_bytes, .mapped = &mapped }; + pool.arena.pieces = &s; + Slow.caller = std.Thread.getCurrentId(); + Slow.on_caller.store(0, .monotonic); + Slow.created.store(0, .monotonic); + + // alone: no stream can wait, so nothing is posted and the open maps on its own thread, as before + try std.testing.expect(!pool.waits(320, false)); + try std.testing.expect(s.ahead == null and std.mem.indexOfScalar(bool, &mapped, true) == null); + + // beside a running stream: pages 0-19 reach pieces 0-1, the run (88-95) piece 5; posted, the call returns at once + const t0 = std.Io.Clock.awake.now(std.testing.io); + try std.testing.expect(pool.waits(320, true)); + const took = t0.durationTo(std.Io.Clock.awake.now(std.testing.io)).toNanoseconds(); + try std.testing.expect(took < 25 * std.time.ns_per_ms); // a map takes 50 ms: the caller did not wait on one + try std.testing.expect(pool.waits(320, true)); // asked again before they are mapped: still waits, posts nothing twice + s.ahead.?.settle(); + try std.testing.expect(mapped[0] and mapped[1] and !mapped[2] and mapped[5]); + try std.testing.expect(!pool.waits(320, true)); // mapped: the open goes on + // what the open ensures (its run, then its pages) maps nothing on the caller's thread now + const pb = big.pageBytes(); + try pool.arena.ensure(88 * pb, 8 * pb, Device.stream); + try pool.arena.ensure(0, 20 * pb, Device.stream); + try std.testing.expectEqual(@as(u32, 0), Slow.on_caller.load(.monotonic)); + try std.testing.expectEqual(@as(u32, 3), Slow.created.load(.monotonic)); + + s.ahead.?.deinit(); + s.ahead = null; + s.lazy.?.unmapAll(.{ .be = s.vmm.backend(), .seek = undefined }); + pool.arena.pieces = null; + live = false; + pool.deinit(); + try Device.released(); +} diff --git a/zig/src/families/flashnext/cuda_kv_lanes.zig b/zig/src/families/flashnext/cuda_kv_lanes.zig index e10452bd5d7..d3d6a1a51d9 100644 --- a/zig/src/families/flashnext/cuda_kv_lanes.zig +++ b/zig/src/families/flashnext/cuda_kv_lanes.zig @@ -86,6 +86,12 @@ pub const State = struct { return false; } + /// Whether a new stream of `rows` rows waits for the arena's thread before its open (Pool.waits); own stream: no. + pub fn waits(s: *const State, rows: usize, others: usize) bool { + if (s.choose() != .pool) return false; + return s.pool.?.waits(@min(rows + mtp.max_rows, prompt.max_tokens), others > 0); + } + /// The lane host's admission: the own stream is free, or a lane and the request's pages are. pub fn fits(s: *const State, prompt_rows: u32, max_tokens: u32) bool { const p = s.pool orelse return true; @@ -104,18 +110,24 @@ pub const Pool = struct { capacity: usize, head: ?Head, pool: kv.Pool, - arena: cuda.DeviceBuffer, + arena: @import("cuda_kv_arena.zig").Arena, lanes: []Lane, /// `streams` lanes and `count` pages of layout `l`, made and touched now; a lane holds only its table idle. pub fn init(gpa: std.mem.Allocator, e: *prompt.Engine, l: kv.Layout, capacity: usize, head: ?Head, streams: usize, count: usize) !*Pool { + return initOn(gpa, e, l, capacity, head, streams, count, null, null); + } + + /// As init, the arena from pieces on `device` (null: one cuMemAlloc), with `io` mapped ahead on its own thread. + pub fn initOn(gpa: std.mem.Allocator, e: *prompt.Engine, l: kv.Layout, capacity: usize, head: ?Head, streams: usize, count: usize, device: ?cuda.abi.Device, io: ?std.Io) !*Pool { if (!pages.valid(l.page_tokens) or capacity > prompt.max_tokens or count > @as(usize, std.math.maxInt(c_int)) + 1) return error.BadFlashNextKvPages; const page_bytes = try std.math.mul(usize, @intCast(l.token_bytes), l.page_tokens); if (page_bytes == 0) return error.BadFlashNextKvPages; _ = try std.math.add(u64, l.run_bytes, page_bytes - 1); const p = try gpa.create(Pool); errdefer gpa.destroy(p); - var arena = try cuda.DeviceBuffer.alloc(e.driver, try std.math.mul(usize, count, page_bytes)); + // pieces mapped as the lanes first use them: memory no stream has taken stays free at load + var arena = try @import("cuda_kv_arena.zig").Arena.alloc(gpa, e.driver, try std.math.mul(usize, count, page_bytes), device, io); errdefer arena.free(); p.* = .{ .gpa = gpa, .e = e, .layout = l, .capacity = capacity, .head = head, .pool = try kv.Pool.init(gpa, count, page_bytes), .arena = arena, .lanes = &.{} }; errdefer p.pool.deinit(); @@ -128,8 +140,9 @@ pub const Pool = struct { made += 1; } errdefer cuda.completion.drain(e.driver, e.stream.*, "flashnext: failed pool initialization did not drain"); - try arena.fill8(0, e.stream.handle); + if (!arena.lazy()) try arena.buf.fill8(0, e.stream.handle); // pieces are zeroed as they map for (p.lanes) |x| try x.seq.paged.?.table.fill8(0, e.stream.handle); + p.mapAhead(true); try e.stream.synchronize(); return p; } @@ -140,7 +153,7 @@ pub const Pool = struct { const d = p.e.driver; var table = try cuda.DeviceBuffer.alloc(d, mostPages(p.capacity, p.layout.page_tokens) * 4); errdefer table.free(); - const paged: pages.Paged = .{ .base = p.arena.ptr, .table = table, .ids = &.{}, .tokens = p.layout.page_tokens, .own_ids = false, .layers = wt.attn_n + @intFromBool(p.head != null) }; + const paged: pages.Paged = .{ .base = p.arena.buf.ptr, .table = table, .ids = &.{}, .tokens = p.layout.page_tokens, .own_ids = false, .layers = wt.attn_n + @intFromBool(p.head != null) }; const conv = try gpa.alloc(cuda.DeviceBuffer, wt.linear_n); errdefer gpa.free(conv); const state = try gpa.alloc(cuda.DeviceBuffer, wt.linear_n); @@ -182,6 +195,31 @@ pub const Pool = struct { return false; } + /// Whether an open of `cap` rows waits: beside other streams, the arena's thread maps its pieces; true until then. + pub fn waits(p: *Pool, cap: usize, others: bool) bool { + // alone, or a piece the thread failed: false; the open maps on its own thread, as before (or fails: LaneMemory) + if (!others or !p.arena.lazy()) return false; + const k = p.layout.runPages(); + const n = p.layout.pages(cap); + var ids: [2048]u32 = undefined; + if (n > ids.len or !p.pool.fits(n + k)) return false; + const run = p.pool.findRun(k) orelse return false; + const pb = p.layout.pageBytes(); + var posted = false; + if (!p.meet(@as(u64, run) * pb, k * pb, &posted)) return false; + for (nextPages(&p.pool, k, ids[0..n])) |id| if (!p.meet(@as(u64, id) * pb, pb, &posted)) return false; + return posted; + } + + fn meet(p: *Pool, off: u64, n: u64, posted: *bool) bool { + switch (p.arena.reach(off, n)) { + .mapped => {}, + .posted => posted.* = true, + .caller => return false, + } + return true; + } + /// A free lane's cleared cache (a copy) with `cap` rows' pages and its run; LaneMemory: not now. pub fn open(p: *Pool, cap: usize) !prompt.Seq { if (cap > p.capacity + window_rows) return error.PromptTooLong; @@ -210,13 +248,14 @@ pub const Pool = struct { } fn runBase(p: *const Pool, x: *const Lane) u64 { - return p.arena.ptr + @as(u64, x.run) * p.layout.pageBytes(); + return p.arena.buf.ptr + @as(u64, x.run) * p.layout.pageBytes(); } /// The lane's states as views of its run, laid out afresh (a kept window swaps state buffers with the head's). fn mapStates(p: *Pool, seq: *prompt.Seq) !void { if (p.layout.runPages() * p.layout.pageBytes() < seqRunBytes()) return error.FlashNextRunTooShort; const x = p.laneOf(seq).?; + try p.arena.ensure(@as(u64, x.run) * p.layout.pageBytes(), p.layout.runPages() * p.layout.pageBytes(), p.e.stream.handle); var at = p.runBase(x); for (seq.conv) |*b| { b.* = .{ .d = p.e.driver, .ptr = at, .len = conv_bytes, .borrowed = true }; @@ -251,6 +290,7 @@ pub const Pool = struct { cuda.completion.drain(p.e.driver, p.e.stream.*, "flashnext: a closed stream did not drain"); p.pool.releaseRun(x.run, p.layout.runPages()); p.pool.finish(&x.lease); + p.mapAhead(false); // on the arena's thread: the reply's last token, sent after this, does not wait for it if (seq.media) |*m| m.deinit(); // the stream's image state, held by its copy seq.media = null; x.seq.paged.?.ids = &.{}; @@ -259,6 +299,22 @@ pub const Pool = struct { return true; } + /// Maps what an open reaches first (`runs`: at load, the lanes' runs too, here; else on the arena's thread). + fn mapAhead(p: *Pool, runs: bool) void { + if (!p.arena.lazy()) return; + const pb = p.layout.pageBytes(); + const s = p.e.stream.handle; + if (runs) { + const k = @min(p.layout.runPages() * p.lanes.len, p.pool.total()); + p.arena.ensure((p.pool.total() - k) * pb, k * pb, s) catch return; + } + var ids: [1024]u32 = undefined; // two pieces' worth: a request's pages and a keep's held ones + const n: usize = @intCast(@min(ids.len, @max(1, 2 * @import("cuda_kv_arena.zig").piece_bytes / pb))); + for (nextPages(&p.pool, p.layout.runPages(), ids[0..n])) |id| { + if (!runs) p.arena.post(@as(u64, id) * pb, pb) else p.arena.ensure(@as(u64, id) * pb, pb, s) catch return; + } + } + /// A lane's new table entries uploaded to its device table. const Upload = struct { p: *Pool, @@ -267,6 +323,8 @@ pub const Pool = struct { fn write(ctx: *anyopaque, ids: []const u32, from: usize) anyerror!void { const u: *Upload = @ptrCast(@alignCast(ctx)); errdefer cuda.completion.drain(u.p.e.driver, u.p.e.stream.*, "flashnext: a failed table upload did not drain"); + const pb = u.p.layout.pageBytes(); + for (ids[from..]) |id| try u.p.arena.ensure(@as(u64, id) * pb, pb, u.p.e.stream.handle); // before any read try u.table.uploadAsync(from * 4, std.mem.sliceAsBytes(ids[from..]), u.p.e.stream.handle); try u.p.e.stream.synchronize(); // the ids slice may move as the lease grows } @@ -304,6 +362,52 @@ test "TF_FLASHNEXT_KV_PAGES: unset, empty or whitespace-only text reads as no pa try t.expectError(error.BadFlashNextKvPages, pagingOf(" ")); } +/// The page ids the free stack hands an open out next, past the run of `run_pages` it claims first, into `out`. +pub fn nextPages(pool: *const kv.Pool, run_pages: usize, out: []u32) []u32 { + const run = if (run_pages > 0) pool.findRun(run_pages) else null; + var n: usize = 0; + var i = pool.nfree; + while (i > 0 and n < out.len) { + i -= 1; + const id = pool.free[i]; + if (run) |r| if (id >= r and id < r + run_pages) continue; + out[n] = id; + n += 1; + } + return out[0..n]; +} + +test "mapped ahead: the pages the free stack hands out next, page 0 first, then past the ones held" { + var pool = try kv.Pool.init(std.testing.allocator, 64, 4096); + defer pool.deinit(); + var out: [100]u32 = undefined; + try std.testing.expectEqualSlices(u32, &.{ 0, 1, 2, 3 }, nextPages(&pool, 0, out[0..4])); + var held: [5]u32 = undefined; + try std.testing.expect(pool.hold(&held)); + try std.testing.expectEqualSlices(u32, &.{ 5, 6, 7, 8 }, nextPages(&pool, 0, out[0..4])); // what a keep leaves next + for (held) |id| pool.release(id); + try std.testing.expectEqual(@as(usize, 64), nextPages(&pool, 0, &out).len); + try std.testing.expect(pool.idle()); +} + +test "mapped ahead: after a close the next pages are the freed and fresh ones, never the run the next open claims" { + var pool = try kv.Pool.init(std.testing.allocator, 64, 4096); + defer pool.deinit(); + var l: kv.Lease = .{}; + try pool.promise(&l, 4 + 5); + const run = pool.claimRun(&l, 4).?; + for (0..5) |_| _ = try pool.take(&l); + var held: [3]u32 = undefined; + try std.testing.expect(pool.hold(&held)); // a keep's pages + pool.releaseRun(run, 4); // close: the run back, then the lane's pages + pool.finish(&l); + var out: [8]u32 = undefined; + const next = nextPages(&pool, 4, &out); + for (next) |id| try std.testing.expect(id < run); // the run the next open claims again is no page it is handed + try std.testing.expect(std.mem.indexOfScalar(u32, next, 8) != null); // the first fresh page past the keep's + for (held) |id| pool.release(id); +} + test "a stream's pages: its rows and a drafted window, no more than a full window's" { const l = layout(40960, 256, null, 0); try std.testing.expectEqual(pages.pageBytes(256), l.pageBytes()); @@ -317,4 +421,5 @@ test "a stream's pages: its rows and a drafted window, no more than a full windo test { _ = @import("cuda_kv_init_test.zig"); _ = @import("cuda_kv_lifetime_test.zig"); + _ = @import("cuda_kv_arena.zig"); } diff --git a/zig/src/families/flashnext/cuda_lanes.zig b/zig/src/families/flashnext/cuda_lanes.zig index 3c2055f7c55..ecd5440845b 100644 --- a/zig/src/families/flashnext/cuda_lanes.zig +++ b/zig/src/families/flashnext/cuda_lanes.zig @@ -44,7 +44,7 @@ pub fn Namespace(comptime Tri: type) type { pub const window_rows = kvl.window_rows; pub fn attach(p: *anyopaque, streams: u32, count: usize) !void { const own = of(p); - own.kv.pool = try kvl.Pool.init(own.gpa, own.engine, own.kv.layout.?, own.context, own.kv.head, streams, count); + own.kv.pool = try kvl.Pool.initOn(own.gpa, own.engine, own.kv.layout.?, own.context, own.kv.head, streams, count, own.device, own.io); own.kv.paged_only = kvl.pagedOnly() and streams > 0; } pub fn fits(p: *anyopaque, rows: u32, max_tokens: u32) bool { @@ -149,7 +149,6 @@ pub fn Namespace(comptime Tri: type) type { const Parts = @import("cuda_lane_parts.zig").Parts; const seq_parts = @import("cuda_seq_parts.zig"); - const Ops = mtp.Ops(Tri); const snaps = @import("cuda_lanes_snap.zig").Snaps(Cuda); @@ -157,6 +156,8 @@ pub fn Namespace(comptime Tri: type) type { gpa: std.mem.Allocator, context: usize, engine: *prompt.Engine, + device: ?cuda.abi.Device = null, // the load context's: the page pool's arena maps from pieces on it + io: ?std.Io = null, // the load's: the arena's thread maps pieces ahead with it vision: ?*@import("cuda_images.zig").Vision = null, ranks: ?*ranks.Session = null, head: ?*mtp.Head = null, @@ -417,6 +418,7 @@ pub fn Namespace(comptime Tri: type) type { /// One chunk of the stream's prompt between the other streams' rounds; the first call opens its caches. fn prefillStepFn(ptr: *anyopaque, s: *lanes.Stream, _: u32) anyerror!bool { const self = of(ptr); + if (self.lanes.getPtr(s) == null and self.kv.waits(s.prompt().len + s.max_new, self.lanes.count())) return false; const l = if (self.lanes.getPtr(s)) |x| (if (x.filled != null) x else try self.open(s)) else try self.open(s); return self.step(s, l, 0); } diff --git a/zig/src/families/flashnext/cuda_lanes_load.zig b/zig/src/families/flashnext/cuda_lanes_load.zig index 3ebc849aeb8..9bc26ca994c 100644 --- a/zig/src/families/flashnext/cuda_lanes_load.zig +++ b/zig/src/families/flashnext/cuda_lanes_load.zig @@ -39,7 +39,7 @@ pub fn open(comptime F: type, gpa: std.mem.Allocator, io: std.Io, ctx: *const cu const driver: *cuda.Driver = @constCast(ctx.d); const own = try gpa.create(Cuda); errdefer gpa.destroy(own); - own.* = .{ .gpa = gpa, .context = o.context, .engine = undefined, .glue = undefined, .stream = undefined, .logits = undefined }; + own.* = .{ .gpa = gpa, .context = o.context, .engine = undefined, .glue = undefined, .stream = undefined, .logits = undefined, .device = ctx.device, .io = io }; // fixed-size lane buffers reused across streams (cuda_lane_parts.zig; TF_FLASHNEXT_LANE_PARTS=0: allocate each) own.parts.on = try @import("sys").environment.read(bool, "TF_FLASHNEXT_LANE_PARTS", true); own.stream = try cuda.Stream.init(driver, true); diff --git a/zig/src/families/flashnext/hip/cache.zig b/zig/src/families/flashnext/hip/cache.zig index 87177044727..ee1c0167fb0 100644 --- a/zig/src/families/flashnext/hip/cache.zig +++ b/zig/src/families/flashnext/hip/cache.zig @@ -5,8 +5,8 @@ const model = @import("model.zig"); const Dims = model.Dims; -/// Most rows a verified window holds: the pending token and up to three drafts. -pub const max_window = 4; +/// Most rows a verified window holds: the pending token and up to seven drafts (copies use the width; MTP drafts 3). +pub const max_window = 8; /// Where the bytes of one sparse layer's caches start, and their strides. pub const SparseView = struct { k: u64, v: u64, raw: u64, pooled: u64 }; @@ -257,3 +257,16 @@ test "a stream's bytes at tp 4: 12 sparse layers' caches, 36 DeltaNet states and const linear = 3 * 2560 * 4 + 12 * 128 * 128 * 4; try std.testing.expectEqual(@as(usize, 12 * per_layer + 36 * linear + 9 * 10240 * 2), l.bytes()); } + +test "a window's snapshots hold eight rows at tp 4: the pending token and seven copied or drafted ones" { + const config = @import("../config.zig"); + var c = try config.parse(std.testing.allocator, @embedFile("../fixtures/config.json")); + defer c.deinit(); + const d = try Dims.of(&c, 4); + var kinds: [48]bool = undefined; + for (&kinds, 0..) |*k, i| k.* = (try c.kind(i)) == .linear_attention; + const l = Layout.of(d, &kinds, 4096, .f16); + const linear = 3 * 2560 * 4 + 12 * 128 * 128 * 4; + try std.testing.expectEqual(@as(usize, 8 * 36 * linear), l.windowBytes()); + try std.testing.expectEqual(l.tail_bytes + 8 * (l.tail_bytes / l.tail_rows), l.cinBytes()); +} diff --git a/zig/src/families/flashnext/hip/engine.zig b/zig/src/families/flashnext/hip/engine.zig index e36b0924a28..e4cf3866bef 100644 --- a/zig/src/families/flashnext/hip/engine.zig +++ b/zig/src/families/flashnext/hip/engine.zig @@ -32,9 +32,9 @@ pub const Options = struct { want: usize = 1, }; -/// Whether the smaller chunk's scratch admits more of `want` streams of `per` bytes in `room` than the larger's. -pub fn narrows(room: u64, larger: u64, smaller: u64, per: u64, want: u64) bool { - return @min(want, (room -| smaller) / per) > @min(want, (room -| larger) / per); +/// Whether the smaller chunk admits more of `want` streams than the larger's in `room`, after the `slots` bytes. +pub fn narrows(room: u64, slots: u64, larger: u64, smaller: u64, per: u64, want: u64) bool { + return @min(want, (room -| slots -| smaller) / per) > @min(want, (room -| slots -| larger) / per); } /// Bytes of the pinned staging a forward's uploads and n-gram rows go through. @@ -280,10 +280,14 @@ pub const Engine = struct { if (small >= e.o.chunk) return larger; const pool = try hip.admission.budget(e.gpa, e.io, e.ctx); const room = pool.room(hip.usage(false).device); + const slots: u64 = if (gdn.supported(e.weights.model.dims, e.cfg.layers)) + @intCast(gdn.Slots.bytes(e.weights.model.dims, @max(e.o.want, 1))) + else + 0; const asked = e.o.chunk; e.o.chunk = small; const smaller = try e.scratchBytes(); - if (!narrows(room, larger, smaller, e.streamBytes(e.o.capacity), e.o.want)) { + if (!narrows(room, slots, larger, smaller, e.streamBytes(e.o.capacity), e.o.want)) { e.o.chunk = asked; return larger; } @@ -527,13 +531,23 @@ fn weightMapOf(a: std.mem.Allocator, io: std.Io, dir: []const u8) !std.json.Obje test "a chunk narrows only when its scratch costs a stream the server asked for" { const gib: u64 = 1 << 30; // one stream asked, room for many either way: the larger chunk stays - try std.testing.expect(!narrows(40 * gib, 7 * gib, 2 * gib, 3 * gib, 1)); + try std.testing.expect(!narrows(40 * gib, 0, 7 * gib, 2 * gib, 3 * gib, 1)); // one stream fits only beside the smaller chunk's scratch - try std.testing.expect(narrows(9 * gib, 7 * gib, 2 * gib, 4 * gib, 1)); + try std.testing.expect(narrows(9 * gib, 0, 7 * gib, 2 * gib, 4 * gib, 1)); // four asked: the larger chunk leaves three, the smaller four - try std.testing.expect(narrows(20 * gib, 7 * gib, 2 * gib, 4 * gib, 4)); + try std.testing.expect(narrows(20 * gib, 0, 7 * gib, 2 * gib, 4 * gib, 4)); // four asked and four fit beside either - try std.testing.expect(!narrows(30 * gib, 7 * gib, 2 * gib, 4 * gib, 4)); + try std.testing.expect(!narrows(30 * gib, 0, 7 * gib, 2 * gib, 4 * gib, 4)); // neither fits one: nothing to gain - try std.testing.expect(!narrows(3 * gib, 7 * gib, 2 * gib, 4 * gib, 1)); + try std.testing.expect(!narrows(3 * gib, 0, 7 * gib, 2 * gib, 4 * gib, 1)); +} + +test "the chunk fallback leaves the window plan slots' bytes off the room" { + const gib: u64 = 1 << 30; + // one stream fits beside either chunk's scratch: the larger stays + try std.testing.expect(!narrows(13 * gib, 0, 7 * gib, 2 * gib, 4 * gib, 1)); + // the same room with the slots' bytes off it: one stream fits only beside the smaller chunk's scratch + try std.testing.expect(narrows(13 * gib, 4 * gib, 7 * gib, 2 * gib, 4 * gib, 1)); + // the room was already tight for four with no slots: the subtraction stays a narrowing + try std.testing.expect(narrows(20 * gib, 4 * gib, 7 * gib, 2 * gib, 4 * gib, 4)); } diff --git a/zig/src/families/flashnext/hip/facts.zig b/zig/src/families/flashnext/hip/facts.zig new file mode 100644 index 00000000000..fe82e50eab6 --- /dev/null +++ b/zig/src/families/flashnext/hip/facts.zig @@ -0,0 +1,48 @@ +//! The lane core's facts of a loaded Flash Next model, pure so a host test drives them without a device. +const std = @import("std"); +const lanes = @import("lanes"); +const cache = @import("cache.zig"); + +/// MTP drafts the HIP head takes at most: `--mtp-drafts` is refused past it (native/hip.zig's check). +pub const mtp_max_drafts: u32 = 3; + +/// The policy's `--mtp-drafts` capped at the head's. +pub fn capDrafts(asked: u8) u32 { + return @min(mtp_max_drafts, @as(u32, asked)); +} + +/// A shared round's copy window and a lone stream's first: the pending row and three copies; lone runs grow past it. +const shared_copy_rows = 4; + +/// The lane core's facts of a loaded model: `drafting` names a head that drafts, `drafts` its capped chains. +pub fn factsFor(exact_width: u32, streams: usize, drafting: bool, drafts: u32) lanes.Model { + return .{ + .exact_width = exact_width, + .first_copy_rows = shared_copy_rows, + .gpu_tokens = false, + .mtp = drafting, + .speculate = drafting, + .speculate_early = false, + .drafts = drafts, + .hidden_rows = true, + .batch_rows = @intCast(exact_width * streams), + .max_streams = @intCast(streams), + .draft_streams = drafting, + }; +} + +test "the shared round's copy window: the lane core takes three copies, a lone stream the whole window" { + const a = std.testing.allocator; + var cfg = try lanes.Config.init(a, factsFor(cache.max_window, 2, true, 3), cache.max_window, cache.max_window - 1); + defer cfg.deinit(a); + try std.testing.expectEqual(@as(u32, 3), cfg.first_copy); + try std.testing.expectEqual(@as(u32, 7), cfg.max_copy); + try std.testing.expectEqual(@as(u32, 4), cfg.base_width); +} + +test "the extracted facts retain the loaded head drafting mode" { + for ([_]bool{ false, true }) |drafting| { + const facts = factsFor(cache.max_window, 2, drafting, 3); + try std.testing.expectEqual(drafting, facts.draft_streams); + } +} diff --git a/zig/src/families/flashnext/hip/lanes.zig b/zig/src/families/flashnext/hip/lanes.zig index 8c84d8f2aec..8cd05d12829 100644 --- a/zig/src/families/flashnext/hip/lanes.zig +++ b/zig/src/families/flashnext/hip/lanes.zig @@ -5,6 +5,7 @@ const lanes = @import("lanes"); const serve = @import("hip_serve"); const Engine = @import("engine.zig").Engine; const cache = @import("cache.zig"); +const facts_mod = @import("facts.zig"); const forward = @import("forward.zig"); const head_mod = @import("head.zig"); const draft_batch = @import("draft_batch.zig"); @@ -20,7 +21,6 @@ const draw = serve.draw; pub const ring = 1024; /// Drafts the head holds for a stream at most. pub const max_depth = cache.max_window - 1; - pub const Fill = struct { at: usize, stops: [16]u32 = undefined, @@ -82,7 +82,7 @@ pub const Fx = struct { .streams = streams, .ones = try hip.DeviceBuffer.fromHost(&e.driver, std.mem.sliceAsBytes(host)), .draft_ids = &.{}, - .drafts = @min(max_depth, e.o.policy.mtp.drafts), + .drafts = facts_mod.capDrafts(e.o.policy.mtp.drafts), }; errdefer f.ones.free(); if (e.weights.model.mtp != null) f.draft_ids = try load.draftIds(gpa); @@ -206,19 +206,7 @@ pub const Fx = struct { } pub fn facts(f: *const Fx) lanes.Model { - const drafting = f.e.weights.model.mtp != null and f.drafts > 0; - return .{ - .exact_width = cache.max_window, - .gpu_tokens = false, - .mtp = drafting, - .speculate = drafting, - .speculate_early = false, - .drafts = f.drafts, - .hidden_rows = true, - .batch_rows = @intCast(cache.max_window * f.streams), - .max_streams = @intCast(f.streams), - .draft_streams = drafting, - }; + return facts_mod.factsFor(cache.max_window, f.streams, f.e.weights.model.mtp != null and f.drafts > 0, f.drafts); } fn free(f: *Fx, l: *Lane) void { @@ -522,3 +510,14 @@ pub const Fx = struct { f.free(kv.value); } }; + +test "MTP stays at three: the constant, the cap and the facts never report more" { + try std.testing.expectEqual(@as(u32, 3), facts_mod.mtp_max_drafts); + try std.testing.expectEqual(@as(u32, 3), facts_mod.capDrafts(3)); + try std.testing.expectEqual(@as(u32, 3), facts_mod.capDrafts(7)); + const m = facts_mod.factsFor(cache.max_window, 2, true, facts_mod.capDrafts(7)); + try std.testing.expectEqual(@as(u32, 3), m.drafts); + var cfg = try lanes.Config.init(std.testing.allocator, m, cache.max_window, cache.max_window - 1); + defer cfg.deinit(std.testing.allocator); + try std.testing.expectEqual(@as(u32, 3), cfg.most_drafts); +} diff --git a/zig/src/families/flashnext/hip/worker.zig b/zig/src/families/flashnext/hip/worker.zig index 53acf1c07f7..f28c49fd4c4 100644 --- a/zig/src/families/flashnext/hip/worker.zig +++ b/zig/src/families/flashnext/hip/worker.zig @@ -23,6 +23,11 @@ pub fn step(w: []const u32) error{ EmptyMessage, ShortMessage, UnknownStep }!Op return op; } +/// A begin's cache slot: one this rank's pool holds, or the next (rank 0 leases the lowest slot no stream holds). +pub fn slotFits(slot: u32, slots: usize) bool { + return slot <= slots; +} + const Lane = struct { caches: cache.Caches, pending: [cache.max_window]u32 = undefined, @@ -57,6 +62,7 @@ pub fn follow(gpa: std.mem.Allocator, e: *Engine, link: hip.collective.Link) !vo switch (try step(w)) { .stop => return, .begin => { + if (!slotFits(w[2], e.pool.slots.items.len)) return error.ShortMessage; const lane = try gpa.create(Lane); errdefer gpa.destroy(lane); if (lanes.fetchRemove(w[1])) |kv| { @@ -148,3 +154,10 @@ test "security: a step from the link is refused unless its message holds the wor try t.expectEqual(need[0], try step(words[0..need[1]])); } } + +test "security: a begin's cache slot is refused past this rank's pool, and the next slot passes" { + try std.testing.expect(slotFits(0, 0)); + try std.testing.expect(slotFits(7, 7)); + try std.testing.expect(!slotFits(8, 7)); + try std.testing.expect(!slotFits(0xffff_ffff, 7)); +} diff --git a/zig/src/families/gemma4/dflash_weights.zig b/zig/src/families/gemma4/dflash_weights.zig index bbf53514aa4..8f13e0465f6 100644 --- a/zig/src/families/gemma4/dflash_weights.zig +++ b/zig/src/families/gemma4/dflash_weights.zig @@ -63,6 +63,7 @@ pub const Config = struct { for (kinds.array.items, 0..) |k, i| c.sliding[i] = k == .string and std.mem.eql(u8, k.string, "sliding_attention"); } if (o.get("is_causal") != null) return error.UnsupportedDraftMask; // the vendored default decides the block's mask + if (c.heads == 0 or c.kv_heads == 0) return error.BadDraftConfig; // a count below 1, as CUDA's twin refuses it if (c.head_dim != 128 or c.heads % c.kv_heads != 0 or c.heads > 128 or c.block != 16 or c.window < 32) return error.UnsupportedDraftShape; if (c.hidden % 64 != 0 or c.intermediate % 64 != 0 or (c.heads * c.head_dim) % 32 != 0 or (c.kv_heads * c.head_dim) % 64 != 0) return error.UnsupportedDraftShape; if (c.mask >= cfg.vocab) return error.BadDraftConfig; @@ -298,6 +299,16 @@ test "the stock drafter config is admitted and others refused with a reason" { defer std.testing.allocator.free(causal); try std.testing.expectError(error.UnsupportedDraftMask, Config.parse(std.testing.allocator, causal, cfg.dense31b)); try std.testing.expectError(error.DraftForAnotherTarget, Config.parse(std.testing.allocator, stock, cfg.unified12b)); + // a head count of 0, refused as CUDA's twin refuses it, before heads % kv_heads + const zeros = [_][2][]const u8{ + .{ "\"num_attention_heads\":64", "\"num_attention_heads\":0" }, + .{ "\"num_key_value_heads\":8", "\"num_key_value_heads\":0" }, + }; + for (zeros) |row| { + const zero = try std.mem.replaceOwned(u8, std.testing.allocator, stock, row[0], row[1]); + defer std.testing.allocator.free(zero); + try std.testing.expectError(error.BadDraftConfig, Config.parse(std.testing.allocator, zero, cfg.dense31b)); + } } test "4-bit quantization keeps the larger edge exact and zero within the scale's bf16 rounding, as MLX does" { diff --git a/zig/src/families/gemma4/gemma4.zig b/zig/src/families/gemma4/gemma4.zig index 6ad0e3911ec..75b13955841 100644 --- a/zig/src/families/gemma4/gemma4.zig +++ b/zig/src/families/gemma4/gemma4.zig @@ -20,6 +20,7 @@ pub const snapshot = @import("snapshot.zig"); test { _ = backend; + _ = @import("model.zig"); _ = assistant; _ = assistant_weights; _ = config; diff --git a/zig/src/families/gemma4/model.zig b/zig/src/families/gemma4/model.zig index 7246940f2de..d9eeef3b66a 100644 --- a/zig/src/families/gemma4/model.zig +++ b/zig/src/families/gemma4/model.zig @@ -161,12 +161,15 @@ pub const Model = struct { if (m.config.geo.unified()) { try vision_unified.addTensors(&m.checkpoint, m.device, files); if (!vision_unified.present(&m.checkpoint)) return error.NoGemmaVision; - m.vision = .{ .embedder = try vision_unified.Embedder.load(m.gpa, m.device, &m.checkpoint, m.config.geo.hidden, m.pipes(m.config.widths.vision.bits), m.config.widths.vision) }; + // bound first: a failed load must leave m.vision null, not a tag with no embedder behind it + const e = try vision_unified.Embedder.load(m.gpa, m.device, &m.checkpoint, m.config.geo.hidden, m.pipes(m.config.widths.vision.bits), m.config.widths.vision); + m.vision = .{ .embedder = e }; return; } try vision.addTensors(&m.checkpoint, m.device, files); if (!vision.present(&m.checkpoint)) return error.NoGemmaVision; - m.vision = .{ .encoder = try vision.Vision.load(m.gpa, m.device, &m.checkpoint, m.pipes(m.config.widths.vision.bits), m.config.widths.vision, m.config.geo.hidden) }; + const v = try vision.Vision.load(m.gpa, m.device, &m.checkpoint, m.pipes(m.config.widths.vision.bits), m.config.widths.vision, m.config.geo.hidden); + m.vision = .{ .encoder = v }; } /// The drafter's taps, in its feature order: each a layer whose output (layer scalar applied) it reads. @@ -195,3 +198,33 @@ pub const Model = struct { m.gpa.destroy(m); } }; + +test "a tower that fails to load leaves the model without one, so deinit frees nothing that was never made" { + if (comptime !@hasDecl(mtl.Device, "init")) return error.SkipZigTest; + const device = mtl.Device.init() catch return error.SkipZigTest; + defer device.deinit(); + const gpa = std.testing.allocator; + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + // the name vision_unified.present() looks for, so loadVision reaches Embedder.load + const header = + \\{"vision_embedder.patch_dense.weight":{"dtype":"BF16","shape":[2],"data_offsets":[0,4]}} + ; + var data: [8 + header.len + 4]u8 = @splat(0); + std.mem.writeInt(u64, data[0..8], header.len, .little); + @memcpy(data[8..][0..header.len], header); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "model.safetensors", .data = &data }); + const dir = try std.fmt.allocPrint(gpa, ".zig-cache/tmp/{s}", .{tmp.sub_path}); + defer gpa.free(dir); + var m: Model = undefined; + m.gpa = gpa; + m.device = device; + m.checkpoint = ckpt.Checkpoint.init(gpa); + defer m.checkpoint.deinit(); + m.vision = null; + m.config = .{ .geo = cfg.unified12b, .context = 1 }; + m.config.geo.hidden = vision_unified.width + 1; // a width the embedder cannot project to: Embedder.load refuses it + for (&m.mm) |*p| p.* = @as(affine_mm.Pipes, undefined); // never read: the refusal comes first + try std.testing.expectError(error.UnexpectedGemmaVisionTensor, m.loadVision(std.testing.io, dir)); + try std.testing.expect(m.vision == null); +} diff --git a/zig/src/families/glm/cuda.zig b/zig/src/families/glm/cuda.zig index d11094d0599..588f1481ec9 100644 --- a/zig/src/families/glm/cuda.zig +++ b/zig/src/families/glm/cuda.zig @@ -43,6 +43,7 @@ pub const lane_costs = @import("cuda_lane_costs.zig"); pub const native = @import("cuda_native.zig"); pub const snapshots = @import("cuda_snapshots.zig"); pub const kv_host = @import("cuda_kv_host.zig"); +pub const pdl = @import("cuda_pdl.zig"); test { _ = lane_costs; @@ -60,6 +61,7 @@ test { _ = @import("cuda_ranks_roce_test.zig"); _ = @import("cuda_env.zig"); _ = @import("cuda_taps_tp_test.zig"); + _ = @import("cuda_pdl.zig"); _ = @import("cuda_resolve_test.zig"); _ = @import("cuda_boundary.zig"); _ = @import("cuda_roce_multi.zig"); diff --git a/zig/src/families/glm/cuda_b16.zig b/zig/src/families/glm/cuda_b16.zig index 77e6fb61714..9662db17283 100644 --- a/zig/src/families/glm/cuda_b16.zig +++ b/zig/src/families/glm/cuda_b16.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const mm = @import("cuda_mm.zig"); @@ -73,9 +74,9 @@ pub fn matmul(set: glue.Set, stream: cuda.Stream, x: u64, x_stride: usize, w: u6 const f = if (one) set.glue.bmm_tile1 else set.glue.bmm_tile; const bn: usize = if (one) 128 else 64; const shared: u32 = if (one) glue.bmm_tile1_smem[@intFromBool(wide)] else glue.bmm_tile_smem; - return cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(cdiv(m, 128)), .y = @intCast(cdiv(n, bn)) }, .block = .{ .x = 256 }, .shared = shared }, stream, &a); + return cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(cdiv(m, 128)), .y = @intCast(cdiv(n, bn)) }, .block = .{ .x = 256 }, .shared = shared }, stream, &a); } - if (m >= rows_from) return cuda.launch.launch(set.glue.bmm_rows, .{ .grid = .{ .x = @intCast(cdiv(m, 128)), .y = @intCast(cdiv(n, 64)) }, .block = .{ .x = 128 } }, stream, &a); + if (m >= rows_from) return cuda_pdl.launch(set.glue.bmm_rows, .{ .grid = .{ .x = @intCast(cdiv(m, 128)), .y = @intCast(cdiv(n, 64)) }, .block = .{ .x = 128 } }, stream, &a); if (decodeTile(n, k)) |t| { if (x % 16 == 0 and x_stride % 8 == 0 and n % 8 == 0 and out % 16 == 0 and part % 16 == 0) { const f = switch (t.bn * 10 + t.st) { @@ -86,12 +87,12 @@ pub fn matmul(set: glue.Set, stream: cuda.Stream, x: u64, x_stride: usize, w: u6 else => unreachable, }; const shared: u32 = t.st * (16 + t.bn) * bk * 2; // Tile<16, bn, 64, st, 1, 4>'s stages (the output tile is smaller) - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(cdiv(m, 16)), .y = @intCast(cdiv(n, t.bn)), .z = @intCast(sk) }, .block = .{ .x = 128 }, .shared = shared }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(cdiv(m, 16)), .y = @intCast(cdiv(n, t.bn)), .z = @intCast(sk) }, .block = .{ .x = 128 }, .shared = shared }, stream, &a); if (sk > 1) try glue.sliceSum(set, stream, part, out, m * n, sk, wide); return; } } - try cuda.launch.launch(set.glue.bmm_decode, .{ .grid = .{ .x = @intCast(cdiv(m, 16)), .y = @intCast(cdiv(n, 64)), .z = @intCast(sk) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.bmm_decode, .{ .grid = .{ .x = @intCast(cdiv(m, 16)), .y = @intCast(cdiv(n, 64)), .z = @intCast(sk) }, .block = .{ .x = 128 } }, stream, &a); if (sk > 1) try glue.sliceSum(set, stream, part, out, m * n, sk, wide); } @@ -99,7 +100,7 @@ pub fn matmul(set: glue.Set, stream: cuda.Stream, x: u64, x_stride: usize, w: u6 pub fn groupSums(set: glue.Set, stream: cuda.Stream, x: u64, x_stride: usize, xs: u64, m: usize, k: usize) !void { var a: cuda.Args = .{}; inline for (.{ x, xs, @as(i64, @intCast(x_stride)), @as(i64, @intCast(k / 64)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.group_sums, .{ .grid = .{ .x = @intCast(m), .y = @intCast(cdiv(k / 64, 16)) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.group_sums, .{ .grid = .{ .x = @intCast(m), .y = @intCast(cdiv(k / 64, 16)) }, .block = .{ .x = 128 } }, stream, &a); } test "K slices as qmm.py picks them" { diff --git a/zig/src/families/glm/cuda_dsa_block.zig b/zig/src/families/glm/cuda_dsa_block.zig index 57c8c5d209d..61d9c15aa63 100644 --- a/zig/src/families/glm/cuda_dsa_block.zig +++ b/zig/src/families/glm/cuda_dsa_block.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const projection = @import("cuda_proj.zig"); const latent = @import("cuda_latent.zig"); @@ -194,7 +195,7 @@ fn attendLastRow(k: Kernels, stream: cuda.Stream, l: Layer, c: Caches, s: Scratc a.add(pos); a.add(@as(c_int, @intCast(r0))); a.add(v.at); - try cuda.launch.launch(try k.ops.function("tf_glm_add_i32"), .{ .grid = .{ .x = 1 }, .block = .{ .x = 32 } }, stream, &a); + try cuda_pdl.launch(try k.ops.function("tf_glm_add_i32"), .{ .grid = .{ .x = 1 }, .block = .{ .x = 32 } }, stream, &a); at = v.at; } const scale: f32 = @floatCast(std.math.pow(f64, @floatFromInt(l.qk), -0.5)); @@ -224,7 +225,7 @@ fn denseAttention(k: Kernels, stream: cuda.Stream, l: Layer, c: Caches, s: Scrat a.add(pos); a.add(@as(c_int, @intCast(r0))); a.add(s.at); - try cuda.launch.launch(try k.ops.function("tf_glm_add_i32"), .{ .grid = .{ .x = 1 }, .block = .{ .x = 32 } }, stream, &a); + try cuda_pdl.launch(try k.ops.function("tf_glm_add_i32"), .{ .grid = .{ .x = 1 }, .block = .{ .x = 32 } }, stream, &a); at = s.at; } const off = r0 * l.heads * l.lw * 2; diff --git a/zig/src/families/glm/cuda_engine_pick.zig b/zig/src/families/glm/cuda_engine_pick.zig index afd14c136bf..9936bd4b50b 100644 --- a/zig/src/families/glm/cuda_engine_pick.zig +++ b/zig/src/families/glm/cuda_engine_pick.zig @@ -1,5 +1,6 @@ //! The existing rank-gathered greedy pick, kept separate from engine lifetime and prompt diagnostics. const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const std = @import("std"); const ranks = @import("cuda_ranks.zig"); const chance = @import("cuda_mtp_chance.zig"); @@ -26,7 +27,7 @@ pub fn greedyRows(e: *Engine, logits: u64, rows: usize, out: []u32) !void { a.add(@as(i64, @intCast(e.share.vocab.len()))); a.add(@as(u32, @intCast(e.share.vocab.lo))); a.add(mine + r * pair_bytes); - try cuda.launch.launch(e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); + try cuda_pdl.launch(e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); } if (e.group) |g| try g.allGather(e.stream, mine, e.pairs.ptr, bytes) else try e.lib.check(e.lib.api.ncclAllGather(mine, e.pairs.ptr, bytes, .u8, e.comm, e.stream.handle), "ncclAllGather"); try e.stream.synchronize(); @@ -52,7 +53,7 @@ fn pick(e: *Engine, logits: u64, sums: bool) !chance.Pick { a.add(@as(i64, @intCast(e.share.vocab.len()))); a.add(@as(u32, @intCast(e.share.vocab.lo))); a.add(e.pairs.ptr + e.share.rank * pair_bytes); - try cuda.launch.launch(if (sums) e.m.glue.top1_sums else e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); + try cuda_pdl.launch(if (sums) e.m.glue.top1_sums else e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); const mine = e.pairs.ptr + e.share.rank * pair_bytes; const stamp = @import("cuda_prof.zig").span(e.profiling_prompt, e.stream, .token_gather); if (e.group) |g| try g.allGather(e.stream, mine, e.pairs.ptr, pair_bytes) else try e.lib.check(e.lib.api.ncclAllGather(mine, e.pairs.ptr, pair_bytes, .u8, e.comm, e.stream.handle), "ncclAllGather"); diff --git a/zig/src/families/glm/cuda_follow.zig b/zig/src/families/glm/cuda_follow.zig index 25ef795ed98..940dceac462 100644 --- a/zig/src/families/glm/cuda_follow.zig +++ b/zig/src/families/glm/cuda_follow.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const engine = @import("cuda_engine.zig"); const prompt_solo = @import("cuda_prompt_solo.zig"); const prompt_cuts = @import("cuda_prompt_cuts.zig"); @@ -93,7 +94,7 @@ pub const Link = struct { a.add(l.buf.ptr); a.add(@as(u32, @intCast(16 + ids.len))); a.add(w); - try cuda.launch.launch(put, .{ .grid = .{ .x = 1 }, .block = .{ .x = 128 } }, l.stream, &a); + try cuda_pdl.launch(put, .{ .grid = .{ .x = 1 }, .block = .{ .x = 128 } }, l.stream, &a); try l.post(first_bytes); if (ids.len > inline_ids) try l.post(64 + ids.len * 4); return; @@ -154,7 +155,7 @@ pub const Leader = struct { return @intFromBool(x.e.prompt_logprobs != null); } - /// No stream is left: the other ranks sleep on their lines until the next step instead of spinning in NCCL. + /// No stream is left, or rank 0's tower is about to run: the other ranks sleep on their lines until the next step. pub fn idle(x: Leader) !void { if (x.link.asleep or !cuda.tp_watch.open()) return; try x.send(.{ .kind = @backingInt(Kind.idle) }, &.{}); @@ -216,6 +217,13 @@ pub const Leader = struct { try x.send(.{ .kind = @backingInt(Kind.pool), .depth = streams, .a = pages, .seed = page_bytes }, &.{}); } + /// Rank 0's tower encodes the bound slot's images past `from` with the other ranks asleep (#3614), then their rows. + pub fn encode(x: Leader, v: *images_mod.Images, list: []const @import("lanes").stream.Image, from: usize) !void { + try x.idle(); // a net plugin may time out an NCCL wait as long as the pass: they wait on their lines instead + try v.begin(x.e.slot, list, from); // a refusal leaves every rank as it was, asleep until rank 0's next step + try x.images(v); + } + /// The prompt pass's image rows (rank 0 encoded them for the bound slot) to every rank: spans, then the rows. pub fn images(x: Leader, v: *const images_mod.Images) !void { try x.flush(); diff --git a/zig/src/families/glm/cuda_forward.zig b/zig/src/families/glm/cuda_forward.zig index 28c4e471686..34ace9226db 100644 --- a/zig/src/families/glm/cuda_forward.zig +++ b/zig/src/families/glm/cuda_forward.zig @@ -65,10 +65,12 @@ pub const Modules = struct { n += 1; } m.lane = try cuda.qmmf.Lane.load(d, @intCast(try ctx.attribute(.compute_capability_major))); + m.lane.pdl = @import("cuda_pdl.zig").on(); errdefer m.lane.unload(); m.prompt = try cuda.nvfp4.Prompt.load(d); errdefer m.prompt.unload(); m.kda = try kda.Kernels.load(m.mods[0]); + m.kda.pdl = @import("cuda_pdl.zig").on(); m.experts = try experts.Kernels.load(d, m.mods[2], @intCast(try ctx.attribute(.multiprocessor_count)), block32); errdefer m.experts.unload(); m.copy_rows = try m.mods[1].function("tf_glm_copy_rows"); diff --git a/zig/src/families/glm/cuda_glue.zig b/zig/src/families/glm/cuda_glue.zig index 777355de58f..b2b088ac715 100644 --- a/zig/src/families/glm/cuda_glue.zig +++ b/zig/src/families/glm/cuda_glue.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const mm_mod = @import("cuda_mm.zig"); const index_mod = @import("cuda_index.zig"); @@ -87,14 +88,14 @@ pub const Kernels = struct { /// An element-wise kernel's launch: a block of 256 columns, `rows` x the blocks to cover `d`. fn rowsLaunch(f: cuda.Function, stream: cuda.Stream, a: *cuda.Args, rows: usize, d: usize) !void { - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(d, 256) }, .block = .{ .x = 256 } }, stream, a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(d, 256) }, .block = .{ .x = 256 } }, stream, a); } /// As above, 8 columns a thread (16-byte loads), 1024 a block of 128 (Triton's BLOCK); d % 8 == 0, rows 16B-aligned. fn rows8Launch(f: cuda.Function, stream: cuda.Stream, a: *cuda.Args, rows: usize, d: usize, ptrs: anytype) !void { if (d % 8 != 0) return error.WidthNotEights; inline for (ptrs) |p| if (p % 16 != 0) return error.RowsUnaligned; - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(d, 1024) }, .block = .{ .x = 128 } }, stream, a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(d, 1024) }, .block = .{ .x = 128 } }, stream, a); } fn i64of(v: usize) i64 { @@ -126,7 +127,7 @@ pub fn rmsnorm(set: Set, stream: cuda.Stream, x: u64, x_stride: usize, w: u64, o a.add(xs orelse @as(u64, 0)); a.add(eps); a.add(@as(c_int, @intFromBool(xs != null))); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = warps * 32 } }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = warps * 32 } }, stream, &a); } /// rmsnorm by a Norm: a float32 weight (the hidden size) through rmsnorm_4096_f32w, rmsnorm_4096's arithmetic. @@ -138,7 +139,7 @@ pub fn rmsnormBy(set: Set, stream: cuda.Stream, x: u64, x_stride: usize, n: Norm if (d != 4096) return error.NoRmsnormWidth; var a: cuda.Args = .{}; inline for (.{ x, i64of(x_stride), g, out, i64of(o_stride), xs orelse @as(u64, 0), eps, @as(c_int, @intFromBool(xs != null)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.rmsnorm_4096_f32w, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(set.glue.rmsnorm_4096_f32w, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &a); } fn cdiv(a: usize, b: usize) u32 { @@ -158,7 +159,7 @@ pub fn swiglu(set: Set, stream: cuda.Stream, gu: u64, out: u64, xs: u64, limit: const f, const threads: u32 = if (block == 512) .{ set.glue.swiglu_512, 128 } else .{ set.glue.swiglu_64, 64 }; var a: cuda.Args = .{}; inline for (.{ gu, out, xs, limit, i64of(w) }) |v| a.add(v); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = @intCast(w / block) }, .block = .{ .x = threads } }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = @intCast(w / block) }, .block = .{ .x = threads } }, stream, &a); } /// glm_glue_bmm.cuh's Tile::smem(f32) of tf_glm_bmm_tile: 3 stages of 128 x and 64 w rows, 64 bf16 a row. @@ -182,7 +183,7 @@ pub fn router(set: Set, stream: cuda.Stream, x: u64, x_stride: usize, w: u64, ou if (x % 16 != 0 or x_stride % 8 != 0 or w % 16 != 0) return error.RowShape; // the tiles stage rows by cp.async var a: cuda.Args = .{}; inline for (.{ x, w, part, i64of(m), i64of(x_stride), i64of(d), i64of(ne), @as(c_int, router_ks) }) |v| a.add(v); - try cuda.launch.launch(set.glue.router_tile, .{ .grid = .{ .x = cdiv(m, 64), .y = cdiv(ne, 32), .z = router_ks }, .block = .{ .x = 128 }, .shared = router_tile_smem }, stream, &a); + try cuda_pdl.launch(set.glue.router_tile, .{ .grid = .{ .x = cdiv(m, 64), .y = cdiv(ne, 32), .z = router_ks }, .block = .{ .x = 128 }, .shared = router_tile_smem }, stream, &a); try sliceSum(set, stream, part, out, m * ne, router_ks, true); } @@ -191,7 +192,7 @@ pub fn select(set: Set, stream: cuda.Stream, logits: u64, bias: u64, pick: u64, if (experts > 512 or top_k >= 32) return error.TopkTooWide; var a: cuda.Args = .{}; inline for (.{ logits, bias, pick, wts, scale, cint(experts), cint(top_k), @as(c_int, @intFromBool(norm)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.topk, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 32 } }, stream, &a); + try cuda_pdl.launch(set.glue.topk, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 32 } }, stream, &a); } /// glue.combine: out [rows][d] fp32 = sum over slots in order of wts[r][k] y[r][k] (y fp32 in decode, bf16 in prefill). @@ -216,10 +217,10 @@ pub fn hcPre(set: Set, stream: cuda.Stream, x: u64, fn_w: u64, base: u64, scale: inline for (.{ x, fn_w, part, i64of(s * d), @as(c_int, hc_blocks) }) |v| a.add(v); // Decode windows (16 blocks a row) take each block's 8 steps at once; prompt rows 4 rows a 128-thread block. if (rows < 64) { - try cuda.launch.launch(set.glue.hc_partial8, .{ .grid = .{ .x = @intCast(rows), .y = hc_blocks }, .block = .{ .x = 1024 } }, stream, &a); + try cuda_pdl.launch(set.glue.hc_partial8, .{ .grid = .{ .x = @intCast(rows), .y = hc_blocks }, .block = .{ .x = 1024 } }, stream, &a); } else { a.add(i64of(rows)); - try cuda.launch.launch(set.glue.hc_partial, .{ .grid = .{ .x = cdiv(rows, 4), .y = hc_blocks }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.hc_partial, .{ .grid = .{ .x = cdiv(rows, 4), .y = hc_blocks }, .block = .{ .x = 128 } }, stream, &a); } const f, const w = switch (norm) { .bf16 => |p| .{ set.glue.hc_finish, p }, @@ -227,7 +228,7 @@ pub fn hcPre(set: Set, stream: cuda.Stream, x: u64, fn_w: u64, base: u64, scale: }; var b: cuda.Args = .{}; inline for (.{ x, part, base, scale, w, out, xs, post, comb, eps, hc_eps, @as(c_int, hc_blocks), cint(iters) }) |v| b.add(v); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &b); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &b); } /// glue.hc_post: branch = bf16(`g`, rank 0 first); xout[s] = bf16(post[s] branch + sum_t comb[t][s] x[t]); x may alias. @@ -277,7 +278,7 @@ pub fn convShift(set: Set, stream: cuda.Stream, conv: u64, proj: u64, keep: usiz pub fn sliceSum(set: Set, stream: cuda.Stream, part: u64, out: u64, total: usize, ks: usize, wide: bool) !void { var a: cuda.Args = .{}; inline for (.{ part, out, i64of(total), cint(ks), @as(c_int, @intFromBool(wide)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.slice_sum, .{ .grid = .{ .x = cdiv(total, 1024) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.slice_sum, .{ .grid = .{ .x = cdiv(total, 1024) }, .block = .{ .x = 128 } }, stream, &a); } test "the norm's block is the next power of two of the width" { diff --git a/zig/src/families/glm/cuda_images.zig b/zig/src/families/glm/cuda_images.zig index fad0506f68e..b4d8642465a 100644 --- a/zig/src/families/glm/cuda_images.zig +++ b/zig/src/families/glm/cuda_images.zig @@ -1,6 +1,7 @@ //! A prompt pass's image rows on every rank: rank 0's tower encodes them, the others receive them, all splice them. const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const lanes = @import("lanes"); const vision = @import("cuda_vision.zig"); const vcfg = @import("vision_config.zig"); @@ -217,7 +218,7 @@ pub const Images = struct { a.add(@as(c_int, @intCast(n))); a.add(@as(c_int, @intCast(vcfg.out_hidden))); a.add(@as(c_int, @intCast(copies))); - try cuda.launch.launch(v.run.f.inject, .{ .grid = .{ .x = @intCast(n) }, .block = .{ .x = 256 } }, s, &a); + try cuda_pdl.launch(v.run.f.inject, .{ .grid = .{ .x = @intCast(n) }, .block = .{ .x = 256 } }, s, &a); } /// The words for a prepare error the server cannot word (a JPEG library this machine lacks). diff --git a/zig/src/families/glm/cuda_images_interleave_test.zig b/zig/src/families/glm/cuda_images_interleave_test.zig index 1046a8c38a8..e9bea3c9d3b 100644 --- a/zig/src/families/glm/cuda_images_interleave_test.zig +++ b/zig/src/families/glm/cuda_images_interleave_test.zig @@ -76,6 +76,8 @@ fn run(other_media: bool) !void { d.api.cuMemcpyHtoDAsync_v2 = Fake.uploadAsync; d.api.cuStreamSynchronize = Fake.sync; d.api.cuLaunchKernel = Fake.launch; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Fake.launch); + d.func_name = null; Fake.owned(&d); const stream: cuda.Stream = .{ .d = &d, .handle = @ptrFromInt(0x55) }; var map: [2049]i32 = undefined; @@ -147,6 +149,8 @@ test "slot 0's stream released while another slot is bound leaves that slot's ow d.api.cuMemcpyHtoDAsync_v2 = Fake.uploadAsync; d.api.cuStreamSynchronize = Fake.sync; d.api.cuLaunchKernel = Fake.launch; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Fake.launch); + d.func_name = null; Fake.owned(&d); const stream: cuda.Stream = .{ .d = &d, .handle = @ptrFromInt(0x55) }; var map: [2049]i32 = undefined; diff --git a/zig/src/families/glm/cuda_index.zig b/zig/src/families/glm/cuda_index.zig index 542822b9f67..70f986ce4e0 100644 --- a/zig/src/families/glm/cuda_index.zig +++ b/zig/src/families/glm/cuda_index.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const sparse = @import("cuda_sparse.zig"); @@ -81,7 +82,7 @@ pub const Kernels = struct { const g = scoresGrid(rows, nb); var a: cuda.Args = .{}; inline for (.{ qi, wts, @as(i64, @intCast(w_stride)), pk, out, at, @as(i64, @intCast(rows)), @as(i64, @intCast(np)), @as(i64, @intCast(nb)), scale, wscale, @as(i64, @intCast(heads)), @as(c_int, score_tiles), pt, @as(i64, @intCast(ps)) }) |v| a.add(v); - try cuda.launch.launch(k.scores_fn, .{ .grid = .{ .x = g[0], .y = g[1] }, .block = .{ .x = threads } }, s, &a); + try cuda_pdl.launch(k.scores_fn, .{ .grid = .{ .x = g[0], .y = g[1] }, .block = .{ .x = threads } }, s, &a); } /// tf_glm_select_rows' launch: each row's 512 best pools of scores [rows][np] ascending into out [rows][512] int64. @@ -89,7 +90,7 @@ pub const Kernels = struct { const t = tile(np); var a: cuda.Args = .{}; inline for (.{ scores_ptr, out, @as(i64, @intCast(np)), at, @as(c_int, topk), @as(c_int, @intCast(t.cap)), @as(c_int, @intCast(t.target)), path }) |v| a.add(v); - try cuda.launch.launch(k.pools_fn, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = pool_threads } }, s, &a); + try cuda_pdl.launch(k.pools_fn, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = pool_threads } }, s, &a); } }; @@ -153,6 +154,8 @@ test "GLM index: prompt chunks take the kernels; a decode row, an unaligned key const latent = @import("cuda_latent.zig"); var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Recorded.launch; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Recorded.launch); + d.func_name = null; d.api.cuModuleGetFunction = Recorded.function; var ks: glue.Kernels = undefined; // 20 tf_glm_scores, 21 tf_glm_select_rows, 22 its wide form ks.scores = .{ .d = &d, .handle = @ptrFromInt(20) }; diff --git a/zig/src/families/glm/cuda_kda_block.zig b/zig/src/families/glm/cuda_kda_block.zig index 92e3bcdd8af..8408249ff7b 100644 --- a/zig/src/families/glm/cuda_kda_block.zig +++ b/zig/src/families/glm/cuda_kda_block.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const kda = cuda.kda; const b16 = @import("cuda_b16.zig"); @@ -124,7 +125,7 @@ fn columns(set: glue.Set, stream: cuda.Stream, src: u64, cols: usize, dst: u64, a.add(@as(c_longlong, @intCast(stride * 2))); a.add(@as(c_int, @intCast(rows))); a.add(@as(c_int, @intCast(cols * 2))); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast((rows * cols * 2 + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast((rows * cols * 2 + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); } /// The chain over `rows` projected rows (s.p, s.ka, s.kg) on one sequence's conv window and recurrent state. diff --git a/zig/src/families/glm/cuda_kda_tp3_test.zig b/zig/src/families/glm/cuda_kda_tp3_test.zig index 252757ef656..0f0d90c0d31 100644 --- a/zig/src/families/glm/cuda_kda_tp3_test.zig +++ b/zig/src/families/glm/cuda_kda_tp3_test.zig @@ -42,6 +42,8 @@ test "GLM TP3: real KDA projections accept uneven shares and retain aligned tile const c = Config{}; var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Capture.launch; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Capture.launch); + d.func_name = null; const stream: cuda.Stream = .{ .d = &d, .handle = null }; var kernels: mm.Kernels = .{ .by_rows = @splat(function(&d, 1)), .prompt = function(&d, 2), .reduce = function(&d, 3), .pdl = false, .packed_rows = undefined, .tile = undefined, .tile_packed = undefined }; var raw: glue.Kernels = undefined; diff --git a/zig/src/families/glm/cuda_kv8_test.zig b/zig/src/families/glm/cuda_kv8_test.zig index 143483948cc..12f9f4df47b 100644 --- a/zig/src/families/glm/cuda_kv8_test.zig +++ b/zig/src/families/glm/cuda_kv8_test.zig @@ -106,6 +106,8 @@ test "GLM FP8 KV: real launchers preserve BF16 ABI and pass FP8 scale pointers f const latent = @import("cuda_latent.zig"); var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Launch.run; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Launch.run); + d.func_name = null; var ks: glue.Kernels = undefined; ks.lat_write = .{ .d = &d, .handle = @ptrFromInt(1) }; ks.lat_write_fp8 = .{ .d = &d, .handle = @ptrFromInt(2) }; @@ -141,6 +143,8 @@ test "GLM FP8 KV: an FP8 cache takes no page table, so its writes and reads refu const latent = @import("cuda_latent.zig"); var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Launch.run; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Launch.run); + d.func_name = null; var ks: glue.Kernels = undefined; inline for (@typeInfo(glue.Kernels).@"struct".field_names) |name| @field(ks, name) = .{ .d = &d, .handle = @ptrFromInt(10) }; const set: glue.Set = .{ .glue = &ks }; @@ -177,6 +181,8 @@ test "GLM FP8 KV: actual DSA dense and sparse passes retain the sequence-owned s const dsa = @import("cuda_dsa_block.zig"); var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Launch.run; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Launch.run); + d.func_name = null; d.api.cuModuleGetFunction = Ops.function; var ks: glue.Kernels = undefined; inline for (@typeInfo(glue.Kernels).@"struct".field_names) |name| @field(ks, name) = .{ .d = &d, .handle = @ptrFromInt(10) }; @@ -223,6 +229,8 @@ test "GLM KV host: a prompt MTP chunk's pooled keys take their own page stride, try t.expectEqual(@as(u64, 17), ps / pks); var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Launch.run; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(Launch.run); + d.func_name = null; d.api.cuModuleGetFunction = Ops.function; var ks: glue.Kernels = undefined; inline for (@typeInfo(glue.Kernels).@"struct".field_names) |name| @field(ks, name) = .{ .d = &d, .handle = @ptrFromInt(10) }; diff --git a/zig/src/families/glm/cuda_kv_host.zig b/zig/src/families/glm/cuda_kv_host.zig index 6866d0d78cb..24485508a61 100644 --- a/zig/src/families/glm/cuda_kv_host.zig +++ b/zig/src/families/glm/cuda_kv_host.zig @@ -1,6 +1,7 @@ //! TF_GLM_KV_HOST=1: the DSA layers' latent rows on pinned host pages, each call's picked rows gathered to the device. const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const posix = std.posix; pub fn onHost() bool { @@ -174,7 +175,7 @@ pub const Gather = struct { fn launch(ops: cuda.Module, stream: cuda.Stream, name: [:0]const u8, blocks: usize, args: anytype) !void { var a: cuda.Args = .{}; inline for (args) |v| a.add(v); - try cuda.launch.launch(try ops.function(name), .{ .grid = .{ .x = @intCast(blocks) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(try ops.function(name), .{ .grid = .{ .x = @intCast(blocks) }, .block = .{ .x = 256 } }, stream, &a); } /// The shared pages' file for an NCCL id (`host:port`), the same name on every rank. diff --git a/zig/src/families/glm/cuda_lane_costs.zig b/zig/src/families/glm/cuda_lane_costs.zig index da1233ad728..3e798ed90c2 100644 --- a/zig/src/families/glm/cuda_lane_costs.zig +++ b/zig/src/families/glm/cuda_lane_costs.zig @@ -150,13 +150,13 @@ fn keyShape(e: *const engine.Engine, sm: usize, driver: c_int, shape: []u8, pin: const hex = std.fmt.bytesToHex(e.checkpoint_digest, .lower); const draft_hex = std.fmt.bytesToHex(if (e.drafter) |dr| dr.checkpoint_digest else @as([32]u8, @splat(0)), .lower); const tail: []const u8 = if (pin) |f| (if (f) " form factored" else " form classic") else ""; - return std.fmt.bufPrint(shape, "sm{d} cuda{d} ranks{d} {s} drafter{d}/{d}/{s} layers{d} l2{d}/{d}/{d}/{d}/{d} warps{d} kda{d} mm{d} bits{d}/{d} kv8{d} pages{d} host{d} roce{d} p2p{s}/{s}/{s}{s}", .{ + return std.fmt.bufPrint(shape, "sm{d} cuda{d} ranks{d} {s} drafter{d}/{d}/{s} layers{d} l2{d}/{d}/{d}/{d}/{d} warps{d} kda{d} mm{d} bits{d}/{d} kv8{d} pages{d} host{d} roce{d} p2p{s}/{s}/{s} pad{d} pdl{d} dsel{d} wide{d}{s}", .{ sm, driver, e.share.world, hex[0..], @intFromBool(e.drafter != null), if (e.drafter) |dr| dr.bits else @as(u8, 0), draft_hex[0..], set.layers, @intFromBool(set.l2pf.on), @intFromBool(set.l2pf.named), set.l2pf.mb, set.l2pf.ctas, set.l2pf.pace_gbps, e.m.experts.nvfp4.warps, @intFromBool(set.kda_wide), @intFromBool(set.tiled), set.dense_bits, set.head_bits, @intFromBool(set.kv8), @intFromBool(set.pages), set.kv_host, @intFromBool(set.roce_multi), sys.getenv("NCCL_P2P_LEVEL") orelse "", sys.getenv("NCCL_MIN_NCHANNELS") orelse "", sys.getenv("NCCL_MAX_NCHANNELS") orelse "", - tail, + @intFromBool(set.kda_pad), @intFromBool(e.m.mm.pdl), @intFromBool(e.m.dsel), @intFromBool(set.roce_wide), tail, }); } @@ -243,13 +243,15 @@ test "GLM cost identity: the consumed key includes drafter precision and all tim e.checkpoint_digest = @splat(1); e.share.world = 2; e.m.experts.nvfp4.warps = 4; + e.m.mm.pdl = true; + e.m.dsel = true; var dr: dflash.Drafter = undefined; dr.bits = 4; dr.checkpoint_digest = @splat(2); e.drafter = &dr; var base: [512]u8 = undefined; const before = try keyShape(&e, 121, 13000, &base, null); - for (0..11) |which| { + for (0..15) |which| { const original = e.settings; switch (which) { 0 => dr.bits = 0, @@ -263,6 +265,10 @@ test "GLM cost identity: the consumed key includes drafter precision and all tim 8 => e.m.experts.nvfp4.warps = 1, 9 => e.drafter = null, 10 => e.checkpoint_digest[31] ^= 1, + 11 => e.settings.kda_pad = true, + 12 => e.m.mm.pdl = false, + 13 => e.m.dsel = false, + 14 => e.settings.roce_wide = true, else => unreachable, } var changed: [512]u8 = undefined; @@ -273,6 +279,8 @@ test "GLM cost identity: the consumed key includes drafter precision and all tim dr.checkpoint_digest = @splat(2); e.checkpoint_digest = @splat(1); e.m.experts.nvfp4.warps = 4; + e.m.mm.pdl = true; + e.m.dsel = true; } // a named form only ends the identity, so the race's key stays as it was var classic: [512]u8 = undefined; @@ -327,6 +335,8 @@ test "GLM cost identity: a record kept at one named form is not reused at the ot e.checkpoint_digest = @splat(1); e.share.world = 2; e.m.experts.nvfp4.warps = 4; + e.m.mm.pdl = true; + e.m.dsel = true; e.drafter = null; var shapes: [2][512]u8 = undefined; var keys: [2][32]u8 = undefined; diff --git a/zig/src/families/glm/cuda_lanes.zig b/zig/src/families/glm/cuda_lanes.zig index 08436c4d045..37eedcc152a 100644 --- a/zig/src/families/glm/cuda_lanes.zig +++ b/zig/src/families/glm/cuda_lanes.zig @@ -360,8 +360,7 @@ pub const Lanes = struct { fn images(self: *Lanes, s: *lanes.Stream, from: ?engine.Resume) !void { if (s.images.len == 0) return; const v = self.x.e.images orelse return error.NoVision; - try v.begin(self.x.e.slot, s.images, if (from) |r| r.at else 0); // a refusal here leaves every rank as it was - try self.x.images(v); + try self.x.encode(v, s.images, if (from) |r| r.at else 0); } const Sink = @import("cuda_prompt_sink.zig").Sink; diff --git a/zig/src/families/glm/cuda_latent.zig b/zig/src/families/glm/cuda_latent.zig index 8cc7b2eeb92..82e40283881 100644 --- a/zig/src/families/glm/cuda_latent.zig +++ b/zig/src/families/glm/cuda_latent.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); /// latent.CHUNK, KT, HB, HB_WIDE, PROMPT_ROWS, PROMPT_RB. @@ -37,7 +38,7 @@ fn rowBlocks(f: cuda.Function, stream: cuda.Stream, in: u64, w: u64, out: u64, r const rb = if (rows >= prompt_rows) prompt_rb else rows; var a: cuda.Args = .{}; inline for (.{ in, w, out, @as(i64, @intCast(rows)), @as(i64, @intCast(heads)), @as(i64, @intCast(rb)) }) |v| a.add(v); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(heads), .y = @intCast(cols), .z = cdiv(rows, rb) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(heads), .y = @intCast(cols), .z = cdiv(rows, rb) }, .block = .{ .x = 128 } }, stream, &a); } /// latent.expand_v (BF16 kv_b): out [rows][heads][dv] bf16 = o_lat [rows][heads][lw] . wv [heads][dv][lw]. @@ -63,14 +64,14 @@ pub fn latentWriteFormat(set: glue.Set, stream: cuda.Stream, lat: u64, lat_strid if (t.pt != 0) return error.Fp8OnPages; var a: cuda.Args = .{}; inline for (.{ lat, @as(i64, @intCast(lat_stride)), cache, scales, pos }) |v| a.add(v); - try cuda.launch.launch(set.glue.lat_write_fp8, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 512 } }, stream, &a); + try cuda_pdl.launch(set.glue.lat_write_fp8, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 512 } }, stream, &a); } /// latent.latent_write: rows of `lat` (stride `lat_stride`) into slots pos .. pos + rows - 1 (pos an i32 on device). pub fn latentWrite(set: glue.Set, stream: cuda.Stream, lat: u64, lat_stride: usize, cache: u64, t: Table, pos: u64, rows: usize, lw: usize) !void { var a: cuda.Args = .{}; inline for (.{ lat, @as(i64, @intCast(lat_stride)), cache, pos, @as(i64, @intCast(lw)), t.pt, @as(i64, @intCast(t.ps)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.lat_write, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.lat_write, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 128 } }, stream, &a); } /// The chunk partials of one attention call: po fp32 [nch][rows][heads][lw], pm and pl fp32 [nch][rows][heads]. @@ -105,7 +106,7 @@ fn chunks(set: glue.Set, stream: cuda.Stream, qa: u64, cache: u64, scales: u64, a.add(@as(i64, @intCast(t.ps))); } const shared = if (hb == heads_tile_wide) glue.chunksSmem(heads_tile_wide) else glue.chunksSmem(heads_tile); - try cuda.launch.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(heads, hb), .z = @intCast(nch) }, .block = .{ .x = 256 }, .shared = shared }, stream, &a); + try cuda_pdl.launch(f, .{ .grid = .{ .x = @intCast(rows), .y = cdiv(heads, hb), .z = @intCast(nch) }, .block = .{ .x = 256 }, .shared = shared }, stream, &a); } /// latent.sparse_attention: rows with counts > 0 over their selected tokens (i32 [rows][w]); others left alone. @@ -123,7 +124,7 @@ fn merge(set: glue.Set, stream: cuda.Stream, p: Partials, out: u64, counts: u64, if (lw != 512) return error.LatentShape; var a: cuda.Args = .{}; inline for (.{ p.po, p.pm, p.pl, out, counts, @as(i64, @intCast(rows)), @as(i64, @intCast(heads)), @as(c_int, @intCast(nch)), @as(c_int, @intFromBool(sparse)) }) |v| a.add(v); - try cuda.launch.launch(set.glue.merge, .{ .grid = .{ .x = @intCast(rows), .y = @intCast(heads) }, .block = .{ .x = 128 } }, stream, &a); + try cuda_pdl.launch(set.glue.merge, .{ .grid = .{ .x = @intCast(rows), .y = @intCast(heads) }, .block = .{ .x = 128 } }, stream, &a); } test "latent.py's tiling rules" { diff --git a/zig/src/families/glm/cuda_mlp.zig b/zig/src/families/glm/cuda_mlp.zig index 68a94468fec..7b04c02a847 100644 --- a/zig/src/families/glm/cuda_mlp.zig +++ b/zig/src/families/glm/cuda_mlp.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const b16 = @import("cuda_b16.zig"); const projection = @import("cuda_proj.zig"); @@ -71,7 +72,7 @@ pub fn body(k: Kernels, stream: cuda.Stream, l: Layer, s: Scratch, x: u64, x_str a.add(@as(c_longlong, @intCast(2 * w * 2))); a.add(@as(c_int, @intCast(rows))); a.add(@as(c_int, @intCast(w * 2))); - try cuda.launch.launch(k.copy_rows, .{ .grid = .{ .x = @intCast((rows * w * 2 + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(k.copy_rows, .{ .grid = .{ .x = @intCast((rows * w * 2 + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); } try glue.swiglu(k.set, stream, s.gu, s.act, s.xs_act, l.limit, rows, w); } diff --git a/zig/src/families/glm/cuda_mm.zig b/zig/src/families/glm/cuda_mm.zig index 5bcd0348b36..d1f8dfe117a 100644 --- a/zig/src/families/glm/cuda_mm.zig +++ b/zig/src/families/glm/cuda_mm.zig @@ -1,6 +1,7 @@ //! GLM's bf16 linears on tensor cores (glm_mm): weights tiled once at load, any row count, row-stable K slices. const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); /// A linear's tiles: bf16 pairs (glm_mm_tile16), or `bits`-bit codes (glm_mm_tile4/6/8) with fp16 scales at `s`. pub const Tiled = struct { w: u64, n: usize, k: usize, s: u64 = 0, bits: u8 = 16 }; @@ -61,7 +62,7 @@ pub const Kernels = struct { k.tile_packed[wi] = try m.function(std.fmt.comptimePrint("glm_mm_tile{d}", .{b})); } try k.prompt.allowDynamicShared(smem(128)); - k.pdl = try @import("sys").environment.value(bool, "TF_GLM_PDL", @import("profile").lookup("TF_GLM_PDL"), true); + k.pdl = cuda_pdl.on(); return k; } }; @@ -137,7 +138,7 @@ pub fn matmul(k: *const Kernels, s: cuda.Stream, x: u64, ldx: usize, w: Tiled, o r.add(@as(c_longlong, @intCast(total))); r.add(@as(c_int, @intCast(sk))); r.add(@as(c_int, @intFromBool(wide))); - try cuda.launch.launch(k.reduce, .{ .grid = .{ .x = @intCast((total + 255) / 256) }, .block = .{ .x = 256 } }, s, &r); + try cuda.launch.launch(k.reduce, .{ .grid = .{ .x = @intCast((total + 255) / 256) }, .block = .{ .x = 256 }, .pdl = k.pdl }, s, &r); } done += rows; } @@ -155,7 +156,7 @@ pub fn tilePacked(k: *const Kernels, s: cuda.Stream, bits: u8, src: u64, ss: u64 a.add(ds); a.add(@as(c_int, @intCast(n))); a.add(@as(c_int, @intCast(kk))); - try cuda.launch.launch(k.tile_packed[wi - 1], .{ .grid = .{ .x = @intCast((chunks + 255) / 256) }, .block = .{ .x = 256 } }, s, &a); + try cuda.launch.launch(k.tile_packed[wi - 1], .{ .grid = .{ .x = @intCast((chunks + 255) / 256) }, .block = .{ .x = 256 }, .pdl = k.pdl }, s, &a); } /// A row-major bf16 [n][k] linear at `src` tiled into `dst` (as many bytes). @@ -166,7 +167,7 @@ pub fn tile(k: *const Kernels, s: cuda.Stream, src: u64, dst: u64, n: usize, kk: a.add(dst); a.add(@as(c_int, @intCast(n))); a.add(@as(c_int, @intCast(kk))); - try cuda.launch.launch(k.tile, .{ .grid = .{ .x = @intCast((chunks + 255) / 256) }, .block = .{ .x = 256 } }, s, &a); + try cuda.launch.launch(k.tile, .{ .grid = .{ .x = @intCast((chunks + 255) / 256) }, .block = .{ .x = 256 }, .pdl = k.pdl }, s, &a); } test "K slices as the shapes take them" { diff --git a/zig/src/families/glm/cuda_moe.zig b/zig/src/families/glm/cuda_moe.zig index 1f21c38811a..edde69f93dc 100644 --- a/zig/src/families/glm/cuda_moe.zig +++ b/zig/src/families/glm/cuda_moe.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const experts = @import("cuda_experts.zig"); const exl3 = @import("cuda_exl3.zig"); @@ -85,6 +86,6 @@ pub fn fill(k: Kernels, stream: cuda.Stream, l: Layer, s: Scratch, x: u64, x_str a.add(s.sy + lo * d * 4); a.add(s.ey + lo * slots * d * eb); for ([_]usize{ n, d, slots, l.top_k, @intFromBool(bf16_slots) }) |v| a.add(@as(c_int, @intCast(v))); - try cuda.launch.launch(k.put_slot, .{ .grid = .{ .x = @intCast((n * d + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(k.put_slot, .{ .grid = .{ .x = @intCast((n * d + 255) / 256) }, .block = .{ .x = 256 } }, stream, &a); try glue.combine(k.set, stream, s.ey + lo * slots * d * eb, !bf16_slots, s.wts + lo * slots * 4, out, n, d, slots); } diff --git a/zig/src/families/glm/cuda_mtp_load_test.zig b/zig/src/families/glm/cuda_mtp_load_test.zig index f1e187a6271..5e707150b7d 100644 --- a/zig/src/families/glm/cuda_mtp_load_test.zig +++ b/zig/src/families/glm/cuda_mtp_load_test.zig @@ -52,6 +52,8 @@ const Fake = struct { d.api.cuStreamSynchronize = wait; d.api.cuCtxSynchronize = context; d.api.cuLaunchKernel = launch; + d.api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(launch); + d.func_name = null; return d; } }; diff --git a/zig/src/families/glm/cuda_pdl.zig b/zig/src/families/glm/cuda_pdl.zig new file mode 100644 index 00000000000..167bc475c83 --- /dev/null +++ b/zig/src/families/glm/cuda_pdl.zig @@ -0,0 +1,43 @@ +//! GLM's launches as dependent launches (TF_GLM_PDL, default on): every GLM kernel opens with glm_pdl::enter(). +const std = @import("std"); +const cuda = @import("cuda"); + +var state: std.atomic.Value(u8) = .init(0); // 0 unread, 1 off, 2 on + +/// TF_GLM_PDL, read once: exact 0 launches GLM's kernels plain (the environment refuses malformed values at startup). +pub fn on() bool { + const v = state.load(.monotonic); + if (v != 0) return v == 2; + const want = @import("sys").environment.value(bool, "TF_GLM_PDL", @import("profile").lookup("TF_GLM_PDL"), true) catch true; + state.store(if (want) 2 else 1, .monotonic); + return want; +} + +/// `cfg` as a GLM launch makes it: dependent when `pdl`. +pub fn config(cfg: cuda.launch.Config, pdl: bool) cuda.launch.Config { + var c = cfg; + c.pdl = pdl; + return c; +} + +/// Launches a GLM image's kernel (test-glm-pdl-scan: each one opens with its wait), dependent under TF_GLM_PDL. +pub fn launch(f: cuda.Function, cfg: cuda.launch.Config, s: cuda.Stream, a: *cuda.Args) !void { + return cuda.launch.launch(f, config(cfg, on()), s, a); +} + +/// Test drivers: a cuLaunchKernelEx handing each launch, its attributes dropped, to a recording cuLaunchKernel. +pub fn forwardEx(comptime plain: @FieldType(cuda.abi.Api, "cuLaunchKernel")) @FieldType(cuda.abi.Api, "cuLaunchKernelEx") { + const P = ?[*]?*anyopaque; + return &struct { + fn ex(c: *const cuda.abi.LaunchConfig, f: cuda.abi.Function, p: P, e: P) callconv(.c) cuda.abi.Result { + return plain(f, c.grid_x, c.grid_y, c.grid_z, c.block_x, c.block_y, c.block_z, c.shared_bytes, c.stream, p, e); + } + }.ex; +} + +test "a GLM launch keeps its config and sets only pdl" { + const base: cuda.launch.Config = .{ .grid = .{ .x = 7, .y = 2 }, .block = .{ .x = 128 }, .shared = 4096 }; + const c = config(base, true); + try std.testing.expect(c.pdl and c.grid.x == 7 and c.grid.y == 2 and c.block.x == 128 and c.shared == 4096); + try std.testing.expect(!config(c, false).pdl); +} diff --git a/zig/src/families/glm/cuda_proj.zig b/zig/src/families/glm/cuda_proj.zig index b6117f8762d..7c16322e318 100644 --- a/zig/src/families/glm/cuda_proj.zig +++ b/zig/src/families/glm/cuda_proj.zig @@ -38,6 +38,7 @@ test "a block-FP8 projection is refused before any launch when the call's shape try std.testing.expectError(error.FormatNotLoaded, matmul(set, s, .{ .fp8g = q }, 0, 4096, 0, 0, 1, 64, 4096, true)); var lane: cuda.qmmf.Lane = undefined; lane.clusters = false; // a GPU before sm_90: 64 outputs from 4,096 inputs take K slices summed in memory + lane.pdl = false; set.linear = .{ .lane = &lane }; try std.testing.expectError(error.SlicePartialsNotHeld, matmul(set, s, .{ .fp8g = q }, 0, 4096, 0, 0, 1, 64, 4096, true)); try std.testing.expectError(error.SlicePartialsNotHeld, matmul(set, s, .{ .mxfp8 = cuda.mxfp8.weight(0, 0, 64, 4096) }, 0, 4096, 0, 0, 1, 64, 4096, true)); @@ -46,8 +47,10 @@ test "a block-FP8 projection is refused before any launch when the call's shape test "the loader's check refuses an FP8 projection exactly when matmul would at some row count" { var flat: cuda.qmmf.Lane = undefined; flat.clusters = false; // a GPU before sm_90 + flat.pdl = false; var gb10: cuda.qmmf.Lane = undefined; gb10.clusters = true; + gb10.pdl = false; // FP4-Local's stored kda q, kv_a and MLA o, a 64-output cut, an lm_head share, and inputs too few for K slices const shapes = [_][2]usize{ .{ 8192, 4096 }, .{ 512, 4096 }, .{ 4096, 16384 }, .{ 64, 4096 }, .{ 77440, 4096 }, .{ 64, 512 } }; for (shapes) |nk| for ([_]*const cuda.qmmf.Lane{ &flat, &gb10 }) |lane| { diff --git a/zig/src/families/glm/cuda_quant.zig b/zig/src/families/glm/cuda_quant.zig index 08fb0c9d371..e501ad03844 100644 --- a/zig/src/families/glm/cuda_quant.zig +++ b/zig/src/families/glm/cuda_quant.zig @@ -1,6 +1,7 @@ //! GLM-5.3-Flash's draft-only weight quantizers on CUDA (glm_quant.cu): the Python family's load-time ops, same bits. const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); /// glm_quant.cu's entries. pub const Kernels = struct { @@ -30,7 +31,7 @@ pub fn nvfp4(ks: *const Kernels, stream: cuda.Stream, w: u64, e: usize, n: usize a.add(w); a.add(@as(c_longlong, @intCast(per))); a.add(g); - try cuda.launch.launch(ks.amax, .{ .grid = .{ .x = @intCast(e) }, .block = .{ .x = 1024 } }, stream, &a); + try cuda_pdl.launch(ks.amax, .{ .grid = .{ .x = @intCast(e) }, .block = .{ .x = 1024 } }, stream, &a); const total = e * per / 16; var b: cuda.Args = .{}; b.add(w); @@ -39,7 +40,7 @@ pub fn nvfp4(ks: *const Kernels, stream: cuda.Stream, w: u64, e: usize, n: usize b.add(@as(c_longlong, @intCast(total))); b.add(codes); b.add(scales); - try cuda.launch.launch(ks.nvfp4, .{ .grid = .{ .x = blocks(total) }, .block = .{ .x = 256 } }, stream, &b); + try cuda_pdl.launch(ks.nvfp4, .{ .grid = .{ .x = blocks(total) }, .block = .{ .x = 256 } }, stream, &b); } /// qmm.quantize4: w bf16 [n][k] -> MLX words i32 [n][k/8], scales and biases bf16 [n][k/64]; 16-byte aligned. @@ -53,5 +54,5 @@ pub fn q4(ks: *const Kernels, stream: cuda.Stream, w: u64, n: usize, k: usize, w a.add(words); a.add(scales); a.add(biases); - try cuda.launch.launch(ks.q4, .{ .grid = .{ .x = blocks(groups) }, .block = .{ .x = 256 } }, stream, &a); + try cuda_pdl.launch(ks.q4, .{ .grid = .{ .x = blocks(groups) }, .block = .{ .x = 256 } }, stream, &a); } diff --git a/zig/src/families/glm/cuda_sampler.zig b/zig/src/families/glm/cuda_sampler.zig index c3bfacdbaac..3e34a2e0bd5 100644 --- a/zig/src/families/glm/cuda_sampler.zig +++ b/zig/src/families/glm/cuda_sampler.zig @@ -14,12 +14,11 @@ pub fn check(s: ?Sampling) ?Sampling { return if (x.temperature > 0) x else null; } -/// sample.cu's Rule: the seed, 1 / T, top_p, the candidates' near window, ln(min_p) and top_k (0: off). -pub const Rule = extern struct { seed: u64, inv_t: f32, top_p: f32, near: f32, min_log: f32, top_k: u32, pad: u32 = 0 }; +pub const Rule = cuda.sample.Rule; -/// The rule as nemotron/cuda_sampler.zig fills it. +/// The rule sample.cu reads for `s` (cuda.sample.rule over lanes.gpu_rule). pub fn rule(s: Sampling) Rule { - return .{ .seed = s.seed, .inv_t = @floatCast(1.0 / @max(s.temperature, 1e-6)), .top_p = @floatCast(s.top_p), .near = 20.0, .min_log = @floatCast(s.minLog()), .top_k = s.top_k }; + return cuda.sample.rule(s); } /// A rank's logits rows: bf16 [rows][its vocabulary span]. @@ -160,6 +159,31 @@ test "rules as nemotron/cuda_sampler fills them; temperature 0 is greedy" { try std.testing.expectEqual(@as(?Sampling, null), check(.{ .seed = 0, .temperature = 0 })); } +test "GLM sampler rule: the hand-built rule it replaced, byte for byte; check is ruleFor's gate" { + const Hand = extern struct { seed: u64, inv_t: f32, top_p: f32, near: f32, min_log: f32, top_k: u32, pad: u32 = 0 }; + const inf = std.math.inf(f64); + const seeds = [_]u64{ 0, 1234, 1 << 63 | 5, std.math.maxInt(u64) }; + const temps = [_]f64{ -1, 0, 1e-9, 1e-6, 0.5, 0.7, 1, 2, inf }; + const ks = [_]u32{ 0, 1, 20, 1024, 1025 }; + const ps = [_]f64{ 0, 0.5, 0.95, 1, 1.5 }; + const mins = [_]f64{ -1, 0, 1e-12, 0.05, 1 }; + var sampled: usize = 0; + for (seeds) |seed| for (temps) |t| for (ks) |k| for (ps) |p| for (mins) |m| { + const s: Sampling = .{ .seed = seed, .temperature = t, .top_k = k, .top_p = p, .min_p = m }; + const h: Hand = .{ .seed = s.seed, .inv_t = @floatCast(1.0 / @max(s.temperature, 1e-6)), .top_p = @floatCast(s.top_p), .near = 20.0, .min_log = @floatCast(s.minLog()), .top_k = s.top_k }; + const r = rule(s); + try std.testing.expectEqualSlices(u8, std.mem.asBytes(&h), std.mem.asBytes(&r)); + const via = cuda.sample.ruleFor(@as(?Sampling, s)); + try std.testing.expectEqual(check(s) == null, via == null); + if (via) |v| { + try std.testing.expectEqualSlices(u8, std.mem.asBytes(&h), std.mem.asBytes(&v)); + sampled += 1; + } + }; + try std.testing.expectEqual(@as(usize, 4 * 7 * 5 * 5 * 5), sampled); + try std.testing.expect(cuda.sample.ruleFor(@as(?Sampling, null)) == null); +} + /// Each rank's columns as one block from that rank (spans may differ in width: TP=3), in one group: world broadcasts. const Spread = struct { lib: *const cuda.nccl.Library, diff --git a/zig/src/families/glm/cuda_sparse.zig b/zig/src/families/glm/cuda_sparse.zig index 218f53670a3..ec2555e4866 100644 --- a/zig/src/families/glm/cuda_sparse.zig +++ b/zig/src/families/glm/cuda_sparse.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const latent = @import("cuda_latent.zig"); @@ -66,21 +67,21 @@ pub fn decodeSelect( if (g > 0) { var sa: cuda.Args = .{}; inline for (.{ scores, @as(i64, @intCast(np)), at, @as(c_int, topk_pools), @as(c_int, dsel_target), bits, @as(i64, @intCast(words)) }) |v| sa.add(v); - try cuda.launch.launch(set.glue.dsel_scan, .{ .grid = .{ .x = @intCast(g), .y = @intCast(rows) }, .block = .{ .x = dsel_scan_threads } }, stream, &sa); + try cuda_pdl.launch(set.glue.dsel_scan, .{ .grid = .{ .x = @intCast(g), .y = @intCast(rows) }, .block = .{ .x = dsel_scan_threads } }, stream, &sa); } var ma: cuda.Args = .{}; inline for (.{ scores, pools, @as(i64, @intCast(np)), at, @as(c_int, topk_pools), bits, @as(i64, @intCast(words)), path }) |v| ma.add(v); - try cuda.launch.launch(set.glue.dsel_merge, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = dsel_merge_threads } }, stream, &ma); + try cuda_pdl.launch(set.glue.dsel_merge, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = dsel_merge_threads } }, stream, &ma); } /// sparse.index_update: the window's LayerNormed index keys and gates into ik and ig at pos, completed pools into pk. pub fn indexUpdate(set: glue.Set, stream: cuda.Stream, k_raw: u64, k_stride: usize, gate: u64, ln_w: u64, ln_b: u64, ape: u64, ik: u64, ig: u64, pk: u64, t: latent.Table, pos: u64, rows: usize) !void { var a: cuda.Args = .{}; inline for (.{ k_raw, @as(i64, @intCast(k_stride)), gate, ln_w, ln_b, ik, ig, pos, @as(f32, 1e-6) }) |v| a.add(v); - try cuda.launch.launch(set.glue.index_write, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 32 } }, stream, &a); + try cuda_pdl.launch(set.glue.index_write, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 32 } }, stream, &a); var b: cuda.Args = .{}; inline for (.{ ik, ig, ape, pk, pos, @as(i64, @intCast(rows)), t.pt, @as(i64, @intCast(t.ps)) }) |v| b.add(v); - try cuda.launch.launch(set.glue.pool_keys, .{ .grid = .{ .x = @intCast(rows / 4 + 2) }, .block = .{ .x = 32 } }, stream, &b); + try cuda_pdl.launch(set.glue.pool_keys, .{ .grid = .{ .x = @intCast(rows / 4 + 2) }, .block = .{ .x = 32 } }, stream, &b); } /// sparse.pool_bucket: visible pools for rows pos .. pos + rows - 1, a power of two (at least 1024), at most `np_max`. @@ -143,7 +144,7 @@ pub fn selectTokensProfile(set: glue.Set, ops: cuda.Module, stream: cuda.Stream, args.add(pos); args.add(@as(c_int, @intCast(a))); args.add(s.at); - try cuda.launch.launch(add, .{ .grid = .{}, .block = .{ .x = 32 } }, stream, &args); + try cuda_pdl.launch(add, .{ .grid = .{}, .block = .{ .x = 32 } }, stream, &args); at = s.at; } const nb = cdiv(scoreColumns(host_pos + a, n, np_max), 64); @@ -153,7 +154,7 @@ pub fn selectTokensProfile(set: glue.Set, ops: cuda.Module, stream: cuda.Stream, if (d != 128 or heads > 32) return error.IndexShape; const quick = if (set.index) |k| if (k.takes(rows, np_max, pk, t.ps)) k else null else null; var stamp = prof.span(profile, stream, .index_score); - if (quick) |k| try k.scores(stream, qi + a * heads * d * 2, wts + a * w_stride * 2, w_stride, pk, s.scores, at, n, np_max, nb, scale, headScale(heads), heads, t.pt, t.ps) else try cuda.launch.launch(set.glue.scores, .{ .grid = .{ .x = @intCast(n), .y = @intCast(cdiv(nb, loop)) }, .block = .{ .x = 128 } }, stream, &sa); + if (quick) |k| try k.scores(stream, qi + a * heads * d * 2, wts + a * w_stride * 2, w_stride, pk, s.scores, at, n, np_max, nb, scale, headScale(heads), heads, t.pt, t.ps) else try cuda_pdl.launch(set.glue.scores, .{ .grid = .{ .x = @intCast(n), .y = @intCast(cdiv(nb, loop)) }, .block = .{ .x = 128 } }, stream, &sa); stamp.end(); stamp = prof.span(profile, stream, .index_select); if (quick) |k| if (k.select) { @@ -169,7 +170,7 @@ pub fn selectTokensProfile(set: glue.Set, ops: cuda.Module, stream: cuda.Stream, } var sel: cuda.Args = .{}; inline for (.{ s.scores, s.pools + a * topk_pools * 8, @as(i64, @intCast(np_max)), at, @as(c_int, topk_pools) }) |v| sel.add(v); - try cuda.launch.launch(if (wide) set.glue.select_rows_wide else set.glue.select_rows, .{ .grid = .{ .x = @intCast(n) }, .block = .{ .x = if (wide) 1024 else 128 } }, stream, &sel); + try cuda_pdl.launch(if (wide) set.glue.select_rows_wide else set.glue.select_rows, .{ .grid = .{ .x = @intCast(n) }, .block = .{ .x = if (wide) 1024 else 128 } }, stream, &sel); stamp.end(); } const stamp = prof.span(profile, stream, .index_select); @@ -187,7 +188,7 @@ pub fn selectTokensProfile(set: glue.Set, ops: cuda.Module, stream: cuda.Stream, args.add(counts); args.add(t.pt); args.add(@as(i64, @intCast(t.page_rows))); - try cuda.launch.launch(assemble, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &args); + try cuda_pdl.launch(assemble, .{ .grid = .{ .x = @intCast(rows) }, .block = .{ .x = 256 } }, stream, &args); } test "sparse.py's sizing rules" { diff --git a/zig/src/families/glm/cuda_structured.zig b/zig/src/families/glm/cuda_structured.zig index 217cca19bd1..5742ff2ad64 100644 --- a/zig/src/families/glm/cuda_structured.zig +++ b/zig/src/families/glm/cuda_structured.zig @@ -1,5 +1,6 @@ //! Whole-vocabulary grammar draws and prompt redraws. const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const std = @import("std"); const sampler = @import("cuda_sampler.zig"); const projection = @import("cuda_proj.zig"); @@ -24,7 +25,7 @@ pub fn drawWhole(e: anytype, logits: u64, rows: usize, first: u64, bits: u64, ou a.add(@as(i64, @intCast(e.c.vocab))); a.add(@as(u32, 0)); a.add(e.pairs.ptr); - try cuda.launch.launch(e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); + try cuda_pdl.launch(e.m.glue.top1, .{ .grid = .{ .x = 1 }, .block = .{ .x = 1024 } }, e.stream, &a); var pick: [2]u32 = undefined; try e.stream.synchronize(); try e.checkGathers(); diff --git a/zig/src/families/glm/cuda_taps.zig b/zig/src/families/glm/cuda_taps.zig index 01d0f4ad13e..07b736b970b 100644 --- a/zig/src/families/glm/cuda_taps.zig +++ b/zig/src/families/glm/cuda_taps.zig @@ -1,5 +1,6 @@ //! DFlash2's taps on the target's forward: after each tapped layer, its rows' 4-stream mean into one tap slot. const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); /// The target layers DFlash2 reads (incoai/GLM-5.3-Flash-DFlash2's target_layer_ids), in tap-slot order. pub const layers = [_]usize{ 5, 14, 24, 33, 42 }; @@ -27,6 +28,6 @@ pub const Taps = struct { a.add(t.out + lo * layers.len * hidden * 2); a.add(k); a.add(@as(i32, 0)); // the mean of the 4 streams (df_tap's mode 0) - try cuda.launch.launch(t.f, .{ .grid = .{ .x = @intCast(n), .y = hidden / 1024 }, .block = .{ .x = 256 } }, s, &a); + try cuda_pdl.launch(t.f, .{ .grid = .{ .x = @intCast(n), .y = hidden / 1024 }, .block = .{ .x = 256 } }, s, &a); } }; diff --git a/zig/src/families/glm/cuda_taps_tp_test.zig b/zig/src/families/glm/cuda_taps_tp_test.zig index 1e3b16b680c..866ba78145b 100644 --- a/zig/src/families/glm/cuda_taps_tp_test.zig +++ b/zig/src/families/glm/cuda_taps_tp_test.zig @@ -80,6 +80,7 @@ fn driver() cuda.Driver { var api: cuda.abi.Api = undefined; api.cuMemcpyDtoDAsync_v2 = memcpy; api.cuLaunchKernel = launchTap; + api.cuLaunchKernelEx = @import("cuda_pdl.zig").forwardEx(launchTap); api.cuGetErrorName = errName; api.cuGetErrorString = errName; return .{ .lib = undefined, .api = api, .func_name = null }; diff --git a/zig/src/families/glm/cuda_vision.zig b/zig/src/families/glm/cuda_vision.zig index 7481a94d997..75bc5129782 100644 --- a/zig/src/families/glm/cuda_vision.zig +++ b/zig/src/families/glm/cuda_vision.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const core = @import("core"); const formats = @import("cuda_formats.zig"); const projection = @import("cuda_proj.zig"); @@ -120,7 +121,7 @@ pub const Funcs = struct { }; fn launch(r: *const Run, f: cuda.Function, grid: cuda.Dim3, threads: u32, a: *cuda.Args) !void { - try cuda.launch.launch(f, .{ .grid = grid, .block = .{ .x = threads } }, r.stream, a); + try cuda_pdl.launch(f, .{ .grid = grid, .block = .{ .x = threads } }, r.stream, a); } pub const Tower = struct { @@ -574,8 +575,7 @@ test "vision quantized projections reject either mismatched axis before a launch var d: cuda.Driver = undefined; d.api.cuLaunchKernel = Fake.launch; const f: cuda.Function = .{ .d = &d, .handle = null }; - var lane: cuda.qmmf.Lane = undefined; - lane.clusters = true; + var lane: cuda.qmmf.Lane = .{ .mod = undefined, .fns = undefined, .f32_fns = undefined, .reduce = undefined, .half = undefined, .clusters = true }; for (&lane.f32_fns) |*set| for (set) |*function| { function.* = f; }; @@ -588,8 +588,7 @@ test "vision quantized projections reject either mismatched axis before a launch } test "vision MXFP8 refuses a lane requiring unowned slice partials before upload" { - var lane: cuda.qmmf.Lane = undefined; - lane.clusters = false; + var lane: cuda.qmmf.Lane = .{ .mod = undefined, .fns = undefined, .f32_fns = undefined, .reduce = undefined, .half = undefined, .clusters = false }; const p: Plan = .{ .module = "model.visual.blocks.0.attn.qkv", .format = .mxfp8, .n = 3072, .k = 1024, .codes = 0, .scales = 0 }; try std.testing.expectError(error.SlicePartialsNotHeld, fits(.{ .lane = &lane }, p)); lane.clusters = true; diff --git a/zig/src/families/glm/dflash_block.zig b/zig/src/families/glm/dflash_block.zig index acd261ef412..db958a3303e 100644 --- a/zig/src/families/glm/dflash_block.zig +++ b/zig/src/families/glm/dflash_block.zig @@ -1,6 +1,7 @@ //! DFlash2's device passes: the context ingest (taps through fc into the rings) and the block (embed to candidates). const std = @import("std"); const cuda = @import("cuda"); +const cuda_pdl = @import("cuda_pdl.zig"); const glue = @import("cuda_glue.zig"); const mm = @import("cuda_mm.zig"); const q4 = @import("cuda_q4.zig"); @@ -10,7 +11,7 @@ const D = df.D; const BLOCK = df.BLOCK; fn go(f: cuda.Function, grid: cuda.Dim3, threads: u32, e: anytype, a: *cuda.Args) !void { - try cuda.launch.launch(f, .{ .grid = grid, .block = .{ .x = threads } }, e.stream, a); + try cuda_pdl.launch(f, .{ .grid = grid, .block = .{ .x = threads } }, e.stream, a); } fn set(e: anytype) glue.Set { diff --git a/zig/src/families/gpt_oss/README.md b/zig/src/families/gpt_oss/README.md new file mode 100644 index 00000000000..e833a486427 --- /dev/null +++ b/zig/src/families/gpt_oss/README.md @@ -0,0 +1,32 @@ +# gpt-oss host package + +This package reads config and tensor metadata for `openai/gpt-oss-20b` revision +`6cee5e81ee83917806bbde320786a8fb61efebee` (Apache-2.0). Its fixtures preserve all +459 supplied tensor names, dtypes, shapes and byte offsets; `fixtures/SOURCE.json` +records the original and whitespace-normalized header digests. + +`config` retains explicit `layer_types` and YaRN fields. `names` checks complete +coverage and the mixed BF16/U8 projection geometry. `core/mxfp4.zig` reads standard +32-value E2M1/UE8M0 blocks without expanding a checkpoint or changing its bytes. +Nibble order is a required argument because shapes alone cannot establish it. + +`attention` supplies FP64 causal/sliding attention primitives under a documented +denominator-only sink and current-token-inclusive window convention. Its inputs +are already rotated query/key rows; YaRN is metadata only. `route.select` chooses +the configured count from router logits with a documented low-ID tie convention; +`softmaxSelected` is a separate explicit reference operation, not an inferred +checkpoint normalization policy. These conventions still need model-specific +confirmation before an execution path is added. The gate/up row order and exact +clamped activation formula also remain unresolved by the supplied files. + +Harmony parsing is the existing server `reply_text.parseHarmony` function, shared +by alias. No second splitter, tokenizer rewrite, GPU code, CPU generation fallback, +native registration, scheduler or serving capability is included. + +```sh +zig build -Dfixed-cpu test-gpt-oss-host test-gpt-oss-fast +``` + +The tests cover real headers, named refusals, analytic sink/window/routing cases, +all finite MXFP4 code/scale values against independent FP64 arithmetic and explicit +wrong-order input. They do not establish checkpoint output tokens or device speed. diff --git a/zig/src/families/gpt_oss/arithmetic_test.zig b/zig/src/families/gpt_oss/arithmetic_test.zig new file mode 100644 index 00000000000..81d0129d69b --- /dev/null +++ b/zig/src/families/gpt_oss/arithmetic_test.zig @@ -0,0 +1,77 @@ +//! Analytic host cases for sinks, window edges and four-expert selection; no full-model reference claim. +const std = @import("std"); +const attention = @import("attention.zig"); +const route = @import("route.zig"); +const t = std.testing; + +test "gpt-oss sink has probability mass but contributes no value" { + var out: [1]f64 = undefined; + try attention.combine(&.{0}, &.{8}, 1, 0, &out); + try t.expectEqual(@as(f64, 4), out[0]); + try attention.combine(&.{ 0, 0 }, &.{ 3, 9 }, 1, 0, &out); + try t.expectEqual(@as(f64, 4), out[0]); + try attention.combine(&.{1000}, &.{8}, 1, 1000, &out); + try t.expectEqual(@as(f64, 4), out[0]); + try attention.combine(&.{}, &.{}, 1, 0, &out); + try t.expectEqual(@as(f64, 0), out[0]); + try t.expectError(error.NonfiniteAttention, attention.combine(&.{std.math.nan(f64)}, &.{1}, 1, 0, &out)); +} + +test "gpt-oss FP64 attention reference scales QK and includes the sink without reading future keys" { + const c = try @import("config_test.zig").load(); + var q: [64]f64 = @splat(0); + q[0] = 8; + var keys: [128]f64 = @splat(std.math.nan(f64)); + @memset(keys[0..64], 0); + keys[0] = 1; + var values: [128]f64 = @splat(std.math.nan(f64)); + @memset(values[0..64], 4); + var out: [64]f64 = undefined; + try attention.reference(t.allocator, &c, 0, 0, &q, &keys, &values, 0, &out); + for (out) |v| try t.expectApproxEqAbs(@as(f64, 2.9242343145200196), v, 1e-14); +} + +test "gpt-oss full and sliding attention use layer_types with explicit inclusive window bounds" { + const c = try @import("config_test.zig").load(); + const slide = try attention.bounds(&c, 0, 128); + try t.expectEqual(@as(usize, 1), slide.begin); + try t.expectEqual(@as(usize, 129), slide.end); + const full = try attention.bounds(&c, 1, 128); + try t.expectEqual(@as(usize, 0), full.begin); + try t.expectEqual(@as(usize, 129), full.end); + try t.expectEqual(@as(usize, 0), (try attention.bounds(&c, 0, 127)).begin); + try t.expectError(error.BadPosition, attention.bounds(&c, 0, c.context)); +} + +test "gpt-oss masked keys are omitted before logits and values are read" { + const c = try @import("config_test.zig").load(); + var logits: [130]f64 = @splat(0); + var values: [130]f64 = @splat(4); + logits[0] = std.math.nan(f64); + values[0] = std.math.nan(f64); + logits[129] = std.math.nan(f64); + values[129] = std.math.inf(f64); + var out: [1]f64 = undefined; + try attention.row(&c, 0, 128, &logits, &values, 1, -std.math.inf(f64), &out); + try t.expectEqual(@as(f64, 4), out[0]); + try t.expectError(error.NonfiniteAttention, attention.row(&c, 1, 128, &logits, &values, 1, 0, &out)); +} + +test "gpt-oss router selects experts_per_token raw logits with deterministic low-ID ties" { + const c = try @import("config_test.zig").load(); + var logits: [32]f64 = @splat(-100); + logits[7] = 9; + logits[2] = 9; + logits[20] = 8; + logits[31] = 7; + const selected = try route.select(&c, &logits); + try t.expectEqual(@as(usize, 4), selected.len); + try t.expectEqualSlices(u32, &.{ 2, 7, 20, 31 }, selected.ids[0..selected.len]); + try t.expectEqualSlices(f64, &.{ 9, 9, 8, 7 }, selected.logits[0..selected.len]); + var weights: [4]f64 = undefined; + try route.softmaxSelected(&.{ 0, 0, 0, 0 }, &weights); + try t.expectEqualSlices(f64, &.{ 0.25, 0.25, 0.25, 0.25 }, &weights); + logits[0] = std.math.nan(f64); + try t.expectError(error.NonfiniteRouter, route.select(&c, &logits)); + try t.expectError(error.BadRouterShape, route.select(&c, logits[0..31])); +} diff --git a/zig/src/families/gpt_oss/attention.zig b/zig/src/families/gpt_oss/attention.zig new file mode 100644 index 00000000000..6c053a845da --- /dev/null +++ b/zig/src/families/gpt_oss/attention.zig @@ -0,0 +1,58 @@ +//! FP64 host primitives: causal bounds and a learned sink logit with zero value. No GPU execution path. +const std = @import("std"); +const config = @import("config.zig"); +pub const Bounds = struct { begin: usize, end: usize }; + +/// Reference convention: a sliding window includes the current token; end is exclusive. Checkpoint fidelity is open. +pub fn bounds(c: *const config.Config, layer: usize, position: usize) !Bounds { + if (position >= c.context) return error.BadPosition; + const end = position + 1; + return .{ .begin = if (try c.kind(layer) == .sliding) end -| c.window else 0, .end = end }; +} + +/// Explicit denominator-only sink convention; scores are already scaled/rotated, values are [keys,width]. +pub fn combine(scores: []const f64, values: []const f64, width: usize, sink: f64, out: []f64) !void { + const n = std.math.mul(usize, scores.len, width) catch return error.BadAttentionShape; + if (width == 0 or out.len != width or values.len != n) return error.BadAttentionShape; + if (!std.math.isFinite(sink) and sink != -std.math.inf(f64)) return error.NonfiniteAttention; + if (scores.len == 0 and sink == -std.math.inf(f64)) return error.EmptyAttention; + var maximum = sink; + for (scores) |s| { + if (!std.math.isFinite(s)) return error.NonfiniteAttention; + maximum = @max(maximum, s); + } + for (values) |v| if (!std.math.isFinite(v)) return error.NonfiniteAttention; + var denominator: f64 = @exp(sink - maximum); + for (scores) |s| denominator += @exp(s - maximum); + for (out, 0..) |*value, column| { + var sum: f64 = 0; + for (scores, 0..) |s, row_index| sum += @exp(s - maximum) * values[row_index * width + column]; + value.* = sum / denominator; + } +} + +/// Remove future and out-of-window keys before reading their logits or values, including nonfinite masked inputs. +pub fn row(c: *const config.Config, layer: usize, position: usize, scores: []const f64, values: []const f64, width: usize, sink: f64, out: []f64) !void { + const visible = try bounds(c, layer, position); + const n = std.math.mul(usize, scores.len, width) catch return error.BadAttentionShape; + if (visible.end > scores.len or values.len != n) return error.BadAttentionShape; + return combine(scores[visible.begin..visible.end], values[visible.begin * width .. visible.end * width], width, sink, out); +} + +/// One already-rotated query and its selected KV head, using FP64 dots and 1/sqrt(head_dim); no RoPE policy implied. +pub fn reference(a: std.mem.Allocator, c: *const config.Config, layer: usize, position: usize, query: []const f64, keys: []const f64, values: []const f64, sink: f64, out: []f64) !void { + const width = c.head_dim; + if (width == 0 or query.len != width or out.len != width or keys.len % width != 0 or values.len != keys.len) return error.BadAttentionShape; + const visible = try bounds(c, layer, position); + if (visible.end > keys.len / width) return error.BadAttentionShape; + for (query) |v| if (!std.math.isFinite(v)) return error.NonfiniteAttention; + const scores = try a.alloc(f64, visible.end - visible.begin); + defer a.free(scores); + const scale = 1 / @sqrt(@as(f64, @floatFromInt(width))); + for (scores, visible.begin..) |*score, index| { + var sum: f64 = 0; + for (query, keys[index * width ..][0..width]) |q, k| sum += q * k; + score.* = sum * scale; + } + return combine(scores, values[visible.begin * width .. visible.end * width], width, sink, out); +} diff --git a/zig/src/families/gpt_oss/config.zig b/zig/src/families/gpt_oss/config.zig new file mode 100644 index 00000000000..4ae2b063e4a --- /dev/null +++ b/zig/src/families/gpt_oss/config.zig @@ -0,0 +1,204 @@ +//! gpt-oss config admission for host metadata; arithmetic details absent from the checkpoint remain unqualified. +const std = @import("std"); +pub const max_layers = 128; +pub const max_topk = 32; +pub const Kind = enum { sliding, full }; +pub const Why = struct { + buf: [320]u8 = @splat(0), + len: usize = 0, + + pub fn set(w: *Why, key: []const u8) void { + const message = std.fmt.bufPrint(&w.buf, "gpt_oss refuses field {s}", .{key}) catch w.buf[0..]; + w.len = message.len; + } + pub fn text(w: *const Why) []const u8 { + return w.buf[0..w.len]; + } +}; + +pub const Yarn = struct { factor: f64, beta_fast: f64, beta_slow: f64, original: u32, truncate: bool }; +pub const Config = struct { + hidden: u32, + layers: u32, + vocab: u32, + heads: u32, + kv_heads: u32, + head_dim: u32, + intermediate: u32, + experts: u32, + topk: u32, + context: u32, + initial_context: u32, + window: u32, + eps: f64, + rope_theta: f64, + swiglu_limit: f64, + eos: u32, + pad: u32, + yarn: Yarn, + layer: [max_layers]Kind, + + pub fn kind(c: *const Config, i: usize) !Kind { + if (i >= c.layers) return error.BadLayer; + return c.layer[i]; + } + pub fn qWidth(c: *const Config) u32 { + return c.heads * c.head_dim; + } + pub fn kvWidth(c: *const Config) u32 { + return c.kv_heads * c.head_dim; + } +}; + +pub fn bad(why: *Why, key: []const u8) error{BadGptOssConfig} { + why.set(key); + return error.BadGptOssConfig; +} + +pub fn field(o: std.json.ObjectMap, key: []const u8, why: *Why) !std.json.Value { + return o.get(key) orelse return bad(why, key); +} + +pub fn uint(o: std.json.ObjectMap, key: []const u8, why: *Why) !u32 { + const v = try field(o, key, why); + if (v != .integer or v.integer < 0 or v.integer > std.math.maxInt(u32)) return bad(why, key); + return @intCast(v.integer); +} + +fn positive(o: std.json.ObjectMap, key: []const u8, limit: u32, why: *Why) !u32 { + const n = try uint(o, key, why); + if (n == 0 or n > limit) return bad(why, key); + return n; +} + +fn number(o: std.json.ObjectMap, key: []const u8, why: *Why) !f64 { + const v = try field(o, key, why); + const n: f64 = switch (v) { + .integer => |x| @floatFromInt(x), + .float => |x| x, + else => return bad(why, key), + }; + if (!std.math.isFinite(n)) return bad(why, key); + return n; +} + +fn word(o: std.json.ObjectMap, key: []const u8, expected: []const u8, why: *Why) !void { + const v = try field(o, key, why); + if (v != .string or !std.mem.eql(u8, v.string, expected)) return bad(why, key); +} + +fn flag(o: std.json.ObjectMap, key: []const u8, expected: bool, why: *Why) !void { + const v = try field(o, key, why); + if (v != .bool or v.bool != expected) return bad(why, key); +} + +fn quant(o: std.json.ObjectMap, why: *Why) !void { + const v = try field(o, "quantization_config", why); + if (v != .object) return bad(why, "quantization_config"); + word(v.object, "quant_method", "mxfp4", why) catch return bad(why, "quantization_config.quant_method"); + if (v.object.count() != 2) return bad(why, "quantization_config"); + const list = v.object.get("modules_to_not_convert") orelse return bad(why, "quantization_config.modules_to_not_convert"); + const expected = [_][]const u8{ "model.layers.*.self_attn", "model.layers.*.mlp.router", "model.embed_tokens", "lm_head" }; + if (list != .array or list.array.items.len != expected.len) return bad(why, "quantization_config.modules_to_not_convert"); + var seen: [4]bool = @splat(false); + for (list.array.items) |entry| { + if (entry != .string) return bad(why, "quantization_config.modules_to_not_convert"); + for (expected, 0..) |name, i| { + if (std.mem.eql(u8, name, entry.string) and !seen[i]) { + seen[i] = true; + break; + } + } else return bad(why, "quantization_config.modules_to_not_convert"); + } +} + +fn rope(o: std.json.ObjectMap, initial: u32, why: *Why) !Yarn { + const v = try field(o, "rope_scaling", why); + if (v != .object) return bad(why, "rope_scaling"); + const p = v.object; + word(p, "rope_type", "yarn", why) catch return bad(why, "rope_scaling.rope_type"); + flag(p, "truncate", false, why) catch return bad(why, "rope_scaling.truncate"); + const y: Yarn = .{ + .factor = number(p, "factor", why) catch return bad(why, "rope_scaling.factor"), + .beta_fast = number(p, "beta_fast", why) catch return bad(why, "rope_scaling.beta_fast"), + .beta_slow = number(p, "beta_slow", why) catch return bad(why, "rope_scaling.beta_slow"), + .original = uint(p, "original_max_position_embeddings", why) catch return bad(why, "rope_scaling.original_max_position_embeddings"), + .truncate = false, + }; + if (p.count() != 6) return bad(why, "rope_scaling"); + if (y.factor < 1) return bad(why, "rope_scaling.factor"); + if (y.beta_fast <= 0) return bad(why, "rope_scaling.beta_fast"); + if (y.beta_slow <= 0 or y.beta_slow >= y.beta_fast) return bad(why, "rope_scaling.beta_slow"); + if (y.original != initial) return bad(why, "rope_scaling.original_max_position_embeddings"); + return y; +} + +pub fn parse(a: std.mem.Allocator, bytes: []const u8, why: *Why) !Config { + why.len = 0; + var doc = std.json.parseFromSlice(std.json.Value, a, bytes, .{}) catch |err| { + if (err == error.OutOfMemory) return err; + return bad(why, "config.json"); + }; + defer doc.deinit(); + if (doc.value != .object) return bad(why, "config.json"); + const o = doc.value.object; + try word(o, "model_type", "gpt_oss", why); + const arch = try field(o, "architectures", why); + if (arch != .array or arch.array.items.len != 1 or arch.array.items[0] != .string or + !std.mem.eql(u8, arch.array.items[0].string, "GptOssForCausalLM")) return bad(why, "architectures"); + try flag(o, "attention_bias", true, why); + try flag(o, "tie_word_embeddings", false, why); + try flag(o, "use_cache", true, why); + try flag(o, "output_router_logits", false, why); + try word(o, "hidden_act", "silu", why); + if (try number(o, "attention_dropout", why) != 0) return bad(why, "attention_dropout"); + try quant(o, why); + const initial = try positive(o, "initial_context_length", 1 << 30, why); + var c: Config = .{ + .hidden = try positive(o, "hidden_size", 65536, why), + .layers = try positive(o, "num_hidden_layers", max_layers, why), + .vocab = try positive(o, "vocab_size", 1 << 24, why), + .heads = try positive(o, "num_attention_heads", 512, why), + .kv_heads = try positive(o, "num_key_value_heads", 512, why), + .head_dim = try positive(o, "head_dim", 256, why), + .intermediate = try positive(o, "intermediate_size", 65536, why), + .experts = try positive(o, "num_local_experts", 512, why), + .topk = try positive(o, "experts_per_token", max_topk, why), + .context = try positive(o, "max_position_embeddings", 1 << 30, why), + .initial_context = initial, + .window = try positive(o, "sliding_window", 1 << 30, why), + .eps = try number(o, "rms_norm_eps", why), + .rope_theta = try number(o, "rope_theta", why), + .swiglu_limit = try number(o, "swiglu_limit", why), + .eos = try uint(o, "eos_token_id", why), + .pad = try uint(o, "pad_token_id", why), + .yarn = try rope(o, initial, why), + .layer = @splat(.full), + }; + if (c.hidden % 32 != 0) return bad(why, "hidden_size"); + if (c.intermediate % 32 != 0) return bad(why, "intermediate_size"); + if (c.heads % c.kv_heads != 0) return bad(why, "num_attention_heads"); + if (c.head_dim % 2 != 0) return bad(why, "head_dim"); + if (c.topk > c.experts) return bad(why, "experts_per_token"); + if (o.contains("num_experts_per_tok") and try uint(o, "num_experts_per_tok", why) != c.topk) return bad(why, "num_experts_per_tok"); + if (c.eps <= 0) return bad(why, "rms_norm_eps"); + if (c.rope_theta <= 0) return bad(why, "rope_theta"); + if (c.swiglu_limit <= 0) return bad(why, "swiglu_limit"); + if (c.initial_context > c.context) return bad(why, "initial_context_length"); + if (c.window > c.context) return bad(why, "sliding_window"); + if (c.eos >= c.vocab) return bad(why, "eos_token_id"); + if (c.pad >= c.vocab) return bad(why, "pad_token_id"); + const kinds = try field(o, "layer_types", why); + if (kinds != .array or kinds.array.items.len != c.layers) return bad(why, "layer_types"); + for (kinds.array.items, 0..) |v, i| { + if (v != .string) return bad(why, "layer_types"); + c.layer[i] = if (std.mem.eql(u8, v.string, "sliding_attention")) .sliding else if (std.mem.eql(u8, v.string, "full_attention")) .full else return bad(why, "layer_types"); + } + const known = [_][]const u8{ "architectures", "attention_bias", "attention_dropout", "eos_token_id", "experts_per_token", "head_dim", "hidden_act", "hidden_size", "initial_context_length", "initializer_range", "intermediate_size", "layer_types", "max_position_embeddings", "model_type", "num_attention_heads", "num_experts_per_tok", "num_hidden_layers", "num_key_value_heads", "num_local_experts", "output_router_logits", "pad_token_id", "quantization_config", "rms_norm_eps", "rope_scaling", "rope_theta", "router_aux_loss_coef", "sliding_window", "swiglu_limit", "tie_word_embeddings", "transformers_version", "use_cache", "vocab_size", "_name_or_path", "_commit_hash" }; + for (o.keys()) |key| { + for (known) |name| { + if (std.mem.eql(u8, key, name)) break; + } else return bad(why, key); + } + return c; +} diff --git a/zig/src/families/gpt_oss/config_test.zig b/zig/src/families/gpt_oss/config_test.zig new file mode 100644 index 00000000000..b4513fd0bc7 --- /dev/null +++ b/zig/src/families/gpt_oss/config_test.zig @@ -0,0 +1,98 @@ +//! Admission from the supplied checkpoint, including malformed semantic fields and conflicting aliases. +const std = @import("std"); +const config = @import("config.zig"); +const generation = @import("generation.zig"); +const t = std.testing; +const real = @embedFile("fixtures/config.json"); + +pub fn load() !config.Config { + var why: config.Why = .{}; + return config.parse(t.allocator, real, &why); +} + +test "gpt-oss real config preserves explicit heads, layers, routing and YaRN fields" { + const c = try load(); + try t.expectEqual(@as(u32, 2880), c.hidden); + try t.expectEqual(@as(u32, 4096), c.qWidth()); + try t.expectEqual(@as(u32, 512), c.kvWidth()); + try t.expectEqual(@as(u32, 32), c.experts); + try t.expectEqual(@as(u32, 4), c.topk); + try t.expectEqual(@as(u32, 131072), c.context); + try t.expectEqual(@as(u32, 128), c.window); + try t.expectEqual(@as(f64, 7), c.swiglu_limit); + try t.expectEqual(@as(f64, 150000), c.rope_theta); + try t.expectEqual(@as(f64, 32), c.yarn.factor); + try t.expectEqual(@as(f64, 32), c.yarn.beta_fast); + try t.expectEqual(@as(f64, 1), c.yarn.beta_slow); + try t.expect(!c.yarn.truncate); + for (0..24) |layer| try t.expectEqual(if (layer % 2 == 0) config.Kind.sliding else .full, try c.kind(layer)); + try t.expectError(error.BadLayer, c.kind(24)); +} + +fn refused(before: []const u8, after: []const u8, field: []const u8) !void { + const changed = try std.mem.replaceOwned(u8, t.allocator, real, before, after); + defer t.allocator.free(changed); + try t.expect(!std.mem.eql(u8, changed, real)); + var why: config.Why = .{}; + if (config.parse(t.allocator, changed, &why)) |_| return error.AcceptedBadConfig else |_| {} + try t.expect(std.mem.indexOf(u8, why.text(), field) != null); +} + +test "gpt-oss refusals name the field before geometry or unsupported math can be used" { + const Case = struct { []const u8, []const u8, []const u8 }; + for ([_]Case{ + .{ "\"gpt_oss\"", "\"other\"", "model_type" }, + .{ "GptOssForCausalLM", "OtherForCausalLM", "architectures" }, + .{ "\"hidden_size\": 2880", "\"hidden_size\": 0", "hidden_size" }, + .{ "\"hidden_size\": 2880", "\"hidden_size\": 2881", "hidden_size" }, + .{ "\"num_hidden_layers\": 24", "\"num_hidden_layers\": 129", "num_hidden_layers" }, + .{ "\"num_attention_heads\": 64", "\"num_attention_heads\": 63", "num_attention_heads" }, + .{ "\"num_key_value_heads\": 8", "\"num_key_value_heads\": 0", "num_key_value_heads" }, + .{ "\"head_dim\": 64", "\"head_dim\": 0", "head_dim" }, + .{ "\"experts_per_token\": 4", "\"experts_per_token\": 33", "experts_per_token" }, + .{ "\"num_experts_per_tok\": 4", "\"num_experts_per_tok\": 3", "num_experts_per_tok" }, + .{ "\"num_local_experts\": 32", "\"num_local_experts\": -1", "num_local_experts" }, + .{ "\"intermediate_size\": 2880", "\"intermediate_size\": 31", "intermediate_size" }, + .{ "sliding_attention", "unknown_attention", "layer_types" }, + .{ "\"layer_types\":", "\"other_layer_types\":", "layer_types" }, + .{ "\"sliding_window\": 128", "\"sliding_window\": 0", "sliding_window" }, + .{ "\"attention_bias\": true", "\"attention_bias\": false", "attention_bias" }, + .{ "\"attention_dropout\": 0.0", "\"attention_dropout\": 0.1", "attention_dropout" }, + .{ "\"hidden_act\": \"silu\"", "\"hidden_act\": \"gelu\"", "hidden_act" }, + .{ "\"tie_word_embeddings\": false", "\"tie_word_embeddings\": true", "tie_word_embeddings" }, + .{ "\"rms_norm_eps\": 1e-05", "\"rms_norm_eps\": -1", "rms_norm_eps" }, + .{ "\"rope_theta\": 150000", "\"rope_theta\": 0", "rope_theta" }, + .{ "\"rope_type\": \"yarn\"", "\"rope_type\": \"linear\"", "rope_scaling.rope_type" }, + .{ "\"factor\": 32.0", "\"factor\": 0", "rope_scaling.factor" }, + .{ "\"beta_slow\": 1.0", "\"beta_slow\": 33", "rope_scaling.beta_slow" }, + .{ "\"truncate\": false", "\"truncate\": true", "rope_scaling.truncate" }, + .{ "\"original_max_position_embeddings\": 4096", "\"original_max_position_embeddings\": 2048", "rope_scaling.original_max_position_embeddings" }, + .{ "\"quant_method\": \"mxfp4\"", "\"quant_method\": \"nvfp4\"", "quantization_config.quant_method" }, + .{ "model.layers.*.mlp.router", "model.layers.*.mlp.other", "quantization_config.modules_to_not_convert" }, + .{ "\"eos_token_id\": 200002", "\"eos_token_id\": 201088", "eos_token_id" }, + .{ "\"use_cache\": true", "\"use_cache\": false", "use_cache" }, + .{ "\"output_router_logits\": false", "\"output_router_logits\": true", "output_router_logits" }, + .{ "\"swiglu_limit\": 7.0", "\"swiglu_limit\": 0", "swiglu_limit" }, + .{ "\"vocab_size\": 201088", "\"vocab_size\": 201088, \"unknown_attention\": true", "unknown_attention" }, + }) |c| try refused(c[0], c[1], c[2]); +} + +test "gpt-oss layer schedule is read rather than regenerated from parity" { + const changed = try std.mem.replaceOwned(u8, t.allocator, real, "sliding_attention", "full_attention"); + defer t.allocator.free(changed); + var why: config.Why = .{}; + const c = try config.parse(t.allocator, changed, &why); + for (0..c.layers) |layer| try t.expectEqual(config.Kind.full, try c.kind(layer)); +} + +test "gpt-oss generation stop IDs retain all three supplied endings" { + const c = try load(); + var why: config.Why = .{}; + const g = try generation.parse(t.allocator, @embedFile("fixtures/generation_config.json"), c.vocab, &why); + try t.expect(g.sample); + try t.expectEqual(@as(u32, 199998), g.bos); + try t.expectEqualSlices(u32, &.{ 200002, 199999, 200012 }, g.eos[0..g.eos_n]); + try t.expect(g.stops(200012) and !g.stops(200007)); + try t.expectError(error.BadGptOssConfig, generation.parse(t.allocator, "{\"bos_token_id\":-1}", c.vocab, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), "bos_token_id") != null); +} diff --git a/zig/src/families/gpt_oss/fixtures/SOURCE.json b/zig/src/families/gpt_oss/fixtures/SOURCE.json new file mode 100644 index 00000000000..497b3c5b7f4 --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/SOURCE.json @@ -0,0 +1,43 @@ +{ + "checkpoint": "openai/gpt-oss-20b", + "revision": "6cee5e81ee83917806bbde320786a8fb61efebee", + "license": "Apache-2.0", + "files": [ + { + "file": "config.json", + "inputSha256": "3a2a26ded679375b7928ddeca59764df7cea83220c1961035f6d6e232659e9ce", + "fixtureSha256": "3a2a26ded679375b7928ddeca59764df7cea83220c1961035f6d6e232659e9ce", + "transformation": "none" + }, + { + "file": "generation_config.json", + "inputSha256": "f9970ada892d2d1f72e3ed0a6535ccebadd11897318794ca671d8c7014c957da", + "fixtureSha256": "f9970ada892d2d1f72e3ed0a6535ccebadd11897318794ca671d8c7014c957da", + "transformation": "none" + }, + { + "file": "model-00000-of-00002.safetensors.header.json", + "inputSha256": "c3f0da47d5067762957fb7c2498baa7116dca369f7ec21cb87d534131f28a339", + "fixtureSha256": "79342560c524ca186e60530732df0e15a7fa5d8362eb77dab0c84ef844c7b509", + "tensors": 196, + "dataBytes": 4792250240, + "transformation": "JSON whitespace only, one entry per line; same keys, dtype, shapes and byte offsets" + }, + { + "file": "model-00001-of-00002.safetensors.header.json", + "inputSha256": "2a5470e03fce466096b781271d6d5a6584080c97aa3bfe3ef5979b2ad504688f", + "fixtureSha256": "3e3f8fc53bc6a469030b5d86b106cafc96c1c684aeb9b372510e89a957cd72a2", + "tensors": 197, + "dataBytes": 4798679872, + "transformation": "JSON whitespace only, one entry per line; same keys, dtype, shapes and byte offsets" + }, + { + "file": "model-00002-of-00002.safetensors.header.json", + "inputSha256": "9417871457ee6416db1afa51d00a73fe10bb2b1ff2b82accf9920f60e277681f", + "fixtureSha256": "0a1e9c7eaf13af9f6e169a80fc7d72b66a50a1526ccb9050c0a27902ca5c47be", + "tensors": 66, + "dataBytes": 4170334656, + "transformation": "JSON whitespace only, one entry per line; same keys, dtype, shapes and byte offsets" + } + ] +} diff --git a/zig/src/families/gpt_oss/fixtures/config.json b/zig/src/families/gpt_oss/fixtures/config.json new file mode 100644 index 00000000000..8fb5a4a0337 --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/config.json @@ -0,0 +1,76 @@ +{ + "architectures": [ + "GptOssForCausalLM" + ], + "attention_bias": true, + "attention_dropout": 0.0, + "eos_token_id": 200002, + "experts_per_token": 4, + "head_dim": 64, + "hidden_act": "silu", + "hidden_size": 2880, + "initial_context_length": 4096, + "initializer_range": 0.02, + "intermediate_size": 2880, + "layer_types": [ + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention", + "sliding_attention", + "full_attention" + ], + "max_position_embeddings": 131072, + "model_type": "gpt_oss", + "num_attention_heads": 64, + "num_experts_per_tok": 4, + "num_hidden_layers": 24, + "num_key_value_heads": 8, + "num_local_experts": 32, + "output_router_logits": false, + "pad_token_id": 199999, + "quantization_config": { + "modules_to_not_convert": [ + "model.layers.*.self_attn", + "model.layers.*.mlp.router", + "model.embed_tokens", + "lm_head" + ], + "quant_method": "mxfp4" + }, + "rms_norm_eps": 1e-05, + "rope_scaling": { + "beta_fast": 32.0, + "beta_slow": 1.0, + "factor": 32.0, + "original_max_position_embeddings": 4096, + "rope_type": "yarn", + "truncate": false + }, + "rope_theta": 150000, + "router_aux_loss_coef": 0.9, + "sliding_window": 128, + "swiglu_limit": 7.0, + "tie_word_embeddings": false, + "transformers_version": "4.55.0.dev0", + "use_cache": true, + "vocab_size": 201088 +} diff --git a/zig/src/families/gpt_oss/fixtures/generation_config.json b/zig/src/families/gpt_oss/fixtures/generation_config.json new file mode 100644 index 00000000000..86f91466555 --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/generation_config.json @@ -0,0 +1,11 @@ +{ + "bos_token_id": 199998, + "do_sample": true, + "eos_token_id": [ + 200002, + 199999, + 200012 + ], + "pad_token_id": 199999, + "transformers_version": "4.55.0.dev0" +} diff --git a/zig/src/families/gpt_oss/fixtures/model-00000-of-00002.safetensors.header.json b/zig/src/families/gpt_oss/fixtures/model-00000-of-00002.safetensors.header.json new file mode 100644 index 00000000000..1d95ce0ceeb --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/model-00000-of-00002.safetensors.header.json @@ -0,0 +1,198 @@ +{ + "model.layers.0.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[0,5760]}, + "model.layers.0.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[5760,190080]}, + "model.layers.0.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[190080,558720]}, + "model.layers.0.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[558720,558784]}, + "model.layers.0.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[558784,743104]}, + "model.layers.0.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[743104,748864]}, + "model.layers.0.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[748864,749888]}, + "model.layers.0.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[749888,3699008]}, + "model.layers.0.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[3699008,3704768]}, + "model.layers.0.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[3704768,27297728]}, + "model.layers.0.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[27297728,27305920]}, + "model.layers.0.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[27305920,50898880]}, + "model.layers.0.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[50898880,50899008]}, + "model.layers.0.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[50899008,50900032]}, + "model.layers.0.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[50900032,53849152]}, + "model.layers.1.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[53849152,53854912]}, + "model.layers.1.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[53854912,54039232]}, + "model.layers.1.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[54039232,54407872]}, + "model.layers.1.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[54407872,54407936]}, + "model.layers.1.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[54407936,54592256]}, + "model.layers.1.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[54592256,54598016]}, + "model.layers.1.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[54598016,54599040]}, + "model.layers.1.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[54599040,57548160]}, + "model.layers.1.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[57548160,57553920]}, + "model.layers.1.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[57553920,81146880]}, + "model.layers.1.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[81146880,81155072]}, + "model.layers.1.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[81155072,104748032]}, + "model.layers.1.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[104748032,104748160]}, + "model.layers.1.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[104748160,104749184]}, + "model.layers.1.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[104749184,107698304]}, + "model.layers.10.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[107698304,107704064]}, + "model.layers.10.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[107704064,107888384]}, + "model.layers.10.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[107888384,108257024]}, + "model.layers.10.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[108257024,108257088]}, + "model.layers.10.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[108257088,108441408]}, + "model.layers.10.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[108441408,108447168]}, + "model.layers.10.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[108447168,108448192]}, + "model.layers.10.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[108448192,111397312]}, + "model.layers.10.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[111397312,111403072]}, + "model.layers.10.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[111403072,134996032]}, + "model.layers.10.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[134996032,135004224]}, + "model.layers.10.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[135004224,158597184]}, + "model.layers.10.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[158597184,158597312]}, + "model.layers.10.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[158597312,158598336]}, + "model.layers.10.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[158598336,161547456]}, + "model.layers.11.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[161547456,161553216]}, + "model.layers.11.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[161553216,161737536]}, + "model.layers.11.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[161737536,162106176]}, + "model.layers.11.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[162106176,162106240]}, + "model.layers.11.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[162106240,162290560]}, + "model.layers.11.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[162290560,162296320]}, + "model.layers.11.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[162296320,162297344]}, + "model.layers.11.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[162297344,165246464]}, + "model.layers.11.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[165246464,165252224]}, + "model.layers.11.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[165252224,188845184]}, + "model.layers.11.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[188845184,188853376]}, + "model.layers.11.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[188853376,212446336]}, + "model.layers.11.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[212446336,212446464]}, + "model.layers.11.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[212446464,212447488]}, + "model.layers.11.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[212447488,215396608]}, + "model.layers.12.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[215396608,215402368]}, + "model.layers.12.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[215402368,215586688]}, + "model.layers.12.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[215586688,215955328]}, + "model.layers.12.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[215955328,215955392]}, + "model.layers.12.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[215955392,216139712]}, + "model.layers.12.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[216139712,216145472]}, + "model.layers.12.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[216145472,216146496]}, + "model.layers.12.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[216146496,219095616]}, + "model.layers.12.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[219095616,219101376]}, + "model.layers.12.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[219101376,242694336]}, + "model.layers.12.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[242694336,242702528]}, + "model.layers.12.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[242702528,266295488]}, + "model.layers.12.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[266295488,266295616]}, + "model.layers.12.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[266295616,266296640]}, + "model.layers.12.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[266296640,269245760]}, + "model.layers.13.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[269245760,269251520]}, + "model.layers.13.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[269251520,269435840]}, + "model.layers.13.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[269435840,269804480]}, + "model.layers.13.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[269804480,269804544]}, + "model.layers.13.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[269804544,269988864]}, + "model.layers.13.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[269988864,269994624]}, + "model.layers.13.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[269994624,269995648]}, + "model.layers.13.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[269995648,272944768]}, + "model.layers.13.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[272944768,272950528]}, + "model.layers.13.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[272950528,296543488]}, + "model.layers.13.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[296543488,296551680]}, + "model.layers.13.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[296551680,320144640]}, + "model.layers.13.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[320144640,320144768]}, + "model.layers.13.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[320144768,320145792]}, + "model.layers.13.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[320145792,323094912]}, + "model.layers.14.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[323094912,323100672]}, + "model.layers.14.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[323100672,323284992]}, + "model.layers.14.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[323284992,323653632]}, + "model.layers.14.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[323653632,323653696]}, + "model.layers.14.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[323653696,323838016]}, + "model.layers.14.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[323838016,323843776]}, + "model.layers.14.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[323843776,323844800]}, + "model.layers.14.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[323844800,326793920]}, + "model.layers.14.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[326793920,326799680]}, + "model.layers.14.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[326799680,350392640]}, + "model.layers.14.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[350392640,350400832]}, + "model.layers.14.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[350400832,373993792]}, + "model.layers.14.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[373993792,373993920]}, + "model.layers.14.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[373993920,373994944]}, + "model.layers.14.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[373994944,376944064]}, + "model.layers.15.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[376944064,376949824]}, + "model.layers.15.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[376949824,377134144]}, + "model.layers.15.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[377134144,377502784]}, + "model.layers.15.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[377502784,377502848]}, + "model.layers.15.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[377502848,377687168]}, + "model.layers.15.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[377687168,377692928]}, + "model.layers.15.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[377692928,377693952]}, + "model.layers.15.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[377693952,380643072]}, + "model.layers.15.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[380643072,380648832]}, + "model.layers.15.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[380648832,404241792]}, + "model.layers.15.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[404241792,404249984]}, + "model.layers.15.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[404249984,427842944]}, + "model.layers.15.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[427842944,427843072]}, + "model.layers.15.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[427843072,427844096]}, + "model.layers.15.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[427844096,430793216]}, + "model.layers.16.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[430793216,430798976]}, + "model.layers.16.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[430798976,430983296]}, + "model.layers.16.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[430983296,431351936]}, + "model.layers.16.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[431351936,431352000]}, + "model.layers.16.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[431352000,431536320]}, + "model.layers.16.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[431536320,431542080]}, + "model.layers.16.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[431542080,431543104]}, + "model.layers.16.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[431543104,434492224]}, + "model.layers.16.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[434492224,434497984]}, + "model.layers.16.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[434497984,458090944]}, + "model.layers.16.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[458090944,458099136]}, + "model.layers.16.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[458099136,481692096]}, + "model.layers.16.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[481692096,481692224]}, + "model.layers.16.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[481692224,481693248]}, + "model.layers.16.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[481693248,484642368]}, + "model.layers.17.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[484642368,484648128]}, + "model.layers.17.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[484648128,484832448]}, + "model.layers.17.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[484832448,485201088]}, + "model.layers.17.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[485201088,485201152]}, + "model.layers.17.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[485201152,485385472]}, + "model.layers.17.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[485385472,485391232]}, + "model.layers.17.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[485391232,485392256]}, + "model.layers.17.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[485392256,488341376]}, + "model.layers.17.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[488341376,488347136]}, + "model.layers.17.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[488347136,511940096]}, + "model.layers.17.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[511940096,511948288]}, + "model.layers.17.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[511948288,535541248]}, + "model.layers.17.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[535541248,535541376]}, + "model.layers.17.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[535541376,535542400]}, + "model.layers.17.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[535542400,538491520]}, + "model.layers.18.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[538491520,538497280]}, + "model.layers.18.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[538497280,538498304]}, + "model.layers.18.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[538498304,538504064]}, + "model.layers.18.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[538504064,562097024]}, + "model.layers.18.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[562097024,562105216]}, + "model.layers.18.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[562105216,562106240]}, + "model.layers.0.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[562106240,694816640]}, + "model.layers.0.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[694816640,703111040]}, + "model.layers.0.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[703111040,968531840]}, + "model.layers.0.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[968531840,985120640]}, + "model.layers.1.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[985120640,1117831040]}, + "model.layers.1.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1117831040,1126125440]}, + "model.layers.1.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1126125440,1391546240]}, + "model.layers.1.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[1391546240,1408135040]}, + "model.layers.10.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[1408135040,1540845440]}, + "model.layers.10.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1540845440,1549139840]}, + "model.layers.10.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1549139840,1814560640]}, + "model.layers.10.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[1814560640,1831149440]}, + "model.layers.11.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[1831149440,1963859840]}, + "model.layers.11.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1963859840,1972154240]}, + "model.layers.11.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1972154240,2237575040]}, + "model.layers.11.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[2237575040,2254163840]}, + "model.layers.12.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2254163840,2386874240]}, + "model.layers.12.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[2386874240,2395168640]}, + "model.layers.12.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[2395168640,2660589440]}, + "model.layers.12.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[2660589440,2677178240]}, + "model.layers.13.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2677178240,2809888640]}, + "model.layers.13.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[2809888640,2818183040]}, + "model.layers.13.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[2818183040,3083603840]}, + "model.layers.13.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3083603840,3100192640]}, + "model.layers.14.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3100192640,3232903040]}, + "model.layers.14.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3232903040,3241197440]}, + "model.layers.14.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3241197440,3506618240]}, + "model.layers.14.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3506618240,3523207040]}, + "model.layers.15.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3523207040,3655917440]}, + "model.layers.15.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3655917440,3664211840]}, + "model.layers.15.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3664211840,3929632640]}, + "model.layers.15.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3929632640,3946221440]}, + "model.layers.16.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3946221440,4078931840]}, + "model.layers.16.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[4078931840,4087226240]}, + "model.layers.16.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[4087226240,4352647040]}, + "model.layers.16.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[4352647040,4369235840]}, + "model.layers.17.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[4369235840,4501946240]}, + "model.layers.17.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[4501946240,4510240640]}, + "model.layers.17.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[4510240640,4775661440]}, + "model.layers.17.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[4775661440,4792250240]} +} diff --git a/zig/src/families/gpt_oss/fixtures/model-00001-of-00002.safetensors.header.json b/zig/src/families/gpt_oss/fixtures/model-00001-of-00002.safetensors.header.json new file mode 100644 index 00000000000..4b6d384d611 --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/model-00001-of-00002.safetensors.header.json @@ -0,0 +1,199 @@ +{ + "model.layers.18.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[0,184320]}, + "model.layers.18.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[184320,552960]}, + "model.layers.18.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[552960,553024]}, + "model.layers.18.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[553024,737344]}, + "model.layers.18.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[737344,743104]}, + "model.layers.18.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[743104,3692224]}, + "model.layers.18.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[3692224,27285184]}, + "model.layers.18.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[27285184,27285312]}, + "model.layers.18.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[27285312,30234432]}, + "model.layers.19.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[30234432,30240192]}, + "model.layers.19.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[30240192,30424512]}, + "model.layers.19.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[30424512,30793152]}, + "model.layers.19.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[30793152,30793216]}, + "model.layers.19.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[30793216,30977536]}, + "model.layers.19.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[30977536,30983296]}, + "model.layers.19.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[30983296,30984320]}, + "model.layers.19.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[30984320,33933440]}, + "model.layers.19.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[33933440,33939200]}, + "model.layers.19.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[33939200,57532160]}, + "model.layers.19.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[57532160,57540352]}, + "model.layers.19.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[57540352,81133312]}, + "model.layers.19.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[81133312,81133440]}, + "model.layers.19.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[81133440,81134464]}, + "model.layers.19.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[81134464,84083584]}, + "model.layers.2.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[84083584,84089344]}, + "model.layers.2.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[84089344,84273664]}, + "model.layers.2.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[84273664,84642304]}, + "model.layers.2.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[84642304,84642368]}, + "model.layers.2.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[84642368,84826688]}, + "model.layers.2.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[84826688,84832448]}, + "model.layers.2.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[84832448,84833472]}, + "model.layers.2.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[84833472,87782592]}, + "model.layers.2.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[87782592,87788352]}, + "model.layers.2.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[87788352,111381312]}, + "model.layers.2.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[111381312,111389504]}, + "model.layers.2.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[111389504,134982464]}, + "model.layers.2.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[134982464,134982592]}, + "model.layers.2.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[134982592,134983616]}, + "model.layers.2.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[134983616,137932736]}, + "model.layers.20.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[137932736,137938496]}, + "model.layers.20.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[137938496,138122816]}, + "model.layers.20.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[138122816,138491456]}, + "model.layers.20.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[138491456,138491520]}, + "model.layers.20.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[138491520,138675840]}, + "model.layers.20.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[138675840,138681600]}, + "model.layers.20.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[138681600,138682624]}, + "model.layers.20.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[138682624,141631744]}, + "model.layers.20.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[141631744,141637504]}, + "model.layers.20.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[141637504,165230464]}, + "model.layers.20.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[165230464,165238656]}, + "model.layers.20.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[165238656,188831616]}, + "model.layers.20.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[188831616,188831744]}, + "model.layers.20.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[188831744,188832768]}, + "model.layers.20.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[188832768,191781888]}, + "model.layers.21.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[191781888,191787648]}, + "model.layers.21.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[191787648,191971968]}, + "model.layers.21.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[191971968,192340608]}, + "model.layers.21.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[192340608,192340672]}, + "model.layers.21.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[192340672,192524992]}, + "model.layers.21.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[192524992,192530752]}, + "model.layers.21.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[192530752,192531776]}, + "model.layers.21.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[192531776,195480896]}, + "model.layers.21.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[195480896,195486656]}, + "model.layers.21.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[195486656,219079616]}, + "model.layers.21.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[219079616,219087808]}, + "model.layers.21.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[219087808,242680768]}, + "model.layers.21.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[242680768,242680896]}, + "model.layers.21.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[242680896,242681920]}, + "model.layers.21.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[242681920,245631040]}, + "model.layers.22.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[245631040,245636800]}, + "model.layers.22.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[245636800,245821120]}, + "model.layers.22.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[245821120,246189760]}, + "model.layers.22.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[246189760,246189824]}, + "model.layers.22.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[246189824,246374144]}, + "model.layers.22.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[246374144,246379904]}, + "model.layers.22.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[246379904,246380928]}, + "model.layers.22.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[246380928,249330048]}, + "model.layers.22.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[249330048,249335808]}, + "model.layers.22.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[249335808,272928768]}, + "model.layers.22.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[272928768,272936960]}, + "model.layers.22.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[272936960,296529920]}, + "model.layers.22.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[296529920,296530048]}, + "model.layers.22.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[296530048,296531072]}, + "model.layers.22.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[296531072,299480192]}, + "model.layers.23.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[299480192,299485952]}, + "model.layers.23.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[299485952,299670272]}, + "model.layers.23.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[299670272,300038912]}, + "model.layers.23.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[300038912,300038976]}, + "model.layers.23.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[300038976,300223296]}, + "model.layers.23.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[300223296,300229056]}, + "model.layers.23.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[300229056,300230080]}, + "model.layers.23.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[300230080,303179200]}, + "model.layers.23.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[303179200,303184960]}, + "model.layers.23.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[303184960,326777920]}, + "model.layers.23.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[326777920,326786112]}, + "model.layers.23.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[326786112,350379072]}, + "model.layers.23.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[350379072,350379200]}, + "model.layers.23.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[350379200,350380224]}, + "model.layers.23.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[350380224,353329344]}, + "model.layers.3.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[353329344,353335104]}, + "model.layers.3.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[353335104,353519424]}, + "model.layers.3.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[353519424,353888064]}, + "model.layers.3.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[353888064,353888128]}, + "model.layers.3.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[353888128,354072448]}, + "model.layers.3.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[354072448,354078208]}, + "model.layers.3.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[354078208,354079232]}, + "model.layers.3.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[354079232,357028352]}, + "model.layers.3.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[357028352,357034112]}, + "model.layers.3.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[357034112,380627072]}, + "model.layers.3.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[380627072,380635264]}, + "model.layers.3.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[380635264,404228224]}, + "model.layers.3.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[404228224,404228352]}, + "model.layers.3.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[404228352,404229376]}, + "model.layers.3.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[404229376,407178496]}, + "model.layers.4.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[407178496,407184256]}, + "model.layers.4.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[407184256,407368576]}, + "model.layers.4.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[407368576,407737216]}, + "model.layers.4.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[407737216,407737280]}, + "model.layers.4.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[407737280,407921600]}, + "model.layers.4.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[407921600,407927360]}, + "model.layers.4.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[407927360,407928384]}, + "model.layers.4.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[407928384,410877504]}, + "model.layers.4.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[410877504,410883264]}, + "model.layers.4.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[410883264,434476224]}, + "model.layers.4.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[434476224,434484416]}, + "model.layers.4.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[434484416,458077376]}, + "model.layers.4.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[458077376,458077504]}, + "model.layers.4.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[458077504,458078528]}, + "model.layers.4.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[458078528,461027648]}, + "model.layers.5.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[461027648,461033408]}, + "model.layers.5.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[461033408,461217728]}, + "model.layers.5.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[461217728,461586368]}, + "model.layers.5.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[461586368,461586432]}, + "model.layers.5.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[461586432,461770752]}, + "model.layers.5.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[461770752,461776512]}, + "model.layers.5.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[461776512,461777536]}, + "model.layers.5.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[461777536,464726656]}, + "model.layers.5.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[464726656,464732416]}, + "model.layers.5.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[464732416,488325376]}, + "model.layers.5.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[488325376,488333568]}, + "model.layers.5.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[488333568,511926528]}, + "model.layers.5.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[511926528,511926656]}, + "model.layers.5.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[511926656,511927680]}, + "model.layers.5.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[511927680,514876800]}, + "model.layers.6.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[514876800,514882560]}, + "model.layers.6.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[514882560,515251200]}, + "model.layers.6.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[515251200,515251264]}, + "model.layers.6.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[515251264,515435584]}, + "model.layers.6.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[515435584,515436608]}, + "model.layers.6.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[515436608,518385728]}, + "model.layers.6.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[518385728,518391488]}, + "model.layers.6.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[518391488,541984448]}, + "model.layers.6.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[541984448,541992640]}, + "model.layers.6.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[541992640,565585600]}, + "model.layers.6.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[565585600,565585728]}, + "model.layers.6.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[565585728,565586752]}, + "model.layers.6.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[565586752,568535872]}, + "model.layers.18.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[568535872,701246272]}, + "model.layers.18.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[701246272,709540672]}, + "model.layers.18.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[709540672,974961472]}, + "model.layers.18.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[974961472,991550272]}, + "model.layers.19.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[991550272,1124260672]}, + "model.layers.19.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1124260672,1132555072]}, + "model.layers.19.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1132555072,1397975872]}, + "model.layers.19.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[1397975872,1414564672]}, + "model.layers.2.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[1414564672,1547275072]}, + "model.layers.2.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1547275072,1555569472]}, + "model.layers.2.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1555569472,1820990272]}, + "model.layers.2.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[1820990272,1837579072]}, + "model.layers.20.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[1837579072,1970289472]}, + "model.layers.20.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[1970289472,1978583872]}, + "model.layers.20.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[1978583872,2244004672]}, + "model.layers.20.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[2244004672,2260593472]}, + "model.layers.21.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2260593472,2393303872]}, + "model.layers.21.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[2393303872,2401598272]}, + "model.layers.21.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[2401598272,2667019072]}, + "model.layers.21.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[2667019072,2683607872]}, + "model.layers.22.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2683607872,2816318272]}, + "model.layers.22.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[2816318272,2824612672]}, + "model.layers.22.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[2824612672,3090033472]}, + "model.layers.22.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3090033472,3106622272]}, + "model.layers.23.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3106622272,3239332672]}, + "model.layers.23.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3239332672,3247627072]}, + "model.layers.23.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3247627072,3513047872]}, + "model.layers.23.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3513047872,3529636672]}, + "model.layers.3.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3529636672,3662347072]}, + "model.layers.3.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3662347072,3670641472]}, + "model.layers.3.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3670641472,3936062272]}, + "model.layers.3.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3936062272,3952651072]}, + "model.layers.4.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3952651072,4085361472]}, + "model.layers.4.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[4085361472,4093655872]}, + "model.layers.4.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[4093655872,4359076672]}, + "model.layers.4.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[4359076672,4375665472]}, + "model.layers.5.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[4375665472,4508375872]}, + "model.layers.5.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[4508375872,4516670272]}, + "model.layers.5.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[4516670272,4782091072]}, + "model.layers.5.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[4782091072,4798679872]} +} diff --git a/zig/src/families/gpt_oss/fixtures/model-00002-of-00002.safetensors.header.json b/zig/src/families/gpt_oss/fixtures/model-00002-of-00002.safetensors.header.json new file mode 100644 index 00000000000..253f8f53881 --- /dev/null +++ b/zig/src/families/gpt_oss/fixtures/model-00002-of-00002.safetensors.header.json @@ -0,0 +1,68 @@ +{ + "lm_head.weight": {"dtype":"BF16","shape":[201088,2880],"data_offsets":[0,1158266880]}, + "model.embed_tokens.weight": {"dtype":"BF16","shape":[201088,2880],"data_offsets":[1158266880,2316533760]}, + "model.layers.6.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2316533760,2316718080]}, + "model.layers.6.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2316718080,2316723840]}, + "model.layers.7.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2316723840,2316729600]}, + "model.layers.7.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2316729600,2316913920]}, + "model.layers.7.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[2316913920,2317282560]}, + "model.layers.7.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[2317282560,2317282624]}, + "model.layers.7.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2317282624,2317466944]}, + "model.layers.7.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2317466944,2317472704]}, + "model.layers.7.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2317472704,2317473728]}, + "model.layers.7.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2317473728,2320422848]}, + "model.layers.7.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[2320422848,2320428608]}, + "model.layers.7.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[2320428608,2344021568]}, + "model.layers.7.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[2344021568,2344029760]}, + "model.layers.7.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[2344029760,2367622720]}, + "model.layers.7.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[2367622720,2367622848]}, + "model.layers.7.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2367622848,2367623872]}, + "model.layers.7.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2367623872,2370572992]}, + "model.layers.8.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2370572992,2370578752]}, + "model.layers.8.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2370578752,2370763072]}, + "model.layers.8.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[2370763072,2371131712]}, + "model.layers.8.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[2371131712,2371131776]}, + "model.layers.8.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2371131776,2371316096]}, + "model.layers.8.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2371316096,2371321856]}, + "model.layers.8.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2371321856,2371322880]}, + "model.layers.8.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2371322880,2374272000]}, + "model.layers.8.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[2374272000,2374277760]}, + "model.layers.8.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[2374277760,2397870720]}, + "model.layers.8.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[2397870720,2397878912]}, + "model.layers.8.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[2397878912,2421471872]}, + "model.layers.8.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[2421471872,2421472000]}, + "model.layers.8.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2421472000,2421473024]}, + "model.layers.8.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2421473024,2424422144]}, + "model.layers.9.input_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2424422144,2424427904]}, + "model.layers.9.mlp.experts.down_proj_bias": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2424427904,2424612224]}, + "model.layers.9.mlp.experts.gate_up_proj_bias": {"dtype":"BF16","shape":[32,5760],"data_offsets":[2424612224,2424980864]}, + "model.layers.9.mlp.router.bias": {"dtype":"BF16","shape":[32],"data_offsets":[2424980864,2424980928]}, + "model.layers.9.mlp.router.weight": {"dtype":"BF16","shape":[32,2880],"data_offsets":[2424980928,2425165248]}, + "model.layers.9.post_attention_layernorm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2425165248,2425171008]}, + "model.layers.9.self_attn.k_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2425171008,2425172032]}, + "model.layers.9.self_attn.k_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2425172032,2428121152]}, + "model.layers.9.self_attn.o_proj.bias": {"dtype":"BF16","shape":[2880],"data_offsets":[2428121152,2428126912]}, + "model.layers.9.self_attn.o_proj.weight": {"dtype":"BF16","shape":[2880,4096],"data_offsets":[2428126912,2451719872]}, + "model.layers.9.self_attn.q_proj.bias": {"dtype":"BF16","shape":[4096],"data_offsets":[2451719872,2451728064]}, + "model.layers.9.self_attn.q_proj.weight": {"dtype":"BF16","shape":[4096,2880],"data_offsets":[2451728064,2475321024]}, + "model.layers.9.self_attn.sinks": {"dtype":"BF16","shape":[64],"data_offsets":[2475321024,2475321152]}, + "model.layers.9.self_attn.v_proj.bias": {"dtype":"BF16","shape":[512],"data_offsets":[2475321152,2475322176]}, + "model.layers.9.self_attn.v_proj.weight": {"dtype":"BF16","shape":[512,2880],"data_offsets":[2475322176,2478271296]}, + "model.norm.weight": {"dtype":"BF16","shape":[2880],"data_offsets":[2478271296,2478277056]}, + "model.layers.6.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2478277056,2610987456]}, + "model.layers.6.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[2610987456,2619281856]}, + "model.layers.6.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[2619281856,2884702656]}, + "model.layers.6.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[2884702656,2901291456]}, + "model.layers.7.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[2901291456,3034001856]}, + "model.layers.7.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3034001856,3042296256]}, + "model.layers.7.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3042296256,3307717056]}, + "model.layers.7.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3307717056,3324305856]}, + "model.layers.8.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3324305856,3457016256]}, + "model.layers.8.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3457016256,3465310656]}, + "model.layers.8.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3465310656,3730731456]}, + "model.layers.8.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[3730731456,3747320256]}, + "model.layers.9.mlp.experts.down_proj_blocks": {"dtype":"U8","shape":[32,2880,90,16],"data_offsets":[3747320256,3880030656]}, + "model.layers.9.mlp.experts.down_proj_scales": {"dtype":"U8","shape":[32,2880,90],"data_offsets":[3880030656,3888325056]}, + "model.layers.9.mlp.experts.gate_up_proj_blocks": {"dtype":"U8","shape":[32,5760,90,16],"data_offsets":[3888325056,4153745856]}, + "model.layers.9.mlp.experts.gate_up_proj_scales": {"dtype":"U8","shape":[32,5760,90],"data_offsets":[4153745856,4170334656]} +} diff --git a/zig/src/families/gpt_oss/generation.zig b/zig/src/families/gpt_oss/generation.zig new file mode 100644 index 00000000000..c36f55d6a87 --- /dev/null +++ b/zig/src/families/gpt_oss/generation.zig @@ -0,0 +1,44 @@ +//! Generation stop metadata, kept separate from the architecture's single eos_token_id. +const std = @import("std"); +const config = @import("config.zig"); + +pub const Generation = struct { + bos: u32, + pad: u32, + sample: bool, + eos: [8]u32, + eos_n: usize, + + pub fn stops(g: *const Generation, id: u32) bool { + return std.mem.indexOfScalar(u32, g.eos[0..g.eos_n], id) != null; + } +}; + +pub fn parse(a: std.mem.Allocator, bytes: []const u8, vocab: u32, why: *config.Why) !Generation { + why.len = 0; + var doc = std.json.parseFromSlice(std.json.Value, a, bytes, .{}) catch |err| { + if (err == error.OutOfMemory) return err; + return config.bad(why, "generation_config.json"); + }; + defer doc.deinit(); + if (doc.value != .object) return config.bad(why, "generation_config.json"); + const o = doc.value.object; + const bos = try config.uint(o, "bos_token_id", why); + if (bos >= vocab) return config.bad(why, "bos_token_id"); + const pad = try config.uint(o, "pad_token_id", why); + if (pad >= vocab) return config.bad(why, "pad_token_id"); + const sample = try config.field(o, "do_sample", why); + if (sample != .bool) return config.bad(why, "do_sample"); + var out: Generation = .{ .bos = bos, .pad = pad, .sample = sample.bool, .eos = @splat(0), .eos_n = 0 }; + const eos = try config.field(o, "eos_token_id", why); + const values: []const std.json.Value = if (eos == .array) eos.array.items else &.{eos}; + if (values.len == 0 or values.len > out.eos.len) return config.bad(why, "eos_token_id"); + for (values) |v| { + if (v != .integer or v.integer < 0 or v.integer >= vocab) return config.bad(why, "eos_token_id"); + const id: u32 = @intCast(v.integer); + if (std.mem.indexOfScalar(u32, out.eos[0..out.eos_n], id) != null) return config.bad(why, "eos_token_id"); + out.eos[out.eos_n] = id; + out.eos_n += 1; + } + return out; +} diff --git a/zig/src/families/gpt_oss/gpt_oss.zig b/zig/src/families/gpt_oss/gpt_oss.zig new file mode 100644 index 00000000000..50dd1379881 --- /dev/null +++ b/zig/src/families/gpt_oss/gpt_oss.zig @@ -0,0 +1,8 @@ +//! Host-only gpt-oss package. It advertises no native backend or checkpoint execution capability. +pub const config = @import("config.zig"); +pub const generation = @import("generation.zig"); +pub const names = @import("names.zig"); +pub const attention = @import("attention.zig"); +pub const route = @import("route.zig"); +pub const mxfp4 = @import("mxfp4"); +pub const parseHarmony = @import("reply_text").parseHarmony; diff --git a/zig/src/families/gpt_oss/host_test.zig b/zig/src/families/gpt_oss/host_test.zig new file mode 100644 index 00000000000..102594d1110 --- /dev/null +++ b/zig/src/families/gpt_oss/host_test.zig @@ -0,0 +1,18 @@ +//! Host-only family bring-up, without native registration or a model execution claim. +const std = @import("std"); +const family = @import("gpt_oss.zig"); + +test { + _ = @import("config_test.zig"); + _ = @import("names_test.zig"); + _ = @import("arithmetic_test.zig"); + _ = @import("mxfp4_test.zig"); +} + +test "gpt-oss uses the existing Harmony splitter for analysis and final channels" { + const text = "<|start|>assistant<|channel|>analysis<|message|>work<|end|><|start|>assistant<|channel|>final<|message|>42<|return|>"; + const reply = family.parseHarmony(text); + try std.testing.expectEqualStrings("42", reply.content); + try std.testing.expectEqualStrings("work", reply.reasoning.?); + try std.testing.expectEqual(@intFromPtr(&@import("reply_text").parseHarmony), @intFromPtr(&family.parseHarmony)); +} diff --git a/zig/src/families/gpt_oss/mxfp4_test.zig b/zig/src/families/gpt_oss/mxfp4_test.zig new file mode 100644 index 00000000000..ceaae01f258 --- /dev/null +++ b/zig/src/families/gpt_oss/mxfp4_test.zig @@ -0,0 +1,83 @@ +//! Independent FP64 bitfield arithmetic against every finite scale and code, with a wrong-order control. +const std = @import("std"); +const mx = @import("mxfp4"); +const st = @import("safetensors"); +const t = std.testing; + +fn reference(code: u8, scale: u8) f64 { + const exponent = (code >> 1) & 3; + const mantissa: f64 = @floatFromInt(code & 1); + var magnitude: f64 = if (exponent == 0) mantissa * 0.5 else 1 + mantissa * 0.5; + if (exponent > 1) for (1..exponent) |_| { + magnitude *= 2; + }; + const power = @as(i32, scale) - 127; + var factor: f64 = 1; + for (0..@abs(power)) |_| factor *= if (power < 0) 0.5 else 2; + return (if (code & 8 != 0) -magnitude else magnitude) * factor; +} + +test "gpt-oss MXFP4 preserves every code and all 255 finite UE8M0 scales exactly in FP64" { + var block: [16]u8 = undefined; + for (&block, 0..) |*byte, i| byte.* = @as(u8, @intCast(i)) | (@as(u8, @intCast(15 - i)) << 4); + for (0..255) |s| { + var out: [32]f64 = undefined; + try mx.decodeBlock(&block, @intCast(s), .low_first, &out); + for (out, 0..) |value, i| { + const code = if (i % 2 == 0) block[i / 2] & 15 else block[i / 2] >> 4; + try t.expectEqual(@as(u64, @bitCast(reference(code, @intCast(s)))), @as(u64, @bitCast(value))); + } + } + var out: [32]f64 = undefined; + try t.expectError(error.BadMxfp4Scale, mx.decodeBlock(&block, 255, .low_first, &out)); +} + +test "gpt-oss MXFP4 packed reader respects expert row block and nibble boundaries" { + var blocks: [2 * 2 * 2 * 16]u8 = @splat(0); + var scales: [8]u8 = @splat(127); + blocks[0] = 0xF2; + blocks[16 + 15] = 0x30; + blocks[64 + 32] = 0x77; + scales[6] = 128; + const b: st.Tensor = .{ .dtype = .u8, .rank = 4, .shape = .{ 2, 2, 2, 16, 1 }, .bytes = &blocks }; + const s: st.Tensor = .{ .dtype = .u8, .rank = 3, .shape = .{ 2, 2, 2, 1, 1 }, .bytes = &scales }; + const h = try mx.Host.init(b, s, .low_first); + try t.expectEqual(@as(f64, 1), try h.value(0, 0, 0)); + try t.expectEqual(@as(f64, -6), try h.value(0, 0, 1)); + try t.expectEqual(@as(f64, 1.5), try h.value(0, 0, 63)); + try t.expectEqual(@as(f64, 12), try h.value(1, 1, 0)); + for (0..2) |expert| for (0..2) |index| { + var got: [64]f64 = undefined; + try h.row(expert, index, &got); + var want: [64]f64 = @splat(0); + if (expert == 0 and index == 0) { + want[0] = 1; + want[1] = -6; + want[63] = 1.5; + } + if (expert == 1 and index == 1) { + want[0] = 12; + want[1] = 12; + } + try t.expectEqualSlices(f64, &want, &got); + }; + try t.expectError(error.BadMxfp4Index, h.value(2, 0, 0)); + try t.expectError(error.BadMxfp4Index, h.value(0, 0, 64)); + const swapped = try mx.Host.init(b, s, .high_first); + try t.expectEqual(@as(f64, -6), try swapped.value(0, 0, 0)); + try t.expect((try h.value(0, 0, 0)) != (try swapped.value(0, 0, 0))); + var bad = b; + bad.shape[3] = 15; + try t.expectError(error.BadMxfp4Shape, mx.Host.init(bad, s, .low_first)); + bad = b; + bad.dtype = .bf16; + try t.expectError(error.BadMxfp4Shape, mx.Host.init(bad, s, .low_first)); + bad = b; + bad.bytes = blocks[0..127]; + try t.expectError(error.BadMxfp4Shape, mx.Host.init(bad, s, .low_first)); + bad = b; + bad.shape[0] = std.math.maxInt(usize); + try t.expectError(error.BadMxfp4Shape, mx.Host.init(bad, s, .low_first)); + scales[6] = 255; + try t.expectError(error.BadMxfp4Scale, h.value(1, 1, 0)); +} diff --git a/zig/src/families/gpt_oss/names.zig b/zig/src/families/gpt_oss/names.zig new file mode 100644 index 00000000000..ed2430964fb --- /dev/null +++ b/zig/src/families/gpt_oss/names.zig @@ -0,0 +1,136 @@ +//! The checkpoint's complete tensor namespace, stored dtypes and physical shapes; no data conversion. +const std = @import("std"); +const st = @import("safetensors"); +const config = @import("config.zig"); + +pub const Role = enum { + embed, + final_norm, + head, + attn_norm, + mlp_norm, + q, + q_bias, + k, + k_bias, + v, + v_bias, + o, + o_bias, + sink, + router, + router_bias, + gate_up_blocks, + gate_up_scales, + gate_up_bias, + down_blocks, + down_scales, + down_bias, +}; +pub const Spec = struct { role: Role, layer: ?u32, dtype: st.DType, rank: u8, shape: [4]usize }; +const Part = struct { key: []const u8, role: Role }; +const globals = [_]Part{ + .{ .key = "model.embed_tokens.weight", .role = .embed }, + .{ .key = "model.norm.weight", .role = .final_norm }, + .{ .key = "lm_head.weight", .role = .head }, +}; +const parts = [_]Part{ + .{ .key = "input_layernorm.weight", .role = .attn_norm }, + .{ .key = "post_attention_layernorm.weight", .role = .mlp_norm }, + .{ .key = "self_attn.q_proj.weight", .role = .q }, + .{ .key = "self_attn.q_proj.bias", .role = .q_bias }, + .{ .key = "self_attn.k_proj.weight", .role = .k }, + .{ .key = "self_attn.k_proj.bias", .role = .k_bias }, + .{ .key = "self_attn.v_proj.weight", .role = .v }, + .{ .key = "self_attn.v_proj.bias", .role = .v_bias }, + .{ .key = "self_attn.o_proj.weight", .role = .o }, + .{ .key = "self_attn.o_proj.bias", .role = .o_bias }, + .{ .key = "self_attn.sinks", .role = .sink }, + .{ .key = "mlp.router.weight", .role = .router }, + .{ .key = "mlp.router.bias", .role = .router_bias }, + .{ .key = "mlp.experts.gate_up_proj_blocks", .role = .gate_up_blocks }, + .{ .key = "mlp.experts.gate_up_proj_scales", .role = .gate_up_scales }, + .{ .key = "mlp.experts.gate_up_proj_bias", .role = .gate_up_bias }, + .{ .key = "mlp.experts.down_proj_blocks", .role = .down_blocks }, + .{ .key = "mlp.experts.down_proj_scales", .role = .down_scales }, + .{ .key = "mlp.experts.down_proj_bias", .role = .down_bias }, +}; + +fn spec(c: *const config.Config, role: Role, layer: ?u32) Spec { + const h: usize = c.hidden; + const i: usize = c.intermediate; + const e: usize = c.experts; + const dims: []const usize = switch (role) { + .embed, .head => &.{ c.vocab, h }, + .final_norm, .attn_norm, .mlp_norm, .o_bias => &.{h}, + .q => &.{ c.qWidth(), h }, + .q_bias => &.{c.qWidth()}, + .k, .v => &.{ c.kvWidth(), h }, + .k_bias, .v_bias => &.{c.kvWidth()}, + .o => &.{ h, c.qWidth() }, + .sink => &.{c.heads}, + .router => &.{ e, h }, + .router_bias => &.{e}, + .gate_up_blocks => &.{ e, i * 2, h / 32, 16 }, + .gate_up_scales => &.{ e, i * 2, h / 32 }, + .gate_up_bias => &.{ e, i * 2 }, + .down_blocks => &.{ e, h, i / 32, 16 }, + .down_scales => &.{ e, h, i / 32 }, + .down_bias => &.{ e, h }, + }; + var out: Spec = .{ .role = role, .layer = layer, .dtype = switch (role) { + .gate_up_blocks, .gate_up_scales, .down_blocks, .down_scales => .u8, + else => .bf16, + }, .rank = @intCast(dims.len), .shape = @splat(1) }; + @memcpy(out.shape[0..dims.len], dims); + return out; +} + +pub fn find(c: *const config.Config, name: []const u8) ?Spec { + for (globals) |p| if (std.mem.eql(u8, name, p.key)) return spec(c, p.role, null); + const prefix = "model.layers."; + if (!std.mem.startsWith(u8, name, prefix)) return null; + const tail = name[prefix.len..]; + const dot = std.mem.indexOfScalar(u8, tail, '.') orelse return null; + const digits = tail[0..dot]; + if (digits.len == 0 or (digits.len > 1 and digits[0] == '0')) return null; + for (digits) |d| if (!std.ascii.isDigit(d)) return null; + const layer = std.fmt.parseInt(u32, digits, 10) catch return null; + if (layer >= c.layers) return null; + for (parts) |p| if (std.mem.eql(u8, tail[dot + 1 ..], p.key)) return spec(c, p.role, layer); + return null; +} + +/// Enumerate all globals and each stored layer tensor. The sink consumes the ephemeral name during put(). +pub fn walk(c: *const config.Config, sink: anytype) !void { + for (globals) |p| try sink.put(p.key, spec(c, p.role, null)); + var buf: [192]u8 = undefined; + for (0..c.layers) |layer| for (parts) |p| { + const name = try std.fmt.bufPrint(&buf, "model.layers.{d}.{s}", .{ layer, p.key }); + try sink.put(name, spec(c, p.role, @intCast(layer))); + }; +} + +fn bad(why: *config.Why, name: []const u8) error{BadGptOssTensor} { + why.set(name); + return error.BadGptOssTensor; +} + +pub fn check(c: *const config.Config, header: *const st.Header, why: *config.Why) !void { + for (header.keys(), header.values()) |name, entry| { + const expected = find(c, name) orelse return bad(why, name); + if (entry.dtype != expected.dtype or entry.rank != expected.rank or + !std.mem.eql(usize, entry.shape[0..entry.rank], expected.shape[0..expected.rank])) return bad(why, name); + } + var checker: Checker = .{ .header = header, .why = why }; + try walk(c, &checker); +} + +const Checker = struct { + header: *const st.Header, + why: *config.Why, + + pub fn put(self: *Checker, name: []const u8, _: Spec) !void { + if (!self.header.contains(name)) return bad(self.why, name); + } +}; diff --git a/zig/src/families/gpt_oss/names_test.zig b/zig/src/families/gpt_oss/names_test.zig new file mode 100644 index 00000000000..cf0fc3cfcec --- /dev/null +++ b/zig/src/families/gpt_oss/names_test.zig @@ -0,0 +1,69 @@ +//! All 459 real tensor headers, without model payloads or a second safetensors parser. +const std = @import("std"); +const st = @import("safetensors"); +const names = @import("names.zig"); +const config = @import("config.zig"); +const t = std.testing; + +pub fn headers(a: std.mem.Allocator) !st.Header { + var all: st.Header = .empty; + const jsons = [_][]const u8{ + @embedFile("fixtures/model-00000-of-00002.safetensors.header.json"), + @embedFile("fixtures/model-00001-of-00002.safetensors.header.json"), + @embedFile("fixtures/model-00002-of-00002.safetensors.header.json"), + }; + for (jsons, [_]usize{ 4792250240, 4798679872, 4170334656 }) |json, size| { + const h = try st.parseHeader(a, json, size); + for (h.keys(), h.values()) |key, value| { + try t.expect(!all.contains(key)); + try all.put(a, key, value); + } + } + return all; +} + +test "gpt-oss tensor map accounts for every real name dtype and dimension" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + var h = try headers(arena.allocator()); + const c = try @import("config_test.zig").load(); + var why: config.Why = .{}; + try names.check(&c, &h, &why); + try t.expectEqual(@as(usize, 459), h.count()); + const q = names.find(&c, "model.layers.0.self_attn.q_proj.weight").?; + try t.expectEqual(@as(usize, 4096), q.shape[0]); + try t.expectEqual(@as(usize, 2880), q.shape[1]); + const blocks = names.find(&c, "model.layers.23.mlp.experts.gate_up_proj_blocks").?; + try t.expectEqualSlices(usize, &.{ 32, 5760, 90, 16 }, blocks.shape[0..blocks.rank]); + try t.expectEqual(st.DType.u8, blocks.dtype); + try t.expect(names.find(&c, "model.layers.24.self_attn.sinks") == null); + try t.expect(names.find(&c, "model.layers.00.self_attn.sinks") == null); + try t.expect(names.find(&c, "model.layers.-1.self_attn.sinks") == null); +} + +test "gpt-oss missing sink and malformed mixed projections are refused by tensor name" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + var h = try headers(arena.allocator()); + const c = try @import("config_test.zig").load(); + var why: config.Why = .{}; + const sink = "model.layers.0.self_attn.sinks"; + const saved = h.get(sink).?; + _ = h.swapRemove(sink); + try t.expectError(error.BadGptOssTensor, names.check(&c, &h, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), sink) != null); + try h.put(arena.allocator(), sink, saved); + const key = "model.layers.0.mlp.experts.gate_up_proj_blocks"; + const original = h.get(key).?; + h.getPtr(key).?.shape[2] = 89; + try t.expectError(error.BadGptOssTensor, names.check(&c, &h, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), key) != null); + h.getPtr(key).?.* = original; + h.getPtr(key).?.dtype = .bf16; + try t.expectError(error.BadGptOssTensor, names.check(&c, &h, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), key) != null); + h.getPtr(key).?.* = original; + try h.put(arena.allocator(), "model.layers.0.mlp.experts.unexpected", saved); + try t.expectError(error.BadGptOssTensor, names.check(&c, &h, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), "unexpected") != null); +} diff --git a/zig/src/families/gpt_oss/route.zig b/zig/src/families/gpt_oss/route.zig new file mode 100644 index 00000000000..c5d10801877 --- /dev/null +++ b/zig/src/families/gpt_oss/route.zig @@ -0,0 +1,37 @@ +//! Host top-k selection from router projection-plus-bias logits. Normalization is an explicit separate operation. +const std = @import("std"); +const config = @import("config.zig"); +pub const Selected = struct { ids: [config.max_topk]u32, logits: [config.max_topk]f64, len: usize }; + +/// Reference convention: descending finite logits, lower expert ID first on ties. This does not choose weights. +pub fn select(c: *const config.Config, logits: []const f64) !Selected { + if (logits.len != c.experts or c.topk == 0 or c.topk > config.max_topk or c.topk > logits.len) return error.BadRouterShape; + var out: Selected = .{ .ids = @splat(0), .logits = @splat(-std.math.inf(f64)), .len = c.topk }; + for (logits, 0..) |score, id| { + if (!std.math.isFinite(score)) return error.NonfiniteRouter; + var at: usize = 0; + while (at < out.len and score <= out.logits[at]) : (at += 1) {} + if (at == out.len) continue; + var end = out.len - 1; + while (end > at) : (end -= 1) { + out.logits[end] = out.logits[end - 1]; + out.ids[end] = out.ids[end - 1]; + } + out.logits[at] = score; + out.ids[at] = @intCast(id); + } + return out; +} + +/// Explicit host reference for softmax over selected logits; the packet does not establish its model integration. +pub fn softmaxSelected(logits: []const f64, out: []f64) !void { + if (logits.len == 0 or out.len != logits.len) return error.BadRouterShape; + var maximum = -std.math.inf(f64); + for (logits) |v| { + if (!std.math.isFinite(v)) return error.NonfiniteRouter; + maximum = @max(maximum, v); + } + var sum: f64 = 0; + for (logits) |v| sum += @exp(v - maximum); + for (out, logits) |*weight, v| weight.* = @exp(v - maximum) / sum; +} diff --git a/zig/src/families/inkling2/config.zig b/zig/src/families/inkling2/config.zig new file mode 100644 index 00000000000..b4143603140 --- /dev/null +++ b/zig/src/families/inkling2/config.zig @@ -0,0 +1,375 @@ +//! Inkling 2 Small's shape from config.json (inkling2), refusing every layout the engine does not run. +const std = @import("std"); + +/// The most backbone layers the plan tables hold (Inkling 2 Small has 48). +pub const max_layers = 128; + +/// Every sixth layer attends over the whole context; the reference derives its layer types the same way. +pub const global_every = 6; + +/// The short convolutions' taps, as the checkpoint stores them. +pub const conv_taps = 4; + +/// The reference config's default for image_token_id. +pub const default_image_token = 200054; + +/// Layer i attends over the whole context; the others over a sliding window. +pub fn isGlobal(i: u32) bool { + return (i + 1) % global_every == 0; +} + +/// Why parse refused the config, one sentence for the caller's log line (tests read it too). +pub const Why = struct { + buf: [320]u8 = undefined, + len: usize = 0, + + pub fn set(self: *Why, comptime fmt: []const u8, args: anytype) void { + var w: std.Io.Writer = .fixed(&self.buf); + w.print(fmt, args) catch {}; + self.len = w.end; + } + + pub fn text(self: *const Why) []const u8 { + return self.buf[0..self.len]; + } +}; + +/// One attention geometry: sliding layers read the `swa_*` keys, global layers the plain ones. +pub const Heads = struct { q: u32, kv: u32, dim: u32 }; + +pub const Text = struct { + hidden: u32, + layers: u32, + vocab: u32, + unpadded_vocab: u32, // rows of the unembedding that hold real tokens + local: Heads, + global: Heads, + window: u32, // sliding_window_size: the local layers' span and their relative-bias extent + d_rel: u32, + rel_extent: u32, // the global layers' relative-bias extent + log_floor: u32, + log_alpha: f32, + eps: f32, + qk_clip: f32, + rel_clip: f32, + block: u32, // n_layers_per_attn_res_block + experts: u32, + topk: u32, + expert_inter: u32, + route_scale: f32, + gate_cap: f32, + up_cap: f32, + logit_cap: f32, + max_context: u32, + + pub fn heads(c: *const Text, i: u32) Heads { + return if (isGlobal(i)) c.global else c.local; + } + + /// Layer i's relative-bias extent in backward tokens. + pub fn extent(c: *const Text, i: u32) u32 { + return if (isGlobal(i)) c.rel_extent else c.window; + } +}; + +/// The draft head's shape (mtp_config); the target taps are indices into the backbone, `layers` meaning the final norm. +pub const Mtp = struct { + layers: u32, + q_heads: u32, + kv_heads: u32, + head_dim: u32, + inter: u32, + rope_theta: f32, + window: u32, + local: [8]bool, // local[i]: draft layer i slides + block: u32, + rank: u32, + taps: [16]u32, + taps_n: u32, +}; + +pub const Vision = struct { + hidden: u32, + layers: u32, + heads: u32, + patch: u32, + merge: u32, + grid: u32, + mlp_ratio: u32, + proj_hidden: u32, + text_hidden: u32, +}; + +pub const Config = struct { + text: Text, + vision: Vision, + mtp: ?Mtp, + eos: u32, + image_token: u32, +}; + +fn get(o: std.json.ObjectMap, key: []const u8, why: *Why) !std.json.Value { + return o.get(key) orelse { + why.set("config.json has no {s}", .{key}); + return error.BadConfig; + }; +} + +fn object(o: std.json.ObjectMap, key: []const u8, why: *Why) !std.json.ObjectMap { + const v = try get(o, key, why); + if (v != .object) { + why.set("config.json's {s} is not an object", .{key}); + return error.BadConfig; + } + return v.object; +} + +fn int(o: std.json.ObjectMap, key: []const u8, why: *Why) !u32 { + const v = try get(o, key, why); + if (v != .integer or v.integer <= 0 or v.integer > std.math.maxInt(u32)) { + why.set("config.json's {s} is not a positive whole number", .{key}); + return error.BadConfig; + } + return @intCast(v.integer); +} + +fn float(o: std.json.ObjectMap, key: []const u8, why: *Why) !f32 { + const v = try get(o, key, why); + const x: f64 = switch (v) { + .float => |f| f, + .integer => |i| @floatFromInt(i), + else => std.math.nan(f64), + }; + if (!std.math.isFinite(x) or x <= 0) { + why.set("config.json's {s} is not a positive number", .{key}); + return error.BadConfig; + } + return @floatCast(x); +} + +/// A key the engine runs one way only: absent keeps the default, any other value is refused by name. +fn fixed(o: std.json.ObjectMap, key: []const u8, want: bool, why: *Why) !void { + const v = o.get(key) orelse return; + if (v == .bool and v.bool == want) return; + why.set("{s} must be {s}: the engine runs no other layout", .{ key, if (want) "true" else "false" }); + return error.Unsupported; +} + +fn text(o: std.json.ObjectMap, key: []const u8) ?[]const u8 { + const v = o.get(key) orelse return null; + return if (v == .string) v.string else null; +} + +fn heads(o: std.json.ObjectMap, prefix: []const u8, why: *Why) !Heads { + var kb: [24]u8 = undefined; + const q = try int(o, try std.fmt.bufPrint(&kb, "{s}num_attention_heads", .{prefix}), why); + const kv = try int(o, try std.fmt.bufPrint(&kb, "{s}num_key_value_heads", .{prefix}), why); + const dim = try int(o, try std.fmt.bufPrint(&kb, "{s}head_dim", .{prefix}), why); + if (q % kv != 0) { + why.set("{d} query heads do not split over {d} key/value heads", .{ q, kv }); + return error.Layout; + } + return .{ .q = q, .kv = kv, .dim = dim }; +} + +/// local_layer_ids must list exactly the layers the reference's every-sixth rule leaves sliding. +fn layerTypes(o: std.json.ObjectMap, layers: u32, why: *Why) !void { + const v = try get(o, "local_layer_ids", why); + var want: u32 = 0; + for (0..layers) |i| want += @intFromBool(!isGlobal(@intCast(i))); + var seen: [max_layers]bool = @splat(false); + if (v != .array or v.array.items.len != want) { + why.set("local_layer_ids must list the {d} sliding layers (every {d}th layer is global)", .{ want, global_every }); + return error.Layout; + } + for (v.array.items) |e| { + const ok = e == .integer and e.integer >= 0 and e.integer < layers and !isGlobal(@intCast(e.integer)); + if (!ok or seen[@intCast(e.integer)]) { + why.set("local_layer_ids names a global, repeated or missing layer: the engine runs the every-{d}th-global layout", .{global_every}); + return error.Layout; + } + seen[@intCast(e.integer)] = true; + } +} + +fn parseText(o: std.json.ObjectMap, why: *Why) !Text { + var t: Text = undefined; + t.hidden = try int(o, "hidden_size", why); + t.layers = try int(o, "num_hidden_layers", why); + t.vocab = try int(o, "vocab_size", why); + t.unpadded_vocab = try int(o, "unpadded_vocab_size", why); + t.global = try heads(o, "", why); + t.local = try heads(o, "swa_", why); + t.window = try int(o, "sliding_window_size", why); + t.d_rel = try int(o, "d_rel", why); + t.rel_extent = try int(o, "rel_extent", why); + t.log_floor = try int(o, "log_scaling_n_floor", why); + t.log_alpha = try float(o, "log_scaling_alpha", why); + t.eps = try float(o, "rms_norm_eps", why); + t.qk_clip = try float(o, "qk_l2_clip_threshold", why); + t.rel_clip = try float(o, "rel_l2_clip_threshold", why); + t.block = try int(o, "n_layers_per_attn_res_block", why); + t.experts = try int(o, "n_routed_experts", why); + t.topk = try int(o, "num_experts_per_tok", why); + t.expert_inter = try int(o, "intermediate_size", why); + t.route_scale = try float(o, "route_scale", why); + t.gate_cap = try float(o, "mlp_gate_softcap", why); + t.up_cap = try float(o, "mlp_up_softcap", why); + t.logit_cap = try float(o, "final_logit_softcapping", why); + t.max_context = try int(o, "model_max_length", why); + if (t.layers > max_layers) { + why.set("{d} layers: the plan tables hold {d}", .{ t.layers, max_layers }); + return error.Layout; + } + if (t.block > t.layers) { + why.set("n_layers_per_attn_res_block {d} is past num_hidden_layers {d}", .{ t.block, t.layers }); + return error.Layout; + } + if (try int(o, "sconv_kernel_size", why) != conv_taps) { + why.set("sconv_kernel_size must be {d}: the checkpoint's published short convolutions", .{conv_taps}); + return error.Unsupported; + } + if (t.unpadded_vocab > t.vocab) { + why.set("unpadded_vocab_size {d} is past vocab_size {d}", .{ t.unpadded_vocab, t.vocab }); + return error.Layout; + } + if (t.topk > t.experts) { + why.set("num_experts_per_tok {d} is past n_routed_experts {d}", .{ t.topk, t.experts }); + return error.Layout; + } + if (t.hidden % 32 != 0) { + why.set("hidden_size {d} is not a multiple of 32, the quantized experts' group size", .{t.hidden}); + return error.Layout; + } + if (t.expert_inter % 32 != 0) { + why.set("intermediate_size {d} is not a multiple of 32, the quantized experts' group size", .{t.expert_inter}); + return error.Layout; + } + if (o.get("n_shared_experts")) |n| if (n != .integer or n.integer != 0) { + why.set("n_shared_experts must be 0: Inkling 2 has routed experts only", .{}); + return error.Unsupported; + }; + try fixed(o, "q_bias", false, why); + try fixed(o, "o_bias", false, why); + try fixed(o, "pre_norm_pre_affine", false, why); + try fixed(o, "final_norm_pre_affine", false, why); + try fixed(o, "use_value_norm_no_gamma", true, why); + try fixed(o, "use_gate_bias", true, why); + try fixed(o, "tie_word_embeddings", false, why); + if (text(o, "scoring_func")) |s| if (!std.mem.eql(u8, s, "sigmoid")) { + why.set("scoring_func must be \"sigmoid\"", .{}); + return error.Unsupported; + }; + try layerTypes(o, t.layers, why); + return t; +} + +fn parseVision(o: std.json.ObjectMap, text_hidden: u32, why: *Why) !Vision { + var v: Vision = undefined; + v.hidden = try int(o, "hidden_size", why); + v.layers = try int(o, "num_hidden_layers", why); + v.heads = try int(o, "num_attention_heads", why); + v.patch = try int(o, "native_patch_size", why); + v.merge = try int(o, "adapter_merge_size", why); + v.grid = try int(o, "posemb_grid_size", why); + v.proj_hidden = try int(o, "projection_hidden_dim", why); + v.text_hidden = if (o.get("text_hidden_size") != null) try int(o, "text_hidden_size", why) else text_hidden; + const ratio = try float(o, "mlp_ratio", why); + if (ratio != @floor(ratio) or ratio > 1024 or v.hidden % v.heads != 0 or v.text_hidden != text_hidden) { + why.set("vision_config: a whole mlp_ratio of at most 1024, heads that divide the width and text_hidden_size equal to hidden_size", .{}); + return error.Layout; + } + v.mlp_ratio = @intFromFloat(ratio); + try fixed(o, "projector_bias", false, why); + return v; +} + +fn parseMtp(o: std.json.ObjectMap, t: *const Text, why: *Why) !Mtp { + var m = std.mem.zeroes(Mtp); + m.layers = try int(o, "num_hidden_layers", why); + m.q_heads = try int(o, "num_attention_heads", why); + m.kv_heads = try int(o, "num_key_value_heads", why); + m.head_dim = try int(o, "head_dim", why); + m.inter = try int(o, "intermediate_size", why); + m.rope_theta = try float(o, "rope_theta", why); + m.window = try int(o, "sliding_window_size", why); + m.block = try int(o, "block_size", why); + m.rank = try int(o, "markov_rank", why); + const ids = try get(o, "local_layer_ids", why); + const taps = try get(o, "target_layer_ids", why); + const bad = m.layers > m.local.len or m.q_heads % m.kv_heads != 0 or ids != .array or taps != .array or + taps.array.items.len == 0 or taps.array.items.len > m.taps.len or try int(o, "hidden_size", why) != t.hidden; + if (bad or !std.mem.eql(u8, text(o, "markov_head_type") orelse "", "rnn_hidden")) { + why.set("mtp_config: a draft head of the backbone's width, with rnn_hidden Markov head and listed layers", .{}); + return error.Layout; + } + for (ids.array.items) |e| { + if (e != .integer or e.integer < 0 or e.integer >= m.layers) { + why.set("mtp_config's local_layer_ids names a layer the head does not have", .{}); + return error.Layout; + } + m.local[@intCast(e.integer)] = true; + } + for (taps.array.items) |e| { + if (e != .integer or e.integer < 0 or e.integer > t.layers) { + why.set("mtp_config's target_layer_ids names a layer the backbone does not have", .{}); + return error.Layout; + } + m.taps[m.taps_n] = @intCast(e.integer); + m.taps_n += 1; + } + return m; +} + +/// A quantization_config in config.json must be ModelOpt NVFP4, which the experts' header dtype refines per layer. +fn quantization(o: std.json.ObjectMap, why: *Why) !void { + const v = o.get("quantization_config") orelse return; + const q = if (v == .object) v.object else { + why.set("quantization_config is not an object", .{}); + return error.Quant; + }; + const ok = std.ascii.eqlIgnoreCase(text(q, "quant_method") orelse "", "modelopt") and + std.ascii.eqlIgnoreCase(text(q, "quant_algo") orelse "", "NVFP4"); + if (!ok) { + why.set("quantization_config: the loader reads ModelOpt NVFP4 experts (MXFP8 layers follow from their tensors)", .{}); + return error.Quant; + } +} + +/// config.json as the reference (configuration_inkling2.py) and the checkpoint read it; a refusal is in `why`. +pub fn parse(gpa: std.mem.Allocator, json: []const u8, why: *Why) !Config { + const parsed = std.json.parseFromSlice(std.json.Value, gpa, json, .{}) catch { + why.set("config.json is not JSON", .{}); + return error.BadConfig; + }; + defer parsed.deinit(); + if (parsed.value != .object) { + why.set("config.json is not an object", .{}); + return error.BadConfig; + } + const o = parsed.value.object; + const arch = o.get("architectures"); + const ok = arch != null and arch.? == .array and arch.?.array.items.len == 1 and arch.?.array.items[0] == .string and + std.mem.eql(u8, arch.?.array.items[0].string, "Inkling2ForConditionalGeneration"); + if (!ok or !std.mem.eql(u8, text(o, "model_type") orelse "", "inkling2")) { + why.set("not an Inkling 2 checkpoint: architectures Inkling2ForConditionalGeneration, model_type inkling2", .{}); + return error.NotInkling2; + } + try fixed(o, "tie_word_embeddings", false, why); + try quantization(o, why); + const t = try parseText(try object(o, "text_config", why), why); + const eos = try int(o, "eos_token_id", why); + if (eos >= t.vocab) { + why.set("eos_token_id is not a token of the {d}-token vocabulary", .{t.vocab}); + return error.BadConfig; + } + const mtp = if (o.get("mtp_config") != null) try parseMtp(try object(o, "mtp_config", why), &t, why) else null; + const image = if (o.get("image_token_id") != null) try int(o, "image_token_id", why) else default_image_token; + return .{ + .text = t, + .vision = try parseVision(try object(o, "vision_config", why), t.hidden, why), + .mtp = mtp, + .eos = eos, + .image_token = image, + }; +} diff --git a/zig/src/families/inkling2/config_test.zig b/zig/src/families/inkling2/config_test.zig new file mode 100644 index 00000000000..3d24d543b66 --- /dev/null +++ b/zig/src/families/inkling2/config_test.zig @@ -0,0 +1,123 @@ +//! Config parsing: the real checkpoint's config.json, the tiny-random one, and what parse refuses. +const std = @import("std"); +const config = @import("config.zig"); + +const t = std.testing; +pub const real = @embedFile("fixtures/config.json"); +pub const tiny = @embedFile("fixtures/tiny_config.json"); + +fn refused(json: []const u8, from: []const u8, to: []const u8, want: anyerror, says: []const u8) !void { + if (std.mem.count(u8, json, from) != 1) return error.EditAnchor; + const edited = try std.mem.replaceOwned(u8, t.allocator, json, from, to); + defer t.allocator.free(edited); + var why: config.Why = .{}; + try t.expectError(want, config.parse(t.allocator, edited, &why)); + try t.expect(std.mem.indexOf(u8, why.text(), says) != null); +} + +test "Inkling 2 Small's config.json parses: 48 layers, 8 global, 384 experts, 8 per token" { + var why: config.Why = .{}; + const c = try config.parse(t.allocator, real, &why); + try t.expectEqual(@as(u32, 4608), c.text.hidden); + try t.expectEqual(@as(u32, 48), c.text.layers); + try t.expectEqual(@as(u32, 201024), c.text.vocab); + try t.expectEqual(@as(u32, 200058), c.text.unpadded_vocab); + try t.expectEqual(config.Heads{ .q = 48, .kv = 8, .dim = 128 }, c.text.global); + try t.expectEqual(config.Heads{ .q = 48, .kv = 8, .dim = 128 }, c.text.local); + try t.expectEqual(@as(u32, 1024), c.text.window); + try t.expectEqual(@as(u32, 16), c.text.d_rel); + try t.expectEqual(@as(u32, 6), c.text.block); + try t.expectEqual(@as(u32, 384), c.text.experts); + try t.expectEqual(@as(u32, 8), c.text.topk); + try t.expectEqual(@as(u32, 2304), c.text.expert_inter); + try t.expectEqual(@as(f32, 8), c.text.route_scale); + try t.expectEqual(@as(f32, 30), c.text.logit_cap); + try t.expectEqual(@as(u32, 200006), c.eos); + try t.expectEqual(@as(u32, 200054), c.image_token); + var global: u32 = 0; + for (0..c.text.layers) |i| global += @intFromBool(config.isGlobal(@intCast(i))); + try t.expectEqual(@as(u32, 8), global); + try t.expectEqual(@as(u32, 23), c.vision.layers); + try t.expectEqual(@as(u32, 1024), c.vision.hidden); + const m = c.mtp.?; + try t.expectEqual(@as(u32, 5), m.layers); + try t.expectEqual(@as(u32, 256), m.rank); + try t.expectEqualSlices(u32, &.{ 5, 11, 17, 23, 29, 35, 41, 48 }, m.taps[0..m.taps_n]); + try t.expectEqualSlices(bool, &.{ true, true, false, true, true }, m.local[0..5]); +} + +test "tiny-random's config.json parses: 12 layers, 96 experts, width 128, no quantization_config" { + var why: config.Why = .{}; + const c = try config.parse(t.allocator, tiny, &why); + try t.expectEqual(@as(u32, 128), c.text.hidden); + try t.expectEqual(@as(u32, 12), c.text.layers); + try t.expectEqual(@as(u32, 96), c.text.experts); + try t.expectEqual(@as(u32, 4), c.vision.layers); + try t.expectEqualSlices(u32, &.{ 5, 12 }, c.mtp.?.taps[0..c.mtp.?.taps_n]); + try t.expectEqual(@as(u32, 1024), c.text.extent(0)); + try t.expectEqual(@as(u32, 1024), c.text.extent(5)); +} + +test "a config that is not Inkling 2 is refused by name" { + try refused(tiny, "\"model_type\": \"inkling2\"", "\"model_type\": \"llama\"", error.NotInkling2, "not an Inkling 2 checkpoint"); + try refused(tiny, "Inkling2ForConditionalGeneration", "Inkling2ForCausalLM", error.NotInkling2, "not an Inkling 2 checkpoint"); +} + +test "layouts the engine does not run are refused with the key that differs" { + try refused(tiny, "\"rel_extent\": 1024,\n \"q_bias\": false", "\"rel_extent\": 1024,\n \"q_bias\": true", error.Unsupported, "q_bias must be false"); + try refused(tiny, "\"use_value_norm_no_gamma\": true", "\"use_value_norm_no_gamma\": false", error.Unsupported, "use_value_norm_no_gamma must be true"); + try refused(tiny, "\"n_shared_experts\": 0", "\"n_shared_experts\": 1", error.Unsupported, "n_shared_experts must be 0"); + try refused(tiny, "\"sconv_kernel_size\": 4", "\"sconv_kernel_size\": 3", error.Unsupported, "sconv_kernel_size must be 4"); + try refused(tiny, "\"use_gate_bias\": true,\n \"tie_word_embeddings\": false", "\"use_gate_bias\": true,\n \"tie_word_embeddings\": true", error.Unsupported, "tie_word_embeddings"); +} + +test "a layer list that is not every sixth layer global is refused, and a missing key is named" { + try refused(tiny, "4,\n 6,", "4,\n 5,", error.Layout, "global, repeated or missing layer"); + try refused(real, "\"n_layers_per_attn_res_block\":", "\"n_layers_per_block\":", error.BadConfig, "n_layers_per_attn_res_block"); +} + +test "geometry the experts cannot hold and a non-NVFP4 quantization are refused, each by its key" { + try refused(tiny, "\"hidden_size\": 128,\n \"num_hidden_layers\": 12", "\"hidden_size\": 100,\n \"num_hidden_layers\": 12", error.Layout, "hidden_size 100 is not a multiple of 32"); + try refused(tiny, "\"intermediate_size\": 128,\n \"mlp_gate_softcap\"", "\"intermediate_size\": 100,\n \"mlp_gate_softcap\"", error.Layout, "intermediate_size 100 is not a multiple of 32"); + try refused(tiny, "\"num_experts_per_tok\": 8", "\"num_experts_per_tok\": 97", error.Layout, "num_experts_per_tok 97 is past n_routed_experts 96"); + try refused(tiny, "\"unpadded_vocab_size\": 200058", "\"unpadded_vocab_size\": 201025", error.Layout, "unpadded_vocab_size 201025 is past vocab_size 201024"); + try refused(tiny, "\"num_attention_heads\": 8,\n \"num_key_value_heads\": 4,\n \"head_dim\": 128,\n \"d_rel\"", "\"num_attention_heads\": 9,\n \"num_key_value_heads\": 4,\n \"head_dim\": 128,\n \"d_rel\"", error.Layout, "do not split"); + try refused(real, "\"quant_algo\": \"NVFP4\"", "\"quant_algo\": \"FP8\"", error.Quant, "ModelOpt NVFP4"); + try refused(tiny, "\"eos_token_id\": 200006", "\"eos_token_id\": 300000", error.BadConfig, "eos_token_id"); +} + +test "a config without a vision tower is refused rather than read as text only" { + try refused(tiny, "\"vision_config\"", "\"vision_cfg\"", error.BadConfig, "vision_config"); +} + +test "the draft head is refused by key when it is not the one the engine runs" { + try refused(tiny, "\"markov_head_type\": \"rnn_hidden\"", "\"markov_head_type\": \"gru\"", error.Layout, "rnn_hidden Markov head"); + try refused(tiny, "\"hidden_size\": 128,\n \"num_hidden_layers\": 5", "\"hidden_size\": 64,\n \"num_hidden_layers\": 5", error.Layout, "the backbone's width"); + try refused(tiny, " 3,\n 4\n ],\n \"sliding_window_size\"", " 3,\n 9\n ],\n \"sliding_window_size\"", error.Layout, "names a layer the head does not have"); + try refused(tiny, " 5,\n 12\n ]", " 5,\n 13\n ]", error.Layout, "names a layer the backbone does not have"); +} + +test "the vision tower is refused by key when it is not the one the engine reads" { + try refused(tiny, "\"projector_bias\": false", "\"projector_bias\": true", error.Unsupported, "projector_bias must be false"); + try refused(tiny, "\"mlp_ratio\": 4.0", "\"mlp_ratio\": 4.5", error.Layout, "whole mlp_ratio"); + try refused(tiny, "\"num_attention_heads\": 4,\n \"mlp_ratio\"", "\"num_attention_heads\": 5,\n \"mlp_ratio\"", error.Layout, "heads that divide the width"); + try refused(tiny, "\"text_hidden_size\": 128", "\"text_hidden_size\": 256", error.Layout, "text_hidden_size equal to hidden_size"); +} + +test "an mlp_ratio past 1024 is refused instead of overflowing, as is a block longer than the model" { + try refused(tiny, "\"mlp_ratio\": 4.0", "\"mlp_ratio\": 1e30", error.Layout, "at most 1024"); + try refused(tiny, "\"mlp_ratio\": 4.0", "\"mlp_ratio\": 1e39", error.Layout, "at most 1024"); + try refused(tiny, "\"n_layers_per_attn_res_block\": 6", "\"n_layers_per_attn_res_block\": 13", error.Layout, "is past num_hidden_layers"); + try refused(tiny, "\"n_layers_per_attn_res_block\": 6", "\"n_layers_per_attn_res_block\": 4294967295", error.Layout, "is past num_hidden_layers"); +} + +test "a scoring function, a layer count, a quantization_config and a root that the engine cannot read are refused" { + try refused(tiny, "\"use_gate_bias\": true,\n \"tie_word_embeddings\"", "\"use_gate_bias\": true,\n \"scoring_func\": \"softmax\",\n \"tie_word_embeddings\"", error.Unsupported, "scoring_func must be"); + try refused(tiny, "\"hidden_size\": 128,\n \"num_hidden_layers\": 12", "\"hidden_size\": 128,\n \"num_hidden_layers\": 129", error.Layout, "129 layers: the plan tables hold 128"); + try refused(tiny, "\"model_type\": \"inkling2\",", "\"model_type\": \"inkling2\",\n \"quantization_config\": 5,", error.Quant, "quantization_config is not an object"); + var why: config.Why = .{}; + try t.expectError(error.BadConfig, config.parse(t.allocator, "[]", &why)); + try t.expectEqualStrings("config.json is not an object", why.text()); + try t.expectError(error.BadConfig, config.parse(t.allocator, "{", &why)); + try t.expectEqualStrings("config.json is not JSON", why.text()); +} diff --git a/zig/src/families/inkling2/fixtures/chat_template.jinja b/zig/src/families/inkling2/fixtures/chat_template.jinja new file mode 100644 index 00000000000..85258f99eca --- /dev/null +++ b/zig/src/families/inkling2/fixtures/chat_template.jinja @@ -0,0 +1,130 @@ +{%- set effort_map = {"none": 0.0, "minimal": 0.1, "low": 0.2, "medium": 0.7, "high": 0.9, "xhigh": 0.99, "max": 0.99} -%} +{%- set role_token = {"user": "<|message_user|>", "assistant": "<|message_model|>", "system": "<|message_system|>", "tool": "<|message_tool|>"} -%} + +{%- macro emit_thinking_effort() -%} + {%- set eff = reasoning_effort if reasoning_effort is defined and reasoning_effort is not none else 0.9 -%} + {%- if eff is string -%} + {%- set key = eff | trim -%} + {%- if key not in effort_map -%} + {{- raise_exception("Unknown reasoning_effort: " ~ eff) -}} + {%- endif -%} + {%- set num = effort_map[key] -%} + {%- else -%} + {%- set num = eff | float -%} + {%- endif -%} + {%- if num < 0.0 or num > 0.99 -%} + {{- raise_exception("reasoning_effort must be in [0.0, 0.99]") -}} + {%- endif -%} + {{- "<|message_system|><|content_text|>Thinking effort level: " -}} + {%- if num == 0.0 -%}0{%- else -%}{{ num }}{%- endif -%} + {{- "<|end_message|>" -}} +{%- endmacro -%} + +{%- if tools -%} + {%- set tool_state = namespace(specs=[]) -%} + {%- for tool in tools -%} + {%- set fn = tool.function if tool.function is defined else tool -%} + {%- set spec = { + "description": (fn.description if fn.description is defined and fn.description else ""), + "name": fn.name, + "parameters": (fn.parameters if fn.parameters is defined and fn.parameters else {}), + "type": (tool.type if tool.type is defined and tool.type else "function"), + } -%} + {%- set tool_state.specs = tool_state.specs + [spec] -%} + {%- endfor -%} + {{- "<|message_system|>tool_declare<|content_xml|>" -}} + {{- tool_state.specs | tojson(sort_keys=true, separators=(",", ":")) -}} + {{- "<|end_message|>" -}} +{%- endif -%} + +{%- set state = namespace(effort_emitted=false) -%} +{%- for message in messages -%} + {%- if message.role not in role_token -%} + {{- raise_exception("Unknown message role: " ~ message.role) -}} + {%- endif -%} + {%- if not state.effort_emitted and message.role != "system" -%} + {{- emit_thinking_effort() -}} + {%- set state.effort_emitted = true -%} + {%- endif -%} + + {%- set header = namespace(text=role_token[message.role]) -%} + {%- if message.role == "tool" -%} + {%- if message.name is defined and message.name -%} + {%- set header.text = header.text ~ message.name -%} + {%- elif message.tool_call_id is defined and message.tool_call_id -%} + {%- for prev in messages -%} + {%- if prev.role == "assistant" and prev.tool_calls -%} + {%- for tc in prev.tool_calls -%} + {%- if tc.id is defined and tc.id == message.tool_call_id and tc.function.name is defined -%} + {%- set header.text = header.text ~ tc.function.name -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + {%- elif message.role == "assistant" and message.name is defined and message.name -%} + {%- set header.text = header.text ~ message.name -%} + {%- endif -%} + {%- set rtok = header.text -%} + + {%- if message.role == "assistant" and message.reasoning_content is defined and message.reasoning_content -%} + {{- rtok ~ "<|content_thinking|>" ~ message.reasoning_content ~ "<|end_message|>" -}} + {%- endif -%} + + {%- if message.content is string and (message.content or not (message.role == "assistant" and (message.tool_calls or message.reasoning_content))) -%} + {{- rtok ~ "<|content_text|>" ~ message.content ~ "<|end_message|>" -}} + {%- elif message.content -%} + {%- for part in message.content -%} + {%- if part is string -%} + {{- rtok ~ "<|content_text|>" ~ part ~ "<|end_message|>" -}} + {%- elif part.type is not defined or part.type in ("text", "input_text") -%} + {%- set text_part = (part.text if part.text is defined and part.text is string else "") -%} + {{- rtok ~ "<|content_text|>" ~ text_part ~ "<|end_message|>" -}} + {%- elif part.type in ("image", "input_image", "image_url") -%} + {%- if message.role not in ("user", "tool") -%} + {{- raise_exception("Image content is only supported for user and tool messages") -}} + {%- endif -%} + {{- rtok ~ "<|content_image|><|unused_200054|><|end_message|>" -}} + {%- elif part.type in ("audio", "input_audio", "audio_url") -%} + {{- raise_exception("Inkling 2 does not accept audio input") -}} + {%- else -%} + {{- raise_exception("Unsupported content part type: " ~ part.type) -}} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + + {%- if message.role == "assistant" and message.tool_calls -%} + {%- for tc in message.tool_calls -%} + {%- set fn = tc.function -%} + {%- if fn.name is not defined or fn.name is not string -%} + {{- raise_exception("tool call function name must be a string") -}} + {%- endif -%} + {%- if message.name is defined and message.name and message.name != fn.name -%} + {{- raise_exception("assistant name " ~ message.name ~ " does not match its tool call " ~ fn.name) -}} + {%- endif -%} + {%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%} + {%- if args is string -%} + {{- raise_exception("tool call arguments must be a parsed object, not a JSON string; canonicalize upstream") -}} + {%- endif -%} + {%- if args is not mapping -%} + {{- raise_exception("tool call arguments must be an object") -}} + {%- endif -%} + {{- "<|message_model|>" ~ fn.name ~ "<|content_invoke_tool_json|>" -}} + {{- '{"name":' ~ (fn.name | tojson(sort_keys=true, separators=(",", ":"))) ~ ',"args":' -}} + {{- "{" -}} + {%- for key, value in args | dictsort(case_sensitive=true) -%} + {{- (key | tojson) ~ ":" ~ (value | tojson(separators=(",", ":"))) -}} + {%- if not loop.last -%},{%- endif -%} + {%- endfor -%} + {{- "}}<|end_message|>" -}} + {%- endfor -%} + {%- endif -%} + + {%- if message.role == "assistant" -%} + {{- "<|content_model_end_sampling|>" -}} + {%- endif -%} +{%- endfor -%} + +{%- if not state.effort_emitted -%} + {{- emit_thinking_effort() -}} +{%- endif -%} diff --git a/zig/src/families/inkling2/fixtures/config.json b/zig/src/families/inkling2/fixtures/config.json new file mode 100644 index 00000000000..4792cdd780a --- /dev/null +++ b/zig/src/families/inkling2/fixtures/config.json @@ -0,0 +1,139 @@ +{ + "architectures": [ + "Inkling2ForConditionalGeneration" + ], + "model_type": "inkling2", + "eos_token_id": 200006, + "text_config": { + "model_max_length": 1048576, + "torch_dtype": "bfloat16", + "hidden_size": 4608, + "num_hidden_layers": 48, + "vocab_size": 201024, + "num_attention_heads": 48, + "num_key_value_heads": 8, + "head_dim": 128, + "d_rel": 16, + "rel_extent": 1024, + "q_bias": false, + "o_bias": false, + "log_scaling_n_floor": 128000, + "log_scaling_alpha": 0.1, + "rms_norm_eps": 1e-06, + "pre_norm_pre_affine": false, + "final_norm_pre_affine": false, + "use_value_norm_no_gamma": true, + "qk_l2_clip_threshold": 22.627416997969522, + "rel_l2_clip_threshold": 8.0, + "local_layer_ids": [ + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8, + 9, + 10, + 12, + 13, + 14, + 15, + 16, + 18, + 19, + 20, + 21, + 22, + 24, + 25, + 26, + 27, + 28, + 30, + 31, + 32, + 33, + 34, + 36, + 37, + 38, + 39, + 40, + 42, + 43, + 44, + 45, + 46 + ], + "sconv_kernel_size": 4, + "unpadded_vocab_size": 200058, + "final_logit_softcapping": 30.0, + "swa_head_dim": 128, + "swa_num_attention_heads": 48, + "swa_num_key_value_heads": 8, + "sliding_window_size": 1024, + "n_layers_per_attn_res_block": 6, + "attn_res_normalize_values": true, + "n_routed_experts": 384, + "num_experts_per_tok": 8, + "n_shared_experts": 0, + "intermediate_size": 2304, + "mlp_gate_softcap": 4.0, + "mlp_up_softcap": 25.0, + "route_scale": 8.0, + "use_gate_bias": true + }, + "vision_config": { + "temporal_patch_size": 2, + "native_patch_size": 20, + "adapter_merge_size": 2, + "projection_hidden_dim": 4096, + "projector_bias": false, + "hidden_size": 1024, + "num_hidden_layers": 23, + "num_attention_heads": 16, + "mlp_ratio": 4.0, + "posemb_grid_size": 32, + "layer_norm_eps": 1e-05 + }, + "mtp_config": { + "hidden_size": 4608, + "num_hidden_layers": 5, + "num_attention_heads": 48, + "num_key_value_heads": 8, + "head_dim": 128, + "intermediate_size": 18432, + "max_position_embeddings": 1048576, + "torch_dtype": "bfloat16", + "q_bias": false, + "o_bias": false, + "rms_norm_eps": 1e-06, + "rope_theta": 1000000.0, + "local_layer_ids": [ + 0, + 1, + 3, + 4 + ], + "sliding_window_size": 1024, + "block_size": 8, + "markov_rank": 256, + "markov_head_type": "rnn_hidden", + "target_layer_ids": [ + 5, + 11, + 17, + 23, + 29, + 35, + 41, + 48 + ] + }, + "quantization_config": { + "quant_method": "modelopt", + "quant_algo": "NVFP4" + } +} diff --git a/zig/src/families/inkling2/fixtures/mini_cases.json b/zig/src/families/inkling2/fixtures/mini_cases.json new file mode 100644 index 00000000000..e612f60e0f2 --- /dev/null +++ b/zig/src/families/inkling2/fixtures/mini_cases.json @@ -0,0 +1,75 @@ +{ + "reference": "tokenizers 0.23.3 on mini_tokenizer.json (the checkpoint's tokenizer.json cut to its added tokens, its byte alphabet and the first 1500 merges)", + "cases": [ + { + "text": "Hello, I'll go 12345 times!", + "ids": [39, 789, 296, 11, 220, 40, 6, 359, 220, 850, 220, 16, 17, 18, 19, 20, 220, 848, 82, 0], + "decoded": "Hello, I'll go 12345 times!" + }, + { + "text": "I'LL DON'T it's we've", + "ids": [40, 6, 43, 43, 220, 35, 46, 45, 6, 51, 220, 271, 6, 82, 220, 363, 6, 290], + "decoded": "I'LL DON'T it's we've" + }, + { + "text": "Café naïve — 你好 🌍 ñandú", + "ids": [34, 1124, 127, 102, 220, 77, 64, 127, 107, 290, 220, 718, 242, 220, 486, 254, 733, 121, 220, 172, 253, 234, 235, 220, 127, 109, 276, 127, 118], + "decoded": "Café naïve — 你好 🌍 ñandú" + }, + { + "text": "def f(x):\n return x**2 # square\n\n\tprint(f(3))\n", + "ids": [281, 69, 220, 69, 7, 87, 8, 25, 198, 220, 220, 220, 220, 261, 896, 220, 87, 9, 9, 17, 220, 220, 2, 220, 82, 369, 346, 198, 198, 197, 1160, 7, 69, 7, 18, 8, 8, 198], + "decoded": "def f(x):\n return x**2 # square\n\n\tprint(f(3))\n" + }, + { + "text": " two spaces and trailing ", + "ids": [220, 220, 83, 1052, 220, 220, 694, 282, 590, 220, 220, 276, 220, 874, 291, 279, 220, 220], + "decoded": " two spaces and trailing " + }, + { + "text": "a\r\nb\n\n\nc", + "ids": [64, 201, 198, 65, 198, 198, 198, 66], + "decoded": "a\r\nb\n\n\nc" + }, + { + "text": "1234567890", + "ids": [16, 17, 18, 19, 20, 21, 22, 23, 24, 15], + "decoded": "1234567890" + }, + { + "text": "CamelCaseWord ÀÉÎ Dž", + "ids": [34, 666, 75, 34, 693, 54, 846, 220, 127, 222, 127, 231, 127, 236, 220, 131, 227], + "decoded": "CamelCaseWord ÀÉÎ Dž" + }, + { + "text": "xxxxxxxxxxxxxxxxxxxx", + "ids": [87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87], + "decoded": "xxxxxxxxxxxxxxxxxxxx" + }, + { + "text": "<|message_user|><|content_text|>hi<|end_message|>", + "ids": [1514, 1518, 71, 72, 1524], + "decoded": "<|message_user|><|content_text|>hi<|end_message|>" + }, + { + "text": "é combining dž", + "ids": [68, 136, 223, 220, 376, 65, 256, 279, 220, 131, 228], + "decoded": "é combining dž" + }, + { + "text": "...!!!???///\n", + "ids": [13, 13, 13, 0, 0, 0, 30, 30, 30, 14, 14, 14, 198], + "decoded": "...!!!???///\n" + }, + { + "text": "word's 'quoted' text", + "ids": [786, 67, 6, 82, 220, 6, 369, 78, 300, 67, 6, 220, 911], + "decoded": "word's 'quoted' text" + }, + { + "text": "", + "ids": [], + "decoded": "" + } + ] +} diff --git a/zig/src/families/inkling2/fixtures/mini_tokenizer.json b/zig/src/families/inkling2/fixtures/mini_tokenizer.json new file mode 100644 index 00000000000..b0794c25a2a --- /dev/null +++ b/zig/src/families/inkling2/fixtures/mini_tokenizer.json @@ -0,0 +1 @@ +{"version":"1.0","truncation":null,"padding":null,"added_tokens":[{"id":199998,"content":"<|unused|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":199999,"content":"<|endoftext|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200000,"content":"<|message_user|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200001,"content":"<|message_model|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200002,"content":"<|message_system|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200003,"content":"<|message_tool|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200004,"content":"<|content_text|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200005,"content":"<|content_image|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200006,"content":"<|content_model_end_sampling|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200007,"content":"<|unused_200007|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200008,"content":"<|content_thinking|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200009,"content":"<|unused_200009|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200010,"content":"<|end_message|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200011,"content":"<|unused_200011|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200012,"content":"<|unused_200012|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200013,"content":"<|unused_200013|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200014,"content":"<|unused_200014|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200015,"content":"<|unused_200015|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200016,"content":"<|unused_200016|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200017,"content":"<|unused_200017|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200018,"content":"<|unused_200018|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200019,"content":"<|unused_200019|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200020,"content":"<|unused_200020|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200021,"content":"<|unused_200021|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200022,"content":"<|content_tool_error|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200023,"content":"<|unused_200023|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200024,"content":"<|content_xml|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200025,"content":"<|unused_200025|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200026,"content":"<|unused_200026|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200027,"content":"<|unused_200027|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200028,"content":"<|begin_of_text|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200029,"content":"<|unused_200029|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200030,"content":"<|unused_200030|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200031,"content":"<|unused_200031|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200032,"content":"<|unused_200032|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200033,"content":"<|unused_200033|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200034,"content":"<|unused_200034|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200035,"content":"<|unused_200035|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200036,"content":"<|unused_200036|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200037,"content":"<|unused_200037|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200038,"content":"<|unused_200038|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200039,"content":"<|unused_200039|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200040,"content":"<|unused_200040|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200041,"content":"<|unused_200041|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200042,"content":"<|unused_200042|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200043,"content":"<|unused_200043|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200044,"content":"<|unused_200044|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200045,"content":"<|unused_200045|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200046,"content":"<|unused_200046|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200047,"content":"<|unused_200047|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200048,"content":"<|unused_200048|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200049,"content":"<|content_invoke_tool_json|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200050,"content":"<|unused_200050|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200051,"content":"<|unused_200051|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200052,"content":"<|unused_200052|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200053,"content":"<|unused_200053|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200054,"content":"<|unused_200054|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200055,"content":"<|unused_200055|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200056,"content":"<|unused_200056|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true},{"id":200057,"content":"<|content_invoke_tool_text|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false,"special":true}],"normalizer":null,"pre_tokenizer":{"type":"Sequence","pretokenizers":[{"type":"Split","pattern":{"Regex":"[^\\r\\n\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?i:'s|'t|'re|'ve|'m|'ll|'d)?|[^\\r\\n\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?i:'s|'t|'re|'ve|'m|'ll|'d)?|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+"},"behavior":"Isolated","invert":false},{"type":"ByteLevel","add_prefix_space":false,"trim_offsets":true,"use_regex":false}]},"post_processor":{"type":"ByteLevel","add_prefix_space":true,"trim_offsets":false,"use_regex":true},"decoder":{"type":"ByteLevel","add_prefix_space":true,"trim_offsets":true,"use_regex":true},"model":{"type":"BPE","dropout":null,"unk_token":null,"continuing_subword_prefix":null,"end_of_word_suffix":null,"fuse_unk":false,"byte_fallback":false,"ignore_merges":true,"vocab":{"!":0,"\"":1,"#":2,"$":3,"%":4,"&":5,"'":6,"(":7,")":8,"*":9,"+":10,",":11,"-":12,".":13,"/":14,"0":15,"1":16,"2":17,"3":18,"4":19,"5":20,"6":21,"7":22,"8":23,"9":24,":":25,";":26,"<":27,"=":28,">":29,"?":30,"@":31,"A":32,"B":33,"C":34,"D":35,"E":36,"F":37,"G":38,"H":39,"I":40,"J":41,"K":42,"L":43,"M":44,"N":45,"O":46,"P":47,"Q":48,"R":49,"S":50,"T":51,"U":52,"V":53,"W":54,"X":55,"Y":56,"Z":57,"[":58,"\\":59,"]":60,"^":61,"_":62,"`":63,"a":64,"b":65,"c":66,"d":67,"e":68,"f":69,"g":70,"h":71,"i":72,"j":73,"k":74,"l":75,"m":76,"n":77,"o":78,"p":79,"q":80,"r":81,"s":82,"t":83,"u":84,"v":85,"w":86,"x":87,"y":88,"z":89,"{":90,"|":91,"}":92,"~":93,"¡":94,"¢":95,"£":96,"¤":97,"¥":98,"¦":99,"§":100,"¨":101,"©":102,"ª":103,"«":104,"¬":105,"®":106,"¯":107,"°":108,"±":109,"²":110,"³":111,"´":112,"µ":113,"¶":114,"·":115,"¸":116,"¹":117,"º":118,"»":119,"¼":120,"½":121,"¾":122,"¿":123,"À":124,"Á":125,"Â":126,"Ã":127,"Ä":128,"Å":129,"Æ":130,"Ç":131,"È":132,"É":133,"Ê":134,"Ë":135,"Ì":136,"Í":137,"Î":138,"Ï":139,"Ð":140,"Ñ":141,"Ò":142,"Ó":143,"Ô":144,"Õ":145,"Ö":146,"×":147,"Ø":148,"Ù":149,"Ú":150,"Û":151,"Ü":152,"Ý":153,"Þ":154,"ß":155,"à":156,"á":157,"â":158,"ã":159,"ä":160,"å":161,"æ":162,"ç":163,"è":164,"é":165,"ê":166,"ë":167,"ì":168,"í":169,"î":170,"ï":171,"ð":172,"ñ":173,"ò":174,"ó":175,"ô":176,"õ":177,"ö":178,"÷":179,"ø":180,"ù":181,"ú":182,"û":183,"ü":184,"ý":185,"þ":186,"ÿ":187,"Ā":188,"ā":189,"Ă":190,"ă":191,"Ą":192,"ą":193,"Ć":194,"ć":195,"Ĉ":196,"ĉ":197,"Ċ":198,"ċ":199,"Č":200,"č":201,"Ď":202,"ď":203,"Đ":204,"đ":205,"Ē":206,"ē":207,"Ĕ":208,"ĕ":209,"Ė":210,"ė":211,"Ę":212,"ę":213,"Ě":214,"ě":215,"Ĝ":216,"ĝ":217,"Ğ":218,"ğ":219,"Ġ":220,"ġ":221,"Ģ":222,"ģ":223,"Ĥ":224,"ĥ":225,"Ħ":226,"ħ":227,"Ĩ":228,"ĩ":229,"Ī":230,"ī":231,"Ĭ":232,"ĭ":233,"Į":234,"į":235,"İ":236,"ı":237,"IJ":238,"ij":239,"Ĵ":240,"ĵ":241,"Ķ":242,"ķ":243,"ĸ":244,"Ĺ":245,"ĺ":246,"Ļ":247,"ļ":248,"Ľ":249,"ľ":250,"Ŀ":251,"ŀ":252,"Ł":253,"ł":254,"Ń":255,"in":256,"er":257,"th":258,"an":259,"on":260,"re":261,"en":262,"at":263,"or":264,"st":265,"al":266,"ar":267,"the":268,"le":269,"se":270,"it":271,"is":272,"ro":273,"ic":274,"ou":275,"and":276,"of":277,"to":278,"ing":279,"me":280,"de":281,"ac":282,"as":283,"ent":284,"ð¤":285,"ion":286,"ð¡":287,"ðł":288,"ch":289,"ve":290,"il":291,"ct":292,"ce":293,"ð¨":294,"co":295,"lo":296,"ge":297,"ð£":298,"ð¦":299,"te":300,"ig":301,"ed":302,"ãĤ":303,"su":304,"ra":305,"he":306,"for":307,"be":308,"ol":309,"ad":310,"un":311,"ãĥ":312,"id":313,"ss":314,"im":315,"no":316,"ur":317,"con":318,"ate":319,"am":320,"ð¢":321,"ut":322,"do":323,"ri":324,"pe":325,"ne":326,"pro":327,"ð¥":328,"ter":329,"ma":330,"ul":331,"ab":332,"ð§":333,"ver":334,"mo":335,"if":336,"pl":337,"per":338,"ue":339,"ir":340,"po":341,"ð¬":342,"ãģ":343,"ex":344,"ie":345,"are":346,"ke":347,"ð©":348,"ap":349,"us":350,"ht":351,"wh":352,"ay":353,"um":354,"ith":355,"tr":356,"ist":357,"ation":358,"ll":359,"sh":360,"ment":361,"art":362,"we":363,"so":364,"cl":365,"ine":366,"our":367,"In":368,"qu":369,"ort":370,"The":371,"ta":372,"all":373,"that":374,"age":375,"com":376,"act":377,"with":378,"di":379,"á¸":380,"á¹":381,"áº":382,"á»":383,"ere":384,"ure":385,"ly":386,"ãĢ":387,"ç»":388,"éĶ":389,"ï¼":390,"Re":391,"ill":392,"pt":393,"æı":394,"è¯":395,"è½":396,"em":397,"áĢ":398,"æ¶":399,"æ»":400,"æĭ":401,"è°":402,"èĿ":403,"é²":404,"é¸":405,"end":406,"int":407,"áĪ":408,"åĴ":409,"æ´":410,"æ·":411,"æ¼":412,"æŁ":413,"çİ":414,"çı":415,"çij":416,"è´":417,"èĭ":418,"é¨":419,"é¹":420,"éº":421,"éħ":422,"éĴ":423,"éĵ":424,"éķ":425,"å§":426,"å©":427,"å«":428,"åIJ":429,"åĹ":430,"æ¥":431,"æ²":432,"æµ":433,"ç¼":434,"ç½":435,"çIJ":436,"çĹ":437,"èµ":438,"è·":439,"è¸":440,"è¹":441,"èı":442,"èij":443,"èĶ":444,"èķ":445,"é¡":446,"é©":447,"é·":448,"é½":449,"éĭ":450,"éį":451,"ha":452,"à¤":453,"å¦":454,"åī":455,"åij":456,"åł":457,"æ°":458,"æ³":459,"æ¸":460,"æĥ":461,"æħ":462,"ç¹":463,"çº":464,"ç¿":465,"çĥ":466,"çħ":467,"çł":468,"è£":469,"è¬":470,"è¾":471,"è¿":472,"èį":473,"èİ":474,"èĸ":475,"é¥":476,"éª":477,"é¶":478,"é»":479,"éĦ":480,"éĨ":481,"pre":482,"ld":483,"ight":484,"à¸":485,"ä½":486,"å»":487,"æª":488,"æ¾":489,"æĻ":490,"ç¥":491,"ç¦":492,"ç´":493,"ç¶":494,"ç¸":495,"çģ":496,"çĭ":497,"çĺ":498,"è®":499,"èĢ":500,"èĪ":501,"èĬ":502,"èĹ":503,"èł":504,"é¢":505,"éİ":506,"ð«":507,"om":508,"ä¼":509,"ä¿":510,"åª":511,"åĪ":512,"åį":513,"åĶ":514,"åĸ":515,"åŀ":516,"æ£":517,"æ¦":518,"æ¨":519,"æī":520,"æĬ":521,"æİ":522,"æĿ":523,"æŀ":524,"ç£":525,"çª":526,"ç¯":527,"ç·":528,"ç¾":529,"çĴ":530,"çĶ":531,"è§":532,"è³":533,"èĥ":534,"èĵ":535,"èŀ":536,"èŁ":537,"é§":538,"éģ":539,"éĬ":540,"éĽ":541,"ple":542,"port":543,"out":544,"ä¸":545,"å¯":546,"å²":547,"å³":548,"å´":549,"å¹":550,"å½":551,"åĢ":552,"åĺ":553,"åĻ":554,"æº":555,"æ½":556,"æĤ":557,"æĪ":558,"æį":559,"æIJ":560,"æĺ":561,"æļ":562,"æł":563,"çĨ":564,"çī":565,"çĬ":566,"çĮ":567,"çį":568,"çŀ":569,"è¢":570,"è«":571,"è²":572,"è¼":573,"èĩ":574,"èĮ":575,"èIJ":576,"èļ":577,"èĽ":578,"éĥ":579,"éĮ":580,"éIJ":581,"éij":582,"éĺ":583,"éĻ":584,"éľ":585,"éŀ":586,"str":587,"fe":588,"ow":589,"es":590,"ä¾":591,"åº":592,"å¾":593,"åģ":594,"åĿ":595,"åŁ":596,"åŃ":597,"æ§":598,"æ¯":599,"æ±":600,"æ¹":601,"æ¿":602,"æĢ":603,"æĮ":604,"æij":605,"æĴ":606,"æĶ":607,"æĸ":608,"æľ":609,"çĢ":610,"çĻ":611,"èĦ":612,"èħ":613,"èī":614,"èĴ":615,"èĺ":616,"èľ":617,"èŃ":618,"é³":619,"éĩ":620,"éĪ":621,"éī":622,"éı":623,"éļ":624,"éŁ":625,"ant":626,"use":627,"et":628,"à°":629,"áŀ":630,"äº":631,"å£":632,"å¨":633,"å®":634,"å±":635,"å¸":636,"åĥ":637,"åı":638,"åĵ":639,"åķ":640,"åļ":641,"æ¢":642,"æ©":643,"æ®":644,"æģ":645,"æĵ":646,"ç©":647,"ç¬":648,"çµ":649,"çĩ":650,"çĸ":651,"çŃ":652,"è¤":653,"è¥":654,"èĻ":655,"é¤":656,"é¦":657,"é¬":658,"éµ":659,"éĸ":660,"éĹ":661,"éĿ":662,"éł":663,"by":664,"oun":665,"ame":666,"br":667,"àª":668,"à²":669,"à´":670,"å¡":671,"å¢":672,"å°":673,"å¼":674,"åħ":675,"åĩ":676,"æ¡":677,"æĩ":678,"æķ":679,"ç¢":680,"ç³":681,"çĪ":682,"çĽ":683,"çŁ":684,"è¡":685,"èº":686,"èĨ":687,"é£":688,"é«":689,"é¼":690,"éĢ":691,"éĤ":692,"ase":693,"sp":694,"à¬":695,"å¶":696,"åĤ":697,"åĦ":698,"æ¤":699,"æĦ":700,"æĨ":701,"ç¡":702,"ç°":703,"ç±":704,"ç²":705,"çĤ":706,"çĵ":707,"çľ":708,"çĿ":709,"èª":710,"è»":711,"ðª":712,"ass":713,"od":714,"rom":715,"ag":716,"áī":717,"âĢ":718,"ä»":719,"åĨ":720,"åĬ":721,"åľ":722,"æĹ":723,"æŃ":724,"ç¨":725,"ç®":726,"è©":727,"è¶":728,"one":729,"ata":730,"ci":731,"à¦":732,"å¥":733,"å¬":734,"åµ":735,"å¿":736,"åĭ":737,"åĮ":738,"çĦ":739,"çķ":740,"è±":741,"èĤ":742,"é°":743,"é±":744,"ive":745,"ti":746,"sup":747,"å·":748,"æ¬":749,"ç¤":750,"ç§":751,"è¦":752,"é´":753,"éŃ":754,"ice":755,"à¶":756,"å¤":757,"åİ":758,"åĽ":759,"æĽ":760,"up":761,"ther":762,"áĭ":763,"ç«":764,"è¨":765,"é¾":766,"ard":767,"ber":768,"áĮ":769,"èģ":770,"à¨":771,"áĬ":772,"âĪ":773,"çļ":774,"à½":775,"æ«":776,"é¯":777,"from":778,"ot":779,"form":780,"ile":781,"iz":782,"é®":783,"able":784,"ck":785,"wor":786,"ph":787,"du":788,"el":789,"ä¹":790,"this":791,"Th":792,"val":793,"ace":794,"àº":795,"sc":796,"man":797,"ub":798,"not":799,"li":800,"pr":801,"mar":802,"ack":803,"ance":804,"ust":805,"und":806,"fr":807,"ug":808,"ity":809,"à¥":810,"à®":811,"ach":812,"av":813,"ast":814,"bo":815,"ide":816,"áĥ":817,"low":818,"was":819,"ite":820,"ï©":821,"data":822,"ud":823,"can":824,"put":825,"fer":826,"St":827,"son":828,"ang":829,"set":830,"ser":831,"get":832,"âĦ":833,"gra":834,"ign":835,"âĤ":836,"ia":837,"op":838,"you":839,"fo":840,"tur":841,"log":842,"âģ":843,"ï½":844,"xt":845,"ord":846,"ìķ":847,"time":848,"ans":849,"go":850,"ould":851,"De":852,"ft":853,"wn":854,"ty":855,"ind":856,"à¾":857,"áŁ":858,"ê°":859,"ìŀ":860,"ich":861,"ence":862,"part":863,"Ch":864,"An":865,"je":866,"sy":867,"ob":868,"mat":869,"ìĹ":870,"est":871,"spe":872,"ok":873,"tra":874,"dis":875,"have":876,"que":877,"Con":878,"lect":879,"cre":880,"col":881,"áģ":882,"ê²":883,"ë§":884,"ë°":885,"ì§":886,"ain":887,"ial":888,"right":889,"inter":890,"la":891,"à§":892,"à©":893,"ëĤ":894,"ble":895,"turn":896,"ho":897,"ong":898,"cur":899,"ip":900,"à¹":901,"but":902,"gen":903,"ange":904,"cess":905,"àŃ":906,"ëĭ":907,"ìł":908,"line":909,"Pro":910,"text":911,"ear":912,"ree":913,"sa":914,"ick":915,"ire":916,"del":917,"ject":918,"pa":919,"à·":920,"âī":921,"ã»":922,"ë¹":923,"ì°":924,"ìĺ":925,"íĮ":926,"lt":927,"ize":928,"left":929,"name":930,"ish":931,"cell":932,"old":933,"ount":934,"à³":935,"áį":936,"âĺ":937,"ê¹":938,"ëĦ":939,"íķ":940,"ca":941,"down":942,"sel":943,"mon":944,"min":945,"au":946,"ary":947,"à«":948,"âĨ":949,"ëŀ":950,"ëł":951,"ìĽ":952,"íĥ":953,"ð¤¦":954,"ev":955,"iv":956,"work":957,"pos":958,"new":959,"gro":960,"frac":961,"which":962,"ff":963,"will":964,"test":965,"add":966,"class":967,"igh":968,"iew":969,"Se":970,"par":971,"âĬ":972,"âĻ":973,"ë²":974,"ìĥ":975,"ict":976,"ry":977,"now":978,"mark":979,"ari":980,"bu":981,"No":982,"ubl":983,"ild":984,"my":985,"has":986,"cent":987,"ë©":988,"ìĪ":989,"ï¨":990,"ãĤ§":991,"ous":992,"over":993,"pri":994,"other":995,"ep":996,"ens":997,"vo":998,"ak":999,"fin":1000,"stru":1001,"fl":1002,"We":1003,"any":1004,"rect":1005,"cor":1006,"duct":1007,"type":1008,"reg":1009,"sub":1010,"ies":1011,"sol":1012,"âĩ":1013,"ìľ":1014,"íİ":1015,"íĹ":1016,"num":1017,"tro":1018,"fun":1019,"Ex":1020,"stem":1021,"arch":1022,"Com":1023,"base":1024,"ink":1025,"ren":1026,"sign":1027,"Wh":1028,"ix":1029,"For":1030,"sult":1031,"àµ":1032,"à»":1033,"ãĽ":1034,"äĵ":1035,"ê³":1036,"ëª":1037,"ìĦ":1038,"ìħ":1039,"ìĬ":1040,"ìĸ":1041,"ìĿ":1042,"ð¤©":1043,"tp":1044,"tal":1045,"tri":1046,"trans":1047,"sent":1048,"ult":1049,"self":1050,"tain":1051,"wo":1052,"ound":1053,"ress":1054,"read":1055,"let":1056,"struct":1057,"car":1058,"ank":1059,"ef":1060,"org":1061,"dif":1062,"tem":1063,"gr":1064,"fir":1065,"ëĵ":1066,"ëĶ":1067,"ìĨ":1068,"ìĭ":1069,"ãĥ¥":1070,"eng":1071,"This":1072,"fa":1073,"tent":1074,"way":1075,"your":1076,"lat":1077,"err":1078,"plo":1079,"http":1080,"were":1081,"file":1082,"Ar":1083,"publ":1084,"ude":1085,"iss":1086,"cle":1087,"under":1088,"more":1089,"Un":1090,"En":1091,"funct":1092,"wer":1093,"cr":1094,"some":1095,"ww":1096,"scri":1097,"her":1098,"áĤ":1099,"ã·":1100,"ãľ":1101,"ëį":1102,"ìĻ":1103,"íħ":1104,"íĻ":1105,"ð¤§":1106,"ð¤¨":1107,"ð¤ª":1108,"ð¡Ł":1109,"Mo":1110,"serv":1111,"quest":1112,"cept":1113,"view":1114,"ale":1115,"gram":1116,"oug":1117,"ton":1118,"model":1119,"ever":1120,"main":1121,"ample":1122,"vers":1123,"af":1124,"cho":1125,"posit":1126,"âļ":1127,"ãĹ":1128,"äĶ":1129,"êµ":1130,"ë£":1131,"ë¬":1132,"ëı":1133,"ìº":1134,"ì¼":1135,"ìĤ":1136,"ìļ":1137,"íĿ":1138,"ð¨«":1139,"ð¨¯":1140,"pol":1141,"cer":1142,"vi":1143,"their":1144,"ond":1145,"gin":1146,"vel":1147,"ull":1148,"dit":1149,"ian":1150,"Me":1151,"point":1152,"fect":1153,"Co":1154,"sk":1155,"io":1156,"cu":1157,"number":1158,"pat":1159,"print":1160,"come":1161,"net":1162,"ax":1163,"cy":1164,"result":1165,"ugh":1166,"ray":1167,"sim":1168,"press":1169,"fore":1170,"may":1171,"che":1172,"vis":1173,"ten":1174,"sum":1175,"bl":1176,"they":1177,"char":1178,"there":1179,"áł":1180,"ê·":1181,"ê¿":1182,"ë¥":1183,"ë¦":1184,"ë³":1185,"ëģ":1186,"ëħ":1187,"ëIJ":1188,"ì¹":1189,"íĬ":1190,"íĺ":1191,"íĽ":1192,"ð¡Ľ":1193,"ðłµ":1194,"ð¬Ń":1195,"Tr":1196,"equ":1197,"He":1198,"ource":1199,"row":1200,"how":1201,"when":1202,"public":1203,"So":1204,"count":1205,"bar":1206,"hel":1207,"off":1208,"state":1209,"about":1210,"Lo":1211,"than":1212,"gu":1213,"date":1214,"loc":1215,"stat":1216,"day":1217,"who":1218,"To":1219,"As":1220,"where":1221,"had":1222,"know":1223,"Al":1224,"like":1225,"fig":1226,"ise":1227,"jo":1228,"list":1229,"Ad":1230,"stud":1231,"bel":1232,"thing":1233,"ute":1234,"à±":1235,"ãµ":1236,"ä´":1237,"äķ":1238,"ê´":1239,"ê¸":1240,"ë¶":1241,"ëĬ":1242,"ëĿ":1243,"ì²":1244,"ìĮ":1245,"ð¨§":1246,"ãĤĥ":1247,"ãĤħ":1248,"ãĤĩ":1249,"ãĥ£":1250,"ãĥ§":1251,"show":1252,"vari":1253,"plic":1254,"ness":1255,"It":1256,"back":1257,"year":1258,"Cl":1259,"Ne":1260,"bit":1261,"reat":1262,"she":1263,"twe":1264,"see":1265,"differ":1266,"mer":1267,"system":1268,"pend":1269,"tt":1270,"sid":1271,"Po":1272,"would":1273,"ava":1274,"ath":1275,"first":1276,"key":1277,"opt":1278,"vide":1279,"cause":1280,"need":1281,"sm":1282,"wa":1288,"ru":1293,"der":1347,"his":1357,"orm":1363,"na":1364,"pen":1365,"da":1367,"unt":1495,"amp":1496,"men":1500,"anc":1509,"ell":1516,"ey":1520,"ext":1524,"own":1589,"ste":1595,"vid":1600,"oc":1609,"fil":1614,"here":1653,"coun":1694,"ime":1739,"inte":1751,"sta":1752,"ork":1771,"tu":1773,"sit":1774,"mor":1783,"dow":1787,"nt":1860,"ze":1865,"stu":1880,"wit":1898,"pli":1904,"mi":1918,"mod":1923,"Pr":1925,"ess":1955,"bi":1983,"ark":1999,"hav":2111,"lin":2115,"ore":2119,"por":2120,"os":2122,"bas":2128,"ave":2154,"har":2168,"fi":2248,"cri":2424,"res":2431,"whe":2455,"mode":2458,"cel":2460,"gn":2507,"enc":2534,"mber":2535,"nam":2540,"abl":2558,"ba":2574,"ove":2589,"prin":2602,"si":2622,"ov":2627,"tru":2682,"diff":2697,"sho":2699,"ye":2714,"duc":2859,"cou":2940,"ee":2993,"ng":3068,"han":3080,"eve":3082,"lic":3094,"unct":3114,"tim":3120,"fra":3136,"nes":3211,"nu":3246,"ai":3394,"oth":3400,"rac":3401,"typ":3436,"tex":3622,"sen":3624,"Fo":3631,"pu":3641,"tw":3666,"ram":3693,"kno":3760,"rig":3831,"dd":3846,"gi":3861,"pub":3899,"ny":3900,"tion":4044,"va":4144,"yo":4200,"sul":4218,"nd":4230,"hey":4353,"oul":4369,"ike":4415,"sys":4496,"kn":4554,"ome":4682,"uct":30718,"ns":30776,"pres":30796,"eat":30858,"arc":30887,"eg":31111,"eq":31132,"rec":31176,"wi":31330,"cha":31332,"thin":31401,"rg":31442,"cla":31454,"tate":31505,"rd":31514,"rs":31677,"rm":31848,"fu":31876,"vie":32066,"urn":32075,"tha":32129,"dat":32222,"rea":32256,"hen":32284,"caus":32312,"rt":32395,"ques":32445,"fro":32498,"tran":32796,"ampl":33107,"nee":33219,"gh":33608,"hat":33719,"som":33875,"lis":33880,"nk":33914,"wil":34350,"tes":34836,"rr":35206,"var":35298,"ffer":35655,"tat":36021,"ea":36326,"eir":36427,"ect":37212,"bout":37427,"lf":37469,"rv":37479,"og":37666,"ew":37679,"ati":37975,"clas":38057,"nce":38078,"heir":38546,"lik":38816,"fec":39068,"ces":39163,"lass":39502,"umber":39978,"rst":40013,"rk":40502,"blic":40680,"numb":40927,"thi":41880,"cep":42575,"eft":42794,"yea":43213,"sig":43393,"cen":43453,"ers":43538,"nge":43636,"righ":43708,"scr":45076,"tai":45500,"atio":45894,"ead":46488,"abo":47278,"bac":47720,"erv":47943,"iffer":47944,"ght":48155,"ept":48372,"func":50162,"ttp":50515,"nder":51227,"htt":52349,"Thi":52556,"rch":52731,"uld":52844,"odel":55386,"nct":55466,"rce":57039,"whic":58837,"oint":59791,"cau":59824,"othe":60037,"thei":60043,"nter":60890,"posi":61090,"rn":62178,"abou":63119,"irst":63320,"lec":63504,"elf":65068,"uest":65309,"poi":65498,"mai":66240,"eed":66891,"hing":67935,"syst":70294,"tud":73460,"resul":73915,"unde":74204,"ype":74441,"syste":76573,"publi":78199,"lef":79713,"wou":105045,"rans":115263,"jec":118746,"resu":131774},"merges":[["i","n"],["e","r"],["t","h"],["a","n"],["o","n"],["r","e"],["e","n"],["a","t"],["o","r"],["s","t"],["a","l"],["a","r"],["t","he"],["th","e"],["l","e"],["s","e"],["i","t"],["i","s"],["r","o"],["i","c"],["o","u"],["a","nd"],["an","d"],["o","f"],["t","o"],["i","ng"],["in","g"],["m","e"],["d","e"],["a","c"],["a","s"],["e","nt"],["en","t"],["ð","¤"],["i","on"],["io","n"],["ð","¡"],["ð","ł"],["c","h"],["v","e"],["i","l"],["c","t"],["c","e"],["ð","¨"],["c","o"],["l","o"],["g","e"],["ð","£"],["ð","¦"],["t","e"],["i","g"],["e","d"],["ã","Ĥ"],["s","u"],["r","a"],["h","e"],["f","or"],["fo","r"],["b","e"],["o","l"],["a","d"],["u","n"],["ã","ĥ"],["i","d"],["s","s"],["i","m"],["n","o"],["u","r"],["c","on"],["co","n"],["a","te"],["at","e"],["a","m"],["ð","¢"],["u","t"],["d","o"],["r","i"],["p","e"],["n","e"],["p","ro"],["pr","o"],["ð","¥"],["t","er"],["te","r"],["m","a"],["u","l"],["a","b"],["ð","§"],["v","er"],["ve","r"],["m","o"],["i","f"],["p","l"],["p","er"],["pe","r"],["u","e"],["i","r"],["p","o"],["ð","¬"],["ã","ģ"],["e","x"],["i","e"],["a","re"],["ar","e"],["k","e"],["ð","©"],["a","p"],["u","s"],["h","t"],["w","h"],["a","y"],["u","m"],["i","th"],["it","h"],["t","r"],["i","st"],["is","t"],["a","tion"],["at","ion"],["ati","on"],["atio","n"],["l","l"],["s","h"],["m","ent"],["me","nt"],["men","t"],["a","rt"],["ar","t"],["w","e"],["s","o"],["c","l"],["i","ne"],["in","e"],["o","ur"],["ou","r"],["I","n"],["q","u"],["o","rt"],["or","t"],["T","he"],["Th","e"],["t","a"],["a","ll"],["al","l"],["t","hat"],["th","at"],["tha","t"],["a","ge"],["ag","e"],["c","om"],["co","m"],["a","ct"],["ac","t"],["w","ith"],["wit","h"],["wi","th"],["d","i"],["á","¸"],["á","¹"],["á","º"],["á","»"],["e","re"],["er","e"],["u","re"],["ur","e"],["l","y"],["ã","Ģ"],["ç","»"],["é","Ķ"],["ï","¼"],["R","e"],["i","ll"],["il","l"],["p","t"],["æ","ı"],["è","¯"],["è","½"],["e","m"],["á","Ģ"],["æ","¶"],["æ","»"],["æ","ĭ"],["è","°"],["è","Ŀ"],["é","²"],["é","¸"],["e","nd"],["en","d"],["i","nt"],["in","t"],["á","Ī"],["å","Ĵ"],["æ","´"],["æ","·"],["æ","¼"],["æ","Ł"],["ç","İ"],["ç","ı"],["ç","ij"],["è","´"],["è","ĭ"],["é","¨"],["é","¹"],["é","º"],["é","ħ"],["é","Ĵ"],["é","ĵ"],["é","ķ"],["å","§"],["å","©"],["å","«"],["å","IJ"],["å","Ĺ"],["æ","¥"],["æ","²"],["æ","µ"],["ç","¼"],["ç","½"],["ç","IJ"],["ç","Ĺ"],["è","µ"],["è","·"],["è","¸"],["è","¹"],["è","ı"],["è","ij"],["è","Ķ"],["è","ķ"],["é","¡"],["é","©"],["é","·"],["é","½"],["é","ĭ"],["é","į"],["h","a"],["à","¤"],["å","¦"],["å","ī"],["å","ij"],["å","ł"],["æ","°"],["æ","³"],["æ","¸"],["æ","ĥ"],["æ","ħ"],["ç","¹"],["ç","º"],["ç","¿"],["ç","ĥ"],["ç","ħ"],["ç","ł"],["è","£"],["è","¬"],["è","¾"],["è","¿"],["è","į"],["è","İ"],["è","ĸ"],["é","¥"],["é","ª"],["é","¶"],["é","»"],["é","Ħ"],["é","Ĩ"],["p","re"],["pr","e"],["l","d"],["i","ght"],["ig","ht"],["igh","t"],["à","¸"],["ä","½"],["å","»"],["æ","ª"],["æ","¾"],["æ","Ļ"],["ç","¥"],["ç","¦"],["ç","´"],["ç","¶"],["ç","¸"],["ç","ģ"],["ç","ĭ"],["ç","ĺ"],["è","®"],["è","Ģ"],["è","Ī"],["è","Ĭ"],["è","Ĺ"],["è","ł"],["é","¢"],["é","İ"],["ð","«"],["o","m"],["ä","¼"],["ä","¿"],["å","ª"],["å","Ī"],["å","į"],["å","Ķ"],["å","ĸ"],["å","ŀ"],["æ","£"],["æ","¦"],["æ","¨"],["æ","ī"],["æ","Ĭ"],["æ","İ"],["æ","Ŀ"],["æ","ŀ"],["ç","£"],["ç","ª"],["ç","¯"],["ç","·"],["ç","¾"],["ç","Ĵ"],["ç","Ķ"],["è","§"],["è","³"],["è","ĥ"],["è","ĵ"],["è","ŀ"],["è","Ł"],["é","§"],["é","ģ"],["é","Ĭ"],["é","Ľ"],["p","le"],["pl","e"],["p","ort"],["po","rt"],["por","t"],["o","ut"],["ou","t"],["ä","¸"],["å","¯"],["å","²"],["å","³"],["å","´"],["å","¹"],["å","½"],["å","Ģ"],["å","ĺ"],["å","Ļ"],["æ","º"],["æ","½"],["æ","Ĥ"],["æ","Ī"],["æ","į"],["æ","IJ"],["æ","ĺ"],["æ","ļ"],["æ","ł"],["ç","Ĩ"],["ç","ī"],["ç","Ĭ"],["ç","Į"],["ç","į"],["ç","ŀ"],["è","¢"],["è","«"],["è","²"],["è","¼"],["è","ĩ"],["è","Į"],["è","IJ"],["è","ļ"],["è","Ľ"],["é","ĥ"],["é","Į"],["é","IJ"],["é","ij"],["é","ĺ"],["é","Ļ"],["é","ľ"],["é","ŀ"],["s","tr"],["st","r"],["f","e"],["o","w"],["e","s"],["ä","¾"],["å","º"],["å","¾"],["å","ģ"],["å","Ŀ"],["å","Ł"],["å","Ń"],["æ","§"],["æ","¯"],["æ","±"],["æ","¹"],["æ","¿"],["æ","Ģ"],["æ","Į"],["æ","ij"],["æ","Ĵ"],["æ","Ķ"],["æ","ĸ"],["æ","ľ"],["ç","Ģ"],["ç","Ļ"],["è","Ħ"],["è","ħ"],["è","ī"],["è","Ĵ"],["è","ĺ"],["è","ľ"],["è","Ń"],["é","³"],["é","ĩ"],["é","Ī"],["é","ī"],["é","ı"],["é","ļ"],["é","Ł"],["a","nt"],["an","t"],["u","se"],["us","e"],["e","t"],["à","°"],["á","ŀ"],["ä","º"],["å","£"],["å","¨"],["å","®"],["å","±"],["å","¸"],["å","ĥ"],["å","ı"],["å","ĵ"],["å","ķ"],["å","ļ"],["æ","¢"],["æ","©"],["æ","®"],["æ","ģ"],["æ","ĵ"],["ç","©"],["ç","¬"],["ç","µ"],["ç","ĩ"],["ç","ĸ"],["ç","Ń"],["è","¤"],["è","¥"],["è","Ļ"],["é","¤"],["é","¦"],["é","¬"],["é","µ"],["é","ĸ"],["é","Ĺ"],["é","Ŀ"],["é","ł"],["b","y"],["o","un"],["ou","n"],["a","me"],["am","e"],["b","r"],["à","ª"],["à","²"],["à","´"],["å","¡"],["å","¢"],["å","°"],["å","¼"],["å","ħ"],["å","ĩ"],["æ","¡"],["æ","ĩ"],["æ","ķ"],["ç","¢"],["ç","³"],["ç","Ī"],["ç","Ľ"],["ç","Ł"],["è","¡"],["è","º"],["è","Ĩ"],["é","£"],["é","«"],["é","¼"],["é","Ģ"],["é","Ĥ"],["a","se"],["as","e"],["s","p"],["à","¬"],["å","¶"],["å","Ĥ"],["å","Ħ"],["æ","¤"],["æ","Ħ"],["æ","Ĩ"],["ç","¡"],["ç","°"],["ç","±"],["ç","²"],["ç","Ĥ"],["ç","ĵ"],["ç","ľ"],["ç","Ŀ"],["è","ª"],["è","»"],["ð","ª"],["a","ss"],["as","s"],["o","d"],["r","om"],["ro","m"],["a","g"],["á","ī"],["â","Ģ"],["ä","»"],["å","Ĩ"],["å","Ĭ"],["å","ľ"],["æ","Ĺ"],["æ","Ń"],["ç","¨"],["ç","®"],["è","©"],["è","¶"],["o","ne"],["on","e"],["a","ta"],["at","a"],["c","i"],["à","¦"],["å","¥"],["å","¬"],["å","µ"],["å","¿"],["å","ĭ"],["å","Į"],["ç","Ħ"],["ç","ķ"],["è","±"],["è","Ĥ"],["é","°"],["é","±"],["i","ve"],["iv","e"],["t","i"],["s","up"],["su","p"],["å","·"],["æ","¬"],["ç","¤"],["ç","§"],["è","¦"],["é","´"],["é","Ń"],["i","ce"],["ic","e"],["à","¶"],["å","¤"],["å","İ"],["å","Ľ"],["æ","Ľ"],["u","p"],["t","her"],["th","er"],["the","r"],["á","ĭ"],["ç","«"],["è","¨"],["é","¾"],["a","rd"],["ar","d"],["b","er"],["be","r"],["á","Į"],["è","ģ"],["à","¨"],["á","Ĭ"],["â","Ī"],["ç","ļ"],["à","½"],["æ","«"],["é","¯"],["f","rom"],["fr","om"],["fro","m"],["o","t"],["f","orm"],["for","m"],["fo","rm"],["i","le"],["il","e"],["i","z"],["é","®"],["a","ble"],["ab","le"],["abl","e"],["c","k"],["w","or"],["wo","r"],["p","h"],["d","u"],["e","l"],["ä","¹"],["t","his"],["th","is"],["thi","s"],["T","h"],["v","al"],["va","l"],["a","ce"],["ac","e"],["à","º"],["s","c"],["m","an"],["ma","n"],["u","b"],["n","ot"],["no","t"],["l","i"],["p","r"],["m","ar"],["ma","r"],["a","ck"],["ac","k"],["a","nce"],["an","ce"],["anc","e"],["u","st"],["us","t"],["u","nd"],["un","d"],["f","r"],["u","g"],["i","ty"],["it","y"],["à","¥"],["à","®"],["a","ch"],["ac","h"],["a","v"],["a","st"],["as","t"],["b","o"],["i","de"],["id","e"],["á","ĥ"],["l","ow"],["lo","w"],["w","as"],["wa","s"],["i","te"],["it","e"],["ï","©"],["d","ata"],["da","ta"],["dat","a"],["u","d"],["c","an"],["ca","n"],["p","ut"],["pu","t"],["f","er"],["fe","r"],["S","t"],["s","on"],["so","n"],["a","ng"],["an","g"],["s","et"],["se","t"],["s","er"],["se","r"],["g","et"],["ge","t"],["â","Ħ"],["g","ra"],["gr","a"],["i","gn"],["ig","n"],["â","Ĥ"],["i","a"],["o","p"],["y","ou"],["yo","u"],["f","o"],["t","ur"],["tu","r"],["l","og"],["lo","g"],["â","ģ"],["ï","½"],["x","t"],["o","rd"],["or","d"],["ì","ķ"],["t","ime"],["ti","me"],["tim","e"],["a","ns"],["an","s"],["g","o"],["o","uld"],["ou","ld"],["oul","d"],["D","e"],["f","t"],["w","n"],["t","y"],["i","nd"],["in","d"],["à","¾"],["á","Ł"],["ê","°"],["ì","ŀ"],["i","ch"],["ic","h"],["e","nce"],["en","ce"],["enc","e"],["p","art"],["pa","rt"],["par","t"],["C","h"],["A","n"],["j","e"],["s","y"],["o","b"],["m","at"],["ma","t"],["ì","Ĺ"],["e","st"],["es","t"],["s","pe"],["sp","e"],["o","k"],["t","ra"],["tr","a"],["d","is"],["di","s"],["h","ave"],["ha","ve"],["hav","e"],["q","ue"],["qu","e"],["C","on"],["Co","n"],["l","ect"],["le","ct"],["lec","t"],["c","re"],["cr","e"],["c","ol"],["co","l"],["á","ģ"],["ê","²"],["ë","§"],["ë","°"],["ì","§"],["a","in"],["ai","n"],["i","al"],["ia","l"],["r","ight"],["ri","ght"],["rig","ht"],["righ","t"],["i","nter"],["in","ter"],["int","er"],["inte","r"],["l","a"],["à","§"],["à","©"],["ë","Ĥ"],["b","le"],["bl","e"],["t","urn"],["tur","n"],["tu","rn"],["h","o"],["o","ng"],["on","g"],["c","ur"],["cu","r"],["i","p"],["à","¹"],["b","ut"],["bu","t"],["g","en"],["ge","n"],["a","nge"],["an","ge"],["ang","e"],["c","ess"],["ce","ss"],["ces","s"],["à","Ń"],["ë","ĭ"],["ì","ł"],["l","ine"],["li","ne"],["lin","e"],["P","ro"],["Pr","o"],["t","ext"],["te","xt"],["tex","t"],["e","ar"],["ea","r"],["r","ee"],["re","e"],["s","a"],["i","ck"],["ic","k"],["i","re"],["ir","e"],["d","el"],["de","l"],["j","ect"],["je","ct"],["jec","t"],["p","a"],["à","·"],["â","ī"],["ã","»"],["ë","¹"],["ì","°"],["ì","ĺ"],["í","Į"],["l","t"],["i","ze"],["iz","e"],["l","eft"],["le","ft"],["lef","t"],["n","ame"],["na","me"],["nam","e"],["i","sh"],["is","h"],["c","ell"],["ce","ll"],["cel","l"],["o","ld"],["ol","d"],["o","unt"],["ou","nt"],["oun","t"],["à","³"],["á","į"],["â","ĺ"],["ê","¹"],["ë","Ħ"],["í","ķ"],["c","a"],["d","own"],["do","wn"],["dow","n"],["s","el"],["se","l"],["m","on"],["mo","n"],["m","in"],["mi","n"],["a","u"],["a","ry"],["ar","y"],["à","«"],["â","Ĩ"],["ë","ŀ"],["ë","ł"],["ì","Ľ"],["í","ĥ"],["ð¤","¦"],["e","v"],["i","v"],["w","ork"],["wor","k"],["wo","rk"],["p","os"],["po","s"],["n","ew"],["ne","w"],["g","ro"],["gr","o"],["f","rac"],["fr","ac"],["fra","c"],["wh","ich"],["whic","h"],["f","f"],["w","ill"],["wi","ll"],["wil","l"],["t","est"],["te","st"],["tes","t"],["a","dd"],["ad","d"],["c","lass"],["cl","ass"],["cla","ss"],["clas","s"],["i","gh"],["ig","h"],["i","ew"],["ie","w"],["S","e"],["p","ar"],["pa","r"],["â","Ĭ"],["â","Ļ"],["ë","²"],["ì","ĥ"],["i","ct"],["ic","t"],["r","y"],["n","ow"],["no","w"],["m","ark"],["ma","rk"],["mar","k"],["a","ri"],["ar","i"],["b","u"],["N","o"],["u","bl"],["ub","l"],["i","ld"],["il","d"],["m","y"],["h","as"],["ha","s"],["c","ent"],["ce","nt"],["cen","t"],["ë","©"],["ì","Ī"],["ï","¨"],["ãĤ","§"],["o","us"],["ou","s"],["o","ver"],["ove","r"],["ov","er"],["p","ri"],["pr","i"],["o","ther"],["ot","her"],["oth","er"],["othe","r"],["e","p"],["e","ns"],["en","s"],["v","o"],["a","k"],["f","in"],["fi","n"],["s","tru"],["st","ru"],["str","u"],["f","l"],["W","e"],["a","ny"],["an","y"],["r","ect"],["re","ct"],["rec","t"],["c","or"],["co","r"],["d","uct"],["du","ct"],["duc","t"],["t","ype"],["ty","pe"],["typ","e"],["r","eg"],["re","g"],["s","ub"],["su","b"],["i","es"],["ie","s"],["s","ol"],["so","l"],["â","ĩ"],["ì","ľ"],["í","İ"],["í","Ĺ"],["n","um"],["nu","m"],["t","ro"],["tr","o"],["f","un"],["fu","n"],["E","x"],["s","tem"],["st","em"],["ste","m"],["a","rch"],["ar","ch"],["arc","h"],["C","om"],["Co","m"],["b","ase"],["bas","e"],["ba","se"],["i","nk"],["in","k"],["r","en"],["re","n"],["s","ign"],["si","gn"],["sig","n"],["W","h"],["i","x"],["F","or"],["Fo","r"],["s","ult"],["su","lt"],["sul","t"],["à","µ"],["à","»"],["ã","Ľ"],["ä","ĵ"],["ê","³"],["ë","ª"],["ì","Ħ"],["ì","ħ"],["ì","Ĭ"],["ì","ĸ"],["ì","Ŀ"],["ð¤","©"],["t","p"],["t","al"],["ta","l"],["t","ri"],["tr","i"],["t","rans"],["tr","ans"],["tra","ns"],["tran","s"],["s","ent"],["se","nt"],["sen","t"],["u","lt"],["ul","t"],["s","elf"],["se","lf"],["sel","f"],["t","ain"],["ta","in"],["tai","n"],["w","o"],["o","und"],["ou","nd"],["oun","d"],["r","ess"],["re","ss"],["res","s"],["r","ead"],["re","ad"],["rea","d"],["l","et"],["le","t"],["str","uct"],["stru","ct"],["c","ar"],["ca","r"],["a","nk"],["an","k"],["e","f"],["o","rg"],["or","g"],["d","if"],["di","f"],["t","em"],["te","m"],["g","r"],["f","ir"],["fi","r"],["ë","ĵ"],["ë","Ķ"],["ì","Ĩ"],["ì","ĭ"],["ãĥ","¥"],["e","ng"],["en","g"],["T","his"],["Th","is"],["Thi","s"],["f","a"],["t","ent"],["te","nt"],["ten","t"],["w","ay"],["wa","y"],["y","our"],["you","r"],["yo","ur"],["l","at"],["la","t"],["e","rr"],["er","r"],["p","lo"],["pl","o"],["h","ttp"],["ht","tp"],["htt","p"],["w","ere"],["we","re"],["wer","e"],["f","ile"],["fil","e"],["fi","le"],["A","r"],["p","ubl"],["pu","bl"],["pub","l"],["u","de"],["ud","e"],["i","ss"],["is","s"],["c","le"],["cl","e"],["u","nder"],["un","der"],["und","er"],["unde","r"],["m","ore"],["mo","re"],["mor","e"],["U","n"],["E","n"],["f","unct"],["fun","ct"],["fu","nct"],["func","t"],["w","er"],["we","r"],["c","r"],["s","ome"],["so","me"],["som","e"],["w","w"],["s","cri"],["sc","ri"],["scr","i"],["h","er"],["he","r"],["á","Ĥ"],["ã","·"],["ã","ľ"],["ë","į"],["ì","Ļ"],["í","ħ"],["í","Ļ"],["ð¤","§"],["ð¤","¨"],["ð¤","ª"],["ð¡","Ł"],["M","o"],["s","erv"],["se","rv"],["ser","v"],["q","uest"],["qu","est"],["que","st"],["ques","t"],["c","ept"],["ce","pt"],["cep","t"],["v","iew"],["vi","ew"],["vie","w"],["a","le"],["al","e"],["g","ram"],["gra","m"],["gr","am"],["o","ug"],["ou","g"],["t","on"],["to","n"],["m","odel"],["mo","del"],["mod","el"],["mode","l"],["e","ver"],["ev","er"],["eve","r"],["m","ain"],["ma","in"],["mai","n"],["am","ple"],["amp","le"],["ampl","e"],["v","ers"],["ve","rs"],["ver","s"],["a","f"],["c","ho"],["ch","o"],["po","sit"],["pos","it"],["posi","t"],["â","ļ"],["ã","Ĺ"],["ä","Ķ"],["ê","µ"],["ë","£"],["ë","¬"],["ë","ı"],["ì","º"],["ì","¼"],["ì","Ĥ"],["ì","ļ"],["í","Ŀ"],["ð¨","«"],["ð¨","¯"],["p","ol"],["po","l"],["c","er"],["ce","r"],["v","i"],["t","heir"],["th","eir"],["the","ir"],["thei","r"],["o","nd"],["on","d"],["g","in"],["gi","n"],["v","el"],["ve","l"],["u","ll"],["ul","l"],["d","it"],["di","t"],["i","an"],["ia","n"],["M","e"],["p","oint"],["po","int"],["poi","nt"],["f","ect"],["fe","ct"],["fec","t"],["C","o"],["s","k"],["i","o"],["c","u"],["n","umber"],["num","ber"],["nu","mber"],["numb","er"],["p","at"],["pa","t"],["pr","int"],["pri","nt"],["prin","t"],["c","ome"],["co","me"],["com","e"],["n","et"],["ne","t"],["a","x"],["c","y"],["re","sult"],["res","ult"],["resul","t"],["resu","lt"],["u","gh"],["ug","h"],["r","ay"],["ra","y"],["s","im"],["si","m"],["p","ress"],["pre","ss"],["pr","ess"],["pres","s"],["f","ore"],["for","e"],["fo","re"],["m","ay"],["ma","y"],["c","he"],["ch","e"],["v","is"],["vi","s"],["t","en"],["te","n"],["s","um"],["su","m"],["b","l"],["t","hey"],["th","ey"],["the","y"],["c","har"],["ch","ar"],["cha","r"],["t","here"],["th","ere"],["the","re"],["ther","e"],["á","ł"],["ê","·"],["ê","¿"],["ë","¥"],["ë","¦"],["ë","³"],["ë","ģ"],["ë","ħ"],["ë","IJ"],["ì","¹"],["í","Ĭ"],["í","ĺ"],["í","Ľ"],["ð¡","Ľ"],["ðł","µ"],["ð¬","Ń"],["T","r"],["e","qu"],["eq","u"],["H","e"],["ou","rce"],["our","ce"],["r","ow"],["ro","w"],["h","ow"],["ho","w"],["w","hen"],["wh","en"],["whe","n"],["publ","ic"],["pu","blic"],["pub","lic"],["publi","c"],["S","o"],["c","ount"],["co","unt"],["coun","t"],["cou","nt"],["b","ar"],["ba","r"],["h","el"],["he","l"],["o","ff"],["of","f"],["s","tate"],["st","ate"],["stat","e"],["sta","te"],["a","bout"],["ab","out"],["abo","ut"],["abou","t"],["L","o"],["t","han"],["th","an"],["tha","n"],["g","u"],["d","ate"],["da","te"],["dat","e"],["l","oc"],["lo","c"],["s","tat"],["st","at"],["sta","t"],["d","ay"],["da","y"],["w","ho"],["wh","o"],["T","o"],["A","s"],["w","here"],["wh","ere"],["whe","re"],["h","ad"],["ha","d"],["k","now"],["kno","w"],["kn","ow"],["A","l"],["l","ike"],["li","ke"],["lik","e"],["f","ig"],["fi","g"],["i","se"],["is","e"],["j","o"],["l","ist"],["li","st"],["lis","t"],["A","d"],["s","tud"],["st","ud"],["stu","d"],["b","el"],["be","l"],["t","hing"],["th","ing"],["thin","g"],["thi","ng"],["u","te"],["ut","e"],["à","±"],["ã","µ"],["ä","´"],["ä","ķ"],["ê","´"],["ê","¸"],["ë","¶"],["ë","Ĭ"],["ë","Ŀ"],["ì","²"],["ì","Į"],["ð¨","§"],["ãĤ","ĥ"],["ãĤ","ħ"],["ãĤ","ĩ"],["ãĥ","£"],["ãĥ","§"],["s","how"],["sh","ow"],["sho","w"],["v","ari"],["va","ri"],["var","i"],["p","lic"],["pl","ic"],["pli","c"],["n","ess"],["ne","ss"],["nes","s"],["I","t"],["b","ack"],["ba","ck"],["bac","k"],["y","ear"],["ye","ar"],["yea","r"],["C","l"],["N","e"],["b","it"],["bi","t"],["r","eat"],["re","at"],["rea","t"],["s","he"],["sh","e"],["t","we"],["tw","e"],["s","ee"],["se","e"],["d","iffer"],["di","ffer"],["dif","fer"],["diff","er"],["m","er"],["me","r"],["sy","stem"],["sys","tem"],["syst","em"],["syste","m"],["p","end"],["pe","nd"],["pen","d"],["t","t"],["s","id"],["si","d"],["P","o"],["w","ould"],["wo","uld"],["wou","ld"],["a","va"],["av","a"],["a","th"],["at","h"],["f","irst"],["fir","st"],["fi","rst"],["k","ey"],["ke","y"],["o","pt"],["op","t"],["v","ide"],["vi","de"],["vid","e"],["ca","use"],["caus","e"],["cau","se"],["n","eed"],["ne","ed"],["nee","d"],["s","m"]]}} diff --git a/zig/src/families/inkling2/fixtures/prompt_cases.json b/zig/src/families/inkling2/fixtures/prompt_cases.json new file mode 100644 index 00000000000..d17cce2eb8e --- /dev/null +++ b/zig/src/families/inkling2/fixtures/prompt_cases.json @@ -0,0 +1,203 @@ +{ + "reference": { + "transformers": "5.20.0", + "tokenizers": "0.23.3", + "jinja2": "3.1.6", + "files": "thinkingmachines/Inkling-2-Small@2ad1157016e1aac77b6ff1b770e7c05229403134: tokenizer.json, tokenizer_config.json, chat_template.jinja", + "call": "apply_chat_template(messages, tokenize=False, add_generation_prompt=True[, reasoning_effort=E]); tok(prompt, add_special_tokens=False)" + }, + "chat": [ + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>" + }, + { + "user": "Café naïve — 你好 🌍 ñandú", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Café naïve — 你好 🌍 ñandú<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 120967, 149946, 5169, 290, 150220, 220, 11739, 23643, 220, 114925, 155662, 276, 5180, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Café naïve — 你好 🌍 ñandú<|end_message|>" + }, + { + "user": "def f(x):\n return x**2 # square\n\n\tprint(f(3))\n", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>def f(x):\n return x**2 # square\n\n\tprint(f(3))\n<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 1719, 149983, 7, 87, 8, 25, 198, 149862, 150583, 149924, 145054, 17, 220, 196994, 152397, 68014, 197, 1160, 7, 69, 7, 18, 8, 8, 198, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>def f(x):\n return x**2 # square\n\n\tprint(f(3))\n<|end_message|>" + }, + { + "user": "It's 1234567 DON'T stop; we'll see ...\r\nnext?", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>It's 1234567 DON'T stop; we'll see ...\r\nnext?<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 1256, 6, 82, 220, 70904, 81554, 22, 199445, 6, 51, 151292, 26, 220, 149961, 6, 359, 150294, 197017, 68247, 2157, 30, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>It's 1234567 DON'T stop; we'll see ...\r\nnext?<|end_message|>" + }, + { + "user": "a", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>a<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 64, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>a<|end_message|>" + }, + { + "user": " two spaces and trailing ", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|> two spaces and trailing <|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 220, 150103, 220, 156465, 220, 149880, 162610, 279, 149859, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|> two spaces and trailing <|end_message|>" + }, + { + "user": "Explain MoE routing in two sentences.", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 100887, 150881, 36, 184537, 149881, 150103, 167608, 13, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>" + }, + { + "user": "Literal markers: <|end_message|> and <|message_user|> inside text.", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Literal markers: <|end_message|> and <|message_user|> inside text.<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 89246, 175691, 25, 220, 200010, 149880, 220, 200000, 153200, 150311, 13, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Literal markers: <|end_message|> and <|message_user|> inside text.<|end_message|>" + }, + { + "user": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word ", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word <|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 31496, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 151290, 220, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word <|end_message|>" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "none" + }, + { + "user": "Café naïve — 你好 🌍 ñandú", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Café naïve — 你好 🌍 ñandú<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 200010, 200000, 200004, 120967, 149946, 5169, 290, 150220, 220, 11739, 23643, 220, 114925, 155662, 276, 5180, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Café naïve — 你好 🌍 ñandú<|end_message|>", + "effort": "none" + }, + { + "user": "def f(x):\n return x**2 # square\n\n\tprint(f(3))\n", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>def f(x):\n return x**2 # square\n\n\tprint(f(3))\n<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 200010, 200000, 200004, 1719, 149983, 7, 87, 8, 25, 198, 149862, 150583, 149924, 145054, 17, 220, 196994, 152397, 68014, 197, 1160, 7, 69, 7, 18, 8, 8, 198, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>def f(x):\n return x**2 # square\n\n\tprint(f(3))\n<|end_message|>", + "effort": "none" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.1<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 16, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.1<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "minimal" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.2<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 17, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.2<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "low" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.7<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 22, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.7<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "medium" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "high" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 68436, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "xhigh" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 68436, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": "max" + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.5<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 20, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.5<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": 0.5 + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 68436, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.99<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": 0.99 + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0.1<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 16, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0.1<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": 0.1 + }, + { + "user": "Hello, I'll go 12345 times!", + "prompt": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "ids": [200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 200010, 200000, 200004, 32269, 11, 149904, 6, 359, 150323, 220, 70904, 68358, 150879, 0, 200010], + "decoded": "<|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Hello, I'll go 12345 times!<|end_message|>", + "effort": 0 + }, + { + "user": "Explain MoE routing in two sentences.", + "prompt": "<|message_system|><|content_text|>You are terse.<|end_message|><|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>", + "ids": [200002, 200004, 1735, 149914, 172044, 13, 200010, 200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 13, 24, 200010, 200000, 200004, 100887, 150881, 36, 184537, 149881, 150103, 167608, 13, 200010], + "decoded": "<|message_system|><|content_text|>You are terse.<|end_message|><|message_system|><|content_text|>Thinking effort level: 0.9<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>", + "system": "You are terse." + }, + { + "user": "Explain MoE routing in two sentences.", + "prompt": "<|message_system|><|content_text|>You are terse.<|end_message|><|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>", + "ids": [200002, 200004, 1735, 149914, 172044, 13, 200010, 200002, 200004, 34182, 279, 154554, 150628, 25, 220, 15, 200010, 200000, 200004, 100887, 150881, 36, 184537, 149881, 150103, 167608, 13, 200010], + "decoded": "<|message_system|><|content_text|>You are terse.<|end_message|><|message_system|><|content_text|>Thinking effort level: 0<|end_message|><|message_user|><|content_text|>Explain MoE routing in two sentences.<|end_message|>", + "system": "You are terse.", + "effort": "none" + } + ], + "raw": [ + { + "text": "Hello world", + "ids": [32269, 150770], + "decoded": "Hello world" + }, + { + "text": "I'll 12345 ÄÖÜ", + "ids": [40, 6, 359, 220, 70904, 68358, 154050, 5208, 5214], + "decoded": "I'll 12345 ÄÖÜ" + }, + { + "text": "\n\n \t x", + "ids": [68014, 149859, 197, 149924], + "decoded": "\n\n \t x" + }, + { + "text": "<|endoftext|>plain", + "ids": [199999, 2550], + "decoded": "<|endoftext|>plain" + }, + { + "text": "日本語のテキスト", + "ids": [90626, 22912, 6084, 2804, 2064, 3527, 3529], + "decoded": "日本語のテキスト" + }, + { + "text": "é combining", + "ids": [108114, 172469], + "decoded": "é combining" + } + ] +} diff --git a/zig/src/families/inkling2/fixtures/tiny_config.json b/zig/src/families/inkling2/fixtures/tiny_config.json new file mode 100644 index 00000000000..85df007f3c1 --- /dev/null +++ b/zig/src/families/inkling2/fixtures/tiny_config.json @@ -0,0 +1,104 @@ +{ + "architectures": [ + "Inkling2ForConditionalGeneration" + ], + "model_type": "inkling2", + "eos_token_id": 200006, + "text_config": { + "model_max_length": 1048576, + "torch_dtype": "bfloat16", + "hidden_size": 128, + "num_hidden_layers": 12, + "vocab_size": 201024, + "num_attention_heads": 8, + "num_key_value_heads": 4, + "head_dim": 128, + "d_rel": 16, + "rel_extent": 1024, + "q_bias": false, + "o_bias": false, + "log_scaling_n_floor": 128000, + "log_scaling_alpha": 0.1, + "rms_norm_eps": 1e-06, + "pre_norm_pre_affine": false, + "final_norm_pre_affine": false, + "use_value_norm_no_gamma": true, + "qk_l2_clip_threshold": 22.627416997969522, + "rel_l2_clip_threshold": 8.0, + "local_layer_ids": [ + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8, + 9, + 10 + ], + "sconv_kernel_size": 4, + "unpadded_vocab_size": 200058, + "final_logit_softcapping": 30.0, + "swa_head_dim": 128, + "swa_num_attention_heads": 8, + "swa_num_key_value_heads": 4, + "sliding_window_size": 1024, + "n_layers_per_attn_res_block": 6, + "attn_res_normalize_values": true, + "n_routed_experts": 96, + "num_experts_per_tok": 8, + "n_shared_experts": 0, + "intermediate_size": 128, + "mlp_gate_softcap": 4.0, + "mlp_up_softcap": 25.0, + "route_scale": 8.0, + "use_gate_bias": true, + "tie_word_embeddings": false + }, + "vision_config": { + "temporal_patch_size": 2, + "native_patch_size": 20, + "adapter_merge_size": 2, + "projection_hidden_dim": 32, + "projector_bias": false, + "hidden_size": 32, + "num_hidden_layers": 4, + "num_attention_heads": 4, + "mlp_ratio": 4.0, + "posemb_grid_size": 32, + "layer_norm_eps": 1e-05, + "text_hidden_size": 128 + }, + "mtp_config": { + "hidden_size": 128, + "num_hidden_layers": 5, + "num_attention_heads": 8, + "num_key_value_heads": 4, + "head_dim": 128, + "intermediate_size": 128, + "max_position_embeddings": 1048576, + "torch_dtype": "bfloat16", + "q_bias": false, + "o_bias": false, + "rms_norm_eps": 1e-06, + "rope_theta": 1000000.0, + "local_layer_ids": [ + 0, + 1, + 3, + 4 + ], + "sliding_window_size": 1024, + "block_size": 8, + "markov_rank": 8, + "markov_head_type": "rnn_hidden", + "target_layer_ids": [ + 5, + 12 + ] + }, + "tie_word_embeddings": false, + "transformers_version": "5.23.0.dev0", + "dtype": "bfloat16" +} diff --git a/zig/src/families/inkling2/fixtures/tiny_model_header.txt b/zig/src/families/inkling2/fixtures/tiny_model_header.txt new file mode 100644 index 00000000000..feda45d6275 --- /dev/null +++ b/zig/src/families/inkling2/fixtures/tiny_model_header.txt @@ -0,0 +1,72 @@ +inkling2-tiny-model 404 e0f797f40c47aacdba26c9b4702e40e55f6d4f574a94acb0aaaa5779cb781089 +model.llm.attn_res.attn_queries.{L} F32 128 0-3,5-9 +model.llm.attn_res.attn_queries.{L} F32 3x128 4,10 +model.llm.attn_res.mlp_queries.{L} F32 128 0-11 +model.llm.attn_res.output_query F32 128 +model.llm.embed.weight BF16 201024x128 +model.llm.embed_norm.weight BF16 128 +model.llm.layers.{L}.attn.attn_sink_proj.weight BF16 8x128 0-11 +model.llm.layers.{L}.attn.gate_attn.weight BF16 1024x128 0-11 +model.llm.layers.{L}.attn.k_sconv.static_w BF16 4x512 5,11 +model.llm.layers.{L}.attn.k_sconv.weight BF16 512x1x4 0-4,6-10 +model.llm.layers.{L}.attn.k_sconv.weight_proj BF16 16x128 5,11 +model.llm.layers.{L}.attn.q_l2_clip.scale BF16 8x128 0-11 +model.llm.layers.{L}.attn.rel_l2_clip.scale BF16 8x16 0-11 +model.llm.layers.{L}.attn.rel_logits_proj.proj BF16 16x1024 0-11 +model.llm.layers.{L}.attn.v_sconv.static_w BF16 4x512 5,11 +model.llm.layers.{L}.attn.v_sconv.weight BF16 512x1x4 0-4,6-10 +model.llm.layers.{L}.attn.v_sconv.weight_proj BF16 16x128 5,11 +model.llm.layers.{L}.attn.wk_dv.weight BF16 512x128 0-11 +model.llm.layers.{L}.attn.wo_ud.weight BF16 128x1024 0-11 +model.llm.layers.{L}.attn.wq_du.weight BF16 1024x128 0-11 +model.llm.layers.{L}.attn.wr_du.weight BF16 128x128 0-11 +model.llm.layers.{L}.attn.wv_dv.weight BF16 512x128 0-11 +model.llm.layers.{L}.attn_norm.weight BF16 128 0-4,6-10 +model.llm.layers.{L}.attn_sconv.weight BF16 128x1x4 0-11 +model.llm.layers.{L}.k_input_norm.weight BF16 128 5,11 +model.llm.layers.{L}.mlp.experts.w13_weight F8_E4M3 96x256x128 6-11 +model.llm.layers.{L}.mlp.experts.w13_weight U8 96x256x64 0-5 +model.llm.layers.{L}.mlp.experts.w13_weight_amax F32 96 0-5 +model.llm.layers.{L}.mlp.experts.w13_weight_outer_scale_denominator F32 1 0-5 +model.llm.layers.{L}.mlp.experts.w13_weight_scale F8_E4M3 96x256x8 0-5 +model.llm.layers.{L}.mlp.experts.w13_weight_scale U8 96x256x4 6-11 +model.llm.layers.{L}.mlp.experts.w2_weight F8_E4M3 96x128x128 6-11 +model.llm.layers.{L}.mlp.experts.w2_weight U8 96x128x64 0-5 +model.llm.layers.{L}.mlp.experts.w2_weight_amax F32 96 0-5 +model.llm.layers.{L}.mlp.experts.w2_weight_outer_scale_denominator F32 1 0-5 +model.llm.layers.{L}.mlp.experts.w2_weight_scale F8_E4M3 96x128x8 0-5 +model.llm.layers.{L}.mlp.experts.w2_weight_scale U8 96x128x4 6-11 +model.llm.layers.{L}.mlp.gate.bias F32 96 0-11 +model.llm.layers.{L}.mlp.gate.weight BF16 96x128 0-11 +model.llm.layers.{L}.mlp_norm.weight BF16 128 0-11 +model.llm.layers.{L}.mlp_sconv.weight BF16 128x1x4 0-11 +model.llm.layers.{L}.q_input_norm.weight BF16 128 5,11 +model.llm.layers.{L}.v_input_norm.weight BF16 128 5,11 +model.llm.norm.weight BF16 128 +model.llm.unembed.weight BF16 201024x128 +model.visual.backbone.embeddings.class_embedding BF16 32 +model.visual.backbone.embeddings.cls_position_embedding BF16 32 +model.visual.backbone.embeddings.patch_embedding.weight BF16 32x1200 +model.visual.backbone.embeddings.position_embedding BF16 1024x32 +model.visual.backbone.layers.{L}.ln_1.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.ln_1.weight BF16 32 0-3 +model.visual.backbone.layers.{L}.ln_2.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.ln_2.weight BF16 32 0-3 +model.visual.backbone.layers.{L}.ls_1.gamma BF16 32 0-3 +model.visual.backbone.layers.{L}.ls_2.gamma BF16 32 0-3 +model.visual.backbone.layers.{L}.mlp.c_fc.bias BF16 128 0-3 +model.visual.backbone.layers.{L}.mlp.c_fc.weight BF16 128x32 0-3 +model.visual.backbone.layers.{L}.mlp.c_proj.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.mlp.c_proj.weight BF16 32x128 0-3 +model.visual.backbone.layers.{L}.self_attn.k_proj.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.self_attn.k_proj.weight BF16 32x32 0-3 +model.visual.backbone.layers.{L}.self_attn.out_proj.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.self_attn.out_proj.weight BF16 32x32 0-3 +model.visual.backbone.layers.{L}.self_attn.q_proj.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.self_attn.q_proj.weight BF16 32x32 0-3 +model.visual.backbone.layers.{L}.self_attn.v_proj.bias BF16 32 0-3 +model.visual.backbone.layers.{L}.self_attn.v_proj.weight BF16 32x32 0-3 +model.visual.backbone.ln_pre.bias BF16 32 +model.visual.backbone.ln_pre.weight BF16 32 +model.visual.proj_in.weight BF16 32x128 +model.visual.proj_out.weight BF16 128x32 diff --git a/zig/src/families/inkling2/fixtures/tiny_mtp_header.txt b/zig/src/families/inkling2/fixtures/tiny_mtp_header.txt new file mode 100644 index 00000000000..d24cb1ae35f --- /dev/null +++ b/zig/src/families/inkling2/fixtures/tiny_mtp_header.txt @@ -0,0 +1,25 @@ +inkling2-tiny-mtp 84 84ae1305a3c2be06bf9984f30b5fe8bfb47a5915245105b5081c518277bf7615 +fuse_weight BF16 6x2 +layers.{L}.dflare_norm.weight BF16 128 0-4 +layers.{L}.input_layernorm.weight BF16 128 0-4 +layers.{L}.mlp.down_proj.weight BF16 128x128 0-4 +layers.{L}.mlp.gate_proj.weight BF16 128x128 0-4 +layers.{L}.mlp.up_proj.weight BF16 128x128 0-4 +layers.{L}.post_attention_layernorm.weight BF16 128 0-4 +layers.{L}.self_attn.k_norm.weight BF16 128 0-4 +layers.{L}.self_attn.k_norm_ctx.weight BF16 128 0-4 +layers.{L}.self_attn.k_proj.weight BF16 512x128 0-4 +layers.{L}.self_attn.k_proj_ctx.weight BF16 512x128 0-4 +layers.{L}.self_attn.o_proj.weight BF16 128x1024 0-4 +layers.{L}.self_attn.q_norm.weight BF16 128 0-4 +layers.{L}.self_attn.q_proj.weight BF16 1024x128 0-4 +layers.{L}.self_attn.v_proj.weight BF16 512x128 0-4 +layers.{L}.self_attn.v_proj_ctx.weight BF16 512x128 0-4 +markov_head.dflare_norm.weight BF16 128 +markov_head.hidden_out.bias BF16 128 +markov_head.hidden_out.weight BF16 128x8 +markov_head.markov_w1.weight BF16 201024x8 +markov_head.rnn_proj.bias BF16 24 +markov_head.rnn_proj.weight BF16 24x272 +mask_embed BF16 128 +norm.weight BF16 128 diff --git a/zig/src/families/inkling2/host_test.zig b/zig/src/families/inkling2/host_test.zig new file mode 100644 index 00000000000..4f8b47e83b3 --- /dev/null +++ b/zig/src/families/inkling2/host_test.zig @@ -0,0 +1,11 @@ +//! Host-only Inkling 2 family package: config, weight map, layer plan, chat template and tokenizer. No GPU. +test { + _ = @import("config.zig"); + _ = @import("config_test.zig"); + _ = @import("names.zig"); + _ = @import("names_test.zig"); + _ = @import("plan.zig"); + _ = @import("prompt.zig"); + _ = @import("template_test.zig"); + _ = @import("tokenizer_test.zig"); +} diff --git a/zig/src/families/inkling2/names.zig b/zig/src/families/inkling2/names.zig new file mode 100644 index 00000000000..3c75db572bf --- /dev/null +++ b/zig/src/families/inkling2/names.zig @@ -0,0 +1,241 @@ +//! Inkling 2 Small's weight map: each tensor the config implies, with dtype and shape, checked against headers. +const std = @import("std"); +const st = @import("safetensors"); +const config = @import("config.zig"); +const plan = @import("plan.zig"); + +const Dtype = st.DType; +const Text = config.Text; + +/// A dimension the map does not derive from the config: any size is accepted there. +pub const any = std.math.maxInt(u64); + +/// Which file's tensors: the backbone and vision tower (model.safetensors), or the draft head (mtp.safetensors). +pub const File = enum { model, mtp }; + +fn put(sink: anytype, comptime fmt: []const u8, args: anytype, dtype: Dtype, dims: []const u64) !void { + var buf: [128]u8 = undefined; + try sink.put(try std.fmt.bufPrint(&buf, fmt, args), dtype, dims); +} + +fn attention(c: *const Text, i: u32, sink: anytype) !void { + const h: u64 = c.hidden; + const hd = c.heads(i); + const q: u64 = @as(u64, hd.q) * hd.dim; + const kv: u64 = @as(u64, hd.kv) * hd.dim; + const k: u64 = config.conv_taps; + const L = .{i}; + try put(sink, "model.llm.layers.{d}.attn.wq_du.weight", L, .bf16, &.{ q, h }); + try put(sink, "model.llm.layers.{d}.attn.wk_dv.weight", L, .bf16, &.{ kv, h }); + try put(sink, "model.llm.layers.{d}.attn.wv_dv.weight", L, .bf16, &.{ kv, h }); + try put(sink, "model.llm.layers.{d}.attn.wr_du.weight", L, .bf16, &.{ @as(u64, hd.q) * c.d_rel, h }); + try put(sink, "model.llm.layers.{d}.attn.wo_ud.weight", L, .bf16, &.{ h, q }); + try put(sink, "model.llm.layers.{d}.attn.gate_attn.weight", L, .bf16, &.{ q, h }); + try put(sink, "model.llm.layers.{d}.attn.attn_sink_proj.weight", L, .bf16, &.{ hd.q, h }); + try put(sink, "model.llm.layers.{d}.attn.q_l2_clip.scale", L, .bf16, &.{ hd.q, hd.dim }); + try put(sink, "model.llm.layers.{d}.attn.rel_l2_clip.scale", L, .bf16, &.{ hd.q, c.d_rel }); + try put(sink, "model.llm.layers.{d}.attn.rel_logits_proj.proj", L, .bf16, &.{ c.d_rel, c.extent(i) }); + inline for (.{ "k", "v" }) |kind| { + if (config.isGlobal(i)) { + try put(sink, "model.llm.layers.{d}.attn." ++ kind ++ "_sconv.static_w", L, .bf16, &.{ k, kv }); + try put(sink, "model.llm.layers.{d}.attn." ++ kind ++ "_sconv.weight_proj", L, .bf16, &.{ @as(u64, hd.kv) * k, h }); + } else { + try put(sink, "model.llm.layers.{d}.attn." ++ kind ++ "_sconv.weight", L, .bf16, &.{ kv, 1, k }); + } + } + if (config.isGlobal(i)) { + inline for (.{ "q", "k", "v" }) |kind| try put(sink, "model.llm.layers.{d}." ++ kind ++ "_input_norm.weight", L, .bf16, &.{h}); + } else { + try put(sink, "model.llm.layers.{d}.attn_norm.weight", L, .bf16, &.{h}); + } +} + +fn experts(c: *const Text, i: u32, prec: plan.Precision, sink: anytype) !void { + const h: u64 = c.hidden; + const m: u64 = c.expert_inter; + const e: u64 = c.experts; + const L = .{i}; + try put(sink, "model.llm.layers.{d}.mlp.gate.weight", L, .bf16, &.{ e, h }); + try put(sink, "model.llm.layers.{d}.mlp.gate.bias", L, .f32, &.{e}); + // gate and up are one tensor, w13: 2 * intermediate rows + const rows = [2][2]u64{ .{ 2 * m, h }, .{ h, m } }; + inline for (.{ "w13", "w2" }, 0..) |w, n| { + const r = rows[n][0]; + const k = rows[n][1]; + switch (prec) { + .nvfp4 => { + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight", L, .u8, &.{ e, r, k / 2 }); + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight_scale", L, .f8_e4m3, &.{ e, r, k / 16 }); + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight_amax", L, .f32, &.{e}); + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight_outer_scale_denominator", L, .f32, &.{1}); + }, + .mxfp8 => { + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight", L, .f8_e4m3, &.{ e, r, k }); + try put(sink, "model.llm.layers.{d}.mlp.experts." ++ w ++ "_weight_scale", L, .u8, &.{ e, r, k / 32 }); + }, + } + } +} + +fn backbone(c: *const Text, prec: []const plan.Precision, sink: anytype) !void { + const h: u64 = c.hidden; + try put(sink, "model.llm.embed.weight", .{}, .bf16, &.{ c.vocab, h }); + try put(sink, "model.llm.embed_norm.weight", .{}, .bf16, &.{h}); + try put(sink, "model.llm.norm.weight", .{}, .bf16, &.{h}); + try put(sink, "model.llm.unembed.weight", .{}, .bf16, &.{ c.vocab, h }); + try put(sink, "model.llm.attn_res.output_query", .{}, .f32, &.{h}); + for (0..c.layers) |k| { + const i: u32 = @intCast(k); + try put(sink, "model.llm.attn_res.mlp_queries.{d}", .{i}, .f32, &.{h}); + // queries.j feeds the attention input of layer j + 1: layer 0 reads the embedding alone + if (i + 1 < c.layers) { + const dims: []const u64 = if (config.isGlobal(i + 1)) &.{ 3, h } else &.{h}; + try put(sink, "model.llm.attn_res.attn_queries.{d}", .{i}, .f32, dims); + } + try attention(c, i, sink); + try put(sink, "model.llm.layers.{d}.attn_sconv.weight", .{i}, .bf16, &.{ h, 1, config.conv_taps }); + try put(sink, "model.llm.layers.{d}.mlp_norm.weight", .{i}, .bf16, &.{h}); + try put(sink, "model.llm.layers.{d}.mlp_sconv.weight", .{i}, .bf16, &.{ h, 1, config.conv_taps }); + try experts(c, i, prec[i], sink); + } +} + +fn vision(v: config.Vision, sink: anytype) !void { + const h: u64 = v.hidden; + const ff: u64 = h * v.mlp_ratio; + try put(sink, "model.visual.backbone.embeddings.class_embedding", .{}, .bf16, &.{h}); + try put(sink, "model.visual.backbone.embeddings.cls_position_embedding", .{}, .bf16, &.{h}); + try put(sink, "model.visual.backbone.embeddings.patch_embedding.weight", .{}, .bf16, &.{ h, 3 * @as(u64, v.patch) * v.patch }); + try put(sink, "model.visual.backbone.embeddings.position_embedding", .{}, .bf16, &.{ @as(u64, v.grid) * v.grid, h }); + inline for (.{ "weight", "bias" }) |p| try put(sink, "model.visual.backbone.ln_pre." ++ p, .{}, .bf16, &.{h}); + for (0..v.layers) |k| { + const L = .{k}; + const pre = "model.visual.backbone.layers.{d}."; + inline for (.{ "ln_1", "ln_2" }) |n| inline for (.{ "weight", "bias" }) |p| try put(sink, pre ++ n ++ "." ++ p, L, .bf16, &.{h}); + inline for (.{ "ls_1", "ls_2" }) |n| try put(sink, pre ++ n ++ ".gamma", L, .bf16, &.{h}); + inline for (.{ "q_proj", "k_proj", "v_proj", "out_proj" }) |n| { + try put(sink, pre ++ "self_attn." ++ n ++ ".weight", L, .bf16, &.{ h, h }); + try put(sink, pre ++ "self_attn." ++ n ++ ".bias", L, .bf16, &.{h}); + } + try put(sink, pre ++ "mlp.c_fc.weight", L, .bf16, &.{ ff, h }); + try put(sink, pre ++ "mlp.c_fc.bias", L, .bf16, &.{ff}); + try put(sink, pre ++ "mlp.c_proj.weight", L, .bf16, &.{ h, ff }); + try put(sink, pre ++ "mlp.c_proj.bias", L, .bf16, &.{h}); + } + try put(sink, "model.visual.proj_in.weight", .{}, .bf16, &.{ v.proj_hidden, h * v.merge * v.merge }); + try put(sink, "model.visual.proj_out.weight", .{}, .bf16, &.{ v.text_hidden, v.proj_hidden }); +} + +fn draft(m: config.Mtp, text: *const Text, sink: anytype) !void { + const h: u64 = text.hidden; + const q: u64 = @as(u64, m.q_heads) * m.head_dim; + const kv: u64 = @as(u64, m.kv_heads) * m.head_dim; + const rank: u64 = m.rank; + // fuse_weight's six rows do not follow from the config, so any row count passes + try put(sink, "fuse_weight", .{}, .bf16, &.{ any, m.taps_n }); + try put(sink, "mask_embed", .{}, .bf16, &.{h}); + try put(sink, "norm.weight", .{}, .bf16, &.{h}); + try put(sink, "markov_head.dflare_norm.weight", .{}, .bf16, &.{h}); + try put(sink, "markov_head.hidden_out.bias", .{}, .bf16, &.{h}); + try put(sink, "markov_head.hidden_out.weight", .{}, .bf16, &.{ h, m.rank }); + try put(sink, "markov_head.markov_w1.weight", .{}, .bf16, &.{ text.vocab, m.rank }); + try put(sink, "markov_head.rnn_proj.bias", .{}, .bf16, &.{3 * rank}); + try put(sink, "markov_head.rnn_proj.weight", .{}, .bf16, &.{ 3 * rank, 2 * h + 2 * rank }); + for (0..m.layers) |k| { + const L = .{k}; + const pre = "layers.{d}."; + inline for (.{ "dflare_norm", "input_layernorm", "post_attention_layernorm" }) |n| try put(sink, pre ++ n ++ ".weight", L, .bf16, &.{h}); + inline for (.{ "k_norm", "k_norm_ctx", "q_norm" }) |n| try put(sink, pre ++ "self_attn." ++ n ++ ".weight", L, .bf16, &.{m.head_dim}); + inline for (.{ "k_proj", "k_proj_ctx", "v_proj", "v_proj_ctx" }) |n| try put(sink, pre ++ "self_attn." ++ n ++ ".weight", L, .bf16, &.{ kv, h }); + try put(sink, pre ++ "self_attn.q_proj.weight", L, .bf16, &.{ q, h }); + try put(sink, pre ++ "self_attn.o_proj.weight", L, .bf16, &.{ h, q }); + try put(sink, pre ++ "mlp.gate_proj.weight", L, .bf16, &.{ m.inter, h }); + try put(sink, pre ++ "mlp.up_proj.weight", L, .bf16, &.{ m.inter, h }); + try put(sink, pre ++ "mlp.down_proj.weight", L, .bf16, &.{ h, m.inter }); + } +} + +/// Every tensor of `file` the config implies, as sink.put(name, dtype, dims); `prec` is one precision per layer. +pub fn all(c: *const config.Config, prec: []const plan.Precision, file: File, sink: anytype) !void { + switch (file) { + .model => { + try backbone(&c.text, prec, sink); + try vision(c.vision, sink); + }, + .mtp => try draft(c.mtp orelse return error.NoDraftHead, &c.text, sink), + } +} + +/// Each layer's expert precision from its w13 tensor: packed U8 is NVFP4, FP8 is MXFP8, anything else is refused. +pub fn precisions(entries: st.Header, layers: u32, out: []plan.Precision) !void { + if (out.len < layers) return error.PrecisionCount; + for (0..layers) |i| { + var buf: [96]u8 = undefined; + const name = try std.fmt.bufPrint(&buf, "model.llm.layers.{d}.mlp.experts.w13_weight", .{i}); + const hit = entries.get(name) orelse return error.NoExperts; + out[i] = switch (hit.dtype) { + .u8 => .nvfp4, + .f8_e4m3 => .mxfp8, + else => return error.ExpertFormat, + }; + } +} + +/// Every tensor of `from` added to `into`, for a checkpoint held in several files; a name in both is refused. +pub fn merge(arena: std.mem.Allocator, into: *st.Header, from: st.Header) !void { + for (from.keys(), from.values()) |name, entry| { + const slot = try into.getOrPut(arena, name); + if (slot.found_existing) return error.DuplicateName; + slot.value_ptr.* = entry; + } +} + +/// The map against a header: tensors it expects, those missing or held in another dtype or shape, and extras. +pub const Report = struct { + expected: usize = 0, + missing: std.ArrayList([]const u8) = .empty, + wrong: std.ArrayList([]const u8) = .empty, + unknown: std.ArrayList([]const u8) = .empty, + + pub fn clean(r: *const Report) bool { + return r.missing.items.len + r.wrong.items.len + r.unknown.items.len == 0; + } +}; + +const Checker = struct { + arena: std.mem.Allocator, + entries: st.Header, + seen: []bool, + report: *Report, + + pub fn put(k: *Checker, name: []const u8, dtype: Dtype, dims: []const u64) !void { + k.report.expected += 1; + const at = k.entries.getIndex(name) orelse return k.report.missing.append(k.arena, try k.arena.dupe(u8, name)); + if (k.seen[at]) return error.DuplicateName; + k.seen[at] = true; + const e = k.entries.values()[at]; + var same = e.dtype == dtype and e.rank == dims.len; + if (same) for (dims, e.shape[0..e.rank]) |want, got| { + if (want != any and want != got) same = false; + }; + if (!same) try k.report.wrong.append(k.arena, try k.arena.dupe(u8, name)); + } +}; + +fn lessThan(_: void, a: []const u8, b: []const u8) bool { + return std.mem.lessThan(u8, a, b); +} + +/// `entries` against the map of `file`; expert precisions come from the entries themselves (lists live in `arena`). +pub fn check(arena: std.mem.Allocator, c: *const config.Config, entries: st.Header, file: File) !Report { + var prec: [config.max_layers]plan.Precision = undefined; + if (file == .model) try precisions(entries, c.text.layers, &prec); + const seen = try arena.alloc(bool, entries.count()); + @memset(seen, false); + var r: Report = .{}; + var k: Checker = .{ .arena = arena, .entries = entries, .seen = seen, .report = &r }; + try all(c, &prec, file, &k); + for (entries.keys(), seen) |name, was| if (!was) try r.unknown.append(arena, name); + std.mem.sort([]const u8, r.unknown.items, {}, lessThan); + return r; +} diff --git a/zig/src/families/inkling2/names_test.zig b/zig/src/families/inkling2/names_test.zig new file mode 100644 index 00000000000..c5eb215d86b --- /dev/null +++ b/zig/src/families/inkling2/names_test.zig @@ -0,0 +1,253 @@ +//! The weight map and layer plan against the tiny-random checkpoint's safetensors headers (fixtures fold them). +const std = @import("std"); +const config = @import("config.zig"); +const config_test = @import("config_test.zig"); +const st = @import("safetensors"); +const names = @import("names.zig"); +const plan = @import("plan.zig"); + +const t = std.testing; +const model_fixture = @embedFile("fixtures/tiny_model_header.txt"); +const mtp_fixture = @embedFile("fixtures/tiny_mtp_header.txt"); + +fn byName(_: void, a: []const u8, b: []const u8) bool { + return std.mem.lessThan(u8, a, b); +} + +/// The tag safetensors writes for the four dtypes the fixtures hold. +fn dtypeTag(d: st.DType) []const u8 { + return switch (d) { + .bf16 => "BF16", + .f32 => "F32", + .f8_e4m3 => "F8_E4M3", + .u8 => "U8", + else => unreachable, + }; +} + +/// Each `{L}` line over its layer ranges; the header line holds the tag, the tensor count and the sha256 of the lines. +pub fn unfold(arena: std.mem.Allocator, text: []const u8, tag: []const u8) !st.Header { + var out: st.Header = .empty; + var lines = std.mem.tokenizeScalar(u8, text, '\n'); + var head = std.mem.tokenizeScalar(u8, lines.next().?, ' '); + if (!std.mem.eql(u8, head.next().?, tag)) return error.BadFixture; + const count = try std.fmt.parseInt(usize, head.next().?, 10); + const digest = head.next().?; + while (lines.next()) |line| { + var f = std.mem.tokenizeScalar(u8, line, ' '); + const pat = f.next().?; + const dtype = st.DType.parse(f.next().?).?; + var e: st.Entry = .{ .dtype = dtype, .rank = 0, .shape = @splat(1), .begin = 0, .end = 0 }; + var dims = std.mem.tokenizeScalar(u8, f.next().?, 'x'); + while (dims.next()) |d| : (e.rank += 1) e.shape[e.rank] = try std.fmt.parseInt(usize, d, 10); + const layers = f.next() orelse { + try out.put(arena, pat, e); + continue; + }; + var spans = std.mem.tokenizeScalar(u8, layers, ','); + while (spans.next()) |span| { + const dash = std.mem.indexOfScalar(u8, span, '-'); + const lo = try std.fmt.parseInt(u32, if (dash) |d| span[0..d] else span, 10); + const hi = if (dash) |d| try std.fmt.parseInt(u32, span[d + 1 ..], 10) else lo; + for (lo..hi + 1) |l| { + var b: [8]u8 = undefined; + const named = try std.mem.replaceOwned(u8, arena, pat, "{L}", try std.fmt.bufPrint(&b, "{d}", .{l})); + try out.put(arena, named, e); + } + } + } + if (out.count() != count) return error.BadFixture; + const sorted = try arena.dupe([]const u8, out.keys()); + std.mem.sort([]const u8, sorted, {}, byName); + var h = std.crypto.hash.sha2.Sha256.init(.{}); + for (sorted, 0..) |name, i| { + if (i > 0) h.update("\n"); + const e = out.get(name).?; + var shape: std.ArrayList(u8) = .empty; + for (e.shape[0..e.rank], 0..) |d, k| try shape.print(arena, "{s}{d}", .{ if (k > 0) "x" else "", d }); + h.update(try std.fmt.allocPrint(arena, "{s} {s} {s}", .{ name, dtypeTag(e.dtype), shape.items })); + } + var d: [32]u8 = undefined; + h.final(&d); + if (!std.mem.eql(u8, &std.fmt.bytesToHex(d, .lower), digest)) return error.BadFixture; + return out; +} + +fn load(a: std.mem.Allocator) !config.Config { + var why: config.Why = .{}; + return config.parse(a, config_test.tiny, &why); +} + +test "the folded fixtures unfold to the 404 and 84 tensors of tiny's two files, digests equal" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + try t.expectEqual(@as(usize, 404), (try unfold(arena.allocator(), model_fixture, "inkling2-tiny-model")).count()); + try t.expectEqual(@as(usize, 84), (try unfold(arena.allocator(), mtp_fixture, "inkling2-tiny-mtp")).count()); +} + +test "the map names exactly tiny's backbone and vision tensors, with their dtypes and shapes" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const c = try load(a); + const entries = try unfold(a, model_fixture, "inkling2-tiny-model"); + const r = try names.check(a, &c, entries, .model); + try t.expectEqual(@as(usize, 404), r.expected); + try t.expectEqual(@as(usize, 0), r.missing.items.len); + try t.expectEqual(@as(usize, 0), r.wrong.items.len); + try t.expectEqual(@as(usize, 0), r.unknown.items.len); +} + +test "the map names exactly tiny's draft head tensors" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const c = try load(a); + const r = try names.check(a, &c, try unfold(a, mtp_fixture, "inkling2-tiny-mtp"), .mtp); + try t.expectEqual(@as(usize, 84), r.expected); + try t.expect(r.clean()); +} + +test "a missing tensor, a wrong shape, a wrong dtype and an unknown tensor are each reported by name" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const c = try load(a); + const all = try unfold(a, model_fixture, "inkling2-tiny-model"); + var kept: st.Header = .empty; + for (all.keys(), all.values()) |name, e| { + var x = e; + if (std.mem.eql(u8, name, "model.llm.layers.3.attn.wq_du.weight")) continue; // missing + if (std.mem.eql(u8, name, "model.llm.layers.4.attn.wk_dv.weight")) x.shape[0] += 1; // shape + if (std.mem.eql(u8, name, "model.llm.layers.2.mlp.gate.bias")) x.dtype = .bf16; // dtype + try kept.put(a, name, x); + } + try kept.put(a, "model.llm.layers.0.attn.rope_freqs", kept.values()[0]); + const r = try names.check(a, &c, kept, .model); + try t.expectEqualStrings("model.llm.layers.3.attn.wq_du.weight", r.missing.items[0]); + try t.expectEqual(@as(usize, 1), r.missing.items.len); + try t.expectEqualStrings("model.llm.layers.2.mlp.gate.bias", r.wrong.items[0]); + try t.expectEqualStrings("model.llm.layers.4.attn.wk_dv.weight", r.wrong.items[1]); + try t.expectEqualStrings("model.llm.layers.0.attn.rope_freqs", r.unknown.items[0]); + try t.expect(!r.clean()); +} + +test "core's header reader feeds the map: a wrong dtype, a wrong rank and an extra tensor are reported by name" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const c = try load(a); + const json = + \\{"__metadata__":{"format":"pt"},"mask_embed":{"dtype":"F16","shape":[128],"data_offsets":[0,256]}, + \\"norm.weight":{"dtype":"BF16","shape":[128,1],"data_offsets":[256,512]},"extra":{"dtype":"U8","shape":[],"data_offsets":[512,513]}} + ; + const r = try names.check(a, &c, try st.parseHeader(a, json, 513), .mtp); + try t.expectEqual(@as(usize, 84), r.expected); + try t.expectEqual(@as(usize, 82), r.missing.items.len); + try t.expectEqualStrings("mask_embed", r.wrong.items[0]); + try t.expectEqualStrings("norm.weight", r.wrong.items[1]); + try t.expectEqual(@as(usize, 2), r.wrong.items.len); + try t.expectEqualStrings("extra", r.unknown.items[0]); + try t.expectEqual(@as(usize, 1), r.unknown.items.len); +} + +test "merging the headers of several files keeps every tensor and refuses a name held twice" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const one = try st.parseHeader(a, "{\"a\":{\"dtype\":\"U8\",\"shape\":[1],\"data_offsets\":[0,1]}}", 1); + const two = try st.parseHeader(a, "{\"b\":{\"dtype\":\"U8\",\"shape\":[1],\"data_offsets\":[0,1]}}", 1); + var all: st.Header = .empty; + try names.merge(a, &all, one); + try names.merge(a, &all, two); + try t.expectEqual(@as(usize, 2), all.count()); + try t.expectError(error.DuplicateName, names.merge(a, &all, one)); +} + +test "expert precision follows each layer's tensors: NVFP4 on layers 0 to 5, MXFP8 on 6 to 11" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const entries = try unfold(a, model_fixture, "inkling2-tiny-model"); + var prec: [12]plan.Precision = undefined; + try names.precisions(entries, 12, &prec); + for (prec, 0..) |p, i| try t.expectEqual(if (i < 6) plan.Precision.nvfp4 else plan.Precision.mxfp8, p); + var bad = try entries.clone(a); + bad.getPtr("model.llm.layers.7.mlp.experts.w13_weight").?.dtype = .bf16; + try t.expectError(error.ExpertFormat, names.precisions(bad, 12, &prec)); +} + +test "the plan: global layers 5 and 11, blocks of six, three attention queries before each global layer" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const c = try load(a); + var prec: [12]plan.Precision = undefined; + try names.precisions(try unfold(a, model_fixture, "inkling2-tiny-model"), 12, &prec); + const p = try plan.build(&c.text, &prec); + try t.expectEqual(@as(u32, 2), p.count(.global)); + try t.expectEqual(@as(u32, 10), p.count(.local)); + for (0..12) |i| try t.expectEqual(i == 5 or i == 11, p.at(@intCast(i)).kind == .global); + try t.expect(p.at(0).boundary and p.at(6).boundary and !p.at(5).boundary); + try t.expectEqual(@as(u8, 0), p.at(0).attn_queries); + try t.expectEqual(@as(u8, 3), p.at(5).attn_queries); + try t.expectEqual(@as(u8, 1), p.at(6).attn_queries); + // layer 0: no attention input, the MLP input sees its own input as a block and the partial output + try t.expectEqual(@as(u32, 2), p.at(0).mlp_sources); + try t.expectEqual(@as(u32, 2), p.at(1).attn_sources); + try t.expectEqual(@as(u32, 3), p.at(6).mlp_sources); + try t.expectEqual(@as(u32, 3), p.at(11).attn_sources); + try t.expectEqual(@as(u32, 3), p.final_sources); + try t.expectError(error.PrecisionCount, plan.build(&c.text, prec[0..11])); +} + +/// A file's header through the core reader; the files may hold the header alone, so no data length is checked. +fn headerOf(a: std.mem.Allocator, dir: []const u8, file: []const u8) !st.Header { + const path = try std.fmt.allocPrint(a, "{s}/{s}", .{ dir, file }); + const f = try std.Io.Dir.cwd().openFile(t.io, path, .{}); + defer f.close(t.io); + var prefix: [8]u8 = undefined; + if (try f.readPositionalAll(t.io, &prefix, 0) != 8) return error.BadSafetensors; + const size = std.math.cast(usize, try f.length(t.io)) orelse return error.BadSafetensors; + const json = try a.alloc(u8, try st.headerSize(std.mem.readInt(u64, &prefix, .little), size)); + if (try f.readPositionalAll(t.io, json, 8) != json.len) return error.BadSafetensors; + return st.parseHeader(a, json, std.math.maxInt(usize)); +} + +test "tiny-random's real model.safetensors and mtp.safetensors headers match the map (TF_INKLING2_TINY=)" { + const dir = std.mem.span(std.c.getenv("TF_INKLING2_TINY") orelse return error.SkipZigTest); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var why: config.Why = .{}; + const c = try config.parse(a, config_test.tiny, &why); + const model = try names.check(a, &c, try headerOf(a, dir, "model.safetensors"), .model); + try t.expectEqual(@as(usize, 404), model.expected); + try t.expect(model.clean()); + const mtp = try names.check(a, &c, try headerOf(a, dir, "mtp.safetensors"), .mtp); + try t.expectEqual(@as(usize, 84), mtp.expected); + try t.expect(mtp.clean()); +} + +test "the real checkpoint's 24 shard headers and mtp.safetensors match the map (TF_INKLING2_REAL=)" { + const dir = std.mem.span(std.c.getenv("TF_INKLING2_REAL") orelse return error.SkipZigTest); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var why: config.Why = .{}; + const c = try config.parse(a, config_test.real, &why); + var all: st.Header = .empty; + for (1..25) |i| { + const file = try std.fmt.allocPrint(a, "model-{d:0>5}-of-00024.safetensors", .{i}); + try names.merge(a, &all, try headerOf(a, dir, file)); + } + const model = try names.check(a, &c, all, .model); + try t.expectEqual(@as(usize, 1770), model.expected); + try t.expect(model.clean()); + var prec: [config.max_layers]plan.Precision = undefined; + try names.precisions(all, c.text.layers, &prec); + for (prec[0..48], 0..) |p, i| try t.expectEqual(if (i < 40) plan.Precision.nvfp4 else plan.Precision.mxfp8, p); + const mtp = try names.check(a, &c, try headerOf(a, dir, "mtp.safetensors"), .mtp); + try t.expectEqual(@as(usize, 84), mtp.expected); + try t.expect(mtp.clean()); +} diff --git a/zig/src/families/inkling2/plan.zig b/zig/src/families/inkling2/plan.zig new file mode 100644 index 00000000000..c2327d26bef --- /dev/null +++ b/zig/src/families/inkling2/plan.zig @@ -0,0 +1,62 @@ +//! The layer plan: which layers slide or see everything, where attention-residual blocks end, what layers sum over. +const std = @import("std"); +const config = @import("config.zig"); + +/// A routed-expert layer's stored format, read from its tensors: ModelOpt NVFP4 (groups of 16) or MXFP8 (groups of 32). +pub const Precision = enum { nvfp4, mxfp8 }; + +pub const Kind = enum { local, global }; + +pub const Layer = struct { + kind: Kind, + heads: config.Heads, + extent: u32, // backward tokens the relative bias reaches + boundary: bool, // the layer's input joins the finished blocks after its attention, before its MLP input is formed + blocks_in: u32, // finished block states when the layer starts + attn_queries: u8, // learned queries of the attention input: none for layer 0, one per q/k/v for a global layer + attn_sources: u32, // states the attention input attends over: finished blocks plus the running partial one + mlp_sources: u32, // the same for the MLP input; a boundary layer first adds its own input as a block + precision: Precision, +}; + +pub const Plan = struct { + layers: [config.max_layers]Layer, + n: u32, + final_sources: u32, // the output query's states: every finished block and the last layer's output + + pub fn at(p: *const Plan, i: u32) *const Layer { + return &p.layers[i]; + } + + pub fn count(p: *const Plan, kind: Kind) u32 { + var k: u32 = 0; + for (p.layers[0..p.n]) |l| k += @intFromBool(l.kind == kind); + return k; + } +}; + +/// The plan for a parsed config and each layer's expert precision (`prec` holds one entry per layer). +pub fn build(c: *const config.Text, prec: []const Precision) error{PrecisionCount}!Plan { + if (prec.len != c.layers) return error.PrecisionCount; + var p: Plan = undefined; + p.n = c.layers; + for (0..c.layers) |k| { + const i: u32 = @intCast(k); + const boundary = i % c.block == 0; + const blocks_in = (i + c.block - 1) / c.block; + const global = config.isGlobal(i); + p.layers[i] = .{ + .kind = if (global) .global else .local, + .heads = c.heads(i), + .extent = c.extent(i), + .boundary = boundary, + .blocks_in = blocks_in, + .attn_queries = if (i == 0) 0 else if (global) 3 else 1, + .attn_sources = blocks_in + 1, + .mlp_sources = blocks_in + 1 + @intFromBool(boundary), + .precision = prec[i], + }; + } + p.final_sources = (c.layers + c.block - 1) / c.block + 1; + return p; +} diff --git a/zig/src/families/inkling2/prompt.zig b/zig/src/families/inkling2/prompt.zig new file mode 100644 index 00000000000..c6083f3ac9c --- /dev/null +++ b/zig/src/families/inkling2/prompt.zig @@ -0,0 +1,53 @@ +//! A text prompt as Inkling 2 Small's chat template renders it, and its ids and text through the tokenizer. +const std = @import("std"); +const template = @import("template"); +const tokenizer = @import("tokenizer"); + +/// One user turn, an optional system turn before it, and the thinking effort the template writes. +pub const Request = struct { + user: []const u8, + system: ?[]const u8 = null, + /// A name (none, minimal, low, medium, high, xhigh, max) or a number from 0 to 0.99; null: the template's own 0.9. + effort: ?[]const u8 = null, +}; + +/// Whether effort text is a plain decimal (digits, sign, point, exponent) rather than a name or Zig-only number syntax. +fn plainNumber(e: []const u8) bool { + if (e.len == 0) return false; + for (e) |ch| if (!std.ascii.isDigit(ch) and std.mem.indexOfScalar(u8, ".eE+-", ch) == null) return false; + return true; +} + +/// The rendered prompt: the template's text for `req`, owned by `gpa`; the template's own refusal lands in `diag`. +pub fn render(gpa: std.mem.Allocator, compiled: *const template.Compiled, req: Request, diag: ?*template.Diag) ![]u8 { + var arena = std.heap.ArenaAllocator.init(gpa); + defer arena.deinit(); + const a = arena.allocator(); + const Msg = struct { role: []const u8, content: []const u8 }; + var msgs: [2]Msg = undefined; + var n: usize = 0; + if (req.system) |s| { + msgs[n] = .{ .role = "system", .content = s }; + n += 1; + } + msgs[n] = .{ .role = "user", .content = req.user }; + n += 1; + const messages = try std.json.parseFromSliceLeaky(std.json.Value, a, try std.json.Stringify.valueAlloc(a, msgs[0..n], .{}), .{}); + var context: std.json.ObjectMap = .empty; + if (req.effort) |e| { + const parsed: ?f64 = if (plainNumber(e)) (std.fmt.parseFloat(f64, e) catch null) else null; + const v: std.json.Value = if (parsed) |x| (if (std.math.isFinite(x)) .{ .float = x } else .{ .string = e }) else .{ .string = e }; + try context.put(a, "reasoning_effort", v); + } + return template.render(gpa, compiled, messages, .null, .{ .object = context }, true, diag); +} + +/// Token ids of `text`: the tokenizer applied to a rendered prompt as the reference does, no post-processor tokens. +pub fn encode(a: std.mem.Allocator, tok: *const tokenizer.Tokenizer, text: []const u8) ![]u32 { + return tok.encode(a, text); +} + +/// The text of `ids`, special tokens spelled out. +pub fn decode(a: std.mem.Allocator, tok: *const tokenizer.Tokenizer, ids: []const u32) ![]u8 { + return tok.decode(a, ids, false); +} diff --git a/zig/src/families/inkling2/template_test.zig b/zig/src/families/inkling2/template_test.zig new file mode 100644 index 00000000000..306511c235d --- /dev/null +++ b/zig/src/families/inkling2/template_test.zig @@ -0,0 +1,53 @@ +//! The checkpoint's chat template through TensorFold's template core, against the reference's rendered prompts. +const std = @import("std"); +const template = @import("template"); +const prompt = @import("prompt.zig"); + +const t = std.testing; +pub const jinja = @embedFile("fixtures/chat_template.jinja"); +pub const cases_json = @embedFile("fixtures/prompt_cases.json"); + +/// The effort a case passed the reference, as the text prompt.zig takes: a name, or a number written out. +pub fn effortText(a: std.mem.Allocator, v: ?std.json.Value) !?[]const u8 { + const e = v orelse return null; + return switch (e) { + .string => |s| s, + .integer => |i| try std.fmt.allocPrint(a, "{d}", .{i}), + .float => |f| try std.fmt.allocPrint(a, "{d}", .{f}), + else => error.BadCase, + }; +} + +fn field(o: std.json.ObjectMap, key: []const u8) ?[]const u8 { + const v = o.get(key) orelse return null; + return v.string; +} + +test "every reference prompt is rendered byte for byte, thinking effort names and numbers included" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const doc = try std.json.parseFromSliceLeaky(std.json.Value, a, cases_json, .{}); + var compiled = try template.compile(t.allocator, jinja, null); + defer compiled.deinit(); + const cases = doc.object.get("chat").?.array.items; + try t.expect(cases.len >= 20); + for (cases) |c| { + const o = c.object; + const req: prompt.Request = .{ .user = field(o, "user").?, .system = field(o, "system"), .effort = try effortText(a, o.get("effort")) }; + const got = try prompt.render(t.allocator, &compiled, req, null); + defer t.allocator.free(got); + try t.expectEqualStrings(field(o, "prompt").?, got); + } +} + +test "the template raises for an unknown effort, one out of range and text that is no plain decimal, as the reference does" { + var compiled = try template.compile(t.allocator, jinja, null); + defer compiled.deinit(); + for ([_][]const u8{ "turbo", "1.5", "-0.1", "nan", "inf", "-infinity", "0x1p-1", "0.5_5" }) |bad| { + var diag: template.Diag = .{}; + defer t.allocator.free(diag.msg); + try t.expectError(error.TemplateFailed, prompt.render(t.allocator, &compiled, .{ .user = "hi", .effort = bad }, &diag)); + try t.expect(diag.raised); + } +} diff --git a/zig/src/families/inkling2/tokenizer_test.zig b/zig/src/families/inkling2/tokenizer_test.zig new file mode 100644 index 00000000000..cd8338b81ab --- /dev/null +++ b/zig/src/families/inkling2/tokenizer_test.zig @@ -0,0 +1,92 @@ +//! The checkpoint's tokenizer through TensorFold's tokenizer core, against the reference's ids. +const std = @import("std"); +const template = @import("template"); +const tokenizer = @import("tokenizer"); +const prompt = @import("prompt.zig"); +const template_test = @import("template_test.zig"); + +const t = std.testing; + +/// Loads the checkpoint's tokenizer from the path TF_INKLING2_CKPT names: its directory or its tokenizer.json. +fn load() !tokenizer.Tokenizer { + const path = std.mem.span(std.c.getenv("TF_INKLING2_CKPT") orelse return error.SkipZigTest); + return tokenizer.loadTokenizer(t.io, t.allocator, path); +} + +fn ids(a: std.mem.Allocator, v: std.json.Value) ![]u32 { + const out = try a.alloc(u32, v.array.items.len); + for (v.array.items, out) |x, *y| y.* = @intCast(x.integer); + return out; +} + +test "rendered prompts encode to the reference's ids and decode back to the prompt (TF_INKLING2_CKPT)" { + var tok = try load(); + defer tok.deinit(); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const doc = try std.json.parseFromSliceLeaky(std.json.Value, a, template_test.cases_json, .{}); + var compiled = try template.compile(t.allocator, template_test.jinja, null); + defer compiled.deinit(); + for (doc.object.get("chat").?.array.items) |c| { + const o = c.object; + const req: prompt.Request = .{ + .user = o.get("user").?.string, + .system = if (o.get("system")) |s| s.string else null, + .effort = try template_test.effortText(a, o.get("effort")), + }; + const text = try prompt.render(a, &compiled, req, null); + const got = try prompt.encode(a, &tok, text); + try t.expectEqualSlices(u32, try ids(a, o.get("ids").?), got); + try t.expectEqualStrings(o.get("decoded").?.string, try prompt.decode(a, &tok, got)); + try t.expectEqualStrings(text, try prompt.decode(a, &tok, got)); + } +} + +test "plain text encodes to the reference's ids with no template (TF_INKLING2_CKPT)" { + var tok = try load(); + defer tok.deinit(); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const doc = try std.json.parseFromSliceLeaky(std.json.Value, a, template_test.cases_json, .{}); + for (doc.object.get("raw").?.array.items) |c| { + const o = c.object; + const got = try prompt.encode(a, &tok, o.get("text").?.string); + try t.expectEqualSlices(u32, try ids(a, o.get("ids").?), got); + try t.expectEqualStrings(o.get("decoded").?.string, try prompt.decode(a, &tok, got)); + } +} + +test "the checkpoint's split regex, added tokens and byte alphabet encode to the reference's ids (cut tokenizer, always run)" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tok = try tokenizer.parse(t.allocator, @embedFile("fixtures/mini_tokenizer.json")); + defer tok.deinit(); + const doc = try std.json.parseFromSliceLeaky(std.json.Value, a, @embedFile("fixtures/mini_cases.json"), .{}); + const cases = doc.object.get("cases").?.array.items; + try t.expect(cases.len >= 14); + for (cases) |c| { + const o = c.object; + const got = try prompt.encode(a, &tok, o.get("text").?.string); + try t.expectEqualSlices(u32, try ids(a, o.get("ids").?), got); + try t.expectEqualStrings(o.get("decoded").?.string, try prompt.decode(a, &tok, got)); + } +} + +test "control: another split regex changes the cut tokenizer's ids, so the equality above is not vacuous" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tok = try tokenizer.parse(t.allocator, @embedFile("fixtures/mini_tokenizer.json")); + defer tok.deinit(); + try tok.overrideSplit("[\\s\\S]"); + const doc = try std.json.parseFromSliceLeaky(std.json.Value, a, @embedFile("fixtures/mini_cases.json"), .{}); + var differing: usize = 0; + for (doc.object.get("cases").?.array.items) |c| { + const got = try prompt.encode(a, &tok, c.object.get("text").?.string); + differing += @intFromBool(!std.mem.eql(u32, try ids(a, c.object.get("ids").?), got)); + } + try t.expect(differing >= 1); +} diff --git a/zig/src/families/muse_spark/config.zig b/zig/src/families/muse_spark/config.zig new file mode 100644 index 00000000000..572998ed59a --- /dev/null +++ b/zig/src/families/muse_spark/config.zig @@ -0,0 +1,316 @@ +//! Muse Spark Open's checkpoint facts (text model) and a rank's EXL3 cuts, as exllamav3's muse_spark reads them. + +const std = @import("std"); + +pub const model_type = "muse_spark"; +pub const text_type = "muse_spark_text"; +pub const max_layers = 64; +/// The tensors' prefix in the pack: the text model of the multimodal checkpoint. +pub const prefix = "model.language_model."; + +pub const Config = struct { + layers: usize, + hidden: usize, // 8192 + heads: usize, // query heads; a rank's under TP + kv_heads: usize, + head_dim: usize, // 64 + window: usize, // past keys a sliding row sees: sliding_window - 1 (the reference mask counts the row itself) + full: [max_layers]bool = @splat(false), // full attention, else sliding + theta: [max_layers]f64 = @splat(0), // RoPE theta of the layer, 0 = NoPE + latent: usize, // moe_hidden_size: the experts' model width (4096) + width: usize, // moe_intermediate_size: an expert's width; a rank's under TP + experts: usize, + top_k: usize, + vocab: usize, // real tokens; the head's rows are padded to a multiple of 128 + eps: f64, // rms_norm_eps: input, pre-ffn, pre-expert, qk, o and final norms + post_eps: f64, // post_norm_eps: post-attention, post-ffn and post-expert norms + qk_scale: f64, // qk_scale_factor: folds into the softmax scale + out_mult: f64, // output_multiplier: router logits and head pre-scale + softcap: f64, // final_logit_softcapping, 0 = none + gate_temp: f64, // residual_gate_temperature + route_scale: f64, // routed_scaling_factor + eos: [4]u32 = @splat(0), + eos_len: usize = 0, + + pub fn isEos(c: Config, t: u32) bool { + return std.mem.indexOfScalar(u32, c.eos[0..c.eos_len], t) != null; + } + pub fn rope(c: Config, i: usize) bool { + return c.theta[i] != 0; + } + /// The softmax scale: qk_scale_factor * head_dim ** -0.5 (exllamav3's sm_scale), as a Python float. + pub fn smScale(c: Config) f64 { + return c.qk_scale * std.math.pow(f64, @floatFromInt(c.head_dim), -0.5); + } + + /// config.json (+ generation_config.json's EOS ids); refuses every variant the forward does not wire. + pub fn parse(gpa: std.mem.Allocator, config_json: []const u8, generation_json: ?[]const u8) !Config { + const parsed = try std.json.parseFromSlice(std.json.Value, gpa, config_json, .{}); + defer parsed.deinit(); + const top = parsed.value.object; + if (!std.mem.eql(u8, str(top, "model_type") orelse "", model_type)) return error.NotMuseSpark; + const q = if (top.get("quantization_config")) |v| v.object else return error.NotExl3; + if (!std.mem.eql(u8, str(q, "quant_method") orelse "", "exl3")) return error.NotExl3; + if (!std.mem.eql(u8, str(q, "codebook") orelse "mul1", "mul1")) return error.NotMul1; + const o = (top.get("text_config") orelse return error.MissingField).object; + if (!std.mem.eql(u8, str(o, "model_type") orelse text_type, text_type)) return error.NotMuseSpark; + if (boolean(o, "attention_bias") or boolean(o, "tie_word_embeddings")) return error.Unsupported; + if (!std.mem.eql(u8, str(o, "hidden_act") orelse "silu", "silu")) return error.UnsupportedActivation; + if ((int(o, "num_shared_experts") orelse 0) != 0) return error.UnsupportedRouting; + if (o.get("rope_parameters")) |rp| if (rp == .object) { + if (!std.mem.eql(u8, str(rp.object, "rope_type") orelse "default", "default")) return error.UnsupportedRope; + }; + var c: Config = .{ + .layers = try need(o, "num_hidden_layers"), + .hidden = try need(o, "hidden_size"), + .heads = try need(o, "num_attention_heads"), + .kv_heads = try need(o, "num_key_value_heads"), + .head_dim = try need(o, "head_dim"), + .window = (try need(o, "sliding_window")) - 1, + .latent = try need(o, "moe_hidden_size"), + .width = try need(o, "moe_intermediate_size"), + .experts = try need(o, "num_local_experts"), + .top_k = try need(o, "num_experts_per_tok"), + .vocab = try need(o, "vocab_size"), + .eps = try numNeed(o, "rms_norm_eps"), + .post_eps = if (o.get("post_norm_eps")) |v| num(v) else try numNeed(o, "rms_norm_eps"), + .qk_scale = if (o.get("qk_scale_factor")) |v| num(v) else 1.0, + .out_mult = if (o.get("output_multiplier")) |v| num(v) else 1.0, + .softcap = if (o.get("final_logit_softcapping")) |v| num(v) else 0.0, + .gate_temp = try numNeed(o, "residual_gate_temperature"), + .route_scale = if (o.get("routed_scaling_factor")) |v| num(v) else 1.0, + }; + if (c.layers > max_layers) return error.TooManyLayers; + if (c.head_dim != 64) return error.HeadDim; // the attention kernels: a lane holds dims l and l + 32 + if (c.heads % c.kv_heads != 0 or c.heads / c.kv_heads != 8) return error.GroupSize; // a warp a query head of the group + if (c.top_k > 32 or c.experts > 1024) return error.UnsupportedRouting; + const types = (o.get("layer_types") orelse return error.MissingField).array.items; + if (types.len != c.layers) return error.LayerPattern; + if (o.get("mlp_layer_types")) |m| for (m.array.items) |t| { + if (!std.mem.eql(u8, t.string, "sparse")) return error.DenseMlp; + }; + var default_theta: f64 = 500000.0; + if (o.get("rope_parameters")) |rp| if (rp == .object) if (rp.object.get("rope_theta")) |v| { + default_theta = num(v); + }; + const thetas: ?[]std.json.Value = if (o.get("layer_rope_theta")) |v| v.array.items else null; + if (thetas != null and thetas.?.len != c.layers) return error.LayerPattern; + for (types, 0..) |t, i| { + if (std.mem.eql(u8, t.string, "full_attention")) { + c.full[i] = true; + } else if (!std.mem.eql(u8, t.string, "sliding_attention")) return error.LayerPattern; + c.theta[i] = if (thetas) |th| num(th[i]) else default_theta; + } + if (o.get("eos_token_id")) |v| c.addEos(v); + if (generation_json) |g| { + const gp = try std.json.parseFromSlice(std.json.Value, gpa, g, .{}); + defer gp.deinit(); + if (gp.value.object.get("eos_token_id")) |v| c.addEos(v); + } + return c; + } + + fn addEos(c: *Config, v: std.json.Value) void { + switch (v) { + .integer => |i| c.pushEos(@intCast(i)), + .array => |a| for (a.items) |x| if (x == .integer) c.pushEos(@intCast(x.integer)), + else => {}, + } + } + fn pushEos(c: *Config, t: u32) void { + if (c.isEos(t) or c.eos_len == c.eos.len) return; + c.eos[c.eos_len] = t; + c.eos_len += 1; + } + + /// A rank's view at two ranks (as `admit`): heads, KV heads and the expert width split; the latent stays whole. + pub fn rankView(c: Config, world: usize) !Config { + if (world != 2) return error.MuseSparkRequiresTwoRanks; + if (c.heads % world != 0 or c.kv_heads % world != 0) return error.HeadsSplit; + if (c.width % (128 * world) != 0 or c.latent % (128 * world) != 0) return error.WidthSplit; + if ((c.heads / world) * c.head_dim % 128 != 0 or (c.kv_heads / world) * c.head_dim % 128 != 0) return error.HeadsSplit; + var r = c; + r.heads = c.heads / world; + r.kv_heads = c.kv_heads / world; + r.width = c.width / world; + return r; + } +}; + +/// Muse Spark is served only as it was gated: on GB10 (sm_121), at two TP ranks. +pub fn admit(sm: u32, world: usize) error{ MuseSparkRequiresSm121, MuseSparkRequiresTwoRanks }!void { + if (sm != 121) return error.MuseSparkRequiresSm121; + if (world != 2) return error.MuseSparkRequiresTwoRanks; +} + +/// One EXL3 matrix a rank loads: its tensors' prefix and the cut: outputs (`n`) or inputs (`k`). +pub const Cut = struct { + prefix: []const u8, + axis: enum { whole, n, k } = .whole, + lo: usize = 0, + hi: usize = 0, +}; + +/// The layer's matrices in load order: q, k, v, gate, o, pre_expert, post_expert, then (gate, up, down) per expert. +pub const attn_mats = 5; +pub const latent_mats = 2; + +/// Every EXL3 matrix of layer `i` a rank loads, by heads, latent halves and expert width; `buf` holds the prefixes. +pub fn layerCuts(full: Config, i: usize, rank: usize, world: usize, buf: *std.ArrayList(u8), gpa: std.mem.Allocator, out: *std.ArrayList(Cut)) !void { + const hq = full.heads / world * full.head_dim; + const hk = full.kv_heads / world * full.head_dim; + const lat = full.latent / world; + const wid = full.width / world; + const r = rank; + const one = struct { + fn f(g: std.mem.Allocator, b: *std.ArrayList(u8), o: *std.ArrayList(Cut), comptime fmt: []const u8, args: anytype, axis: @FieldType(Cut, "axis"), lo: usize, hi: usize, w: usize) !void { + const start = b.items.len; + try b.print(g, prefix ++ fmt, args); + try o.append(g, .{ .prefix = b.items[start..], .axis = if (w == 1) .whole else axis, .lo = lo, .hi = hi }); + } + }.f; + try one(gpa, buf, out, "layers.{d}.self_attn.q_proj", .{i}, .n, r * hq, (r + 1) * hq, world); + try one(gpa, buf, out, "layers.{d}.self_attn.k_proj", .{i}, .n, r * hk, (r + 1) * hk, world); + try one(gpa, buf, out, "layers.{d}.self_attn.v_proj", .{i}, .n, r * hk, (r + 1) * hk, world); + try one(gpa, buf, out, "layers.{d}.self_attn.gate_proj", .{i}, .n, r * hq, (r + 1) * hq, world); + try one(gpa, buf, out, "layers.{d}.self_attn.o_proj", .{i}, .k, r * hq, (r + 1) * hq, world); + try one(gpa, buf, out, "layers.{d}.mlp.pre_expert_proj", .{i}, .n, r * lat, (r + 1) * lat, world); + try one(gpa, buf, out, "layers.{d}.mlp.post_expert_proj", .{i}, .k, r * lat, (r + 1) * lat, world); + for (0..full.experts) |e| { + try one(gpa, buf, out, "layers.{d}.mlp.experts.{d}.gate_proj", .{ i, e }, .n, r * wid, (r + 1) * wid, world); + try one(gpa, buf, out, "layers.{d}.mlp.experts.{d}.up_proj", .{ i, e }, .n, r * wid, (r + 1) * wid, world); + try one(gpa, buf, out, "layers.{d}.mlp.experts.{d}.down_proj", .{ i, e }, .k, r * wid, (r + 1) * wid, world); + } +} + +/// lm_head's rows of a rank in 128-row blocks of the padded head (1579 blocks: 790 + 789 at TP=2). +pub fn headCut(n: usize, rank: usize, world: usize) Cut { + if (world == 1) return .{ .prefix = "lm_head", .lo = 0, .hi = n }; + const blocks = n / 128; + const first = (blocks + 1) / 2; + const lo = if (rank == 0) 0 else first * 128; + const hi = if (rank == 0) first * 128 else n; + return .{ .prefix = "lm_head", .axis = .n, .lo = lo, .hi = hi }; +} + +/// Columns a rank's head slice occupies in the gather buffer: the widest rank's. +pub fn headStride(n: usize, world: usize) usize { + return if (world == 1) n else ((n / 128 + 1) / 2) * 128; +} + +fn str(o: std.json.ObjectMap, k: []const u8) ?[]const u8 { + const v = o.get(k) orelse return null; + return if (v == .string) v.string else null; +} +fn int(o: std.json.ObjectMap, k: []const u8) ?usize { + const v = o.get(k) orelse return null; + return switch (v) { + .integer => |i| @intCast(i), + else => null, + }; +} +fn need(o: std.json.ObjectMap, k: []const u8) !usize { + return int(o, k) orelse error.MissingField; +} +fn num(v: std.json.Value) f64 { + return switch (v) { + .integer => |i| @floatFromInt(i), + .float => |f| f, + .number_string => |s| std.fmt.parseFloat(f64, s) catch 0, + else => 0, + }; +} +fn numNeed(o: std.json.ObjectMap, k: []const u8) !f64 { + return num(o.get(k) orelse return error.MissingField); +} +fn boolean(o: std.json.ObjectMap, k: []const u8) bool { + const v = o.get(k) orelse return false; + return v == .bool and v.bool; +} + +// The fields Config.parse reads, as the 2-layer dry-run pack's config.json has them (text_config of Muse Spark Open). +const fixture = + \\{"model_type": "muse_spark", "quantization_config": {"quant_method": "exl3", "codebook": "mul1", "bits": 2.04}, + \\ "text_config": {"attention_bias": false, "eos_token_id": 200001, "final_logit_softcapping": 20.0, "head_dim": 64, + \\ "hidden_act": "silu", "hidden_size": 8192, "intermediate_size": 16384, "layer_rope_theta": [500000.0, 0], + \\ "layer_types": ["sliding_attention", "full_attention"], "mlp_layer_types": ["sparse", "sparse"], + \\ "model_type": "muse_spark_text", "moe_hidden_size": 4096, "moe_intermediate_size": 4096, + \\ "num_attention_heads": 128, "num_experts_per_tok": 8, "num_hidden_layers": 2, "num_key_value_heads": 16, + \\ "num_local_experts": 256, "num_shared_experts": 0, "output_multiplier": 0.17677669529663687, "post_norm_eps": 1e-08, + \\ "qk_scale_factor": 5.4730064863875, "residual_gate_temperature": 0.3, "rms_norm_eps": 1e-05, + \\ "rope_parameters": {"rope_theta": 500000.0, "rope_type": "default"}, "routed_scaling_factor": 1.0, + \\ "sliding_window": 2048, "tie_word_embeddings": false, "vocab_size": 202048}} +; + +test "Config.parse reads the 2-layer pack as exllamav3's MuseSparkConfig does" { + const c = try Config.parse(std.testing.allocator, fixture, "{\"eos_token_id\": [200001, 200007]}"); + try std.testing.expectEqual(@as(usize, 2), c.layers); + try std.testing.expectEqual(@as(usize, 2047), c.window); + try std.testing.expect(!c.full[0] and c.full[1]); + try std.testing.expect(c.rope(0) and !c.rope(1)); + try std.testing.expectEqual(@as(f64, 500000.0), c.theta[0]); + try std.testing.expectEqual(@as(f64, 1e-8), c.post_eps); + try std.testing.expectEqualSlices(u32, &.{ 200001, 200007 }, c.eos[0..c.eos_len]); + try std.testing.expectApproxEqRel(@as(f64, 5.4730064863875 / 8.0), c.smScale(), 1e-15); + const r = try c.rankView(2); + try std.testing.expectEqual(@as(usize, 64), r.heads); + try std.testing.expectEqual(@as(usize, 8), r.kv_heads); + try std.testing.expectEqual(@as(usize, 2048), r.width); + try std.testing.expectEqual(@as(usize, 4096), r.latent); +} + +test "Muse Spark is admitted on GB10 (sm_121) at two TP ranks only" { + try admit(121, 2); + try std.testing.expectError(error.MuseSparkRequiresSm121, admit(120, 2)); + try std.testing.expectError(error.MuseSparkRequiresSm121, admit(90, 2)); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, admit(121, 1)); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, admit(121, 4)); + const c = try Config.parse(std.testing.allocator, fixture, null); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, c.rankView(1)); +} + +test "Config.parse refuses what the forward does not wire" { + const a = std.testing.allocator; + const bad = [_][2][]const u8{ + .{ "\"num_shared_experts\": 0", "\"num_shared_experts\": 1" }, + .{ "\"attention_bias\": false", "\"attention_bias\": true" }, + .{ "\"mlp_layer_types\": [\"sparse\", \"sparse\"]", "\"mlp_layer_types\": [\"dense\", \"sparse\"]" }, + .{ "\"head_dim\": 64", "\"head_dim\": 128" }, + .{ "\"quant_method\": \"exl3\"", "\"quant_method\": \"fp8\"" }, + }; + for (bad) |b| { + const t = try std.mem.replaceOwned(u8, a, fixture, b[0], b[1]); + defer a.free(t); + try std.testing.expect(std.meta.isError(Config.parse(a, t, null))); + } +} + +test "rank cuts" { + const a = std.testing.allocator; + const c = try Config.parse(a, fixture, null); + var buf: std.ArrayList(u8) = .empty; + defer buf.deinit(a); + try buf.ensureTotalCapacity(a, 1 << 20); // prefixes slice into it: no reallocation + var cuts: std.ArrayList(Cut) = .empty; + defer cuts.deinit(a); + try layerCuts(c, 1, 1, 2, &buf, a, &cuts); + try std.testing.expectEqual(@as(usize, attn_mats + latent_mats + 3 * 256), cuts.items.len); + try std.testing.expectEqualStrings("model.language_model.layers.1.self_attn.q_proj", cuts.items[0].prefix); + try std.testing.expectEqual(@as(usize, 64 * 64), cuts.items[0].lo); // q: heads 64..127 + try std.testing.expectEqual(@as(usize, 8 * 64), cuts.items[1].lo); // k: KV heads 8..15 + try std.testing.expectEqual(@as(usize, 16 * 64), cuts.items[1].hi); + try std.testing.expect(cuts.items[4].axis == .k); // o: input columns of its heads + try std.testing.expectEqual(@as(usize, 2048), cuts.items[5].lo); // pre_expert_proj: latent outputs 2048..4095 + try std.testing.expect(cuts.items[6].axis == .k); // post_expert_proj: latent inputs + try std.testing.expectEqual(@as(usize, 2048), cuts.items[7].lo); // expert width 4096 / 2 + try std.testing.expectEqualStrings("model.language_model.layers.1.mlp.experts.255.down_proj", cuts.items[cuts.items.len - 1].prefix); + cuts.clearRetainingCapacity(); + try layerCuts(c, 0, 0, 1, &buf, a, &cuts); + try std.testing.expect(cuts.items[0].axis == .whole); + const h0 = headCut(202112, 0, 2); + const h1 = headCut(202112, 1, 2); + try std.testing.expectEqual(@as(usize, 101120), h0.hi); + try std.testing.expectEqual(@as(usize, 101120), h1.lo); + try std.testing.expectEqual(@as(usize, 202112), h1.hi); + try std.testing.expectEqual(@as(usize, 101120), headStride(202112, 2)); +} diff --git a/zig/src/families/muse_spark/dflash2.zig b/zig/src/families/muse_spark/dflash2.zig new file mode 100644 index 00000000000..6dc31f394b5 --- /dev/null +++ b/zig/src/families/muse_spark/dflash2.zig @@ -0,0 +1,457 @@ +//! Muse Spark's DFlash2 drafter (RadixArk/Muse-Spark-Open-DFlash2) as an EXL3 pack, fed from the target's run. + +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const fwd = @import("forward.zig"); +const load_ = @import("load.zig"); +const dc = @import("dflash2_config.zig"); +const dl = @import("dflash2_load.zig"); +const exl3 = @import("exl3.zig"); +const Stream = cuda.Stream; + +pub const MAX_STREAMS = 16; // a draft pass's streams: 16 x block 8 = the EXL3 GEMV's 128 rows + +fn u(x: usize) u32 { + return @intCast(x); +} +fn ci(x: usize) c_int { + return @intCast(x); +} + +/// A matrix: EXL3 (the drafter pack's quantised linears) or 16-bit dense rows [N, K] (an unquantised Linear). +pub const Lin = union(enum) { + q: exl3.Linear, + dense: struct { w: u64, n: usize, k: usize, bf16: bool }, + + pub fn n(l: Lin) usize { + return switch (l) { + .q => |x| x.n, + .dense => |x| x.n, + }; + } +}; + +pub const Conv = struct { proj: Lin, base: u64 }; // base fp32 [2, KT, D] + +pub const DLayer = struct { + in_norm: u64, + post_norm: u64, + q_norm: u64, + k_norm: u64, + q: exl3.Linear, + k: exl3.Linear, + v: exl3.Linear, + o: exl3.Linear, + gate: exl3.Linear, + up: exl3.Linear, + down: exl3.Linear, + aconv: Conv, + mconv: Conv, +}; + +pub const Drafter = struct { + m: *fwd.Model, + d: *const cuda.Driver, + gpa: std.mem.Allocator, + mod_m: cuda.Module, // dflash.cu: embed, taps, per-head norm + RoPE, cache stores, block attention, row take + mod: cuda.Module, // muse_dflash2 + f: struct { embed: cuda.Function, tap: cuda.Function, norm_rope: cuda.Function, store: cuda.Function, attn: cuda.Function, take: cuda.Function }, + g: struct { dense: cuda.Function, prep: cuda.Function, finish: cuda.Function, silu: cuda.Function, topk: cuda.Function, walk: cuda.Function }, + arena: load_.Arena, + full: dc.DConfig, + c: dc.DConfig, // this rank's view + block: usize, + taps: []usize, + ring: usize, + scale: f32, + streams: usize, + graphs_on: bool, + fc: exl3.Linear, + fc_norm: u64, + layers: []DLayer, + norm: u64, + mask_emb: u64, // fp32 [D]: the target's embedding row of mask_token_id (raw: the reference skips embed_norm) + sel: Lin, // candidate_selector.hidden_projection [rank, D] + pcb: u64, + scb: u64, + cb_bf16: bool, + kc: []u64, + vc: []u64, + cos: u64, + sin: u64, + b: struct { tapbuf: u64, ctx16: u64, ctxg: u64, ctx: u64, kb: u64, vb: u64, xh: u64, z: u64, x32: u64, h: u64, c16: u64, dyn: u64, q16: u64, q32: u64, a: u64, part: u64, recv: u64, gb: u64, ub: u64, mm: u64, tk: u64, head: u64, top: u64, topg: u64, sg: u64, am: u64, in_tok: u64, in_pos0: u64, in_slot: u64, rpos: u64, rslot: u64, anc: u64, anc_idx: u64 }, + h_anc: []u16 = &.{}, // the anchors' embedding rows staged here (anc bf16 [streams, D], anc_idx iota) + drafts: usize = 0, + graphs: [MAX_STREAMS + 1]?cuda.graph.Exec = @splat(null), + + /// The drafter pack at `dir` on this rank; `taps_override`: target layers to tap (k-layer packs only). + pub fn init(gpa: std.mem.Allocator, io: std.Io, m: *fwd.Model, dir: []const u8, s: Stream, graphs_on: bool, taps_override: ?[]const usize) !*Drafter { + const d = m.d; + const w = m.w; + const text = try dl.readFile(gpa, io, dir, "config.json"); + defer gpa.free(text); + const full = try dc.DConfig.parse(gpa, text); + if (full.hidden != w.full.hidden) return error.HiddenMismatch; + if (full.vocab != w.full.vocab or full.mask_id >= w.full.vocab) return error.VocabMismatch; + // the target head already applies output_multiplier and the softcap (muse_softcap): the same, applied once + if (!dl.near(full.out_mult, w.full.out_mult) or !dl.near(full.softcap, w.full.softcap)) return error.HeadScaleMismatch; + const c = try full.rankView(w.world); + const dr = try gpa.create(Drafter); + errdefer gpa.destroy(dr); + dr.* = undefined; + dr.m = m; + dr.d = d; + dr.gpa = gpa; + dr.full = full; + dr.c = c; + dr.drafts = 0; + dr.graphs = @splat(null); + dr.graphs_on = graphs_on; + dr.block = full.block; + dr.ring = m.ring; + if (dr.ring < full.window + 2 * full.block) return error.RingShorterThanWindow; + dr.scale = @floatCast(std.math.pow(f64, @floatFromInt(full.head_dim), -0.5)); + dr.streams = @min(m.slots, MAX_STREAMS); + const tl = taps_override orelse full.tapList(); + if (tl.len != full.ntaps) return error.TapCount; // fc's input width is fixed by the checkpoint + dr.taps = try gpa.dupe(usize, tl); + errdefer gpa.free(dr.taps); + for (dr.taps, 0..) |t, i| if (t >= w.layers.len or (i > 0 and t < dr.taps[i - 1])) return error.TapPastLastLayer; + dr.mod_m = try cuda.Module.load(d, cuda.kernels.muse_dflash); + errdefer dr.mod_m.unload(); + dr.mod = try cuda.Module.load(d, cuda.kernels.muse_dflash2); + errdefer dr.mod.unload(); + dr.f = .{ .embed = try dr.mod_m.function("dr_block_embed"), .tap = try dr.mod_m.function("dr_tap"), .norm_rope = try dr.mod_m.function("dr_norm_rope"), .store = try dr.mod_m.function("dr_store"), .attn = try dr.mod_m.function("dr_attn"), .take = try dr.mod_m.function("dr_take") }; + dr.g = .{ .dense = try dr.mod.function("dfl_dense"), .prep = try dr.mod.function("dfl_conv_prep"), .finish = try dr.mod.function("dfl_conv_finish"), .silu = try dr.mod.function("dfl_silu_mul"), .topk = try dr.mod.function("dfl_topk"), .walk = try dr.mod.function("dfl_walk") }; + dr.arena = .{ .d = d, .gpa = gpa }; + errdefer dr.arena.deinit(); + try dl.loadWeights(dr, io, dir); + errdefer gpa.free(dr.layers); + try dl.allocState(dr, s); + errdefer { + gpa.free(dr.kc); + gpa.free(dr.vc); + } + try s.synchronize(); + return dr; + } + + pub fn deinit(dr: *Drafter) void { + const gpa = dr.gpa; + for (&dr.graphs) |*g| if (g.*) |*e| { + e.deinit(); + g.* = null; + }; + gpa.free(dr.h_anc); + gpa.free(dr.taps); + gpa.free(dr.layers); + gpa.free(dr.kc); + gpa.free(dr.vc); + dr.mod.unload(); + dr.mod_m.unload(); + dr.arena.deinit(); + gpa.destroy(dr); + } + + /// Device bytes the drafter holds on this rank (weights, caches, scratch). + pub fn bytes(dr: *const Drafter) usize { + return dr.arena.total; + } + + pub fn zBytes(l: exl3.Linear, R: usize) usize { + return if (l.split[0] > 1) l.split[0] * R * l.n * 4 else 0; + } + + fn proj(dr: *Drafter, s: Stream, l: exl3.Linear, x: u64, out: u64, out_f32: bool, n: usize) !void { + try dr.m.k3.linear(s, l, x, .f16, dr.b.xh, out, if (out_f32) .f32 else .f16, if (l.split[0] > 1) dr.b.z else 0, n); + } + + fn projL(dr: *Drafter, s: Stream, l: Lin, x: u64, out: u64, out_f32: bool, n: usize) !void { + switch (l) { + .q => |q| try dr.proj(s, q, x, out, out_f32, n), + .dense => |w| { + var a: cuda.Args = .{}; + a.add(x); + a.add(w.w); + a.add(@as(c_int, @intFromBool(w.bf16))); + a.add(out); + a.add(@as(c_int, @intFromBool(out_f32))); + a.add(ci(n)); + a.add(ci(w.k)); + a.add(ci(w.n)); + try launch(dr.g.dense, s, (w.n + 7) / 8, (n + 7) / 8, 256, &a); + }, + } + } + + /// muse_rms: out fp16 = x * rsqrt(mean x^2 + eps) * w; parts > 0: x is the ranks' gathered column slices. + fn rms(dr: *Drafter, s: Stream, x: u64, x_half: bool, w: u64, out: u64, n: usize, parts: usize) !void { + var a: cuda.Args = .{}; + a.add(x); + a.add(@as(c_int, @intFromBool(x_half))); + a.add(w); + a.add(out); + a.add(ci(dr.c.hidden)); + a.add(@as(f32, @floatCast(dr.c.eps))); + a.add(ci(parts)); + try launch(dr.m.f_rms, s, n, 1, fwd.NORM_THREADS, &a); + } + + fn launch(f: cuda.Function, s: Stream, gx: usize, gy: usize, threads: usize, a: *cuda.Args) !void { + try cuda.launch.launch(f, .{ .grid = .{ .x = u(gx), .y = u(gy), .z = 1 }, .block = .{ .x = u(threads), .y = 1, .z = 1 } }, s, a); + } + + /// The target's tap: residual rows after target layer `layer` (when tapped) into the tap buffer (fp16). + pub fn tap(dr: *Drafter, s: Stream, layer: usize, res: u64, n: usize) !void { + return dr.tapInto(s, layer, res, n, dr.b.tapbuf); + } + + /// tap into another buffer of the same row layout ([rows, taps, D] fp16): the prompt path's chunk-wide taps. + pub fn tapInto(dr: *Drafter, s: Stream, layer: usize, res: u64, n: usize, buf: u64) !void { + for (dr.taps, 0..) |t, j| if (t == layer) { + var a: cuda.Args = .{}; + a.add(res); + a.add(buf); + a.add(ci(dr.c.hidden)); + a.add(ci(dr.taps.len)); + a.add(ci(j)); + try launch(dr.f.tap, s, n, 1, 256, &a); + }; + } + + /// The context update of the target's n rows: fc, hidden_norm, each layer's k (k_norm, RoPE) and v into the ring. + pub fn update(dr: *Drafter, s: Stream, n: usize) !void { + return dr.updateAt(s, dr.b.tapbuf, dr.m.b.pos, dr.m.b.slot, n); + } + + /// update from explicit taps [n, taps, D] fp16 and the rows' positions / slots (n <= the target's window rows). + pub fn updateAt(dr: *Drafter, s: Stream, taps: u64, pos: u64, slot: u64, n: usize) !void { + const m = dr.m; + if (n > m.rows) return error.WindowTooWide; + try dr.proj(s, dr.fc, taps, dr.b.ctx16, false, n); + if (m.comm) |comm| { + try comm.allGather(dr.b.ctx16, dr.b.ctxg, n * dr.fc.n, .f16, s.handle); + try dr.rms(s, dr.b.ctxg, true, dr.fc_norm, dr.b.ctx, n, dr.fc.n); + } else try dr.rms(s, dr.b.ctx16, true, dr.fc_norm, dr.b.ctx, n, 0); + for (dr.layers, 0..) |L, i| { + try dr.proj(s, L.k, dr.b.ctx, dr.b.kb, false, n); + try dr.normRope(s, dr.b.kb, L.k_norm, pos, slot, 0, dr.kc[i], dr.c.kv_heads, n); + try dr.proj(s, L.v, dr.b.ctx, dr.b.vb, false, n); + try dr.store(s, dr.b.vb, pos, slot, dr.vc[i], n); + } + } + + fn normRope(dr: *Drafter, s: Stream, in: u64, w: u64, pos: u64, slot: u64, out32: u64, cache: u64, nh: usize, n: usize) !void { + var a: cuda.Args = .{}; + inline for (.{ in, w, dr.cos, dr.sin, pos, slot, out32, cache }) |p| a.add(p); + a.add(ci(nh)); + a.add(ci(128)); + a.add(ci(dr.ring)); + a.add(@as(f32, @floatCast(dr.c.eps))); + try launch(dr.f.norm_rope, s, n, nh, 128, &a); + } + + fn store(dr: *Drafter, s: Stream, in: u64, pos: u64, slot: u64, cache: u64, n: usize) !void { + var a: cuda.Args = .{}; + inline for (.{ in, pos, slot, cache }) |p| a.add(p); + a.add(ci(dr.c.kv_heads)); + a.add(ci(dr.ring)); + try launch(dr.f.store, s, n, 1, 256, &a); + } + + /// conv.prepare on h: the kernel projection into dyn, the first convolution into c16. + fn convPrep(dr: *Drafter, s: Stream, cv: Conv, n: usize) !void { + try dr.projL(s, cv.proj, dr.b.h, dr.b.dyn, false, n); + var a: cuda.Args = .{}; + inline for (.{ dr.b.h, dr.b.dyn, cv.base, dr.b.c16 }) |p| a.add(p); + a.add(ci(dr.block)); + a.add(ci(dr.c.hidden)); + a.add(ci(dr.c.conv_k)); + a.add(ci(dr.c.conv_g)); + try launch(dr.g.prep, s, n, 1, 256, &a); + } + + /// The sublayer's fp32 partials (part) gathered, summed in rank order, convolved (conv.finish) into the residual. + fn convFinish(dr: *Drafter, s: Stream, cv: Conv, n: usize) !void { + const D = dr.c.hidden; + var y0 = dr.b.part; + var y1: u64 = 0; + if (dr.m.comm) |comm| { + try comm.allGather(dr.b.part, dr.b.recv, n * D, .f32, s.handle); + y0 = dr.b.recv; + y1 = dr.b.recv + n * D * 4; + } + var a: cuda.Args = .{}; + inline for (.{ dr.b.x32, y0, y1, dr.b.dyn, cv.base + dr.c.conv_k * D * 4 }) |p| a.add(p); + a.add(ci(dr.block)); + a.add(ci(D)); + a.add(ci(dr.c.conv_k)); + a.add(ci(dr.c.conv_g)); + try launch(dr.g.finish, s, n, 1, 256, &a); + } + + /// Stage a draft: each stream's pending (anchor) token, its position and slot (the draft pass's fixed inputs). + pub fn stage(dr: *Drafter, tokens: []const i64, pos0: []const u32, slots: []const u32) !void { + const S = tokens.len; + if (S == 0 or S > dr.streams) return error.TooManyStreams; + var pz: [MAX_STREAMS]i32 = undefined; + var sz: [MAX_STREAMS]i32 = undefined; + var rp: [MAX_STREAMS * 16]i32 = undefined; + var rs: [MAX_STREAMS * 16]i32 = undefined; + for (0..S) |i| { + if (pos0[i] >= dr.m.context) return error.PastContext; + if (slots[i] >= dr.m.slots) return error.BadSlot; + if (tokens[i] < 0 or tokens[i] >= dr.full.vocab) return error.BadToken; + pz[i] = @intCast(pos0[i]); + sz[i] = @intCast(slots[i]); + for (0..dr.block) |b| { + rp[i * dr.block + b] = @intCast(pos0[i] + b); + rs[i * dr.block + b] = @intCast(slots[i]); + } + } + const d = dr.d; + try d.check(d.api.cuMemcpyHtoD_v2(dr.b.in_tok, std.mem.sliceAsBytes(tokens).ptr, S * 8), "draft in"); + try dr.m.embedRows(tokens, dr.h_anc, dr.b.anc); + try d.check(d.api.cuMemcpyHtoD_v2(dr.b.in_pos0, @ptrCast(&pz), S * 4), "draft in"); + try d.check(d.api.cuMemcpyHtoD_v2(dr.b.in_slot, @ptrCast(&sz), S * 4), "draft in"); + try d.check(d.api.cuMemcpyHtoD_v2(dr.b.rpos, @ptrCast(&rp), S * dr.block * 4), "draft in"); + try d.check(d.api.cuMemcpyHtoD_v2(dr.b.rslot, @ptrCast(&rs), S * dr.block * 4), "draft in"); + } + + /// The draft pass on staged inputs for S streams, kernels only: drafts [S, block - 1] (int32) left in `am`. + pub fn run(dr: *Drafter, s: Stream, S: usize) !void { + const m = dr.m; + const c = dr.c; + const B = dr.block; + const n = S * B; + const D = c.hidden; + const bb = &dr.b; + { + var a: cuda.Args = .{}; + const es = m.embedSrc(bb.anc, bb.anc_idx); + inline for (.{ es[0], dr.mask_emb, es[1], bb.x32 }) |p| a.add(p); + a.add(ci(B)); + a.add(ci(D)); + try launch(dr.f.embed, s, n, 1, 256, &a); + } + for (dr.layers, 0..) |L, i| { + try dr.rms(s, bb.x32, false, L.in_norm, bb.h, n, 0); + try dr.convPrep(s, L.aconv, n); + try dr.proj(s, L.q, bb.c16, bb.q16, false, n); + try dr.normRope(s, bb.q16, L.q_norm, bb.rpos, bb.rslot, bb.q32, 0, c.heads, n); + try dr.proj(s, L.k, bb.c16, bb.kb, false, n); + try dr.normRope(s, bb.kb, L.k_norm, bb.rpos, bb.rslot, 0, dr.kc[i], c.kv_heads, n); + try dr.proj(s, L.v, bb.c16, bb.vb, false, n); + try dr.store(s, bb.vb, bb.rpos, bb.rslot, dr.vc[i], n); + { + var a: cuda.Args = .{}; + inline for (.{ bb.q32, dr.kc[i], dr.vc[i], @as(u64, 0), bb.in_pos0, bb.in_slot, bb.a }) |p| a.add(p); + a.add(ci(B)); + a.add(ci(c.window)); + a.add(ci(dr.ring)); + a.add(ci(c.heads)); + a.add(ci(c.kv_heads)); + a.add(dr.scale); + try launch(dr.f.attn, s, n, c.kv_heads, 256, &a); // a block per (row, KV head), a warp per head + } + try dr.proj(s, L.o, bb.a, bb.part, true, n); + try dr.convFinish(s, L.aconv, n); + try dr.rms(s, bb.x32, false, L.post_norm, bb.h, n, 0); + try dr.convPrep(s, L.mconv, n); + try dr.proj(s, L.gate, bb.c16, bb.gb, false, n); + try dr.proj(s, L.up, bb.c16, bb.ub, false, n); + { + var a: cuda.Args = .{}; + inline for (.{ bb.gb, bb.ub, bb.mm }) |p| a.add(p); + a.add(@as(i64, @intCast(n * c.inter))); + try launch(dr.g.silu, s, @min((n * c.inter + 255) / 256, 4096), 1, 256, &a); + } + try dr.proj(s, L.down, bb.mm, bb.part, true, n); + try dr.convFinish(s, L.mconv, n); + } + try dr.rms(s, bb.x32, false, dr.norm, bb.h, n, 0); + const n1 = S * (B - 1); + { + var a: cuda.Args = .{}; + a.add(bb.h); + a.add(bb.tk); + a.add(ci(B)); + a.add(ci(D)); + try launch(dr.f.take, s, n1, 1, 256, &a); + } + try dr.headTop(s, n1); + try dr.projL(s, dr.sel, bb.tk, bb.sg, false, n1); + var a: cuda.Args = .{}; + a.add(if (m.comm != null) bb.topg else bb.top); + a.add(ci(m.w.world)); + a.add(ci(n1)); + a.add(bb.sg); + a.add(ci(c.sel_rank)); + inline for (.{ dr.pcb, dr.scb }) |p| a.add(p); + a.add(@as(c_int, @intFromBool(dr.cb_bf16))); + a.add(bb.in_tok); + a.add(ci(B - 1)); + a.add(bb.am); + try launch(dr.g.walk, s, S, 1, 512, &a); + } + + /// The target's head on the draft rows (this rank's slice, scaled and softcapped), each rank's top 16, gathered. + fn headTop(dr: *Drafter, s: Stream, n1: usize) !void { + const m = dr.m; + const bb = &dr.b; + try dr.proj(s, m.w.head, bb.tk, bb.head, true, n1); + const vr = m.w.head.n; + { + var a: cuda.Args = .{}; + a.add(bb.head); + a.add(@as(i64, @intCast(n1 * vr))); + a.add(@as(f32, @floatCast(m.w.full.out_mult))); + a.add(@as(f32, @floatCast(m.w.full.softcap))); + try launch(m.f_softcap, s, @min((n1 * vr + 255) / 256, 4096), 1, 256, &a); + } + var a: cuda.Args = .{}; + a.add(bb.head); + a.add(ci(vr)); + a.add(ci(@min(vr, m.w.full.vocab - m.w.head_lo))); + a.add(ci(m.w.head_lo)); + a.add(bb.top); + try launch(dr.g.topk, s, n1, 1, 256, &a); + if (m.comm) |comm| try comm.allGather(bb.top, bb.topg, n1 * 32, .f32, s.handle); + } + + /// A draft for S streams: drafts [S, block - 1] into `out` (row-major). Graphed per stream count when enabled. + pub fn draft(dr: *Drafter, s: Stream, tokens: []const i64, pos0: []const u32, slots: []const u32, out: []i32) !void { + try dr.stage(tokens, pos0, slots); + const S = tokens.len; + if (!dr.graphs_on) { + try dr.run(s, S); + } else if (dr.graphs[S]) |e| { + try e.launchOn(s); + } else { + try dr.run(s, S); // warm-up: writes the same cache rows the replay will + try s.synchronize(); + try cuda.graph.beginCapture(s, .thread_local); + dr.run(s, S) catch |err| { + if (cuda.graph.endCapture(s)) |g| { + var gg = g; + gg.deinit(); + } else |_| {} + return err; + }; + var g = try cuda.graph.endCapture(s); + defer g.deinit(); + dr.graphs[S] = try g.instantiate(); + try dr.graphs[S].?.launchOn(s); + } + try s.synchronize(); + const n1 = S * (dr.block - 1); + try dr.d.check(dr.d.api.cuMemcpyDtoH_v2(@ptrCast(out.ptr), dr.b.am, n1 * 4), "drafts"); + dr.drafts += 1; + } +}; + +test "drafter modules" { + _ = dc; + _ = dl; +} diff --git a/zig/src/families/muse_spark/dflash2_config.zig b/zig/src/families/muse_spark/dflash2_config.zig new file mode 100644 index 00000000000..9e9cb42127f --- /dev/null +++ b/zig/src/families/muse_spark/dflash2_config.zig @@ -0,0 +1,254 @@ +//! RadixArk's DFlash2 drafter for Muse Spark: its config and a rank's matrix cuts (z-lab/dflash semantics). + +const std = @import("std"); +const config = @import("config.zig"); +const Cut = config.Cut; + +pub const DConfig = struct { + hidden: usize, // 8192: the target's + inter: usize, // 28672 (a rank's under TP: rankView) + layers: usize, // 5 + heads: usize, // 64 query heads (a rank's under TP) + kv_heads: usize, // 8 + head_dim: usize, // 128 + eps: f64, // rms_norm_eps: every drafter norm + theta: f64, // RoPE theta, NeoX over the whole head + window: usize, // sliding_window: keys q - k < window behind each query, the whole block ahead (is_causal false) + block: usize, // block_size: the anchor and block - 1 mask rows + mask_id: usize, + taps: [8]usize = @splat(0), // target layers whose OUTPUT (residual) feeds the context, increasing + ntaps: usize = 0, + conv_k: usize, // conv_kernel_size: taps of each grouped dynamic convolution + conv_g: usize, // conv_group_size: channels sharing a dynamic weight + sel_rank: usize, // selector_rank + sel_k: usize, // selector_top_k (the walk kernel takes 16) + out_mult: f64, // output_multiplier on the draft logits (the target head's own: applied once) + softcap: f64, // final_logit_softcapping (likewise) + vocab: usize, + + pub fn tapList(c: *const DConfig) []const usize { + return c.taps[0..c.ntaps]; + } + + /// config.json of the drafter (the bf16 release or exllamav3's EXL3 export of it); refuses what is not wired. + pub fn parse(gpa: std.mem.Allocator, text: []const u8) !DConfig { + const parsed = try std.json.parseFromSlice(std.json.Value, gpa, text, .{}); + defer parsed.deinit(); + const top = parsed.value.object; + const arch = if (top.get("architectures")) |a| (if (a == .array and a.array.items.len > 0 and a.array.items[0] == .string) a.array.items[0].string else "") else ""; + if (!std.mem.eql(u8, arch, "DFlash2DraftModel")) return error.NotDFlash2; + const df: ?std.json.ObjectMap = if (top.get("dflash_config")) |v| (if (v == .object) v.object else null) else null; + var c: DConfig = .{ + .hidden = try need(top, "hidden_size"), + .inter = try need(top, "intermediate_size"), + .layers = try need(top, "num_hidden_layers"), + .heads = try need(top, "num_attention_heads"), + .kv_heads = try need(top, "num_key_value_heads"), + .head_dim = int(top, "head_dim") orelse return error.MissingField, + .eps = num(top.get("rms_norm_eps") orelse return error.MissingField), + .theta = 0, + .window = int(top, "sliding_window") orelse 2048, + .block = try pick(df, top, "block_size"), + .mask_id = try pick(df, top, "mask_token_id"), + .conv_k = pickOr(df, top, "conv_kernel_size", 2), + .conv_g = pickOr(df, top, "conv_group_size", 16), + .sel_rank = try pick(df, top, "selector_rank"), + .sel_k = try pick(df, top, "selector_top_k"), + .out_mult = pickNum(df, top, "output_multiplier", 1.0), + .softcap = pickNum(df, top, "final_logit_softcapping", 0.0), + .vocab = try need(top, "vocab_size"), + }; + c.theta = if (top.get("rope_theta")) |v| num(v) else 0; + if (top.get("rope_parameters")) |rp| if (rp == .object) { + if (rp.object.get("rope_theta")) |v| c.theta = num(v); + if (!std.mem.eql(u8, str(rp.object, "rope_type") orelse "default", "default")) return error.UnsupportedRope; + }; + if (c.theta == 0) c.theta = 10000.0; + if (boolean(top, "attention_bias")) return error.Unsupported; + if (!std.mem.eql(u8, str(top, "hidden_act") orelse "silu", "silu")) return error.UnsupportedActivation; + // the reference reads is_causal (default: causal on sliding layers); this checkpoint ships false + const causal = if (top.get("is_causal")) |v| (v == .bool and v.bool) else true; + if (causal) return error.CausalDrafter; + const lt = top.get("layer_types") orelse return error.LayerPattern; + if (lt.array.items.len != c.layers) return error.LayerPattern; + for (lt.array.items) |t| if (!std.mem.eql(u8, t.string, "sliding_attention")) return error.LayerPattern; + if (pickNum(df, top, "input_embedding_scale", 1.0) != 1.0) return error.Unsupported; + if (pickOr(df, top, "tap_shift", 0) != 0) return error.Unsupported; // DFlash2: hidden_states[id + 1] = layer id's output + const ids = (if (df) |d| d.get("target_layer_ids") else null) orelse top.get("target_layer_ids") orelse return error.MissingField; + for (ids.array.items) |v| { + if (c.ntaps == c.taps.len) return error.TooManyTaps; + c.taps[c.ntaps] = @intCast(v.integer); + if (c.ntaps > 0 and c.taps[c.ntaps] <= c.taps[c.ntaps - 1]) return error.TapsOutOfOrder; + c.ntaps += 1; + } + if (c.head_dim != 128) return error.HeadDim; // dflash.cu's norm/rope and attention: 128 threads a head + if (c.heads % c.kv_heads != 0 or c.heads / c.kv_heads > 8) return error.GroupWiderThan8; + if (c.sel_k != 16) return error.SelectorTopK; // dfl_walk: a warp a candidate, 16 warps + if (c.block < 2 or c.block > 16) return error.BlockSize; + if (c.conv_k == 0 or c.conv_k > c.block or c.conv_k > 4) return error.ConvKernel; + if (c.hidden % c.conv_g != 0) return error.ConvGroups; + if (c.sel_rank % 32 != 0 or c.sel_rank > 1024) return error.SelectorRank; + return c; + } + + /// A rank's view at two ranks: query / KV heads and the MLP width split (the context projection fc by outputs). + pub fn rankView(c: DConfig, world: usize) !DConfig { + if (world != 2) return error.MuseSparkRequiresTwoRanks; + if (c.heads % world != 0 or c.kv_heads % world != 0) return error.HeadsSplit; + if ((c.kv_heads / world) * c.head_dim % 128 != 0) return error.HeadsSplit; + if (c.inter % (128 * world) != 0 or c.hidden % (128 * world) != 0) return error.WidthSplit; + var r = c; + r.heads = c.heads / world; + r.kv_heads = c.kv_heads / world; + r.inter = c.inter / world; + return r; + } +}; + +/// The drafter's matrices: fc, then per layer q, k, v, o, gate, up, down, the two convolutions' kernel projections. +pub const Mat = enum { q, k, v, o, gate, up, down, aconv, mconv }; +pub const mat_names = [_][]const u8{ "self_attn.q_proj", "self_attn.k_proj", "self_attn.v_proj", "self_attn.o_proj", "mlp.gate_proj", "mlp.up_proj", "mlp.down_proj", "attention_conv.kernel_projection", "mlp_conv.kernel_projection" }; + +/// A layer matrix's cut for `rank`: q / o by heads, k / v by KV heads, the MLP by width; kernel projections whole. +pub fn layerCut(c: DConfig, mat: Mat, prefix: []const u8, rank: usize, world: usize) Cut { + if (world == 1) return .{ .prefix = prefix }; + const hq = c.heads / world * c.head_dim; + const hk = c.kv_heads / world * c.head_dim; + const wi = c.inter / world; + const r = rank; + return switch (mat) { + .q => .{ .prefix = prefix, .axis = .n, .lo = r * hq, .hi = (r + 1) * hq }, + .k, .v => .{ .prefix = prefix, .axis = .n, .lo = r * hk, .hi = (r + 1) * hk }, + .o => .{ .prefix = prefix, .axis = .k, .lo = r * hq, .hi = (r + 1) * hq }, + .gate, .up => .{ .prefix = prefix, .axis = .n, .lo = r * wi, .hi = (r + 1) * wi }, + .down => .{ .prefix = prefix, .axis = .k, .lo = r * wi, .hi = (r + 1) * wi }, + .aconv, .mconv => .{ .prefix = prefix }, + }; +} + +/// fc (taps -> hidden) by outputs: each rank projects its half of the context row; the halves are gathered (fp16). +pub fn fcCut(c: DConfig, rank: usize, world: usize) Cut { + if (world == 1) return .{ .prefix = "fc" }; + const w = c.hidden / world; + return .{ .prefix = "fc", .axis = .n, .lo = rank * w, .hi = (rank + 1) * w }; +} + +/// Weight bytes a draft pass reads on one rank (bpw for the EXL3 matrices; the head and the context update excluded). +pub fn passBytes(c: DConfig, world: usize, bpw: f64) f64 { + const H = @as(f64, @floatFromInt(c.hidden)); + const q = H * @as(f64, @floatFromInt(c.heads * c.head_dim)); + const kv = 2 * H * @as(f64, @floatFromInt(c.kv_heads * c.head_dim)); + const mlp = 3 * H * @as(f64, @floatFromInt(c.inter)); + const conv = 2 * H * @as(f64, @floatFromInt(2 * c.conv_k * (c.hidden / c.conv_g))); + const w: f64 = @floatFromInt(world); + return @as(f64, @floatFromInt(c.layers)) * ((2 * q + kv + mlp) / w + conv) * bpw / 8; +} + +fn str(o: std.json.ObjectMap, k: []const u8) ?[]const u8 { + const v = o.get(k) orelse return null; + return if (v == .string) v.string else null; +} +fn int(o: std.json.ObjectMap, k: []const u8) ?usize { + const v = o.get(k) orelse return null; + return if (v == .integer) @intCast(v.integer) else null; +} +fn need(o: std.json.ObjectMap, k: []const u8) !usize { + return int(o, k) orelse error.MissingField; +} +fn num(v: std.json.Value) f64 { + return switch (v) { + .integer => |i| @floatFromInt(i), + .float => |f| f, + .number_string => |s| std.fmt.parseFloat(f64, s) catch 0, + else => 0, + }; +} +fn boolean(o: std.json.ObjectMap, k: []const u8) bool { + const v = o.get(k) orelse return false; + return v == .bool and v.bool; +} +/// dflash_config->key first, then the top level (the reference's _draft_value). +fn pickOr(df: ?std.json.ObjectMap, top: std.json.ObjectMap, k: []const u8, default: usize) usize { + if (df) |d| if (int(d, k)) |v| return v; + return int(top, k) orelse default; +} +fn pick(df: ?std.json.ObjectMap, top: std.json.ObjectMap, k: []const u8) !usize { + if (df) |d| if (int(d, k)) |v| return v; + return int(top, k) orelse error.MissingField; +} +fn pickNum(df: ?std.json.ObjectMap, top: std.json.ObjectMap, k: []const u8, default: f64) f64 { + if (df) |d| if (d.get(k)) |v| return num(v); + return if (top.get(k)) |v| num(v) else default; +} + +// RadixArk/Muse-Spark-Open-DFlash2 @ 46c90f41's config.json (the fields parse reads). +pub const fixture = + \\{"architectures": ["DFlash2DraftModel"], "attention_bias": false, "dflash_config": {"attention_mode": "gqa", + \\ "block_size": 8, "conv_group_size": 16, "conv_kernel_size": 2, "final_logit_softcapping": 20, "mask_token_id": 200002, + \\ "output_multiplier": 0.1767766952966369, "selector_rank": 256, "selector_top_k": 16, + \\ "target_layer_ids": [1, 16, 30, 44, 59]}, "head_dim": 128, "hidden_act": "silu", "hidden_size": 8192, + \\ "intermediate_size": 28672, "is_causal": false, "layer_types": ["sliding_attention", "sliding_attention", + \\ "sliding_attention", "sliding_attention", "sliding_attention"], "num_attention_heads": 64, "num_hidden_layers": 5, + \\ "num_key_value_heads": 8, "rms_norm_eps": 1e-05, "rope_parameters": {"rope_theta": 500000, "rope_type": "default"}, + \\ "rope_theta": 500000, "sliding_window": 2048, "vocab_size": 202048} +; + +test "DConfig.parse reads RadixArk's Muse Spark DFlash2" { + const c = try DConfig.parse(std.testing.allocator, fixture); + try std.testing.expectEqual(@as(usize, 5), c.layers); + try std.testing.expectEqual(@as(usize, 8), c.block); + try std.testing.expectEqual(@as(usize, 200002), c.mask_id); + try std.testing.expectEqualSlices(usize, &.{ 1, 16, 30, 44, 59 }, c.tapList()); + try std.testing.expectEqual(@as(f64, 500000), c.theta); + try std.testing.expectEqual(@as(usize, 2048), c.window); + try std.testing.expectEqual(@as(usize, 2), c.conv_k); + try std.testing.expectEqual(@as(f64, 20), c.softcap); + try std.testing.expectApproxEqRel(@as(f64, 0.17677669529663687), c.out_mult, 1e-12); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, c.rankView(1)); + const r = try c.rankView(2); + try std.testing.expectEqual(@as(usize, 32), r.heads); + try std.testing.expectEqual(@as(usize, 4), r.kv_heads); + try std.testing.expectEqual(@as(usize, 14336), r.inter); +} + +test "DConfig.parse refuses what the drafter does not wire" { + const a = std.testing.allocator; + const bad = [_][2][]const u8{ + .{ "\"is_causal\": false", "\"is_causal\": true" }, + .{ "\"selector_top_k\": 16", "\"selector_top_k\": 8" }, + .{ "\"head_dim\": 128", "\"head_dim\": 64" }, + .{ "\"DFlash2DraftModel\"", "\"DFlashDraftModel\"" }, + .{ "[1, 16, 30, 44, 59]", "[16, 1, 30, 44, 59]" }, + .{ "\"sliding_attention\", \"sliding_attention\"]", "\"sliding_attention\", \"full_attention\"]" }, + }; + for (bad) |b| { + const t = try std.mem.replaceOwned(u8, a, fixture, b[0], b[1]); + defer a.free(t); + try std.testing.expect(std.meta.isError(DConfig.parse(a, t))); + } +} + +test "drafter cuts at TP=2 sit on 128-column blocks" { + const c = try DConfig.parse(std.testing.allocator, fixture); + const q1 = layerCut(c, .q, "layers.0.self_attn.q_proj", 1, 2); + try std.testing.expectEqual(@as(usize, 4096), q1.lo); + try std.testing.expectEqual(@as(usize, 8192), q1.hi); + const k1 = layerCut(c, .k, "x", 1, 2); + try std.testing.expectEqual(@as(usize, 512), k1.lo); + try std.testing.expect(layerCut(c, .o, "x", 0, 2).axis == .k); + const d1 = layerCut(c, .down, "x", 1, 2); + try std.testing.expectEqual(@as(usize, 14336), d1.lo); + try std.testing.expect(d1.axis == .k); + try std.testing.expect(layerCut(c, .aconv, "x", 1, 2).axis == .whole); + try std.testing.expectEqual(@as(usize, 4096), fcCut(c, 1, 2).lo); + for (std.enums.values(Mat)) |m| { + const cc = layerCut(c, m, "x", 1, 2); + try std.testing.expect(cc.lo % 128 == 0 and cc.hi % 128 == 0); + } + try std.testing.expect(layerCut(c, .q, "x", 0, 1).axis == .whole); + // a draft pass reads about half the drafter a rank when split + const split = passBytes(c, 2, 4.0) / 1e9; + const repl = passBytes(c, 1, 4.0) / 1e9; + try std.testing.expect(split > 1.0 and split < 1.3); + try std.testing.expect(repl > 2.0 and repl < 2.4); +} diff --git a/zig/src/families/muse_spark/dflash2_load.zig b/zig/src/families/muse_spark/dflash2_load.zig new file mode 100644 index 00000000000..3b41179e145 --- /dev/null +++ b/zig/src/families/muse_spark/dflash2_load.zig @@ -0,0 +1,197 @@ +//! The DFlash2 drafter's load on a rank: its EXL3 pack's weights (split like the target) and its device state. + +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const load_ = @import("load.zig"); +const dc = @import("dflash2_config.zig"); +const ml = @import("pack.zig"); +const dflash2 = @import("dflash2.zig"); +const Drafter = dflash2.Drafter; +const DLayer = dflash2.DLayer; +const Lin = dflash2.Lin; +const Stream = cuda.Stream; +const MAX_STREAMS = dflash2.MAX_STREAMS; + +fn ci(x: usize) c_int { + return @intCast(x); +} + +/// The drafter pack's weights on this rank: fc, norms, selector and codebooks, the layers, the mask row. +pub fn loadWeights(dr: *Drafter, io: std.Io, dir: []const u8) !void { + const gpa = dr.gpa; + const ar = &dr.arena; + const full = dr.full; + const rank = dr.m.w.rank; + const world = dr.m.w.world; + var ck = try core.Checkpoint.openModel(gpa, io, dir); + defer ck.close(); + dr.fc = try ml.linear(gpa, ar, try ml.cut(gpa, try ml.readMat(gpa, &ck, "fc"), dc.fcCut(full, rank, world))); + if (dr.fc.k != full.ntaps * full.hidden) return error.FcWidth; + dr.fc_norm = try f32Up(gpa, ar, try ck.get("hidden_norm.weight")); + dr.norm = try f32Up(gpa, ar, try ck.get("norm.weight")); + dr.sel = try lin(gpa, ar, &ck, "candidate_selector.hidden_projection", .{ .prefix = "candidate_selector.hidden_projection" }); + if (dr.sel.n() != full.sel_rank) return error.SelectorShape; + const pc = try codebook(&ck, "candidate_selector.predecessor_codebook"); + const sc = try codebook(&ck, "candidate_selector.successor_codebook"); + for ([_]core.safetensors.Tensor{ pc, sc }) |t| if (t.rank != 2 or t.shape[0] != full.vocab or t.shape[1] != full.sel_rank or t.dtype != pc.dtype or (t.dtype != .bf16 and t.dtype != .f16)) return error.CodebookShape; + dr.cb_bf16 = pc.dtype == .bf16; + dr.pcb = try ar.upload(pc.bytes); + dr.scb = try ar.upload(sc.bytes); + dr.layers = try gpa.alloc(DLayer, full.layers); + errdefer gpa.free(dr.layers); + var nb: [160]u8 = undefined; + var pb: [160]u8 = undefined; + for (dr.layers, 0..) |*L, i| { + L.in_norm = try f32Up(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, "layers.{d}.input_layernorm.weight", .{i}))); + L.post_norm = try f32Up(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, "layers.{d}.post_attention_layernorm.weight", .{i}))); + L.q_norm = try f32Up(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, "layers.{d}.self_attn.q_norm.weight", .{i}))); + L.k_norm = try f32Up(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, "layers.{d}.self_attn.k_norm.weight", .{i}))); + inline for (.{ "q", "k", "v", "o", "gate", "up", "down" }, 0..) |f, j| { + const prefix = try std.fmt.bufPrint(&pb, "layers.{d}.{s}", .{ i, dc.mat_names[j] }); + const cut = dc.layerCut(full, @fromBackingInt(@intCast(j)), prefix, rank, world); + @field(L, f) = try ml.linear(gpa, ar, try ml.cut(gpa, try ml.readMat(gpa, &ck, prefix), cut)); + } + inline for (.{ "aconv", "mconv" }, .{ "attention_conv", "mlp_conv" }, 7..) |f, cname, j| { + const prefix = try std.fmt.bufPrint(&pb, "layers.{d}.{s}", .{ i, dc.mat_names[j] }); + @field(L, f).proj = try lin(gpa, ar, &ck, prefix, .{ .prefix = prefix }); + if (@field(L, f).proj.n() != 2 * full.conv_k * (full.hidden / full.conv_g)) return error.ConvShape; + const bt = try ck.get(try std.fmt.bufPrint(&nb, "layers.{d}.{s}.base_kernel", .{ i, cname })); + if (bt.numel() != 2 * full.conv_k * full.hidden) return error.ConvShape; + @field(L, f).base = try f32Up(gpa, ar, bt); + } + } + // the mask rows: a shipped mask_embedding, else the target's (raw) embedding row of mask_token_id + if (ck.get("mask_embedding")) |t| { + dr.mask_emb = try f32Up(gpa, ar, t); + } else |_| { + const D = full.hidden; + const row = try gpa.alloc(u16, D); + defer gpa.free(row); + @memcpy(std.mem.sliceAsBytes(row), dr.m.w.embed_host[full.mask_id * D * 2 ..][0 .. D * 2]); + const f = try gpa.alloc(f32, D); + defer gpa.free(f); + for (row, f) |x, *o| o.* = @bitCast(@as(u32, x) << 16); + dr.mask_emb = try ar.upload(std.mem.sliceAsBytes(f)); + } +} + +/// The context caches, RoPE tables and draft-pass scratch on this rank. +pub fn allocState(dr: *Drafter, s: Stream) !void { + const gpa = dr.gpa; + const ar = &dr.arena; + const m = dr.m; + const c = dr.c; + const D = c.hidden; + const L = dr.layers.len; + dr.kc = try gpa.alloc(u64, L); + errdefer gpa.free(dr.kc); + dr.vc = try gpa.alloc(u64, L); + errdefer gpa.free(dr.vc); + for (0..L) |i| { + dr.kc[i] = try ar.zeros(m.slots * dr.ring * c.kv_heads * 128 * 2); + dr.vc[i] = try ar.zeros(m.slots * dr.ring * c.kv_heads * 128 * 2); + } + const tlen = m.context + dr.block; + dr.cos = try ar.alloc(tlen * 64 * 4); + dr.sin = try ar.alloc(tlen * 64 * 4); + { + const f = try m.glue.function("muse_rope_tables"); + var a: cuda.Args = .{}; + a.add(dr.cos); + a.add(dr.sin); + a.add(ci(tlen)); + a.add(c.theta); + a.add(ci(128)); + try cuda.launch.launch(f, .{ .grid = .{ .x = 256, .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + } + const R = m.rows; + const SB = dr.streams * dr.block; + const RR = @max(R, SB); + const S1 = dr.streams * (dr.block - 1); + const W = m.w.world; + const HQ = c.heads * 128; + const HK = c.kv_heads * 128; + const vr = m.w.head.n; + var max_z: usize = @max(Drafter.zBytes(dr.fc, R), Drafter.zBytes(m.w.head, S1)); + for (dr.layers) |ly| { + inline for (.{ "q", "k", "v", "o", "gate", "up", "down" }) |f| max_z = @max(max_z, Drafter.zBytes(@field(ly, f), RR)); + for ([_]Lin{ ly.aconv.proj, ly.mconv.proj }) |p| if (p == .q) { + max_z = @max(max_z, Drafter.zBytes(p.q, SB)); + }; + } + if (dr.sel == .q) max_z = @max(max_z, Drafter.zBytes(dr.sel.q, S1)); + var b = &dr.b; + b.tapbuf = try ar.zeros(R * dr.taps.len * D * 2); + b.ctx16 = try ar.zeros(R * dr.fc.n * 2); + b.ctxg = if (W > 1) try ar.zeros(W * R * dr.fc.n * 2) else 0; + b.ctx = try ar.zeros(R * D * 2); + b.kb = try ar.zeros(RR * HK * 2); + b.vb = try ar.zeros(RR * HK * 2); + b.xh = try ar.zeros(RR * @max(dr.taps.len * D, @max(c.inter, HQ)) * 2); + b.z = try ar.zeros(@max(max_z, 4)); + b.x32 = try ar.zeros(SB * D * 4); + b.h = try ar.zeros(SB * D * 2); + b.c16 = try ar.zeros(SB * D * 2); + b.dyn = try ar.zeros(SB * dr.layers[0].aconv.proj.n() * 2); + b.q16 = try ar.zeros(SB * HQ * 2); + b.q32 = try ar.zeros(SB * HQ * 4); + b.a = try ar.zeros(SB * HQ * 2); + b.part = try ar.zeros(SB * D * 4); + b.recv = if (W > 1) try ar.zeros(W * SB * D * 4) else 0; + b.gb = try ar.zeros(SB * c.inter * 2); + b.ub = try ar.zeros(SB * c.inter * 2); + b.mm = try ar.zeros(SB * c.inter * 2); + b.tk = try ar.zeros(S1 * D * 2); + b.head = try ar.zeros(S1 * vr * 4); + b.top = try ar.zeros(S1 * 32 * 4); + b.topg = if (W > 1) try ar.zeros(W * S1 * 32 * 4) else 0; + b.sg = try ar.zeros(S1 * c.sel_rank * 2); + b.am = try ar.zeros(S1 * 4); + b.in_tok = try ar.zeros(dr.streams * 8); + b.in_pos0 = try ar.zeros(dr.streams * 4); + b.in_slot = try ar.zeros(dr.streams * 4); + b.rpos = try ar.zeros(SB * 4); + b.rslot = try ar.zeros(SB * 4); + b.anc = try ar.zeros(dr.streams * D * 2); + { + var io_: [MAX_STREAMS]i64 = undefined; + for (&io_, 0..) |*x, j| x.* = @intCast(j); + b.anc_idx = try ar.upload(std.mem.sliceAsBytes(io_[0..dr.streams])); + } + dr.h_anc = try dr.gpa.alloc(u16, dr.streams * D); +} + +pub fn near(a: f64, b: f64) bool { + return @abs(a - b) <= 1e-6 * @max(@abs(a), @abs(b)); +} + +pub fn readFile(gpa: std.mem.Allocator, io: std.Io, dir: []const u8, name: []const u8) ![]u8 { + const path = try std.fs.path.join(gpa, &.{ dir, name }); + defer gpa.free(path); + return std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 22)); +} + +fn f32Up(gpa: std.mem.Allocator, ar: *load_.Arena, t: core.safetensors.Tensor) !u64 { + const f = try ml.asF32(gpa, t); + defer gpa.free(f); + return ar.upload(std.mem.sliceAsBytes(f)); +} + +/// A replicated matrix: EXL3 when the pack quantised it, else its 16-bit rows (`{prefix}.weight`, [N, K]). +fn lin(gpa: std.mem.Allocator, ar: *load_.Arena, ck: *core.Checkpoint, prefix: []const u8, cut: @import("config.zig").Cut) !Lin { + if (ml.readMat(gpa, ck, prefix)) |mat| { + return .{ .q = try ml.linear(gpa, ar, try ml.cut(gpa, mat, cut)) }; + } else |_| {} + var nb: [192]u8 = undefined; + const t = try ck.get(try std.fmt.bufPrint(&nb, "{s}.weight", .{prefix})); + if (t.rank != 2 or (t.dtype != .bf16 and t.dtype != .f16)) return error.BadDenseMatrix; + return .{ .dense = .{ .w = try ar.upload(t.bytes), .n = t.shape[0], .k = t.shape[1], .bf16 = t.dtype == .bf16 } }; +} + +/// The selector codebooks: bare keys, or with `.weight` (older trainers), 16-bit. +fn codebook(ck: *core.Checkpoint, key: []const u8) !core.safetensors.Tensor { + if (ck.get(key)) |t| return t else |_| {} + var nb: [128]u8 = undefined; + return ck.get(try std.fmt.bufPrint(&nb, "{s}.weight", .{key})); +} diff --git a/zig/src/families/muse_spark/draft_main.zig b/zig/src/families/muse_spark/draft_main.zig new file mode 100644 index 00000000000..3454b809910 --- /dev/null +++ b/zig/src/families/muse_spark/draft_main.zig @@ -0,0 +1,268 @@ +//! tf-muse dflash / drafted: the DFlash2 drafter's gates (docs/recipes/muse-spark.md), one GPU, a pair or TP=2. + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const muse = @import("muse_spark"); +const Model = muse.forward.Model; +const Row = muse.forward.Row; +const Drafter = muse.dflash2.Drafter; + +pub const Mode = enum { dflash, drafted }; +pub const Knobs = struct { context: usize, n_greedy: usize, graphs: bool, max_layers: ?usize, rows_per: usize, dump_taps: bool }; + +const Text = struct { name: []const u8, ids: []i32, out: std.ArrayList(i32) = .empty, plain: std.ArrayList(i32) = .empty }; + +fn readAll(gpa: std.mem.Allocator, io: std.Io, path: []const u8) ![]u8 { + return std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 32)); +} +fn writeAll(io: std.Io, path: []const u8, bytes: []const u8) !void { + try std.Io.Dir.cwd().writeFile(io, .{ .sub_path = path, .data = bytes }); +} + +const Ctx = struct { + gpa: std.mem.Allocator, + s: cuda.Stream, + model: *Model, + dr: *Drafter, + graphs: bool, + am: [muse.forward.DECODE_ROWS]i32 = undefined, + + fn fwd(c: *Ctx, rows: []const Row) !void { + if (c.graphs) try c.model.graphed(c.s, rows, null) else try c.model.forward(c.s, rows, null, null); + try c.model.argmaxTo(c.s, rows.len, c.am[0..rows.len]); + } +}; + +/// One rank's run of `mode`: load the target and the drafter, every text, rank 0 writes OUT_DIR. +pub fn run(mode: Mode, gpa: std.mem.Allocator, ar: std.mem.Allocator, io: std.Io, driver: *const cuda.Driver, args: []const [:0]const u8, rank: usize, world: usize, comm: ?tp.Collective, kn: Knobs) !void { + var s = try cuda.Stream.init(driver, false); + defer s.deinit(); + var w = try muse.load.load(gpa, io, driver, args[2], rank, world, .{ .max_layers = kn.max_layers, .log = rank == 0 }); + defer w.deinit(); + var k3 = try muse.exl3.Kernels.load(driver); + defer k3.deinit(); + var texts: std.ArrayList(Text) = .empty; + const names_text = try readAll(ar, io, try std.fs.path.join(ar, &.{ args[3], "names.txt" })); + var it = std.mem.tokenizeAny(u8, names_text, " \r\n\t"); + while (it.next()) |name| { + const raw = try readAll(ar, io, try std.fmt.allocPrint(ar, "{s}/{s}.ids", .{ args[3], name })); + const ids = try ar.alloc(i32, raw.len / 4); + @memcpy(std.mem.sliceAsBytes(ids), raw[0 .. ids.len * 4]); + if (ids.len + kn.n_greedy + 16 > kn.context) return error.TextTooLong; + try texts.append(ar, .{ .name = name, .ids = ids }); + } + const slots = if (mode == .drafted) @min(texts.items.len, muse.dflash2.MAX_STREAMS) else 1; + if (mode == .drafted and texts.items.len > slots) return error.TooManyTexts; + var model = try Model.init(gpa, driver, &w, &k3, comm, kn.context, muse.forward.DECODE_ROWS, slots, s); + defer model.deinit(); + const ddir = try muse.engine.drafterDir(ar, args[2], if (std.c.getenv("MUSE_DRAFTER")) |v| std.mem.span(v) else null); + var tb: [8]usize = undefined; + const dr = try Drafter.init(gpa, io, &model, ddir, s, kn.graphs, try tapsOverride(&tb)); + defer dr.deinit(); + model.dr = dr; + std.debug.print("[draft] rank {d}/{d}: target {d} layers ({d:.1} GiB), drafter {s} ({d:.2} GiB, taps {any}), {d} slots, {s}\n", .{ rank, world, w.layers.len, @as(f64, @floatFromInt(w.arena.total)) / (1 << 30), ddir, @as(f64, @floatFromInt(dr.bytes())) / (1 << 30), dr.taps, slots, if (kn.graphs) "graphed" else "eager" }); + var c: Ctx = .{ .gpa = gpa, .s = s, .model = &model, .dr = dr, .graphs = kn.graphs }; + switch (mode) { + .dflash => for (texts.items) |*t| try fixedProtocol(&c, ar, io, args[4], t, w.full, kn, rank == 0), + .drafted => try drafted(&c, ar, io, args[4], texts.items, w.full, kn, rank == 0), + } + std.debug.print("DONE {s} rank {d}\n", .{ @tagName(mode), rank }); +} + +/// The fixed protocol for one text (slot 0): the prompt a row at a time, then greedy steps that draft first. +fn fixedProtocol(c: *Ctx, ar: std.mem.Allocator, io: std.Io, out_dir: []const u8, t: *Text, cfg: muse.Config, kn: Knobs, write: bool) !void { + const dr = c.dr; + const P = dr.block - 1; + const NT = dr.taps.len; + const D = cfg.hidden; + const T = t.ids.len; + var taps: std.ArrayList(u16) = .empty; + var drafts: std.ArrayList(i32) = .empty; + var seq: std.ArrayList(i32) = .empty; + try seq.appendSlice(ar, t.ids); + const row_buf = try ar.alloc(u16, NT * D); + var pending: i32 = 0; + for (0..T + kn.n_greedy) |j| { + if (j >= T) { // a greedy step: draft from the pending token at position j, then feed it + var out: [16]i32 = undefined; + try dr.draft(c.s, &.{pending}, &.{@intCast(j)}, &.{0}, &out); + try drafts.appendSlice(ar, out[0..P]); + try seq.append(ar, pending); + } + const tok: i32 = if (j < T) t.ids[j] else pending; + try c.fwd(&.{.{ .slot = 0, .pos = @intCast(j), .token = tok }}); + if (kn.dump_taps) { + try c.s.synchronize(); + try c.model.d.check(c.model.d.api.cuMemcpyDtoH_v2(@ptrCast(row_buf.ptr), dr.b.tapbuf, NT * D * 2), "taps"); + try taps.appendSlice(ar, row_buf); + } + pending = c.am[0]; + if (j >= T and cfg.isEos(@intCast(tok))) break; + } + const G = seq.items.len - T; + var acc_sum: usize = 0; + var hist: [17]usize = @splat(0); + for (0..G) |i| { + var a: usize = 0; + while (a < P and T + i + 1 + a < seq.items.len and drafts.items[i * P + a] == seq.items[T + i + 1 + a]) a += 1; + acc_sum += a; + hist[a] += 1; + } + std.debug.print("[dflash] {s}: prompt {d}, greedy {d}, mean accepted {d:.3} of {d} (counts by accepted {any})\n", .{ t.name, T, G, @as(f64, @floatFromInt(acc_sum)) / @as(f64, @floatFromInt(@max(G, 1))), P, hist[0 .. P + 1] }); + if (!write) return; + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.seq.i32", .{ out_dir, t.name }), std.mem.sliceAsBytes(seq.items)); + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.drafts.i32", .{ out_dir, t.name }), std.mem.sliceAsBytes(drafts.items)); + if (kn.dump_taps) try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.taps.f16", .{ out_dir, t.name }), std.mem.sliceAsBytes(taps.items)); +} + +/// Prompts of every slot in windows of up to rows_per rows a slot; each slot's first greedy token. +fn prefill(c: *Ctx, texts: []Text, rows_per: usize, first: []i32) !void { + var fed: [muse.dflash2.MAX_STREAMS]usize = @splat(0); + var rows: [muse.forward.DECODE_ROWS]Row = undefined; + var last: [muse.dflash2.MAX_STREAMS]usize = undefined; + const per = @min(rows_per, muse.forward.DECODE_ROWS / texts.len); + while (true) { + var n: usize = 0; + var who: [muse.dflash2.MAX_STREAMS]bool = @splat(false); + for (texts, 0..) |t, j| if (fed[j] < t.ids.len) { + const k = @min(per, t.ids.len - fed[j]); + for (0..k) |q| rows[n + q] = .{ .slot = @intCast(j), .pos = @intCast(fed[j] + q), .token = t.ids[fed[j] + q] }; + n += k; + fed[j] += k; + last[j] = n - 1; + who[j] = fed[j] == t.ids.len; + }; + if (n == 0) break; + try c.fwd(rows[0..n]); + for (0..texts.len) |j| if (who[j]) { + first[j] = c.am[last[j]]; + }; + } +} + +/// Plain greedy, then the speculative loop on the same slots; every reply must be byte-identical. +fn drafted(c: *Ctx, ar: std.mem.Allocator, io: std.Io, out_dir: []const u8, texts: []Text, cfg: muse.Config, kn: Knobs, write: bool) !void { + const S = texts.len; + const B = c.dr.block; + const MS = muse.dflash2.MAX_STREAMS; + var first: [MS]i32 = undefined; + var rows: [muse.forward.DECODE_ROWS]Row = undefined; + // plain: one row a slot a window + try prefill(c, texts, kn.rows_per, &first); + var pend: [MS]i32 = undefined; + var pos: [MS]usize = undefined; + var live: [MS]bool = @splat(true); + for (texts, 0..) |*t, j| { + pend[j] = first[j]; + pos[j] = t.ids.len; + try t.plain.append(ar, first[j]); + live[j] = !cfg.isEos(@intCast(first[j])) and kn.n_greedy > 1; + } + while (true) { + var n: usize = 0; + var at: [MS]usize = undefined; + for (0..S) |j| if (live[j]) { + rows[n] = .{ .slot = @intCast(j), .pos = @intCast(pos[j]), .token = pend[j] }; + at[j] = n; + n += 1; + }; + if (n == 0) break; + try c.fwd(rows[0..n]); + for (texts, 0..) |*t, j| if (live[j]) { + pend[j] = c.am[at[j]]; + pos[j] += 1; + try t.plain.append(ar, pend[j]); + if (t.plain.items.len >= kn.n_greedy or cfg.isEos(@intCast(pend[j]))) live[j] = false; + }; + } + // speculative: draft, verify [pending, drafts] of every live slot in one window, accept while equal + try prefill(c, texts, kn.rows_per, &first); + var rounds: usize = 0; + var drafted_rows: usize = 0; + var accepted: usize = 0; + var stream_rounds: usize = 0; + var new_tokens: usize = 0; + for (texts, 0..) |*t, j| { + pend[j] = first[j]; + pos[j] = t.ids.len; + try t.out.append(ar, first[j]); + live[j] = !cfg.isEos(@intCast(first[j])) and kn.n_greedy > 1; + } + while (true) { + var toks: [MS]i64 = undefined; + var p0: [MS]u32 = undefined; + var sl: [MS]u32 = undefined; + var idx: [MS]usize = undefined; + var m: usize = 0; + for (0..S) |j| if (live[j]) { + toks[m] = pend[j]; + p0[m] = @intCast(pos[j]); + sl[m] = @intCast(j); + idx[m] = j; + m += 1; + }; + if (m == 0) break; + var dout: [MS * 16]i32 = undefined; + try c.dr.draft(c.s, toks[0..m], p0[0..m], sl[0..m], &dout); + var n: usize = 0; + var at: [MS]usize = undefined; + var width: [MS]usize = undefined; + for (0..m) |q| { + const j = idx[q]; + const left = kn.n_greedy - texts[j].out.items.len; + width[q] = @min(B, left); + at[q] = n; + for (0..width[q]) |r| rows[n + r] = .{ .slot = @intCast(j), .pos = @intCast(pos[j] + r), .token = if (r == 0) pend[j] else dout[q * (B - 1) + r - 1] }; + n += width[q]; + } + try c.fwd(rows[0..n]); + rounds += 1; + stream_rounds += m; + for (0..m) |q| { + const j = idx[q]; + const t = &texts[j]; + var a: usize = 0; + while (a + 1 < width[q] and dout[q * (B - 1) + a] == c.am[at[q] + a]) a += 1; + drafted_rows += width[q] - 1; + accepted += a; + for (0..a + 1) |k| { + const tok = c.am[at[q] + k]; + try t.out.append(ar, tok); + new_tokens += 1; + if (t.out.items.len >= kn.n_greedy or cfg.isEos(@intCast(tok))) { + live[j] = false; + break; + } + } + pend[j] = t.out.items[t.out.items.len - 1]; + pos[j] += a + 1; + } + } + var pass = true; + for (texts) |t| { + const same = std.mem.eql(i32, t.plain.items, t.out.items); + pass = pass and same; + var first_diff: usize = 0; + while (first_diff < @min(t.plain.items.len, t.out.items.len) and t.plain.items[first_diff] == t.out.items[first_diff]) first_diff += 1; + std.debug.print("[drafted] {s}: plain {d} tokens, drafted {d}: {s}", .{ t.name, t.plain.items.len, t.out.items.len, if (same) "identical\n" else "DIFFER\n" }); + if (!same) std.debug.print(" at token {d}\n", .{first_diff}); + if (write) { + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.plain.i32", .{ out_dir, t.name }), std.mem.sliceAsBytes(t.plain.items)); + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.drafted.i32", .{ out_dir, t.name }), std.mem.sliceAsBytes(t.out.items)); + } + } + std.debug.print("[drafted] {d} streams, {d} rounds, accepted {d} / drafted {d} ({d:.3}), {d:.2} tokens a stream-round: {s}\n", .{ S, rounds, accepted, drafted_rows, @as(f64, @floatFromInt(accepted)) / @as(f64, @floatFromInt(@max(drafted_rows, 1))), @as(f64, @floatFromInt(new_tokens)) / @as(f64, @floatFromInt(@max(stream_rounds, 1))), if (pass) "PASS" else "FAIL" }); +} + +/// MUSE_DRAFT_TAPS=a,b,..: tap these target layers instead of the drafter's (plumbing checks on k-layer packs). +fn tapsOverride(buf: []usize) !?[]const usize { + const v = std.mem.span(std.c.getenv("MUSE_DRAFT_TAPS") orelse return null); + var n: usize = 0; + var it = std.mem.tokenizeScalar(u8, v, ','); + while (it.next()) |t| : (n += 1) { + if (n == buf.len) return error.TooManyTaps; + buf[n] = try std.fmt.parseInt(usize, t, 10); + } + return buf[0..n]; +} diff --git a/zig/src/families/muse_spark/engine.zig b/zig/src/families/muse_spark/engine.zig new file mode 100644 index 00000000000..36dca068d74 --- /dev/null +++ b/zig/src/families/muse_spark/engine.zig @@ -0,0 +1,200 @@ +//! Muse Spark's engine on one rank: the model, its DFlash2 drafter (opt-in) and the plan-link steps rank 0 sends. + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const load_ = @import("load.zig"); +const fwd = @import("forward.zig"); +const dflash2 = @import("dflash2.zig"); +const prompt_ = @import("prompt.zig"); +const kept = @import("kept.zig"); +const exl3 = @import("exl3.zig"); + +/// The plan link's words: one GPU step each, executed by every rank in order. +pub const Op = enum(i64) { hello = 0x3A5E, forward = 1, draft = 2, stop = 3, prompt = 4, cache = 5 }; + +/// What rank 0 announces first so every rank builds the same model (the prompt path's chunking is prompt.zig's). +pub const Setup = struct { context: usize, slots: usize, drafts: bool = false }; + +const hello_version = 9; + +/// The hello words: [hello, version, context, slots, drafts]. +pub fn hello(su: Setup) [5]i64 { + return .{ @backingInt(Op.hello), hello_version, @intCast(su.context), @intCast(su.slots), @intFromBool(su.drafts) }; +} + +/// The setup a follower reads from rank 0's hello; another build's hello is refused. +pub fn setupOf(words: []const i64) !Setup { + if (words.len < 2 or words[0] != @backingInt(Op.hello)) return error.NoHello; + if (words[1] != hello_version or words.len != 5) return error.OtherBuild; + return .{ .context = @intCast(words[2]), .slots = @intCast(words[3]), .drafts = words[4] != 0 }; +} + +/// The drafter pack: `given` (the same path on every rank), else `/dflash2`. +pub fn drafterDir(gpa: std.mem.Allocator, pack: []const u8, given: ?[]const u8) ![]u8 { + if (given) |g| return gpa.dupe(u8, g); + return std.fmt.allocPrint(gpa, "{s}/dflash2", .{pack}); +} + +/// The model, its kernels and the TP session: what rank 0 serves and rank 1 follows. +pub const Engine = struct { + gpa: std.mem.Allocator, + d: *const cuda.Driver, + w: load_.Weights, + k3: exl3.Kernels, + model: fwd.Model, + dr: ?*dflash2.Drafter = null, + pr: ?*prompt_.Prompt = null, + session: ?*tp.Session = null, + s: cuda.Stream, + logits: []f32, // [DECODE_ROWS, V] host + ids: [fwd.DECODE_ROWS]i32 = undefined, // device argmax of each row (Want.ids) + words: std.ArrayList(i64) = .empty, + copies: kept.Copies = undefined, // kept prompt states' windows (kept.zig), on every rank + + /// Load everything on this rank; `session` null on one GPU, `drafter` null: `/dflash2` (with su.drafts). + pub fn init(gpa: std.mem.Allocator, io: std.Io, d: *const cuda.Driver, dir: []const u8, su: Setup, session: ?*tp.Session, drafter: ?[]const u8) !*Engine { + const e = try gpa.create(Engine); + errdefer gpa.destroy(e); + e.* = .{ .gpa = gpa, .d = d, .w = undefined, .k3 = undefined, .model = undefined, .s = undefined, .logits = &.{}, .session = session }; + const rank: usize = if (session) |ss| ss.cfg.rank else 0; + const world: usize = if (session) |ss| ss.cfg.world else 1; + e.s = try cuda.Stream.init(d, false); + errdefer e.s.deinit(); + e.w = try load_.load(gpa, io, d, dir, rank, world, .{ .log = rank == 0 }); + errdefer e.w.deinit(); + e.k3 = try exl3.Kernels.load(d); + errdefer e.k3.deinit(); + const comm = if (session) |ss| ss.comm() else null; + e.model = try fwd.Model.init(gpa, d, &e.w, &e.k3, comm, su.context, fwd.DECODE_ROWS, su.slots, e.s); + errdefer e.model.deinit(); + if (su.drafts) { + const ddir = try drafterDir(gpa, dir, drafter); + defer gpa.free(ddir); + e.dr = try dflash2.Drafter.init(gpa, io, &e.model, ddir, e.s, true, null); + e.model.dr = e.dr; + if (rank == 0) std.log.info("muse drafter: {s}, block {d}, {d:.2} GiB on this rank (split over {d})", .{ ddir, e.dr.?.block, @as(f64, @floatFromInt(e.dr.?.bytes())) / (1 << 30), world }); + } + errdefer if (e.dr) |dr| dr.deinit(); + e.pr = try prompt_.Prompt.init(&e.model, gpa, prompt_.CAP, prompt_.EWIN, e.s); + if (rank == 0) std.log.info("muse prompt path: chunks of {d} rows, experts in {d}-row windows, {d:.2} GiB scratch", .{ e.pr.?.cap, e.pr.?.ewin, @as(f64, @floatFromInt(e.pr.?.bytes())) / (1 << 30) }); + errdefer if (e.pr) |pr| pr.deinit(); + e.copies = try kept.Copies.init(gpa, &e.model, e.dr); + errdefer e.copies.deinit(); + e.logits = try gpa.alloc(f32, fwd.DECODE_ROWS * e.w.full.vocab); + return e; + } + + pub fn deinit(e: *Engine) void { + const gpa = e.gpa; + e.words.deinit(gpa); + gpa.free(e.logits); + e.copies.deinit(); + if (e.pr) |pr| pr.deinit(); + if (e.dr) |dr| dr.deinit(); + e.model.deinit(); + e.k3.deinit(); + e.w.deinit(); + e.s.deinit(); + gpa.destroy(e); + } + + fn send(e: *Engine, words: []const i64) !void { + if (e.session) |ss| try ss.plan.send(words); + } + + pub const Want = enum { none, ids, logits }; + + /// A graphed forward window on every rank; on rank 0 `ids` leaves each row's argmax in `ids`, `logits` [n, V]. + pub fn forward(e: *Engine, rows: []const fwd.Row, want: Want) !void { + e.words.clearRetainingCapacity(); + try e.words.appendSlice(e.gpa, &.{ @backingInt(Op.forward), @intCast(rows.len) }); + for (rows) |r| try e.words.appendSlice(e.gpa, &.{ r.slot, r.pos, r.token }); + try e.send(e.words.items); + try e.model.graphed(e.s, rows, if (want == .logits) e.logits[0 .. rows.len * e.w.full.vocab] else null); + if (want == .ids) try e.model.argmaxTo(e.s, rows.len, e.ids[0..rows.len]); + } + + /// A prompt chunk on every rank: `tokens` at [p0, p0 + n) of `slot`; the last row's argmax or logits. + pub fn prompt(e: *Engine, slot: u32, p0: usize, tokens: []const i64, want: Want) !void { + const pr = e.pr orelse return error.NoPromptPath; + e.words.clearRetainingCapacity(); + try e.words.appendSlice(e.gpa, &.{ @backingInt(Op.prompt), @intCast(tokens.len), slot, @intCast(p0) }); + try e.words.appendSlice(e.gpa, tokens); + try e.send(e.words.items); + try pr.chunk(e.s, slot, p0, tokens); + switch (want) { + .none => try e.s.synchronize(), + .ids => try e.model.argmaxTo(e.s, 1, e.ids[0..1]), + .logits => try e.model.logitsTo(e.s, 1, e.logits[0..e.w.full.vocab]), + } + } + + /// A draft pass on every rank: drafts [S, block - 1] into `out` (each stream's anchor token, position, slot). + pub fn draft(e: *Engine, tokens: []const i64, pos0: []const u32, slots: []const u32, out: []i32) !void { + e.words.clearRetainingCapacity(); + try e.words.appendSlice(e.gpa, &.{ @backingInt(Op.draft), @intCast(tokens.len) }); + for (tokens, pos0, slots) |t, p, s| try e.words.appendSlice(e.gpa, &.{ t, p, s }); + try e.send(e.words.items); + try e.dr.?.draft(e.s, tokens, pos0, slots, out); + } + + /// A kept state's step on every rank (kept.zig: save, restore, copy prefix, drop); rank 0 sends it first. + pub fn cache(e: *Engine, kind: kept.Kind, id: u64, slot: u32, slot2: u32, at: usize) !void { + try e.send(&kept.words(@backingInt(Op.cache), kind, id, slot, slot2, at)); + switch (kind) { + .save => try e.copies.save(e.s, id, slot), + .restore => try e.copies.restore(e.s, id, slot), + .copy => try e.copies.copyPrefix(e.s, slot, slot2, at), + .drop => e.copies.drop(id), + } + } + + /// One step from the plan link, on a follower; false at stop. + pub fn follow(e: *Engine, words: []const i64) !bool { + if (words.len < 2) return error.ShortPlan; + const op: Op = @fromBackingInt(@intCast(words[0])); + const n: usize = @intCast(words[1]); + switch (op) { + .forward => { + if (words.len != 2 + 3 * n or n > fwd.DECODE_ROWS) return error.BadPlan; + var rows: [fwd.DECODE_ROWS]fwd.Row = undefined; + for (0..n) |i| rows[i] = .{ .slot = @intCast(words[2 + 3 * i]), .pos = @intCast(words[3 + 3 * i]), .token = words[4 + 3 * i] }; + try e.model.graphed(e.s, rows[0..n], null); + }, + .draft => { + if (words.len != 2 + 3 * n or n > dflash2.MAX_STREAMS) return error.BadPlan; + const dr = e.dr orelse return error.NoDrafter; + var t: [dflash2.MAX_STREAMS]i64 = undefined; + var p: [dflash2.MAX_STREAMS]u32 = undefined; + var sl: [dflash2.MAX_STREAMS]u32 = undefined; + var out: [dflash2.MAX_STREAMS * 16]i32 = undefined; + for (0..n) |i| { + t[i] = words[2 + 3 * i]; + p[i] = @intCast(words[3 + 3 * i]); + sl[i] = @intCast(words[4 + 3 * i]); + } + try dr.draft(e.s, t[0..n], p[0..n], sl[0..n], &out); + }, + .prompt => { + const pr = e.pr orelse return error.NoPromptPath; + if (words.len != 4 + n or n > pr.cap) return error.BadPlan; + try pr.chunk(e.s, @intCast(words[2]), @intCast(words[3]), words[4..]); + try e.s.synchronize(); + }, + .cache => try e.copies.follow(e.s, words), + .stop => return false, + .hello => return error.LateHello, + } + return true; + } +}; + +test "the hello carries the setup, and another build's is refused" { + const su: Setup = .{ .context = 131072, .slots = 4, .drafts = true }; + try std.testing.expectEqual(su, try setupOf(&hello(su))); + const plain: Setup = .{ .context = 65536, .slots = 2 }; + try std.testing.expectEqual(plain, try setupOf(&hello(plain))); + try std.testing.expectError(error.OtherBuild, setupOf(&.{ @backingInt(Op.hello), 7, 65536, 2, 0, 1024, 512, 1, 0 })); + try std.testing.expectError(error.NoHello, setupOf(&.{ 3, 0 })); +} diff --git a/zig/src/families/muse_spark/exl3.zig b/zig/src/families/muse_spark/exl3.zig new file mode 100644 index 00000000000..53a28c4c5bc --- /dev/null +++ b/zig/src/families/muse_spark/exl3.zig @@ -0,0 +1,205 @@ +//! Muse Spark's EXL3 layers on the shared operators (cuda.exl3 Linear, cuda.exl3_experts) plus its 32-member tiles. + +const std = @import("std"); +const cuda = @import("cuda"); +const shared = cuda.exl3; +const sx = cuda.exl3_experts; +const launch_ = cuda.launch; + +const Driver = cuda.Driver; +const Module = cuda.Module; +const Function = cuda.Function; +const Stream = cuda.Stream; +const Args = cuda.Args; + +pub const DType = shared.DType; +pub const Scratch = sx.Scratch; + +/// (K splits, warps a program) for a K x N layer: the shared linear's plan, the shape's alone. +pub fn plan(k: usize, n: usize) [2]usize { + const p = shared.plan(k, n, 192, 8); + return .{ p.sk, p.wk }; +} + +/// One EXL3 linear layer in the strips layout ([N/128, K/16, 8, 4 * K2] words), mul1 codebook. +pub const Linear = struct { + words: u64, + suh: u64, // fp16 [K] + svh: u64, // fp16 [N] + bias: u64 = 0, // fp16 [N] or 0 + counters: u64, // int32 [8 * N / 128], zeroed once (the split tickets) + k: usize, + n: usize, + k2: u32, + split: [2]usize, // plan(k, n) + + /// (words between k tiles, words between 128-column blocks) of the strips layout. + pub fn strides(l: Linear) [2]i64 { + const st = shared.strides(l.k, l.n, l.k2, true); + return .{ @intCast(st.k), @intCast(st.nb) }; + } + + /// The shared linear's view of this layer. + pub fn weight(l: Linear) shared.Weight { + const st = shared.strides(l.k, l.n, l.k2, true); + return .{ .trellis = l.words, .suh = l.suh, .svh = l.svh, .bias = l.bias, .k = @intCast(l.k), .n = @intCast(l.n), .halves = l.k2, .codebook = .mul1, .stride_k = st.k, .stride_nb = st.nb }; + } +}; + +/// One layer's routed experts: device tables of trellis pointers and widths, stacked scales. +pub const Experts = struct { + gate_ptr: u64, // int64 [E] + up_ptr: u64, + down_ptr: u64, + gate_k2: u64, // int32 [E] + up_k2: u64, + down_k2: u64, + suh_g: u64, // fp16 [E, D] + suh_u: u64, + svh_g: u64, // fp16 [E, I] + svh_u: u64, + suh_d: u64, // fp16 [E, I] + svh_d: u64, // fp16 [E, D] + count: usize, // E + dims: usize, // D + width: usize, // I (this rank's) + k2_gu: [2]u32, // (min, max) over gate and up + k2_d: [2]u32, + host_ptr: []const u64 = &.{}, // [gate E, up E, down E] + host_k2: []const i32 = &.{}, + + /// The shared experts' view: mul1, the fp32 SwiGLU (act_mode 1), no clamp. + pub fn layer(x: Experts) sx.Layer { + return .{ .gate = x.gate_ptr, .up = x.up_ptr, .down = x.down_ptr, .gate_k2 = x.gate_k2, .up_k2 = x.up_k2, .down_k2 = x.down_k2, .suh_g = x.suh_g, .suh_u = x.suh_u, .svh_g = x.svh_g, .svh_u = x.svh_u, .suh_d = x.suh_d, .svh_d = x.svh_d, .experts = x.count, .dims = x.dims, .width = x.width, .codebook = .mul1, .limit = 0, .act_mode = 1 }; + } +}; + +/// The scratch parts' bytes for `rows` rows of `slots` slots (the shared scratch's, without its alignment). +pub const Sizes = struct { xg: usize, xd: usize, z: usize, y: usize, ids: usize, members: usize }; + +pub fn sizes(e: Experts, rows: usize, slots: usize) !Sizes { + const g_sk = try sx.plan(e.dims, e.width, true); + const d_sk = try sx.plan(e.width, e.dims, false); + const p = rows * slots; + const maxu = @min(p, e.count); + return .{ .xg = p * e.dims * 2, .xd = p * e.width * 2, .z = @max(2 * g_sk * e.width, d_sk * e.dims) * p * 4, .y = p * e.dims * 4, .ids = maxu * 4, .members = maxu * rows * 4 }; +} + +pub const Kernels = struct { + lin: shared.Linear, + ex: sx.Experts, + x2: Module, // experts2.cu: muse_grouped2 + f_x2: Function, + + pub fn load(d: *const Driver) !Kernels { + if (!cuda.kernels.available) return error.KernelsNotBuilt; + var k: Kernels = undefined; + k.lin = try shared.Linear.load(d); + errdefer k.lin.unload(); + k.ex = try sx.Experts.load(d); + errdefer k.ex.unload(); + k.x2 = try Module.load(d, cuda.kernels.muse_experts2); + errdefer k.x2.unload(); + k.f_x2 = try k.x2.function("muse_grouped2"); + return k; + } + + pub fn deinit(k: *Kernels) void { + k.x2.unload(); + k.ex.unload(); + k.lin.unload(); + } + + /// xh (m, K) fp16 = Hadamard-rotated x * suh (the shared tf_exl3_rot_in). + pub fn rotIn(k: *const Kernels, s: Stream, x: u64, x_dtype: DType, suh: u64, xh: u64, m: usize, kk: usize) !void { + var a: Args = .{}; + a.add(x); + a.add(suh); + a.add(xh); + a.add(@as(i32, @backingInt(x_dtype))); + a.add(@as(i32, @intCast(m))); + a.add(@as(i32, @intCast(kk))); + try launch_.launch(k.lin.rot_in, .{ .grid = .{ .x = u((kk / 128 + 3) / 4), .y = u(m), .z = 1 }, .block = .{ .x = 128, .y = 1, .z = 1 } }, s, &a); + } + + /// y (m, N) = x @ W * svh (+ bias) through the shared linear; z: fp32 split partials when the plan splits K. + pub fn linear(k: *const Kernels, s: Stream, l: Linear, x: u64, x_dtype: DType, xh: u64, y: u64, y_dtype: DType, z: u64, m: usize) !void { + try k.lin.matmul(s, l.weight(), x, x_dtype, m, y, y_dtype, xh, z, l.counters); + } + + /// The routed experts' per-slot fp32 outputs in sc.y [rows * slots, D] (shared runSlots; x fp16). + pub fn routed(k: *const Kernels, s: Stream, e: Experts, x: u64, x_stride: usize, pick: u64, rows: usize, sc: Scratch) !void { + try k.ex.runSlots(s, e.layer(), x, x_stride, .f16, pick, rows, sc); + } + + /// routed() with the grouped GEMMs in 32-member tiles (wide windows): the same launches and bits otherwise. + pub fn routedWide(k: *const Kernels, s: Stream, e: Experts, x: u64, x_stride: usize, pick: u64, rows: usize, sc: Scratch) !void { + const l = e.layer(); + const d, const w, const slots = .{ l.dims, l.width, sc.slots }; + if (rows < 1 or rows > sc.rows or slots > 32) return error.WindowTooWide; + const g_sk = try sx.plan(d, w, true); + const d_sk = try sx.plan(w, d, false); + const p = rows * slots; + const maxu = @min(p, l.experts); + { + var a: Args = .{}; + inline for (.{ pick, sc.ids, sc.count, sc.members }) |v| a.add(v); + inline for (.{ rows, slots, l.experts, rows }) |v| a.add(int(v)); + try launch_.launch(k.ex.group, .{ .grid = .{ .x = 1, .y = 1, .z = 1 }, .block = .{ .x = 1024, .y = 1, .z = 1 }, .shared = u(rows * slots * 4) }, s, &a); + } + { + var a: Args = .{}; + a.add(x); + a.add(int(x_stride)); + a.add(@as(i32, @backingInt(DType.f16))); + inline for (.{ pick, l.suh_g, l.suh_u, sc.xg, sc.xu }) |v| a.add(v); + inline for (.{ d, slots, l.experts }) |v| a.add(int(v)); + try launch_.launch(k.ex.rot_in, .{ .grid = .{ .x = u(p), .y = u(d / 128), .z = 2 }, .block = .{ .x = 32, .y = 1, .z = 1 } }, s, &a); + } + try k.grouped2(s, .{ sc.xg, sc.xu, l.gate, l.up, l.gate_k2, l.up_k2 }, sc, d, w, p, g_sk, rows, maxu, 2); + { + var a: Args = .{}; + inline for (.{ sc.z, pick, l.svh_g, l.svh_u, l.suh_d, sc.xd }) |v| a.add(v); + inline for (.{ p, w, g_sk, l.experts }) |v| a.add(int(v)); + a.add(l.limit); + a.add(l.act_mode); + try launch_.launch(k.ex.gateup, .{ .grid = .{ .x = u(p), .y = u(w / 128), .z = 1 }, .block = .{ .x = 32, .y = 1, .z = 1 } }, s, &a); + } + try k.grouped2(s, .{ sc.xd, sc.xd, l.down, l.down, l.down_k2, l.down_k2 }, sc, w, d, p, d_sk, rows, maxu, 1); + { + var a: Args = .{}; + inline for (.{ sc.z, pick, l.svh_d, sc.y, @as(u64, 0), @as(u64, 0) }) |v| a.add(v); + inline for (.{ p, d, d_sk, l.experts, slots }) |v| a.add(int(v)); + try launch_.launch(k.ex.down_combine, .{ .grid = .{ .x = u(rows), .y = u(d / 128), .z = 1 }, .block = .{ .x = u(32 * slots), .y = 1, .z = 1 } }, s, &a); + } + } + + /// muse_grouped2 over (x0, x1, trellis tables 0 / 1, width tables 0 / 1): grid z = mats * sk * member tiles of 32. + fn grouped2(k: *const Kernels, s: Stream, t: [6]u64, sc: Scratch, kk: usize, n: usize, p: usize, sk: usize, maxm: usize, maxu: usize, mats: usize) !void { + if (kk % (16 * sk * 4) != 0 or n % 128 != 0) return error.UnevenSplit; + var a: Args = .{}; + inline for (0..6) |i| a.add(t[i]); + inline for (.{ sc.ids, sc.count, sc.members, sc.z }) |v| a.add(v); + inline for (.{ kk, n, p, sk, maxm, sc.slots }) |v| a.add(int(v)); + try launch_.launch(k.f_x2, .{ .grid = .{ .x = u(maxu), .y = u(n / 128), .z = u(mats * sk * ((maxm + 31) / 32)) }, .block = .{ .x = 128, .y = 1, .z = 1 } }, s, &a); + } +}; + +fn int(x: usize) i32 { + return @intCast(x); +} + +fn u(x: usize) u32 { + return @intCast(x); +} + +test "the shared plans at Muse Spark's shapes" { + const vectors = [_][4]usize{ + .{ 8192, 8192, 1, 8 }, .{ 8192, 4096, 8, 4 }, .{ 8192, 512, 16, 4 }, .{ 4096, 8192, 1, 8 }, + .{ 2048, 8192, 1, 8 }, .{ 8192, 2048, 16, 4 }, .{ 8192, 1024, 16, 4 }, .{ 8192, 101120, 1, 8 }, + .{ 4096, 6144, 4, 4 }, .{ 4096, 76288, 1, 8 }, .{ 1024, 4096, 2, 4 }, + }; + for (vectors) |v| try std.testing.expectEqual([2]usize{ v[2], v[3] }, plan(v[0], v[1])); + try std.testing.expectEqual(@as(u32, 4), try sx.plan(4096, 2048, true)); + try std.testing.expectEqual(@as(u32, 1), try sx.plan(2048, 4096, false)); +} diff --git a/zig/src/families/muse_spark/forward.zig b/zig/src/families/muse_spark/forward.zig new file mode 100644 index 00000000000..da1a7921f14 --- /dev/null +++ b/zig/src/families/muse_spark/forward.zig @@ -0,0 +1,485 @@ +//! Muse Spark's decode forward: windows of decode rows (any slots, any positions), four all-gathers a layer at TP=2. + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const load_ = @import("load.zig"); +const dflash2 = @import("dflash2.zig"); +const ops = @import("ops.zig"); +const exl3 = @import("exl3.zig"); +const Weights = load_.Weights; +const Stream = cuda.Stream; + +pub const CK = 256; // keys an attention chunk +pub const DECODE_ROWS = 128; // the EXL3 GEMV's row limit +pub const NORM_THREADS = 1024; +pub const BUCKET = 4096; // graphs: the smallest key bucket (full layers read bucket / CK chunks) +pub const MAX_GRAPH_ROWS = 32; // wider windows (prompt chunks) run eagerly +pub const MAX_CHUNKS = 64; // full layers' key chunks at most: chunks grow past CK keys with the context +/// Graphs key windows under this bucket at it (at most the context): one graph a width, the same bits (graphed()). +pub const GRAPH_BUCKET = 1 << 20; + +/// The key bucket of a window ending at end - 1: a power of two from BUCKET, at most the context (CK-rounded). +pub fn bucketOf(context: usize, end: usize) usize { + const full = (context + CK - 1) / CK * CK; + return @min(full, @max(BUCKET, std.math.ceilPowerOfTwo(usize, end) catch unreachable)); +} + +/// Keys a full layer's chunk holds for a bucket: CK, or bucket / MAX_CHUNKS rounded up to CK past 16K keys. +pub fn chunkKeys(bucket: usize) usize { + return @max(CK, std.mem.alignForward(usize, (bucket + MAX_CHUNKS - 1) / MAX_CHUNKS, CK)); +} + +/// linear_multi.cu's instantiations (EXL3 bits a weight; mul1 codebook, 4 warps). +pub const multi_k2s = [_]u32{ 2, 3, 4, 5, 6, 8 }; + +/// Key chunks a full layer's row at position pos reads eagerly (its own chunk width). +pub fn rowChunks(context: usize, pos: usize) usize { + return pos / chunkKeys(bucketOf(context, pos + 1)) + 1; +} + +/// One decode row: a stream's cache slot, its position, its input token. +pub const Row = struct { slot: u32, pos: u32, token: i64 }; + +/// Sliding cache rows a slot keeps: the window, the row itself and a window's other rows of the same slot. +pub fn ringSize(window: usize, rows: usize) usize { + return std.mem.alignForward(usize, window + 1 + rows, 64); +} + +fn u(x: usize) u32 { + return @intCast(x); +} +fn ci(x: usize) c_int { + return @intCast(x); +} + +const Bufs = struct { + ids: u64, // i64 [R] + pos: u64, // i32 [R] + slot: u64, // i32 [R] + res: u64, // f32 [R, D] + x: u64, // f16 [R, D]: the normed sublayer input + xf: u64, // f32 [R, D]: the normed MoE input unrounded (the router's) + q: u64, // f16 [R, H * 64] + k: u64, // f16 [R, HK * 64] + v: u64, + g: u64, // f16 [R, H * 64]: the output gate's logits + qo: u64, // f16 [R, H * 64] + att: u64, // f16 [R, H * 64]: gated attention output + po: u64, // f32 [R, H, NCH, 64] + pm: u64, + pl: u64, + xh: u64, // f16 rot_in scratch [R, max K] + xh4: u64, // f16 [4, R, D]: q / k / v / gate's rotated inputs (one launch) + z4: u64, // f32: their split partials, one region each + z: u64, // f32 split partials + part: u64, // f32 [R, D] + logits: u64, // f32 [R, E] + pick: u64, // i32 [R, K] + wts: u64, // f32 [R, K] + lat: u64, // f16 [R, latent] + latn: u64, // f16 [R, latent] + acc: u64, // f16 [R, latent] + head: u64, // f32 [R, head stride]: this rank's head rows + recv: u64, // f32 [world, R, max(D, K * latent, head stride)]: all-gathers + latg: u64, // f16 [world, R, latent / world]: the gathered latent halves + am: u64, // i32 [R] + erow: u64, // bf16 [R, D]: the window's embedding rows, read through iota + iota: u64, // i64 [R]: 0 .. R - 1 + sc: exl3.Scratch, +}; + +pub const Model = struct { + w: *const Weights, + d: *const cuda.Driver, + k3: *const exl3.Kernels, + comm: ?tp.Collective, + glue: cuda.Module, + attn: cuda.Module, + lin: cuda.Module, // linear_multi.cu: q / k / v / gate in one launch + f_multi: [multi_k2s.len]cuda.Function, + f_rotm: cuda.Function, + f_lin2: [multi_k2s.len][2]cuda.Function, // linear_body2 (32-row passes, the same bits) at 4 and 8 warps + f_embed: cuda.Function, + f_rms: cuda.Function, + f_gate: cuda.Function, + f_gate_c: cuda.Function, // the cluster versions (8 blocks a row, the same bits) + f_esum_c: cuda.Function, + f_router: cuda.Function, + f_topk: cuda.Function, + f_esum: cuda.Function, + f_softcap: cuda.Function, + f_argmax: cuda.Function, + f_prep: cuda.Function, + f_rows: cuda.Function, + f_merge: cuda.Function, + context: usize, + graphs: std.AutoHashMapUnmanaged([2]u32, cuda.graph.Exec) = .empty, + replays: usize = 0, + captures: usize = 0, + kv_bytes: usize = 0, // the KV caches' device bytes + ring: usize, + rows: usize, + slots: usize, + nch_max: usize, + kc: []u64, + vc: []u64, + cos: u64, // fp32 [context, 32] (one theta: every RoPE layer's) + sin: u64, + theta: f64, + b: Bufs, + arena: load_.Arena, + gpa: std.mem.Allocator, + h_erow: []u16 = &.{}, // host staging of the window's embedding rows + dr: ?*dflash2.Drafter = null, // fed inside run: taps after its layers, the context update after the last layer + + /// fp16 K/V caches: full layers [slots, context, HK, 64], sliding layers rings of ringSize rows. + pub fn init(gpa: std.mem.Allocator, d: *const cuda.Driver, w: *const Weights, k3: *const exl3.Kernels, comm: ?tp.Collective, context: usize, rows: usize, slots: usize, s: Stream) !Model { + const cfg = w.cfg; + if (w.world > 1 and comm == null) return error.NeedComm; + if (rows > DECODE_ROWS or rows == 0) return error.TooManyRows; + var m: Model = undefined; + m.w = w; + m.d = d; + m.k3 = k3; + m.comm = if (w.world > 1) comm else null; + m.context = context; + m.graphs = .empty; + m.replays = 0; + m.captures = 0; + m.kv_bytes = 0; + m.ring = ringSize(cfg.window, rows); + m.rows = rows; + m.slots = slots; + m.nch_max = @max(@min(MAX_CHUNKS, (context + CK - 1) / CK), (cfg.window + 1 + CK - 1) / CK); + m.gpa = gpa; + m.dr = null; + m.arena = .{ .d = d, .gpa = gpa }; + errdefer m.arena.deinit(); + m.glue = try cuda.Module.load(d, cuda.kernels.muse_glue); + errdefer m.glue.unload(); + m.attn = try cuda.Module.load(d, cuda.kernels.muse_attention); + errdefer m.attn.unload(); + m.f_embed = try m.glue.function("muse_embed_norm"); + m.f_rms = try m.glue.function("muse_rms"); + m.f_gate = try m.glue.function("muse_gate_norm"); + m.f_gate_c = try m.glue.function("muse_gate_norm_c"); + m.f_esum_c = try m.glue.function("muse_expert_sum_c"); + m.f_router = try m.glue.function("muse_router"); + m.f_topk = try m.glue.function("muse_topk"); + m.f_esum = try m.glue.function("muse_expert_sum"); + m.f_softcap = try m.glue.function("muse_softcap"); + m.f_argmax = try m.glue.function("muse_argmax"); + m.f_prep = try m.attn.function("muse_qk_prep"); + m.f_rows = try m.attn.function("muse_attn_rows"); + m.f_merge = try m.attn.function("muse_attn_merge"); + m.lin = try cuda.Module.load(d, cuda.kernels.muse_linear); + errdefer m.lin.unload(); + inline for (multi_k2s, 0..) |k2, j| m.f_multi[j] = try m.lin.function(std.fmt.comptimePrint("muse_linear_multi_k{d}", .{k2})); + m.f_rotm = try m.lin.function("muse_rot_multi"); + inline for (multi_k2s, 0..) |k2, j| inline for (.{ 4, 8 }, 0..) |wk, q| { + m.f_lin2[j][q] = try m.lin.function(std.fmt.comptimePrint("muse_linear2_k{d}_w{d}", .{ k2, wk })); + }; + const ar = &m.arena; + const L = w.layers.len; + const HK = cfg.kv_heads; + const hd = cfg.head_dim; + m.kc = try gpa.alloc(u64, L); + m.vc = try gpa.alloc(u64, L); + for (0..L) |i| { + const n = if (cfg.full[i]) context else m.ring; + m.kc[i] = try ar.zeros(slots * n * HK * hd * 2); + m.vc[i] = try ar.zeros(slots * n * HK * hd * 2); + m.kv_bytes += 2 * slots * n * HK * hd * 2; + } + // RoPE tables: every RoPE layer of Muse Spark has the same theta (5e5); refuse a second one + m.theta = 0; + for (0..L) |i| if (cfg.rope(i)) { + if (m.theta != 0 and m.theta != cfg.theta[i]) return error.SeveralThetas; + m.theta = cfg.theta[i]; + }; + m.cos = try ar.alloc(context * (hd / 2) * 4); + m.sin = try ar.alloc(context * (hd / 2) * 4); + if (m.theta != 0) { + const f = try m.glue.function("muse_rope_tables"); + var a: cuda.Args = .{}; + a.add(m.cos); + a.add(m.sin); + a.add(ci(context)); + a.add(m.theta); + a.add(ci(hd)); + try cuda.launch.launch(f, .{ .grid = .{ .x = 256, .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + } + const R = rows; + const D = cfg.hidden; + const HQ = cfg.heads * hd; + const HKD = HK * hd; + const lat = cfg.latent; + const vr = w.head_stride; + var max_z: usize = zBytes(w.head, R); + for (w.layers) |ly| inline for (.{ "q", "k", "v", "g", "o", "pre", "post" }) |f| { + max_z = @max(max_z, zBytes(@field(ly, f), R)); + }; + var b: Bufs = undefined; + b.ids = try ar.zeros(R * 8); + b.pos = try ar.zeros(R * 4); + b.slot = try ar.zeros(R * 4); + b.res = try ar.zeros(R * D * 4); + b.x = try ar.zeros(R * D * 2); + b.xf = try ar.zeros(R * D * 4); + b.q = try ar.zeros(R * HQ * 2); + b.k = try ar.zeros(R * HKD * 2); + b.v = try ar.zeros(R * HKD * 2); + b.g = try ar.zeros(R * HQ * 2); + b.qo = try ar.zeros(R * HQ * 2); + b.att = try ar.zeros(R * HQ * 2); + b.po = try ar.zeros(R * cfg.heads * m.nch_max * hd * 4); + b.pm = try ar.zeros(R * cfg.heads * m.nch_max * 4); + b.pl = try ar.zeros(R * cfg.heads * m.nch_max * 4); + b.xh = try ar.zeros(R * @max(D, HQ) * 2); + b.z = try ar.zeros(@max(max_z, 4)); + var z4: usize = 0; + for (w.layers) |ly| z4 = @max(z4, zBytes(ly.q, R) + zBytes(ly.k, R) + zBytes(ly.v, R) + zBytes(ly.g, R)); + b.xh4 = try ar.zeros(4 * R * D * 2); + b.z4 = try ar.zeros(@max(z4, 4)); + b.part = try ar.zeros(R * D * 4); + b.logits = try ar.zeros(R * cfg.experts * 4); + b.pick = try ar.zeros(R * cfg.top_k * 4); + b.wts = try ar.zeros(R * cfg.top_k * 4); + b.lat = try ar.zeros(R * lat * 2); + b.latn = try ar.zeros(R * lat * 2); + b.acc = try ar.zeros(R * lat * 2); + b.head = try ar.zeros(R * vr * 4); + b.recv = if (w.world > 1) try ar.zeros(w.world * R * @max(@max(D, cfg.top_k * lat), vr) * 4) else 0; + b.latg = if (w.world > 1) try ar.zeros(R * lat * 2) else 0; + b.am = try ar.zeros(R * 4); + b.erow = try ar.zeros(R * D * 2); + { + const io_ = try gpa.alloc(i64, R); + defer gpa.free(io_); + for (io_, 0..) |*x, j| x.* = @intCast(j); + b.iota = try ar.upload(std.mem.sliceAsBytes(io_)); + } + m.h_erow = try gpa.alloc(u16, R * D); + const first = w.layers[0].experts; + const sz = try exl3.sizes(first, R, cfg.top_k); + b.sc = .{ .xg = try ar.zeros(sz.xg), .xu = try ar.zeros(sz.xg), .xd = try ar.zeros(sz.xd), .z = try ar.zeros(sz.z), .y = try ar.zeros(sz.y), .ids = try ar.zeros(sz.ids), .count = try ar.zeros(4), .members = try ar.alloc(sz.members), .rows = R, .slots = cfg.top_k }; + try d.check(d.api.cuMemsetD32_v2(b.sc.members, 0xFFFF_FFFF, sz.members / 4), "members -1"); + m.b = b; + try s.synchronize(); + return m; + } + + fn zBytes(l: exl3.Linear, R: usize) usize { + return if (l.split[0] > 1) l.split[0] * R * l.n * 4 else 0; + } + + pub fn deinit(m: *Model) void { + var it = m.graphs.valueIterator(); + while (it.next()) |e| e.deinit(); + m.graphs.deinit(m.gpa); + m.gpa.free(m.kc); + m.gpa.free(m.vc); + m.gpa.free(m.h_erow); + m.glue.unload(); + m.attn.unload(); + m.lin.unload(); + m.arena.deinit(); + } + + pub const Tap = enum { input, attn, mlp }; + /// A hook per layer: `.input` before it (teacher forcing), `.attn` after the gate, `.mlp` the block output. + pub const Capture = struct { + hook: *const fn (ctx: *anyopaque, what: Tap, layer: usize, dev: u64, n: usize) anyerror!void, + ctx: *anyopaque, + teacher: bool = false, + }; + + /// Rows' tokens, positions and slots into the fixed device inputs. + pub fn stage(m: *Model, rows: []const Row) !void { + if (rows.len == 0 or rows.len > m.rows) return error.WindowTooWide; + var ids: [DECODE_ROWS]i64 = undefined; + var pos: [DECODE_ROWS]i32 = undefined; + var slot: [DECODE_ROWS]i32 = undefined; + var per: [DECODE_ROWS]usize = @splat(0); + for (rows, 0..) |r, i| { + if (r.slot >= m.slots) return error.BadSlot; + if (r.pos >= m.context) return error.PastContext; + if (r.token < 0 or r.token >= m.w.full.vocab) return error.BadToken; + ids[i] = r.token; + pos[i] = @intCast(r.pos); + slot[i] = @intCast(r.slot); + per[r.slot] += 1; + } + for (per[0..m.slots]) |c| if (c + m.w.cfg.window + 1 > m.ring) return error.RingOverrun; + const n = rows.len; + try m.embedRows(ids[0..n], m.h_erow, m.b.erow); + try upload(m.d, m.b.ids, std.mem.sliceAsBytes(ids[0..n])); + try upload(m.d, m.b.pos, std.mem.sliceAsBytes(pos[0..n])); + try upload(m.d, m.b.slot, std.mem.sliceAsBytes(slot[0..n])); + } + + /// The tokens' table rows (bf16) through host staging `h` into `dev` [n, D]. + pub fn embedRows(m: *const Model, tokens: []const i64, h: []u16, dev: u64) !void { + const D = m.w.full.hidden; + const tab = m.w.embed_host; + if (h.len < tokens.len * D) return error.WindowTooWide; + for (tokens, 0..) |t, j| @memcpy(std.mem.sliceAsBytes(h[j * D ..][0..D]), tab[@as(usize, @intCast(t)) * D * 2 ..][0 .. D * 2]); + try upload(m.d, dev, std.mem.sliceAsBytes(h[0 .. tokens.len * D])); + } + + /// The embedding launch's (table, ids): the staged rows and iota (the table stays on the host). + pub fn embedSrc(_: *const Model, erow: u64, iota: u64) [2]u64 { + return .{ erow, iota }; + } + + /// Eager decode window: softcapped fp32 logits of every row into `out` [n, vocab] (or none). + pub fn forward(m: *Model, s: Stream, rows: []const Row, out: ?[]f32, cap: ?Capture) !void { + try m.stage(rows); + var chunks: usize = 1; // the most any row's own chunking takes + for (rows) |r| chunks = @max(chunks, rowChunks(m.context, r.pos)); + try m.run(s, rows.len, chunks, cap); + if (out) |o| try m.logitsTo(s, rows.len, o) else try s.synchronize(); + } + + /// Graphed decode window: a graph per (rows, key bucket) after an eager warm-up; replay bits equal eager bits. + pub fn graphed(m: *Model, s: Stream, rows: []const Row, out: ?[]f32) !void { + if (rows.len > MAX_GRAPH_ROWS) return m.forward(s, rows, out, null); // prompt windows: eager, the same bits + var end: usize = 0; + for (rows) |r| end = @max(end, r.pos + 1); + var bucket = bucketOf(m.context, end); + if (GRAPH_BUCKET > bucket) bucket = @min(GRAPH_BUCKET, (m.context + CK - 1) / CK * CK); + const chunks = (bucket + chunkKeys(bucket) - 1) / chunkKeys(bucket); // covers every row at or under bucket + const key: [2]u32 = .{ @intCast(rows.len), @intCast(bucket) }; + try m.stage(rows); + if (m.graphs.get(key)) |exec| { + try exec.launchOn(s); + m.replays += 1; + } else { + try m.run(s, rows.len, chunks, null); // warm-up: writes the same cache rows the replay will + try s.synchronize(); + try cuda.graph.beginCapture(s, .thread_local); + m.run(s, rows.len, chunks, null) catch |e| { + if (cuda.graph.endCapture(s)) |g| { + var gg = g; + gg.deinit(); + } else |_| {} + return e; + }; + var g = try cuda.graph.endCapture(s); + defer g.deinit(); + const exec = try g.instantiate(); + try m.graphs.put(m.gpa, key, exec); + try exec.launchOn(s); + m.captures += 1; + } + if (out) |o| try m.logitsTo(s, rows.len, o) else try s.synchronize(); + } + + pub const norm = ops.norm; + pub const normParts = ops.normParts; + pub const gateNormAt = ops.gateNormAt; + pub const qkvg = ops.qkvg; + pub const rowLaunch = ops.rowLaunch; + pub const proj = ops.proj; + pub const AttnIo = ops.AttnIo; + pub const attentionIo = ops.attentionIo; + + /// The window's kernels on staged inputs, no host work; full layers read `chunks` key chunks (each row's width). + pub fn run(m: *Model, s: Stream, n: usize, chunks: usize, cap: ?Capture) !void { + const cfg = m.w.cfg; + const D = cfg.hidden; + if (chunks > m.nch_max) return error.TooManyChunks; + { + var a: cuda.Args = .{}; + const es = m.embedSrc(m.b.erow, m.b.iota); + a.add(es[0]); + a.add(es[1]); + a.add(m.b.res); + a.add(ci(D)); + a.add(@as(f32, @floatCast(cfg.eps))); + try cuda.launch.launch(m.f_embed, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = NORM_THREADS, .y = 1, .z = 1 } }, s, &a); + } + try m.norm(s, m.b.res, false, m.w.layers[0].in_norm, m.b.x, n, D, cfg.eps); + for (m.w.layers, 0..) |L, i| { + if (cap) |c| if (c.teacher) { + try c.hook(c.ctx, .input, i, m.b.res, n); + try m.norm(s, m.b.res, false, L.in_norm, m.b.x, n, D, cfg.eps); + }; + try m.qkvg(s, L, m.b.x, m.b.q, m.b.k, m.b.v, m.b.g, n); + try ops.attention(m, s, i, n, chunks); + try m.proj(s, L.o, m.b.att, m.b.part, true, n); + try ops.gateNorm(m, s, m.b.part, 0, L.attn_ab, L.ffn_norm, m.b.xf, n); + if (cap) |c| try c.hook(c.ctx, .attn, i, m.b.res, n); + try ops.moe(m, s, L, n); + const after = if (i + 1 < m.w.layers.len) m.w.layers[i + 1].in_norm else m.w.norm; + try ops.gateNorm(m, s, m.b.part, L.post_ffn, L.mlp_ab, after, 0, n); + if (cap) |c| try c.hook(c.ctx, .mlp, i, m.b.res, n); + if (m.dr) |dr| if (cap == null) try dr.tap(s, i, m.b.res, n); + } + if (m.dr) |dr| if (cap == null) try dr.update(s, n); + try m.proj(s, m.w.head, m.b.x, m.b.head, true, n); + const cfgf = m.w.full; + var a: cuda.Args = .{}; + a.add(m.b.head); + a.add(@as(i64, @intCast(n * m.w.head.n))); + a.add(@as(f32, @floatCast(cfgf.out_mult))); + a.add(@as(f32, @floatCast(cfgf.softcap))); + try cuda.launch.launch(m.f_softcap, .{ .grid = .{ .x = u(@min((n * m.w.head.n + 255) / 256, 4096)), .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + // each rank's [n, its rows] block, gathered as n * stride elements a rank (rank 1's slice is a block shorter) + if (m.comm) |c| try c.allGather(m.b.head, m.b.recv, n * m.w.head_stride, .f32, s.handle); + } + + /// Where the rows' head slices are: (rank 0's [n, w0], rank 1's [n, w1] offset in elements, w0, w1). + fn heads(m: *const Model, n: usize) struct { base: u64, part: usize, w0: usize, w1: usize } { + if (m.comm == null) return .{ .base = m.b.head, .part = 0, .w0 = m.w.head.n, .w1 = 0 }; + const st = m.w.head_stride; + return .{ .base = m.b.recv, .part = n * st, .w0 = st, .w1 = m.w.head_rows - st }; // rank 1: the padded head's rest + } + + /// Each row's argmax over the real vocabulary on the device; only the ids reach the host. + pub fn argmaxTo(m: *Model, s: Stream, n: usize, out: []i32) !void { + const h = m.heads(n); + var a: cuda.Args = .{}; + a.add(h.base); + a.add(m.b.am); + a.add(ci(h.w0)); + a.add(ci(h.w1)); + a.add(@as(i64, @intCast(h.part))); + a.add(ci(m.w.full.vocab)); + try cuda.launch.launch(m.f_argmax, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + try s.synchronize(); + try m.d.check(m.d.api.cuMemcpyDtoH_v2(@ptrCast(out.ptr), m.b.am, n * 4), "argmax"); + } + + /// The window's logits on the host: [n, vocab] (the head's padding rows dropped). + pub fn logitsTo(m: *Model, s: Stream, n: usize, out: []f32) !void { + const V = m.w.full.vocab; + const h = m.heads(n); + try s.synchronize(); + for (0..n) |r| { + const c0 = @min(V, h.w0); + try m.d.check(m.d.api.cuMemcpyDtoH_v2(@ptrCast(out[r * V ..].ptr), h.base + r * h.w0 * 4, c0 * 4), "logits"); + if (V > c0) try m.d.check(m.d.api.cuMemcpyDtoH_v2(@ptrCast(out[r * V + c0 ..].ptr), h.base + (h.part + r * h.w1) * 4, (V - c0) * 4), "logits"); + } + } +}; + +fn upload(d: *const cuda.Driver, at: u64, bytes: []const u8) !void { + try d.check(d.api.cuMemcpyHtoD_v2(at, bytes.ptr, bytes.len), "upload"); +} + +test "chunks stay at 64 or fewer, and at CK keys up to 16K" { + try std.testing.expectEqual(@as(usize, 4096), bucketOf(4096, 2615)); + try std.testing.expectEqual(@as(usize, 256), chunkKeys(4096)); + try std.testing.expectEqual(@as(usize, 256), chunkKeys(16384)); + try std.testing.expectEqual(@as(usize, 512), chunkKeys(32768)); + try std.testing.expectEqual(@as(usize, 2048), chunkKeys(131072)); + try std.testing.expectEqual(@as(usize, 40960), bucketOf(40960, 40000)); + try std.testing.expect((40960 + chunkKeys(40960) - 1) / chunkKeys(40960) <= MAX_CHUNKS); +} + +test "ring" { + try std.testing.expectEqual(@as(usize, 2176), ringSize(2047, 128)); + try std.testing.expectEqual(@as(usize, 2112), ringSize(2047, 1)); +} diff --git a/zig/src/families/muse_spark/kept.zig b/zig/src/families/muse_spark/kept.zig new file mode 100644 index 00000000000..93f3a494a17 --- /dev/null +++ b/zig/src/families/muse_spark/kept.zig @@ -0,0 +1,326 @@ +//! Muse Spark's kept prompt states: full-layer rows pinned in their slot, sliding and drafter rings copied. + +const std = @import("std"); +const cuda = @import("cuda"); +const fwd = @import("forward.zig"); +const dflash2 = @import("dflash2.zig"); + +/// A cache word on the plan link: [Op.cache, kind, id, slot, slot2, at]. +pub const Kind = enum(i64) { save = 0, restore = 1, copy = 2, drop = 3 }; + +pub const WORDS = 6; + +/// A slot's span of one cache plane: `base + slot * bytes`, `bytes` long. +const Plane = struct { base: u64, bytes: usize }; + +/// Every rank's copies of kept states' windows, by id. +pub const Copies = struct { + gpa: std.mem.Allocator, + d: *const cuda.Driver, + m: *const fwd.Model, + planes: []Plane = &.{}, // the sliding layers' K and V rings, then the drafter's + bytes: usize = 0, // one state's copy + map: std.AutoHashMapUnmanaged(u64, cuda.DeviceBuffer) = .empty, + held: usize = 0, + + /// The planes a state copies: built after the drafter (when one is loaded) so its ring is in. + pub fn init(gpa: std.mem.Allocator, m: *const fwd.Model, dr: ?*const dflash2.Drafter) !Copies { + const cfg = m.w.cfg; + const L = m.w.layers.len; + var list: std.ArrayList(Plane) = .empty; + errdefer list.deinit(gpa); + const ring_row = cfg.kv_heads * cfg.head_dim * 2; // sliding caches are 16-bit + for (0..L) |i| if (!cfg.full[i]) { + try list.append(gpa, .{ .base = m.kc[i], .bytes = m.ring * ring_row }); + try list.append(gpa, .{ .base = m.vc[i], .bytes = m.ring * ring_row }); + }; + if (dr) |x| for (x.kc, x.vc) |k, v| { + const b = x.ring * x.c.kv_heads * 128 * 2; + try list.append(gpa, .{ .base = k, .bytes = b }); + try list.append(gpa, .{ .base = v, .bytes = b }); + }; + var c: Copies = .{ .gpa = gpa, .d = m.d, .m = m, .planes = try list.toOwnedSlice(gpa) }; + for (c.planes) |p| c.bytes += p.bytes; + return c; + } + + pub fn deinit(c: *Copies) void { + var it = c.map.valueIterator(); + while (it.next()) |b| b.free(); + c.map.deinit(c.gpa); + c.gpa.free(c.planes); + c.held = 0; + } + + fn copy(c: *const Copies, s: cuda.Stream, dst: u64, src: u64, n: usize) !void { + if (n > 0) try c.d.check(c.d.api.cuMemcpyDtoDAsync_v2(dst, src, n, s.handle), "kept copy"); + } + + /// Copy `slot`'s windows into a new buffer kept as `id` (on `s`, after the chunk that ends at the mark). + pub fn save(c: *Copies, s: cuda.Stream, id: u64, slot: u32) !void { + if (slot >= c.m.slots) return error.BadSlot; + if (c.map.contains(id)) return error.KeptTwice; + var buf = try cuda.DeviceBuffer.alloc(c.d, c.bytes); + errdefer buf.free(); + var off: usize = 0; + for (c.planes) |p| { + try c.copy(s, buf.ptr + off, p.base + slot * p.bytes, p.bytes); + off += p.bytes; + } + try c.map.put(c.gpa, id, buf); + c.held += c.bytes; + } + + /// Kept `id`'s windows into `slot` (before the pass's first chunk). + pub fn restore(c: *Copies, s: cuda.Stream, id: u64, slot: u32) !void { + if (slot >= c.m.slots) return error.BadSlot; + const buf = c.map.get(id) orelse return error.NoSuchState; + var off: usize = 0; + for (c.planes) |p| { + try c.copy(s, p.base + slot * p.bytes, buf.ptr + off, p.bytes); + off += p.bytes; + } + } + + /// The full layers' first `at` rows of slot `from` into `to`, for a resume in another slot. + pub fn copyPrefix(c: *const Copies, s: cuda.Stream, from: u32, to: u32, at: usize) !void { + const m = c.m; + const cfg = m.w.cfg; + if (from >= m.slots or to >= m.slots or from == to) return error.BadSlot; + if (at > m.context) return error.PastContext; + const row = cfg.kv_heads * cfg.head_dim * 2; + for (0..m.w.layers.len) |i| if (cfg.full[i]) { + for ([2]u64{ m.kc[i], m.vc[i] }) |base| try c.copy(s, base + to * m.context * row, base + from * m.context * row, at * row); + }; + } + + pub fn drop(c: *Copies, id: u64) void { + var kv = c.map.fetchRemove(id) orelse return; + kv.value.free(); + c.held -= c.bytes; + } + + /// A follower's cache word (after Op.cache): the same copy rank 0 made. + pub fn follow(c: *Copies, s: cuda.Stream, w: []const i64) !void { + if (w.len != WORDS) return error.BadPlan; + const kind: Kind = std.enums.fromInt(Kind, w[1]) orelse return error.BadPlan; + const id: u64 = @intCast(w[2]); + const slot: u32 = @intCast(w[3]); + switch (kind) { + .save => try c.save(s, id, slot), + .restore => try c.restore(s, id, slot), + .copy => try c.copyPrefix(s, slot, @intCast(w[4]), @intCast(w[5])), + .drop => c.drop(id), + } + } +}; + +/// The words of a cache step (Op.cache is the first word's value, passed in so this file needs no engine). +pub fn words(op: i64, kind: Kind, id: u64, slot: u32, slot2: u32, at: usize) [WORDS]i64 { + return .{ op, @backingInt(kind), @intCast(id), slot, slot2, @intCast(at) }; +} + +/// One kept state on rank 0: the slot whose full-layer rows it pins, its position, its window copy's id. +pub const State = struct { + id: u64, + slot: u32, + at: u32, + live: bool = true, // false once a pass rewrote rows under `at` (the cache drops it at its next lookup or eviction) + freed: bool = false, // its window copy is gone already (on every rank) + used: u64 = 0, +}; + +/// Rank 0's kept states and the slot choice that keeps them alive. +pub const Pins = struct { + gpa: std.mem.Allocator, + states: std.ArrayList(*State) = .empty, + next: u64 = 1, + tick: u64 = 0, + + pub fn deinit(p: *Pins) void { + for (p.states.items) |st| p.gpa.destroy(st); + p.states.deinit(p.gpa); + } + + pub fn add(p: *Pins, slot: u32, at: u32) !*State { + const st = try p.gpa.create(State); + errdefer p.gpa.destroy(st); + p.tick += 1; + st.* = .{ .id = p.next, .slot = slot, .at = at, .used = p.tick }; + try p.states.append(p.gpa, st); + p.next += 1; + return st; + } + + pub fn remove(p: *Pins, st: *State) void { + if (std.mem.indexOfScalar(*State, p.states.items, st)) |i| _ = p.states.swapRemove(i); + p.gpa.destroy(st); + } + + pub fn touch(p: *Pins, st: *State) void { + p.tick += 1; + st.used = p.tick; + } + + /// The lowest slot of `free` (slot bits) that no live state pins. + pub fn unpinned(p: *const Pins, free: u32) ?u32 { + var bits = free; + while (bits != 0) : (bits &= bits - 1) { + const slot: u32 = @ctz(bits); + const pinned = for (p.states.items) |st| { + if (st.live and st.slot == slot) break true; + } else false; + if (!pinned) return slot; + } + return null; + } + + /// Whether a live state of `slot` sits past `at` (a pass resumed at `at` there would end it). + pub fn later(p: *const Pins, slot: u32, at: u32) bool { + for (p.states.items) |st| if (st.live and st.slot == slot and st.at > at) return true; + return false; + } + + /// A stream's slot from `free`: the lowest no live state pins, else the one whose newest state is oldest. + pub fn pick(p: *const Pins, free: u32) ?u32 { + if (free == 0) return null; + var best: ?u32 = null; + var best_used: u64 = std.math.maxInt(u64); + var bits = free; + while (bits != 0) : (bits &= bits - 1) { + const slot: u32 = @ctz(bits); + var newest: u64 = 0; + for (p.states.items) |st| if (st.live and st.slot == slot) { + newest = @max(newest, st.used); + }; + if (newest == 0) return slot; + if (newest < best_used) { + best_used = newest; + best = slot; + } + } + return best; + } + + /// A resume's slot: `st`'s own when free and safe, else a free unpinned one (prefix copied), else LRU (or null). + pub fn resumeSlot(p: *const Pins, free: u32, st: *const State) ?u32 { + const own = free & (@as(u32, 1) << @intCast(st.slot)) != 0; + if (own and !p.later(st.slot, st.at)) return st.slot; + if (p.unpinned(free)) |u| return u; + if (own) return st.slot; + return p.pick(free); + } + + /// A pass on `slot` from `from` ends its live states past it; the first `out.len` go to `out` to free now. + pub fn overwrite(p: *Pins, slot: u32, from: u32, out: []*State) []*State { + var n: usize = 0; + for (p.states.items) |st| if (st.live and st.slot == slot and st.at > from) { + st.live = false; + if (n < out.len) { + out[n] = st; + n += 1; + } + }; + return out[0..n]; + } + + pub fn liveCount(p: *const Pins) usize { + var n: usize = 0; + for (p.states.items) |st| n += @intFromBool(st.live); + return n; + } +}; + +/// The rows of a pass's next chunk from `at` of `len`: at most `cap`, ending at the next mark past `at` if sooner. +pub fn chunkRows(at: usize, len: usize, cap: usize, marks: []const u32) usize { + var n = @min(cap, len - at); + for (marks) |mk| if (mk > at and mk < at + n) { + n = mk - at; + break; + }; + return n; +} + +test "chunks end at marks, the prompt's end or the cap" { + const t = std.testing; + try t.expectEqual(@as(usize, 1024), chunkRows(0, 5000, 1024, &.{})); + try t.expectEqual(@as(usize, 300), chunkRows(0, 5000, 1024, &.{ 300, 4000 })); + try t.expectEqual(@as(usize, 1024), chunkRows(300, 5000, 1024, &.{ 300, 4000 })); // the next mark is past the cap + try t.expectEqual(@as(usize, 1024), chunkRows(1024, 5000, 1024, &.{ 300, 4000 })); + try t.expectEqual(@as(usize, 952), chunkRows(3048, 5000, 1024, &.{ 300, 4000 })); + try t.expectEqual(@as(usize, 1000), chunkRows(4000, 5000, 1024, &.{ 300, 4000 })); + try t.expectEqual(@as(usize, 1), chunkRows(2047, 4096, 128, &.{2048})); // the sliding window's edge + try t.expectEqual(@as(usize, 128), chunkRows(2048, 4096, 128, &.{2048})); + try t.expectEqual(@as(usize, 5), chunkRows(4091, 4096, 128, &.{5000})); // a mark past the prompt cuts nothing +} + +test "slot choice keeps live states: free unpinned slots first, then the least recently used" { + const t = std.testing; + var p: Pins = .{ .gpa = t.allocator }; + defer p.deinit(); + try t.expectEqual(@as(?u32, 0), p.pick(0b1111)); + try t.expectEqual(@as(?u32, null), p.pick(0)); + const a = try p.add(0, 4096); // conversation A on slot 0 + const b = try p.add(1, 9000); // B on slot 1 + try t.expectEqual(@as(?u32, 2), p.pick(0b1111)); // a new conversation takes an unpinned slot + try t.expectEqual(@as(?u32, 0), p.pick(0b0011)); // only pinned slots: A was used longest ago + p.touch(a); + try t.expectEqual(@as(?u32, 1), p.pick(0b0011)); // now B is + try t.expectEqual(@as(?u32, 2), p.unpinned(0b1111)); + try t.expectEqual(@as(?u32, null), p.unpinned(0b0011)); + try t.expect(p.later(0, 2048) and !p.later(0, 4096) and !p.later(2, 0)); + var out: [4]*State = undefined; + try t.expectEqual(@as(usize, 0), p.overwrite(1, 9000, &out).len); // a pass resumed at B's own mark keeps B + try t.expect(b.live); + const ended = p.overwrite(1, 0, &out); // a fresh pass on slot 1 ends B + try t.expectEqual(@as(usize, 1), ended.len); + try t.expectEqual(b, ended[0]); + try t.expect(!b.live and a.live); + try t.expectEqual(@as(usize, 1), p.liveCount()); + try t.expectEqual(@as(?u32, 1), p.pick(0b0011)); // a slot whose states all ended is unpinned again + p.remove(b); + try t.expectEqual(@as(usize, 1), p.states.items.len); +} + +test "a resume at an earlier mark ends the later states of its slot only" { + const t = std.testing; + var p: Pins = .{ .gpa = t.allocator }; + defer p.deinit(); + const h = try p.add(0, 2048); // the history's mark + const r = try p.add(0, 6000); // the reply's warm end + const o = try p.add(1, 6000); // another slot's + var out: [1]*State = undefined; + const ended = p.overwrite(0, 2048, &out); // an edited last message resumes at the history + try t.expectEqual(@as(usize, 1), ended.len); + try t.expectEqual(r, ended[0]); + try t.expect(h.live and !r.live and o.live); + _ = try p.add(1, 7000); + try t.expectEqual(@as(usize, 1), p.overwrite(1, 0, &out).len); // two end, one fits `out`: the other keeps its copy + try t.expectEqual(@as(usize, 1), p.liveCount()); // the history's mark only + try t.expect(h.live and !o.live); +} + +test "a resume takes its own slot unless that ends later states or the slot is busy" { + const t = std.testing; + var p: Pins = .{ .gpa = t.allocator }; + defer p.deinit(); + const sys = try p.add(0, 1500); // a shared system block's state + try t.expectEqual(@as(?u32, 0), p.resumeSlot(0b1111, sys)); // nothing later on slot 0: resume in place + const conv = try p.add(0, 8000); // the conversation that kept it went on + try t.expectEqual(@as(?u32, 1), p.resumeSlot(0b1111, sys)); // another conversation copies the prefix to slot 1 + try t.expectEqual(@as(?u32, 0), p.resumeSlot(0b1111, conv)); // the conversation itself resumes in place + try t.expectEqual(@as(?u32, 1), p.resumeSlot(0b1110, conv)); // its slot busy: an unpinned free one + _ = try p.add(2, 100); + _ = try p.add(3, 100); + try t.expectEqual(@as(?u32, 0), p.resumeSlot(0b1101, sys)); // no unpinned slot: its own, ending the later state + p.touch(sys); + try t.expectEqual(@as(?u32, 2), p.resumeSlot(0b1100, conv)); // busy and no unpinned: the least recently used + try t.expectEqual(@as(?u32, null), p.resumeSlot(0, conv)); +} + +test "cache words round-trip the plan link" { + const w = words(5, .copy, 7, 2, 3, 70000); + try std.testing.expectEqual(@as(i64, 5), w[0]); + try std.testing.expectEqual(Kind.copy, std.enums.fromInt(Kind, w[1]).?); + try std.testing.expectEqual(@as(i64, 70000), w[5]); +} diff --git a/zig/src/families/muse_spark/load.zig b/zig/src/families/muse_spark/load.zig new file mode 100644 index 00000000000..18bf6ed40a2 --- /dev/null +++ b/zig/src/families/muse_spark/load.zig @@ -0,0 +1,252 @@ +//! A rank's share of a Muse Spark EXL3 pack on the GPU: the tensor set and its host-side constants (pack.zig reads). + +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const config = @import("config.zig"); +const ml = @import("pack.zig"); +const exl3 = @import("exl3.zig"); +const Config = config.Config; + +pub const Arena = ml.Arena; +const P = config.prefix; + +pub const Layer = struct { + in_norm: u64, // fp32 [D]: 1 + w (centred RMS before attention) + ffn_norm: u64, // fp32 [D]: 1 + w (centred RMS before the MoE) + post_ffn: u64, // fp32 [D]: 1 + w (input-scaled RMS after the MoE) + attn_ab: u64, // fp32 [2, D]: the post-attention residual gate's alpha, beta + mlp_ab: u64, // fp32 [2, D] + q: exl3.Linear, + k: exl3.Linear, + v: exl3.Linear, + g: exl3.Linear, // the full-width output gate + o: exl3.Linear, // a rank's input columns: partial outputs under TP + router: u64, // [E, D]: bf16 when every fp32 value is a bf16 (exact), else fp32 + router_bf16: bool, + bias: u64, // fp32 [E]: e_score_correction_bias + pre: exl3.Linear, // pre_expert_proj D -> latent (a rank's latent outputs under TP) + pre_norm: u64, // fp32 [latent]: 1 + w + post: exl3.Linear, // post_expert_proj latent -> D (a rank's latent inputs under TP) + expert_norm: u64, // fp32 [latent]: 1 + w (input-scaled RMS of each expert's output) + experts: exl3.Experts, +}; + +pub const Weights = struct { + full: Config, + cfg: Config, // this rank's view + rank: usize, + world: usize, + embed_host: []const u8 = &.{}, // bf16 [V, D]: read in place from the pack's mapped file, rows staged per window + embed_file: ?core.safetensors.File = null, + io: ?std.Io = null, + layers: []const Layer, + norm: u64, // fp32 [D]: w (the final norm is weighted by w, not 1 + w) + head: exl3.Linear, // a rank's 128-row blocks of the padded head + head_lo: usize, // its first vocabulary row + head_stride: usize, // columns a rank's slice takes in a gather + head_rows: usize, // the padded head's rows, every rank's together (202112) + arena: Arena, + gpa: std.mem.Allocator, + + pub fn deinit(w: *Weights) void { + if (w.embed_file) |*f| f.close(w.io.?); + for (w.layers) |L| { + w.gpa.free(L.experts.host_ptr); + w.gpa.free(L.experts.host_k2); + } + w.gpa.free(w.layers); + w.arena.deinit(); + } +}; + +/// Options for partial packs: the first `max_layers` layers only (a k-layer pack, or a check on fewer). +pub const Options = struct { max_layers: ?usize = null, log: bool = false }; + +pub fn load(gpa: std.mem.Allocator, io: std.Io, d: *const cuda.Driver, model_dir: []const u8, rank: usize, world: usize, opt: Options) !Weights { + const cfg_text = try readFile(gpa, io, model_dir, "config.json"); + defer gpa.free(cfg_text); + const gen_text = readFile(gpa, io, model_dir, "generation_config.json") catch null; + defer if (gen_text) |g| gpa.free(g); + var full = try Config.parse(gpa, cfg_text, gen_text); + if (opt.max_layers) |m| full.layers = @min(full.layers, m); + const view = try full.rankView(world); + var ck = try core.Checkpoint.openModel(gpa, io, model_dir); + defer ck.close(); + var w: Weights = .{ .full = full, .cfg = view, .rank = rank, .world = world, .layers = &.{}, .norm = 0, .head = undefined, .head_lo = 0, .head_stride = 0, .head_rows = 0, .arena = .{ .d = d, .gpa = gpa }, .gpa = gpa }; + errdefer w.deinit(); + const ar = &w.arena; + const emb = try ck.get(P ++ "embed_tokens.weight"); + if (emb.dtype != .bf16 or emb.shape[0] != full.vocab or emb.shape[1] != full.hidden) return error.BadEmbedding; + // the embedding stays out of GPU memory: token rows are copied from the pack's file mapping into each window + const name = P ++ "embed_tokens.weight"; + for (ck.files.items) |*f| if (f.get(name) != null) { + w.embed_file = try core.safetensors.File.open(gpa, io, f.path); + w.io = io; + break; + }; + const et = w.embed_file.?.get(name) orelse return error.BadEmbedding; + w.embed_host = et.bytes; + + var names: std.ArrayList(u8) = .empty; + defer names.deinit(gpa); + try names.ensureTotalCapacity(gpa, 1 << 20); + var cuts: std.ArrayList(config.Cut) = .empty; + defer cuts.deinit(gpa); + var nb: [256]u8 = undefined; + const t0 = std.Io.Clock.awake.now(io).toNanoseconds(); + var layers: std.ArrayList(Layer) = .empty; + errdefer { + for (layers.items) |L| { + gpa.free(L.experts.host_ptr); + gpa.free(L.experts.host_k2); + } + layers.deinit(gpa); + } + for (0..full.layers) |i| { + names.clearRetainingCapacity(); + cuts.clearRetainingCapacity(); + try config.layerCuts(full, i, rank, world, &names, gpa, &cuts); + var L: Layer = undefined; + L.in_norm = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.input_layernorm.weight", .{i})), 1.0); + L.ffn_norm = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.pre_feedforward_layernorm.weight", .{i})), 1.0); + L.post_ffn = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.post_feedforward_layernorm.weight", .{i})), 1.0); + L.attn_ab = try gates(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.post_attention_residual_gate.gate", .{i})), full.gate_temp); + L.mlp_ab = try gates(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.post_feedforward_residual_gate.gate", .{i})), full.gate_temp); + inline for (.{ "q", "k", "v", "g", "o", "pre", "post" }, 0..) |f, j| @field(L, f) = try ml.linear(gpa, ar, try ml.cut(gpa, try ml.readMat(gpa, &ck, cuts.items[j].prefix), cuts.items[j])); + const ex = cuts.items[config.attn_mats + config.latent_mats ..]; + L.experts = try experts(gpa, ar, &ck, full, ex); + errdefer { + gpa.free(L.experts.host_ptr); + gpa.free(L.experts.host_k2); + } + L.pre_norm = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.mlp.pre_expert_norm.weight", .{i})), 1.0); + L.expert_norm = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.mlp.experts.post_expert_norm.weight", .{i})), 1.0); + const r = try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.mlp.gate.weight", .{i})); + if (r.rank != 2 or r.shape[0] != full.experts or r.shape[1] != full.hidden) return error.BadRouter; + const rf = try ml.asF32(gpa, r); + defer gpa.free(rf); + L.router_bf16 = for (rf) |x| { + if (ml.bf16Round(x) != x) break false; + } else true; + if (L.router_bf16) { + const rb = try gpa.alloc(u16, rf.len); + defer gpa.free(rb); + for (rf, rb) |x, *o| o.* = @intCast(@as(u32, @bitCast(x)) >> 16); + L.router = try ar.upload(std.mem.sliceAsBytes(rb)); + } else L.router = try ar.upload(std.mem.sliceAsBytes(rf)); + L.bias = try plusOne(gpa, ar, try ck.get(try std.fmt.bufPrint(&nb, P ++ "layers.{d}.mlp.gate.e_score_correction_bias", .{i})), 0.0); + try layers.append(gpa, L); + ck.release(); // the uploaded layer's pages leave the mapping and the page cache + if (opt.log and (i % 8 == 7 or i == full.layers - 1)) { + const s = @as(f64, @floatFromInt(std.Io.Clock.awake.now(io).toNanoseconds() - t0)) / 1e9; + std.debug.print("[tensorfold] muse_spark (zig): {d}/{d} layers in {d:.0}s, {d:.1} GiB\n", .{ i + 1, full.layers, s, @as(f64, @floatFromInt(ar.total)) / (1 << 30) }); + } + } + gpa.free(w.layers); + w.layers = try layers.toOwnedSlice(gpa); + w.norm = try plusOne(gpa, ar, try ck.get(P ++ "norm.weight"), 0.0); + const hm = try ml.readMat(gpa, &ck, "lm_head"); + if (hm.n() < full.vocab) return error.BadHead; + const hc = config.headCut(hm.n(), rank, world); + w.head_lo = hc.lo; + w.head_stride = config.headStride(hm.n(), world); + w.head_rows = hm.n(); + w.head = try ml.linear(gpa, ar, try ml.cut(gpa, hm, hc)); + ck.release(); + return w; +} + +/// A norm weight as fp32 `bias + w` (exllamav3's constant_bias: 1 for the centred and input-scaled norms, else 0). +fn plusOne(gpa: std.mem.Allocator, ar: *Arena, t: core.safetensors.Tensor, bias: f32) !u64 { + const f = try ml.asF32(gpa, t); + defer gpa.free(f); + for (f) |*x| x.* = bias + x.*; + return ar.upload(std.mem.sliceAsBytes(f)); +} + +/// MuseSparkBlock._alpha_beta: w = g / T, beta = sigmoid(w), alpha = sqrt(max(sigmoid(-w) * (1 + beta), 1e-3)). +fn gates(gpa: std.mem.Allocator, ar: *Arena, t: core.safetensors.Tensor, temp: f64) !u64 { + const g = try ml.asF32(gpa, t); + defer gpa.free(g); + const ab = try gpa.alloc(f32, 2 * g.len); + defer gpa.free(ab); + const tf: f32 = @floatCast(temp); + for (g, 0..) |x, j| { + const v = x / tf; + const beta = 1.0 / (1.0 + @exp(-v)); + const sn = 1.0 / (1.0 + @exp(v)); + ab[j] = @sqrt(@max(sn * (1.0 + beta), 1e-3)); + ab[g.len + j] = beta; + } + return ar.upload(std.mem.sliceAsBytes(ab)); +} + +/// experts.prepare: per expert (gate, up, down) cut trellises in the stored layout, referenced by pointer tables. +fn experts(gpa: std.mem.Allocator, ar: *Arena, ck: *core.Checkpoint, full: Config, cuts: []const config.Cut) !exl3.Experts { + const E = full.experts; + if (cuts.len != 3 * E) return error.ExpertCuts; + const ptrs = try gpa.alloc(u64, 3 * E); // kept: Experts.host_ptr + errdefer gpa.free(ptrs); + const k2s = try gpa.alloc(i32, 3 * E); // kept: Experts.host_k2 + errdefer gpa.free(k2s); + var st: [6]std.ArrayList(f16) = @splat(.empty); // suh_g, suh_u, svh_g, svh_u, suh_d, svh_d + defer for (&st) |*l| l.deinit(gpa); + var lo: [2]u32 = .{ 99, 99 }; + var hi: [2]u32 = .{ 0, 0 }; + var dims: usize = 0; + var width: usize = 0; + for (0..E) |e| for (0..3) |j| { + const m = try ml.cut(gpa, try ml.readMat(gpa, ck, cuts[3 * e + j].prefix), cuts[3 * e + j]); + defer m.deinit(gpa); + ptrs[j * E + e] = try ar.upload(std.mem.sliceAsBytes(m.trellis)); + k2s[j * E + e] = @intCast(m.k2); + const g: usize = if (j == 2) 1 else 0; + lo[g] = @min(lo[g], m.k2); + hi[g] = @max(hi[g], m.k2); + switch (j) { + 0 => { + dims = m.k(); + width = m.n(); + try st[0].appendSlice(gpa, m.suh); + try st[2].appendSlice(gpa, m.svh); + }, + 1 => { + try st[1].appendSlice(gpa, m.suh); + try st[3].appendSlice(gpa, m.svh); + }, + else => { + if (m.n() != dims or m.k() != width) return error.ExpertShapes; + try st[4].appendSlice(gpa, m.suh); + try st[5].appendSlice(gpa, m.svh); + }, + } + }; + return .{ + .gate_ptr = try ar.upload(std.mem.sliceAsBytes(ptrs[0..E])), + .up_ptr = try ar.upload(std.mem.sliceAsBytes(ptrs[E .. 2 * E])), + .down_ptr = try ar.upload(std.mem.sliceAsBytes(ptrs[2 * E ..])), + .gate_k2 = try ar.upload(std.mem.sliceAsBytes(k2s[0..E])), + .up_k2 = try ar.upload(std.mem.sliceAsBytes(k2s[E .. 2 * E])), + .down_k2 = try ar.upload(std.mem.sliceAsBytes(k2s[2 * E ..])), + .suh_g = try ar.upload(std.mem.sliceAsBytes(st[0].items)), + .suh_u = try ar.upload(std.mem.sliceAsBytes(st[1].items)), + .svh_g = try ar.upload(std.mem.sliceAsBytes(st[2].items)), + .svh_u = try ar.upload(std.mem.sliceAsBytes(st[3].items)), + .suh_d = try ar.upload(std.mem.sliceAsBytes(st[4].items)), + .svh_d = try ar.upload(std.mem.sliceAsBytes(st[5].items)), + .count = E, + .dims = dims, + .width = width, + .k2_gu = .{ lo[0], hi[0] }, + .k2_d = .{ lo[1], hi[1] }, + .host_ptr = ptrs, + .host_k2 = k2s, + }; +} + +fn readFile(gpa: std.mem.Allocator, io: std.Io, dir: []const u8, name: []const u8) ![]u8 { + const path = try std.fs.path.join(gpa, &.{ dir, name }); + defer gpa.free(path); + return std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 22)); +} diff --git a/zig/src/families/muse_spark/m1_main.zig b/zig/src/families/muse_spark/m1_main.zig new file mode 100644 index 00000000000..e3927d3e0ba --- /dev/null +++ b/zig/src/families/muse_spark/m1_main.zig @@ -0,0 +1,316 @@ +//! tf-muse: teacher-forced decode rows against an answer key, its checks and `follow` (docs/recipes/muse-spark.md). + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const muse = @import("muse_spark"); +const pair = @import("pair.zig"); +const draft_main = @import("draft_main.zig"); +const prompt_main = @import("prompt_main.zig"); +const Model = muse.forward.Model; + +/// A developer knob's whole number (`std.c.getenv("MUSE_...")` at the call, so the name stays a literal). +fn env(raw: ?[*:0]const u8, default: usize) usize { + const v = raw orelse return default; + return std.fmt.parseInt(usize, std.mem.span(v), 10) catch default; +} + +const Text = struct { + name: []const u8, + ids: []i32, + states: ?[]f32 = null, // teacher: [L + 1, T, D] + logits: []f32, // [T, V] + res: ?[]f32 = null, // [L, T, D] + attn: ?[]f32 = null, + greedy: std.ArrayList(i32) = .empty, + fed: usize = 0, + last: usize = 0, // row of its last logits in the window buffer +}; + +const Win = struct { text: usize, pos: usize }; + +const Ctx = struct { + d: *const cuda.Driver, + s: cuda.Stream, + texts: []Text, + win: []Win, + layers: usize, + D: usize, + host: []f32, // [R, D] +}; + +fn hook(ctx: *anyopaque, what: Model.Tap, layer: usize, dev: u64, n: usize) anyerror!void { + const c: *Ctx = @ptrCast(@alignCast(ctx)); + const D = c.D; + switch (what) { + .input => { + for (c.win[0..n], 0..) |w, r| { + const t = c.texts[w.text]; + const st = t.states orelse return error.NoTeacher; + const T = t.ids.len; + if (w.pos >= T) { // greedy rows: keep ours + try c.s.synchronize(); + try c.d.check(c.d.api.cuMemcpyDtoH_v2(@ptrCast(c.host[r * D ..].ptr), dev + r * D * 4, D * 4), "teacher keep"); + continue; + } + @memcpy(c.host[r * D ..][0..D], st[(layer * T + w.pos) * D ..][0..D]); + } + try c.s.synchronize(); + try c.d.check(c.d.api.cuMemcpyHtoD_v2(dev, @ptrCast(c.host.ptr), n * D * 4), "teacher"); + }, + .attn, .mlp => { + try c.s.synchronize(); + try c.d.check(c.d.api.cuMemcpyDtoH_v2(@ptrCast(c.host.ptr), dev, n * D * 4), "capture"); + for (c.win[0..n], 0..) |w, r| { + const t = c.texts[w.text]; + const T = t.ids.len; + if (w.pos >= T) continue; + const dst = (if (what == .mlp) t.res else t.attn) orelse continue; + @memcpy(dst[(layer * T + w.pos) * D ..][0..D], c.host[r * D ..][0..D]); + } + }, + } +} + +fn readAll(gpa: std.mem.Allocator, io: std.Io, path: []const u8) ![]u8 { + return std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 34)); +} + +fn writeAll(io: std.Io, path: []const u8, bytes: []const u8) !void { + try std.Io.Dir.cwd().writeFile(io, .{ .sub_path = path, .data = bytes }); +} + +fn argmax(xs: []const f32) i32 { + var best: usize = 0; + for (xs, 0..) |x, i| if (x > xs[best]) { + best = i; + }; + return @intCast(best); +} + +pub fn main(init: std.process.Init) !u8 { + const args = try init.minimal.args.toSlice(init.arena.allocator()); + if (args.len >= 3 and std.mem.eql(u8, args[1], "follow")) return follow(init.gpa, init.io, args[2], if (args.len >= 4) args[3] else null); + const mode: ?draft_main.Mode = if (args.len >= 2) std.meta.stringToEnum(draft_main.Mode, args[1]) else null; + const prompt_check = args.len >= 2 and std.mem.eql(u8, args[1], "prompt"); + if (args.len < 5 or (mode == null and !prompt_check and !std.mem.eql(u8, args[1], "m1"))) { + std.debug.print("usage: tf-muse m1 MODEL IN_DIR OUT_DIR (knobs: MUSE_ROWS, MUSE_SLOTS, MUSE_LAYERS, MUSE_CONTEXT, MUSE_GREEDY, MUSE_CAPTURE, MUSE_TEACHER, MUSE_GRAPHS)\n" ++ + " tf-muse dflash|drafted MODEL IN_DIR OUT_DIR (the DFlash2 drafter's gates, TF_MUSE_DRAFTER: draft_main.zig)\n" ++ + " tf-muse prompt MODEL IN_DIR OUT_DIR (the prompt path against decode rows: prompt_main.zig)\n" ++ + " tf-muse follow MODEL [DRAFTER] (TP rank 1 behind tensorfold-native serve on rank 0; TF_TP_* as rank 0's;\n" ++ + " DRAFTER: rank 0's --drafter, else MODEL/dflash2)\n", .{}); + return 2; + } + const gpa = init.gpa; + const ar = init.arena.allocator(); + const io = init.io; + const rows_per = env(std.c.getenv("MUSE_ROWS"), 1); + const slots = env(std.c.getenv("MUSE_SLOTS"), 1); + const context = env(std.c.getenv("MUSE_CONTEXT"), 4096); + const n_greedy = env(std.c.getenv("MUSE_GREEDY"), 32); + const capture = env(std.c.getenv("MUSE_CAPTURE"), 0) != 0; + const teacher = env(std.c.getenv("MUSE_TEACHER"), 0) != 0; + const graphs = env(std.c.getenv("MUSE_GRAPHS"), 0) != 0; // graphed windows (no captures): logits must equal the eager run's bits + if (graphs and (capture or teacher)) return error.GraphsTakeNoCaptures; + const max_layers: ?usize = if (env(std.c.getenv("MUSE_LAYERS"), 0) > 0) env(std.c.getenv("MUSE_LAYERS"), 0) else null; + if (rows_per * slots > muse.forward.DECODE_ROWS) return error.WindowTooWide; + + const kn: Knobs = .{ .rows_per = rows_per, .slots = slots, .context = context, .n_greedy = n_greedy, .capture = capture, .teacher = teacher, .graphs = graphs, .max_layers = max_layers, .mode = mode, .dk = .{ .context = env(std.c.getenv("MUSE_CONTEXT"), 8192), .n_greedy = env(std.c.getenv("MUSE_GREEDY"), 64), .graphs = env(std.c.getenv("MUSE_GRAPHS"), 1) != 0 and env(std.c.getenv("MUSE_PAIR"), 0) == 0, .max_layers = max_layers, .rows_per = env(std.c.getenv("MUSE_ROWS"), 32), .dump_taps = env(std.c.getenv("MUSE_DUMP_TAPS"), 0) != 0 }, .prompt = prompt_check }; + const pair_mode = env(std.c.getenv("MUSE_PAIR"), 0) != 0; // both ranks of TP=2 in this process on one GPU (an in-process gather) + const tp_set = @import("sys").environment.Process.get(.{}, "TF_TP_WORLD") != null; // unset: one rank (tp's default is two) + const tpc: ?tp.Config = if (!pair_mode and tp_set) try tp.Config.fromEnv() else null; + const world: usize = if (pair_mode) 2 else if (tpc) |c| c.world else 1; + const rank: usize = if (tpc) |c| c.rank else 0; + var driver = try cuda.Driver.open(); + defer driver.close(); + var ctx = try cuda.Context.init(&driver, if (tpc) |c| @intCast(c.device) else 0); + defer ctx.deinit(); + if (pair_mode) { + if (graphs and mode == null) return error.PairIsEager; // the in-process gather syncs on the host + var pr: pair.Pair = .{ .d = &driver }; + var r1: pair.Rank = .{ .pair = &pr, .rank = 1 }; + var r0: pair.Rank = .{ .pair = &pr, .rank = 0 }; + var err1: ?anyerror = null; + const th = try std.Thread.spawn(.{}, pairRank, .{ gpa, io, &driver, &ctx, args, kn, r1.collective(), &err1 }); + runRank(gpa, ar, io, &driver, args, 0, 2, r0.collective(), kn) catch |e| { + pr.abort(); + th.join(); + return e; + }; + th.join(); + if (err1) |e| return e; + std.debug.print("DONE m1 pair\n", .{}); + return 0; + } + var session: tp.Session = undefined; + if (world > 1) try session.open(&driver, tpc.?, @import("tp_kernel").mailbox); + // a failed rank only closes: its hang-up fails the peer fast (exit 70) instead of leaving it in a collective + defer if (world > 1) session.close(); + try runRank(gpa, ar, io, &driver, args, rank, world, if (world > 1) session.comm() else null, kn); + if (world > 1) { // the stop: rank 0 (dumps written) announces it, then both meet, so neither close fails the other + if (rank == 0) session.announceStop(); + try session.comm().barrier(); + std.debug.print("STOPPED rank {d}: both ranks done\n", .{rank}); + } + return 0; +} + +const Knobs = struct { rows_per: usize, slots: usize, context: usize, n_greedy: usize, capture: bool, teacher: bool, graphs: bool, max_layers: ?usize, mode: ?draft_main.Mode = null, dk: draft_main.Knobs, prompt: bool = false }; + +fn pairRank(gpa: std.mem.Allocator, io: std.Io, driver: *const cuda.Driver, ctx: *const cuda.Context, args: []const [:0]const u8, kn: Knobs, comm: tp.Collective, err: *?anyerror) void { + ctx.makeCurrent() catch |e| { + err.* = e; + return; + }; + var arena = std.heap.ArenaAllocator.init(gpa); + defer arena.deinit(); + runRank(gpa, arena.allocator(), io, driver, args, 1, 2, comm, kn) catch |e| { + std.debug.print("[m1] rank 1: {s}\n", .{@errorName(e)}); + err.* = e; + comm.vtable.abort(comm.ptr); // rank 0 leaves its next gather instead of waiting forever + }; +} + +/// One rank's m1: load, every text's windows, rank 0 writes the dumps. +fn runRank(gpa: std.mem.Allocator, ar: std.mem.Allocator, io: std.Io, driver: *const cuda.Driver, args: []const [:0]const u8, rank: usize, world: usize, comm: ?tp.Collective, kn: Knobs) !void { + if (kn.mode) |md| return draft_main.run(md, gpa, ar, io, driver, args, rank, world, comm, kn.dk); + if (kn.prompt) return prompt_main.run(gpa, ar, io, driver, args, rank, world, comm); + var s = try cuda.Stream.init(driver, false); + defer s.deinit(); + const t0 = std.Io.Clock.awake.now(io).toNanoseconds(); + var w = try muse.load.load(gpa, io, driver, args[2], rank, world, .{ .max_layers = kn.max_layers, .log = rank == 0 }); + defer w.deinit(); + var k3 = try muse.exl3.Kernels.load(driver); + defer k3.deinit(); + var model = try Model.init(gpa, driver, &w, &k3, comm, kn.context, kn.rows_per * kn.slots, kn.slots, s); + defer model.deinit(); + const L = w.layers.len; + const D = w.cfg.hidden; + const V = w.full.vocab; + std.debug.print("[m1] rank {d}/{d}: loaded {d} layers in {d:.0}s ({d:.1} GiB weights, {d:.1} GiB model buffers); rows {d} x slots {d}, context {d}\n", .{ rank, world, L, @as(f64, @floatFromInt(std.Io.Clock.awake.now(io).toNanoseconds() - t0)) / 1e9, @as(f64, @floatFromInt(w.arena.total)) / (1 << 30), @as(f64, @floatFromInt(model.arena.total)) / (1 << 30), kn.rows_per, kn.slots, kn.context }); + + // texts + const names_path = try std.fs.path.join(ar, &.{ args[3], "names.txt" }); + const names_text = try readAll(ar, io, names_path); + var texts: std.ArrayList(Text) = .empty; + var it = std.mem.tokenizeAny(u8, names_text, " \r\n\t"); + while (it.next()) |name| { + const raw = try readAll(ar, io, try std.fmt.allocPrint(ar, "{s}/{s}.ids", .{ args[3], name })); + const ids = try ar.alloc(i32, raw.len / 4); + @memcpy(std.mem.sliceAsBytes(ids), raw[0 .. ids.len * 4]); + if (ids.len + kn.n_greedy > kn.context) return error.TextTooLong; + var t: Text = .{ .name = name, .ids = ids, .logits = try gpa.alloc(f32, ids.len * V) }; + if (kn.teacher) { + const st = try readAll(gpa, io, try std.fmt.allocPrint(ar, "{s}/{s}.states.f32", .{ args[3], name })); + if (st.len < L * ids.len * D * 4) return error.TeacherStatesShort; + t.states = @alignCast(std.mem.bytesAsSlice(f32, st)); + } + if (kn.capture) { + t.res = try gpa.alloc(f32, L * ids.len * D); + t.attn = try gpa.alloc(f32, L * ids.len * D); + } + try texts.append(ar, t); + } + const R = kn.rows_per * kn.slots; + const win = try ar.alloc(Win, R); + const host = try ar.alloc(f32, R * D); + const out = try gpa.alloc(f32, R * V); + defer gpa.free(out); + var cc: Ctx = .{ .d = driver, .s = s, .texts = texts.items, .win = win, .layers = L, .D = D, .host = host }; + const cap: ?Model.Capture = if (kn.capture or kn.teacher) .{ .hook = &hook, .ctx = &cc, .teacher = kn.teacher } else null; + + const t1 = std.Io.Clock.awake.now(io).toNanoseconds(); + var windows: usize = 0; + var total_rows: usize = 0; + var b: usize = 0; + while (b < texts.items.len) : (b += kn.slots) { + const batch = texts.items[b..@min(b + kn.slots, texts.items.len)]; + while (true) { + var rows: std.ArrayList(muse.forward.Row) = .empty; + defer rows.deinit(gpa); + for (batch, 0..) |*t, j| { + const T = t.ids.len; + if (t.fed < T) { + const k = @min(kn.rows_per, T - t.fed); + for (0..k) |q| { + win[rows.items.len] = .{ .text = b + j, .pos = t.fed + q }; + try rows.append(gpa, .{ .slot = @intCast(j), .pos = @intCast(t.fed + q), .token = t.ids[t.fed + q] }); + } + t.fed += k; + t.last = rows.items.len - 1; + } else if (t.greedy.items.len < kn.n_greedy) { + const nxt = argmax(out[t.last * V ..][0..V]); + try t.greedy.append(gpa, nxt); + if (t.greedy.items.len == kn.n_greedy or w.full.isEos(@intCast(nxt))) { + if (w.full.isEos(@intCast(nxt))) while (t.greedy.items.len < kn.n_greedy) try t.greedy.append(gpa, -1); + continue; + } + win[rows.items.len] = .{ .text = b + j, .pos = t.fed }; + try rows.append(gpa, .{ .slot = @intCast(j), .pos = @intCast(t.fed), .token = nxt }); + t.fed += 1; + t.last = rows.items.len - 1; + } + } + if (rows.items.len == 0) break; + if (kn.graphs) try model.graphed(s, rows.items, out[0 .. rows.items.len * V]) else try model.forward(s, rows.items, out[0 .. rows.items.len * V], cap); + windows += 1; + total_rows += rows.items.len; + for (rows.items, win[0..rows.items.len], 0..) |r, wv, i| { + const t = &texts.items[wv.text]; + if (r.pos < t.ids.len) @memcpy(t.logits[r.pos * V ..][0..V], out[i * V ..][0..V]); + } + } + } + const secs = @as(f64, @floatFromInt(std.Io.Clock.awake.now(io).toNanoseconds() - t1)) / 1e9; + std.debug.print("[m1] {d} windows, {d} rows in {d:.1}s ({s}; not a speed number); graphs captured {d}, replayed {d}\n", .{ windows, total_rows, secs, if (kn.graphs) "graphed" else "eager", model.captures, model.replays }); + for (texts.items) |*t| if (rank == 0) { + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.logits.f32", .{ args[4], t.name }), std.mem.sliceAsBytes(t.logits)); + try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.greedy.i32", .{ args[4], t.name }), std.mem.sliceAsBytes(t.greedy.items)); + if (t.res) |x| try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.res.f32", .{ args[4], t.name }), std.mem.sliceAsBytes(x)); + if (t.attn) |x| try writeAll(io, try std.fmt.allocPrint(ar, "{s}/{s}.attn.f32", .{ args[4], t.name }), std.mem.sliceAsBytes(x)); + std.debug.print("[m1] {s}: {d} tokens, greedy {any}\n", .{ t.name, t.ids.len, t.greedy.items[0..@min(8, t.greedy.items.len)] }); + }; + for (texts.items) |*t| { + gpa.free(t.logits); + if (t.res) |x| gpa.free(x); + if (t.attn) |x| gpa.free(x); + if (t.states) |x| gpa.free(std.mem.sliceAsBytes(x)); + t.greedy.deinit(gpa); + } + std.debug.print("DONE m1 rank {d}\n", .{rank}); +} + +/// Rank 1 behind the native server: the model rank 0 announces (hello), then every step rank 0 sends, until it stops. +fn follow(gpa: std.mem.Allocator, io: std.Io, model_dir: []const u8, drafter: ?[]const u8) !u8 { + const cfg = try tp.Config.fromEnv(); + if (cfg.world < 2 or cfg.rank == 0) return error.FollowNeedsRankOne; + var driver = try cuda.Driver.open(); + defer driver.close(); + var ctx = try cuda.Context.init(&driver, @intCast(cfg.device)); + defer ctx.deinit(); + try muse.config.admit(try ctx.capability(), cfg.world); + var session: tp.Session = undefined; + try session.open(&driver, cfg, @import("tp_kernel").mailbox); + defer { + session.announceStop(); + session.close(); + } + var buf: std.ArrayList(i64) = .empty; + defer buf.deinit(gpa); + const su = try muse.engine.setupOf(try session.plan.recvGrow(gpa, &buf)); + std.debug.print("[follow] rank {d}: context {d}, {d} slots\n", .{ cfg.rank, su.context, su.slots }); + const e = try muse.engine.Engine.init(gpa, io, &driver, model_dir, su, &session, drafter); + defer e.deinit(); + std.debug.print("[follow] loaded; following\n", .{}); + var steps: usize = 0; + while (true) { + const words = session.plan.recvGrow(gpa, &buf) catch |err| switch (err) { + error.PeerClosed => break, + else => return err, + }; + if (!try e.follow(words)) break; + steps += 1; + } + std.debug.print("[follow] stopped after {d} steps\n", .{steps}); + return 0; +} diff --git a/zig/src/families/muse_spark/native.zig b/zig/src/families/muse_spark/native.zig new file mode 100644 index 00000000000..03248a7efa5 --- /dev/null +++ b/zig/src/families/muse_spark/native.zig @@ -0,0 +1,553 @@ +//! Muse Spark behind the native server: the lane backend over engine.zig at two TP ranks (`tf-muse follow` on rank 1). + +const std = @import("std"); +const cuda = @import("cuda"); +const lanes = @import("lanes"); +const tp = @import("tp"); +const fwd = @import("forward.zig"); +const engine = @import("engine.zig"); +const dflash2 = @import("dflash2.zig"); +const kept = @import("kept.zig"); +const prompt_ = @import("prompt.zig"); +const rounds = @import("rounds.zig"); +const config = @import("config.zig"); +const be = lanes.backend; +const Engine = engine.Engine; + +pub const model_type = "muse_spark"; +pub const formats: []const []const u8 = &.{"exl3"}; +pub const default_context: i64 = 131072; +pub const max_segments: u32 = 1; +pub const prompt_rows: u32 = fwd.DECODE_ROWS; +pub const takes_drafter = true; // --drafter: the DFlash2 pack (the server refuses it to families without this) +pub const prompt_cache_gib: f64 = 1; // the cache budget a rank when --prompt-cache-gib is not given + +/// The server's settings: `lanes` (--parallel) the streams' cache slots, `drafter` (--drafter) the DFlash2 pack. +pub const Options = struct { context: usize, drafts: bool, segments: usize = 1, slide: bool = false, lanes: u32 = 4, drafter: ?[]const u8 = null }; + +pub const LoneRun = *const fn (ctx: *anyopaque, s: *lanes.Stream, hooks: *anyopaque, committed: *const fn (*anyopaque) void, yield: *const fn (*anyopaque) bool, resumed: bool) anyerror!bool; + +pub const Loaded = struct { + backend: be.Backend, + facts: lanes.Model, + rows: u32, + stream_bytes: usize, + free_streams: u32 = 1, + ctx: *anyopaque, + deinit: *const fn (*anyopaque) void, + lone: ?LoneRun = null, + target: *anyopaque, // the prompt cache's snap_* calls get this (the Lanes) + learns: ?*anyopaque = null, // no --slide + learn_bytes: usize = 0, +}; + +/// DFlash2's acceptance by depth until a stream has its own: a prior from RadixArk's reported acceptance lengths. +const draft_prior = [_]f64{ 0.80, 0.78, 0.78, 0.78, 0.78, 0.78, 0.78 }; +const first_copy_rows = 6; // a lone stream's first copy window beside the drafter + +const Lane = rounds.Lane; +const ring = 1024; + +pub const Lanes = struct { + gpa: std.mem.Allocator, + e: *Engine, + lanes: rounds.Map = .empty, + free: u32, // slot bits + drawn: [ring]u32 = undefined, + next: u64 = 0, + costs: [16]lanes.config.Cost = undefined, + shared: [32]lanes.config.Cost = undefined, + nshared: usize = 0, + draft_ms: f64 = 0, + pins: ?kept.Pins = null, // the kept prompt states (kept.zig), once the server grants the prompt cache room + + fn of(p: *anyopaque) *Lanes { + return @ptrCast(@alignCast(p)); + } + + pub fn backend(l: *Lanes) be.Backend { + return .{ .ptr = l, .vtable = &.{ .prefill = prefillFn, .first = firstFn, .queue = queueFn, .read = readFn, .verify = verifyFn, .keep = keepFn, .draft = draftFn, .release = releaseFn } }; + } + + fn block(l: *const Lanes) usize { + return if (l.e.dr) |dr| dr.block else 1; + } + + pub fn facts(l: *const Lanes) lanes.Model { + const drafting = l.e.dr != null; + const B: u32 = @intCast(l.block()); + return .{ + .exact_width = 8, // windows are row-invariant (tf-muse m1: 8 x 2 and 32 x 4 windows give one-row bits) + .gpu_tokens = false, + .mtp = drafting, + .speculate = drafting, + .speculate_early = false, + .draft_prior = if (drafting) &draft_prior else &.{}, + .drafts = B - 1, + .window_costs = l.costs[0..B], + .mtp_step_ms = l.draft_ms, + .hidden_rows = true, + .batch_rows = fwd.DECODE_ROWS, + .max_streams = @intCast(l.e.model.slots), + .shared_costs = l.shared[0..l.nshared], + .draft_streams = drafting, + .first_copy_rows = if (drafting) first_copy_rows else 0, + }; + } + + /// Graphed forward costs at load on distinct tokens (one stream; 2 .. 32 rows over the slots) and the draft pass. + pub fn measure(l: *Lanes, io: std.Io) !void { + const e = l.e; + var rows: [32]fwd.Row = undefined; + var rng = std.Random.DefaultPrng.init(0x3A5E); + const V = e.w.full.vocab; + const B = l.block(); + for (1..B + 1) |w| { + for (0..w) |j| rows[j] = .{ .slot = 0, .pos = @intCast(64 + j), .token = 0 }; + l.costs[w - 1] = .{ .width = @intCast(w), .ms = try l.time(io, rows[0..w], 16, &rng, V) }; + } + if (e.dr != null) { + var out: [16]i32 = undefined; + for (0..3) |_| try e.draft(&.{1000}, &.{64}, &.{0}, &out); + var dms: [16]f64 = undefined; + for (&dms, 0..) |*m, i| { + const t0 = std.Io.Clock.awake.now(io).toNanoseconds(); + try e.draft(&.{@intCast(1000 + 7919 * i)}, &.{64}, &.{0}, &out); + m.* = @as(f64, @floatFromInt(std.Io.Clock.awake.now(io).toNanoseconds() - t0)) / 1e6; + } + std.mem.sort(f64, &dms, {}, std.sort.asc(f64)); + l.draft_ms = dms[8]; + } + l.nshared = 0; + const S = e.model.slots; + for (2..33) |n| { + for (0..n) |j| rows[j] = .{ .slot = @intCast(j % S), .pos = @intCast(64 + j / S), .token = 0 }; + l.shared[l.nshared] = .{ .width = @intCast(n), .ms = try l.time(io, rows[0..n], 8, &rng, V) }; + l.nshared += 1; + } + std.log.info("muse costs (distinct tokens): window {d:.2} .. {d:.2} ms (1 .. {d} rows), shared 8 / 16 / 32 rows {d:.2} / {d:.2} / {d:.2} ms, draft {d:.2} ms", .{ l.costs[0].ms, l.costs[B - 1].ms, B, l.shared[6].ms, l.shared[14].ms, l.shared[l.nshared - 1].ms, l.draft_ms }); + } + + /// Median ms of `reps` graphed forwards of `rows`, each on fresh pseudo-random tokens, after warm replays. + fn time(l: *Lanes, io: std.Io, rows: []fwd.Row, reps: usize, rng: *std.Random.DefaultPrng, V: usize) !f64 { + const fill = struct { + fn f(rs: []fwd.Row, r: *std.Random.DefaultPrng, v: usize) void { + for (rs) |*x| x.token = @intCast(1000 + r.random().uintLessThan(usize, v - 2000)); + } + }.f; + for (0..3) |_| { + fill(rows, rng, V); + try l.e.forward(rows, .ids); + } + try l.e.s.synchronize(); + var ms: [32]f64 = undefined; + const n = @min(reps, ms.len); + for (0..n) |i| { + fill(rows, rng, V); + const t0 = std.Io.Clock.awake.now(io).toNanoseconds(); + try l.e.forward(rows, .ids); + try l.e.s.synchronize(); + ms[i] = @as(f64, @floatFromInt(std.Io.Clock.awake.now(io).toNanoseconds() - t0)) / 1e6; + } + std.mem.sort(f64, ms[0..n], {}, std.sort.asc(f64)); + return ms[n / 2]; + } + + fn take(l: *Lanes, token: u32) u64 { + const h = l.next; + l.drawn[h % ring] = token; + l.next += 1; + return h; + } + + fn rowOf(l: *Lanes, r: usize) []const f32 { + const V = l.e.w.full.vocab; + return l.e.logits[r * V ..][0..V]; + } + + /// The prompt as prompt chunks (prompt path) or decode windows of up to 128 rows; the last row's token drawn. + fn prefillFn(p: *anyopaque, s: *lanes.Stream) anyerror!void { + const l = of(p); + const e = l.e; + const ids = s.prompt(); + if (ids.len == 0 or ids.len + s.max_new + l.block() > e.model.context) return error.PromptTooLong; + const gop = try l.lanes.getOrPut(l.gpa, s); + s.cached = 0; + if (l.pins != null) { + if (gop.found_existing) l.free |= bit(gop.value_ptr.slot); // bound again: a kept state may want another slot + gop.value_ptr.* = .{ .slot = l.bind(s, ids.len) catch |err| { + l.lanes.removeByPtr(gop.key_ptr); + return err; + } }; + } else if (!gop.found_existing) { + if (l.free == 0) { + l.lanes.removeByPtr(gop.key_ptr); + return error.NoFreeSlot; + } + const slot: u32 = @ctz(l.free); + l.free &= ~(@as(u32, 1) << @intCast(slot)); + gop.value_ptr.* = .{ .slot = slot }; + } + gop.value_ptr.nheld = 0; + const slot = gop.value_ptr.slot; + const from: usize = s.cached; // a kept state's position (bind), else 0 + const marks: []const u32 = if (l.pins != null) s.reuse.marks else &.{}; + const greedy = s.sampling == null or s.sampling.?.temperature <= 0; + if (e.pr) |pr| if (ids.len - from >= prompt_.MIN) { + const toks = try l.gpa.alloc(i64, @min(ids.len, pr.cap)); + defer l.gpa.free(toks); + var at: usize = from; + while (at < ids.len) { + if (s.isCancelled()) return error.Cancelled; + if (l.pins != null and s.yields()) return error.Yielded; // a warm pass steps aside, keeping its marks + const n = kept.chunkRows(at, ids.len, pr.cap, marks); + for (0..n) |j| toks[j] = ids[at + j]; + const last = at + n == ids.len; + try e.prompt(slot, at, toks[0..n], if (!last) .none else if (greedy) .ids else .logits); + if (last) _ = l.take(if (greedy) @intCast(e.ids[0]) else try draw(l.gpa, l.rowOf(0), s.sampling, ids.len)); + at += n; + l.filledTo(s, at, marks); + } + return; + }; + var rows: [fwd.DECODE_ROWS]fwd.Row = undefined; + var at: usize = from; + while (at < ids.len) { + if (s.isCancelled()) return error.Cancelled; + if (l.pins != null and s.yields()) return error.Yielded; + const n = kept.chunkRows(at, ids.len, fwd.DECODE_ROWS, marks); + for (0..n) |j| rows[j] = .{ .slot = slot, .pos = @intCast(at + j), .token = ids[at + j] }; + const last = at + n == ids.len; + try e.forward(rows[0..n], if (!last) .none else if (greedy) .ids else .logits); + if (last) _ = l.take(if (greedy) @intCast(e.ids[n - 1]) else try draw(l.gpa, l.rowOf(n - 1), s.sampling, ids.len)); + at += n; + l.filledTo(s, at, marks); + } + } + + fn bit(slot: u32) u32 { + return @as(u32, 1) << @intCast(slot); + } + + /// The pass stands at `at` (its chunk done on the GPU): a mark there keeps the state (the cache calls snap_save). + fn filledTo(l: *Lanes, s: *lanes.Stream, at: usize, marks: []const u32) void { + if (l.lanes.getPtr(s)) |lane| lane.filled = @intCast(at); + if (std.mem.indexOfScalar(u32, marks, @intCast(at)) == null) return; + if (s.reuse.hook) |hk| hk.at(hk.ptr, s, @intCast(at)); + } + + /// A stream's slot with the prompt cache: a resumed state's own, another with its rows copied, or the least kept. + fn bind(l: *Lanes, s: *lanes.Stream, len: usize) !u32 { + const pins = &l.pins.?; + var out: [64]*kept.State = undefined; + if (s.reuse.saved) |saved| resumed: { + const st: *kept.State = @ptrCast(@alignCast(saved)); + if (!st.live or st.at != s.reuse.at or st.at >= len) { + s.reuse_failed = true; // its rows were rewritten since: the pass runs from 0 + break :resumed; + } + const slot = pins.resumeSlot(l.free, st) orelse return error.NoFreeSlot; + if (slot != st.slot) { + l.end(pins.overwrite(slot, 0, &out)); // the copy rewrites the rows under every state there + try l.e.cache(.copy, 0, st.slot, slot, st.at); + } + l.end(pins.overwrite(slot, st.at, &out)); + try l.e.cache(.restore, st.id, slot, 0, 0); + pins.touch(st); + l.free &= ~bit(slot); + s.cached = st.at; + return slot; + } + const slot = pins.pick(l.free) orelse return error.NoFreeSlot; + l.end(pins.overwrite(slot, 0, &out)); + l.free &= ~bit(slot); + return slot; + } + + /// Ended states' window copies freed on every rank (the cache drops the states themselves later). + fn end(l: *Lanes, ended: []*kept.State) void { + for (ended) |st| { + l.e.cache(.drop, st.id, 0, 0, 0) catch continue; + st.freed = true; + } + } + + fn firstFn(p: *anyopaque, s: *lanes.Stream, position: u64) anyerror!u64 { + const l = of(p); + if (position != s.prompt_len) return error.PositionMismatch; + return l.next - 1; + } + + fn queueFn(_: *anyopaque, _: *lanes.Stream, _: be.Feed, _: u64) anyerror!u64 { + return error.NotPipelined; + } + + fn readFn(p: *anyopaque, handle: u64) anyerror!u32 { + const l = of(p); + if (handle >= l.next or l.next - handle > ring) return error.NoSuchToken; + return l.drawn[handle % ring]; + } + + /// Every window's rows in one forward; each row drawn with its stream's sampling at its keyed position. + fn verifyFn(p: *anyopaque, windows: []const be.Window, out: []be.Verified) anyerror!void { + const l = of(p); + var rows: [fwd.DECODE_ROWS]fwd.Row = undefined; + const n = try rounds.verifyRows(&l.lanes, windows, &rows); + const all_greedy = rounds.allGreedy(windows); + try l.e.forward(rows[0..n], if (all_greedy) .ids else .logits); + var r0: usize = 0; + for (windows, out) |w, *o| { + for (0..w.rows()) |r| o.sampled[r] = if (all_greedy) @intCast(l.e.ids[r0 + r]) else try draw(l.gpa, l.rowOf(r0 + r), w.stream.sampling, w.positions[r]); + rounds.verifiedDrafts(l.lanes.getPtr(w.stream).?, w, o.drafts); + r0 += w.rows(); + } + } + + fn keepFn(_: *anyopaque, _: []const be.Window, paths: []const []const u32) anyerror!void { + try rounds.checkPaths(paths); + } + + /// One draft pass a 16 streams for the requests that want drafts (their contexts came with the target's taps). + fn draftFn(p: *anyopaque, requests: []const be.DraftRequest) anyerror!void { + const l = of(p); + const head: ?usize = if (l.e.dr) |dr| dr.block else null; + var batch: [dflash2.MAX_STREAMS]rounds.Entry = undefined; + var n: usize = 0; + for (requests) |r| { + batch[n] = try rounds.draftEntry(&l.lanes, r, head, &l.drawn) orelse continue; + n += 1; + if (n == batch.len) { + try l.draftBatch(batch[0..n]); + n = 0; + } + } + if (n > 0) try l.draftBatch(batch[0..n]); + } + + fn draftBatch(l: *Lanes, batch: []const rounds.Entry) !void { + const M = dflash2.MAX_STREAMS; + var toks: [M]i64 = undefined; + var pos0: [M]u32 = undefined; + var sl: [M]u32 = undefined; + for (batch, 0..) |e, i| { + toks[i] = e.token; + pos0[i] = e.pos0; + sl[i] = e.slot; + } + var out: [M * 16]i32 = undefined; + try l.e.draft(toks[0..batch.len], pos0[0..batch.len], sl[0..batch.len], &out); + rounds.hold(batch, &out, l.e.dr.?.block - 1); + } + + fn releaseFn(p: *anyopaque, s: *lanes.Stream) void { + const l = of(p); + const kv = l.lanes.fetchRemove(s) orelse return; + l.free |= @as(u32, 1) << @intCast(kv.value.slot); + } +}; + +/// The token for a row: the first maximum when greedy (or temperature 0), else the keyed sampler over the top-k. +pub fn draw(gpa: std.mem.Allocator, row: []const f32, settings: ?lanes.Sampling, position: u64) !u32 { + var best: usize = 0; + for (row, 0..) |x, i| if (x > row[best]) { + best = i; + }; + if (!std.math.isFinite(row[best])) return error.NonfiniteLogits; + const sampling = settings orelse return @intCast(best); + if (sampling.temperature <= 0) return @intCast(best); + const k = if (sampling.top_k == 0) row.len else @min(row.len, sampling.top_k); + const values = try gpa.alloc(f64, k); + defer gpa.free(values); + const ids = try gpa.alloc(u64, k); + defer gpa.free(ids); + var filled: usize = 0; + for (row, 0..) |x32, id| { + const x: f64 = x32; + if (k == row.len) { // the whole row in id order: the sampler cuts and orders it + values[id] = x; + ids[id] = id; + continue; + } + if (filled == k and x <= values[k - 1]) continue; + var at = @min(filled, k - 1); + while (at > 0 and x > values[at - 1]) : (at -= 1) { + values[at] = values[at - 1]; + ids[at] = ids[at - 1]; + } + values[at] = x; + ids[at] = id; + filled = @min(filled + 1, k); + } + return @intCast(try lanes.sampling.choose(gpa, values, ids, position, sampling)); +} + +const Owned = struct { gpa: std.mem.Allocator, e: *Engine, l: Lanes, session: ?*tp.Session }; + +// -- the prompt cache (native/cuda.zig builds the server's store over these when snap_budget grants it room) ------ + +/// No lookahead: a state after `at` tokens holds exactly the rows of those tokens. +pub const snap_lookahead: u32 = 0; + +fn lanesOf(ptr: *anyopaque) *Lanes { + return @ptrCast(@alignCast(ptr)); +} + +/// Warm passes (a reply re-read while the server is idle) wait this long for other work first. +pub const warm_quiet: u64 = 150 * std.time.ns_per_ms; + +/// The server made a prompt cache of `cache` bytes (--prompt-cache-gib, 0: none): states are kept from now on. +pub fn snap_ready(ptr: *anyopaque, cache: u64) !u64 { + const l = lanesOf(ptr); + if (cache > 0 and l.pins == null) { + l.pins = .{ .gpa = l.gpa }; + std.log.info("muse prompt cache: {d:.1} MiB a kept state a rank (sliding and drafter windows; full-layer rows stay in their slot)", .{@as(f64, @floatFromInt(l.e.copies.bytes)) / (1 << 20)}); + } + return 0; +} + +/// A state's new device storage on each rank: its window copies (full-layer rows stay pinned in the slot). +pub fn snap_bytes(ptr: *anyopaque, at: u32) u64 { + _ = at; + return lanesOf(ptr).e.copies.bytes; +} + +/// Keep the state of `owner`'s slot after `at` prompt tokens: the pass stands there (its chunk done). +pub fn snap_save(ptr: *anyopaque, owner: ?*anyopaque, at: u32) anyerror!*anyopaque { + const l = lanesOf(ptr); + const pins = if (l.pins) |*x| x else return error.NoPromptCache; + const s: *const lanes.Stream = @ptrCast(@alignCast(owner orelse return error.NoStream)); + const lane = l.lanes.get(s) orelse return error.UnknownStream; + if (at == 0 or lane.filled != at) return error.NotAtMark; + const st = try pins.add(lane.slot, at); + errdefer pins.remove(st); + try l.e.cache(.save, st.id, lane.slot, 0, 0); + return st; +} + +/// The lane host never restores through the cache: prefill binds the stream to the state's slot itself (bind). +pub fn snap_restore(ptr: *anyopaque, owner: ?*anyopaque, saved: *anyopaque) anyerror!void { + _ = .{ ptr, owner, saved }; + return error.RestoredByPrefill; +} + +pub fn snap_drop(ptr: *anyopaque, saved: *anyopaque) void { + const l = lanesOf(ptr); + const st: *kept.State = @ptrCast(@alignCast(saved)); + if (!st.freed) l.e.cache(.drop, st.id, 0, 0, 0) catch {}; + if (l.pins) |*x| x.remove(st); +} + +/// The native entry: a GB10 (sm_121) at TF_TP_WORLD=2 (rank 1 runs `tf-muse follow`); drafts need --drafter. +pub fn open(gpa: std.mem.Allocator, io: std.Io, ctx: *const cuda.Context, dir: []const u8, kernels: ?[]const u8, o: Options) !Loaded { + _ = kernels; // no captured Triton set: Muse runs its own CUDA kernels + if (o.lanes == 0 or o.lanes > 32) return error.Slots; + const c = (try tpRead()) orelse return error.MuseSparkRequiresTwoRanks; + try config.admit(try ctx.capability(), c.world); + if (c.rank != 0) return error.FollowerServes; // rank 1 runs `tf-muse follow` + const drafting = o.drafts and o.drafter != null; + const su: engine.Setup = .{ .context = o.context, .slots = o.lanes, .drafts = drafting }; + const session = try gpa.create(tp.Session); + errdefer gpa.destroy(session); + try session.open(ctx.d, c, @import("tp_kernel").mailbox); + errdefer { + session.announceStop(); + session.close(); + } + try session.plan.send(&engine.hello(su)); + const e = try Engine.init(gpa, io, ctx.d, dir, su, session, o.drafter); + errdefer e.deinit(); + const own = try gpa.create(Owned); + errdefer gpa.destroy(own); + own.* = .{ .gpa = gpa, .e = e, .l = .{ .gpa = gpa, .e = e, .free = if (su.slots == 32) ~@as(u32, 0) else (@as(u32, 1) << @intCast(su.slots)) - 1 }, .session = session }; + try own.l.measure(io); + return .{ + .backend = own.l.backend(), + .facts = own.l.facts(), + // shared rounds need a family width >= 2 (lanes Config): 8 rows (exact_width) also without the drafter + .rows = @intCast(@max(own.l.block(), 8)), + .stream_bytes = 0, + .free_streams = @intCast(su.slots), + .ctx = own, + .deinit = release, + .target = &own.l, + }; +} + +/// The process's TF_TP_* through tp's own reader; null while TF_TP_WORLD is unset or blank (tp's default is two). +fn tpRead() tp.config.Error!?tp.Config { + const world = @import("sys").environment.Process.get(.{}, "TF_TP_WORLD") orelse return null; + return if (world.len == 0) null else try tp.Config.fromEnv(); +} + +/// `get`'s TF_TP_*, as tpRead reads the process's (the tests' fake environments). +fn tpFrom(get: *const fn ([]const u8) ?[]const u8) tp.config.Error!?tp.Config { + if (get("TF_TP_WORLD") == null) return null; + return try tp.Config.parse(get); +} + +/// Admission bytes of a rank: the checkpoint over the two TP ranks (the embedding stays in host memory). +pub fn weightShare(_: std.mem.Allocator, _: std.Io, _: []const u8, total: u64, _: bool) (tp.config.Error || error{MuseSparkRequiresTwoRanks})!u64 { + return share(total, tpRead()); +} + +/// weightShare under TF_TP_* as read: a bad setting is BadSetting and one rank (unset too) is refused, as `open` does. +fn share(total: u64, read: tp.config.Error!?tp.Config) (tp.config.Error || error{MuseSparkRequiresTwoRanks})!u64 { + const c = (try read) orelse return error.MuseSparkRequiresTwoRanks; + if (c.world != 2) return error.MuseSparkRequiresTwoRanks; + return total / c.world; +} + +pub const explains_open = true; + +pub fn explain(_: ?*anyopaque, err: anyerror) ?[]const u8 { + return switch (err) { + error.PromptTooLong => "the prompt and its reply exceed this server's context window: shorten it or lower max_tokens", + error.NoFreeSlot => "every stream slot is busy: retry once another request ends", + error.BadSetting => "a TF_TP_* setting is malformed or out of range (TF_TP_WORLD, TF_TP_RANK below it, TF_TP_PORT): Muse Spark serves at TF_TP_WORLD=2", + error.MuseSparkRequiresSm121 => "Muse Spark is served on GB10 (sm_121) only so far, and this GPU is another", + error.MuseSparkRequiresTwoRanks => "Muse Spark is served at two TP ranks only so far: TF_TP_WORLD=2 and TF_TP_RANK=0 here, `tf-muse follow` on rank 1", + error.FollowerServes => "TF_TP_RANK is not 0: rank 0 serves, the other ranks run `tf-muse follow`", + else => null, + }; +} + +fn release(p: *anyopaque) void { + const own: *Owned = @ptrCast(@alignCast(p)); + if (own.session) |ss| { + ss.plan.send(&.{ @backingInt(engine.Op.stop), 0 }) catch {}; + } + own.l.lanes.deinit(own.gpa); + if (own.l.pins) |*x| x.deinit(); + own.e.deinit(); + if (own.session) |ss| { + ss.announceStop(); + ss.close(); + own.gpa.destroy(ss); + } + own.gpa.destroy(own); +} + +fn tpEnv(comptime world: []const u8, comptime rank: []const u8) *const fn ([]const u8) ?[]const u8 { + return &struct { + fn get(name: []const u8) ?[]const u8 { + if (std.mem.eql(u8, name, "TF_TP_WORLD")) return world; + if (std.mem.eql(u8, name, "TF_TP_RANK") and rank.len > 0) return rank; + return null; + } + }.get; +} + +test "a bad TF_TP_* refuses the weight share; one rank is refused by name" { + const unset = struct { + fn get(_: []const u8) ?[]const u8 { + return null; + } + }.get; + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, share(1000, tpFrom(&unset))); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, share(1000, tpFrom(tpEnv("1", "")))); + try std.testing.expectError(error.MuseSparkRequiresTwoRanks, share(1000, tpFrom(tpEnv("4", "3")))); + inline for (.{ .{ "two", "" }, .{ "0", "" }, .{ "65", "" }, .{ "2", "2" }, .{ "2", "-1" }, .{ "2", "one" } }) |bad| { + try std.testing.expectError(error.BadSetting, share(1000, tpFrom(tpEnv(bad[0], bad[1])))); + } + try std.testing.expectEqual(@as(u64, 500), try share(1000, tpFrom(tpEnv("2", "1")))); +} diff --git a/zig/src/families/muse_spark/ops.zig b/zig/src/families/muse_spark/ops.zig new file mode 100644 index 00000000000..e5e9ed9e2fe --- /dev/null +++ b/zig/src/families/muse_spark/ops.zig @@ -0,0 +1,265 @@ +//! The decode forward's ops on a Model's buffers: norms, residual gates, EXL3 projections, attention and the MoE. + +const std = @import("std"); +const cuda = @import("cuda"); +const fwd = @import("forward.zig"); +const load_ = @import("load.zig"); +const exl3 = @import("exl3.zig"); +const Model = fwd.Model; +const Stream = cuda.Stream; +const CK = fwd.CK; +const NORM_THREADS = fwd.NORM_THREADS; +const multi_k2s = fwd.multi_k2s; + +fn u(x: usize) u32 { + return @intCast(x); +} +fn ci(x: usize) c_int { + return @intCast(x); +} + +pub fn norm(m: *Model, s: Stream, x: u64, x_half: bool, w: u64, out: u64, n: usize, dim: usize, eps: f64) !void { + return m.normParts(s, x, x_half, w, out, n, dim, eps, 0); +} + +/// RMS norm of n rows; `parts` > 0: x is the ranks' gathered column slices of that width. +pub fn normParts(m: *Model, s: Stream, x: u64, x_half: bool, w: u64, out: u64, n: usize, dim: usize, eps: f64, parts: usize) !void { + var a: cuda.Args = .{}; + a.add(x); + a.add(@as(c_int, @intFromBool(x_half))); + a.add(w); + a.add(out); + a.add(ci(dim)); + a.add(@as(f32, @floatCast(eps))); + a.add(ci(parts)); + try cuda.launch.launch(m.f_rms, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = NORM_THREADS, .y = 1, .z = 1 } }, s, &a); +} + +/// The ranks' fp32 partials [n, count]: all-gathered into recv (rank-major); returns (rank 0's, rank 1's or 0). +fn gather(m: *Model, s: Stream, part: u64, count: usize) ![2]u64 { + const c = m.comm orelse return .{ part, 0 }; + try c.allGather(part, m.b.recv, count, .f32, s.handle); + return .{ m.b.recv, m.b.recv + count * 4 }; +} + +/// res = res * alpha + rms(y') * beta (y the ranks' partials in rank order), then x = half(rms(res) * w_next). +pub fn gateNorm(m: *Model, s: Stream, part: u64, scale: u64, ab: u64, w_next: u64, xf: u64, n: usize) !void { + const y = try gather(m, s, part, n * m.w.cfg.hidden); + try gateNormAt(m, s, m.b.res, y, scale, ab, w_next, m.b.x, xf, n); +} + +/// muse_gate_norm on explicit buffers: res [n, D] fp32 in place, y the ranks' partials, x [n, D] fp16 out. +pub fn gateNormAt(m: *Model, s: Stream, res: u64, y: [2]u64, scale: u64, ab: u64, w_next: u64, x: u64, xf: u64, n: usize) !void { + const cfg = m.w.cfg; + var a: cuda.Args = .{}; + a.add(res); + a.add(y[0]); + a.add(y[1]); + a.add(scale); + a.add(@as(c_int, @intFromBool(scale != 0))); + a.add(@as(f32, @floatCast(cfg.post_eps))); + a.add(ab); + a.add(w_next); + a.add(@as(f32, @floatCast(cfg.eps))); + a.add(x); + a.add(xf); + a.add(ci(cfg.hidden)); + try m.rowLaunch(m.f_gate, m.f_gate_c, cfg.hidden, n, s, &a); +} + +const Job = extern struct { xh: u64, t: u64, stride_k: i64, stride_nb: i64, svh: u64, bias: u64, y: u64, z: u64, counters: u64, y_dtype: c_int, k: c_int, n: c_int, sk: c_int, b0: c_int, pad: c_int = 0 }; +const Batch = extern struct { j: [4]Job, n: c_int, m: c_int, pad: [2]c_int = .{ 0, 0 } }; +const Rot = extern struct { suh: [4]u64, xh: [4]u64 }; + +/// q, k, v and gate (fp16): one rot_in and one linear launch when they share a width and plan, else four. +pub fn qkvg(m: *Model, s: Stream, L: load_.Layer, x: u64, q: u64, k: u64, v: u64, g: u64, n: usize) !void { + const ls = [4]exl3.Linear{ L.q, L.k, L.v, L.g }; + const outs = [4]u64{ q, k, v, g }; + var ok = n <= 16; // wider windows: proj's 32-row passes + const fi = std.mem.indexOfScalar(u32, &multi_k2s, L.q.k2); + if (fi == null) ok = false; + for (ls) |l| if (l.k2 != L.q.k2 or l.split[1] != 4 or l.k != L.q.k or l.bias != 0) { + ok = false; + }; + if (!ok) { + for (ls, outs) |l, o| try m.proj(s, l, x, o, false, n); + return; + } + const K = L.q.k; + const D = m.w.cfg.hidden; + var rot: Rot = undefined; + var bt: Batch = .{ .j = undefined, .n = 4, .m = ci(n) }; + var b0: usize = 0; + var zat = m.b.z4; + for (ls, outs, 0..) |l, o, j| { + rot.suh[j] = l.suh; + rot.xh[j] = m.b.xh4 + j * m.rows * D * 2; + const st = l.strides(); + const sk = l.split[0]; + bt.j[j] = .{ .xh = rot.xh[j], .t = l.words, .stride_k = st[0], .stride_nb = st[1], .svh = l.svh, .bias = 0, .y = o, .z = if (sk > 1) zat else 0, .counters = l.counters, .y_dtype = 0, .k = ci(l.k), .n = ci(l.n), .sk = ci(sk), .b0 = ci(b0) }; + if (sk > 1) zat += sk * n * l.n * 4; + b0 += (l.n / 128) * sk; + } + { + var a: cuda.Args = .{}; + a.add(x); + a.add(@as(c_int, 0)); + a.add(rot); + a.add(ci(K)); + try cuda.launch.launch(m.f_rotm, .{ .grid = .{ .x = u(((K / 128) + 3) / 4), .y = u(n), .z = 4 }, .block = .{ .x = 128, .y = 1, .z = 1 } }, s, &a); + } + const f = m.f_multi[fi.?]; + const smem: u32 = u(4 * @as(usize, @min(n, 8)) * 128 * 4); + var a: cuda.Args = .{}; + a.add(bt); + try cuda.launch.launch(f, .{ .grid = .{ .x = u(b0), .y = 1, .z = 1 }, .block = .{ .x = 128, .y = 1, .z = 1 }, .shared = smem }, s, &a); +} + +/// A glue kernel's cluster form (8 x 128 threads a row), or one 1024-thread block a row past its width limit. +pub fn rowLaunch(_: *const Model, f: cuda.Function, fc: cuda.Function, width: usize, n: usize, s: Stream, a: *cuda.Args) !void { + if (width <= 16 * NORM_THREADS) { + try cuda.launch.launch(fc, .{ .grid = .{ .x = u(n * 8), .y = 1, .z = 1 }, .block = .{ .x = 128, .y = 1, .z = 1 } }, s, a); + } else try cuda.launch.launch(f, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = NORM_THREADS, .y = 1, .z = 1 } }, s, a); +} + +/// An EXL3 projection of n rows: x [n, K] fp16 -> out [n, N] fp16 or fp32. +pub fn proj(m: *Model, s: Stream, l: exl3.Linear, x: u64, out: u64, out_f32: bool, n: usize) !void { + const z = if (l.split[0] > 1) m.b.z else 0; + const ki = std.mem.indexOfScalar(u32, &multi_k2s, l.k2); + const wi: ?usize = if (l.split[1] == 4) 0 else if (l.split[1] == 8) 1 else null; + if (n <= 16 or ki == null or wi == null or n > 128) { + return m.k3.linear(s, l, x, .f16, m.b.xh, out, if (out_f32) .f32 else .f16, z, n); + } + // the shared linear's arguments on linear_body2 (32-row passes), a (N / 128, SK) grid + try m.k3.rotIn(s, x, .f16, l.suh, m.b.xh, n, l.k); + const sk, const wk = l.split; + if ((l.k / 16) % (sk * wk) != 0) return error.KSplit; + const f = m.f_lin2[ki.?][wi.?]; + const smem: u32 = u(wk * @as(usize, @min(n, 8)) * 128 * 4); + if (smem > 48 * 1024) try f.allowDynamicShared(smem); + const st = l.strides(); + var a: cuda.Args = .{}; + inline for (.{ m.b.xh, l.words }) |p| a.add(p); + a.add(st[0]); + a.add(st[1]); + inline for (.{ l.svh, l.bias, out }) |p| a.add(p); + a.add(@as(c_int, if (out_f32) 2 else 0)); + a.add(z); + a.add(l.counters); + a.add(ci(n)); + a.add(ci(l.k)); + a.add(ci(l.n)); + a.add(ci(sk)); + try cuda.launch.launch(f, .{ .grid = .{ .x = u(l.n / 128), .y = u(sk), .z = 1 }, .block = .{ .x = u(wk * 32), .y = 1, .z = 1 }, .shared = smem }, s, &a); +} + +/// A window's attention buffers: q, k, v, g in; qo scratch; att out; the rows' positions and slots. +pub const AttnIo = struct { q: u64, k: u64, v: u64, g: u64, qo: u64, att: u64, pos: u64, slot: u64 }; + +pub fn attention(m: *Model, s: Stream, i: usize, n: usize, chunks: usize) !void { + return attentionIo(m, s, i, n, chunks, .{ .q = m.b.q, .k = m.b.k, .v = m.b.v, .g = m.b.g, .qo = m.b.qo, .att = m.b.att, .pos = m.b.pos, .slot = m.b.slot }); +} + +/// Attention of n <= rows rows (partials in the decode buffers): QK prep and cache write, chunks, merge + gate. +pub fn attentionIo(m: *Model, s: Stream, i: usize, n: usize, chunks: usize, io: AttnIo) !void { + if (n > m.rows) return error.WindowTooWide; + const cfg = m.w.cfg; + const H = cfg.heads; + const HK = cfg.kv_heads; + const full = cfg.full[i]; + const len = if (full) m.context else m.ring; + { + var a: cuda.Args = .{}; + inline for (.{ io.q, io.k, io.v, m.cos, m.sin }) |p| a.add(p); + a.add(@as(c_int, @intFromBool(cfg.rope(i)))); + inline for (.{ io.pos, io.slot, io.qo, m.kc[i], m.vc[i] }) |p| a.add(p); + a.add(ci(len)); + a.add(ci(H)); + a.add(ci(HK)); + a.add(@as(f32, @floatCast(cfg.eps))); + try cuda.launch.launch(m.f_prep, .{ .grid = .{ .x = u(n), .y = u(H + HK), .z = 1 }, .block = .{ .x = 32, .y = 1, .z = 1 } }, s, &a); + } + const win: usize = if (full) 0 else cfg.window; + const nch: usize = if (full) chunks else (cfg.window + 1 + CK - 1) / CK; + { + var a: cuda.Args = .{}; + inline for (.{ io.qo, m.kc[i], m.vc[i], io.pos, io.slot, m.b.po, m.b.pm, m.b.pl }) |p| a.add(p); + a.add(ci(len)); + a.add(ci(nch)); + a.add(if (full) -ci((m.context + CK - 1) / CK * CK) else ci(CK)); // full: each row's own chunk width + a.add(ci(win)); + a.add(ci(H)); + a.add(ci(HK)); + a.add(@as(f32, @floatCast(cfg.smScale()))); + try cuda.launch.launch(m.f_rows, .{ .grid = .{ .x = u(n), .y = u(HK), .z = u(nch) }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + } + { + var a: cuda.Args = .{}; + inline for (.{ m.b.po, m.b.pm, m.b.pl }) |p| a.add(p); + a.add(ci(nch)); + a.add(io.g); + a.add(io.att); + a.add(ci(H)); + a.add(@as(f32, @floatCast(cfg.eps))); + a.add(@as(c_int, @intFromBool(full))); + try cuda.launch.launch(m.f_merge, .{ .grid = .{ .x = u(n), .y = u(H / 8), .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + } +} + +/// MuseSparkMoE: fp32 router, latent projection and norm, routed experts with the per-expert norm, into part. +pub fn moe(m: *Model, s: Stream, L: load_.Layer, n: usize) !void { + const cfg = m.w.cfg; + const E = cfg.experts; + const K = cfg.top_k; + const rs = s; + { + var a: cuda.Args = .{}; + a.add(m.b.xf); + a.add(L.router); + a.add(@as(c_int, @intFromBool(L.router_bf16))); + a.add(m.b.logits); + a.add(ci(cfg.hidden)); + a.add(ci(E)); + const rw: usize = 2; // 2 warps a block spread one row's 256 experts over every SM + try cuda.launch.launch(m.f_router, .{ .grid = .{ .x = u((E + rw - 1) / rw), .y = u(n), .z = 1 }, .block = .{ .x = u(32 * rw), .y = 1, .z = 1 } }, rs, &a); + } + { + var a: cuda.Args = .{}; + a.add(m.b.logits); + a.add(L.bias); + a.add(ci(E)); + a.add(ci(K)); + a.add(@as(f32, @floatCast(cfg.out_mult))); + a.add(@as(f32, @floatCast(cfg.route_scale))); + a.add(m.b.pick); + a.add(m.b.wts); + const t = std.math.ceilPowerOfTwo(usize, @max(E, 32)) catch unreachable; + try cuda.launch.launch(m.f_topk, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = u(t), .y = 1, .z = 1 } }, rs, &a); + } + try m.proj(s, L.pre, m.b.x, m.b.lat, false, n); + if (m.comm) |c| { + const half = L.pre.n; // this rank's latent outputs + try c.allGather(m.b.lat, m.b.latg, n * half, .f16, s.handle); + try m.normParts(s, m.b.latg, true, L.pre_norm, m.b.latn, n, cfg.latent, cfg.eps, half); + } else try m.norm(s, m.b.lat, true, L.pre_norm, m.b.latn, n, cfg.latent, cfg.eps); + // routed experts (shared operator): group, rotate, gate / up, SwiGLU (fp32), down; per-slot outputs in sc.y + const e = L.experts; + const p = n * K; + try m.k3.routed(s, e, m.b.latn, cfg.latent, m.b.pick, n, m.b.sc); + { + const y = try gather(m, s, m.b.sc.y, p * e.dims); // each rank's partial over its half of every expert's width + var a: cuda.Args = .{}; + a.add(y[0]); + a.add(y[1]); + a.add(m.b.wts); + a.add(L.expert_norm); + a.add(@as(f32, @floatCast(cfg.post_eps))); + a.add(m.b.acc); + a.add(ci(cfg.latent)); + a.add(ci(K)); + a.add(ci(m.w.rank * L.post.k)); // this rank's post_expert_proj inputs + a.add(ci(L.post.k)); + try m.rowLaunch(m.f_esum, m.f_esum_c, cfg.latent, n, s, &a); + } + try m.proj(s, L.post, m.b.acc, m.b.part, true, n); +} diff --git a/zig/src/families/muse_spark/pack.zig b/zig/src/families/muse_spark/pack.zig new file mode 100644 index 00000000000..8bc96c414c3 --- /dev/null +++ b/zig/src/families/muse_spark/pack.zig @@ -0,0 +1,202 @@ +//! EXL3 pack helpers for a rank's load: a device arena, trellis reads, TP cuts, the strips layout and fp32 reads. + +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const config = @import("config.zig"); +const exl3 = @import("exl3.zig"); +const fmt = core.exl3_format; + +/// Device memory in 64 MiB blocks handed out first-fit (256-byte aligned); a block or more gets its own buffer. +pub const Arena = struct { + d: *const cuda.Driver, + gpa: std.mem.Allocator, + blocks: std.ArrayList(cuda.DeviceBuffer) = .empty, + own: std.ArrayList(cuda.DeviceBuffer) = .empty, // requests of a block or more, each its own buffer + fill: std.ArrayList(usize) = .empty, // bytes handed out of each block + first_open: usize = 0, // the first block with 4 KiB or more left + total: usize = 0, + pub const block_bytes: usize = 64 << 20; + + /// Device bytes the arena holds (blocks and own buffers), against `total` handed out. + pub fn reserved(a: *const Arena) usize { + var r: usize = 0; + for (a.blocks.items) |b| r += b.len; + for (a.own.items) |b| r += b.len; + return r; + } + + pub fn alloc(a: *Arena, bytes: usize) !u64 { + const n = std.mem.alignForward(usize, @max(bytes, 1), 256); + if (n >= block_bytes) { + try a.own.ensureUnusedCapacity(a.gpa, 1); + const buf = try cuda.DeviceBuffer.alloc(a.d, n); + a.own.appendAssumeCapacity(buf); + a.total += n; + return buf.ptr; + } + var i = a.first_open; + while (i < a.blocks.items.len) : (i += 1) { + if (a.fill.items[i] + n <= a.blocks.items[i].len) break; + } + if (i == a.blocks.items.len) { + try a.fill.ensureUnusedCapacity(a.gpa, 1); + try a.blocks.append(a.gpa, try cuda.DeviceBuffer.alloc(a.d, block_bytes)); + a.fill.appendAssumeCapacity(0); + } + const at = a.blocks.items[i].ptr + a.fill.items[i]; + a.fill.items[i] += n; + a.total += n; + while (a.first_open < a.blocks.items.len and a.blocks.items[a.first_open].len - a.fill.items[a.first_open] < 4096) a.first_open += 1; + return at; + } + pub fn upload(a: *Arena, bytes: []const u8) !u64 { + const at = try a.alloc(bytes.len); + try check(a.d, a.d.api.cuMemcpyHtoD_v2(at, bytes.ptr, bytes.len)); + return at; + } + pub fn zeros(a: *Arena, bytes: usize) !u64 { + const at = try a.alloc(bytes); + try check(a.d, a.d.api.cuMemsetD8_v2(at, 0, std.mem.alignForward(usize, @max(bytes, 1), 256))); + return at; + } + pub fn deinit(a: *Arena) void { + for (a.blocks.items) |*b| b.free(); + a.blocks.deinit(a.gpa); + for (a.own.items) |*b| b.free(); + a.own.deinit(a.gpa); + a.fill.deinit(a.gpa); + } +}; + +fn check(d: *const cuda.Driver, r: anytype) !void { + try d.check(r, "muse_spark load"); +} + +/// An EXL3 matrix on the host: trellis int16 [tk, tn, 8 * k2], suh fp16 [K], svh fp16 [N]. +pub const Mat = struct { + trellis: []i16, + suh: []f16, + svh: []f16, + tk: usize, + tn: usize, + k2: u32, + + pub fn deinit(m: Mat, a: std.mem.Allocator) void { + a.free(m.trellis); + a.free(m.suh); + a.free(m.svh); + } + pub fn k(m: Mat) usize { + return m.tk * 16; + } + pub fn n(m: Mat) usize { + return m.tn * 16; + } +}; + +pub fn readMat(a: std.mem.Allocator, ck: *core.Checkpoint, prefix: []const u8) !Mat { + var nb: [256]u8 = undefined; + if ((ck.get(try std.fmt.bufPrint(&nb, "{s}.mul1", .{prefix})) catch null) == null) return error.NotMul1; + const t = try ck.get(try std.fmt.bufPrint(&nb, "{s}.trellis", .{prefix})); + if (t.dtype != .i16 or t.rank != 3 or t.shape[2] % 8 != 0) return error.BadTrellis; + const tr = try a.alloc(i16, t.numel()); + errdefer a.free(tr); + @memcpy(std.mem.sliceAsBytes(tr), t.bytes); + const suh = try scales(a, ck, prefix, "suh", t.shape[0] * 16); + errdefer a.free(suh); + return .{ .trellis = tr, .suh = suh, .svh = try scales(a, ck, prefix, "svh", t.shape[1] * 16), .tk = t.shape[0], .tn = t.shape[1], .k2 = @intCast(t.shape[2] / 8) }; +} + +fn scales(a: std.mem.Allocator, ck: *core.Checkpoint, prefix: []const u8, part: []const u8, size: usize) ![]f16 { + var nb: [256]u8 = undefined; + const t = try ck.get(try std.fmt.bufPrint(&nb, "{s}.{s}", .{ prefix, part })); + const out = try a.alloc(f16, size); + errdefer a.free(out); + if (t.dtype == .f16 and t.numel() == size) { + @memcpy(std.mem.sliceAsBytes(out), t.bytes); + } else if (t.dtype == .i16 and t.numel() * 16 == size) { + const w = try a.alloc(i16, t.numel()); + defer a.free(w); + @memcpy(std.mem.sliceAsBytes(w), t.bytes); + fmt.unpackSigns(w, out); + } else return error.BadScales; + return out; +} + +/// weights.py cut(): outputs [lo, hi) (trellis columns, svh) or inputs [lo, hi) (trellis rows, suh); `m` is freed. +pub fn cut(a: std.mem.Allocator, m: Mat, c: config.Cut) !Mat { + if (c.axis == .whole) return m; + defer m.deinit(a); + const w = 8 * @as(usize, m.k2); + if (c.lo % 128 != 0 or c.hi % 128 != 0) return error.CutNotOnBlock; + if (c.axis == .n) { + const tn = (c.hi - c.lo) / 16; + const tr = try a.alloc(i16, m.tk * tn * w); + for (0..m.tk) |kt| @memcpy(tr[kt * tn * w ..][0 .. tn * w], m.trellis[(kt * m.tn + c.lo / 16) * w ..][0 .. tn * w]); + return .{ .trellis = tr, .suh = try a.dupe(f16, m.suh), .svh = try a.dupe(f16, m.svh[c.lo..c.hi]), .tk = m.tk, .tn = tn, .k2 = m.k2 }; + } + const tk = (c.hi - c.lo) / 16; + return .{ .trellis = try a.dupe(i16, m.trellis[(c.lo / 16) * m.tn * w ..][0 .. tk * m.tn * w]), .suh = try a.dupe(f16, m.suh[c.lo..c.hi]), .svh = try a.dupe(f16, m.svh), .tk = tk, .tn = m.tn, .k2 = m.k2 }; +} + +/// linear.strips: trellis int32 words [K/16, N/16, W] -> [N/128, K/16, 8, W]. +pub fn strips(a: std.mem.Allocator, m: Mat) ![]u32 { + const w32 = 4 * @as(usize, m.k2); + const words: []align(2) const u32 = std.mem.bytesAsSlice(u32, std.mem.sliceAsBytes(m.trellis)); + const out = try a.alloc(u32, words.len); + for (0..m.tk) |kt| for (0..m.tn / 8) |nb8| for (0..8) |j| { + @memcpy(out[((nb8 * m.tk + kt) * 8 + j) * w32 ..][0..w32], words[((kt * m.tn) + nb8 * 8 + j) * w32 ..][0..w32]); + }; + return out; +} + +/// Exl3Linear.from_tensors (strips) on the device, with its zeroed split counters; the host matrix `m` is freed. +pub fn linear(a: std.mem.Allocator, ar: *Arena, m: Mat) !exl3.Linear { + defer m.deinit(a); + if (m.k() % 128 != 0 or m.n() % 128 != 0) return error.NotBlocked; + const st = try strips(a, m); + defer a.free(st); + return .{ + .words = try ar.upload(std.mem.sliceAsBytes(st)), + .suh = try ar.upload(std.mem.sliceAsBytes(m.suh)), + .svh = try ar.upload(std.mem.sliceAsBytes(m.svh)), + .counters = try ar.zeros(8 * (m.n() / 128) * 4), + .k = m.k(), + .n = m.n(), + .k2 = m.k2, + .split = exl3.plan(m.k(), m.n()), + }; +} + +/// torch's float -> bfloat16 (round to nearest even; NaN kept quiet). +pub fn bf16Round(x: f32) f32 { + const u: u32 = @bitCast(x); + if (std.math.isNan(x)) return @bitCast((u | 0x0040_0000) & 0xFFFF_0000); + const r = u + 0x7FFF + ((u >> 16) & 1); + return @bitCast(r & 0xFFFF_0000); +} + +/// A tensor as fp32 (`.float()`): bf16, fp16 or fp32 storage. +pub fn asF32(a: std.mem.Allocator, t: core.safetensors.Tensor) ![]f32 { + const n = t.numel(); + const out = try a.alloc(f32, n); + switch (t.dtype) { + .f32 => @memcpy(std.mem.sliceAsBytes(out), t.bytes), + .bf16 => for (out, 0..) |*o, i| { + o.* = @bitCast(@as(u32, std.mem.readInt(u16, t.bytes[2 * i ..][0..2], .little)) << 16); + }, + .f16 => for (out, 0..) |*o, i| { + o.* = @floatCast(@as(f16, @bitCast(std.mem.readInt(u16, t.bytes[2 * i ..][0..2], .little)))); + }, + else => return error.BadDType, + } + return out; +} + +test "bf16 rounding is torch's: nearest even, NaN kept quiet" { + try std.testing.expectEqual(@as(f32, 1.0), bf16Round(1.0)); + try std.testing.expectEqual(@as(u32, 0x3F80_0000), @as(u32, @bitCast(bf16Round(@bitCast(@as(u32, 0x3F80_8000)))))); + try std.testing.expectEqual(@as(u32, 0x3F82_0000), @as(u32, @bitCast(bf16Round(@bitCast(@as(u32, 0x3F81_8000)))))); + try std.testing.expect(std.math.isNan(bf16Round(std.math.nan(f32)))); +} diff --git a/zig/src/families/muse_spark/pair.zig b/zig/src/families/muse_spark/pair.zig new file mode 100644 index 00000000000..bf0f8526292 --- /dev/null +++ b/zig/src/families/muse_spark/pair.zig @@ -0,0 +1,89 @@ +//! A test-only TP=2 collective for both ranks on one GPU (MUSE_PAIR=1): device-copy gathers between two threads. + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const C = tp.Collective; +const K = tp.collective; + +pub const Pair = struct { + d: *const cuda.Driver, + arrived: std.atomic.Value(u32) = .init(0), + gen: std.atomic.Value(u32) = .init(0), + aborted: std.atomic.Value(bool) = .init(false), + dst: [2]u64 = .{ 0, 0 }, + + fn barrier(p: *Pair) K.Error!void { + const g = p.gen.load(.acquire); + if (p.arrived.fetchAdd(1, .acq_rel) == 1) { + p.arrived.store(0, .release); + _ = p.gen.fetchAdd(1, .release); + return; + } + while (p.gen.load(.acquire) == g) { + if (p.aborted.load(.acquire)) return error.Aborted; + std.atomic.spinLoopHint(); + } + } + + pub fn abort(p: *Pair) void { + p.aborted.store(true, .release); + } +}; + +pub const Rank = struct { + pair: *Pair, + rank: u32, + + fn of(ptr: *anyopaque) *Rank { + return @ptrCast(@alignCast(ptr)); + } + + pub fn collective(r: *Rank) C { + return .{ .ptr = r, .vtable = &vtable }; + } + + const vtable: C.VTable = .{ .kind = .host, .rank = rankFn, .world = worldFn, .all_reduce = allReduce, .all_gather = allGather, .exchange = exchange, .send = sendFn, .recv = recvFn, .barrier = barrierFn, .check = check, .abort = abortFn }; + + fn rankFn(ptr: *anyopaque) u32 { + return of(ptr).rank; + } + fn worldFn(_: *anyopaque) u32 { + return 2; + } + /// recv[2 * count] <- both ranks' send[count], each rank copying its slice into both after its stream drains. + fn allGather(ptr: *anyopaque, send: K.DevicePtr, recv: K.DevicePtr, count: usize, t: tp.DType, stream: K.Stream) K.Error!void { + const r = of(ptr); + const p = r.pair; + const d = p.d; + d.check(d.api.cuStreamSynchronize(stream), "pair sync") catch return error.BackendFailed; + p.dst[r.rank] = recv; + try p.barrier(); + const bytes = count * t.size(); + // on this rank's stream, finished before the barrier (a plain DtoD copy does not wait for completion) + for (p.dst) |dst| d.check(d.api.cuMemcpyDtoDAsync_v2(dst + r.rank * bytes, send, bytes, stream), "pair copy") catch return error.BackendFailed; + d.check(d.api.cuStreamSynchronize(stream), "pair sync") catch return error.BackendFailed; + try p.barrier(); + } + fn allReduce(_: *anyopaque, _: K.DevicePtr, _: K.DevicePtr, _: usize, _: tp.DType, _: tp.Op, _: K.Stream) K.Error!void { + return error.Unsupported; + } + fn exchange(_: *anyopaque, _: K.DevicePtr, _: K.DevicePtr, _: usize, _: tp.DType, _: u32, _: K.Stream) K.Error!void { + return error.Unsupported; + } + fn sendFn(_: *anyopaque, _: K.DevicePtr, _: usize, _: tp.DType, _: u32, _: K.Stream) K.Error!void { + return error.Unsupported; + } + fn recvFn(_: *anyopaque, _: K.DevicePtr, _: usize, _: tp.DType, _: u32, _: K.Stream) K.Error!void { + return error.Unsupported; + } + fn barrierFn(ptr: *anyopaque) K.Error!void { + return of(ptr).pair.barrier(); + } + fn check(ptr: *anyopaque) K.Error!void { + if (of(ptr).pair.aborted.load(.acquire)) return error.Aborted; + } + fn abortFn(ptr: *anyopaque) void { + of(ptr).pair.abort(); + } +}; diff --git a/zig/src/families/muse_spark/prompt.zig b/zig/src/families/muse_spark/prompt.zig new file mode 100644 index 00000000000..334596f1bcb --- /dev/null +++ b/zig/src/families/muse_spark/prompt.zig @@ -0,0 +1,307 @@ +//! Muse Spark's prompt path: a slot's prompt chunk as wide windows, with the decode rows' bits. + +const std = @import("std"); +const cuda = @import("cuda"); +const load_ = @import("load.zig"); +const fwd = @import("forward.zig"); +const exl3 = @import("exl3.zig"); +const Stream = cuda.Stream; +const Model = fwd.Model; + +pub const CAP = 1024; // rows a chunk +pub const EWIN = 512; // rows an experts window: each expert's trellis read once a window instead of once per 128 rows +pub const MIN = 33; // the shortest prompt (from the pass's start) on this path; shorter ones run as decode windows +const W = fwd.DECODE_ROWS; // the dense and attention windows + +fn u(x: usize) u32 { + return @intCast(x); +} +fn ci(x: usize) c_int { + return @intCast(x); +} + +/// Bytes of the experts window's scratch: (xg + xu + xd, with y over them; z, also the gathers' landing). +pub fn expertBytes(e: exl3.Experts, ewin: usize, slots: usize, world: usize, chunk_d: usize) ![2]usize { + const sz = try exl3.sizes(e, ewin, slots); + const front = @max(2 * sz.xg + sz.xd, sz.y); + const land = world * @max(ewin * slots * e.dims, chunk_d) * 4; + return .{ front, @max(sz.z, if (world > 1) land else 0) }; +} + +pub const Prompt = struct { + m: *Model, + gpa: std.mem.Allocator, + cap: usize, + ewin: usize, + ar: load_.Arena, + ids: u64, // i64 [cap] + pos: u64, // i32 [cap] + slot: u64, + res: u64, // f32 [cap, D] + x: u64, // f16 [cap, D] + xf: u64, // f32 [cap, D] + part: u64, // f32 [cap, D] + big: u64, // f32: the experts' split partials (z), else an all-gather's landing (never live together) + logits: u64, // f32 [cap, E] + pick: u64, // i32 [cap, K] + wts: u64, // f32 [cap, K] + lat: u64, // f16 [cap, latent / world] + latg: u64, // f16 [world, cap, latent / world] + latn: u64, // f16 [cap, latent] + acc: u64, // f16 [cap, post inputs] + sc: exl3.Scratch, // the grouped kernel's for ewin rows; y over xg / xu / xd, z = big + taps: u64, // drafter: the chunk's taps, f16 [cap, taps, D] + erow: u64, // bf16 [cap, D] embedding rows, read through iota (i64 [cap]) + iota: u64, + h_erow: []u16, + h_ids: []i64, + h_pos: []i32, + h_slot: []i32, + + /// Chunks of up to `cap` rows, experts in windows of up to `ewin_` rows. + pub fn init(m: *Model, gpa: std.mem.Allocator, cap: usize, ewin_: usize, s: Stream) !*Prompt { + const w = m.w; + const cfg = w.cfg; + if (cap < 1 or ewin_ < 1) return error.PromptRows; + const ewin = @min(ewin_, cap); + if (ewin * cfg.top_k * 4 > 96 * 1024) return error.ExpertWindow; // the group kernel's picks in shared memory + const pr = try gpa.create(Prompt); + errdefer gpa.destroy(pr); + pr.* = undefined; + pr.m = m; + pr.gpa = gpa; + pr.cap = cap; + pr.ewin = ewin; + pr.ar = .{ .d = m.d, .gpa = gpa }; + errdefer pr.ar.deinit(); + const ar = &pr.ar; + const R = cap; + const D = cfg.hidden; + const L0 = w.layers[0]; + const e0 = L0.experts; + pr.ids = try ar.zeros(R * 8); + pr.pos = try ar.zeros(R * 4); + pr.slot = try ar.zeros(R * 4); + pr.res = try ar.zeros(R * D * 4); + pr.x = try ar.zeros(R * D * 2); + pr.xf = try ar.zeros(R * D * 4); + pr.part = try ar.zeros(R * D * 4); + pr.logits = try ar.zeros(R * cfg.experts * 4); + pr.pick = try ar.zeros(R * cfg.top_k * 4); + pr.wts = try ar.zeros(R * cfg.top_k * 4); + pr.lat = try ar.zeros(R * L0.pre.n * 2); + pr.latg = try ar.zeros(R * cfg.latent * 2); + pr.latn = try ar.zeros(R * cfg.latent * 2); + pr.acc = try ar.zeros(R * L0.post.k * 2); + const eb = try expertBytes(e0, ewin, cfg.top_k, w.world, R * D); + const sz = try exl3.sizes(e0, ewin, cfg.top_k); + const front = try ar.zeros(eb[0]); + pr.big = try ar.zeros(eb[1]); + pr.sc = .{ .xg = front, .xu = front + sz.xg, .xd = front + 2 * sz.xg, .z = pr.big, .y = front, .ids = try ar.zeros(sz.ids), .count = try ar.zeros(4), .members = try ar.alloc(sz.members), .rows = ewin, .slots = cfg.top_k }; + try m.d.check(m.d.api.cuMemsetD32_v2(pr.sc.members, 0xFFFF_FFFF, sz.members / 4), "members -1"); + pr.taps = if (m.dr) |dr| try ar.zeros(R * dr.taps.len * D * 2) else 0; + pr.erow = try ar.zeros(R * D * 2); + { + const io_ = try gpa.alloc(i64, R); + defer gpa.free(io_); + for (io_, 0..) |*x, j| x.* = @intCast(j); + pr.iota = try ar.upload(std.mem.sliceAsBytes(io_)); + } + pr.h_erow = try gpa.alloc(u16, R * D); + errdefer gpa.free(pr.h_erow); + pr.h_ids = try gpa.alloc(i64, R); + errdefer gpa.free(pr.h_ids); + pr.h_pos = try gpa.alloc(i32, R); + errdefer gpa.free(pr.h_pos); + pr.h_slot = try gpa.alloc(i32, R); + try s.synchronize(); + return pr; + } + + pub fn deinit(pr: *Prompt) void { + pr.gpa.free(pr.h_erow); + pr.gpa.free(pr.h_ids); + pr.gpa.free(pr.h_pos); + pr.gpa.free(pr.h_slot); + pr.ar.deinit(); + pr.gpa.destroy(pr); + } + + pub fn bytes(pr: *const Prompt) usize { + return pr.ar.total; + } + + /// The ranks' fp32 partials [count] gathered into big (rank-major); (rank 0's, rank 1's or 0). + fn gather(pr: *Prompt, s: Stream, part: u64, count: usize) ![2]u64 { + const c = pr.m.comm orelse return .{ part, 0 }; + try c.allGather(part, pr.big, count, .f32, s.handle); + return .{ pr.big, pr.big + count * 4 }; + } + + /// An EXL3 projection of the chunk's n rows in 128-row windows: x [n, K] fp16 -> out [n, N]. + fn proj(pr: *Prompt, s: Stream, l: exl3.Linear, x: u64, out: u64, out_f32: bool, n: usize) !void { + var w0: usize = 0; + while (w0 < n) : (w0 += W) { + const k = @min(W, n - w0); + try pr.m.proj(s, l, x + w0 * l.k * 2, out + w0 * l.n * @as(usize, if (out_f32) 4 else 2), out_f32, k); + } + } + + /// Layer i's attention half over the chunk at [p0, p0 + n): 128-row windows of q / k / v / g and o_proj. + fn attention(pr: *Prompt, s: Stream, L: load_.Layer, i: usize, p0: usize, n: usize) !void { + const m = pr.m; + const D = m.w.cfg.hidden; + var w0: usize = 0; + while (w0 < n) : (w0 += W) { + const k = @min(W, n - w0); + const x = pr.x + w0 * D * 2; + try m.qkvg(s, L, x, m.b.q, m.b.k, m.b.v, m.b.g, k); + var chunks: usize = 1; + for (0..k) |j| chunks = @max(chunks, fwd.rowChunks(m.context, p0 + w0 + j)); + try m.attentionIo(s, i, k, chunks, .{ .q = m.b.q, .k = m.b.k, .v = m.b.v, .g = m.b.g, .qo = m.b.qo, .att = m.b.att, .pos = pr.pos + w0 * 4, .slot = pr.slot + w0 * 4 }); + try m.proj(s, L.o, m.b.att, pr.part + w0 * D * 4, true, k); + } + } + + /// MuseSparkMoE over the chunk: router and latent for every row, experts in windows of ewin rows, then post. + fn moe(pr: *Prompt, s: Stream, L: load_.Layer, n: usize) !void { + const m = pr.m; + const cfg = m.w.cfg; + const E = cfg.experts; + const K = cfg.top_k; + { + var a: cuda.Args = .{}; + a.add(pr.xf); + a.add(L.router); + a.add(@as(c_int, @intFromBool(L.router_bf16))); + a.add(pr.logits); + a.add(ci(cfg.hidden)); + a.add(ci(E)); + const rw: usize = 2; + try cuda.launch.launch(m.f_router, .{ .grid = .{ .x = u((E + rw - 1) / rw), .y = u(n), .z = 1 }, .block = .{ .x = u(32 * rw), .y = 1, .z = 1 } }, s, &a); + } + { + var a: cuda.Args = .{}; + a.add(pr.logits); + a.add(L.bias); + a.add(ci(E)); + a.add(ci(K)); + a.add(@as(f32, @floatCast(cfg.out_mult))); + a.add(@as(f32, @floatCast(cfg.route_scale))); + a.add(pr.pick); + a.add(pr.wts); + const tn = std.math.ceilPowerOfTwo(usize, @max(E, 32)) catch unreachable; + try cuda.launch.launch(m.f_topk, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = u(tn), .y = 1, .z = 1 } }, s, &a); + } + try pr.proj(s, L.pre, pr.x, pr.lat, false, n); + if (m.comm) |c| { + const half = L.pre.n; + try c.allGather(pr.lat, pr.latg, n * half, .f16, s.handle); + try m.normParts(s, pr.latg, true, L.pre_norm, pr.latn, n, cfg.latent, cfg.eps, half); + } else try m.norm(s, pr.lat, true, L.pre_norm, pr.latn, n, cfg.latent, cfg.eps); + const e = L.experts; + const sc = pr.sc; + var w0: usize = 0; + while (w0 < n) : (w0 += pr.ewin) { + const r = @min(pr.ewin, n - w0); + const p = r * K; + const pick = pr.pick + w0 * K * 4; + try m.k3.routedWide(s, e, pr.latn + w0 * cfg.latent * 2, cfg.latent, pick, r, sc); // y over xg / xu / xd + const y = try pr.gather(s, sc.y, p * e.dims); // z is dead too: the landing reuses it + var a: cuda.Args = .{}; + a.add(y[0]); + a.add(y[1]); + a.add(pr.wts + w0 * K * 4); + a.add(L.expert_norm); + a.add(@as(f32, @floatCast(cfg.post_eps))); + a.add(pr.acc + w0 * L.post.k * 2); + a.add(ci(cfg.latent)); + a.add(ci(K)); + a.add(ci(m.w.rank * L.post.k)); + a.add(ci(L.post.k)); + try m.rowLaunch(m.f_esum, m.f_esum_c, cfg.latent, r, s, &a); + } + try pr.proj(s, L.post, pr.acc, pr.part, true, n); + } + + /// A prompt chunk at [p0, p0 + n) of `slot`: every cache written, the last row's logits in the decode buffers. + pub fn chunk(pr: *Prompt, s: Stream, slot: u32, p0: usize, tokens: []const i64) !void { + const m = pr.m; + const cfg = m.w.cfg; + const D = cfg.hidden; + const n = tokens.len; + if (n == 0 or n > pr.cap) return error.ChunkTooWide; + if (p0 + n > m.context) return error.PastContext; + if (slot >= m.slots) return error.BadSlot; + for (tokens, 0..) |t, j| { + if (t < 0 or t >= m.w.full.vocab) return error.BadToken; + pr.h_ids[j] = t; + pr.h_pos[j] = @intCast(p0 + j); + pr.h_slot[j] = @intCast(slot); + } + try m.d.check(m.d.api.cuMemcpyHtoD_v2(pr.ids, @ptrCast(pr.h_ids.ptr), n * 8), "ids"); + try m.d.check(m.d.api.cuMemcpyHtoD_v2(pr.pos, @ptrCast(pr.h_pos.ptr), n * 4), "pos"); + try m.d.check(m.d.api.cuMemcpyHtoD_v2(pr.slot, @ptrCast(pr.h_slot.ptr), n * 4), "slot"); + try m.embedRows(pr.h_ids[0..n], pr.h_erow, pr.erow); + { + var a: cuda.Args = .{}; + const es = m.embedSrc(pr.erow, pr.iota); + a.add(es[0]); + a.add(es[1]); + a.add(pr.res); + a.add(ci(D)); + a.add(@as(f32, @floatCast(cfg.eps))); + try cuda.launch.launch(m.f_embed, .{ .grid = .{ .x = u(n), .y = 1, .z = 1 }, .block = .{ .x = fwd.NORM_THREADS, .y = 1, .z = 1 } }, s, &a); + } + try m.norm(s, pr.res, false, m.w.layers[0].in_norm, pr.x, n, D, cfg.eps); + for (m.w.layers, 0..) |L, i| { + try pr.attention(s, L, i, p0, n); + try m.gateNormAt(s, pr.res, try pr.gather(s, pr.part, n * D), 0, L.attn_ab, L.ffn_norm, pr.x, pr.xf, n); + try pr.moe(s, L, n); + const after = if (i + 1 < m.w.layers.len) m.w.layers[i + 1].in_norm else m.w.norm; + try m.gateNormAt(s, pr.res, try pr.gather(s, pr.part, n * D), L.post_ffn, L.mlp_ab, after, pr.x, 0, n); + if (m.dr) |dr| try dr.tapInto(s, i, pr.res, n, pr.taps); + } + if (m.dr) |dr| { + const row = dr.taps.len * D * 2; + var w0: usize = 0; + while (w0 < n) : (w0 += W) { + const k = @min(W, n - w0); + try dr.updateAt(s, pr.taps + w0 * row, pr.pos + w0 * 4, pr.slot + w0 * 4, k); + } + } + // the head on the last row: the decode GEMV, softcap and gather into the decode buffers + try m.proj(s, m.w.head, pr.x + (n - 1) * D * 2, m.b.head, true, 1); + const cfgf = m.w.full; + var a: cuda.Args = .{}; + a.add(m.b.head); + a.add(@as(i64, @intCast(m.w.head.n))); + a.add(@as(f32, @floatCast(cfgf.out_mult))); + a.add(@as(f32, @floatCast(cfgf.softcap))); + try cuda.launch.launch(m.f_softcap, .{ .grid = .{ .x = u(@min((m.w.head.n + 255) / 256, 4096)), .y = 1, .z = 1 }, .block = .{ .x = 256, .y = 1, .z = 1 } }, s, &a); + if (m.comm) |c| try c.allGather(m.b.head, m.b.recv, m.w.head_stride, .f32, s.handle); + } +}; + +/// The chunks of a prompt of `len` tokens: `cap` rows each, the rest last. +pub fn planChunks(len: usize, cap: usize, out: *std.ArrayList(usize), gpa: std.mem.Allocator) !void { + out.clearRetainingCapacity(); + var at: usize = 0; + while (at < len) { + const n = @min(cap, len - at); + try out.append(gpa, n); + at += n; + } +} + +test "prompt chunks" { + const g = std.testing.allocator; + var c: std.ArrayList(usize) = .empty; + defer c.deinit(g); + try planChunks(40, 1024, &c, g); + try std.testing.expectEqualSlices(usize, &.{40}, c.items); + try planChunks(2500, 1024, &c, g); + try std.testing.expectEqualSlices(usize, &.{ 1024, 1024, 452 }, c.items); + try planChunks(2048, 1024, &c, g); + try std.testing.expectEqualSlices(usize, &.{ 1024, 1024 }, c.items); +} diff --git a/zig/src/families/muse_spark/prompt_main.zig b/zig/src/families/muse_spark/prompt_main.zig new file mode 100644 index 00000000000..7596c03fac6 --- /dev/null +++ b/zig/src/families/muse_spark/prompt_main.zig @@ -0,0 +1,121 @@ +//! tf-muse prompt: the prompt path's chunk plans against decode rows, byte for byte (docs/recipes/muse-spark.md). + +const std = @import("std"); +const cuda = @import("cuda"); +const tp = @import("tp"); +const muse = @import("muse_spark"); +const Model = muse.forward.Model; +const Row = muse.forward.Row; + +/// A developer knob's whole number (`std.c.getenv("MUSE_...")` at the call, so the name stays a literal). +fn env(raw: ?[*:0]const u8, default: usize) usize { + const v = raw orelse return default; + return std.fmt.parseInt(usize, std.mem.span(v), 10) catch default; +} + +fn argmax(xs: []const f32) i32 { + var best: usize = 0; + for (xs, 0..) |x, i| if (x > xs[best]) { + best = i; + }; + return @intCast(best); +} + +/// Greedy decode rows on `slot` from position `pos` after the token `first`: n tokens into out. +fn greedy(model: *Model, s: cuda.Stream, slot: u32, pos0: usize, first: i32, out: []i32, buf_all: []f32) !void { + const buf = buf_all[0..model.w.full.vocab]; + var tok = first; + for (out, 0..) |*o, j| { + o.* = tok; + if (j + 1 == out.len) break; + try model.forward(s, &.{.{ .slot = slot, .pos = @intCast(pos0 + j), .token = tok }}, buf, null); + tok = argmax(buf); + } +} + +pub fn run(gpa: std.mem.Allocator, ar: std.mem.Allocator, io: std.Io, driver: *const cuda.Driver, args: []const [:0]const u8, rank: usize, world: usize, comm: ?tp.Collective) !void { + var s = try cuda.Stream.init(driver, false); + defer s.deinit(); + const context = env(std.c.getenv("MUSE_CONTEXT"), 8192); + const G = env(std.c.getenv("MUSE_GREEDY"), 32); + const max_layers: ?usize = if (env(std.c.getenv("MUSE_LAYERS"), 0) > 0) env(std.c.getenv("MUSE_LAYERS"), 0) else null; + var w = try muse.load.load(gpa, io, driver, args[2], rank, world, .{ .max_layers = max_layers, .log = rank == 0 }); + defer w.deinit(); + var k3 = try muse.exl3.Kernels.load(driver); + defer k3.deinit(); + var model = try Model.init(gpa, driver, &w, &k3, comm, context, muse.forward.DECODE_ROWS, 2, s); + defer model.deinit(); + const pr = try muse.prompt.Prompt.init(&model, gpa, muse.prompt.CAP, muse.prompt.EWIN, s); + defer pr.deinit(); + const V = w.full.vocab; + if (rank == 0) std.debug.print("[prompt] {d} layers, chunks of {d} rows, experts window {d}, scratch {d:.2} GiB\n", .{ w.layers.len, pr.cap, pr.ewin, @as(f64, @floatFromInt(pr.bytes())) / (1 << 30) }); + const plans_text = if (std.c.getenv("MUSE_PROMPT_PLANS")) |v| std.mem.span(v) else "r;100,r;1,r;17,256,1000,r;513,700,r"; + const names_text = try std.Io.Dir.cwd().readFileAlloc(io, try std.fs.path.join(ar, &.{ args[3], "names.txt" }), ar, .limited(1 << 20)); + const buf = try gpa.alloc(f32, muse.forward.DECODE_ROWS * V); + defer gpa.free(buf); + const ref_logits = try gpa.alloc(f32, V); + defer gpa.free(ref_logits); + const got = try gpa.alloc(f32, V); + defer gpa.free(got); + const ref_g = try gpa.alloc(i32, G); + defer gpa.free(ref_g); + const got_g = try gpa.alloc(i32, G); + defer gpa.free(got_g); + var fails: usize = 0; + var nit = std.mem.tokenizeAny(u8, names_text, " \r\n\t"); + while (nit.next()) |name| { + const raw = try std.Io.Dir.cwd().readFileAlloc(io, try std.fmt.allocPrint(ar, "{s}/{s}.ids", .{ args[3], name }), ar, .limited(1 << 30)); + const T = raw.len / 4; + if (T + G > context) return error.TextTooLong; + const ids = try ar.alloc(i64, T); + for (ids, 0..) |*x, j| x.* = std.mem.readInt(i32, raw[j * 4 ..][0..4], .little); + // the reference: decode windows of 128 rows on slot 0 + var at: usize = 0; + var rows: [muse.forward.DECODE_ROWS]Row = undefined; + while (at < T) { + const n = @min(muse.forward.DECODE_ROWS, T - at); + for (0..n) |j| rows[j] = .{ .slot = 0, .pos = @intCast(at + j), .token = ids[at + j] }; + try model.forward(s, rows[0..n], buf[0 .. n * V], null); + if (at + n == T) @memcpy(ref_logits, buf[(n - 1) * V ..][0..V]); + at += n; + } + try greedy(&model, s, 0, T, argmax(ref_logits), ref_g, buf); + var pit = std.mem.tokenizeScalar(u8, plans_text, ';'); + while (pit.next()) |plan| { + var sizes: std.ArrayList(usize) = .empty; + defer sizes.deinit(gpa); + var cit = std.mem.tokenizeScalar(u8, plan, ','); + var used: usize = 0; + while (cit.next()) |c| { + const n = if (std.mem.eql(u8, c, "r")) T - used else try std.fmt.parseInt(usize, c, 10); + if (n == 0 or used + n > T) break; + var left = n; + while (left > 0) { // a size over the chunk cap splits into cap-row chunks + const k = @min(left, pr.cap); + try sizes.append(gpa, k); + left -= k; + } + used += n; + } + if (used != T) continue; // a plan longer than the text + at = 0; + for (sizes.items) |n| { + try pr.chunk(s, 1, at, ids[at .. at + n]); + at += n; + } + try model.logitsTo(s, 1, got); + var maxd: f32 = 0; + var equal = true; + for (ref_logits, got) |a, b| { + if (@as(u32, @bitCast(a)) != @as(u32, @bitCast(b))) equal = false; + maxd = @max(maxd, @abs(a - b)); + } + try greedy(&model, s, 1, T, argmax(got), got_g, buf); + var same: usize = 0; + for (ref_g, got_g) |a, b| same += @intFromBool(a == b); + if (!equal or same != G) fails += 1; + if (rank == 0) std.debug.print("PROMPT {s} T={d} chunks {any}: logits {s} (max |diff| {e:.3}), argmax {d}/{d}, greedy {d}/{d}\n", .{ name, T, sizes.items, if (equal) "byte-equal" else "DIFFER", maxd, argmax(got), argmax(ref_logits), same, G }); + } + } + if (rank == 0) std.debug.print("PROMPT {s}: {d} plan(s) differ from decode rows\n", .{ if (fails == 0) "PASS" else "FAIL", fails }); +} diff --git a/zig/src/families/muse_spark/root.zig b/zig/src/families/muse_spark/root.zig new file mode 100644 index 00000000000..d67a326a56b --- /dev/null +++ b/zig/src/families/muse_spark/root.zig @@ -0,0 +1,31 @@ +//! Muse Spark Open (text) on the CUDA engine: an EXL3 pack's decode forward, gated against exllamav3's forward. + +pub const config = @import("config.zig"); +pub const load = @import("load.zig"); +pub const forward = @import("forward.zig"); +pub const engine = @import("engine.zig"); +pub const native = @import("native.zig"); +pub const dflash2 = @import("dflash2.zig"); +pub const prompt = @import("prompt.zig"); +pub const dflash2_config = @import("dflash2_config.zig"); +pub const kept = @import("kept.zig"); +pub const exl3 = @import("exl3.zig"); +pub const pack = @import("pack.zig"); +pub const Config = config.Config; + +test { + _ = config; + _ = load; + _ = forward; + _ = engine; + _ = native; + _ = dflash2; + _ = prompt; + _ = dflash2_config; + _ = kept; + _ = exl3; + _ = pack; + _ = @import("ops.zig"); + _ = @import("dflash2_load.zig"); + _ = @import("rounds.zig"); +} diff --git a/zig/src/families/muse_spark/rounds.zig b/zig/src/families/muse_spark/rounds.zig new file mode 100644 index 00000000000..c23a443f306 --- /dev/null +++ b/zig/src/families/muse_spark/rounds.zig @@ -0,0 +1,178 @@ +//! The lane backend's host side of a round (native.zig): verify rows, kept paths, draft entries and held drafts. +const std = @import("std"); +const lanes = @import("lanes"); +const fwd = @import("forward.zig"); +const be = lanes.backend; + +/// A stream's cache slot, the drafts the backend holds for it, and how far its prompt pass stands. +pub const Lane = struct { slot: u32, held: [16]u32 = undefined, nheld: u32 = 0, filled: u32 = 0 }; +pub const Map = std.AutoHashMapUnmanaged(*const lanes.Stream, Lane); + +/// Every window's rows in order: its pending token, then its held drafts or host tokens, each at its position - 1. +pub fn verifyRows(map: *Map, windows: []const be.Window, rows: []fwd.Row) !usize { + var n: usize = 0; + for (windows) |w| { + if (w.parents != null) return error.TreesNotBuilt; + const lane = map.getPtr(w.stream) orelse return error.UnknownStream; + if (n + w.rows() > rows.len) return error.WindowTooWide; + if (w.held > lane.nheld) return error.NoHeldDrafts; + lane.filled = 0; // decoding: no prompt mark stands + for (0..w.rows()) |r| { + const tok: u32 = if (r == 0) w.pending else if (w.held > 0) lane.held[r - 1] else w.tokens[r - 1]; + rows[n] = .{ .slot = lane.slot, .pos = @intCast(w.positions[r] - 1), .token = tok }; + n += 1; + } + } + return n; +} + +/// Whether every window's stream decodes greedily (the forward then returns ids, not logits). +pub fn allGreedy(windows: []const be.Window) bool { + for (windows) |w| if (w.stream.sampling) |sm| if (sm.temperature > 0) return false; + return true; +} + +/// The drafts a window's forward verified: the ones the backend held, else the host's. +pub fn verifiedDrafts(lane: *const Lane, w: be.Window, out: []u32) void { + if (w.held > 0) @memcpy(out, lane.held[0..w.held]) else @memcpy(out, w.tokens); +} + +/// Kept paths are chains from row 0: the backend builds no trees. +pub fn checkPaths(paths: []const []const u32) !void { + for (paths) |path| { + if (path.len == 0) return error.EmptyPath; + for (path, 0..) |r, i| if (r != i) return error.TreesNotBuilt; + } +} + +/// A token fed by value, or by its handle into the ring of drawn tokens. +pub fn fed(drawn: []const u32, feed: be.Feed) u32 { + return switch (feed) { + .handle => |h| drawn[h % drawn.len], + .value => |v| v, + }; +} + +/// One stream's place in a draft pass. +pub const Entry = struct { token: i64, pos0: u32, slot: u32, lane: *Lane, depth: u32 }; + +/// A request's entry (null: it wants none), its held drafts cleared either way; `block`: the drafter's, null for none. +pub fn draftEntry(map: *Map, r: be.DraftRequest, block: ?usize, drawn: []const u32) !?Entry { + const lane = map.getPtr(r.stream) orelse return error.UnknownStream; + lane.nheld = 0; + if (r.depth == 0) return null; + const b = block orelse return error.NoDraftHead; + const token = if (r.follow.len > 0) r.follow[r.follow.len - 1] else fed(drawn, r.first orelse return error.NoFirstToken); + return .{ .token = token, .pos0 = @intCast(r.position - 1), .slot = lane.slot, .lane = lane, .depth = @min(r.depth, @as(u32, @intCast(b - 1))) }; +} + +/// A draft pass's output (`per` tokens a stream, in pass order) into each stream's held drafts, `depth` of them. +pub fn hold(entries: []const Entry, out: []const i32, per: usize) void { + for (entries, 0..) |e, i| { + for (0..e.depth) |j| e.lane.held[j] = @intCast(out[i * per + j]); + e.lane.nheld = e.depth; + } +} + +fn stream(sampling: ?lanes.Sampling) lanes.Stream { + var s: lanes.Stream = undefined; + s.sampling = sampling; + return s; +} + +test "verify rows: pending then held or host drafts, a row a position, each stream on its slot" { + const gpa = std.testing.allocator; + var map: Map = .empty; + defer map.deinit(gpa); + var a = stream(null); + var b = stream(null); + try map.put(gpa, &a, .{ .slot = 3, .held = @splat(0), .nheld = 2, .filled = 40 }); + try map.put(gpa, &b, .{ .slot = 1 }); + map.getPtr(&a).?.held[0..2].* = .{ 71, 72 }; + const windows = [_]be.Window{ + .{ .stream = &a, .pending = 70, .held = 2, .tokens = &.{}, .parents = null, .positions = &.{ 41, 42, 43 } }, + .{ .stream = &b, .pending = 90, .held = 0, .tokens = &.{91}, .parents = null, .positions = &.{ 8, 9 } }, + }; + var rows: [fwd.DECODE_ROWS]fwd.Row = undefined; + const n = try verifyRows(&map, &windows, &rows); + try std.testing.expectEqual(@as(usize, 5), n); + const want = [_]fwd.Row{ + .{ .slot = 3, .pos = 40, .token = 70 }, .{ .slot = 3, .pos = 41, .token = 71 }, .{ .slot = 3, .pos = 42, .token = 72 }, + .{ .slot = 1, .pos = 7, .token = 90 }, .{ .slot = 1, .pos = 8, .token = 91 }, + }; + for (want, rows[0..n]) |w, r| try std.testing.expectEqual(w, r); + try std.testing.expectEqual(@as(u32, 0), map.get(&a).?.filled); + var drafts: [2]u32 = undefined; + verifiedDrafts(map.getPtr(&a).?, windows[0], &drafts); + try std.testing.expectEqualSlices(u32, &.{ 71, 72 }, &drafts); + verifiedDrafts(map.getPtr(&b).?, windows[1], drafts[0..1]); + try std.testing.expectEqual(@as(u32, 91), drafts[0]); +} + +test "verify refuses trees, unknown streams, windows past the rows and drafts it does not hold" { + const gpa = std.testing.allocator; + var map: Map = .empty; + defer map.deinit(gpa); + var a = stream(null); + var other = stream(null); + try map.put(gpa, &a, .{ .slot = 0, .nheld = 1 }); + var rows: [4]fwd.Row = undefined; + const pos = [_]u64{ 1, 2, 3, 4, 5 }; + const tree = [_]be.Window{.{ .stream = &a, .pending = 1, .held = 0, .tokens = &.{2}, .parents = &.{ -1, 0 }, .positions = pos[0..2] }}; + try std.testing.expectError(error.TreesNotBuilt, verifyRows(&map, &tree, &rows)); + const unknown = [_]be.Window{.{ .stream = &other, .pending = 1, .held = 0, .tokens = &.{}, .parents = null, .positions = pos[0..1] }}; + try std.testing.expectError(error.UnknownStream, verifyRows(&map, &unknown, &rows)); + const wide = [_]be.Window{.{ .stream = &a, .pending = 1, .held = 0, .tokens = &.{ 2, 3, 4, 5 }, .parents = null, .positions = &pos }}; + try std.testing.expectError(error.WindowTooWide, verifyRows(&map, &wide, &rows)); + const unheld = [_]be.Window{.{ .stream = &a, .pending = 1, .held = 2, .tokens = &.{}, .parents = null, .positions = pos[0..3] }}; + try std.testing.expectError(error.NoHeldDrafts, verifyRows(&map, &unheld, &rows)); +} + +test "greedy rounds only when no window's stream samples above temperature 0" { + var g = stream(null); + var cold = stream(.{ .seed = 1, .temperature = 0 }); + var hot = stream(.{ .seed = 1, .temperature = 0.7 }); + const w = struct { + fn of(s: *lanes.Stream) be.Window { + return .{ .stream = s, .pending = 0, .held = 0, .tokens = &.{}, .parents = null, .positions = &.{1} }; + } + }.of; + try std.testing.expect(allGreedy(&.{ w(&g), w(&cold) })); + try std.testing.expect(!allGreedy(&.{ w(&g), w(&hot) })); +} + +test "keep takes chains from row 0 only" { + try checkPaths(&.{ &.{0}, &.{ 0, 1, 2 } }); + try std.testing.expectError(error.EmptyPath, checkPaths(&.{&.{}})); + try std.testing.expectError(error.TreesNotBuilt, checkPaths(&.{&.{ 0, 2 }})); + try std.testing.expectError(error.TreesNotBuilt, checkPaths(&.{&.{1}})); +} + +test "draft entries: the last follow token or the fed first, at position - 1, depth capped by the block" { + const gpa = std.testing.allocator; + var map: Map = .empty; + defer map.deinit(gpa); + var a = stream(null); + var b = stream(null); + try map.put(gpa, &a, .{ .slot = 2, .nheld = 5 }); + try map.put(gpa, &b, .{ .slot = 6, .nheld = 3 }); + const drawn = [_]u32{ 10, 11, 12, 13 }; + const ea = (try draftEntry(&map, .{ .stream = &a, .follow = &.{ 5, 6, 7 }, .rows = null, .start = 0, .position = 101, .depth = 12 }, 8, &drawn)).?; + try std.testing.expectEqual(@as(i64, 7), ea.token); + try std.testing.expectEqual(@as(u32, 100), ea.pos0); + try std.testing.expectEqual(@as(u32, 2), ea.slot); + try std.testing.expectEqual(@as(u32, 7), ea.depth); + try std.testing.expectEqual(@as(u32, 0), map.get(&a).?.nheld); + const eb = (try draftEntry(&map, .{ .stream = &b, .follow = &.{}, .first = .{ .handle = 6 }, .rows = null, .start = 0, .position = 9, .depth = 3 }, 8, &drawn)).?; + try std.testing.expectEqual(@as(i64, 12), eb.token); // handle 6 in a ring of 4 + try std.testing.expectEqual(@as(u32, 3), eb.depth); + try std.testing.expectEqual(@as(?Entry, null), try draftEntry(&map, .{ .stream = &a, .follow = &.{1}, .rows = null, .start = 0, .position = 2, .depth = 0 }, null, &drawn)); + try std.testing.expectError(error.NoDraftHead, draftEntry(&map, .{ .stream = &a, .follow = &.{1}, .rows = null, .start = 0, .position = 2, .depth = 1 }, null, &drawn)); + try std.testing.expectError(error.NoFirstToken, draftEntry(&map, .{ .stream = &a, .follow = &.{}, .rows = null, .start = 0, .position = 2, .depth = 1 }, 8, &drawn)); + var c = stream(null); + try std.testing.expectError(error.UnknownStream, draftEntry(&map, .{ .stream = &c, .follow = &.{1}, .rows = null, .start = 0, .position = 2, .depth = 1 }, 8, &drawn)); + const out = [_]i32{ 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47 }; + hold(&.{ ea, eb }, &out, 7); + try std.testing.expectEqualSlices(u32, &.{ 31, 32, 33, 34, 35, 36, 37 }, map.get(&a).?.held[0..map.get(&a).?.nheld]); + try std.testing.expectEqualSlices(u32, &.{ 41, 42, 43 }, map.get(&b).?.held[0..map.get(&b).?.nheld]); +} diff --git a/zig/src/families/nemotron/config.zig b/zig/src/families/nemotron/config.zig index dc2a28cf207..36889555b7c 100644 --- a/zig/src/families/nemotron/config.zig +++ b/zig/src/families/nemotron/config.zig @@ -419,6 +419,10 @@ pub fn parseWith(allocator: std.mem.Allocator, text: []const u8, why: *Why, allo .routed_scaling = if (o.get("routed_scaling_factor")) |v| @floatCast(try number(v)) else 1.0, .eps = if (o.get("layer_norm_epsilon")) |v| @floatCast(try number(v)) else 1e-5, }; + if (c.heads == 0 or c.kv_heads == 0) { // before hidden / heads below, and the engine's heads / kv_heads groups + why.set("config.json declares {d} attention and {d} key/value heads; both must be positive", .{ c.heads, c.kv_heads }); + return error.BadConfig; + } c.head_dim = if (o.get("head_dim")) |v| @intCast(v.integer) else c.hidden / c.heads; if (o.get(pocket_key)) |v| { if (v != .integer or v.integer < 0 or @as(usize, @intCast(v.integer)) >= c.shared_width or @mod(v.integer, 64) != 0) return error.BadConfig; diff --git a/zig/src/families/nemotron/config_test.zig b/zig/src/families/nemotron/config_test.zig index c4b6e8a7d0d..eb626b2e5ec 100644 --- a/zig/src/families/nemotron/config_test.zig +++ b/zig/src/families/nemotron/config_test.zig @@ -191,3 +191,22 @@ test "a bf16 token table (false) is read only where a backend allows it, by its try std.testing.expectError(error.UnsupportedQuantization, cfg.parseWith(std.testing.allocator, head, &why, .{ .bf16_embed = true })); try std.testing.expect(std.mem.indexOf(u8, why.text(), "lm_head") != null); } + +test "a head count of 0 is refused by name before hidden / heads, with head_dim declared or not" { + const a = std.testing.allocator; + const cases = [_][2][]const u8{ + .{ "\"num_attention_heads\": 32", "\"num_attention_heads\": 0" }, + .{ "\"num_key_value_heads\": 2", "\"num_key_value_heads\": 0" }, + }; + for (cases) |c| for ([_]bool{ true, false }) |declared| { + const zero = try std.mem.replaceOwned(u8, a, lightning, c[0], c[1]); + defer a.free(zero); + // without head_dim the width is hidden / num_attention_heads, the division a 0 reached on main + const text = if (declared) try a.dupe(u8, zero) else try std.mem.replaceOwned(u8, a, zero, "\"head_dim\": 128, ", ""); + defer a.free(text); + try std.testing.expect(declared == (std.mem.indexOf(u8, text, "\"head_dim\"") != null)); + var why: Why = .{}; + try std.testing.expectError(error.BadConfig, parse(a, text, &why)); + try std.testing.expect(std.mem.indexOf(u8, why.text(), "attention and") != null); + }; +} diff --git a/zig/src/families/nemotron/cuda_sm89_test.zig b/zig/src/families/nemotron/cuda_sm89_test.zig index 8799636e62d..5cc3465e714 100644 --- a/zig/src/families/nemotron/cuda_sm89_test.zig +++ b/zig/src/families/nemotron/cuda_sm89_test.zig @@ -61,6 +61,7 @@ const Fake = struct { fn lane(d: *const cuda.Driver, cluster: bool) qmmf.Lane { var l: qmmf.Lane = undefined; l.clusters = cluster; + l.pdl = false; l.mod = .{ .d = d, .handle = @ptrFromInt(1) }; for (&l.fns, 0..) |*set, mi| for (set, 0..) |*f, i| { f.* = .{ .d = d, .handle = @ptrFromInt(10 + mi * 16 + i) }; diff --git a/zig/src/families/nemotron/hip/worker.zig b/zig/src/families/nemotron/hip/worker.zig index beec7e60c85..544dfc1e16d 100644 --- a/zig/src/families/nemotron/hip/worker.zig +++ b/zig/src/families/nemotron/hip/worker.zig @@ -3,6 +3,7 @@ const std = @import("std"); const hip = @import("hip"); const serve = @import("hip_serve"); const lanes = @import("lanes.zig"); +const pages_ = @import("pages.zig"); const protocol = serve.protocol; const Hip = lanes.Hip; @@ -40,6 +41,8 @@ pub const Worker = struct { f.close(m[1]); const l = try w.h.make(); errdefer w.h.free(l); + // the resume is a row of the prompt inside the stream, and the pages fit its table and this rank's pool + if (m[2] > prompt.len or m[2] > l.s.cap or !w.fits(l, 0, table)) return error.ShortMessage; l.id = m[1]; try l.s.set(0, table); if (m[3] != protocol.no_snapshot) try w.h.prefix.putSlot(m[3], l); @@ -78,12 +81,19 @@ pub const Worker = struct { try w.h.keepRows(try f.lane(m[1]), m[2]); } - pub fn pages(_: *Worker, l: *Lane, first: usize, ids: []const u32) !void { + /// Whether rank 0's table from page `first` on fits the lane's table and this rank's pool. + fn fits(w: *const Worker, l: *const Lane, first: usize, ids: []const u32) bool { + return protocol.pagesFit(first, ids, l.s.ids.items.len, pages_.pagesFor(l.s.cap), w.h.e.pool.count); + } + + pub fn pages(w: *Worker, l: *Lane, first: usize, ids: []const u32) !void { + if (!w.fits(l, first, ids)) return error.ShortMessage; try l.s.set(first, ids); } /// Slot `slot` takes the stream's Mamba state and last row. pub fn snap(w: *Worker, l: *Lane, slot: u32) !void { + if (!protocol.slotFits(slot, w.h.prefix.slots.slots.items.len)) return error.ShortMessage; try w.h.prefix.takeSlot(slot, l); } diff --git a/zig/src/families/qwen27/attention.zig b/zig/src/families/qwen27/attention.zig index 2224a828b29..a3250c2cc28 100644 --- a/zig/src/families/qwen27/attention.zig +++ b/zig/src/families/qwen27/attention.zig @@ -509,7 +509,7 @@ pub const Attention = struct { e.barrier(); const scale: f32 = 0.0625; if (plan.prefix_chunks > 0) { - const sg: u32 = @min(plan.tiles, if (plan.prefix_chunks >= 64) @as(u32, 6) else 4); // a pair a tile; a long cache reads each chunk once for six tiles + const sg: u32 = @min(plan.tiles, if (a.units) @as(u32, 2) else if (plan.prefix_chunks >= 64) @as(u32, 6) else 4); // a pair a tile; tensor units take two a group, older chips six on a long cache // a stream of one row sees every key its tile reads; only a stream of rows can mask a value e.setPipeline(a.prefix[if (plan.rows > plan.streams) 16 + sg - 1 else sg - 1]); bind(e, .{ scratch.get(.qa), binding.get(.caches) }); diff --git a/zig/src/families/qwen27/config.zig b/zig/src/families/qwen27/config.zig index 0a0132c6e0a..4c7dc1a9f6c 100644 --- a/zig/src/families/qwen27/config.zig +++ b/zig/src/families/qwen27/config.zig @@ -3,10 +3,16 @@ const std = @import("std"); const layer_pattern = @import("qwen35_layers"); const rules = @import("qwen35_rules"); const rope_config = @import("rope_config"); +const fields = @import("config_fields"); +const eos_ids = @import("checkpoint_eos"); pub const Kind = enum { linear, attention }; pub const max_layers = 128; pub const max_eos = 8; +pub const Problem = fields.Problem; +comptime { + std.debug.assert(eos_ids.qwen27_metal.max.? == max_eos); +} pub const Config = struct { hidden: usize, @@ -221,42 +227,18 @@ pub fn object(v: std.json.Value) !std.json.ObjectMap { return if (v == .object) v.object else error.BadConfig; } -fn integer(v: std.json.Value, zero: bool) !usize { - if (v != .integer or v.integer < 0 or (!zero and v.integer == 0)) return error.BadConfig; - if (v.integer > std.math.maxInt(u32)) return error.BadConfig; - return @intCast(v.integer); -} - -fn required(o: std.json.ObjectMap, key: []const u8) !usize { - return integer(o.get(key) orelse return error.BadConfig, false); +/// A count, 0 allowed when `zero`, at most u32; the field layer names the field, the refusal stays BadConfig. +fn integer(v: std.json.Value, zero: bool, at: fields.At, p: *Problem) !usize { + return fields.int(usize, v, .{ .min = @intFromBool(!zero), .max = std.math.maxInt(u32) }, at, p) catch error.BadConfig; } -fn number(v: std.json.Value) !f64 { - const n: f64 = switch (v) { - .integer => |x| @floatFromInt(x), - .float => |x| x, - else => return error.BadConfig, - }; - return if (std.math.isFinite(n)) n else error.BadConfig; +fn required(r: fields.Reader, key: []const u8) !usize { + return integer(r.value(key) catch return error.BadConfig, false, r.at(key), r.problem); } -fn optional(o: std.json.ObjectMap, key: []const u8, fallback: f64) !f64 { - const v = o.get(key) orelse return fallback; - return if (v == .null) fallback else number(v); -} - -fn eos(c: *Config, v: std.json.Value) !void { - if (v == .null) return; - if (v == .array) { - for (v.array.items) |id| try eos(c, id); - return; - } - const id: u32 = @intCast(try integer(v, true)); - if (id >= c.vocab) return error.BadEos; - if (c.isEos(id)) return; - if (c.eos_count == max_eos) return error.TooManyEos; - c.eos[c.eos_count] = id; - c.eos_count += 1; +/// The number, or `fallback` when absent or null. +fn optional(r: fields.Reader, key: []const u8, fallback: f64) !f64 { + return (r.optionalFloat(key, .absent) catch return error.BadConfig) orelse fallback; } fn shapeProducts(c: Config) !void { @@ -273,57 +255,65 @@ fn shapeProducts(c: Config) !void { } pub fn parse(gpa: std.mem.Allocator, json: []const u8, generation: ?[]const u8) !Config { + var p: Problem = .{}; + return parseWhy(gpa, json, generation, &p); +} + +/// `parse`, with `p` naming the field behind a BadConfig the field layer refused. +pub fn parseWhy(gpa: std.mem.Allocator, json: []const u8, generation: ?[]const u8, p: *Problem) !Config { const parsed = try std.json.parseFromSlice(std.json.Value, gpa, json, .{}); defer parsed.deinit(); const root = try object(parsed.value); const t = if (root.get("text_config")) |v| try object(v) else root; + const tower: fields.Reader = .{ .object = t, .source = if (root.get("text_config") == null) "config.json" else "config.json text_config", .problem = p }; const model = t.get("model_type") orelse root.get("model_type") orelse return error.BadConfig; const kinds_of = [_][]const u8{ "qwen3_5", "qwen3_5_text", "qwen3_5_moe", "qwen3_5_moe_text" }; if (model != .string) return error.NotQwenDense; const routed = for (kinds_of, 0..) |k, i| { if (std.mem.eql(u8, model.string, k)) break i >= 2; } else return error.NotQwenDense; - const experts = if (t.get("num_experts")) |v| try integer(v, true) else 0; + const experts = if (t.get("num_experts")) |v| try integer(v, true, tower.at("num_experts"), p) else 0; if (routed != (experts != 0)) return error.NotQwenDense; if (try rules.tied(root, t, .metal27)) return error.TiedEmbeddingHead; try rules.check(t, .metal27); - const heads = try required(t, "num_attention_heads"); - const hidden = try required(t, "hidden_size"); + const heads = try required(tower, "num_attention_heads"); + const hidden = try required(tower, "hidden_size"); const head_dim = if (t.get("head_dim")) |v| blk: { if (v == .null or (v == .integer and v.integer == 0)) break :blk hidden / heads; - break :blk try integer(v, false); + break :blk try integer(v, false, tower.at("head_dim"), p); } else hidden / heads; const rope = rope_config.params(t) catch return error.BadConfig; // theta alone: a scaled rope (rope_scaling from the tower when it has the key, else the root) runs as plain rope if (rope_config.typed(rope) != null or rope_config.legacy(if (t.contains("rope_scaling")) t else root)) return error.UnsupportedRopeScaling; - const factor = if (rope) |r| try optional(r, "partial_rotary_factor", try optional(t, "partial_rotary_factor", 0.25)) else try optional(t, "partial_rotary_factor", 0.25); + const rp: ?fields.Reader = if (rope) |r| .{ .object = r, .source = "config.json rope_parameters", .problem = p } else null; + const factor = if (rp) |r| try optional(r, "partial_rotary_factor", try optional(tower, "partial_rotary_factor", 0.25)) else try optional(tower, "partial_rotary_factor", 0.25); if (factor <= 0 or factor > 1) return error.BadConfig; var c = Config{ .hidden = hidden, - .intermediate = if (routed) try required(t, "shared_expert_intermediate_size") else try required(t, "intermediate_size"), - .layers = try required(t, "num_hidden_layers"), - .vocab = try required(t, "vocab_size"), + .intermediate = if (routed) try required(tower, "shared_expert_intermediate_size") else try required(tower, "intermediate_size"), + .layers = try required(tower, "num_hidden_layers"), + .vocab = try required(tower, "vocab_size"), .heads = heads, - .kv_heads = try required(t, "num_key_value_heads"), + .kv_heads = try required(tower, "num_key_value_heads"), .head_dim = head_dim, - .k_heads = try required(t, "linear_num_key_heads"), - .v_heads = try required(t, "linear_num_value_heads"), - .dk = try required(t, "linear_key_head_dim"), - .dv = try required(t, "linear_value_head_dim"), - .conv_kernel = try required(t, "linear_conv_kernel_dim"), - .eps = @floatCast(try optional(t, "rms_norm_eps", 1e-6)), + .k_heads = try required(tower, "linear_num_key_heads"), + .v_heads = try required(tower, "linear_num_value_heads"), + .dk = try required(tower, "linear_key_head_dim"), + .dv = try required(tower, "linear_value_head_dim"), + .conv_kernel = try required(tower, "linear_conv_kernel_dim"), + .eps = @floatCast(try optional(tower, "rms_norm_eps", 1e-6)), .rope_dims = @intFromFloat(@as(f64, @floatFromInt(head_dim)) * factor), - .rope_theta = if (rope) |r| try optional(r, "rope_theta", try optional(t, "rope_theta", 10000000)) else try optional(t, "rope_theta", 10000000), + .rope_theta = if (rp) |r| try optional(r, "rope_theta", try optional(tower, "rope_theta", 10000000)) else try optional(tower, "rope_theta", 10000000), }; if (routed) { c.experts = experts; - c.top_k = try required(t, "num_experts_per_tok"); - c.moe_intermediate = try required(t, "moe_intermediate_size"); + c.top_k = try required(tower, "num_experts_per_tok"); + c.moe_intermediate = try required(tower, "moe_intermediate_size"); // absent means true, as Qwen3.5-MoE's reference config and the CUDA family read it - c.renorm = if (t.get("norm_topk_prob")) |v| (if (v == .bool) v.bool else return error.BadConfig) else true; + c.renorm = (tower.optionalFlag("norm_topk_prob", .refused) catch return error.BadConfig) orelse true; if (c.experts > 256 or c.top_k >= c.experts or c.top_k > 15 or c.moe_intermediate != c.intermediate) return error.UnsupportedRouting; } - if (t.get("max_position_embeddings")) |v| c.max_position = try integer(v, false); + if (t.get("max_position_embeddings")) |v| c.max_position = try integer(v, false, tower.at("max_position_embeddings"), p); if (rope) |r| if (r.get("mrope_interleaved")) |v| { if (v != .bool or !v.bool) return error.UnsupportedMrope; c.mrope_interleaved = v.bool; @@ -332,18 +322,20 @@ pub fn parse(gpa: std.mem.Allocator, json: []const u8, generation: ?[]const u8) if (!std.math.isFinite(c.eps) or c.eps <= 0 or c.rope_theta <= 0 or c.rope_dims == 0 or c.rope_dims % 2 != 0) return error.BadConfig; if (rope) |r| if (r.get("mrope_section")) |v| { if (v != .array or v.array.items.len != 3) return error.BadConfig; - for (v.array.items, 0..) |x, i| c.mrope_section[i] = try integer(x, true); + for (v.array.items, 0..) |x, i| c.mrope_section[i] = try integer(x, true, .{ .source = "config.json rope_parameters", .key = "mrope_section" }, p); }; var full: [max_layers]bool = undefined; try layer_pattern.read(full[0..c.layers], t); for (c.kinds[0..c.layers], full[0..c.layers]) |*k, f| k.* = if (f) .attention else .linear; - if (root.get("eos_token_id") orelse t.get("eos_token_id")) |v| try eos(&c, v); - if (generation) |text| { - const gen = try std.json.parseFromSlice(std.json.Value, gpa, text, .{}); - defer gen.deinit(); - if ((try object(gen.value)).get("eos_token_id")) |v| try eos(&c, v); - } - if (c.eos_count == 0) return error.MissingEos; + // generation_config.json is parsed before config.json's ids: only when both are bad does the refusal differ + const gen = if (generation) |text| try std.json.parseFromSlice(std.json.Value, gpa, text, .{}) else null; + defer if (gen) |g| g.deinit(); + const gen_doc: std.json.Value = if (gen) |g| .{ .object = try object(g.value) } else .null; + const ids = eos_ids.collect(&c.eos, eos_ids.qwen27_metal, parsed.value, .{ .object = t }, gen_doc, c.vocab) catch |e| return switch (e) { + error.BadEosValue => error.BadConfig, + else => e, + }; + c.eos_count = ids.len; try shapeProducts(c); return c; } diff --git a/zig/src/families/qwen27/decode_round.zig b/zig/src/families/qwen27/decode_round.zig index 9d040572c3d..d75a0c37cee 100644 --- a/zig/src/families/qwen27/decode_round.zig +++ b/zig/src/families/qwen27/decode_round.zig @@ -88,7 +88,7 @@ pub const Runner = struct { fn build(a: std.mem.Allocator, m: *Model, slots: u32, capacity: u32, ready: u32, paged: bool) !Runner { if (slots == 0 or slots > attn.planning.max_streams or capacity == 0 or m.frame.capacity % 16 != 0 or ready == 0 or ready > slots) return error.BadRoundCapacity; - const geometry = try attn.planning.Geometry.fromConfig(m.config, m.device.tensorUnits()); + const geometry = try attn.planning.Geometry.fromConfig(m.config, try @import("simd_attention.zig").sharedPrefix(m.device.tensorUnits())); const linear_index = try a.alloc(u32, m.config.layers); errdefer a.free(linear_index); // with the MTP layer loaded, its block is one more attention layer past the last (forward.layerAt) diff --git a/zig/src/families/qwen27/model.zig b/zig/src/families/qwen27/model.zig index 30ec2fd225b..94a5afa8375 100644 --- a/zig/src/families/qwen27/model.zig +++ b/zig/src/families/qwen27/model.zig @@ -93,7 +93,11 @@ pub const Model = struct { defer a.free(path); const text = try std.Io.Dir.cwd().readFileAlloc(io, path, a, .limited(16 << 20)); defer a.free(text); - const c = try cfg.parse(a, text, null); + var problem: cfg.Problem = .{}; + const c = cfg.parseWhy(a, text, null, &problem) catch |e| { + if (problem.len != 0) std.log.err("{s}: {s}", .{ path, problem.text() }); + return e; + }; var local = c; const shard = if (ranks == 1) cfg.Shard{ .rank = 0, .ranks = 1, .global = c, .local = local } else try cfg.split(&local, rank, ranks, mode); try supported(shard.global); diff --git a/zig/src/families/qwen27/prompt_memory.zig b/zig/src/families/qwen27/prompt_memory.zig index 2de2cbb0745..9d224f9710e 100644 --- a/zig/src/families/qwen27/prompt_memory.zig +++ b/zig/src/families/qwen27/prompt_memory.zig @@ -5,7 +5,7 @@ const frame = @import("gpu_frame.zig"); const planning = @import("attention_plan.zig"); const Budget = @import("gdn_pool.zig").Budget; -const margin: usize = 8 << 30; +pub const margin: usize = 8 << 30; /// RAM a suggested wired limit leaves outside the GPU for macOS and other processes. const floor: usize = 4 << 30; diff --git a/zig/src/families/qwen27/simd_attention.zig b/zig/src/families/qwen27/simd_attention.zig index 695489a10ad..512f2e39bc6 100644 --- a/zig/src/families/qwen27/simd_attention.zig +++ b/zig/src/families/qwen27/simd_attention.zig @@ -30,7 +30,44 @@ const rewrites = [_][2][]const u8{ }, }; -/// The attention kernels as this chip builds them (before M5: the tail rewritten, the prompt kernels if `prompt`). +/// The prefix kernels before M5: scores 16 x 64 (row half at i & 16), outputs 16 x 128, sums in the tail's order. +const prefix_rewrites = [_][2][]const u8{ + .{ " const short fn = ((qid & 2) | (lane & 1)) * 4;\n", " const short fn = ((lane & 8) >> 1) | ((lane & 1) << 1);\n" }, + .{ + " const int key = kt + (i >> 3) * 16 + fn + (i & 3);\n s[i] = key < ((i & 4) ? e1 : e0) ? S[i] * scale[0] : -INFINITY;\n", + " const int key = kt + fn + (i & 1) + 8 * ((i >> 1) & 7);\n s[i] = key < ((i & 16) ? e1 : e0) ? S[i] * scale[0] : -INFINITY;\n", + }, + .{ "{ if (i & 4) x1 = max(x1, s[i]); else x0 = max(x0, s[i]); }", "{ if (i & 16) x1 = max(x1, s[i]); else x0 = max(x0, s[i]); }" }, + .{ "fast::exp(s[i] - ((i & 4) ? nm1 : nm0));", "fast::exp(s[i] - ((i & 16) ? nm1 : nm0));" }, + .{ + " y0 += (p[b * 8] + p[b * 8 + 1]) + (p[b * 8 + 2] + p[b * 8 + 3]);\n y1 += (p[b * 8 + 4] + p[b * 8 + 5]) + (p[b * 8 + 6] + p[b * 8 + 7]);\n", + " y0 += (p[b * 4] + p[b * 4 + 1]) + (p[b * 4 + 2] + p[b * 4 + 3]);\n y1 += (p[b * 4 + 16] + p[b * 4 + 17]) + (p[b * 4 + 18] + p[b * 4 + 19]);\n", + }, + .{ " for (int i = 0; i < 64; i++) O[i] *= (i & 4) ? f1 : f0;\n", " for (int i = 0; i < 64; i++) O[i] *= (i & 32) ? f1 : f0;\n" }, + .{ + " const int b = d >> 4, u = d & 3;\n", + " const int at = ((d >> 3) << 1) | (d & 1); // element 2 (d / 8) + d % 2 (+ 16) of the lane with fn = d % 8 rounded to 2\n", + }, + .{ + " if ((i >> 2) == b && (i & 3) == u) { va = p[(i >> 2) * 8 + (i & 3)]; vb = p[(i >> 2) * 8 + 4 + (i & 3)]; }\n const short g = (d >> 2) & 3;\n", + " if (i == at) { va = p[i]; vb = p[16 + i]; }\n const short g = (d >> 1) & 3;\n", + }, + .{ + " for (int t = 0; t < 8; t++)\n for (int x = 0; x < 4; x++) {\n const float val = float(vk[t * 16 + x]);\n if (key < e0) O[t * 8 + x] += pa * val;\n if (key < e1) O[t * 8 + 4 + x] += pb * val;\n", + " for (int t = 0; t < 16; t++)\n for (int x = 0; x < 2; x++) {\n const float val = float(vk[t * 8 + x]);\n if (key < e0) O[t * 2 + x] += pa * val;\n if (key < e1) O[32 + t * 2 + x] += pb * val;\n", + }, + .{ + " for (int q = 0; q < 16; q++) {\n if ((q & 1) ? q1 >= G * NQ : q0 >= G * NQ) continue;\n device float* dst = PO + (base + tile * 16 + fm + (q & 1) * 8) * D + (hi ? 128 : 0) + (q >> 1) * 16 + fn;\n *(device float4*)dst = float4(O[4 * q], O[4 * q + 1], O[4 * q + 2], O[4 * q + 3]);\n", + " for (int q = 0; q < 32; q++) {\n if ((q / 16) ? q1 >= G * NQ : q0 >= G * NQ) continue;\n device float* dst = PO + (base + tile * 16 + fm + (q / 16) * 8) * D + (hi ? 128 : 0) + fn + 8 * (q % 16);\n *(device float2*)dst = float2(O[2 * q], O[2 * q + 1]);\n", + }, +}; + +/// Whether cached keys take the batched prefix kernels: M5 always; before M5 unless TF_QWEN27_SHARED_PREFIX=0. +pub fn sharedPrefix(units: bool) !bool { + return units or try @import("sys").environment.read(bool, "TF_QWEN27_SHARED_PREFIX", true); +} + +/// The attention kernels as this chip builds them (before M5: prefix and tail rewritten, prompt kernels if `prompt`). pub fn library(a: std.mem.Allocator, units: bool, prompt: bool) ![]u8 { return compose(a, units, prompt, @import("qwen_runtime_sources")); } @@ -72,22 +109,28 @@ pub fn joined(a: std.mem.Allocator, units: bool, prompt: bool, group: u32, kv_he return std.mem.concat(a, u8, &.{ "#define Q27_JOIN 1\n", body }); } -/// The attention source with the tail kernel's result indexing in the simdgroup-matrix layout; the caller frees it. +/// The attention source, its prefix and tail kernels indexing results in the simdgroup-matrix layout; caller frees. pub fn rewrite(a: std.mem.Allocator, source: []const u8) ![]u8 { - const begin = std.mem.indexOf(u8, source, "kernel void q27_attn_tail(") orelse return error.AttentionSource; - const end = begin + (std.mem.indexOf(u8, source[begin..], "kernel void q27_attn_merge(") orelse return error.AttentionSource); - var tail = try a.dupe(u8, source[begin..end]); + const tail = try region(a, source, "kernel void q27_attn_tail(", "kernel void q27_attn_merge(", &rewrites); defer a.free(tail); - for (rewrites) |r| { - if (std.mem.count(u8, tail, r[0]) != 1) return error.AttentionSource; - const next = try std.mem.replaceOwned(u8, a, tail, r[0], r[1]); - a.free(tail); - tail = next; + return region(a, tail, "kernel void q27_attn_prefix(", "#define Q27_PREFIX_AS(", &prefix_rewrites); +} + +fn region(a: std.mem.Allocator, source: []const u8, from: []const u8, to: []const u8, pairs: []const [2][]const u8) ![]u8 { + const begin = std.mem.indexOf(u8, source, from) orelse return error.AttentionSource; + const end = begin + (std.mem.indexOf(u8, source[begin..], to) orelse return error.AttentionSource); + var part = try a.dupe(u8, source[begin..end]); + defer a.free(part); + for (pairs) |r| { + if (std.mem.count(u8, part, r[0]) != 1) return error.AttentionSource; + const next = try std.mem.replaceOwned(u8, a, part, r[0], r[1]); + a.free(part); + part = next; } - return std.mem.concat(a, u8, &.{ source[0..begin], tail, source[end..] }); + return std.mem.concat(a, u8, &.{ source[0..begin], part, source[end..] }); } -/// The tail kernel's ops (scores 16x32 over 256, outputs 16x128 over 64), each element where it is read. +/// The tail and prefix kernels' ops (scores 16x32 and 16x64 over 256, outputs 16x128 over 64), each element where read. pub const check_source = \\#include \\#include @@ -100,12 +143,17 @@ pub const check_source = \\ threadgroup half Ps[16 * TK]; \\ tensor, tensor_inline> tK32(KV, dextents(D, 32)); \\ tensor, tensor_inline> tVh(KV, dextents(128, TK)); + \\ tensor, tensor_inline> tK64((device bfloat*)X, dextents(D, TK)); \\ tensor, tensor_inline> tP(Ps, dextents(TK, 16)); \\ constexpr auto dS = matmul2d_descriptor(16, 32, D, false, true, false, matmul2d_descriptor::mode::multiply); \\ constexpr auto dO = matmul2d_descriptor(16, 128, TK, false, false, false, matmul2d_descriptor::mode::multiply_accumulate); + \\ constexpr auto dW = matmul2d_descriptor(16, TK, D, false, true, false, matmul2d_descriptor::mode::multiply); \\ matmul2d opS; \\ matmul2d opO; + \\ matmul2d opW; \\ auto S = opS.template get_destination_cooperative_tensor(); + \\ auto Wd = opW.template get_destination_cooperative_tensor(); + \\ auto Wp = opO.template get_left_input_cooperative_tensor(Wd); \\ auto O = opO.template get_destination_cooperative_tensor(); \\ const int fm = ((lane & 16) >> 2) | ((lane >> 1) & 3), fn = ((lane & 8) >> 1) | ((lane & 1) << 1); \\ bool ok = true; @@ -113,6 +161,11 @@ pub const check_source = \\ auto at = S.get_multidimensional_index(i); \\ ok = ok && at[1] == fm + ((i & 8) ? 8 : 0) && at[0] == fn + (i & 1) + 8 * ((i >> 1) & 3); \\ } + \\ for (int i = 0; i < 32; i++) { + \\ auto at = Wd.get_multidimensional_index(i); + \\ auto in = Wp.get_multidimensional_index(i); + \\ ok = ok && at[1] == fm + ((i & 16) ? 8 : 0) && at[0] == fn + (i & 1) + 8 * ((i >> 1) & 7) && in[0] == at[0] && in[1] == at[1]; + \\ } \\ for (int i = 0; i < 64; i++) { \\ auto at = O.get_multidimensional_index(i); \\ ok = ok && at[1] == fm + ((i & 32) ? 8 : 0) && at[0] == fn + (i & 1) + 8 * ((i >> 1) % 16); @@ -129,7 +182,7 @@ pub fn check(device: mtl.Device, queue: mtl.Queue) !void { defer lib.deinit(); const pipe = try mtl.Pipeline.init(device, lib, "tf_q27_attn_layout", false); defer pipe.deinit(); - const x = try device.buffer(256 * 16 * 2, mtl.ResourceOptions.shared); + const x = try device.buffer(256 * 64 * 2, mtl.ResourceOptions.shared); defer x.deinit(); const ok = try device.buffer(32 * 4, mtl.ResourceOptions.shared); defer ok.deinit(); @@ -152,7 +205,7 @@ pub fn check(device: mtl.Device, queue: mtl.Queue) !void { }; } -test "the rewrite changes every M5-indexed line of the tail kernel once and leaves the other kernels alone" { +test "the rewrite changes every M5-indexed line of the tail kernel once and leaves the kernels after it alone" { const source = @import("qwen_runtime_sources").attention_mpp; const text = try rewrite(std.testing.allocator, source); defer std.testing.allocator.free(text); @@ -160,10 +213,21 @@ test "the rewrite changes every M5-indexed line of the tail kernel once and leav const end = begin + std.mem.indexOf(u8, text[begin..], "kernel void q27_attn_merge(").?; try std.testing.expect(std.mem.indexOf(u8, text[begin..end], "(i & 4)") == null); try std.testing.expect(std.mem.indexOf(u8, text[begin..end], "float4(Olo") == null); - try std.testing.expectEqualStrings(source[0..begin], text[0..begin]); try std.testing.expectEqualStrings(source[source.len - (text.len - end) ..], text[end..]); } +test "the rewrite changes every M5-indexed line of the prefix kernel once" { + const source = @import("qwen_runtime_sources").attention_mpp; + const text = try rewrite(std.testing.allocator, source); + defer std.testing.allocator.free(text); + const begin = std.mem.indexOf(u8, text, "kernel void q27_attn_prefix(").?; + const end = begin + std.mem.indexOf(u8, text[begin..], "#define Q27_PREFIX_AS(").?; + try std.testing.expect(std.mem.indexOf(u8, text[begin..end], "(i & 4)") == null); + try std.testing.expect(std.mem.indexOf(u8, text[begin..end], "float4(O[") == null); + try std.testing.expect(std.mem.indexOf(u8, text[begin..end], "* 16 + fn") == null); + try std.testing.expectEqualStrings(source[0..begin], text[0..begin]); +} + test "both attention builds, with and without the prompt kernels, open with the KV-group defines" { const a = std.testing.allocator; const defines = "#define Q27_G 4\n#define Q27_KVH 4\n"; diff --git a/zig/src/families/qwen3_5/backend/hip/engine/hip_lanes.zig b/zig/src/families/qwen3_5/backend/hip/engine/hip_lanes.zig index b49514c2d37..04dbc827ba5 100644 --- a/zig/src/families/qwen3_5/backend/hip/engine/hip_lanes.zig +++ b/zig/src/families/qwen3_5/backend/hip/engine/hip_lanes.zig @@ -193,6 +193,7 @@ pub const Hip = struct { .max_streams = @intCast(h.e.o.batch_rows), .draft_streams = drafting, .plain_guard = plain_guard, + .copy_guard = h.costs.windows > 0, // a lone stream's copies too, with a head or without (lanes/lone_copy.zig) .window_costs = h.costs.window[0..h.costs.windows], .shared_costs = h.costs.shared[0..h.costs.shareds], .mtp_step_ms = h.costs.step_ms, diff --git a/zig/src/families/qwen3_5/backend/hip/engine/native.zig b/zig/src/families/qwen3_5/backend/hip/engine/native.zig index 9b3467cfd59..d9d1d32f8fc 100644 --- a/zig/src/families/qwen3_5/backend/hip/engine/native.zig +++ b/zig/src/families/qwen3_5/backend/hip/engine/native.zig @@ -171,10 +171,7 @@ fn prepare( a, problem, "{s}", - .{try hip.admission.badSetting(a, if (err == error.BadReserve) error.BadReserve else error.BadLimit, .{ - .reserve = @import("sys").getenv("TENSORFOLD_MEMORY_RESERVE_GIB"), - .limit = @import("sys").getenv("TENSORFOLD_HIP_MEMORY_LIMIT_GB"), - })}, + .{try hip.admission.badSetting(a, if (err == error.BadReserve) error.BadReserve else error.BadLimit, hip.admission.envTexts())}, ), error.HostMemoryUnavailable => steps.refuseAll( a, diff --git a/zig/src/families/qwen3_5/backend/hip/engine/worker.zig b/zig/src/families/qwen3_5/backend/hip/engine/worker.zig index c7aece5ecc8..d561fc15db9 100644 --- a/zig/src/families/qwen3_5/backend/hip/engine/worker.zig +++ b/zig/src/families/qwen3_5/backend/hip/engine/worker.zig @@ -6,6 +6,7 @@ const serve = @import("hip_serve"); const Engine = @import("engine.zig").Engine; const Pick = @import("engine.zig").Pick; const state = @import("../forward/state.zig"); +const pages_ = @import("../forward/pages.zig"); const draw = serve.draw; const protocol = serve.protocol; @@ -79,6 +80,7 @@ pub const Worker = struct { errdefer w.gpa.destroy(lane); lane.* = .{ .caches = try w.e.emptyCaches(m[2]), .len = prompt.len }; errdefer lane.caches.deinit(w.gpa); + if (!w.fits(lane, 0, held)) return error.ShortMessage; try lane.caches.set(w.gpa, 0, held); if (m[6] != protocol.no_snapshot) try lane.caches.loadLinear(try w.slots.get(m[6]), w.e.stream.handle); try f.begin(m[1], lane, prompt, m[4]); @@ -131,16 +133,24 @@ pub const Worker = struct { try w.e.flush(); } + /// Whether rank 0's table from page `first` on fits the lane's table and this rank's pool. + fn fits(w: *const Worker, l: *const Lane, first: usize, ids: []const u32) bool { + return protocol.pagesFit(first, ids, l.caches.table.items.len, pages_.pagesFor(l.caches.total), w.e.pool.count); + } + pub fn pages(w: *Worker, l: *Lane, first: usize, ids: []const u32) !void { + if (!w.fits(l, first, ids)) return error.ShortMessage; try l.caches.set(w.gpa, first, ids); } /// Slot `slot` keeps the stream's linear state. pub fn snap(w: *Worker, l: *Lane, slot: u32) !void { + if (!protocol.slotFits(slot, w.slots.slots.items.len)) return error.ShortMessage; try l.caches.saveLinear(try w.slots.buffer(slot, l.caches.linearBytes()), w.e.stream.handle); } pub fn copy(w: *Worker, from: u32, to: u32) !void { + if (!protocol.pageFits(from, w.e.pool.count) or !protocol.pageFits(to, w.e.pool.count)) return error.ShortMessage; try w.e.pool.copyPage(from, to, w.e.stream.handle); } }; diff --git a/zig/src/families/qwen3_5/config.zig b/zig/src/families/qwen3_5/config.zig index 3f0d593c52d..33adaf0ab73 100644 --- a/zig/src/families/qwen3_5/config.zig +++ b/zig/src/families/qwen3_5/config.zig @@ -339,6 +339,7 @@ pub fn geometry(tower: std.json.ObjectMap, bits: u8, group_size: u16) Error!Spec } const model_width = try requiredInt(tower, "hidden_size"); const attn_heads = try requiredInt(tower, "num_attention_heads"); + try checks.heads(&.{attn_heads}); // before hidden / heads below; the other counts in checks.products const per_head = if (truthy(tower.get("head_dim"))) try toInt(tower.get("head_dim").?) else model_width / attn_heads; const rope = if (truthy(tower.get("rope_parameters"))) try objectOf(tower.get("rope_parameters").?) else std.json.ObjectMap.empty; const partial = try numberOf(rope_config.pick(rope, tower, "partial_rotary_factor", .both) orelse .{ .float = 0.25 }); @@ -371,7 +372,6 @@ pub fn geometry(tower: std.json.ObjectMap, bits: u8, group_size: u16) Error!Spec .mtp_layers = try optionalInt(tower, "mtp_num_hidden_layers", 0), }; if (rotary % 2 != 0 or rotary == 0 or rotary > per_head) return error.InvalidRotary; - if (attn_heads == 0) return error.InvalidConfig; try checks.computes(tower); try checks.products(.{ .hidden = spec.hidden, .intermediate = spec.intermediate, .vocab = spec.vocab, .heads = spec.heads, .kv_heads = spec.kv_heads, .head_dim = spec.head_dim, .key_heads = spec.key_heads, .value_heads = spec.value_heads, .key_dim = spec.key_dim, .value_dim = spec.value_dim, .conv = spec.conv, .experts = spec.experts, .moe_width = spec.moe_width, .shared_width = spec.shared_width }); try checks.layers(&spec.full_layers, tower, spec.n_layers); diff --git a/zig/src/families/qwen3_5/config_checks.zig b/zig/src/families/qwen3_5/config_checks.zig index f8f361e7ecd..cdb193515af 100644 --- a/zig/src/families/qwen3_5/config_checks.zig +++ b/zig/src/families/qwen3_5/config_checks.zig @@ -4,11 +4,15 @@ const std = @import("std"); const layer_pattern = @import("qwen35_layers"); const rules = @import("qwen35_rules"); const rope_config = @import("rope_config"); +const eos_ids = @import("checkpoint_eos"); -pub const Error = error{ BadEos, TooManyEos, MissingEos, InvalidConfig, InvalidRotary } || rules.Error || layer_pattern.Error; +pub const Error = error{ BadEos, TooManyEos, MissingEos, InvalidConfig, InvalidRotary, ZeroHeadCount } || rules.Error || layer_pattern.Error; /// The most end ids a checkpoint may declare across config.json and generation_config.json. pub const max_eos = 8; +comptime { + std.debug.assert(eos_ids.qwen35_hip.max.? == max_eos); +} /// The most decoder layers a config may declare. pub const max_layers = 128; @@ -75,7 +79,13 @@ pub const Sizes = struct { shared_width: usize, }; +/// Every head count the host divides by or groups with: 0 is refused by name before any division. +pub fn heads(counts: []const usize) Error!void { + for (counts) |n| if (n == 0) return error.ZeroHeadCount; +} + pub fn products(s: Sizes) Error!void { + try heads(&.{ s.heads, s.kv_heads, s.key_heads, s.value_heads }); if (s.heads % s.kv_heads != 0 or s.value_heads % s.key_heads != 0) return error.InvalidConfig; const limit: usize = std.math.maxInt(u32); const q = try mul(try mul(s.heads, s.head_dim), 2); @@ -88,29 +98,13 @@ pub fn products(s: Sizes) Error!void { for (widths) |w| if (w > limit) return error.InvalidConfig; } -/// The end ids, config.json's (root, then text tower) and generation_config.json's, each once and below `vocab`. +/// The HIP loader's end ids by core's qwen35_hip policy: root, text tower and generation_config.json, below `vocab`. pub fn eos(out: *[max_eos]u32, root: std.json.ObjectMap, tower: std.json.ObjectMap, generation: ?std.json.ObjectMap, vocab: usize) Error![]const u32 { - var n: usize = 0; - const holders = [_]?std.json.Value{ root.get("eos_token_id"), tower.get("eos_token_id"), if (generation) |g| g.get("eos_token_id") else null }; - for (holders) |h| if (h) |v| try collect(out, &n, v, vocab); - if (n == 0) return error.MissingEos; - return out[0..n]; -} - -fn collect(out: *[max_eos]u32, n: *usize, v: std.json.Value, vocab: usize) Error!void { - switch (v) { - .null => {}, - .array => |list| for (list.items) |item| try collect(out, n, item, vocab), - .integer => |i| { - if (i < 0 or i >= vocab) return error.BadEos; - const id: u32 = @intCast(i); - if (std.mem.indexOfScalar(u32, out[0..n.*], id) != null) return; - if (n.* == max_eos) return error.TooManyEos; - out[n.*] = id; - n.* += 1; - }, - else => return error.BadEos, - } + const gen: std.json.Value = if (generation) |g| .{ .object = g } else .null; + return eos_ids.collect(out, eos_ids.qwen35_hip, .{ .object = root }, .{ .object = tower }, gen, vocab) catch |e| return switch (e) { + error.BadEosValue => error.BadEos, + else => |x| x, + }; } fn mul(a: usize, b: usize) Error!usize { @@ -162,7 +156,7 @@ test "end ids from config.json and generation_config.json, once each, refused pa try std.testing.expectError(error.TooManyEos, eos(&out, try parsed(a, "{\"eos_token_id\":[0,1,2,3,4,5,6,7,8]}"), try parsed(a, "{}"), null, 10)); } -test "sizes: products past 32 bits and uneven head groups are refused" { +test "sizes: products past 32 bits, uneven head groups and zero head counts are refused" { const ok: Sizes = .{ .hidden = 5120, .intermediate = 17408, .vocab = 248320, .heads = 24, .kv_heads = 4, .head_dim = 256, .key_heads = 16, .value_heads = 48, .key_dim = 128, .value_dim = 128, .conv = 4, .experts = 0, .moe_width = 0, .shared_width = 0 }; try products(ok); var moe = ok; @@ -172,6 +166,11 @@ test "sizes: products past 32 bits and uneven head groups are refused" { var wide = ok; wide.vocab = 1 << 20; try std.testing.expectError(error.InvalidConfig, products(wide)); + inline for (.{ "heads", "kv_heads", "key_heads", "value_heads" }) |name| { + var zero = ok; + @field(zero, name) = 0; + try std.testing.expectError(error.ZeroHeadCount, products(zero)); + } var uneven = ok; uneven.kv_heads = 5; try std.testing.expectError(error.InvalidConfig, products(uneven)); diff --git a/zig/src/families/qwen3_5/cuda.zig b/zig/src/families/qwen3_5/cuda.zig index da834c553f0..4c8fd7feaa5 100644 --- a/zig/src/families/qwen3_5/cuda.zig +++ b/zig/src/families/qwen3_5/cuda.zig @@ -82,6 +82,7 @@ test { } test { + _ = @import("cuda_sm110_modes.zig"); _ = train; _ = @import("cuda_read_cost_test.zig"); } diff --git a/zig/src/families/qwen3_5/cuda_admit_test.zig b/zig/src/families/qwen3_5/cuda_admit_test.zig index f0193616a40..830622dd114 100644 --- a/zig/src/families/qwen3_5/cuda_admit_test.zig +++ b/zig/src/families/qwen3_5/cuda_admit_test.zig @@ -103,7 +103,9 @@ fn refused(slide: bool, kv_pages: ?[:0]const u8, share: ?[:0]const u8) !void { if (kv_pages) |v| _ = env.setenv("TF_QWEN_KV_PAGES", v, 1); if (share) |v| _ = env.setenv("TF_QWEN_KV_SHARE", v, 1); const o: native.Options = .{ .context = capacity, .drafts = false, .slide = slide }; - _ = try native.open(t.allocator, t.io, undefined, "/nonexistent", null, o); + var d = @import("cuda_sm110_open_test.zig").driver(121); + const ctx: cuda.Context = .{ .d = &d, .device = 0, .handle = null }; + _ = try native.open(t.allocator, t.io, &ctx, "/nonexistent", null, o); } /// A set switch's refusal needs no model: it stops before the weights load, as the other switch checks do. diff --git a/zig/src/families/qwen3_5/cuda_cache.zig b/zig/src/families/qwen3_5/cuda_cache.zig index 7c3c98e1762..1675ac8aa5e 100644 --- a/zig/src/families/qwen3_5/cuda_cache.zig +++ b/zig/src/families/qwen3_5/cuda_cache.zig @@ -3,6 +3,7 @@ const std = @import("std"); const cuda = @import("cuda"); const geometry = @import("cuda_geometry.zig"); const engine = @import("cuda_engine.zig"); +const platform = @import("sys"); const Engine = engine.Engine; const DeviceBuffer = cuda.DeviceBuffer; @@ -21,7 +22,7 @@ pub fn keepLate() bool { var on: ?bool = null; }; if (S.on) |v| return v; - const v = if (std.c.getenv("TF_QWEN_KEEP_LATE")) |x| std.mem.eql(u8, std.mem.span(x), "1") else false; + const v = platform.environment.read(bool, "TF_QWEN_KEEP_LATE", false) catch false; S.on = v; return v; } @@ -71,16 +72,20 @@ pub const Paged = struct { /// TF_QWEN_KV_PAGE_TEST=n: each cache's own buffer read through a table of n-position pages in reverse order (checks). pub fn pageTest() !usize { - const v = std.c.getenv("TF_QWEN_KV_PAGE_TEST") orelse return 0; - return parsePageTest(std.mem.span(v)); + const n = try platform.environment.read(u64, "TF_QWEN_KV_PAGE_TEST", 0); + return if (n == 0) 0 else parsePageTestValue(n); } -pub fn parsePageTest(v: []const u8) !usize { - const n = std.fmt.parseInt(usize, v, 10) catch return error.BadQwenPageTest; +pub fn parsePageTestValue(n: usize) !usize { if (!validPageTokens(n)) return error.BadQwenPageTest; return n; } +pub fn parsePageTest(v: []const u8) !usize { + const n = std.fmt.parseInt(usize, v, 10) catch return error.BadQwenPageTest; + return parsePageTestValue(n); +} + pub fn validPageTokens(n: usize) bool { return n > 0 and n <= std.math.maxInt(c_int); } @@ -413,6 +418,14 @@ fn freePaged(gpa: std.mem.Allocator, p: *Paged) void { if (p.own_ids) gpa.free(p.ids); } +test "TF_QWEN_KEEP_LATE and TF_QWEN_KV_PAGE_TEST: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_QWEN_KEEP_LATE", null)); + try std.testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_QWEN_KEEP_LATE", "1")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_QWEN_KEEP_LATE", "on")); + try std.testing.expectEqual(@as(?u64, 512), try platform.environment.parse("TF_QWEN_KV_PAGE_TEST", "512")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_QWEN_KV_PAGE_TEST", "0")); +} + test "KV page dimensions: diagnostic rows fit the signed kernel argument" { try std.testing.expectEqual(@as(usize, 48), try parsePageTest("48")); try std.testing.expectError(error.BadQwenPageTest, parsePageTest("0")); diff --git a/zig/src/families/qwen3_5/cuda_cost_adapter.zig b/zig/src/families/qwen3_5/cuda_cost_adapter.zig index e2f1796d4a7..11b766fb1a6 100644 --- a/zig/src/families/qwen3_5/cuda_cost_adapter.zig +++ b/zig/src/families/qwen3_5/cuda_cost_adapter.zig @@ -5,6 +5,7 @@ const E = @import("cuda_engine.zig"); const warm = @import("cuda_warm.zig"); const profile = @import("cuda_startup_profile.zig"); const costs = @import("cuda_window_costs.zig"); +const platform = @import("sys"); pub const file_identity = @import("cuda_cost_identity.zig"); pub const Kind = enum { dflash, mtp }; @@ -38,7 +39,7 @@ pub fn identity(l: anytype, d: anytype, reserved: ?*E.Cache) !costs.Keys { const checkpoint = std.fmt.bytesToHex(stamp, .lower); const target_hex = std.fmt.bytesToHex(target, .lower); const parts = [_][]const u8{ "qwen35-cuda/wall-chain-greedy-v2", gpu, release, geometry, policy, taps, @tagName(l.cost_kind), draft, facts, &checkpoint, &target_hex }; - const trace = if (@import("sys").getenv("TF_COST_KEY_TRACE")) |v| std.mem.eql(u8, v, "1") else false; + const trace = try platform.environment.read(bool, "TF_COST_KEY_TRACE", false); if (trace) { const names = [_][]const u8{ "profile", "gpu", "driver", "geometry", "policy", "target-taps", "draft-kind", "draft-config", "draft-facts", "draft-checkpoint", "target-checkpoint" }; for (names, parts) |name_, bytes| tracePart(name_, bytes); @@ -150,3 +151,9 @@ fn tracePart(name: []const u8, bytes: []const u8) void { const hex = std.fmt.bytesToHex(digest, .lower); std.log.info("window cost key part {s} {s}", .{ name, hex[0..12] }); } + +test "TF_COST_KEY_TRACE: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_COST_KEY_TRACE", null)); + try std.testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_COST_KEY_TRACE", "1")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_COST_KEY_TRACE", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_draft.zig b/zig/src/families/qwen3_5/cuda_draft.zig index 5c9d057ab8d..b7f77b8a4f4 100644 --- a/zig/src/families/qwen3_5/cuda_draft.zig +++ b/zig/src/families/qwen3_5/cuda_draft.zig @@ -172,7 +172,7 @@ pub const Draft = struct { /// The target's measured window cost, published after the complete reset-cache width sweep. pub fn setCost(d: *Draft, rows: u32, ms: f64) void { - if (platform.c.getenv("TF_TIMING") != null) std.debug.print("[timing] window {d} rows {d:.2} ms (a hold level {d:.2})\n", .{ rows, ms, d.step_ms }); + if (platform.environment.read(bool, "TF_TIMING", false) catch false) std.debug.print("[timing] window {d} rows {d:.2} ms (a hold level {d:.2})\n", .{ rows, ms, d.step_ms }); if (d.n_costs < d.costs.len) { d.costs[d.n_costs] = .{ .width = rows, .ms = ms }; d.n_costs += 1; @@ -440,7 +440,7 @@ pub const Draft = struct { fn factsFn(p: *anyopaque) dr.Facts { const d = cast(p); // TF_NO_TREES=1: chains only (for comparing) - return .{ .fixed_block = d.c.kind == .dflash2, .depth = @intCast(d.c.block - 1), .step_ms = d.step_ms, .prior = &draft_prior.prior, .plain_guard = true, .batched = true, .stream_bytes = d.c.ringBytes() + d.target_taps + d.scratch_one, .trees = platform.c.getenv("TF_NO_TREES") == null, .window_costs = d.costs[0..d.n_costs], .lane_costs = d.costs[0..d.n_costs], .copy_match = factsCopyMatch(d), .tree_nodes = @intCast(if (d.c.block == 16) d.tree_nodes else 0) }; + return .{ .fixed_block = d.c.kind == .dflash2, .depth = @intCast(d.c.block - 1), .step_ms = d.step_ms, .prior = &draft_prior.prior, .plain_guard = true, .batched = true, .stream_bytes = d.c.ringBytes() + d.target_taps + d.scratch_one, .trees = !(platform.environment.read(bool, "TF_NO_TREES", false) catch false), .window_costs = d.costs[0..d.n_costs], .lane_costs = d.costs[0..d.n_costs], .copy_match = factsCopyMatch(d), .tree_nodes = @intCast(if (d.c.block == 16) d.tree_nodes else 0) }; } fn openFn(p: *anyopaque, s: *Stream) anyerror!void { @@ -549,7 +549,7 @@ pub fn factsCopyMatch(d: anytype) i64 { /// TF_TIMING=1: each call's wall time on stderr. pub fn timing(what: []const u8, io: std.Io, t0: std.Io.Timestamp) void { - if (platform.c.getenv("TF_TIMING") == null) return; + if (!(platform.environment.read(bool, "TF_TIMING", false) catch false)) return; const now = std.Io.Clock.awake.now(io); const ns: f64 = @floatFromInt(t0.durationTo(now).toNanoseconds()); const at: f64 = @floatFromInt(@mod(now.toNanoseconds(), 1_000_000_000_000)); @@ -591,3 +591,9 @@ test "a drafter config with a zero divisor is refused, and any admitted rank's s const c = try Config.parse(gpa, wide, target); try std.testing.expect(Draft.stagedLen(c.rank) >= Draft.hp_at + (c.block - 1) * c.rank * 2); } + +test "TF_TIMING: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_TIMING", null)); + try std.testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_TIMING", "1")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_TIMING", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_draft_tree.zig b/zig/src/families/qwen3_5/cuda_draft_tree.zig index 0475cca0ae5..e5897d2c221 100644 --- a/zig/src/families/qwen3_5/cuda_draft_tree.zig +++ b/zig/src/families/qwen3_5/cuda_draft_tree.zig @@ -11,10 +11,16 @@ pub const lanesOf = walker.lanesOf; /// A grown tree's nodes at most: walker.nodes under the engine's window, 0 under TF_NO_TREES. pub fn nodes() !usize { - return walker.nodes(engine.most_window, platform.c.getenv("TF_NO_TREES") != null); + return walker.nodes(engine.most_window, try platform.environment.read(bool, "TF_NO_TREES", false)); } /// walker.grow under the engine's window. pub fn grow(c: Candidates, pending: u32, rows: usize, most: usize, tokens: []u32, parents: []i32, own: []f64) usize { return walker.grow(engine.most_window, c, pending, rows, most, tokens, parents, own); } + +test "TF_NO_TREES: the platform parses unset, valid and malformed text" { + try @import("std").testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_NO_TREES", null)); + try @import("std").testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_NO_TREES", "1")); + try @import("std").testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_NO_TREES", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_geometry.zig b/zig/src/families/qwen3_5/cuda_geometry.zig index dc99f8a293a..1e952aa517a 100644 --- a/zig/src/families/qwen3_5/cuda_geometry.zig +++ b/zig/src/families/qwen3_5/cuda_geometry.zig @@ -4,6 +4,7 @@ const core = @import("core"); const layer_pattern = @import("qwen35_layers"); const rules = @import("qwen35_rules"); const cuda_rope = @import("cuda_rope.zig"); +const fields = @import("config_fields"); pub const max_layers = 128; /// qwen35.cu's fixed widths. @@ -105,7 +106,11 @@ pub const Geometry = struct { defer gpa.free(path); const bytes = try std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 22)); defer gpa.free(bytes); - var g = try parse(gpa, bytes); + var why: fields.Problem = .{}; + var g = parseWhy(gpa, bytes, &why) catch |e| { + if (why.len != 0) std.log.err("{s}: {s}", .{ path, why.text() }); + return e; + }; if (g.kinds.ct) g.kinds = try @import("cuda_modelopt.zig").ctKinds(gpa, io, dir, g); return g; } @@ -212,7 +217,7 @@ pub fn supported(g: Geometry, rows: usize, prompt: bool, partial_rows: usize) bo } /// Per-module overrides: routers at 8 bits, switch_mlp at 3 or 4 (one width throughout), others 4; groups of 64. -fn expertBits(q: std.json.ObjectMap, layers: usize) !struct { bits: u8, count: usize } { +fn expertBits(q: std.json.ObjectMap, layers: usize, p: *fields.Problem) !struct { bits: u8, count: usize } { var bits: ?usize = null; var count: usize = 0; var seen: [3 * max_layers]bool = @splat(false); @@ -224,8 +229,9 @@ fn expertBits(q: std.json.ObjectMap, layers: usize) !struct { bits: u8, count: u if (o.get("mode")) |mode| { if (mode != .string or !std.mem.eql(u8, mode.string, "affine")) return error.UnsupportedQwenQuantization; } - const b = try integer(o, "bits"); - if (try integer(o, "group_size") != 64) return error.UnsupportedQwenQuantization; + const r: fields.Reader = .{ .object = o, .source = name, .problem = p }; + const b = try integer(r, "bits"); + if (try integer(r, "group_size") != 64) return error.UnsupportedQwenQuantization; if (std.mem.endsWith(u8, name, ".mlp.gate") or std.mem.endsWith(u8, name, ".mlp.shared_expert_gate")) { if (b != 8) return error.UnsupportedQwenQuantization; } else if (std.mem.indexOf(u8, name, ".mlp.switch_mlp.") != null) { @@ -264,18 +270,14 @@ fn object(v: std.json.Value) !std.json.ObjectMap { return if (v == .object) v.object else error.BadQwenConfig; } -fn integer(o: std.json.ObjectMap, key: []const u8) !usize { - const v = o.get(key) orelse return error.BadQwenConfig; - if (v != .integer or v.integer < 1) return error.BadQwenConfig; - return @intCast(v.integer); +/// A required positive integer; the field layer names the field, the refusal stays BadQwenConfig. +fn integer(r: fields.Reader, key: []const u8) !usize { + return r.requiredInt(usize, key, .{ .min = 1 }) catch error.BadQwenConfig; } -fn number(o: std.json.ObjectMap, key: []const u8) !f64 { - return switch (o.get(key) orelse return error.BadQwenConfig) { - .integer => |i| @floatFromInt(i), - .float => |f| f, - else => error.BadQwenConfig, - }; +/// A required number, an integer or a float. +fn number(r: fields.Reader, key: []const u8) !f64 { + return r.requiredFloat(key) catch error.BadQwenConfig; } fn is(o: std.json.ObjectMap, key: []const u8, comptime T: type, want: T) !void { @@ -290,6 +292,12 @@ fn is(o: std.json.ObjectMap, key: []const u8, comptime T: type, want: T) !void { } pub fn parse(gpa: std.mem.Allocator, bytes: []const u8) !Geometry { + var why: fields.Problem = .{}; + return parseWhy(gpa, bytes, &why); +} + +/// `parse`, with `p` naming the field behind a BadQwenConfig the field layer refused. +pub fn parseWhy(gpa: std.mem.Allocator, bytes: []const u8, p: *fields.Problem) !Geometry { const doc = try std.json.parseFromSlice(std.json.Value, gpa, bytes, .{}); defer doc.deinit(); const root = try object(doc.value); @@ -307,7 +315,8 @@ pub fn parse(gpa: std.mem.Allocator, bytes: []const u8) !Geometry { try is(t, "linear_key_head_dim", usize, dk); try is(t, "linear_value_head_dim", usize, dk); try is(t, "linear_conv_kernel_dim", usize, taps); - const rope = try object(t.get("rope_parameters") orelse return error.UnsupportedQwenRotary); + const text: fields.Reader = .{ .object = t, .source = "config.json text_config", .problem = p }; + const rope: fields.Reader = .{ .object = try object(t.get("rope_parameters") orelse return error.UnsupportedQwenRotary), .source = "config.json text_config.rope_parameters", .problem = p }; if (try number(rope, "rope_theta") != cuda_rope.theta or try number(rope, "partial_rotary_factor") != 0.25) return error.UnsupportedQwenRotary; // plain rope, or YaRN from the config (rope_parameters or the older rope_scaling); --rope-yarn applies later const resolved = cuda_rope.resolve(t, null) catch |e| return if (e == error.BadQwenConfig) error.BadQwenConfig else error.UnsupportedQwenRotary; @@ -319,15 +328,15 @@ pub fn parse(gpa: std.mem.Allocator, bytes: []const u8) !Geometry { const bf16 = !modelopt and !exl3 and qv == null; if (bf16 and moe) return error.UnsupportedQwenQuantization; var g: Geometry = .{ - .hidden = try integer(t, "hidden_size"), - .intermediate = try integer(t, if (moe) "moe_intermediate_size" else "intermediate_size"), - .layers = try integer(t, "num_hidden_layers"), - .vocab = try integer(t, "vocab_size"), - .k_heads = try integer(t, "linear_num_key_heads"), - .v_heads = try integer(t, "linear_num_value_heads"), - .q_heads = try integer(t, "num_attention_heads"), - .kv_heads = try integer(t, "num_key_value_heads"), - .eps = @floatCast(try number(t, "rms_norm_eps")), + .hidden = try integer(text, "hidden_size"), + .intermediate = try integer(text, if (moe) "moe_intermediate_size" else "intermediate_size"), + .layers = try integer(text, "num_hidden_layers"), + .vocab = try integer(text, "vocab_size"), + .k_heads = try integer(text, "linear_num_key_heads"), + .v_heads = try integer(text, "linear_num_value_heads"), + .q_heads = try integer(text, "num_attention_heads"), + .kv_heads = try integer(text, "num_key_value_heads"), + .eps = @floatCast(try number(text, "rms_norm_eps")), .tied = try rules.tied(root, t, .cuda), .context = resolved.ceiling, .rope = resolved.rope, @@ -345,13 +354,13 @@ pub fn parse(gpa: std.mem.Allocator, bytes: []const u8) !Geometry { if (g.layers > max_layers or g.hidden % 256 != 0 or g.hidden > 8192 or g.intermediate % 64 != 0) return error.UnsupportedQwenGeometry; if (moe) { if (modelopt and !quantMethod(root, "modelopt")) return error.UnsupportedQwenQuantization; // ModelOpt's own only - g.experts = try integer(t, "num_experts"); - g.top_k = try integer(t, "num_experts_per_tok"); + g.experts = try integer(text, "num_experts"); + g.top_k = try integer(text, "num_experts_per_tok"); // the shared expert runs in the routed experts' table, so it needs their width - if (try integer(t, "shared_expert_intermediate_size") != g.intermediate) return error.UnsupportedQwenGeometry; + if (try integer(text, "shared_expert_intermediate_size") != g.intermediate) return error.UnsupportedQwenGeometry; if (g.experts > 256 or g.top_k > 31 or g.top_k >= g.experts) return error.UnsupportedQwenGeometry; if (!exl3 and !modelopt) { // an MLX table's widths; ModelOpt's experts come from their recipes - const w = try expertBits(try object(qv.?), g.layers); + const w = try expertBits(try object(qv.?), g.layers, p); if (w.count != 0 and w.count != 3 * g.layers) return error.UnsupportedQwenQuantization; g.expert_bits = w.bits; } diff --git a/zig/src/families/qwen3_5/cuda_mtp.zig b/zig/src/families/qwen3_5/cuda_mtp.zig index 7be3a015faa..6aa5907b493 100644 --- a/zig/src/families/qwen3_5/cuda_mtp.zig +++ b/zig/src/families/qwen3_5/cuda_mtp.zig @@ -118,10 +118,10 @@ pub const Mtp = struct { if (!e.g.moe()) return error.NotRouted; const d = try gpa.create(Mtp); errdefer gpa.destroy(d); - d.* = .{ .gpa = gpa, .io = io, .e = e, .w = undefined, .mod = undefined, .dmod = undefined, .fns = undefined, .ring_fns = undefined, .scratch = undefined, .capacity = capacity, .depth = default_depth, .trees = platform.c.getenv("TF_MTP_TREES") != null, .tap = .{@intCast(e.g.layers - 1)}, .taps_in = 0, .hin = 0, .hn = 0, .emb = 0, .en = 0, .h = 0, .r = 0, .x = 0, .qraw = 0, .q = 0, .kraw = 0, .kb = 0, .vb = 0, .att = 0, .xs = 0, .logits = 0, .words = 0, .picks = 0, .lane_state = 0, .lane_k = 0, .lane_v = 0, .anc = 0, .ids = 0, .tok = 0, .staged = undefined, .tab = 0 }; + d.* = .{ .gpa = gpa, .io = io, .e = e, .w = undefined, .mod = undefined, .dmod = undefined, .fns = undefined, .ring_fns = undefined, .scratch = undefined, .capacity = capacity, .depth = default_depth, .trees = try platform.environment.read(bool, "TF_MTP_TREES", false), .tap = .{@intCast(e.g.layers - 1)}, .taps_in = 0, .hin = 0, .hn = 0, .emb = 0, .en = 0, .h = 0, .r = 0, .x = 0, .qraw = 0, .q = 0, .kraw = 0, .kb = 0, .vb = 0, .att = 0, .xs = 0, .logits = 0, .words = 0, .picks = 0, .lane_state = 0, .lane_k = 0, .lane_v = 0, .anc = 0, .ids = 0, .tok = 0, .staged = undefined, .tab = 0 }; d.depth = try platform.environment.read(u32, "TF_MTP_DRAFTS", default_depth); d.depth = @min(@max(d.depth, 1), most_window - 1); - if (platform.c.getenv("TF_MTP_BATCH")) |v| d.batch = !std.mem.eql(u8, std.mem.span(v), "0"); + d.batch = try platform.environment.read(bool, "TF_MTP_BATCH", true); d.mod = try cuda.Module.load(e.d, cuda.kernels.qwen36_mtp); errdefer d.mod.unload(); d.dmod = try cuda.Module.load(e.d, cuda.kernels.qwen35_draft); @@ -160,7 +160,7 @@ pub const Mtp = struct { } pub fn setCost(d: *Mtp, rows: u32, ms: f64) void { - if (platform.c.getenv("TF_TIMING") != null) std.debug.print("[timing] window {d} rows {d:.2} ms (a draft level {d:.2})\n", .{ rows, ms, d.step_ms }); + if (platform.environment.read(bool, "TF_TIMING", false) catch false) std.debug.print("[timing] window {d} rows {d:.2} ms (a draft level {d:.2})\n", .{ rows, ms, d.step_ms }); if (d.n_costs < d.costs.len) { d.costs[d.n_costs] = .{ .width = rows, .ms = ms }; d.n_costs += 1; @@ -474,7 +474,7 @@ pub const Mtp = struct { }; } ctx.held_n = n; - if (platform.c.getenv("TF_TIMING") != null) std.debug.print("[timing] lanes {d} levels {d}\n", .{ n, l.levels() }); + if (platform.environment.read(bool, "TF_TIMING", false) catch false) std.debug.print("[timing] lanes {d} levels {d}\n", .{ n, l.levels() }); } // the Drafter contract @@ -562,3 +562,9 @@ pub const Mtp = struct { /// Acceptance by depth until a stream has its own (the frozen engine's chains kept about three of four). const prior = [_]f64{ 0.7, 0.55, 0.45, 0.4, 0.35, 0.3, 0.3 }; + +test "TF_MTP_TREES: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_MTP_TREES", null)); + try std.testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_MTP_TREES", "1")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_MTP_TREES", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_native.zig b/zig/src/families/qwen3_5/cuda_native.zig index 779806392b4..f813ff3628e 100644 --- a/zig/src/families/qwen3_5/cuda_native.zig +++ b/zig/src/families/qwen3_5/cuda_native.zig @@ -28,7 +28,6 @@ pub const round_timing = @import("cuda_round_timing.zig"); pub const vision = @import("cuda_vision.zig"); pub const slide = @import("cuda_slide.zig"); pub const linked = slide.linked; - pub const model_type = "qwen3_5"; pub const formats: []const []const u8 = &.{ "mlx-q4g64", "exl3" }; pub const default_context: i64 = 32768; @@ -177,6 +176,7 @@ pub fn open(gpa: std.mem.Allocator, io: std.Io, ctx: *const cuda.Context, dir: [ pub fn openLanes(gpa: std.mem.Allocator, io: std.Io, ctx: *const cuda.Context, dir: []const u8, kernels: ?[]const u8, o: Options) !Loaded { if (kernels != null) return error.QwenHasNoCapturedKernels; if (o.slide and o.kv8) return error.UnsupportedLearningFormat; + try @import("cuda_sm110_open.zig").check(gpa, io, ctx, o); const page_tokens = try pages_mod.paging(); const engine_paged = page_tokens > 0 and pages_mod.pagedOnly(); const page_test = try cache_mod.pageTest(); diff --git a/zig/src/families/qwen3_5/cuda_native_explain.zig b/zig/src/families/qwen3_5/cuda_native_explain.zig index 9956b2ef58a..bb07d7c66a7 100644 --- a/zig/src/families/qwen3_5/cuda_native_explain.zig +++ b/zig/src/families/qwen3_5/cuda_native_explain.zig @@ -1,5 +1,6 @@ //! The CUDA Qwen3.5 family's refusals in words: its open's, then a running engine's requests'. const decide = @import("cuda_decide.zig"); +const sm110_modes = @import("cuda_sm110_modes.zig"); /// A request this engine refuses, in words, or with no engine (null) its open; null: none of its own. pub fn explain(ctx: ?*anyopaque, err: anyerror) ?[]const u8 { @@ -13,7 +14,7 @@ pub fn explain(ctx: ?*anyopaque, err: anyerror) ?[]const u8 { error.QwenYarnNoLearner => "--slide: the learner's attention ropes without YaRN; serve without --slide, or without --rope-yarn and a YaRN config", error.BadQwenKvPages => "TF_QWEN_KV_PAGES takes the positions a page holds (a whole number; 0 or unset: a window each)", error.UnsupportedQwenVision => "--vision: this checkpoint's image tower or text M-RoPE is not one the CUDA engine reads", - else => null, + else => sm110_modes.explain(err), }; return switch (err) { error.InvalidQwenPrompt => "the prompt and its reply exceed this server's context window: shorten it or lower max_tokens", diff --git a/zig/src/families/qwen3_5/cuda_pages.zig b/zig/src/families/qwen3_5/cuda_pages.zig index cc50afddd88..100ccd0557c 100644 --- a/zig/src/families/qwen3_5/cuda_pages.zig +++ b/zig/src/families/qwen3_5/cuda_pages.zig @@ -4,6 +4,7 @@ const cuda = @import("cuda"); const kv = @import("core").kv_pool; const engine = @import("cuda_engine.zig"); const caches = @import("cuda_cache.zig"); +const platform = @import("sys"); const Engine = engine.Engine; const Cache = caches.Cache; @@ -193,8 +194,7 @@ pub const Pages = struct { /// TF_QWEN_POOL_LOG=1: the pool's census after a prompt pass (the agent replay's memory readings). pub fn log(p: *const Pages, prompt: usize, cached: usize) void { - const v = std.c.getenv("TF_QWEN_POOL_LOG") orelse return; - if (!std.mem.eql(u8, std.mem.span(v), "1")) return; + if (!(platform.environment.read(bool, "TF_QWEN_POOL_LOG", false) catch false)) return; const n = p.pool.census(); std.log.info("qwen3_5 pool after a prompt of {d} (resumed at {d}): {d} pages leased, {d} held by the prompt cache, {d} free of {d}", .{ prompt, cached, n.leased, n.kept, n.free, n.total }); } @@ -277,3 +277,9 @@ test "Qwen pages default: TF_QWEN_KV_PAGES_ALL unset keeps the engine's stream a try std.testing.expect(pagedOnlyOf("1")); for ([_][]const u8{ "0", "", "true", "01", " 1 " }) |v| try std.testing.expect(!pagedOnlyOf(v)); } + +test "TF_QWEN_POOL_LOG: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_QWEN_POOL_LOG", null)); + try std.testing.expectEqual(@as(?u64, 1), try platform.environment.parse("TF_QWEN_POOL_LOG", "1")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_QWEN_POOL_LOG", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_pocket.zig b/zig/src/families/qwen3_5/cuda_pocket.zig index e52074f4f71..5fc87cc2515 100644 --- a/zig/src/families/qwen3_5/cuda_pocket.zig +++ b/zig/src/families/qwen3_5/cuda_pocket.zig @@ -2,6 +2,7 @@ const std = @import("std"); const cuda = @import("cuda"); const to = @import("cuda_train_ops.zig"); +const platform = @import("sys"); /// A layer's neurons on the device: fp32 [cap, hidden] gate rows, up rows and outputs; the first `used` live. pub const Rows = struct { gate: cuda.DeviceBuffer, up: cuda.DeviceBuffer, down: cuda.DeviceBuffer, cap: usize, used: usize = 0 }; @@ -117,10 +118,10 @@ pub const Pockets = struct { var learned: usize = 0; var off: std.ArrayList([2]usize) = .empty; defer off.deinit(p.gpa); - if (@import("sys").c.getenv("TF_Q27_POCKET_OFF")) |list| { - const all = std.mem.eql(u8, std.mem.span(list), "all"); + if (try platform.environment.path("TF_Q27_POCKET_OFF", platform.environment.Process.get(.{}, "TF_Q27_POCKET_OFF"))) |list| { + const all = std.mem.eql(u8, list, "all"); if (all) for (host, 0..) |slot, l| if (slot) |h| for (0..h.n) |j| try off.append(p.gpa, .{ l, j }); - var it = std.mem.tokenizeAny(u8, if (all) "" else std.mem.span(list), ", "); + var it = std.mem.tokenizeAny(u8, if (all) "" else list, ", "); while (it.next()) |pair| { const c = std.mem.indexOfScalar(u8, pair, ':') orelse return error.UnexpectedTensor; try off.append(p.gpa, .{ try std.fmt.parseInt(usize, pair[0..c], 10), try std.fmt.parseInt(usize, pair[c + 1 ..], 10) }); @@ -209,3 +210,10 @@ fn staged(d: *const cuda.Driver, values: []const f32) !cuda.DeviceBuffer { try d.check(d.api.cuMemcpyHtoD_v2(out.ptr, host.bytes.ptr, bytes.len), "pocket staged upload"); return out; } + +test "TF_Q27_POCKET_OFF: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_Q27_POCKET_OFF", null)); + try std.testing.expectEqual(@as(u64, 0), (try platform.environment.parse("TF_Q27_POCKET_OFF", "all")).?); + try std.testing.expectEqual(@as(u64, 0), (try platform.environment.parse("TF_Q27_POCKET_OFF", "1:2")).?); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_Q27_POCKET_OFF", "no\ncontrol")); +} diff --git a/zig/src/families/qwen3_5/cuda_request_starts_test.zig b/zig/src/families/qwen3_5/cuda_request_starts_test.zig index 430a625a1fb..b20329b0a89 100644 --- a/zig/src/families/qwen3_5/cuda_request_starts_test.zig +++ b/zig/src/families/qwen3_5/cuda_request_starts_test.zig @@ -38,7 +38,8 @@ test "request starts: shared KV refuses at actual dense and MoE startup before l try put("TF_QWEN_REQUEST_STARTS", "1"); try put("TF_QWEN_KV_SHARE", "32"); try put("TF_QWEN_KV_PAGES", "256"); - var ctx: cuda.Context = undefined; + var d = @import("cuda_sm110_open_test.zig").driver(121); + const ctx: cuda.Context = .{ .d = &d, .device = 0, .handle = null }; inline for (.{ native, moe }) |F| { try t.expectError(error.QwenRequestStartsWithSharedKv, F.open(t.allocator, t.io, &ctx, "missing-request-starts-checkpoint", null, .{ .context = 8192, .drafts = false })); const reason = F.explain(null, error.QwenRequestStartsWithSharedKv) orelse return error.MissingNamedRefusal; diff --git a/zig/src/families/qwen3_5/cuda_round_timing.zig b/zig/src/families/qwen3_5/cuda_round_timing.zig index 05fe0226236..8354515bdc9 100644 --- a/zig/src/families/qwen3_5/cuda_round_timing.zig +++ b/zig/src/families/qwen3_5/cuda_round_timing.zig @@ -1,6 +1,7 @@ //! Enabled-only numeric frame receipts join actual CUDA forward buckets to the shared core's accepted paths. const std = @import("std"); const be = @import("lanes").backend; +const platform = @import("sys"); pub const Shape = @import("cuda_shapes.zig").Shape; pub const Trace = struct { const Frame = struct { first: usize, windows: usize, offered: usize, bucket: usize, ms: f64 }; @@ -8,7 +9,7 @@ pub const Trace = struct { len: usize = 0, pub fn enabled() bool { - return std.c.getenv("TF_TIMING") != null; + return platform.environment.read(bool, "TF_TIMING", false) catch false; } pub fn create(a: std.mem.Allocator, on: bool) !?*Trace { diff --git a/zig/src/families/qwen3_5/cuda_sm110_modes.zig b/zig/src/families/qwen3_5/cuda_sm110_modes.zig new file mode 100644 index 00000000000..ff88c918e63 --- /dev/null +++ b/zig/src/families/qwen3_5/cuda_sm110_modes.zig @@ -0,0 +1,133 @@ +//! SM110's Qwen development build serves the measured default path only. +const std = @import("std"); +const cuda = @import("cuda"); +const profile = @import("core").profile; +const environment = @import("sys").environment; + +pub const Modes = struct { + slide: bool = false, + dspine: bool = false, + dspine_window: ?[]const u8 = null, + kv8: bool = false, + prompt_int8: bool = false, + rope_yarn: bool = false, + kv_pages: ?[]const u8 = null, + kv_pages_all: ?[]const u8 = null, + kv_share: ?[]const u8 = null, + request_starts: ?[]const u8 = null, + kv_page_test: ?[]const u8 = null, + keep_late: ?[]const u8 = null, + no_trees: ?[]const u8 = null, + draft_nodes: ?[]const u8 = null, +}; + +pub fn current(kv8: bool, prompt_int8: bool, rope_yarn: bool) Modes { + return .{ + .dspine_window = profile.lookup("TF_DSPINE_WINDOW"), + .kv8 = kv8, + .prompt_int8 = prompt_int8, + .rope_yarn = rope_yarn, + .kv_pages = profile.get(.TF_QWEN_KV_PAGES), + .kv_pages_all = profile.get(.TF_QWEN_KV_PAGES_ALL), + .kv_share = profile.get(.TF_QWEN_KV_SHARE), + .request_starts = profile.get(.TF_QWEN_REQUEST_STARTS), + .kv_page_test = environment.Process.get(.{}, "TF_QWEN_KV_PAGE_TEST"), + .keep_late = environment.Process.get(.{}, "TF_QWEN_KEEP_LATE"), + .no_trees = environment.Process.get(.{}, "TF_NO_TREES"), + .draft_nodes = environment.Process.get(.{}, "TF_DRAFT_NODES"), + }; +} + +pub fn checkDevice(ctx: *const cuda.Context, now: Modes) !void { + if (!needsDevice(now)) return; + try check(try ctx.capability(), now); +} + +pub fn check(sm: u32, modes: Modes) !void { + if (sm != 110) return; + if (modes.slide) return error.QwenSm110SlideUnqualified; + if (modes.dspine) return error.QwenSm110DspineUnqualified; + if (count(modes.dspine_window)) return error.QwenSm110DspineWindowUnqualified; + if (modes.kv8) return error.QwenSm110Fp8KvUnqualified; + if (modes.prompt_int8) return error.QwenSm110Int8PromptUnqualified; + if (modes.rope_yarn) return error.QwenSm110RopeYarnUnqualified; + if (count(modes.kv_pages)) return error.QwenSm110KvPagesUnqualified; + if (one(modes.kv_pages_all)) return error.QwenSm110KvPagesAllUnqualified; + if (count(modes.kv_share)) return error.QwenSm110KvShareUnqualified; + if (one(modes.request_starts)) return error.QwenSm110RequestStartsUnqualified; + if (modes.kv_page_test != null) return error.QwenSm110KvPageTestUnqualified; + if (one(modes.keep_late)) return error.QwenSm110KeepLateUnqualified; + if (modes.no_trees != null) return error.QwenSm110NoTreesUnqualified; + if (modes.draft_nodes != null) return error.QwenSm110DraftNodesUnqualified; +} + +fn count(raw: ?[]const u8) bool { + const v = raw orelse return false; + return (std.fmt.parseInt(usize, v, 10) catch return true) != 0; +} + +fn one(raw: ?[]const u8) bool { + return std.mem.eql(u8, raw orelse return false, "1"); +} + +fn needsDevice(modes: Modes) bool { + return modes.slide or modes.dspine or count(modes.dspine_window) or modes.kv8 or modes.prompt_int8 or modes.rope_yarn or count(modes.kv_pages) or + one(modes.kv_pages_all) or count(modes.kv_share) or one(modes.request_starts) or + modes.kv_page_test != null or one(modes.keep_late) or modes.no_trees != null or modes.draft_nodes != null; +} + +pub fn explain(err: anyerror) ?[]const u8 { + return switch (err) { + error.QwenSm110SlideUnqualified => "--slide is not qualified for Qwen on sm_110; omit it", + error.QwenSm110DspineUnqualified => "DSpine --drafter is not qualified for Qwen on sm_110; use DFlash2", + error.QwenSm110DspineWindowUnqualified => "TF_DSPINE_WINDOW is not qualified for Qwen on sm_110; unset it", + error.QwenSm110Fp8KvUnqualified => "--kv-cache fp8 is not qualified for Qwen on sm_110; use bf16", + error.QwenSm110Int8PromptUnqualified => "--prompt-precision int8 is not qualified for Qwen on sm_110; use bf16", + error.QwenSm110RopeYarnUnqualified => "--rope-yarn is not qualified for Qwen on sm_110; omit it", + error.QwenSm110KvPagesUnqualified => "TF_QWEN_KV_PAGES is not qualified for Qwen on sm_110; unset it or use 0", + error.QwenSm110KvPagesAllUnqualified => "TF_QWEN_KV_PAGES_ALL=1 is not qualified for Qwen on sm_110; unset it", + error.QwenSm110KvShareUnqualified => "TF_QWEN_KV_SHARE is not qualified for Qwen on sm_110; unset it or use 0", + error.QwenSm110RequestStartsUnqualified => "TF_QWEN_REQUEST_STARTS=1 is not qualified for Qwen on sm_110; unset it", + error.QwenSm110KvPageTestUnqualified => "TF_QWEN_KV_PAGE_TEST is not qualified for Qwen on sm_110; unset it", + error.QwenSm110KeepLateUnqualified => "TF_QWEN_KEEP_LATE=1 is not qualified for Qwen on sm_110; unset it", + error.QwenSm110NoTreesUnqualified => "TF_NO_TREES is not qualified for Qwen on sm_110; unset it", + error.QwenSm110DraftNodesUnqualified => "TF_DRAFT_NODES is not qualified for Qwen on sm_110; unset it", + else => null, + }; +} + +test "SM110 accepts defaults, including explicit off values; other SMs retain every mode" { + try check(110, .{}); + try check(110, .{ .kv_pages = "0", .kv_share = "0", .kv_pages_all = "0", .request_starts = "0", .keep_late = "0" }); + try check(121, .{ .kv8 = true, .prompt_int8 = true, .kv_pages = "256", .keep_late = "1" }); + try std.testing.expect(!needsDevice(.{ .kv_pages = "0", .kv_share = "0", .kv_pages_all = "0", .request_starts = "0", .keep_late = "0" })); + try std.testing.expect(needsDevice(.{ .kv8 = true })); +} + +test "SM110 refuses every unqualified Qwen serving mode with an explanation" { + const cases = [_]struct { modes: Modes, err: anyerror }{ + .{ .modes = .{ .slide = true }, .err = error.QwenSm110SlideUnqualified }, + .{ .modes = .{ .dspine = true }, .err = error.QwenSm110DspineUnqualified }, + .{ .modes = .{ .dspine_window = "256" }, .err = error.QwenSm110DspineWindowUnqualified }, + .{ .modes = .{ .kv8 = true }, .err = error.QwenSm110Fp8KvUnqualified }, + .{ .modes = .{ .prompt_int8 = true }, .err = error.QwenSm110Int8PromptUnqualified }, + .{ .modes = .{ .rope_yarn = true }, .err = error.QwenSm110RopeYarnUnqualified }, + .{ .modes = .{ .kv_pages = "256" }, .err = error.QwenSm110KvPagesUnqualified }, + .{ .modes = .{ .kv_pages_all = "1" }, .err = error.QwenSm110KvPagesAllUnqualified }, + .{ .modes = .{ .kv_share = "32" }, .err = error.QwenSm110KvShareUnqualified }, + .{ .modes = .{ .request_starts = "1" }, .err = error.QwenSm110RequestStartsUnqualified }, + .{ .modes = .{ .kv_page_test = "256" }, .err = error.QwenSm110KvPageTestUnqualified }, + .{ .modes = .{ .keep_late = "1" }, .err = error.QwenSm110KeepLateUnqualified }, + .{ .modes = .{ .no_trees = "1" }, .err = error.QwenSm110NoTreesUnqualified }, + .{ .modes = .{ .draft_nodes = "16" }, .err = error.QwenSm110DraftNodesUnqualified }, + }; + for (cases) |case| { + try std.testing.expectError(case.err, check(110, case.modes)); + try std.testing.expect(std.mem.indexOf(u8, explain(case.err).?, "sm_110") != null); + } + try std.testing.expectError(error.QwenSm110NoTreesUnqualified, check(110, .{ .no_trees = "0" })); +} + +test { + _ = @import("cuda_sm110_open_test.zig"); +} diff --git a/zig/src/families/qwen3_5/cuda_sm110_open.zig b/zig/src/families/qwen3_5/cuda_sm110_open.zig new file mode 100644 index 00000000000..b4c5f0d065a --- /dev/null +++ b/zig/src/families/qwen3_5/cuda_sm110_open.zig @@ -0,0 +1,20 @@ +//! Refuse unqualified SM110 modes before Qwen's generic paging checks or weight loading. +const std = @import("std"); +const cuda = @import("cuda"); +const native = @import("cuda_native.zig"); +const modes = @import("cuda_sm110_modes.zig"); + +pub fn check(gpa: std.mem.Allocator, io: std.Io, ctx: *const cuda.Context, o: native.Options) !void { + var now = modes.current(o.kv8, o.prompt_int8, o.rope_yarn != null); + now.slide = o.slide; + try modes.checkDevice(ctx, now); + const dir = o.drafter orelse return; + if (try ctx.capability() != 110) return; + const path = try std.fs.path.join(gpa, &.{ dir, "config.json" }); + defer gpa.free(path); + const bytes = try std.Io.Dir.cwd().readFileAlloc(io, path, gpa, .limited(1 << 20)); + defer gpa.free(bytes); + const doc = try std.json.parseFromSlice(std.json.Value, gpa, bytes, .{}); + defer doc.deinit(); + try modes.check(110, .{ .dspine = @import("core").dspine.declared(doc.value) }); +} diff --git a/zig/src/families/qwen3_5/cuda_sm110_open_test.zig b/zig/src/families/qwen3_5/cuda_sm110_open_test.zig new file mode 100644 index 00000000000..a2927eb8f27 --- /dev/null +++ b/zig/src/families/qwen3_5/cuda_sm110_open_test.zig @@ -0,0 +1,44 @@ +//! Startup admission with a capability-only driver; reaching weights is a test failure. +const std = @import("std"); +const cuda = @import("cuda"); +const native = @import("cuda_native.zig"); +const t = std.testing; +const env = @import("sys").env; +var sm: u32 = 121; +fn attribute(out: *c_int, a: cuda.abi.DeviceAttribute, _: cuda.abi.Device) callconv(.c) cuda.abi.Result { + out.* = @intCast(if (a == .compute_capability_major) sm / 10 else sm % 10); + return 0; +} +pub fn driver(capability: u32) cuda.Driver { + sm = capability; + var d: cuda.Driver = .{ .lib = undefined, .api = undefined }; + d.api.cuDeviceGetAttribute = attribute; + return d; +} + +test "SM110 startup refuses sharing without pages before the generic page requirement" { + var d = driver(110); + const ctx: cuda.Context = .{ .d = &d, .device = 0, .handle = null }; + _ = env.setenv("TF_QWEN_KV_SHARE", "32", 1); + defer _ = env.unsetenv("TF_QWEN_KV_SHARE"); + try t.expectError(error.QwenSm110KvShareUnqualified, native.openLanes(t.allocator, t.io, &ctx, "missing", null, .{ .context = 8192, .drafts = false })); +} + +test "SM110 startup refuses slide and DSpine while admitting the DFlash2 declaration" { + var d = driver(110); + const ctx: cuda.Context = .{ .d = &d, .device = 0, .handle = null }; + const guard = @import("cuda_sm110_open.zig"); + try t.expectError(error.QwenSm110SlideUnqualified, guard.check(t.allocator, t.io, &ctx, .{ .context = 8192, .drafts = false, .slide = true })); + var tmp = t.tmpDir(.{}); + defer tmp.cleanup(); + const dir = try tmp.dir.realPathFileAlloc(t.io, ".", t.allocator); + defer t.allocator.free(dir); + const o: native.Options = .{ .context = 8192, .drafts = true, .drafter = dir }; + try tmp.dir.writeFile(t.io, .{ .sub_path = "config.json", .data = "{\"dflash_config\":{}}" }); + try guard.check(t.allocator, t.io, &ctx, o); + try tmp.dir.writeFile(t.io, .{ .sub_path = "config.json", .data = "{\"dflash_config\":{\"selected_prefix_code_bridge\":{}}}" }); + try t.expectError(error.QwenSm110DspineUnqualified, guard.check(t.allocator, t.io, &ctx, o)); + _ = env.setenv("TF_DSPINE_WINDOW", "256", 1); + defer _ = env.unsetenv("TF_DSPINE_WINDOW"); + try t.expectError(error.QwenSm110DspineWindowUnqualified, guard.check(t.allocator, t.io, &ctx, o)); +} diff --git a/zig/src/families/qwen3_5/cuda_train.zig b/zig/src/families/qwen3_5/cuda_train.zig index 8844e195865..66efea9e84c 100644 --- a/zig/src/families/qwen3_5/cuda_train.zig +++ b/zig/src/families/qwen3_5/cuda_train.zig @@ -1,5 +1,6 @@ //! The 27B's Living Weights trainer: packed passes through Forward.chunks and the loss back to the lowest nudged layer. const std = @import("std"); +const platform = @import("sys"); const cuda = @import("cuda"); const core = @import("core"); const living = @import("living"); @@ -247,7 +248,7 @@ pub const Trainer = struct { /// The rows the backward still needs, each nudged sequence's from its first nudged row on (null: every row). fn tailRows(t: *Trainer, rows: usize) ?to.Tail { if (!t.k.wide) return null; - if (@import("sys").c.getenv("TF_Q27_TAIL")) |v| if (std.mem.eql(u8, std.mem.span(v), "off")) return null; + if ((platform.environment.read(u64, "TF_Q27_TAIL", 1) catch 1) == 0) return null; const list = t.tails.slice(i32, pack_rows); const mask = t.tails.host.bytes[pack_rows * 4 ..][0..pack_rows]; @memset(mask[0..rows], 0); @@ -564,3 +565,9 @@ test "Save recovery: dense constructor pending work drains or exits before any o if (!cuda.kernels.available) return error.SkipZigTest; try @import("cuda_train_init_test.zig").pendingFailure(Trainer.initWithWeights); } + +test "TF_Q27_TAIL: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_Q27_TAIL", null)); + try std.testing.expectEqual(@as(?u64, 0), try platform.environment.parse("TF_Q27_TAIL", "off")); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_Q27_TAIL", "on")); +} diff --git a/zig/src/families/qwen3_5/cuda_train_ops.zig b/zig/src/families/qwen3_5/cuda_train_ops.zig index 1dc9d43ec9b..f56479d35d9 100644 --- a/zig/src/families/qwen3_5/cuda_train_ops.zig +++ b/zig/src/families/qwen3_5/cuda_train_ops.zig @@ -1,6 +1,7 @@ //! The 27B's input gradients for Living Weights as calls on one stream. const std = @import("std"); const cuda = @import("cuda"); +const platform = @import("sys"); /// A 4-bit matrix [n, k] in MLX's layout: words [n, k / 8], bf16 scales and biases [n, k / group]. pub const Q4 = struct { w: u64, s: u64, b: u64, n: usize, k: usize, group: usize = 64 }; @@ -51,7 +52,7 @@ pub const Kernels = struct { pub fn load(d: *const cuda.Driver) !Kernels { if (!cuda.kernels.available) return error.BuiltWithoutKernels; - const narrow = if (@import("sys").c.getenv("TF_Q27_GEMM")) |v| std.mem.eql(u8, std.mem.span(v), "narrow") else false; + const narrow = (try platform.environment.read(?u64, "TF_Q27_GEMM", null)) != null; var k: Kernels = .{ .own = try cuda.Module.load(d, cuda.kernels.qwen27_train), .attn = undefined, .train = undefined, .fo = undefined, .fa = undefined, .ft = undefined, .wide = !narrow }; errdefer k.own.unload(); k.attn = try cuda.Module.load(d, cuda.kernels.attn_train); @@ -418,3 +419,11 @@ test "splits stay within the K rows and fill small products" { try std.testing.expect(splitsFor(16, 5120, 248320) > 1); try std.testing.expectEqual(@as(usize, 1), splitsFor(16, 5120, 512)); } + +test "TF_Q27_GEMM: the platform parses unset, valid and malformed text" { + try std.testing.expectEqual(@as(?u64, null), try platform.environment.parse("TF_Q27_GEMM", null)); + try std.testing.expectEqual(@as(?u64, 0), try platform.environment.parse("TF_Q27_GEMM", "narrow")); + try std.testing.expectEqual(@as(?u64, null), try platform.environment.value(?u64, "TF_Q27_GEMM", null, null)); + try std.testing.expect((try platform.environment.value(?u64, "TF_Q27_GEMM", "narrow", null)) != null); + try std.testing.expectError(error.InvalidEnvironment, platform.environment.parse("TF_Q27_GEMM", "wide")); +} diff --git a/zig/src/hip/admission.zig b/zig/src/hip/admission.zig index e3a0946d4bb..dd612d46e85 100644 --- a/zig/src/hip/admission.zig +++ b/zig/src/hip/admission.zig @@ -55,10 +55,7 @@ pub fn budget(gpa: Allocator, io: std.Io, ctx: Context) !Pool { const integrated = (try ctx.attribute(.integrated)) != 0; const card = try ctx.memInfo(); const own: MemInfo = .{ .total = card.total, .available = card.free }; - const env: Env = .{ - .reserve = getenv("TENSORFOLD_MEMORY_RESERVE_GIB"), - .limit = getenv("TENSORFOLD_HIP_MEMORY_LIMIT_GB"), - }; + const env = envTexts(); if (windows) { // WDDM reports the whole budget through the driver: no host text, no dedicated-VRAM file. const p = try plan(false, own, null, null, env); @@ -79,6 +76,12 @@ pub const Source = enum { card, carve_out, host }; /// The reserve and cap variables' text, unset as null. pub const Env = struct { reserve: ?[]const u8 = null, limit: ?[]const u8 = null }; +/// The two settings' texts, registered in platform/environment.zig; `plan` refuses them against the runtime bounds. +pub fn envTexts() Env { + const e = @import("sys").environment; + return .{ .reserve = e.rawText("TENSORFOLD_MEMORY_RESERVE_GIB"), .limit = e.rawText("TENSORFOLD_HIP_MEMORY_LIMIT_GB") }; +} + pub const Plan = struct { pool: Pool, source: Source }; pub const PlanError = error{ HostMemoryUnavailable, BadReserve, BadLimit }; @@ -173,10 +176,6 @@ fn announce(p: Plan) void { std.log.info("HIP memory budget from {s}: {d:.1} of {d:.1} GiB free, {d:.1} GiB reserve", .{ what, f, t, r }); } -fn getenv(name: [:0]const u8) ?[]const u8 { - return std.mem.span(std.c.getenv(name) orelse return null); -} - /// A /proc file's text, streamed: procfs reports size 0, and a positional read (readFileAlloc) stops there. pub fn procText(a: Allocator, io: std.Io, path: []const u8) ?[]u8 { var file = std.Io.Dir.cwd().openFile(io, path, .{}) catch return null; @@ -253,3 +252,12 @@ test "a carve-out needs the card's total to be the dedicated VRAM: not past it, const shared = plan(true, .{ .total = 60 * g, .available = 59 * g }, big, g / 2, .{ .reserve = "1" }); try std.testing.expectError(error.BadReserve, shared); // shared memory keeps its floor of 2 } + +test "HIP memory settings: the platform parses unset, valid and malformed text" { + const e = @import("sys").environment; + for ([_][:0]const u8{ "TENSORFOLD_MEMORY_RESERVE_GIB", "TENSORFOLD_HIP_MEMORY_LIMIT_GB" }) |name| { + try std.testing.expectEqual(@as(f64, 7), try e.value(f64, name, null, 7)); + try std.testing.expectEqual(@as(f64, 2.5), try e.value(f64, name, "2.5", 7)); + try std.testing.expectError(error.InvalidEnvironment, e.check(name, "none")); + } +} diff --git a/zig/src/hip/kernel_tests.zig b/zig/src/hip/kernel_tests.zig index 11c8b4329f6..d8573084e81 100644 --- a/zig/src/hip/kernel_tests.zig +++ b/zig/src/hip/kernel_tests.zig @@ -58,6 +58,7 @@ test { _ = @import("kernel_tests/stats.zig"); _ = @import("kernel_tests/tap.zig"); _ = @import("kernel_tests/draft.zig"); + _ = @import("kernel_tests/exl3.zig"); _ = @import("kernel_tests/ops.zig"); _ = @import("kernel_tests/conv_split.zig"); _ = @import("kernel_tests/dense.zig"); diff --git a/zig/src/hip/kernel_tests/exl3.zig b/zig/src/hip/kernel_tests/exl3.zig new file mode 100644 index 00000000000..51695281b08 --- /dev/null +++ b/zig/src/hip/kernel_tests/exl3.zig @@ -0,0 +1,295 @@ +//! EXL3's decode-row kernels: weights decoded bit for bit, a row's bits in any window, the rotation by its fp32 steps. +const std = @import("std"); +const core = @import("core"); +const rig = @import("rig.zig"); +const exl3 = @import("../launches/exl3.zig"); +const fmt = core.exl3_format; +const Rig = rig.Rig; +const gpa = rig.gpa; +const at = rig.at; + +const had: f32 = 0.08838834764831845; + +/// The kernels' unscaled 128-point butterfly in fp32: stages 1 to 64 apart, a + b low and a - b high. +fn fwht(v: *[128]f32) void { + var d: usize = 1; + while (d < 128) : (d *= 2) { + var base: usize = 0; + while (base < 128) : (base += 2 * d) for (0..d) |j| { + const a = v[base + j]; + const b = v[base + j + d]; + v[base + j] = a + b; + v[base + j + d] = a - b; + }; + } +} + +/// Random trellis words in the checkpoint's layout, [K/16, N/16, tile words]. +fn randomTrellis(rng: *rig.Rng, w: fmt.Width, k: usize, n: usize) ![]i16 { + const tr = try gpa.alloc(i16, (k / 16) * (n / 16) * w.tileWords()); + for (tr) |*v| v.* = @bitCast(@as(u16, @truncate(rng.next()))); + return tr; +} + +/// A search for a tile's stream whose 256 values all decode above zero, or all below: a value's bits at a time. +const Search = struct { + rng: *rig.Rng, + neg: bool, + /// Stream bits a value adds (a whole width's half-bits), and the ring's length. + g: usize, + ring: usize, + bits: [128 * 16]u1 = undefined, + budget: usize = 0, + + /// The 16-bit window ending at `end` decodes to a value of the wanted sign. + fn signed(s: *const Search, end: usize) bool { + var state: u16 = 0; + for (0..16) |b| state = (state << 1) | s.bits[(end + s.ring - 16 + b) % s.ring]; + const v = fmt.codebookValue(.mul1, state); + return if (s.neg) v < 0 else v > 0; + } + + fn from(s: *Search, p: usize) bool { + if (s.budget == 0) return false; + s.budget -= 1; + // the windows that wrap past the stream's start are whole once every bit is set + if (p == 256) { + var q: usize = 0; + while ((q + 1) * s.g < 16) : (q += 1) if (!s.signed((q + 1) * s.g)) return false; + return true; + } + const options = @as(usize, 1) << @intCast(s.g); + const first: usize = @intCast(s.rng.next() % options); + for (0..options) |i| { + const v = (first + i) % options; + for (0..s.g) |b| s.bits[p * s.g + b] = @intCast((v >> @intCast(s.g - 1 - b)) & 1); + const end = (p + 1) * s.g; + if ((end < 16 or s.signed(end)) and s.from(p + 1)) return true; + } + return false; + } +}; + +/// A tile's words (checkpoint order: MSB-first bits in little-endian int16 pairs) whose values all have one sign. +fn signedTile(rng: *rig.Rng, w: fmt.Width, neg: bool, words: []i16) void { + var s: Search = .{ .rng = rng, .neg = neg, .g = w.halves / 2, .ring = 128 * @as(usize, w.halves) }; + while (true) { + s.budget = 100_000; + if (s.from(0)) break; + } + var word: [64]u32 = @splat(0); + for (0..s.ring) |i| word[i / 32] |= @as(u32, s.bits[i]) << @intCast(31 - i % 32); + for (0..s.ring / 32) |j| { + words[2 * j] = @bitCast(@as(u16, @truncate(word[j]))); + words[2 * j + 1] = @bitCast(@as(u16, @truncate(word[j] >> 16))); + } +} + +/// [K/16, N/16, tile words] from a pool of 16 one-signed tiles, a tile picked by its position. +fn signedTrellis(rng: *rig.Rng, w: fmt.Width, neg: bool, k: usize, n: usize) ![]i16 { + const words = w.tileWords(); + var pool: [16 * 128]i16 = undefined; + for (0..16) |i| signedTile(rng, w, neg, pool[i * words ..][0..words]); + const tr = try gpa.alloc(i16, (k / 16) * (n / 16) * words); + for (0..k / 16) |kt| for (0..n / 16) |nt| { + const i = (kt * 7 + nt * 13) % 16; + @memcpy(tr[(kt * (n / 16) + nt) * words ..][0..words], pool[i * words ..][0..words]); + }; + return tr; +} + +/// The same tiles as 128-column strips: strip nb holds its k steps of eight tiles each. +fn strips(w: fmt.Width, stored: []const i16, k: usize, n: usize) ![]i16 { + const words = w.tileWords(); + const out = try gpa.alloc(i16, stored.len); + for (0..n / 128) |nb| for (0..k / 16) |kt| for (0..8) |t| { + const from = (kt * (n / 16) + nb * 8 + t) * words; + const to = ((nb * (k / 16) + kt) * 8 + t) * words; + @memcpy(out[to..][0..words], stored[from..][0..words]); + }; + return out; +} + +/// The checkpoint layout's strides in 32-bit words, or the strips layout's. +fn layout(w: fmt.Width, k: usize, n: usize, as_strips: bool) [2]u64 { + const tw: u64 = w.tileWords() / 2; + return if (as_strips) .{ 8 * tw, (k / 16) * 8 * tw } else .{ (n / 16) * tw, 8 * tw }; +} + +fn randomHalves(rng: *rig.Rng, n: usize) ![]u16 { + const out = try gpa.alloc(u16, n); + for (out) |*v| v.* = rig.f16Bits(rng.unit()); + return out; +} + +// one-signed tiles, so each zero of the identity enters dot2 as +0: x +0 for positive weights, -0 for negative ones +test "the linear decodes every width's weights as exl3_format does, bit for bit, at 4 and 8 waves and both layouts" { + const t = try Rig.open(1 << 20); + defer t.close(); + var rng: rig.Rng = .{ .state = 0xE3D1 }; + // (k, n): 4 waves on the checkpoint layout, 8 waves on strips + const sizes = [_][3]usize{ .{ 256, 256, 0 }, .{ 1024, 8192, 1 } }; + for (sizes) |sz| { + const k = sz[0]; + const n = sz[1]; + try std.testing.expectEqual(@as(u32, if (sz[2] == 1) 8 else 4), exl3.waves(k, n)); + // xh = I: row r is 1.0 at k = r, so y's row r is W's row r, rotated by 128 columns + const xh = try gpa.alloc(u16, k * k); + defer gpa.free(xh); + const ones = try gpa.alloc(u16, n); + defer gpa.free(ones); + @memset(ones, 0x3c00); + var dx = try t.alloc(k * k * 2); + defer dx.free(); + var dsvh = try t.upload(ones); + defer dsvh.free(); + var dy = try t.alloc(k * n * 4); + defer dy.free(); + const wq = try gpa.alloc(f16, k * n); + defer gpa.free(wq); + for (exl3.widths) |halves| for ([_]bool{ false, true }) |neg| { + const w = fmt.Width{ .halves = @intCast(halves) }; + const stored = try signedTrellis(&rng, w, neg, k, n); + defer gpa.free(stored); + fmt.unpack(w, .mul1, stored, k / 16, n / 16, wq); + for (wq) |v| if ((v < 0) != neg) return error.TestUnexpectedResult; + @memset(xh, if (neg) 0x8000 else 0); + for (0..k) |r| xh[r * k + r] = 0x3c00; + try dx.upload(0, std.mem.sliceAsBytes(xh)); + const words = if (sz[2] == 1) try strips(w, stored, k, n) else try gpa.dupe(i16, stored); + defer gpa.free(words); + var dt = try t.upload(words); + defer dt.free(); + const st = layout(w, k, n, sz[2] == 1); + const tr: exl3.Trellis = .{ .words = at(dt), .halves = halves, .stride_k = st[0], .stride_nb = st[1] }; + try exl3.linear(&t.on, at(dx), tr, at(dsvh), at(dy), 0, k, k, n, t.stream.handle); + try t.stream.synchronize(); + const got = try rig.download(f32, dy); + defer gpa.free(got); + for (0..k) |r| for (0..n / 128) |b| { + var v: [128]f32 = undefined; + for (&v, 0..) |*e, q| e.* = wq[r * n + b * 128 + q]; + fwht(&v); + for (v, 0..) |e, q| { + const want: u32 = @bitCast(e * had * 1.0); + const have: u32 = @bitCast(got[r * n + b * 128 + q]); + if (want != have) { + const at_ = .{ halves / 2, if (neg) "-" else "+", k, n, r, b * 128 + q, have, want }; + std.debug.print("{d}-bit {s} k {d} n {d}: row {d} column {d} is {x} where {x}\n", at_); + return error.TestUnexpectedResult; + } + } + }; + }; + } +} + +test "a row's outputs are the same bits alone, in any window and in every pass of 16 rows" { + const t = try Rig.open(1 << 20); + defer t.close(); + var rng: rig.Rng = .{ .state = 0xE3D2 }; + const rows = 64; + for ([_][3]usize{ .{ 512, 256, 6 }, .{ 1024, 8192, 10 } }) |sz| { + const k = sz[0]; + const n = sz[1]; + const w = fmt.Width{ .halves = @intCast(sz[2]) }; + const words = try randomTrellis(&rng, w, k, n); + defer gpa.free(words); + const xh = try randomHalves(&rng, rows * k); + defer gpa.free(xh); + const svh = try randomHalves(&rng, n); + defer gpa.free(svh); + var dt = try t.upload(words); + defer dt.free(); + var dx = try t.upload(xh); + defer dx.free(); + var dsvh = try t.upload(svh); + defer dsvh.free(); + var dall = try t.alloc(rows * n * 4); + defer dall.free(); + var dw = try t.alloc(rows * n * 4); + defer dw.free(); + const st = layout(w, k, n, false); + const tr: exl3.Trellis = .{ .words = at(dt), .halves = w.halves, .stride_k = st[0], .stride_nb = st[1] }; + try exl3.linear(&t.on, at(dx), tr, at(dsvh), at(dall), 0, rows, k, n, t.stream.handle); + try t.stream.synchronize(); + const all = try rig.download(f32, dall); + defer gpa.free(all); + // (first row, rows): alone, the rows path at 2 to 8, its two parts at 9 to 16, and passes past 16 + const windows = [_][2]usize{ + .{ 0, 1 }, .{ 5, 1 }, .{ 63, 1 }, .{ 0, 2 }, .{ 3, 7 }, + .{ 8, 8 }, .{ 9, 9 }, .{ 0, 16 }, .{ 17, 17 }, .{ 40, 24 }, + }; + for (windows) |win| { + try exl3.linear(&t.on, at(dx) + win[0] * k * 2, tr, at(dsvh), at(dw), 0, win[1], k, n, t.stream.handle); + try t.stream.synchronize(); + const got = try rig.download(f32, dw); + defer gpa.free(got); + const want = std.mem.sliceAsBytes(all[win[0] * n ..][0 .. win[1] * n]); + if (std.mem.indexOfDiff(u8, want, std.mem.sliceAsBytes(got[0 .. win[1] * n]))) |i| { + const at_ = .{ k, n, win[0], win[1], i }; + std.debug.print("k {d} n {d}: rows {d}+{d} differ from the 64-row run at byte {d}\n", at_); + return error.TestUnexpectedResult; + } + } + } +} + +test "rot_in rounds the fp32 butterfly of x * suh to fp16 once, from fp32, fp16 and bf16 rows" { + const t = try Rig.open(1 << 20); + defer t.close(); + var rng: rig.Rng = .{ .state = 0xE3D3 }; + // 391,680 roundings over the three kinds, so the rare fp16 output that a 1-ulp fp32 error moves shows up + const k = 2048 + 128; + const rows = 60; + const suh = try randomHalves(&rng, k); + defer gpa.free(suh); + var dsuh = try t.upload(suh); + defer dsuh.free(); + var dxh = try t.alloc(rows * k * 2); + defer dxh.free(); + const xs = try gpa.alloc(f32, rows * k); + defer gpa.free(xs); + for (xs) |*v| v.* = rng.unit() * 3; + for ([_]c_int{ 0, 1, 2 }) |kind| { + const in = try gpa.alloc(u32, rows * k); + defer gpa.free(in); + const vals = try gpa.alloc(f32, rows * k); + defer gpa.free(vals); + for (xs, in, vals) |v, *b, *e| { + b.* = switch (kind) { + 0 => @bitCast(v), + 1 => rig.f16Bits(v), + else => rig.bf16Bits(v), + }; + e.* = switch (kind) { + 0 => v, + 1 => @floatCast(rig.f16Value(@intCast(b.*))), + else => @floatCast(rig.bf16Value(@intCast(b.*))), + }; + } + var dx = if (kind == 0) try t.upload(in) else blk: { + const narrow = try gpa.alloc(u16, rows * k); + defer gpa.free(narrow); + for (narrow, in) |*a, b| a.* = @intCast(b); + break :blk try t.upload(narrow); + }; + defer dx.free(); + try exl3.rotIn(&t.on, at(dx), kind, at(dsuh), at(dxh), rows, k, t.stream.handle); + try t.stream.synchronize(); + const got = try rig.download(u16, dxh); + defer gpa.free(got); + for (0..rows) |r| for (0..k / 128) |b| { + var v: [128]f32 = undefined; + for (&v, 0..) |*e, q| { + const sc: f32 = @floatCast(rig.f16Value(suh[b * 128 + q])); + e.* = vals[r * k + b * 128 + q] * sc; + } + fwht(&v); + for (v, 0..) |e, q| { + const want: u16 = @bitCast(@as(f16, @floatCast(e * had))); + try std.testing.expectEqual(want, got[r * k + b * 128 + q]); + } + }; + } +} diff --git a/zig/src/hip/kernels.zig b/zig/src/hip/kernels.zig index d18bbe616f6..69ce080ebb0 100644 --- a/zig/src/hip/kernels.zig +++ b/zig/src/hip/kernels.zig @@ -19,6 +19,7 @@ pub const Group = enum { lighton_ocr, qwen_vision, draft, + exl3, }; pub const group_count = @typeInfo(Group).@"enum".field_names.len; diff --git a/zig/src/hip/launches.zig b/zig/src/hip/launches.zig index 3ac0f4ee6c1..2bdad452847 100644 --- a/zig/src/hip/launches.zig +++ b/zig/src/hip/launches.zig @@ -47,6 +47,7 @@ const columns = @import("launches/columns.zig"); const vision = @import("launches/vision.zig"); const dense_text = @import("launches/dense_text.zig"); pub const draft = @import("launches/draft.zig"); +pub const exl3 = @import("launches/exl3.zig"); pub const ConvArgs = conv.ConvArgs; pub const PlanArgs = plan.PlanArgs; @@ -110,6 +111,8 @@ pub const Launcher = struct { nemo: nemotron_moe.Fns, /// The DFlash2 drafter's kernels (draft/draft.hip). draft: draft.Fns, + /// EXL3 projections for decode rows (exl3/exl3.hip). + exl3: exl3.Fns, const PlanFns = struct { kv_write: Function, @@ -331,6 +334,7 @@ pub const Launcher = struct { l.sum_partials = try att.function("tf_sum_partials"); l.mamba = try mamba.Fns.load(l.mods[@backingInt(kernels.Group.mamba)]); l.draft = try draft.Fns.load(l.mods[@backingInt(kernels.Group.draft)]); + l.exl3 = try exl3.Fns.load(l.mods[@backingInt(kernels.Group.exl3)]); const tiles = l.mods[@backingInt(kernels.Group.affine_tiles)]; const dot2 = l.mods[@backingInt(kernels.Group.affine_dot2)]; const chip = caps.Caps.of(kernels.arch) orelse return error.Invalid; diff --git a/zig/src/hip/launches/exl3.zig b/zig/src/hip/launches/exl3.zig new file mode 100644 index 00000000000..704bcebbbfe --- /dev/null +++ b/zig/src/hip/launches/exl3.zig @@ -0,0 +1,117 @@ +//! EXL3 projections for decode rows: the input rotation and the trellis linear (exl3/exl3.hip), mul1 codebook. + +const std = @import("std"); +const Launcher = @import("../launches.zig").Launcher; +const Module = @import("../module.zig").Module; +const Function = @import("../module.zig").Function; +const util = @import("util.zig"); +const S = util.S; +const Args = util.Args; +const Error = util.Error; +const dim = util.dim; +const cdiv = util.cdiv; +const invalid = util.invalid; + +/// The trellis widths with a linear (half-bits a weight, 2 to 8 bits), and the waves a block splits K over. +pub const widths = [_]u32{ 4, 6, 8, 10, 12, 16 }; +pub const wave_counts = [_]u32{ 4, 8 }; + +pub const Fns = struct { + rot_in: Function, + linear: [widths.len][wave_counts.len]Function, + + pub fn load(m: Module) Error!Fns { + var f: Fns = .{ .rot_in = try m.function("tf_exl3_rot_in"), .linear = undefined }; + inline for (widths, 0..) |k2, i| inline for (wave_counts, 0..) |wk, j| { + f.linear[i][j] = try m.function(std.fmt.comptimePrint("tf_exl3_linear_k{d}_w{d}", .{ k2, wk })); + }; + return f; + } +}; + +/// The index of a trellis width in `widths`, null for one without a linear. +pub fn widthIndex(halves: u32) ?usize { + return std.mem.indexOfScalar(u32, &widths, halves); +} + +/// Whole 128-wide blocks of K and N and at least one row, each within the kernels' int arguments. +pub fn fits(rows: usize, k: usize, n: usize) bool { + const most: usize = std.math.maxInt(c_int); + if (rows == 0 or k == 0 or n == 0 or rows > most or k > most or n > most) return false; + return k % 128 == 0 and n % 128 == 0; +} + +/// CUDA's dense plan without a K split: 8 waves from 64 column blocks when each wave keeps 8 k tiles, else 4. +pub fn waves(k: usize, n: usize) u32 { + return if (n / 128 >= 64 and k / 16 / 8 >= 8) 8 else 4; +} + +/// The linear's LDS for its waves' sums: 128 floats a wave and row, at most 8 rows. +pub fn sharedBytes(wk: u32, rows: usize) u32 { + return wk * @as(u32, @intCast(@min(rows, 8))) * 128 * 4; +} + +/// xh [rows, k] fp16 = (x * suh) H / sqrt(128) by 128-wide blocks, of x [rows, k] (kind 0 fp32, 1 fp16, 2 bf16). +pub fn rotIn(l: *const Launcher, x: u64, x_kind: c_int, suh: u64, xh: u64, rows: usize, k: usize, s: S) Error!void { + if (!fits(rows, k, 128) or x_kind < 0 or x_kind > 2) return invalid("exl3 rot_in"); + var a: Args = .{}; + try a.add(x); + try a.add(x_kind); + try a.add(suh); + try a.add(xh); + try a.add(@as(c_int, @intCast(k))); + try l.go(l.exl3.rot_in, dim(cdiv(k / 128, 4), rows, 1), dim(128, 1, 1), 0, s, &a); +} + +/// A matrix's trellis words: `halves` a weight, tile (kt, nt) at kt stride_k + nt / 8 stride_nb + nt % 8 tile words. +pub const Trellis = struct { words: u64, halves: u32, stride_k: u64, stride_nb: u64 }; + +/// y [rows, n] (kind 0 fp32, 2 bf16) = (xh @ W) H / sqrt(128) * svh by 128-column blocks, W decoded from `t`. +pub fn linear( + l: *const Launcher, + xh: u64, + t: Trellis, + svh: u64, + y: u64, + y_kind: c_int, + rows: usize, + k: usize, + n: usize, + s: S, +) Error!void { + const wi = widthIndex(t.halves) orelse return invalid("exl3 linear width"); + if (!fits(rows, k, n) or (y_kind != 0 and y_kind != 2)) return invalid("exl3 linear"); + const most: u64 = std.math.maxInt(c_longlong); + if (t.stride_k > most or t.stride_nb > most) return invalid("exl3 linear strides"); + const wk = waves(k, n); + var a: Args = .{}; + try a.add(xh); + try a.add(t.words); + try a.add(@as(c_longlong, @intCast(t.stride_k))); + try a.add(@as(c_longlong, @intCast(t.stride_nb))); + try a.add(svh); + try a.add(y); + try a.add(y_kind); + try a.add(@as(c_int, @intCast(rows))); + try a.add(@as(c_int, @intCast(k))); + try a.add(@as(c_int, @intCast(n))); + const f = l.exl3.linear[wi][@intFromBool(wk == 8)]; + try l.go(f, dim(n / 128, 1, 1), dim(wk * 32, 1, 1), sharedBytes(wk, rows), s, &a); +} + +test "exl3 launches: shapes in whole blocks, CUDA's wave counts, and LDS for at most 8 rows" { + try std.testing.expect(fits(1, 5120, 129280) and fits(128, 512, 128)); + try std.testing.expect(!fits(0, 512, 128) and !fits(1, 640 - 64, 128) and !fits(1, 512, 192) and !fits(1, 0, 128)); + try std.testing.expect(!fits(@as(usize, std.math.maxInt(c_int)) + 1, 512, 128)); + try std.testing.expectEqual(@as(u32, 8), waves(5120, 129280)); + try std.testing.expectEqual(@as(u32, 8), waves(6144, 25600)); + try std.testing.expectEqual(@as(u32, 4), waves(512, 128)); + try std.testing.expectEqual(@as(u32, 4), waves(512, 129280)); + try std.testing.expectEqual(@as(u32, 4), waves(5120, 63 * 128)); + try std.testing.expectEqual(@as(u32, 8), waves(1024, 64 * 128)); + try std.testing.expectEqual(@as(u32, 4), waves(1024 - 128, 64 * 128)); + try std.testing.expectEqual(@as(u32, 4 * 128 * 4), sharedBytes(4, 1)); + try std.testing.expectEqual(@as(u32, 8 * 8 * 128 * 4), sharedBytes(8, 64)); + try std.testing.expectEqual(@as(?usize, 5), widthIndex(16)); + try std.testing.expectEqual(@as(?usize, null), widthIndex(14)); +} diff --git a/zig/src/hip/moe.zig b/zig/src/hip/moe.zig index 1f9166fa718..5ead1118201 100644 --- a/zig/src/hip/moe.zig +++ b/zig/src/hip/moe.zig @@ -55,6 +55,11 @@ pub fn bucket(rows: usize) usize { return @as(usize, 1) << @intCast(@max(4, bits)); } +/// Plan rows for `rows` real rows: exact on explicit exact plans or RDNA3.5 lane verify rounds, else bucket(rows). +pub fn planRows(o: Ops, exact: bool, rows: usize) usize { + return if (exact or (o.window and o.l.affine.caps.generation == .rdna3_5)) rows else bucket(rows); +} + /// max_items(pairs, experts, min(TILE, LANE_ROWS)): an item a used expert plus one a tile of pairs past its first. pub fn capacity(pairs: usize, experts: usize) usize { return @min(pairs, experts) + pairs / @min(TILE, LANE_ROWS); @@ -81,7 +86,7 @@ pub fn run(o: Ops, kind: Kind, r: Routed, x: Tensor, rows: usize, prefill: bool) _ = prefill; // the affine experts' arithmetic does not depend on it (the plan's tile comes from tile_for) const ex = r.experts; const slots = r.top_k + 1; - const size = if (r.exact) rows else bucket(rows); + const size = planRows(o, r.exact, rows); const pairs = rows * slots; const cap = capacity(size * slots, r.rows); const logits = try o.arena.of(f32, rows * r.rows); @@ -143,7 +148,7 @@ pub const Parts = struct { y: u64, wts: u64, slots: usize }; pub fn parts(o: Ops, kind: Kind, r: Routed, x: Tensor, rows: usize) ops.Error!Parts { std.debug.assert(r.experts.shared == null); const slots = r.top_k + 1; - const size = if (r.exact) rows else bucket(rows); + const size = planRows(o, r.exact, rows); const cap = capacity(size * slots, r.rows); const logits = try o.arena.of(f32, rows * r.rows); const pick = try o.arena.of(i32, size * slots); @@ -205,3 +210,20 @@ test "the routed products take the decode tile below 64 rows and in a lane round try std.testing.expectEqual(@as(usize, LANE_ROWS), tileFor(round, BLOCK_FROM)); try std.testing.expectEqual(@as(usize, LANE_ROWS), tileFor(round, 2048)); } + +test "planRows keeps RDNA3.5 lane rounds exact while leaving non-RDNA3.5 and non-window launches bucketed" { + const Caps = @import("caps.zig").Caps; + const Launcher = @import("launches.zig").Launcher; + for ([_][]const u8{ "gfx1030", "gfx1100", "gfx1151", "gfx1201" }) |name| { + var l: Launcher = undefined; + l.affine.caps = Caps.of(name).?; + const prefill: Ops = .{ .l = &l, .bf16 = true, .stream = undefined, .arena = undefined, .window = false }; + var window = prefill; + window.window = true; + try std.testing.expectEqual(@as(usize, 16), planRows(prefill, false, 3)); + try std.testing.expectEqual(@as(usize, 3), planRows(prefill, true, 3)); + const want: usize = if (l.affine.caps.generation == .rdna3_5) 3 else 16; + try std.testing.expectEqual(want, planRows(window, false, 3)); + try std.testing.expectEqual(@as(usize, 3), planRows(window, true, 3)); + } +} diff --git a/zig/src/hip_serve/costs.zig b/zig/src/hip_serve/costs.zig index 578d6bd4869..d24f8a061b5 100644 --- a/zig/src/hip_serve/costs.zig +++ b/zig/src/hip_serve/costs.zig @@ -62,7 +62,7 @@ pub fn forwards(r: anytype, widest: usize, streams: usize, batch_rows: usize, ou } } -/// `r.time(&.{w})` (one forward's mean ms) of a lone window of each width to `widest` rows. +/// `r.time(&.{w})` (one forward's mean ms) of a lone window of each width to `widest` rows, pooled across tile steps. pub fn windows(r: anytype, widest: usize, out: *Costs) !void { out.windows = 0; for (1..out.window.len + 1) |w| { @@ -70,6 +70,37 @@ pub fn windows(r: anytype, widest: usize, out: *Costs) !void { out.window[out.windows] = .{ .width = @intCast(w), .ms = try r.time(&.{w}) }; out.windows += 1; } + poolWindowRows(out.window[0..out.windows]); +} + +/// Pools rising added-row ms within each 4-row regime so a tile step never prices an earlier draft under a later one. +pub fn poolWindowRows(ws: []Cost) void { + if (ws.len <= 2) return; + std.debug.assert(ws.len <= 16); + var sums: [16]f64 = undefined; + var counts: [16]f64 = undefined; + var m: usize = 0; + var first: usize = 0; + for (ws[0 .. ws.len - 1], ws[1..], 2..) |a, b, r| { + if ((r - 1) % window == 0) first = m + 1; + sums[m] = b.ms - a.ms; + counts[m] = 1; + m += 1; + while (m > first + 1 and sums[m - 2] * counts[m - 1] < sums[m - 1] * counts[m - 2]) { + sums[m - 2] += sums[m - 1]; + counts[m - 2] += counts[m - 1]; + m -= 1; + } + } + var at: usize = 1; + for (sums[0..m], counts[0..m]) |s, k| { + const base = ws[at - 1].ms; + const n: usize = @intFromFloat(k); + for (0..n) |j| { + ws[at].ms = base + s / k * @as(f64, @floatFromInt(j + 1)); + at += 1; + } + } } /// Each row bucket shared rounds pad to, to `batch_rows`, timed at its rows over `streams` windows, prices its totals. @@ -130,3 +161,24 @@ test "lone widths to the widest, shared totals the streams can hold" { try std.testing.expectEqual(@as(u32, 12), c.shared[3].width); try std.testing.expectEqual(@as(usize, 3), f.calls.items[f.calls.items.len - 1]); } + +test "windows pools a rising added-row step across tile boundaries while leaving concave rows alone" { + const Script = struct { + ms: []const f64, + fn time(s: @This(), widths: []const usize) !f64 { + return s.ms[widths[0] - 1]; + } + }; + var c: Costs = .{}; + try windows(Script{ .ms = &.{ 10, 13, 15, 16 } }, 4, &c); + try std.testing.expectEqual(@as(usize, 4), c.windows); + for ([_]f64{ 10, 13, 15, 16 }, 0..) |want, i| try std.testing.expectApproxEqAbs(want, c.window[i].ms, 1e-12); + + try windows(Script{ .ms = &.{ 10, 11, 14, 15 } }, 4, &c); + try std.testing.expectEqual(@as(usize, 4), c.windows); + for ([_]f64{ 10, 12, 14, 15 }, 0..) |want, i| try std.testing.expectApproxEqAbs(want, c.window[i].ms, 1e-12); + + try windows(Script{ .ms = &.{ 10, 11, 14, 15, 21, 22, 25, 26 } }, 8, &c); + try std.testing.expectEqual(@as(usize, 8), c.windows); + for ([_]f64{ 10, 12, 14, 15, 21, 23, 25, 26 }, 0..) |want, i| try std.testing.expectApproxEqAbs(want, c.window[i].ms, 1e-12); +} diff --git a/zig/src/hip_serve/protocol.zig b/zig/src/hip_serve/protocol.zig index 3ccc60c4c2e..0c20f40f474 100644 --- a/zig/src/hip_serve/protocol.zig +++ b/zig/src/hip_serve/protocol.zig @@ -20,6 +20,23 @@ pub fn step(m: []const u32) error{LinkFailed}!Op { return op; } +/// Rank 0's table from page `first` on: no gap past this rank's `held` pages, inside its `room`, ids in its pool. +pub fn pagesFit(first: usize, ids: []const u32, held: usize, room: usize, pool: usize) bool { + if (first > held or ids.len > room or first > room - ids.len) return false; + for (ids) |id| if (id >= pool) return false; + return true; +} + +/// A page rank 0 names, against this rank's pool of `pool` pages (every rank's pool is sized from the same options). +pub fn pageFits(page: u32, pool: usize) bool { + return page < pool; +} + +/// A snapshot slot rank 0 names: one this rank holds, or the next one (rank 0 claims the lowest free slot). +pub fn slotFits(slot: u32, slots: usize) bool { + return slot <= slots; +} + /// The prefill message's snapshot slot when the pass starts from nothing. pub const no_snapshot: u32 = std.math.maxInt(u32); @@ -270,3 +287,23 @@ test "security: a step from the link is refused unless its message holds the wor try t.expectError(error.LinkFailed, step(&.{ pages, 1, 0, 3, 7, 8 })); try t.expectError(error.LinkFailed, step(&.{ pages, 1, 0, 0xffff_ffff, 7 })); } + +test "security: rank 0's page and slot indices are refused past this rank's own pool, table and slots" { + const t = std.testing; + // a table of 4 pages held, room for 6, a pool of 100: the largest legal sends pass + try t.expect(pagesFit(4, &.{ 98, 99 }, 4, 6, 100)); + try t.expect(pagesFit(0, &.{}, 0, 0, 100)); + try t.expect(pagesFit(3, &.{0}, 4, 6, 100)); + try t.expect(!pagesFit(5, &.{0}, 4, 6, 100)); // a gap after the held pages + try t.expect(!pagesFit(4, &.{ 1, 2, 3 }, 4, 6, 100)); // past the stream's room + try t.expect(!pagesFit(0xffff_ffff, &.{1}, 4, 6, 100)); + try t.expect(!pagesFit(0, &.{ 1, 100 }, 4, 6, 100)); // a page past the pool + try t.expect(!pagesFit(0, &.{0xffff_ffff}, 4, 6, 100)); + try t.expect(pageFits(99, 100)); + try t.expect(!pageFits(100, 100)); + try t.expect(!pageFits(0xffff_ffff, 100)); + try t.expect(slotFits(3, 3)); + try t.expect(slotFits(0, 0)); + try t.expect(!slotFits(4, 3)); + try t.expect(!slotFits(0xffff_ffff, 3)); +} diff --git a/zig/src/metal/command.zig b/zig/src/metal/command.zig index 769e0995674..2ee2ac62449 100644 --- a/zig/src/metal/command.zig +++ b/zig/src/metal/command.zig @@ -1,4 +1,4 @@ -//! Command queues, command buffers and compute encoders (serial or concurrent dispatch). +//! Command queues, command buffers and compute encoders (serial or concurrent), on Metal 3 or Metal 4 (metal4.zig). const std = @import("std"); const objc = @import("objc.zig"); const types = @import("types.zig"); @@ -8,12 +8,19 @@ const SharedEvent = @import("sync.zig").SharedEvent; const Event = @import("sync.zig").Event; const IndirectCommandBuffer = @import("icb.zig").IndirectCommandBuffer; const ResidencySet = @import("residency.zig").ResidencySet; +const metal4 = @import("metal4.zig"); const Id = objc.Id; const Size = types.Size; pub const Queue = struct { id: Id, + m4: ?*metal4.State = null, + + /// The Metal 4 queue, a compile-time null where Metal 4 is not compiled in. + inline fn state(self: Queue) ?*metal4.State { + return if (comptime metal4.enabled) self.m4 else null; + } pub fn deviceId(self: Queue) Id { return objc.msg(Id, self.id, "device", .{}); @@ -21,11 +28,13 @@ pub const Queue = struct { /// A command buffer that retains what it references (autoreleased: keep a pool around it). pub fn commandBuffer(self: Queue) CommandBuffer { + if (self.state()) |q| return CommandBuffer.of(q.acquire()); return .{ .id = objc.msg(Id, self.id, "commandBuffer", .{}) }; } /// A command buffer that does not retain its resources: the caller keeps them alive until it completes. pub fn commandBufferUnretained(self: Queue) CommandBuffer { + if (self.state()) |q| return CommandBuffer.of(q.acquire()); return .{ .id = objc.msg(Id, self.id, "commandBufferWithUnretainedReferences", .{}) }; } @@ -39,38 +48,71 @@ pub const Queue = struct { } pub fn deinit(self: Queue) void { + if (self.state()) |q| return q.close(); objc.release(self.id); } + + pub fn isMetal4(self: Queue) bool { + return self.state() != null; + } + + /// Names a round of work for the Metal 4 timeline (TF_METAL4_TIMELINE); nothing on Metal 3. + pub fn roundBegin(self: Queue, name: []const u8) void { + if (self.state()) |q| q.roundBegin(name); + } + + /// After the round's last wait. + pub fn roundEnd(self: Queue) void { + if (self.state()) |q| q.roundEnd(); + } }; pub const CommandBuffer = struct { id: Id, + m4: ?*metal4.Slot = null, + /// the slot's use this handle names + use: u32 = 0, + + /// The Metal 4 slot, a compile-time null where Metal 4 is not compiled in. + inline fn slot(self: CommandBuffer) ?*metal4.Slot { + return if (comptime metal4.enabled) self.m4 else null; + } + + fn of(s: *metal4.Slot) CommandBuffer { + return .{ .id = s.cb, .m4 = s, .use = s.use }; + } pub fn compute(self: CommandBuffer, dispatch: types.DispatchType) ComputeEncoder { + if (self.slot()) |s| return .{ .id = s.compute(dispatch == .serial), .m4 = s }; return .{ .id = objc.msg(Id, self.id, "computeCommandEncoderWithDispatchType:", .{@backingInt(dispatch)}) }; } /// A blit encoder on this buffer, for copies between buffers on the GPU. pub fn blit(self: CommandBuffer) BlitEncoder { + if (self.slot()) |s| return .{ .id = s.blitEncoder(), .m4 = s }; return .{ .id = objc.msg(Id, self.id, "blitCommandEncoder", .{}) }; } /// The GPU waits here until `event` reaches `value`. pub fn waitFor(self: CommandBuffer, event: SharedEvent, value: u64) void { + if (self.slot()) |s| return s.waitEvent(event.id, value); objc.msg(void, self.id, "encodeWaitForEvent:value:", .{ event.id, value }); } /// The GPU sets `event` to `value` once the work before this point completes. pub fn signal(self: CommandBuffer, event: SharedEvent, value: u64) void { + if (self.slot()) |s| return s.signalEvent(event.id, value); objc.msg(void, self.id, "encodeSignalEvent:value:", .{ event.id, value }); } /// waitFor and signal with a GPU-only event. pub fn waitForEvent(self: CommandBuffer, event: Event, value: u64) void { + if (self.slot()) |s| return s.waitEvent(event.id, value); objc.msg(void, self.id, "encodeWaitForEvent:value:", .{ event.id, value }); } pub fn signalEvent(self: CommandBuffer, event: Event, value: u64) void { + if (self.slot()) |s| return s.signalEvent(event.id, value); objc.msg(void, self.id, "encodeSignalEvent:value:", .{ event.id, value }); } @@ -80,22 +122,25 @@ pub const CommandBuffer = struct { pub fn commit(self: CommandBuffer) void { @import("pass_metrics.zig").commit(); + if (self.slot()) |s| return s.commit(); objc.msg(void, self.id, "commit", .{}); } pub fn wait(self: CommandBuffer) void { const metrics = @import("pass_metrics.zig"); const start = metrics.time(); - objc.msg(void, self.id, "waitUntilCompleted", .{}); + if (self.slot()) |s| s.wait(self.use) else objc.msg(void, self.id, "waitUntilCompleted", .{}); if (start != 0) metrics.wait(start, self.gpuSeconds()); } pub fn status(self: CommandBuffer) types.CommandBufferStatus { + if (self.slot()) |s| return s.status(self.use); return @fromBackingInt(@intCast(objc.msg(usize, self.id, "status", .{}))); } - /// The error text when the command buffer failed, else null. + /// The error text when the command buffer failed, else null; on Metal 4, any failure on its queue not yet reported. pub fn failure(self: CommandBuffer) ?[*:0]const u8 { + if (self.slot()) |s| return s.failure(self.use); if (self.status() != .@"error") return null; return objc.errorText(objc.msg(?Id, self.id, "error", .{})); } @@ -106,31 +151,49 @@ pub const CommandBuffer = struct { } pub fn gpuStart(self: CommandBuffer) f64 { + if (self.slot()) |s| return if (s.times(self.use, true)) |t| t[0] else 0; return objc.msg(f64, self.id, "GPUStartTime", .{}); } pub fn gpuEnd(self: CommandBuffer) f64 { + if (self.slot()) |s| return if (s.times(self.use, true)) |t| t[1] else 0; return objc.msg(f64, self.id, "GPUEndTime", .{}); } + /// The GPU's start and end once reported, without waiting for the report (Metal 4), else null. + pub fn gpuTimes(self: CommandBuffer) ?[2]f64 { + if (self.slot()) |s| return s.times(self.use, false); + return .{ self.gpuStart(), self.gpuEnd() }; + } + + /// Metal 4's command buffers belong to their queue's slots: retain and release do nothing there. pub fn retain(self: CommandBuffer) CommandBuffer { + if (self.slot() != null) return self; return .{ .id = objc.retain(self.id) }; } pub fn release(self: CommandBuffer) void { - objc.release(self.id); + if (self.slot() == null) objc.release(self.id); } }; /// Copies between buffers on the GPU. pub const BlitEncoder = struct { id: Id, + m4: ?*metal4.Slot = null, + + /// The Metal 4 slot, a compile-time null where Metal 4 is not compiled in. + inline fn slot(self: BlitEncoder) ?*metal4.Slot { + return if (comptime metal4.enabled) self.m4 else null; + } pub fn copy(self: BlitEncoder, from: Buffer, from_offset: usize, to: Buffer, to_offset: usize, size: usize) void { + if (self.slot()) |s| return s.copy(self.id, from.id, from_offset, to.id, to_offset, size); objc.msg(void, self.id, "copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:", .{ from.id, from_offset, to.id, to_offset, size }); } pub fn fill(self: BlitEncoder, buffer: Buffer, offset: usize, size: usize, value: u8) void { + if (self.slot()) |s| return s.fill(self.id, buffer.id, offset, size, value); objc.msg(void, self.id, "fillBuffer:range:value:", .{ buffer.id, types.Range{ .location = offset, .length = size }, value }); } @@ -141,21 +204,31 @@ pub const BlitEncoder = struct { pub const ComputeEncoder = struct { id: Id, + m4: ?*metal4.Slot = null, + + /// The Metal 4 slot, a compile-time null where Metal 4 is not compiled in. + inline fn slot(self: ComputeEncoder) ?*metal4.Slot { + return if (comptime metal4.enabled) self.m4 else null; + } pub fn deviceId(self: ComputeEncoder) Id { + if (self.slot()) |s| return s.q.device; return objc.msg(Id, self.id, "device", .{}); } pub fn setPipeline(self: ComputeEncoder, pipeline: Pipeline) void { objc.msg(void, self.id, "setComputePipelineState:", .{pipeline.id}); + if (self.slot()) |s| s.pipeline(pipeline.id); } pub fn setBuffer(self: ComputeEncoder, buffer: Buffer, offset: usize, index: usize) void { + if (self.slot()) |s| return s.bind(buffer.id, offset, index); objc.msg(void, self.id, "setBuffer:offset:atIndex:", .{ buffer.id, offset, index }); } - /// Small constants copied into the command stream (at most 4 KB). + /// Small constants copied into the command stream (at most 4 KB); on Metal 4 into the slot's constants pages. pub fn setBytes(self: ComputeEncoder, bytes: []const u8, index: usize) void { + if (self.slot()) |s| return s.bytes(bytes, index); objc.msg(void, self.id, "setBytes:length:atIndex:", .{ bytes.ptr, bytes.len, index }); } @@ -170,43 +243,55 @@ pub const ComputeEncoder = struct { /// Whole threadgroups: `groups` of `threads` each. pub fn dispatchGroups(self: ComputeEncoder, groups: Size, threads: Size) void { objc.msg(void, self.id, "dispatchThreadgroups:threadsPerThreadgroup:", .{ groups, threads }); + if (self.slot()) |s| s.dispatched(self.id); } /// Whole threadgroups of `threads` each, their counts (3 u32) read from `args` at `offset` when the dispatch runs. pub fn dispatchIndirect(self: ComputeEncoder, args: Buffer, offset: usize, threads: Size) void { + if (self.slot()) |s| return s.dispatchIndirect(self.id, args.id, offset, threads); objc.msg(void, self.id, "dispatchThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerThreadgroup:", .{ args.id, offset, threads }); } /// A grid of `grid` threads in groups of `threads` (edge groups may be partial), as MLX dispatches. pub fn dispatchThreads(self: ComputeEncoder, grid: Size, threads: Size) void { objc.msg(void, self.id, "dispatchThreads:threadsPerThreadgroup:", .{ grid, threads }); + if (self.slot()) |s| s.dispatched(self.id); } /// Later dispatches see every buffer write before this point (concurrent encoders). pub fn barrier(self: ComputeEncoder) void { + if (self.slot()) |s| return s.barrier(self.id); objc.msg(void, self.id, "memoryBarrierWithScope:", .{types.BarrierScope.buffers}); } - /// Declare a resource used through indirect commands or argument buffers. + /// Declare a resource used through indirect commands or argument buffers (on Metal 4: it joins the residency set). pub fn useResource(self: ComputeEncoder, buffer: Buffer, usage: usize) void { + if (self.slot()) |s| { + _ = s.q.address(buffer.id); + return; + } objc.msg(void, self.id, "useResource:usage:", .{ buffer.id, usage }); } pub fn execute(self: ComputeEncoder, icb: IndirectCommandBuffer, first: usize, count: usize) void { objc.msg(void, self.id, "executeCommandsInBuffer:withRange:", .{ icb.id, types.Range{ .location = first, .length = count } }); + if (self.slot()) |s| s.dispatched(self.id); } pub fn end(self: ComputeEncoder) void { + if (self.slot()) |s| s.ending(self.id); objc.msg(void, self.id, "endEncoding", .{}); } /// The command buffer this encoder was opened from, for the event ops a seam encodes BETWEEN encoders. pub fn commandBuffer(self: ComputeEncoder) CommandBuffer { + if (self.slot()) |s| return CommandBuffer.of(s); return .{ .id = objc.msg(Id, self.id, "commandBuffer", .{}) }; } /// Whether this encoder dispatches serially or concurrently: a seam reopens it in the same mode. pub fn dispatchType(self: ComputeEncoder) types.DispatchType { + if (self.slot()) |s| return if (s.serial) .serial else .concurrent; return @fromBackingInt(@intCast(objc.msg(usize, self.id, "dispatchType", .{}))); } }; diff --git a/zig/src/metal/device.zig b/zig/src/metal/device.zig index 769a1b7e994..b0504d4537c 100644 --- a/zig/src/metal/device.zig +++ b/zig/src/metal/device.zig @@ -6,6 +6,7 @@ const types = @import("types.zig"); const command = @import("command.zig"); const sync = @import("sync.zig"); const residency = @import("residency.zig"); +const metal4 = @import("metal4.zig"); const Id = objc.Id; @@ -38,6 +39,7 @@ pub const Buffer = struct { } pub fn deinit(self: Buffer) void { + if (comptime metal4.enabled) metal4.forget(self.id); objc.release(self.id); } }; @@ -91,6 +93,20 @@ pub const Device = struct { return .{ .id = objc.msg(?Id, self.id, "newCommandQueue", .{}) orelse return error.NoQueue }; } + /// Whether this Mac has Metal 4's command queues (macOS 26 and later). + pub fn hasMetal4(self: Device) bool { + return self.responds("newMTL4CommandQueue"); + } + + /// A queue taking `queue`'s calls through Metal 4, or error.Unsupported; TF_METAL4_TIMELINE=n stamps n rounds. + pub fn queue4(self: Device) Error!command.Queue { + if (comptime !metal4.enabled) return error.Unsupported; + if (!self.hasMetal4()) return error.Unsupported; + const rounds = platform.environment.read(u32, "TF_METAL4_TIMELINE", 0) catch 0; + const q = metal4.State.open(self.id, rounds) orelse return error.Unsupported; + return .{ .id = q.queue, .m4 = q }; + } + /// A new buffer of `len` bytes; `options` from types.ResourceOptions (shared storage by default). pub fn buffer(self: Device, len: usize, options: usize) Error!Buffer { @import("pass_metrics.zig").buffer(); diff --git a/zig/src/metal/library.zig b/zig/src/metal/library.zig index c8ecd55e6b3..90cfe238cfa 100644 --- a/zig/src/metal/library.zig +++ b/zig/src/metal/library.zig @@ -1,6 +1,8 @@ //! Libraries (a build-time metallib, or source compiled at run time) and compute pipelines. const std = @import("std"); const objc = @import("objc.zig"); +const platform = @import("sys"); +const metal4 = @import("metal4.zig"); const types = @import("types.zig"); const Device = @import("device.zig").Device; @@ -8,6 +10,17 @@ const Id = objc.Id; pub const Error = error{ LibraryLoad, NoFunction, PipelineBuild }; +var timeline_on: std.atomic.Value(u8) = .init(2); + +/// TF_METAL4_TIMELINE set above 0, read once. +fn timelineOn() bool { + const v = timeline_on.load(.monotonic); + if (v != 2) return v == 1; + const on: u8 = @intFromBool((platform.environment.read(u32, "TF_METAL4_TIMELINE", 0) catch 0) > 0); + timeline_on.store(on, .monotonic); + return on == 1; +} + extern "c" fn dispatch_data_create(buffer: *const anyopaque, size: usize, queue: ?*anyopaque, destructor: ?*anyopaque) ?*anyopaque; extern "c" fn dispatch_release(object: *anyopaque) void; @@ -97,6 +110,11 @@ fn fail(comptime fmt: []const u8, what: anytype, err: ?Id) Error { pub const Pipeline = struct { id: Id, + /// Whether pipelines made from now on carry their kernel's name (tests reading the timeline set it on). + pub fn labels(on: bool) void { + timeline_on.store(@intFromBool(on), .monotonic); + } + /// The kernel `name` of `library`; `indirect` lets indirect command buffers use it. pub fn init(device: Device, library: Library, name: []const u8, indirect: bool) Error!Pipeline { return make(device, library, name, indirect, false); @@ -117,6 +135,12 @@ pub const Pipeline = struct { defer objc.release(desc); objc.msg(void, desc, "setComputeFunction:", .{func}); objc.msg(void, desc, "setSupportIndirectCommandBuffers:", .{indirect}); + // the kernel's name on the pipeline, for the Metal 4 timeline only (TF_METAL4_TIMELINE): nothing else reads it + if (metal4.enabled and timelineOn()) { + const label = objc.string(name); + defer objc.release(label); + objc.msg(void, desc, "setLabel:", .{label}); + } const id = objc.msg(?Id, device.id, "newComputePipelineStateWithDescriptor:options:reflection:error:", .{ desc, @as(usize, 0), @as(?*anyopaque, null), &err }); return .{ .id = id orelse { if (optional) std.log.info("pipeline {s}: {s}", .{ name, objc.errorText(err) }) else std.log.err("pipeline {s}: {s}", .{ name, objc.errorText(err) }); diff --git a/zig/src/metal/metal.zig b/zig/src/metal/metal.zig index e1da53b0a32..33a49b696d2 100644 --- a/zig/src/metal/metal.zig +++ b/zig/src/metal/metal.zig @@ -30,6 +30,7 @@ pub const clock = @import("clock.zig"); pub const pass_metrics = @import("pass_metrics.zig"); pub const counters = @import("counters.zig"); pub const ane = @import("ane.zig"); +pub const metal4 = @import("metal4.zig"); test { std.testing.refAllDecls(@This()); diff --git a/zig/src/metal/metal4.zig b/zig/src/metal/metal4.zig new file mode 100644 index 00000000000..91fe3eda409 --- /dev/null +++ b/zig/src/metal/metal4.zig @@ -0,0 +1,578 @@ +//! Metal 4 under command.zig's calls: slots of command buffers, argument tables, constants pages, barriers, an event. +const std = @import("std"); +const sys = @import("sys"); +const objc = @import("objc.zig"); +const types = @import("types.zig"); +const Timeline = @import("metal4_timeline.zig").Timeline; + +const Id = objc.Id; +const heap = std.heap.c_allocator; + +/// In only where the root declares `tf_metal4 = true` (the DeepSeek server) and in tests; elsewhere compiled out. +pub const enabled = @import("builtin").is_test or (@hasDecl(@import("root"), "tf_metal4") and @import("root").tf_metal4); + +pub const stage_dispatch: usize = 1 << 27; +pub const stage_blit: usize = 1 << 28; +const queue_stages = stage_dispatch | stage_blit; +const flush_device: usize = 1; + +/// Command buffers a queue keeps; a slot is begun again once its last commit has completed. +pub const ring = 64; +const page_bytes: usize = 256 << 10; +const max_pages = 32; +const max_events = 4; +/// Feedback kept a slot, by commit: a reader is never more than one commit behind. +const history = 4; +/// How long a reader waits for a completed commit's feedback: spins, then naps of 10 us (2 s in all). +const spins = 4096; +const feedback_naps = 200_000; + +/// The Objective-C block ABI for the commit feedback handler: a global block, so nothing copies or frees it. +const BlockDescriptor = extern struct { reserved: c_ulong, size: c_ulong, signature: [*:0]const u8 }; +const Block = extern struct { + isa: *const anyopaque, + flags: c_int, + reserved: c_int, + invoke: *const fn (*const Block, Id) callconv(.c) void, + descriptor: *const BlockDescriptor, + slot: *Slot, +}; +extern const _NSConcreteGlobalBlock: anyopaque; +const block_global: c_int = 1 << 28; +const block_signature: c_int = 1 << 30; +const descriptor: BlockDescriptor = .{ .reserved = 0, .size = @sizeOf(Block), .signature = "v16@?0@8" }; + +const Page = struct { buf: Id, ptr: [*]u8, addr: u64 }; +const Event = struct { id: Id, value: u64 }; + +pub const Slot = struct { + q: *State, + cb: Id, + allocator: Id, + table: Id, + block: Block, + /// how many times the slot was begun: a handle from an earlier use finds its work done + use: u32 = 0, + commits: u32 = 0, + /// the event value this use's commit signals; 0 before it commits + value: u64 = 0, + open: bool = false, + serial: bool = false, + blit: bool = false, + dirty: bool = false, + pages: [max_pages]?Page = @splat(null), + page: usize = 0, + bump: usize = 0, + waits: [max_events]Event = undefined, + nwaits: usize = 0, + signals: [max_events]Event = undefined, + nsignals: usize = 0, + /// commit feedbacks received; the newest ones' GPU span and whether they failed + seen: std.atomic.Value(u32) = .init(0), + start: [history]f64 = @splat(0), + end: [history]f64 = @splat(0), + bad: [history]bool = @splat(false), + + /// A compute encoder on this slot's command buffer, after every earlier command of the queue. + pub fn compute(s: *Slot, serial: bool) Id { + const e = objc.msg(Id, s.cb, "computeCommandEncoder", .{}); + objc.msg(void, e, "setArgumentTable:", .{s.table}); + objc.msg(void, e, "barrierAfterQueueStages:beforeStages:visibilityOptions:", .{ queue_stages, queue_stages, flush_device }); + s.serial = serial; + s.blit = false; + s.dirty = false; + if (s.q.timeline) |t| t.started(e); + return e; + } + + /// Copies and fills, in order: Metal 4 encodes them on a compute encoder. + pub fn blitEncoder(s: *Slot) Id { + const e = s.compute(true); + s.blit = true; + return e; + } + + pub fn bind(s: *Slot, buffer: Id, offset: usize, index: usize) void { + objc.msg(void, s.table, "setAddress:atIndex:", .{ s.q.address(buffer) + offset, index }); + } + + /// Constants copied into this use's pages, read by address. + pub fn bytes(s: *Slot, data: []const u8, index: usize) void { + const len = std.mem.alignForward(usize, @max(data.len, 1), 64); + if (len > page_bytes) std.debug.panic("metal 4: {d} bytes of constants in one call", .{data.len}); + if (s.bump + len > page_bytes) { + s.page += 1; + s.bump = 0; + } + const p = s.pageAt(s.page); + @memcpy(p.ptr[s.bump..][0..data.len], data); + objc.msg(void, s.table, "setAddress:atIndex:", .{ p.addr + s.bump, index }); + s.bump += len; + } + + fn pageAt(s: *Slot, i: usize) Page { + if (i >= max_pages) std.debug.panic("metal 4: more than {d} KiB of constants in one command buffer", .{max_pages * page_bytes >> 10}); + if (s.pages[i]) |p| return p; + const buf = objc.msg(?Id, s.q.device, "newBufferWithLength:options:", .{ page_bytes, types.ResourceOptions.shared }) orelse + std.debug.panic("metal 4: no buffer for constants", .{}); + const p: Page = .{ .buf = buf, .ptr = objc.msg([*]u8, buf, "contents", .{}), .addr = s.q.address(buf) }; + s.pages[i] = p; + return p; + } + + pub fn pipeline(s: *Slot, id: Id) void { + if (s.q.timeline) |t| t.piped(id); + } + + pub fn dispatched(s: *Slot, e: Id) void { + s.dirty = true; + if (s.q.timeline) |t| t.dispatched(); + if (s.serial) s.barrier(e); + } + + pub fn dispatchIndirect(s: *Slot, e: Id, args: Id, offset: usize, threads: types.Size) void { + objc.msg(void, e, "dispatchThreadgroupsWithIndirectBuffer:threadsPerThreadgroup:", .{ s.q.address(args) + offset, threads }); + s.dispatched(e); + } + + /// Later commands of this encoder see every write before it; with nothing since the last one it does nothing. + pub fn barrier(s: *Slot, e: Id) void { + if (!s.dirty) return; + s.dirty = false; + const st = if (s.blit) stage_blit else stage_dispatch; + objc.msg(void, e, "barrierAfterEncoderStages:beforeEncoderStages:visibilityOptions:", .{ st, st, flush_device }); + if (s.q.timeline) |t| t.stage(e); + } + + pub fn copy(s: *Slot, e: Id, from: Id, from_offset: usize, to: Id, to_offset: usize, size: usize) void { + _ = s.q.address(from); + _ = s.q.address(to); + objc.msg(void, e, "copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:", .{ from, from_offset, to, to_offset, size }); + s.dispatched(e); + } + + pub fn fill(s: *Slot, e: Id, buffer: Id, offset: usize, size: usize, value: u8) void { + _ = s.q.address(buffer); + objc.msg(void, e, "fillBuffer:range:value:", .{ buffer, types.Range{ .location = offset, .length = size }, value }); + s.dispatched(e); + } + + pub fn ending(s: *Slot, e: Id) void { + if (s.q.timeline) |t| if (s.dirty) t.ended(e); + } + + /// Event waits and signals at the command buffer's edges: Metal 4 puts them on the queue, around the commit. + pub fn waitEvent(s: *Slot, event: Id, value: u64) void { + if (s.nwaits == max_events) std.debug.panic("metal 4: more than {d} event waits in one command buffer", .{max_events}); + s.waits[s.nwaits] = .{ .id = event, .value = value }; + s.nwaits += 1; + } + + pub fn signalEvent(s: *Slot, event: Id, value: u64) void { + if (s.nsignals == max_events) std.debug.panic("metal 4: more than {d} event signals in one command buffer", .{max_events}); + s.signals[s.nsignals] = .{ .id = event, .value = value }; + s.nsignals += 1; + } + + pub fn commit(s: *Slot) void { + s.q.commit(s); + } + + /// Blocks until use `use` of this slot completed (at once for a later use's handle or one never committed). + pub fn wait(s: *Slot, use: u32) void { + if (use != s.use or s.value == 0) return; + s.q.reach(s.value); + s.q.drain(); + } + + /// The GPU's start and end of use `use`, in host seconds; null when gone or, unless `block`, not yet reported. + pub fn times(s: *Slot, use: u32, block: bool) ?[2]f64 { + if (use != s.use or s.value == 0) return null; + const k = s.commits; + var tries: u32 = 0; + while (s.seen.load(.acquire) < k) : (tries += 1) { + if (!block or tries == 100_000) return null; + nap(10_000); + } + const i = (k - 1) % history; + return .{ s.start[i], s.end[i] }; + } + + /// A failure the queue has not reported yet; this use's own feedback (apart from its GPU event) is awaited first. + pub fn failure(s: *Slot, use: u32) ?[*:0]const u8 { + const q = s.q; + if (use == s.use and s.value != 0 and !s.fed(s.commits, feedback_naps)) return "metal 4: a command buffer's feedback never arrived"; + if (q.failures.load(.acquire) == q.reported) return null; + q.reported = q.failures.load(.acquire); + return @ptrCast(&q.failure_text); + } + + /// Waits for commit `k`'s feedback: a short spin (it follows the GPU closely), then up to `naps` naps of 10 us. + fn fed(s: *const Slot, k: u32, naps: u32) bool { + var i: u32 = 0; + while (s.seen.load(.acquire) < k) : (i += 1) { + if (i < spins) { + std.atomic.spinLoopHint(); + continue; + } + if (i - spins >= naps) return false; + nap(10_000); + } + return true; + } + + pub fn status(s: *Slot, use: u32) types.CommandBufferStatus { + if (use != s.use) return .completed; + if (s.value == 0) return if (s.open) .not_enqueued else .completed; + if (objc.msg(u64, s.q.event, "signaledValue", .{}) < s.value) return .committed; + const k = s.commits; + if (s.seen.load(.acquire) >= k and s.bad[(k - 1) % history]) return .@"error"; + return .completed; + } + + fn feedback(b: *const Block, fb: Id) callconv(.c) void { + const s = b.slot; + const n = s.seen.load(.monotonic); + const i = n % history; + s.start[i] = objc.msg(f64, fb, "GPUStartTime", .{}); + s.end[i] = objc.msg(f64, fb, "GPUEndTime", .{}); + const err = objc.msg(?Id, fb, "error", .{}); + s.bad[i] = err != null; + if (err) |e| s.q.fail(e); + s.seen.store(n + 1, .release); + } +}; + +/// Buffers bound so far and their GPU addresses: open addressing, read without the lock and written under it. +const Table = struct { + keys: []std.atomic.Value(usize), + addrs: []u64, + used: usize = 0, + + const tomb: usize = 1; + + fn init(n: usize) *Table { + const t = heap.create(Table) catch @panic("metal 4: out of memory"); + t.* = .{ .keys = heap.alloc(std.atomic.Value(usize), n) catch @panic("metal 4: out of memory"), .addrs = heap.alloc(u64, n) catch @panic("metal 4: out of memory") }; + for (t.keys) |*k| k.* = .init(0); + return t; + } + + fn deinit(t: *Table) void { + heap.free(t.keys); + heap.free(t.addrs); + heap.destroy(t); + } + + fn home(t: *const Table, k: usize) usize { + return @as(usize, @truncate(((k >> 4) *% 0x9E3779B97F4A7C15) >> 24)) & (t.keys.len - 1); + } + + fn find(t: *const Table, k: usize) ?usize { + var i = t.home(k); + while (true) : (i = (i + 1) & (t.keys.len - 1)) { + const key = t.keys[i].load(.acquire); + if (key == k) return i; + if (key == 0) return null; + } + } + + /// Under the lock, a key that is not there: its address first, so a reader that sees the key sees the address. + fn put(t: *Table, k: usize, addr: u64) void { + var i = t.home(k); + while (true) : (i = (i + 1) & (t.keys.len - 1)) { + const key = t.keys[i].load(.monotonic); + if (key != 0 and key != tomb) continue; + if (key == 0) t.used += 1; + t.addrs[i] = addr; + t.keys[i].store(k, .release); + return; + } + } +}; + +/// Queues whose buffers Buffer.deinit must hand back. +var registry: [8]std.atomic.Value(?*State) = @splat(.init(null)); +var registered: std.atomic.Value(u32) = .init(0); +/// Set when the first Metal 4 queue opens (never cleared): until then a buffer's release skips the registry. +var any_queue: bool = false; + +/// A buffer's owner let it go: queues that bound it release it from their sets once their work in flight is done. +pub fn forget(buffer: Id) void { + if (!any_queue or registered.load(.acquire) == 0) return; + for (®istry) |*r| if (r.load(.acquire)) |q| q.drop(buffer); +} + +fn nap(ns: u64) void { + const t: std.c.timespec = .{ .sec = 0, .nsec = @intCast(ns) }; + _ = sys.c.nanosleep(&t, null); +} + +pub const State = struct { + device: Id, + queue: Id, + event: Id, + set: Id, + lock_word: std.c.os_unfair_lock = .{}, + tick: u64 = 0, + next: usize = 0, + /// slots begun and not yet committed + unsent: usize = 0, + table: std.atomic.Value(*Table), + retired: std.ArrayList(*Table) = .empty, + /// buffers whose owners freed them: still in the set until the queue has nothing in flight + dropped: std.ArrayList(Id) = .empty, + set_dirty: bool = false, + set_grew: bool = false, + failures: std.atomic.Value(u32) = .init(0), + reported: u32 = 0, + failure_text: [256]u8 = @splat(0), + timeline: ?*Timeline = null, + slots: [ring]Slot = undefined, + + /// A Metal 4 queue on `device` with its slots and its residency set, or null where Metal 4 is missing. + pub fn open(device: Id, timeline_rounds: u32) ?*State { + const queue = objc.msg(?Id, device, "newMTL4CommandQueue", .{}) orelse return null; + const q = heap.create(State) catch @panic("metal 4: out of memory"); + q.* = .{ + .device = device, + .queue = queue, + .event = objc.msg(?Id, device, "newSharedEvent", .{}) orelse @panic("metal 4: no shared event"), + .set = newSet(device), + .table = .init(Table.init(4096)), + }; + const td = objc.msg(Id, objc.msg(Id, objc.class("MTL4ArgumentTableDescriptor"), "alloc", .{}), "init", .{}); + defer objc.release(td); + objc.msg(void, td, "setMaxBufferBindCount:", .{@as(usize, 31)}); + for (&q.slots) |*s| { + var err: ?Id = null; + s.* = .{ + .q = q, + .cb = objc.msg(?Id, device, "newCommandBuffer", .{}) orelse @panic("metal 4: no command buffer"), + .allocator = objc.msg(?Id, device, "newCommandAllocator", .{}) orelse @panic("metal 4: no command allocator"), + .table = objc.msg(?Id, device, "newArgumentTableWithDescriptor:error:", .{ td, &err }) orelse @panic("metal 4: no argument table"), + .block = .{ .isa = &_NSConcreteGlobalBlock, .flags = block_global | block_signature, .reserved = 0, .invoke = Slot.feedback, .descriptor = &descriptor, .slot = s }, + }; + } + objc.msg(void, queue, "addResidencySet:", .{q.set}); + if (timeline_rounds > 0) q.timeline = Timeline.init(device, timeline_rounds); + for (®istry) |*r| if (r.cmpxchgStrong(null, q, .acq_rel, .acquire) == null) { + _ = registered.fetchAdd(1, .acq_rel); + any_queue = true; + break; + }; + return q; + } + + fn newSet(device: Id) Id { + const d = objc.msg(Id, objc.msg(Id, objc.class("MTLResidencySetDescriptor"), "alloc", .{}), "init", .{}); + defer objc.release(d); + objc.msg(void, d, "setInitialCapacity:", .{@as(usize, 1024)}); + var err: ?Id = null; + return objc.msg(?Id, device, "newResidencySetWithDescriptor:error:", .{ d, &err }) orelse @panic("metal 4: no residency set"); + } + + fn lock(q: *State) void { + std.c.os_unfair_lock_lock(&q.lock_word); + } + + fn unlock(q: *State) void { + std.c.os_unfair_lock_unlock(&q.lock_word); + } + + /// The next slot, begun: its previous use has completed (it is waited for if not) and its allocator is reset. + pub fn acquire(q: *State) *Slot { + q.lock(); + defer q.unlock(); + const s = &q.slots[q.next]; + q.next = (q.next + 1) % ring; + if (s.open) { + objc.msg(void, s.cb, "endCommandBuffer", .{}); + s.open = false; + q.unsent -= 1; + } + if (s.value > 0) q.reach(s.value); + objc.msg(void, s.allocator, "reset", .{}); + objc.msg(void, s.cb, "beginCommandBufferWithAllocator:", .{s.allocator}); + s.use +%= 1; + s.value = 0; + s.page = 0; + s.bump = 0; + s.nwaits = 0; + s.nsignals = 0; + s.open = true; + q.unsent += 1; + return s; + } + + fn commit(q: *State, s: *Slot) void { + objc.msg(void, s.cb, "endCommandBuffer", .{}); + const options = objc.msg(Id, objc.msg(Id, objc.class("MTL4CommitOptions"), "alloc", .{}), "init", .{}); + defer objc.release(options); + objc.msg(void, options, "addFeedbackHandler:", .{&s.block}); + q.lock(); + defer q.unlock(); + if (q.set_dirty) { + objc.msg(void, q.set, "commit", .{}); + if (q.set_grew) objc.msg(void, q.set, "requestResidency", .{}); + q.set_dirty = false; + q.set_grew = false; + } + for (s.waits[0..s.nwaits]) |w| objc.msg(void, q.queue, "waitForEvent:value:", .{ w.id, w.value }); + const list = [1]Id{s.cb}; + objc.msg(void, q.queue, "commit:count:options:", .{ @as([*]const Id, &list), @as(usize, 1), options }); + q.tick += 1; + s.value = q.tick; + s.commits += 1; + s.open = false; + q.unsent -= 1; + objc.msg(void, q.queue, "signalEvent:value:", .{ q.event, q.tick }); + for (s.signals[0..s.nsignals]) |g| objc.msg(void, q.queue, "signalEvent:value:", .{ g.id, g.value }); + } + + /// Blocks until the queue's event reaches `v`. + fn reach(q: *State, v: u64) void { + if (objc.msg(u64, q.event, "signaledValue", .{}) >= v) return; + var seconds: u32 = 0; + while (!objc.msg(bool, q.event, "waitUntilSignaledValue:timeoutMS:", .{ v, @as(u64, 1000) })) { + seconds += 1; + if (seconds == 10) std.log.warn("metal 4: a command buffer has run for 10 s", .{}); + } + } + + /// With nothing in flight or being encoded, the buffers their owners freed leave the set. + fn drain(q: *State) void { + if (q.dropped.items.len == 0) return; + q.lock(); + defer q.unlock(); + if (q.unsent != 0 or objc.msg(u64, q.event, "signaledValue", .{}) < q.tick) return; + for (q.dropped.items) |id| objc.msg(void, q.set, "removeAllocation:", .{id}); + q.dropped.clearRetainingCapacity(); + objc.msg(void, q.set, "commit", .{}); + } + + /// A buffer's GPU address, the buffer joining the residency set the first time it is seen. + pub fn address(q: *State, buffer: Id) u64 { + const k = @intFromPtr(buffer); + const t = q.table.load(.acquire); + if (t.find(k)) |i| return t.addrs[i]; + return q.admit(buffer); + } + + fn admit(q: *State, buffer: Id) u64 { + const k = @intFromPtr(buffer); + q.lock(); + defer q.unlock(); + var t = q.table.load(.monotonic); + if (t.find(k)) |i| return t.addrs[i]; + if ((t.used + 1) * 2 > t.keys.len) t = q.grow(t); + const addr = objc.msg(u64, buffer, "gpuAddress", .{}); + objc.msg(void, q.set, "addAllocation:", .{buffer}); + q.set_dirty = true; + q.set_grew = true; + t.put(k, addr); + return addr; + } + + /// A table with room, its live keys moved over; the old one stays readable until the queue closes. + fn grow(q: *State, t: *Table) *Table { + var live: usize = 0; + for (t.keys) |*k| live += @intFromBool(k.load(.monotonic) > Table.tomb); + var n = t.keys.len; + while ((live + 1) * 4 > n) n *= 2; + const g = Table.init(n); + for (t.keys, t.addrs) |*k, a| { + const key = k.load(.monotonic); + if (key > Table.tomb) g.put(key, a); + } + q.retired.append(heap, t) catch @panic("metal 4: out of memory"); + q.table.store(g, .release); + return g; + } + + fn drop(q: *State, buffer: Id) void { + const k = @intFromPtr(buffer); + q.lock(); + defer q.unlock(); + const t = q.table.load(.monotonic); + const i = t.find(k) orelse return; + t.keys[i].store(Table.tomb, .release); + q.dropped.append(heap, buffer) catch { + objc.msg(void, q.set, "removeAllocation:", .{buffer}); + q.set_dirty = true; + }; + } + + fn fail(q: *State, err: Id) void { + const text = std.mem.span(objc.errorText(err)); + std.log.err("metal 4: a command buffer failed: {s}", .{text}); + const n = @min(text.len, q.failure_text.len - 1); + @memcpy(q.failure_text[0..n], text[0..n]); + q.failure_text[n] = 0; + _ = q.failures.fetchAdd(1, .acq_rel); + } + + /// Everything committed has run and reported; then the queue, its slots and its set go. + pub fn close(q: *State) void { + _ = q.closeWithin(feedback_naps); + } + + /// As close with at most `naps` naps for owed feedback; while one is owed the State (its handlers' storage) stays. + pub fn closeWithin(q: *State, naps: u32) bool { + for (®istry) |*r| if (r.cmpxchgStrong(q, null, .acq_rel, .acquire) == null) { + _ = registered.fetchSub(1, .acq_rel); + break; + }; + if (q.tick > 0) q.reach(q.tick); + var left = naps; + var owed = false; + for (&q.slots) |*s| { + while (s.seen.load(.acquire) < s.commits and !owed) { + if (left == 0) owed = true else nap(10_000); + left -|= 1; + } + if (s.open) objc.msg(void, s.cb, "endCommandBuffer", .{}); + for (s.pages) |p| if (p) |pg| objc.release(pg.buf); + for ([_]Id{ s.table, s.allocator, s.cb }) |id| objc.release(id); + } + objc.msg(void, q.set, "removeAllAllocations", .{}); + objc.msg(void, q.set, "commit", .{}); + objc.msg(void, q.queue, "removeResidencySet:", .{q.set}); + if (q.timeline) |t| t.deinit(); + for ([_]Id{ q.set, q.event, q.queue }) |id| objc.release(id); + for (q.retired.items) |t| t.deinit(); + q.retired.deinit(heap); + q.dropped.deinit(heap); + q.table.load(.monotonic).deinit(); + if (owed) { + std.log.warn("metal 4: a command buffer's feedback was still owed at close; the queue's memory is kept for it", .{}); + return true; + } + heap.destroy(q); + return false; + } + + /// A round of named work: under TF_METAL4_TIMELINE some rounds of each name get a timestamp at every stage. + pub fn roundBegin(q: *State, name: []const u8) void { + if (q.timeline) |t| t.begin(name); + } + + /// After the round's last wait: a stamped round's stages are read and summed. + pub fn roundEnd(q: *State) void { + if (q.timeline) |t| t.end(); + } +}; + +test "the follow table: lookups, a dropped key, growth keeps every live address" { + const t = Table.init(8); + defer t.deinit(); + for (1..4) |i| t.put(i * 64, i * 1000); + try std.testing.expectEqual(@as(?usize, null), t.find(5 * 64)); + try std.testing.expectEqual(@as(u64, 2000), t.addrs[t.find(2 * 64).?]); + t.keys[t.find(2 * 64).?].store(Table.tomb, .release); + try std.testing.expectEqual(@as(?usize, null), t.find(2 * 64)); + try std.testing.expectEqual(@as(u64, 3000), t.addrs[t.find(3 * 64).?]); + t.put(2 * 64, 2222); + try std.testing.expectEqual(@as(u64, 2222), t.addrs[t.find(2 * 64).?]); + try std.testing.expectEqual(@as(usize, 3), t.used); +} diff --git a/zig/src/metal/metal4_timeline.zig b/zig/src/metal/metal4_timeline.zig new file mode 100644 index 00000000000..3f6d1b32e1a --- /dev/null +++ b/zig/src/metal/metal4_timeline.zig @@ -0,0 +1,255 @@ +//! TF_METAL4_TIMELINE: a GPU timestamp between every two stages of a named round, logged by kernel and by stage. +const std = @import("std"); +const objc = @import("objc.zig"); +const types = @import("types.zig"); + +const Id = objc.Id; +const heap = std.heap.c_allocator; +/// Stamps a round at most: the most a timestamp heap holds. +const cap = 4096; +const warm = 8; +/// Kernels a stage is named by; more are counted, not named. +const kept = 3; +const shown_kernels = 25; +const shown_stages = 15; + +/// What ran before stamp i: the stage it closes (`n` dispatches), or an encoder's start when `n` is 0. +const Mark = struct { enc: u32 = 0, n: u32 = 0, pipes: [kept]?Id = @splat(null), more: bool = false }; + +const Sum = struct { s: f64 = 0, stages: u64 = 0 }; + +/// One name's rounds, summed: the whole span, inside encoders and between them, by kernel and by stage index. +const Rounds = struct { + name: []u8, + seen: u32 = 0, + done: u32 = 0, + span: f64 = 0, + inside: f64 = 0, + between: f64 = 0, + encoders: u32 = 0, + dispatches: u64 = 0, + kernels: std.StringArrayHashMapUnmanaged(Sum) = .empty, + each: std.ArrayList(f64) = .empty, + keys: std.ArrayList([]const u8) = .empty, + encs: std.ArrayList(u32) = .empty, + fits: bool = true, +}; + +pub const Timeline = struct { + counters: Id, + freq: f64, + want: u32, + on: bool = false, + cur: ?*Rounds = null, + count: usize = 0, + enc: u32 = 0, + pipe: ?Id = null, + open: Mark = .{}, + marks: []Mark, + rounds: std.ArrayList(*Rounds) = .empty, + labels: std.AutoHashMapUnmanaged(usize, []const u8) = .empty, + + pub fn init(device: Id, want: u32) ?*Timeline { + const d = objc.msg(Id, objc.msg(Id, objc.class("MTL4CounterHeapDescriptor"), "alloc", .{}), "init", .{}); + defer objc.release(d); + objc.msg(void, d, "setType:", .{@as(isize, 1)}); + objc.msg(void, d, "setCount:", .{@as(usize, cap)}); + var err: ?Id = null; + const counters = objc.msg(?Id, device, "newCounterHeapWithDescriptor:error:", .{ d, &err }) orelse { + std.log.warn("metal 4 timeline: no timestamp heap ({s})", .{objc.errorText(err)}); + return null; + }; + const t = heap.create(Timeline) catch return null; + t.* = .{ + .counters = counters, + .freq = @floatFromInt(objc.msg(u64, device, "queryTimestampFrequency", .{})), + .want = want, + .marks = heap.alloc(Mark, cap) catch return null, + }; + return t; + } + + pub fn deinit(t: *Timeline) void { + for (t.rounds.items) |r| { + for (r.kernels.keys()) |k| heap.free(k); + r.kernels.deinit(heap); + r.each.deinit(heap); + for (r.keys.items) |k| heap.free(k); + r.keys.deinit(heap); + r.encs.deinit(heap); + heap.free(r.name); + heap.destroy(r); + } + t.rounds.deinit(heap); + var it = t.labels.valueIterator(); + while (it.next()) |v| heap.free(v.*); + t.labels.deinit(heap); + heap.free(t.marks); + objc.release(t.counters); + heap.destroy(t); + } + + pub fn begin(t: *Timeline, name: []const u8) void { + t.on = false; + const r = t.find(name) orelse return; + r.seen += 1; + if (r.seen <= warm or r.done >= t.want) return; + t.on = true; + t.cur = r; + t.count = 0; + t.enc = 0; + t.open = .{}; + } + + fn find(t: *Timeline, name: []const u8) ?*Rounds { + for (t.rounds.items) |r| if (std.mem.eql(u8, r.name, name)) return r; + const r = heap.create(Rounds) catch return null; + r.* = .{ .name = heap.dupe(u8, name) catch return null }; + t.rounds.append(heap, r) catch return null; + return r; + } + + fn stamp(t: *Timeline, e: Id, m: Mark) void { + if (t.count == cap) { + t.on = false; + return; + } + objc.msg(void, e, "writeTimestampWithGranularity:intoHeap:atIndex:", .{ @as(isize, 1), t.counters, t.count }); + t.marks[t.count] = m; + t.count += 1; + } + + pub fn started(t: *Timeline, e: Id) void { + if (!t.on) return; + t.enc += 1; + t.open = .{ .enc = t.enc }; + t.stamp(e, t.open); + } + + pub fn piped(t: *Timeline, id: Id) void { + if (t.on) t.pipe = id; + } + + pub fn dispatched(t: *Timeline) void { + if (!t.on) return; + t.open.n += 1; + for (&t.open.pipes) |*p| { + if (p.* == t.pipe) return; + if (p.* == null) { + p.* = t.pipe; + return; + } + } + t.open.more = true; + } + + pub fn stage(t: *Timeline, e: Id) void { + if (!t.on) return; + t.stamp(e, t.open); + t.open = .{ .enc = t.enc }; + } + + pub fn ended(t: *Timeline, e: Id) void { + t.stage(e); + } + + /// After the round's last wait: its stamps read back and added to its name's sums. + pub fn end(t: *Timeline) void { + if (!t.on) return; + t.on = false; + const r = t.cur orelse return; + if (t.count < 2) return; + const data = objc.msg(?Id, t.counters, "resolveCounterRange:", .{types.Range{ .location = 0, .length = t.count }}) orelse return; + const w: [*]align(1) const u64 = @ptrCast(objc.msg([*]const u8, data, "bytes", .{})); + const first = r.done == 0; + r.done += 1; + r.span += t.secs(w[0], w[t.count - 1]); + r.encoders = t.enc; + var j: usize = 0; + for (1..t.count) |i| { + const d = t.secs(w[i - 1], w[i]); + const m = t.marks[i]; + if (m.n == 0) { + r.between += d; + continue; + } + r.inside += d; + r.dispatches += m.n; + const key = t.keyOf(m) catch continue; + const g = r.kernels.getOrPut(heap, key) catch continue; + if (g.found_existing) heap.free(key) else g.value_ptr.* = .{}; + g.value_ptr.s += d; + g.value_ptr.stages += 1; + if (first) { + r.each.append(heap, d) catch {}; + r.keys.append(heap, heap.dupe(u8, g.key_ptr.*) catch "") catch {}; + r.encs.append(heap, m.enc) catch {}; + } else if (j < r.each.items.len) r.each.items[j] += d else r.fits = false; + j += 1; + } + if (j != r.each.items.len) r.fits = false; + if (r.done == t.want) t.report(r); + } + + fn secs(t: *const Timeline, a: u64, b: u64) f64 { + return if (b > a) @as(f64, @floatFromInt(b - a)) / t.freq else 0; + } + + /// The stage's kernels by label, joined. + fn keyOf(t: *Timeline, m: Mark) ![]u8 { + var out: std.ArrayList(u8) = .empty; + errdefer out.deinit(heap); + for (m.pipes) |p| if (p) |id| { + if (out.items.len > 0) try out.appendSlice(heap, " + "); + try out.appendSlice(heap, t.label(id)); + }; + if (m.more) try out.appendSlice(heap, " + more"); + return out.toOwnedSlice(heap); + } + + fn label(t: *Timeline, id: Id) []const u8 { + const g = t.labels.getOrPut(heap, @intFromPtr(id)) catch return "?"; + if (g.found_existing) return g.value_ptr.*; + const text = if (objc.msg(?Id, id, "label", .{})) |s| std.mem.span(objc.utf8(s)) else "unnamed kernel"; + g.value_ptr.* = heap.dupe(u8, text) catch "?"; + return g.value_ptr.*; + } + + fn report(t: *Timeline, r: *Rounds) void { + _ = t; + const n: f64 = @floatFromInt(r.done); + const ms = 1e3 / n; + var stages: u64 = 0; + for (r.kernels.values()) |v| stages += v.stages; + std.log.info("metal 4 timeline: {s}, {d} rounds after {d} warm: {d} encoders, {d} stages and {d} dispatches a round", .{ r.name, r.done, warm, r.encoders, stages / r.done, r.dispatches / r.done }); + std.log.info("metal 4 timeline: {s}: {d:.3} ms a round from the first stamp to the last, {d:.3} in stages, {d:.3} between encoders", .{ r.name, r.span * ms, r.inside * ms, r.between * ms }); + const order = heap.alloc(usize, r.kernels.count()) catch return; + defer heap.free(order); + for (order, 0..) |*o, i| o.* = i; + const vals = r.kernels.values(); + std.mem.sort(usize, order, vals, struct { + fn more(v: []const Sum, a: usize, b: usize) bool { + return v[a].s > v[b].s; + } + }.more); + std.log.info("metal 4 timeline: {s} by kernel: ms a round, stages a round, us a stage", .{r.name}); + for (order[0..@min(order.len, shown_kernels)]) |i| { + const v = vals[i]; + const per = @as(f64, @floatFromInt(v.stages)) / n; + std.log.info(" {d:>8.3} {d:>6.1} {d:>8.1} {s}", .{ v.s * ms, per, v.s * 1e6 / @as(f64, @floatFromInt(v.stages)), r.kernels.keys()[i] }); + } + if (!r.fits) return std.log.info("metal 4 timeline: {s}: rounds differ in stages, so no stage-by-stage list", .{r.name}); + const idx = heap.alloc(usize, r.each.items.len) catch return; + defer heap.free(idx); + for (idx, 0..) |*o, i| o.* = i; + std.mem.sort(usize, idx, r.each.items, struct { + fn more(v: []const f64, a: usize, b: usize) bool { + return v[a] > v[b]; + } + }.more); + std.log.info("metal 4 timeline: {s}: the longest single stages, us a round", .{r.name}); + for (idx[0..@min(idx.len, shown_stages)]) |i| { + std.log.info(" stage {d:>4} of encoder {d}: {d:>8.1} {s}", .{ i, r.encs.items[i], r.each.items[i] * 1e6 / n, r.keys.items[i] }); + } + } +}; diff --git a/zig/src/native/cuda.zig b/zig/src/native/cuda.zig index 01731ad28a2..5f263b4c45b 100644 --- a/zig/src/native/cuda.zig +++ b/zig/src/native/cuda.zig @@ -180,7 +180,8 @@ pub fn open(a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]c problem.* = try std.fmt.allocPrint(a, "the native CUDA engine has no backend for {s} checkpoints yet", .{o.model_type}); return null; } -fn openWith(comptime F: type, a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]const u8) !?api.Opened { +fn openWith(comptime F: type, a: Allocator, gpa: Allocator, io: std.Io, asked: api.Open, problem: *[]const u8) !?api.Opened { + const o = family_memory.familyOpen(F, asked); if (refusals.family(F, o)) |why| { problem.* = why; return null; diff --git a/zig/src/native/cuda_families.zig b/zig/src/native/cuda_families.zig index 26b85155beb..bbcfc640a25 100644 --- a/zig/src/native/cuda_families.zig +++ b/zig/src/native/cuda_families.zig @@ -14,7 +14,7 @@ const dory = @import("dory"); const qwen3 = @import("qwen3_cuda"); /// CUDA families provide metadata, open their lane backend and explain their refusals. -pub const registry = .{ nemotron.native, nemotron.omni, glm.native, minimax.native, qwen35.native, qwen35.native_moe, flashnext.native, kolibri1.native, gemma4.native, gemma4.native31, spark25.native, dory.native, @import("dots_mocr_cuda").native, @import("lfm2_moe_cuda").native }; +pub const registry = .{ nemotron.native, nemotron.omni, glm.native, minimax.native, qwen35.native, qwen35.native_moe, flashnext.native, kolibri1.native, gemma4.native, gemma4.native31, spark25.native, dory.native, @import("dots_mocr_cuda").native, @import("muse_spark").native, @import("lfm2_moe_cuda").native }; pub const families: []const api.Family = blk: { var out: [registry.len + 6]api.Family = undefined; for (registry, 0..) |F, i| out[i] = .{ .model_type = F.model_type, .formats = F.formats, .decision_formats = if (@hasDecl(F, "decision_formats")) F.decision_formats else &.{} }; diff --git a/zig/src/native/cuda_family_memory.zig b/zig/src/native/cuda_family_memory.zig index b1f1b043d99..56db251f435 100644 --- a/zig/src/native/cuda_family_memory.zig +++ b/zig/src/native/cuda_family_memory.zig @@ -61,10 +61,18 @@ pub fn weights(comptime F: type, a: Allocator, io: std.Io, o: api.Open, problem: problem.* = try std.fmt.allocPrint(a, "cannot estimate checkpoint weight files ({s}); refusing CUDA admission", .{@errorName(err)}); return null; }; - const text = if (@hasDecl(F, "placementWeightBytes")) try F.placementWeightBytes(a, io, o.dir, o.tp, o.rank, o.drafts) else if (@hasDecl(F, "weightShare")) F.weightShare(a, io, o.dir, whole, o.drafts) else whole; + const text = if (@hasDecl(F, "placementWeightBytes")) try F.placementWeightBytes(a, io, o.dir, o.tp, o.rank, o.drafts) else if (@hasDecl(F, "weightShare")) share(F, a, io, o.dir, whole, o.drafts) catch |err| { + problem.* = (if (@hasDecl(F, "explains_open")) F.explain(null, err) else null) orelse try std.fmt.allocPrint(a, "cannot size this rank's weights ({s})", .{@errorName(err)}); + return null; + } else whole; return text + try @import("cuda_vision_offer.zig").weightBytes(F, a, io, o); } +/// `F.weightShare`, plain bytes or an error union (a family whose split settings can be refused). +fn share(comptime F: type, a: Allocator, io: std.Io, dir: []const u8, whole: u64, drafts: bool) anyerror!u64 { + return F.weightShare(a, io, dir, whole, drafts); +} + /// Logs, from 0.25 GiB, the free pages on the per-CPU lists that a pool's reading counted. pub fn noteParked(p: budget.Pool, what: []const u8) void { const line = "{s} counts the {d:.2} GiB free on the per-CPU page lists beyond their resting level (MemAvailable does not)"; @@ -76,6 +84,15 @@ pub fn room(comptime F: type, ptr: *anyopaque, local: u64) !u64 { return local; } +/// `o` with the family's own prompt-cache budget (`prompt_cache_gib`) when --prompt-cache-gib is not given. +pub fn familyOpen(comptime F: type, o: api.Open) api.Open { + if (comptime !@hasDecl(F, "prompt_cache_gib")) return o; + if (o.prompt_cache_gib != null) return o; + var q = o; + q.prompt_cache_gib = F.prompt_cache_gib; + return q; +} + pub fn read(_: ?*anyopaque, reset_peak: bool) ?api.Memory { const u = cuda.usage(reset_peak); return .{ .active = u.device, .cache = 0, .peak = u.peak, .pinned = u.host }; @@ -102,6 +119,18 @@ test "rank room is agreed before stream admission and preserves a single-rank fa try std.testing.expectEqual(@as(u64, 7), try room(Pair, &context, 7)); } +test "a family's own prompt-cache budget applies only where the operator set none" { + const Plain = struct {}; + const Own = struct { + pub const prompt_cache_gib: f64 = 1; + }; + const unset: api.Open = .{ .dir = "d", .model_type = "m" }; + try std.testing.expectEqual(@as(?f64, null), familyOpen(Plain, unset).prompt_cache_gib); + try std.testing.expectEqual(@as(?f64, 1), familyOpen(Own, unset).prompt_cache_gib); + const off: api.Open = .{ .dir = "d", .model_type = "m", .prompt_cache_gib = 0 }; + try std.testing.expectEqual(@as(?f64, 0), familyOpen(Own, off).prompt_cache_gib); +} + test { _ = @import("cuda_family_memory_test.zig"); } diff --git a/zig/src/native/cuda_startup_test.zig b/zig/src/native/cuda_startup_test.zig index 1a7d265a810..a9630daaef9 100644 --- a/zig/src/native/cuda_startup_test.zig +++ b/zig/src/native/cuda_startup_test.zig @@ -50,7 +50,7 @@ fn check(value: ?[:0]const u8, comptime rows: u32) !void { } test "CUDA startup: unset Flash Next chunk reports the default stored pass" { - try check(null, 1536); + try check(null, 3072); } test "CUDA startup: Flash Next chunk 4096 reports the stored pass" { diff --git a/zig/src/native/draft_sources_xpu_test.zig b/zig/src/native/draft_sources_xpu_test.zig index 11eb9fbac9b..887c4be48ac 100644 --- a/zig/src/native/draft_sources_xpu_test.zig +++ b/zig/src/native/draft_sources_xpu_test.zig @@ -3,6 +3,7 @@ const check = @import("draft_sources_check.zig").check; const present = @import("draft_sources_check.zig").present; comptime { + _ = @import("xpu_sampled_topk_test.zig"); // and so do these _ = @import("xpu_dflash2_test.zig"); // its tests run under this file's "draft sources:" filter _ = @import("xpu_dflash2_depth_test.zig"); // the core depth sweep on the XPU adapter _ = @import("xpu_logrow.zig"); // the logprob row's own test diff --git a/zig/src/native/hip.zig b/zig/src/native/hip.zig index 344a1319f5d..eed8a2d8eec 100644 --- a/zig/src/native/hip.zig +++ b/zig/src/native/hip.zig @@ -522,7 +522,7 @@ test "the group flags: one rank source, a supported world, a master past one ran try std.testing.expectError(error.Refused, checkGroup(a, outside, &problem)); } -test "--drafter is refused before any load, on every rank, until the HIP engine runs DFlash2" { +test "--drafter, and --mtp-drafts past three, are refused before any load, on every rank" { var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); defer arena.deinit(); const a = arena.allocator(); @@ -535,6 +535,12 @@ test "--drafter is refused before any load, on every rank, until the HIP engine follower.rank = 1; follower.master = "node0"; try std.testing.expectError(error.Refused, checkGroup(a, follower, &problem)); + // three drafts and fewer are not refused + var o: api.Open = .{ .dir = "d", .model_type = "qwen4_exp", .mtp_drafts = 3 }; + try checkGroup(a, o, &problem); + o.mtp_drafts = 4; + try std.testing.expectError(error.Refused, checkGroup(a, o, &problem)); + try std.testing.expectEqualStrings("--mtp-drafts 4: the HIP engine drafts at most 3", problem); } test "--kv-cache fp8 is refused by name on HIP; bf16 caches are not" { diff --git a/zig/src/native/metal.zig b/zig/src/native/metal.zig index 644f73cff8e..27147a7567b 100644 --- a/zig/src/native/metal.zig +++ b/zig/src/native/metal.zig @@ -153,7 +153,7 @@ pub fn open(a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]c return @import("kimi_metal.zig").open(a, gpa, io, o, problem); if (std.mem.eql(u8, o.model_type, "qwen4") or std.mem.eql(u8, o.model_type, "qwen4_text")) return @import("qwen4_metal.zig").open(a, gpa, io, o, problem); if (std.mem.eql(u8, o.model_type, "qwen3")) return @import("qwen3_metal.zig").open(a, gpa, io, o, problem); - const dense = (std.mem.eql(u8, o.model_type, "qwen3_5") and @import("qwen27_engine.zig").owns(a, io, o.dir)) or std.mem.eql(u8, o.model_type, "qwen3_5_moe"); + const dense = ownsQwen27(a, io, o.model_type, o.dir); if (try refusal(a, o, dense)) |why| { problem.* = why; return null; @@ -319,13 +319,35 @@ fn refusal(a: Allocator, o: api.Open, dense: bool) !?[]const u8 { return try std.fmt.allocPrint(a, "--learn learns prompt prefixes for Nemotron, Flash Next and GLM-5.3-Flash only{s}: serve {s} without --learn, --learn-dir or --learn-gib", .{ or_talks, name }); } -/// Qwen3.8-27B and Qwen3.5-MoE on the lane host: shared rounds, DFlash2 drafts for up to TF_Q27_DRAFT_SLOTS streams. -fn openQwen27(a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]const u8) !?api.Opened { - const context = o.context orelse 32768; - if (context <= 0 or context > 262144) { - problem.* = try std.fmt.allocPrint(a, "--context {d} is outside this Qwen checkpoint's 1 to 262,144 tokens", .{context}); +/// Whether `dir` opens on the Qwen3.8-27B-class engine: the 27B-class qwen3_5 checkpoints, and Qwen3.5-MoE. +fn ownsQwen27(a: Allocator, io: std.Io, t: []const u8, dir: []const u8) bool { + return (std.mem.eql(u8, t, "qwen3_5") and @import("qwen27_engine.zig").owns(a, io, dir)) or std.mem.eql(u8, t, "qwen3_5_moe"); +} + +/// The context a Qwen3.8-27B-class start serves (--context, else 32,768); null with `problem` set past 1 to 262,144. +fn qwen27Context(a: Allocator, context: ?i64, problem: *[]const u8) !?u32 { + const n = context orelse 32768; + if (n <= 0 or n > 262144) { + problem.* = try std.fmt.allocPrint(a, "--context {d} is outside this Qwen checkpoint's 1 to 262,144 tokens", .{n}); return null; } + return @intCast(n); +} + +pub const Qwen27Budget = @import("qwen27_reserve.zig").Budget; +/// What a Qwen3.8-27B-class start keeps free of its working set. +pub const qwen27_margin = tf.qwen27.prompt_memory.margin; + +/// `serve`'s startup charge for a Qwen3.8-27B-class `dir` (no drafter or images); null for others or a refused context. +pub fn qwen27Budget(a: Allocator, io: std.Io, t: []const u8, dir: []const u8, weights: u64, context: ?i64, streams: u32, fixed: bool, problem: *[]const u8) !?Qwen27Budget { + if (!ownsQwen27(a, io, t, dir)) return null; + const n = try qwen27Context(a, context, problem) orelse return null; + return try @import("qwen27_reserve.zig").budget(a, io, dir, weights, n, streams, fixed); +} + +/// Qwen3.8-27B and Qwen3.5-MoE on the lane host: shared rounds, DFlash2 drafts for up to TF_Q27_DRAFT_SLOTS streams. +fn openQwen27(a: Allocator, gpa: Allocator, io: std.Io, o: api.Open, problem: *[]const u8) !?api.Opened { + const context = try qwen27Context(a, o.context, problem) orelse return null; if (o.drafts and o.drafter != null and o.drafter_bits != 0 and o.drafter_bits != 4) { problem.* = "--drafter-bits takes 0 (bf16) or 4"; return null; diff --git a/zig/src/native/qwen27_reserve.zig b/zig/src/native/qwen27_reserve.zig new file mode 100644 index 00000000000..df8b2733e26 --- /dev/null +++ b/zig/src/native/qwen27_reserve.zig @@ -0,0 +1,65 @@ +//! What a Qwen3.8-27B-class start reserves beside its weights: `serve` charges it, and `info` prints it unloaded. +const std = @import("std"); +const mtl = @import("metal"); +const tf = @import("tensorfold"); +const q = tf.qwen27; +const memory = q.prompt_memory; +const Config = q.config.Config; + +/// The rows the deferred load gives the frame before startup widens it. +pub const loaded_rows: u32 = 128; + +const env: @import("sys").environment.Process = .{}; + +/// A development cap on the working set startup counts. +pub fn cap() ?[]const u8 { + return env.get("TF_QWEN27_WORKING_SET_BYTES"); +} + +/// The prompt fit startup charges: `current_rows` is the frame the model holds, `left` the room beside it. +pub fn fit(c: Config, capacity: u32, window: u32, streams: u32, units: bool, ring: usize, planes: usize, current_rows: u32, left: usize) memory.Fit { + return .{ .config = c, .context = capacity + window, .slots = @max(streams, 1), .shared = units, .ring = ring, .planes = planes, .current_rows = current_rows, .left = left }; +} + +fn rowsValue() ?[]const u8 { + return env.get("TF_PROMPT_ROWS"); +} + +/// The prompt rows asked for: a valid TF_PROMPT_ROWS, else the chip's default. +pub fn requested(generation: u32, moe: bool) u32 { + return q.prompt_rows.requested(generation, moe, rowsValue()); +} + +/// The prompt rows startup takes: the request when it fits (always when named), never under the window. +pub fn rows(f: memory.Fit, generation: u32, window: u32) !u32 { + return @max(window, try f.choose(requested(generation, f.config.moe()), q.prompt_rows.override(rowsValue()) != null)); +} + +pub const Budget = struct { + context: u32, + streams: u32, + rows: u32, + /// The streams that fit beside the weights and the margin; 0 when not one does. + slots: u32, + /// Weights, the widened frame, and the charged streams' KV, state and prompt scratch. + total: usize, + working_set: usize, +}; + +/// Startup's charge for `dir` on this Mac, no drafter or images; `weights` bytes stand in for the loaded model. +pub fn budget(a: std.mem.Allocator, io: std.Io, dir: []const u8, weights: u64, context: u32, streams: u32, fixed: bool) !Budget { + const path = try std.fs.path.join(a, &.{ dir, "config.json" }); + const text = try std.Io.Dir.cwd().readFileAlloc(io, path, a, .limited(16 << 20)); + const c = try q.config.parse(a, text, null); + if (context == 0 or context > c.max_position) return error.ContextFull; + const dev = try mtl.Device.init(); + defer dev.deinit(); + const units = dev.tensorUnits(); + const window = try @import("qwen27_lanes.zig").windowRows(units); + const current = @max(loaded_rows, q.model.promptRows(c, 0)); + const held = @as(usize, @intCast(weights)) + memory.frameBytes(c, current); + const f = fit(c, context, window, streams, units, 0, q.taps.layers.len, current, try memory.room(dev.maxWorkingSet(), held, cap())); + const r = try rows(f, dev.generation(), window); + const slots = f.streams(r, fixed) catch |err| if (err == error.TooManyStreams) 0 else return err; + return .{ .context = context, .streams = streams, .rows = r, .slots = slots, .total = held + try f.cost(r, if (slots == 0) streams else slots), .working_set = try memory.workingSet(dev.maxWorkingSet(), cap()) }; +} diff --git a/zig/src/native/qwen27_served.zig b/zig/src/native/qwen27_served.zig index 1b5afbef1ee..b353caac83c 100644 --- a/zig/src/native/qwen27_served.zig +++ b/zig/src/native/qwen27_served.zig @@ -15,6 +15,7 @@ const Resident = @import("resident.zig").Resident; const lb = @import("qwen27_lanes.zig"); pub const lanes_backend = lb; const startup = @import("qwen27_startup.zig"); +const reserve = @import("qwen27_reserve.zig"); const StartupLine = startup.StartupLine; const disk = @import("qwen27_disk.zig"); const images = @import("qwen27_images.zig"); @@ -202,9 +203,7 @@ fn room(model: *const q.model.Model) usize { } /// TF_QWEN27_WORKING_SET_BYTES: a development cap on the device's reported working set. -fn cap() ?[]const u8 { - return if (std.c.getenv("TF_QWEN27_WORKING_SET_BYTES")) |v| std.mem.span(v) else null; -} +const cap = reserve.cap; /// Whether a new slot's `bytes` fit in `free`, once kept prompt states (never the one `restoring`) give theirs back. fn takeRoom(cache: ?*pc.Store, free: usize, bytes: usize, restoring: ?pc.Saved, prompt: []const u32) bool { @@ -287,7 +286,7 @@ pub fn open(gpa: Allocator, io: std.Io, dir: []const u8, o: Options, a: Allocato why.* = try drafterRefusal(a, dir, d, err); return err; }; - const model = try q.model.Model.loadDeferred(gpa, io, dir, 128); + const model = try q.model.Model.loadDeferred(gpa, io, dir, reserve.loaded_rows); errdefer model.deinit(); if (o.mtp) |m| model.loadMtp(io, m) catch |err| { why.* = try std.fmt.allocPrint(a, "--mtp-drafts: the MTP layer cannot load from {s} ({s})", .{ m, @errorName(err) }); @@ -351,10 +350,9 @@ pub fn attach(parent: Allocator, io: std.Io, model: *q.model.Model, drafter: ?*q var draft_owned = owns_draft; errdefer if (draft_owned) draft_model.?.deinit(); const memory = q.prompt_memory; - const fit_prompt = memory.Fit{ .config = model.config, .context = capacity + window, .slots = @max(o.streams, 1), .shared = model.device.tensorUnits(), .ring = if (draft_model) |d| @as(usize, d.ring().window) * d.ring().stride else 0, .planes = if (draft_model) |d| d.graph.config.tap_count else q.taps.layers.len, .current_rows = model.frame.capacity, .left = room(model) }; - const value = if (std.c.getenv("TF_PROMPT_ROWS")) |v| std.mem.span(v) else null; - const row_policy = q.prompt_rows; - const rows = @max(window, try fit_prompt.choose(row_policy.requested(model.device.generation(), model.config.moe(), value), row_policy.override(value) != null)); + const shared = try q.simd_attention.sharedPrefix(model.device.tensorUnits()); + const fit_prompt = reserve.fit(model.config, capacity, window, o.streams, shared, if (draft_model) |d| @as(usize, d.ring().window) * d.ring().stride else 0, if (draft_model) |d| d.graph.config.tap_count else q.taps.layers.len, model.frame.capacity, room(model)); + const rows = try reserve.rows(fit_prompt, model.device.generation(), window); const slots = fit_prompt.streams(rows, o.streams_fixed) catch |err| { const dev = model.device; const ram: ?usize = if (cache_fit.ram()) |r| @intCast(r) else null; @@ -367,7 +365,7 @@ pub fn attach(parent: Allocator, io: std.Io, model: *q.model.Model, drafter: ?*q model.frame.deinit(); model.frame = next; } - std.log.info("qwen27: prompt capacity={d} rows, startup stream and scratch reserve={d} bytes", .{ rows, try memory.runnerBytes(model.config, capacity + window, slots, rows, model.device.tensorUnits(), fit_prompt.ring, fit_prompt.planes) }); + std.log.info("qwen27: prompt capacity={d} rows, startup stream and scratch reserve={d} bytes", .{ rows, try memory.runnerBytes(model.config, capacity + window, slots, rows, shared, fit_prompt.ring, fit_prompt.planes) }); h.gpa = gpa; h.model = model; h.owns_model = false; @@ -394,7 +392,7 @@ pub fn attach(parent: Allocator, io: std.Io, model: *q.model.Model, drafter: ?*q if (h.mtp) |*d| h.back.mtp = d; errdefer h.back.deinit(); h.back.serial_copy_match = policy.serialCopyMatch(units, window, lanes_value); - h.back.chunk = h.runner.promptRows(@min(rows, row_policy.requested(model.device.generation(), model.config.moe(), value))); + h.back.chunk = h.runner.promptRows(@min(rows, reserve.requested(model.device.generation(), model.config.moe()))); h.back.grow = .{ .ctx = h, .room = Host.roomFor, .added = Host.added }; h.back.vision = o.images; if (h.draft != null or h.mtp != null) try h.back.measure(io); diff --git a/zig/src/native/xpu.zig b/zig/src/native/xpu.zig index 6482133363a..185ee455bc5 100644 --- a/zig/src/native/xpu.zig +++ b/zig/src/native/xpu.zig @@ -29,7 +29,26 @@ fn pickCtx(ctx: *anyopaque, row: []const f32, position: u64, s: api.Sampling) !u return pickRow(gpa.*, row, position, s); } -fn pickRow(gpa: Allocator, row: []const f32, position: u64, s: api.Sampling) !u32 { +/// The same draw from the card's top_k candidates (1 <= top_k <= 64), widened to f64 as pickRow's scan holds them. +fn pickCandCtx(ctx: *anyopaque, vals: []const f32, ids: []const u32, bad: bool, position: u64, s: api.Sampling) !u32 { + const gpa: *const Allocator = @ptrCast(@alignCast(ctx)); + return pickCand(gpa.*, vals, ids, bad, position, s); +} + +pub fn pickCand(gpa: Allocator, vals: []const f32, ids: []const u32, bad: bool, position: u64, s: api.Sampling) !u32 { + if (bad) return error.NonfiniteLogits; // a value anywhere in the row, as pickRow's scan finds it + const k: usize = s.top_k; + if (s.temperature <= 0 or k == 0 or k > 64 or vals.len != k or ids.len != k) return error.BadCandidates; + var v64: [64]f64 = undefined; + var id64: [64]u64 = undefined; + for (vals, ids, v64[0..k], id64[0..k]) |v, id, *o, *oi| { + o.* = v; + oi.* = id; + } + return @intCast(try sampling.choose(gpa, v64[0..k], id64[0..k], position, s)); +} + +pub fn pickRow(gpa: Allocator, row: []const f32, position: u64, s: api.Sampling) !u32 { if (s.temperature <= 0 or s.top_k == 0 or s.top_k > 256) return pickAll(gpa, row, position, s); const k: usize = s.top_k; var vals: [256]f64 = undefined; @@ -156,7 +175,7 @@ fn openLanes(gpa: Allocator, io: std.Io, runner: *xq.Runner, drafter: ?*Drafter, gpa_box.* = gpa; h.gpa = gpa; h.cache = null; // gpa.create leaves the defaults unset - h.back = .{ .gpa = gpa, .runner = runner, .drafter = drafter, .pick = pickCtx, .pick_ctx = gpa_box, .slots = slots }; + h.back = .{ .gpa = gpa, .runner = runner, .drafter = drafter, .pick = pickCtx, .pick_cand = pickCandCtx, .pick_ctx = gpa_box, .slots = slots }; if (std.c.getenv("XPU_BLOCK")) |v| h.back.block = std.fmt.parseInt(u32, std.mem.span(v), 10) catch 8; if (std.c.getenv("XPU_TREE")) |v| h.back.nodes = std.fmt.parseInt(u32, std.mem.span(v), 10) catch 15; if (drafter != null) { diff --git a/zig/src/native/xpu_lanes.zig b/zig/src/native/xpu_lanes.zig index fd208af6fec..270aa26c9b6 100644 --- a/zig/src/native/xpu_lanes.zig +++ b/zig/src/native/xpu_lanes.zig @@ -20,6 +20,8 @@ pub const Lanes = struct { drafter: ?*Drafter, pick: *const fn (ctx: *anyopaque, row: []const f32, position: u64, s: api.Sampling) anyerror!u32, pick_ctx: *anyopaque, + /// The draw from a row's card top_k (values, ids, whether the row holds a non-finite value); null: the host draws. + pick_cand: ?*const fn (ctx: *anyopaque, vals: []const f32, ids: []const u32, bad: bool, position: u64, s: api.Sampling) anyerror!u32 = null, slots: u32, block: u32 = 8, nodes: u32 = 15, @@ -57,6 +59,22 @@ pub const Lanes = struct { /// Rows [start, start + rows) of a prompt pass in `slot`, their taps in acts.taps. pub const Tail = struct { slot: u32, start: u64, rows: u32 }; + /// The candidates the card keeps for a sampled row: its top_k when that is 1 to 64 and it is not greedy, else 0. + pub fn candidateK(sp: api.Sampling) u32 { + return if (sp.temperature > 0 and sp.top_k >= 1 and sp.top_k <= xq.cand.TOPK_MAX) sp.top_k else 0; + } + + /// The candidates the next forward keeps for a stream sampling with `sp`: none without the host's rule for them. + fn candK(b: *const Lanes, sp: ?api.Sampling) u32 { + return if (b.pick_cand != null) (if (sp) |x| candidateK(x) else 0) else 0; + } + + /// Row `row` of the last forward drawn at `position`: from its card top_k when it kept them, else from its logits. + fn drawRow(b: *Lanes, row: u32, position: u64, sp: api.Sampling) !u32 { + if (b.pick_cand) |f| if (b.runner.candidates(row, candidateK(sp))) |c| return f(b.pick_ctx, c.vals, c.ids, c.bad, position, sp); + return b.pick(b.pick_ctx, try b.runner.rowLogits(row), position, sp); + } + fn self(ptr: *anyopaque) *Lanes { return @ptrCast(@alignCast(ptr)); } @@ -376,8 +394,10 @@ pub const Lanes = struct { defer r.taps_on = false; b.tapped = 0; b.tail = null; + r.cand.k = b.candK(s.sampling); + defer r.cand.k = 0; try r.step(try b.value(feed)); - return b.push(try b.draw(s, slot, if (s.sampling != null) try r.logits() else null, position)); + return b.push(if (s.sampling) |sp| try b.drawRow(0, position, sp) else b.lastOf(slot)); } fn readFn(ptr: *anyopaque, handle: u64) anyerror!u32 { @@ -409,6 +429,11 @@ pub const Lanes = struct { defer r.taps_on = false; b.tapped = 0; b.tail = null; + r.cand.k = 0; + for (windows) |w| if (w.masks.len == 0) { + r.cand.k = @max(r.cand.k, b.candK(w.stream.sampling)); + }; + defer r.cand.k = 0; try r.verifyMulti(wins[0..windows.len]); b.tapped = windows.len; // structured greedy rows: their tokens among their grammars' on the device, all in one pass @@ -445,8 +470,7 @@ pub const Lanes = struct { row += 1; continue; } - const logits = if (w.stream.sampling != null) try r.rowLogits(row) else null; - o.sampled[j] = if (w.stream.sampling) |sp| try b.pick(b.pick_ctx, logits.?, w.positions[j], sp) else r.block[row]; + o.sampled[j] = if (w.stream.sampling) |sp| try b.drawRow(row, w.positions[j], sp) else r.block[row]; row += 1; } @memcpy(o.drafts, w.tokens); @@ -540,6 +564,8 @@ pub const Lanes = struct { if (s.isCancelled()) return error.Cancelled; r.taps_on = true; defer r.taps_on = false; + r.cand.k = b.candK(s.sampling); + defer r.cand.k = 0; var sampled: Sampled = .{ .b = b, .s = s.sampling orelse .{ .seed = 0 } }; const drawer: ?xq.drafter.Draw = if (s.sampling) |sp| .{ .ctx = &sampled, .row = Sampled.row, .gumbel = Sampled.gumbel, .temperature = sp.temperature } else null; var logged: logrow.Logged = .{ .runner = b.runner, .k = s.logprobs orelse 0 }; @@ -564,7 +590,7 @@ pub const Lanes = struct { s: api.Sampling, fn row(c_: *anyopaque, row_: u32, position: u64) !u32 { const c: *@This() = @ptrCast(@alignCast(c_)); - return c.b.pick(c.b.pick_ctx, try c.b.runner.rowLogits(row_), position, c.s); + return c.b.drawRow(row_, position, c.s); } fn gumbel(c_: *anyopaque, position: u64, id: u64) f64 { const c: *@This() = @ptrCast(@alignCast(c_)); diff --git a/zig/src/native/xpu_sampled_topk_test.zig b/zig/src/native/xpu_sampled_topk_test.zig new file mode 100644 index 00000000000..0d9bdd15453 --- /dev/null +++ b/zig/src/native/xpu_sampled_topk_test.zig @@ -0,0 +1,156 @@ +//! A sampled XPU row drawn from the card's top_k candidates equals the draw over its whole row, on the host. +const std = @import("std"); +const api = @import("engine_api"); +const native = @import("xpu.zig"); +const Lanes = @import("xpu_lanes.zig").Lanes; + +const gpa = std.testing.allocator; +const SEG = 1024; // ids one topk_part group takes +const KMAX = 64; + +/// The card's two kernels on the host: each group's K best of its 1024 ids, then their merge; the row's flag beside. +fn card(row: []const f32, k: usize, vals: []f32, ids: []u32) bool { + const parts = (row.len + SEG - 1) / SEG; + var lv: [256][KMAX]f32 = undefined; + var li: [256][KMAX]u32 = undefined; + var bad = false; + for (0..parts) |p| { + const seg = row[p * SEG ..][0..@min(SEG, row.len - p * SEG)]; + for (seg) |x| bad = bad or !std.math.isFinite(x); + var n: usize = 0; + for (seg, 0..) |x, i| { + const v: f32 = if (std.math.isNan(x)) -std.math.inf(f32) else x; + if (n == k and !(v > lv[p][k - 1])) continue; + var j = if (n < k) n else k - 1; + if (n < k) n += 1; + while (j > 0 and v > lv[p][j - 1]) : (j -= 1) { + lv[p][j] = lv[p][j - 1]; + li[p][j] = li[p][j - 1]; + } + lv[p][j] = v; + li[p][j] = @intCast(p * SEG + i); + } + for (n..k) |j| { + lv[p][j] = -std.math.inf(f32); + li[p][j] = std.math.maxInt(i32); + } + } + var ptr: [256]usize = @splat(0); + for (0..k) |out| { + var best: usize = 0; + var found = false; + for (0..parts) |p| { + if (ptr[p] >= k) continue; + const v = lv[p][ptr[p]]; + const i = li[p][ptr[p]]; + if (!found or v > lv[best][ptr[best]] or (v == lv[best][ptr[best]] and i < li[best][ptr[best]])) { + best = p; + found = true; + } + } + vals[out] = lv[best][ptr[best]]; + ids[out] = li[best][ptr[best]]; + ptr[best] += 1; + } + return bad; +} + +/// A row of `n` fp16 values from a few levels (so many tie), signed zeros among them. +fn fill(rng: std.Random, row: []f32, levels: u32) void { + for (row) |*v| { + const l = rng.uintLessThan(u32, levels); + v.* = if (l == 0) (if (rng.boolean()) -0.0 else 0.0) else @as(f32, @floatFromInt(l)) / 4 - 3; + } +} + +const Cfg = struct { top_k: u32, top_p: f64, min_p: f64, temperature: f64 }; +const cfgs = [_]Cfg{ + .{ .top_k = 20, .top_p = 0.95, .min_p = 0, .temperature = 1 }, + .{ .top_k = 1, .top_p = 1, .min_p = 0, .temperature = 0.7 }, + .{ .top_k = 64, .top_p = 0.5, .min_p = 0.05, .temperature = 1.7 }, + .{ .top_k = 33, .top_p = 1, .min_p = 0.1, .temperature = 0.3 }, + .{ .top_k = 7, .top_p = 0, .min_p = 0, .temperature = 1 }, +}; + +test "draft sources: a draw from the card's candidates is the draw over the whole row, random rows and ties" { + var prng = std.Random.DefaultPrng.init(0x2830); + const rng = prng.random(); + const sizes = [_]usize{ 70, 1023, 1024, 1025, 3000, 5121 }; + var drawn: usize = 0; + for (sizes) |n| for ([_]u32{ 3, 12, 400 }) |levels| { + const row = try gpa.alloc(f32, n); + defer gpa.free(row); + for (0..3) |_| { + if (levels == 400) { + for (row) |*v| v.* = @as(f32, @floatCast(rng.floatNorm(f64) * 3)); + } else fill(rng, row, levels); + for (cfgs) |cfg| { + if (cfg.top_k > n) continue; + var vals: [KMAX]f32 = undefined; + var ids: [KMAX]u32 = undefined; + const k = cfg.top_k; + try std.testing.expect(!card(row, k, &vals, &ids)); + for (0..4) |pos| { + const s: api.Sampling = .{ .seed = rng.int(u63), .temperature = cfg.temperature, .top_k = cfg.top_k, .top_p = cfg.top_p, .min_p = cfg.min_p }; + const want = try native.pickRow(gpa, row, 100 + pos, s); + const got = try native.pickCand(gpa, vals[0..k], ids[0..k], false, 100 + pos, s); + try std.testing.expectEqual(want, got); + drawn += 1; + } + } + } + }; + try std.testing.expect(drawn > 500); +} + +test "draft sources: the candidates are the top_k of the whole row in main's order, ties to the lower id" { + var prng = std.Random.DefaultPrng.init(0x2831); + const rng = prng.random(); + const row = try gpa.alloc(f32, 4097); + defer gpa.free(row); + for ([_]u32{ 1, 2, 5 }) |levels| { + fill(rng, row, levels); + var vals: [KMAX]f32 = undefined; + var ids: [KMAX]u32 = undefined; + _ = card(row, KMAX, &vals, &ids); + const order = try gpa.alloc(u32, row.len); + defer gpa.free(order); + for (order, 0..) |*o, i| o.* = @intCast(i); + std.mem.sort(u32, order, row, struct { + fn before(r: []const f32, a: u32, b: u32) bool { + return r[a] > r[b] or (r[a] == r[b] and a < b); + } + }.before); + try std.testing.expectEqualSlices(u32, order[0..KMAX], &ids); + for (vals, ids) |v, i| try std.testing.expectEqual(@as(u32, @bitCast(row[i])), @as(u32, @bitCast(v))); + } +} + +test "draft sources: a value that is not finite anywhere in the row fails the draw, as the whole-row scan does" { + var prng = std.Random.DefaultPrng.init(0x2832); + const rng = prng.random(); + const row = try gpa.alloc(f32, 3000); + defer gpa.free(row); + const bad = [_]f32{ std.math.nan(f32), std.math.inf(f32), -std.math.inf(f32) }; + for (bad) |x| for ([_]usize{ 0, 1023, 1024, 2999 }) |at| { + fill(rng, row, 12); + row[at] = x; + var vals: [KMAX]f32 = undefined; + var ids: [KMAX]u32 = undefined; + const flag = card(row, 20, &vals, &ids); + try std.testing.expect(flag); + const s: api.Sampling = .{ .seed = 5, .top_k = 20 }; + try std.testing.expectError(error.NonfiniteLogits, native.pickRow(gpa, row, 9, s)); + try std.testing.expectError(error.NonfiniteLogits, native.pickCand(gpa, vals[0..20], ids[0..20], flag, 9, s)); + }; +} + +test "draft sources: the card keeps candidates only for a sampled row with a top_k from 1 to 64" { + const base: api.Sampling = .{ .seed = 1 }; + try std.testing.expectEqual(@as(u32, 20), Lanes.candidateK(base)); + try std.testing.expectEqual(@as(u32, 1), Lanes.candidateK(.{ .seed = 1, .top_k = 1 })); + try std.testing.expectEqual(@as(u32, 64), Lanes.candidateK(.{ .seed = 1, .top_k = 64 })); + try std.testing.expectEqual(@as(u32, 0), Lanes.candidateK(.{ .seed = 1, .top_k = 65 })); + try std.testing.expectEqual(@as(u32, 0), Lanes.candidateK(.{ .seed = 1, .top_k = 0 })); + try std.testing.expectEqual(@as(u32, 0), Lanes.candidateK(.{ .seed = 1, .temperature = 0 })); +} diff --git a/zig/src/platform/environment.zig b/zig/src/platform/environment.zig index 438892aa48c..8809e92f90f 100644 --- a/zig/src/platform/environment.zig +++ b/zig/src/platform/environment.zig @@ -3,7 +3,7 @@ const std = @import("std"); const sys = @import("sys.zig"); pub const Error = error{InvalidEnvironment}; -pub const Scope = enum { common, cuda, metal, xpu, slide, hooks, dsv41, gemma4, drama3, glm, flashnext, nemotron, minimax_m3 }; +pub const Scope = enum { common, cuda, metal, xpu, slide, hooks, dsv41, gemma4, drama3, glm, flashnext, nemotron, minimax_m3, chat }; pub const Kind = enum { u32, u64, size, percent, positive, device, segments, mib, bit_width, word, prompt, flag, toggle, real, positive_real, signed_real, range, path }; pub const Rule = struct { name: [:0]const u8, @@ -45,6 +45,7 @@ pub const rules = [_]Rule{ .{ .name = "TENSORFOLD_RESTORE_PREFETCH_MS", .scope = .common, .kind = .u64, .trim = " \t", .first_digit = true, .forms = "whole unsigned 64-bit milliseconds (capped at 1099511627776)" }, .{ .name = "TENSORFOLD_TOOL_ID_KEY_FILE", .scope = .common, .kind = .path, .forms = "a path without control characters to a file only its owner can read, holding at least 32 key bytes" }, .{ .name = "TENSORFOLD_CUDA_KERNELS", .scope = .cuda, .kind = .path, .forms = "a captured kernel set's folder without control characters, or native for the engine's own kernels" }, + .{ .name = "TF_NCCL_LIB", .scope = .cuda, .kind = .path, .forms = "an NCCL library path without control characters, or blank for libnccl.so.2" }, .{ .name = "TF_CUDA_DEVICE", .scope = .cuda, .kind = .device, .trim = " ", .forms = "a whole GPU ordinal from 0 to 4294967295, or empty for the default" }, .{ .name = "TF_CUDA_SEGMENTS", .scope = .cuda, .kind = .segments, .trim = " ", .forms = "a whole number from 1 to 4, or empty for the default" }, .{ .name = "TF_CUDA_CARVEOUT", .scope = .cuda, .kind = .flag, .forms = "0 or 1" }, @@ -53,6 +54,20 @@ pub const rules = [_]Rule{ .{ .name = "TF_DSPINE_WINDOW", .scope = .cuda, .kind = .size, .min = 16, .max = 8192, .forms = "a whole row count from 16 to 8192, at most the DSpine drafter's own sliding_window" }, .{ .name = "TF_DRAFT_NODES", .scope = .cuda, .kind = .size, .forms = "a whole nonnegative native-size node count (capped by the drafter's window)" }, .{ .name = "TF_QMMF_HALF_BELOW", .scope = .cuda, .kind = .size, .forms = "a whole nonnegative native-size block count (0 disables half tiles)" }, + // Qwen 3.5 CUDA and HIP settings, read through this table: + .{ .name = "TENSORFOLD_MEMORY_RESERVE_GIB", .scope = .cuda, .kind = .real, .forms = "a finite GiB amount (the HIP admission's floor and the memory's size still bound it)" }, + .{ .name = "TENSORFOLD_HIP_MEMORY_LIMIT_GB", .scope = .cuda, .kind = .real, .forms = "a finite GiB amount (the HIP admission still fits its byte count in a 64-bit size)" }, + .{ .name = "TF_QWEN_KEEP_LATE", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, + .{ .name = "TF_QWEN_KV_PAGE_TEST", .scope = .cuda, .kind = .size, .min = 1, .max = 2147483647, .forms = "a whole page size from 1 to 2147483647 (unset: off)" }, + .{ .name = "TF_COST_KEY_TRACE", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, + .{ .name = "TF_TIMING", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, + .{ .name = "TF_NO_TREES", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0; 1 keeps the CUDA drafter's chains only)" }, + .{ .name = "TF_MTP_TREES", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, + .{ .name = "TF_MTP_BATCH", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 1; 0 keeps one stream at a time)" }, + .{ .name = "TF_QWEN_POOL_LOG", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, + .{ .name = "TF_Q27_POCKET_OFF", .scope = .cuda, .kind = .path, .forms = "all, or a list of layer:neuron pairs without control characters (default off)" }, + .{ .name = "TF_Q27_TAIL", .scope = .cuda, .kind = .word, .words = &.{"off"}, .forms = "off (default: each nudged sequence's tail rows)" }, + .{ .name = "TF_Q27_GEMM", .scope = .cuda, .kind = .word, .words = &.{"narrow"}, .forms = "narrow (default: 128x128 tiles)" }, .{ .name = "TENSORFOLD_PROMPT_CACHE_KEEP_OTHERS", .scope = .cuda, .kind = .flag, .forms = "0 or 1" }, .{ .name = "TF_PROMPT_INTERMEDIATE", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (default 0)" }, .{ .name = "TENSORFOLD_LFM2_KV_PAGES", .scope = .cuda, .kind = .flag, .forms = "0 or 1 (unset leases pool pages)" }, @@ -66,10 +81,14 @@ pub const rules = [_]Rule{ .{ .name = "TF_HEAD_GEOMETRY", .scope = .metal, .kind = .size, .forms = "a whole nonnegative native-size geometry count" }, .{ .name = "TF_PROMPT_ROWS", .scope = .metal, .kind = .prompt, .forms = "a multiple of 16 from 128 to 2048 for native serving" }, .{ .name = "TF_ANE_COLUMNS", .scope = .metal, .kind = .u32, .forms = "a whole column count from 0 to 4294967295 (0 disables the share)" }, + .{ .name = "TF_METAL4", .scope = .metal, .kind = .flag, .forms = "0 or 1 (0 keeps Metal 3; 1 sends the work of a family that supports it through Metal 4 on macOS 26 and later, the default for DeepSeek-V4.1 there)" }, + .{ .name = "TF_METAL4_TIMELINE", .scope = .metal, .kind = .u32, .forms = "a whole round count from 0 to 4294967295 (0, the default, stamps nothing; n stamps every stage of n rounds of each kind on a Metal 4 queue and logs them)" }, + .{ .name = "TF_DSV41_ROUND_PROF", .scope = .metal, .kind = .flag, .forms = "0 or 1 (1 logs DeepSeek-V4.1 Metal decode rounds' host and GPU milliseconds by rows)" }, .{ .name = "TF_FLASHNEXT_SCALE_INDEX", .scope = .metal, .kind = .flag, .forms = "0 or 1 (0: Flash Next's 4-bit expert kernels read the stored scales and biases, not their 16-bit index)" }, .{ .name = "GLM_EHPROJ_NAX", .scope = .metal, .kind = .flag, .forms = "0 or 1 (0 serves GLM's MTP eh_proj on the scalar kernel)" }, .{ .name = "TF_FLASHNEXT_GROUPED_ROWS", .scope = .metal, .kind = .size, .forms = "0 (never) or the rows, 1 to 32, from which a window's experts run grouped", .max = 32 }, .{ .name = "TF_QWEN27_SLOT_RESUME", .scope = .metal, .kind = .flag, .forms = "0 or 1 (0 stops slot 0 resuming a later prompt; unset or blank keeps it on)" }, + .{ .name = "TF_QWEN27_SHARED_PREFIX", .scope = .metal, .kind = .flag, .forms = "0 or 1 (0 keeps the 27B's cached keys on the tail kernel before M5; unset or blank is 1)" }, .{ .name = "TF_QWEN27_METAL_KV_PAGES", .scope = .metal, .kind = .flag, .forms = "0 or 1 (1 puts the 27B's keys and values in core-pool pages; unset or blank is 0)" }, .{ .name = "TF_QWEN27_JOIN", .scope = .metal, .kind = .flag, .forms = "0 or 1 (1 runs a window's rows in pairs in the 27B's decode tail before M5; unset or blank is 1)" }, .{ .name = "TF_QWEN35_METAL_KV_PAGES", .scope = .metal, .kind = .flag, .forms = "0 or 1 (1 puts the streams' keys and values in core-pool pages; unset or blank is 0)" }, @@ -205,12 +224,13 @@ pub const rules = [_]Rule{ .{ .name = "TF_FLASHNEXT_GREEDY_WIDE", .scope = .flashnext, .kind = .size, .forms = "a whole round width from 0 to the native size maximum (default 4)" }, .{ .name = "TF_FLASHNEXT_WINDOW_ROWS", .scope = .flashnext, .kind = .size, .forms = "a whole row count from 0 to the native size maximum (default the shared round's rows; capped by them)" }, .{ .name = "TF_FLASHNEXT_READOUT_ROWS", .scope = .flashnext, .kind = .size, .forms = "a whole row count from 0 to the native size maximum (default 64; 0 never takes the tiles)" }, - .{ .name = "TF_FLASHNEXT_CHUNK", .scope = .flashnext, .kind = .size, .min = 1, .max = 16384, .forms = "whole prompt rows a pass, 1 to 16384 (default 1536)" }, + .{ .name = "TF_FLASHNEXT_CHUNK", .scope = .flashnext, .kind = .size, .min = 1, .max = 16384, .forms = "whole prompt rows a pass, 1 to 16384 (default 3072)" }, .{ .name = "TF_FLASHNEXT_CHUNK_SOLO", .scope = .flashnext, .kind = .size, .max = 16384, .forms = "whole prompt rows a pass with no stream decoding, TF_FLASHNEXT_CHUNK to 16384 (unset: 8192 alone at --parallel 1, else off)" }, .{ .name = "TF_FLASHNEXT_FACT_ROWS", .scope = .flashnext, .kind = .size, .forms = "a whole row count from 0 to the native size maximum (default 64; 0 never takes the tiles)" }, .{ .name = "TF_FLASHNEXT_KV_PAGE_TEST", .scope = .flashnext, .kind = .size, .forms = "a page size the kernels take, whole blocks of the indexer's ratio up to the window (unset: off)" }, .{ .name = "TF_FLASHNEXT_CONFIDENCE", .scope = .flashnext, .kind = .signed_real, .forms = "a finite number (default -0.4)" }, .{ .name = "TF_FLASHNEXT_PROMPT", .scope = .flashnext, .kind = .word, .words = &.{"rows"}, .forms = "rows for the rows path (unset or blank keeps the plain path)" }, + .{ .name = "TENSORFOLD_API_KEY", .scope = .chat, .kind = .path, .trim = " \t\n\r\x0b\x0c", .forms = "API keys split by commas, without control characters (checked here by tensorfold chat --url)" }, // Family rank and prompt settings below are read through their own family's startup scope. .{ .name = "TF_GLM_INDEX_CUDA", .scope = .glm, .kind = .word, .words = &.{ "1", "0", "scores" }, .forms = "1 (both kernels), 0 (neither) or scores (scores only; unset or blank is both)" }, .{ .name = "TF_GLM_KV_HOST_GIB", .scope = .glm, .kind = .real, .forms = "a finite GiB amount of at least 0 (unset or blank uses one full window and 16 rows a page)" }, @@ -307,6 +327,11 @@ pub fn describe(a: std.mem.Allocator, name: []const u8, raw: []const u8) ![]cons return std.fmt.allocPrint(a, "{s}=\"{f}\": expected {s}", .{ name, std.zig.fmtString(raw), rule(name).forms }); } +/// A registered setting's raw text, for readers that parse it against runtime bounds the table cannot name. +pub fn rawText(name: [:0]const u8) ?[]const u8 { + return sys.getenv(name); +} + /// A direct family/tool entry point gets the same refusal even when it has no server problem buffer. fn checked(name: [:0]const u8, raw: ?[]const u8) Error!?u64 { return parse(name, raw) catch { @@ -385,6 +410,7 @@ pub const Flags = struct { flashnext: bool = false, nemotron: bool = false, minimax_m3: bool = false, + chat: bool = false, device: ?u32 = null, segments: ?u32 = null, carveout: bool = false, @@ -404,6 +430,7 @@ pub const Flags = struct { .flashnext => f.flashnext, .nemotron => f.nemotron, .minimax_m3 => f.minimax_m3, + .chat => f.chat, }; } }; diff --git a/zig/src/platform/environment_test.zig b/zig/src/platform/environment_test.zig index de938481524..57bc7742237 100644 --- a/zig/src/platform/environment_test.zig +++ b/zig/src/platform/environment_test.zig @@ -3,7 +3,7 @@ const std = @import("std"); const e = @import("environment.zig"); const t = std.testing; const a = t.allocator; -const all: e.Flags = .{ .cuda = true, .metal = true, .xpu = true, .slide = true, .hooks = true, .dsv41 = true, .gemma4 = true, .drama3 = true, .glm = true, .flashnext = true, .nemotron = true, .minimax_m3 = true }; +const all: e.Flags = .{ .cuda = true, .metal = true, .xpu = true, .slide = true, .hooks = true, .dsv41 = true, .gemma4 = true, .drama3 = true, .glm = true, .flashnext = true, .nemotron = true, .minimax_m3 = true, .chat = true }; const Env = struct { name: []const u8, raw: ?[]const u8, @@ -67,6 +67,28 @@ const valid = [_]Case{ .{ .name = "TENSORFOLD_UNIFIED_HOST_COUNTS", .raw = "0", .n = 0 }, .{ .name = "TENSORFOLD_UNIFIED_HOST_COUNTS", .raw = "1", .n = 1 }, .{ .name = "TF_MTP_DRAFTS", .raw = "0", .n = 0 }, + .{ .name = "TF_QWEN_KEEP_LATE", .raw = "0", .n = 0 }, + .{ .name = "TF_QWEN_KEEP_LATE", .raw = "1", .n = 1 }, + .{ .name = "TF_QWEN_KV_PAGE_TEST", .raw = "1", .n = 1 }, + .{ .name = "TF_QWEN_KV_PAGE_TEST", .raw = "2147483647", .n = 2147483647 }, + .{ .name = "TF_COST_KEY_TRACE", .raw = "0", .n = 0 }, + .{ .name = "TF_COST_KEY_TRACE", .raw = "1", .n = 1 }, + .{ .name = "TF_TIMING", .raw = "0", .n = 0 }, + .{ .name = "TF_TIMING", .raw = "1", .n = 1 }, + .{ .name = "TF_NO_TREES", .raw = "0", .n = 0 }, + .{ .name = "TF_NO_TREES", .raw = "1", .n = 1 }, + .{ .name = "TF_MTP_TREES", .raw = "0", .n = 0 }, + .{ .name = "TF_MTP_TREES", .raw = "1", .n = 1 }, + .{ .name = "TF_MTP_BATCH", .raw = "0", .n = 0 }, + .{ .name = "TF_MTP_BATCH", .raw = "1", .n = 1 }, + .{ .name = "TF_QWEN_POOL_LOG", .raw = "0", .n = 0 }, + .{ .name = "TF_QWEN_POOL_LOG", .raw = "1", .n = 1 }, + .{ .name = "TF_Q27_GEMM", .raw = "narrow", .n = 0 }, + .{ .name = "TF_Q27_TAIL", .raw = "off", .n = 0 }, + .{ .name = "TF_Q27_POCKET_OFF", .raw = "all", .n = 0 }, + .{ .name = "TENSORFOLD_MEMORY_RESERVE_GIB", .raw = "1", .n = 4607182418800017408 }, + .{ .name = "TENSORFOLD_HIP_MEMORY_LIMIT_GB", .raw = "2", .n = 4611686018427387904 }, + .{ .name = "TF_MTP_DRAFTS", .raw = "4294967295", .n = std.math.maxInt(u32) }, .{ .name = "TF_DSPINE_WINDOW", .raw = "16", .n = 16 }, .{ .name = "TF_DSPINE_WINDOW", .raw = "4096", .n = 4096 }, @@ -105,6 +127,8 @@ const valid = [_]Case{ .{ .name = "GLM_EHPROJ_NAX", .raw = "1", .n = 1 }, .{ .name = "TF_QWEN27_SLOT_RESUME", .raw = "0", .n = 0 }, .{ .name = "TF_QWEN27_SLOT_RESUME", .raw = "1", .n = 1 }, + .{ .name = "TF_QWEN27_SHARED_PREFIX", .raw = "0", .n = 0 }, + .{ .name = "TF_QWEN27_SHARED_PREFIX", .raw = "1", .n = 1 }, .{ .name = "TF_QWEN27_METAL_KV_PAGES", .raw = "0", .n = 0 }, .{ .name = "TF_QWEN27_METAL_KV_PAGES", .raw = "1", .n = 1 }, .{ .name = "TF_QWEN27_JOIN", .raw = "0", .n = 0 }, @@ -125,12 +149,19 @@ const valid = [_]Case{ .{ .name = "TF_SLIDE_TAP_CHECK", .raw = "1", .n = 1 }, .{ .name = "TF_SLIDE_POCKET_DUMP", .raw = "/tmp/pocket rows", .n = 0 }, .{ .name = "TENSORFOLD_CUDA_KERNELS", .raw = "/tmp/captured set", .n = 0 }, + .{ .name = "TF_NCCL_LIB", .raw = "/fixture/nccl/libnccl.so.2", .n = 0 }, .{ .name = "TF_SLIDE_FORGET_FAIL", .raw = " 0 ", .n = 0 }, + .{ .name = "TF_METAL4", .raw = "0", .n = 0 }, + .{ .name = "TF_METAL4", .raw = "1", .n = 1 }, + .{ .name = "TF_METAL4_TIMELINE", .raw = "0", .n = 0 }, + .{ .name = "TF_METAL4_TIMELINE", .raw = "3", .n = 3 }, + .{ .name = "TF_DSV41_ROUND_PROF", .raw = "1", .n = 1 }, .{ .name = "TF_DSV41_SMALL", .raw = "1", .n = 1 }, .{ .name = "TF_DSV41_ASSETS", .raw = "deepseek assets", .n = 0 }, .{ .name = "TF_DSV41_ENGRAM_DIR", .raw = "engram-rows", .n = 0 }, .{ .name = "TF_DSV41_ENGRAM_VERIFY", .raw = "full", .n = 1 }, .{ .name = "TF_DSV41_ENGRAM_CACHE", .raw = "0", .n = 0 }, + .{ .name = "TENSORFOLD_API_KEY", .raw = " example-key-1, example-key-2\n", .n = 0 }, .{ .name = "TF_NEMOTRON_RANK", .raw = "1", .n = 1 }, .{ .name = "TF_NEMOTRON_WORLD", .raw = "2", .n = 2 }, .{ .name = "TF_MINIMAX_RANK", .raw = "1", .n = 1 }, @@ -171,7 +202,14 @@ test "environment: range, enum, whitespace and native prompt geometry refusals a .{ "XPU_A8_BITS", "16" }, .{ "TF_SLIDE_POCKET_KEY", "AUTO" }, .{ "TF_DRAMA_PREFILL_ROWS", "4096x" }, .{ "TF_DRAMA_REFERENCE_CACHE", "4294967296" }, .{ "TF_DSPINE_WINDOW", "0" }, .{ "TF_DSPINE_WINDOW", "15" }, - .{ "TF_DSPINE_WINDOW", "8193" }, + .{ "TF_DSPINE_WINDOW", "8193" }, .{ "TF_QWEN_KV_PAGE_TEST", "2147483648" }, + .{ "TF_QWEN_KV_PAGE_TEST", "0" }, .{ "TF_Q27_GEMM", "wide" }, + .{ "TF_Q27_GEMM", "NARROW" }, .{ "TF_Q27_TAIL", "on" }, + .{ "TF_Q27_TAIL", "OFF" }, .{ "TF_Q27_POCKET_OFF", "no\ncontrol" }, + .{ "TF_QWEN_KEEP_LATE", "2" }, .{ "TF_TIMING", "2" }, + .{ "TF_NO_TREES", "true" }, .{ "TF_MTP_TREES", "yes" }, + .{ "TF_MTP_BATCH", "off" }, .{ "TF_QWEN_POOL_LOG", "true" }, + .{ "TF_COST_KEY_TRACE", "on" }, }) |c| try t.expectError(error.InvalidEnvironment, e.parse(c[0], c[1])); try t.expectEqual(@as(?u64, null), try e.parse("TF_CUDA_DEVICE", " ")); try t.expectEqual(@as(?u64, 0), try e.parse("TF_Q27_COPY_ROWS", "+0")); @@ -333,7 +371,7 @@ test "environment: a legacy alias is checked only while its canonical name is un } test "environment: the Metal Qwen and slide-learning switches take their forms, read blank as unset and name a refusal" { - const flags = [_][:0]const u8{ "TF_QWEN27_SLOT_RESUME", "TF_QWEN27_METAL_KV_PAGES", "TF_QWEN27_JOIN", "TF_QWEN35_METAL_KV_PAGES", "TF_SLIDE_TAKE_OUT_CHECK", "TF_SLIDE_TAP_CHECK" }; + const flags = [_][:0]const u8{ "TF_QWEN27_SLOT_RESUME", "TF_QWEN27_SHARED_PREFIX", "TF_QWEN27_METAL_KV_PAGES", "TF_QWEN27_JOIN", "TF_QWEN35_METAL_KV_PAGES", "TF_SLIDE_TAKE_OUT_CHECK", "TF_SLIDE_TAP_CHECK" }; for (flags) |name| { try t.expectEqual(@as(?u64, 0), try e.parse(name, "0")); try t.expectEqual(@as(?u64, 1), try e.parse(name, "1")); diff --git a/zig/src/platform/machine.zig b/zig/src/platform/machine.zig new file mode 100644 index 00000000000..0e78ce41790 --- /dev/null +++ b/zig/src/platform/machine.zig @@ -0,0 +1,180 @@ +//! This machine as the model commands see it: chip, memory, the bytes one GPU may hold and its memory bandwidth. +const std = @import("std"); +const builtin = @import("builtin"); +const Allocator = std.mem.Allocator; + +pub const gib: u64 = 1 << 30; + +pub const Backend = enum { metal, cuda, none }; + +pub const Machine = struct { + backend: Backend = .none, + chip_buf: [64]u8 = @splat(0), + chip_len: u8 = 0, + gpu_cores: u32 = 0, + /// CUDA GPUs nvidia-smi lists; the limit is the first one's. + gpus: u32 = 0, + memory: u64 = 0, + /// Bytes one GPU may keep resident: the Metal wired limit, a card's VRAM, or a share of a GB10's unified memory. + gpu_limit: u64 = 0, + /// iogpu.wired_limit_mb as set on a Mac; 0 means macOS chooses. + wired_limit_mb: u64 = 0, + unified: bool = false, + /// Nominal memory bandwidth in bytes a second; 0 for a chip outside the table. + bandwidth: u64 = 0, + + pub fn chip(m: *const Machine) []const u8 { + return m.chip_buf[0..m.chip_len]; + } + + pub fn setChip(m: *Machine, name: []const u8) void { + const t = std.mem.trim(u8, name, " \t\r\n\x00"); + m.chip_len = @intCast(@min(t.len, m.chip_buf.len)); + @memcpy(m.chip_buf[0..m.chip_len], t[0..m.chip_len]); + } +}; + +/// macOS GPU limit when iogpu.wired_limit_mb is 0: fit to 107.5 of 128 GiB and 222.7 of 256 GiB, two thirds below that. +pub fn defaultGpuLimit(memory: u64) u64 { + const fit = memory / 10 * 9 -| 768 * gib / 100; + return @max(memory / 3 * 2, fit); +} + +/// The GPU limit a wired-limit setting gives: the setting itself when non-zero, else macOS's default. +pub fn gpuLimitFor(memory: u64, wired_limit_mb: u64) u64 { + return if (wired_limit_mb == 0) defaultGpuLimit(memory) else wired_limit_mb << 20; +} + +/// Published memory bandwidth in GB/s; the first row whose name the chip contains wins, so variants precede base chips. +const bandwidth_gbs = [_]struct { []const u8, u64 }{ + .{ "M5 Ultra", 1200 }, .{ "M3 Ultra", 819 }, .{ "M2 Ultra", 800 }, .{ "M1 Ultra", 800 }, + .{ "M5 Max", 614 }, .{ "M4 Max", 546 }, .{ "M3 Max", 400 }, .{ "M2 Max", 400 }, + .{ "M1 Max", 400 }, .{ "M5 Pro", 307 }, .{ "M4 Pro", 273 }, .{ "M3 Pro", 150 }, + .{ "M2 Pro", 200 }, .{ "M1 Pro", 200 }, .{ "M5", 153 }, .{ "M4", 120 }, + .{ "M3", 100 }, .{ "M2", 100 }, .{ "M1", 68 }, .{ "GB10", 273 }, + .{ "RTX PRO 6000", 1792 }, .{ "RTX 5090", 1792 }, .{ "RTX 4090", 1008 }, .{ "RTX 3090", 936 }, +}; + +/// The smaller-GPU Max chips have a narrower memory bus than the table's top configuration. +const smaller_max = [_]struct { []const u8, u32, u64 }{ .{ "M5 Max", 32, 460 }, .{ "M4 Max", 32, 410 }, .{ "M3 Max", 30, 300 } }; + +/// Nominal memory bandwidth (bytes a second) for the chips we serve; 0 when unknown (the engine measures it). +pub fn bandwidthOf(chip_name: []const u8) u64 { + return bandwidthFor(chip_name, 0); +} + +/// As bandwidthOf, with the GPU core count picking a Max chip's configuration when it is known. +pub fn bandwidthFor(chip_name: []const u8, gpu_cores: u32) u64 { + for (smaller_max) |row| if (gpu_cores == row[1] and std.mem.indexOf(u8, chip_name, row[0]) != null) return row[2] * 1_000_000_000; + for (bandwidth_gbs) |row| if (std.mem.indexOf(u8, chip_name, row[0]) != null) return row[1] * 1_000_000_000; + return 0; +} + +/// This machine: sysctl and ioreg on a Mac, nvidia-smi elsewhere; a field it cannot read stays 0. +pub fn detect(a: Allocator, io: std.Io) Machine { + var m: Machine = .{ .memory = std.process.totalSystemMemory() catch 0 }; + if (builtin.os.tag == .macos) { + m.backend = .metal; + m.unified = true; + var buf: [128]u8 = undefined; + m.setChip(sysctlString("machdep.cpu.brand_string", &buf) orelse ""); + m.wired_limit_mb = sysctlInt("iogpu.wired_limit_mb"); + m.gpu_cores = gpuCores(run(a, io, &.{ "/usr/sbin/ioreg", "-r", "-c", "AGXAccelerator", "-d", "1" }) orelse ""); + m.gpu_limit = gpuLimitFor(m.memory, m.wired_limit_mb); + m.bandwidth = bandwidthFor(m.chip(), m.gpu_cores); + return m; + } + applyNvidia(&m, run(a, io, &.{ "nvidia-smi", "--query-gpu=name,memory.total", "--format=csv,noheader,nounits" }) orelse ""); + return m; +} + +/// nvidia-smi's `name, memory.total` rows (MiB); a GB10 or a GPU without its own memory takes macOS's share of RAM. +pub fn applyNvidia(m: *Machine, csv: []const u8) void { + var lines = std.mem.splitScalar(u8, csv, '\n'); + while (lines.next()) |line| { + const t = std.mem.trim(u8, line, " \t\r"); + const comma = std.mem.indexOfScalar(u8, t, ',') orelse continue; + m.gpus += 1; + if (m.gpus > 1) continue; + m.backend = .cuda; + m.setChip(t[0..comma]); + const mib = std.fmt.parseInt(u64, std.mem.trim(u8, t[comma + 1 ..], " "), 10) catch 0; + m.unified = mib == 0 or std.mem.indexOf(u8, m.chip(), "GB10") != null; + m.gpu_limit = if (m.unified) defaultGpuLimit(m.memory) else mib << 20; + } + m.bandwidth = bandwidthOf(m.chip()); +} + +/// `"gpu-core-count" = N` from ioreg's AGXAccelerator entry; 0 when absent. +pub fn gpuCores(text: []const u8) u32 { + const key = "\"gpu-core-count\" = "; + const at = std.mem.indexOf(u8, text, key) orelse return 0; + const rest = text[at + key.len ..]; + var end: usize = 0; + while (end < rest.len and std.ascii.isDigit(rest[end])) end += 1; + return std.fmt.parseInt(u32, rest[0..end], 10) catch 0; +} + +fn run(a: Allocator, io: std.Io, argv: []const []const u8) ?[]const u8 { + const r = std.process.run(a, io, .{ + .argv = argv, + .stdout_limit = .limited(4 << 20), + .stderr_limit = .limited(64 << 10), + .timeout = .{ .duration = .{ .raw = .fromSeconds(10), .clock = .awake } }, + }) catch return null; + return if (r.term.success()) r.stdout else null; +} + +fn sysctlString(comptime name: [:0]const u8, buf: []u8) ?[]const u8 { + var len: usize = buf.len; + if (std.c.sysctlbyname(name, buf.ptr, &len, null, 0) != 0 or len == 0) return null; + return std.mem.trimEnd(u8, buf[0..len], "\x00"); +} + +fn sysctlInt(comptime name: [:0]const u8) u64 { + var v: u64 = 0; + var len: usize = @sizeOf(u64); + return if (std.c.sysctlbyname(name, &v, &len, null, 0) == 0) v else 0; +} + +test "bandwidth by chip name, with the smaller Max configurations and unknown chips at zero" { + try std.testing.expectEqual(@as(u64, 819_000_000_000), bandwidthOf("Apple M3 Ultra")); + try std.testing.expectEqual(@as(u64, 614_000_000_000), bandwidthFor("Apple M5 Max", 40)); + try std.testing.expectEqual(@as(u64, 460_000_000_000), bandwidthFor("Apple M5 Max", 32)); + try std.testing.expectEqual(@as(u64, 614_000_000_000), bandwidthFor("Apple M5 Max", 0)); + try std.testing.expectEqual(@as(u64, 273_000_000_000), bandwidthOf("Apple M4 Pro")); + try std.testing.expectEqual(@as(u64, 120_000_000_000), bandwidthOf("Apple M4")); + try std.testing.expectEqual(@as(u64, 153_000_000_000), bandwidthOf("Apple M5")); + try std.testing.expectEqual(@as(u64, 273_000_000_000), bandwidthOf("NVIDIA GB10")); + try std.testing.expectEqual(@as(u64, 0), bandwidthOf("Apple M9")); +} + +test "nvidia-smi rows: a card's own memory, a GB10's share of RAM, and the GPU count" { + var card: Machine = .{ .memory = 64 * gib }; + applyNvidia(&card, "NVIDIA GeForce RTX 3090, 24576\nNVIDIA GeForce RTX 3090, 24576\n"); + try std.testing.expectEqualStrings("NVIDIA GeForce RTX 3090", card.chip()); + try std.testing.expectEqual(@as(u64, 24 * gib), card.gpu_limit); + try std.testing.expectEqual(@as(u32, 2), card.gpus); + try std.testing.expect(card.backend == .cuda and !card.unified and card.bandwidth == 936_000_000_000); + + var spark: Machine = .{ .memory = 128 * gib }; + applyNvidia(&spark, "NVIDIA GB10, [N/A]\n"); + try std.testing.expect(spark.unified and spark.gpu_limit == defaultGpuLimit(128 * gib)); + + var none: Machine = .{}; + applyNvidia(&none, ""); + try std.testing.expect(none.backend == .none and none.gpus == 0); +} + +test "detect reads this host: its memory, and on a Mac its chip and GPU limit" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const m = detect(arena.allocator(), std.testing.io); + try std.testing.expect(m.memory > 0); + if (builtin.os.tag == .macos) try std.testing.expect(m.backend == .metal and m.chip().len > 0 and m.gpu_limit > 0); +} + +test "ioreg's GPU core count" { + try std.testing.expectEqual(@as(u32, 40), gpuCores(" | | \"gpu-core-count\" = 40\n | | \"other\" = 1")); + try std.testing.expectEqual(@as(u32, 0), gpuCores("no such key")); +} diff --git a/zig/src/platform/sys.zig b/zig/src/platform/sys.zig index 0f1a29fff87..4fa9697ee0b 100644 --- a/zig/src/platform/sys.zig +++ b/zig/src/platform/sys.zig @@ -22,6 +22,7 @@ pub const posix = if (windows) @import("win_posix.zig") else std.posix; pub const DynLib = if (windows) WinDynLib else if (builtin.os.tag == .macos) MacDynLib else std.DynLib; pub const experimental = @import("experimental.zig"); pub const memory_policy = @import("memory_policy.zig"); +pub const machine = @import("machine.zig"); pub const optional_libraries = @import("optional_libraries.zig"); /// An environment variable's value, through libc (std.process.Environ.getPosix does not build on Windows). diff --git a/zig/src/server/auth_scope.zig b/zig/src/server/auth_scope.zig index d6db0ca0f42..fb81ae6e699 100644 --- a/zig/src/server/auth_scope.zig +++ b/zig/src/server/auth_scope.zig @@ -75,13 +75,22 @@ pub fn allows(scopes: Scopes, method: []const u8, raw_path: []const u8) bool { if (scopes.admin) return true; const route = routePath(raw_path); if (std.mem.eql(u8, method, "GET")) { - if ((scopes.inference or scopes.read) and oneOf(route, &listing)) return true; + if ((scopes.inference or scopes.read) and (oneOf(route, &listing) or modelId(route) != null)) return true; return scopes.read and oneOf(route, &reading); } const put = std.mem.eql(u8, method, "PUT") and putRoute(route); return scopes.inference and (std.mem.eql(u8, method, "POST") or put) and oneOf(route, &inferring); } +/// The id in GET /v1/models/{id} or /models/{id}, still escaped; a path ending in /models stays the listing's alias. +pub fn modelId(route: []const u8) ?[]const u8 { + if (std.mem.endsWith(u8, route, "/models")) return null; + for ([_][]const u8{ "/v1/models/", "/models/" }) |head| { + if (route.len > head.len and std.mem.startsWith(u8, route, head)) return route[head.len..]; + } + return null; +} + /// A key that may open a Responses WebSocket: admin, or inference (each create is checked again over the socket). pub fn allowsUpgrade(scopes: Scopes) bool { return scopes.admin or scopes.inference; diff --git a/zig/src/server/auth_scope_http_test.zig b/zig/src/server/auth_scope_http_test.zig index 31555f49d0d..c50543995fe 100644 --- a/zig/src/server/auth_scope_http_test.zig +++ b/zig/src/server/auth_scope_http_test.zig @@ -244,8 +244,10 @@ test "auth scopes HTTP: inference and read are separate grants and full keys kee var arena = std.heap.ArenaAllocator.init(t.allocator); defer arena.deinit(); const a = arena.allocator(); - for ([_][]const u8{ "/models", "/v1/models", "/v1/models/?x=1" }) |path| for ([_][]const u8{ "read-secret", "infer-secret" }) |key| + for ([_][]const u8{ "/models", "/v1/models", "/v1/models/?x=1", "/v1/models/m", "/models/m/" }) |path| for ([_][]const u8{ "read-secret", "infer-secret" }) |key| try expectStatus(try h.ask(a, "GET", path, key, ""), 200); + try expectStatus(try h.ask(a, "GET", "/v1/models/other", "read-secret", ""), 404); + try expectStatus(try h.ask(a, "GET", "/v1/models/m", "", ""), 401); for ([_][]const u8{ "/metrics", "/v1/metrics", "/v1/load", "/memory", "/v1/memory", "/stats", "/dashboard" }) |path| { try expectStatus(try h.ask(a, "GET", path, "read-secret", ""), 200); try expectStatus(try h.ask(a, "GET", path, "infer-secret", ""), 403); @@ -320,8 +322,12 @@ test "auth scopes HTTP: restricted Responses cannot read, keep or continue the s try expectStatus(try h.ask(a, "GET", absent, "admin-secret", ""), 404); try expectStatus(try h.ask(a, "GET", path, "admin-secret", ""), 200); const continued = try std.fmt.allocPrint(a, "{{\"input\":\"y\",\"previous_response_id\":\"{s}\",\"max_output_tokens\":1}}", .{id}); - try expectStatus(try h.ask(a, "POST", "/v1/responses", "legacy-secret", continued), 200); - try expectStatus(try h.ask(a, "DELETE", path, "legacy-secret", ""), 200); + // another full key is a different owner: the same miss as an unknown response + try expectStatus(try h.ask(a, "POST", "/v1/responses", "legacy-secret", continued), 400); + try expectStatus(try h.ask(a, "DELETE", path, "legacy-secret", ""), 404); + // the key that stored the response still continues and deletes it + try expectStatus(try h.ask(a, "POST", "/v1/responses", "admin-secret", continued), 200); + try expectStatus(try h.ask(a, "DELETE", path, "admin-secret", ""), 200); } test "auth scopes HTTP: a keep-alive request does not inherit the previous request's full key" { @@ -381,7 +387,8 @@ test "auth scopes HTTP: the request cancel route needs a full key, a loopback ca defer arena.deinit(); const a = arena.allocator(); const cancel_ids = @import("cancel_ids.zig"); - var e: cancel_ids.Entry = .{}; + const admin = keys.matchIdentity(a, "Bearer admin-secret", null).?; + var e: cancel_ids.Entry = .{ .owner = admin.digest }; const names = [_][]const u8{"chatcmpl-scope-held"}; cancel_ids.registry.add(t.io, &names, &e); defer cancel_ids.registry.remove(t.io, &names, &e); @@ -393,7 +400,7 @@ test "auth scopes HTTP: the request cancel route needs a full key, a loopback ca } try expectStatus(try h.ask(a, "POST", path, "", ""), 401); try t.expect(!e.asked.load(.acquire)); - for (full_keys) |key| try expectStatus(try h.ask(a, "POST", path, key, ""), 200); + for (full_keys) |key| try expectStatus(try h.ask(a, "POST", path, key, ""), if (std.mem.eql(u8, key, "admin-secret")) 200 else 404); try t.expect(e.asked.load(.acquire)); try expectStatus(try h.ask(a, "POST", "/v1/requests/chatcmpl-nobody/cancel", "admin-secret", ""), 404); } diff --git a/zig/src/server/auth_scope_test.zig b/zig/src/server/auth_scope_test.zig index 47c79080cae..997d04f6225 100644 --- a/zig/src/server/auth_scope_test.zig +++ b/zig/src/server/auth_scope_test.zig @@ -105,6 +105,23 @@ test "auth scopes: route grants are exact and every other method or resource is try t.expect(!scope.allows(.{}, "GET", "/v1/models")); } +test "auth scopes: one model's entry is granted with the listing, by GET only, and a /models suffix stays refused" { + const infer: scope.Scopes = .{ .inference = true }; + const read: scope.Scopes = .{ .read = true }; + const both: scope.Scopes = .{ .inference = true, .read = true }; + for ([_][]const u8{ "/v1/models/m", "/models/m", "/v1/models/org/m", "/v1/models/org%2Fm", "/models/m/?x=1" }) |path| { + try t.expect(scope.allows(read, "GET", path) and scope.allows(infer, "GET", path)); + for ([_][]const u8{ "POST", "DELETE", "PUT", "HEAD", "OPTIONS" }) |method| try t.expect(!scope.allows(both, method, path)); + try t.expect(!scope.allows(.{}, "GET", path)); + } + for ([_][]const u8{ "/v1/models/m/models", "/models/models", "/x/models/m", "/v2/models/m" }) |path| + try t.expect(!scope.allows(both, "GET", path)); + try t.expectEqualStrings("org/m", scope.modelId("/v1/models/org/m").?); + try t.expectEqualStrings("org%2Fm", scope.modelId("/models/org%2Fm").?); + for ([_][]const u8{ "/v1/models", "/models", "/v1/models/", "/v1/models/m/models", "/v1/modelsx" }) |route| + try t.expect(scope.modelId(route) == null); +} + fn denial(scopes: scope.Scopes, text: []const u8) !?scope.Denial { var arena = std.heap.ArenaAllocator.init(t.allocator); defer arena.deinit(); diff --git a/zig/src/server/benchmark_fake.zig b/zig/src/server/benchmark_fake.zig index b90c08f3a4b..5790585d991 100644 --- a/zig/src/server/benchmark_fake.zig +++ b/zig/src/server/benchmark_fake.zig @@ -17,6 +17,9 @@ pub const Fake = struct { fd: posix.socket_t, port: u16, routes: []const Route, + /// As a keyed server: every request but GET /health wants ``Authorization: Bearer KEY``, KEY this file's text. + key_file: ?[]const u8 = null, + refused: usize = 0, stop_flag: std.atomic.Value(bool) = .init(false), thread: ?std.Thread = null, mutex: std.Io.Mutex = .init, @@ -25,6 +28,11 @@ pub const Fake = struct { /// Listens on 127.0.0.1 at a free port and serves ``routes`` until ``stop``. pub fn start(gpa: Allocator, routes: []const Route) !*Fake { + return startKeyed(gpa, routes, null); + } + + /// ``start`` as a keyed server: a request without the key ``key_file`` holds gets 401 and plays no route. + pub fn startKeyed(gpa: Allocator, routes: []const Route, key_file: ?[]const u8) !*Fake { const rc = posix.system.socket(posix.AF.INET, posix.SOCK.STREAM, 0); if (posix.errno(rc) != .SUCCESS) return error.SocketFailed; const fd: posix.socket_t = @intCast(rc); @@ -38,7 +46,7 @@ pub const Fake = struct { var len: posix.socklen_t = @sizeOf(posix.sockaddr.in); if (posix.errno(posix.system.getsockname(fd, @ptrCast(&bound), &len)) != .SUCCESS) return error.BindFailed; const f = try gpa.create(Fake); - f.* = .{ .gpa = gpa, .fd = fd, .port = std.mem.bigToNative(u16, bound.port), .routes = routes, .arena = .init(gpa) }; + f.* = .{ .gpa = gpa, .fd = fd, .port = std.mem.bigToNative(u16, bound.port), .routes = routes, .key_file = key_file, .arena = .init(gpa) }; f.thread = try std.Thread.spawn(.{}, accept, .{f}); return f; } @@ -71,13 +79,28 @@ pub const Fake = struct { /// The value of header ``name`` in the i-th request, or null. pub fn header(f: *Fake, i: usize, name: []const u8) ?[]const u8 { - var it = std.mem.splitSequence(u8, f.request(i).head, "\r\n"); - _ = it.next(); - while (it.next()) |h| { - const colon = std.mem.indexOfScalar(u8, h, ':') orelse continue; - if (std.ascii.eqlIgnoreCase(h[0..colon], name)) return std.mem.trim(u8, h[colon + 1 ..], " "); - } - return null; + return headerIn(f.request(i).head, name); + } + + /// The requests a keyed fake refused for a missing or wrong key. + pub fn refusals(f: *Fake) usize { + f.mutex.lockUncancelable(std.testing.io); + defer f.mutex.unlock(std.testing.io); + return f.refused; + } + + /// True unless the fake is keyed and the request, not GET /health, lacks the file's key. + fn authorized(f: *Fake, method: []const u8, path: []const u8, head: []const u8) bool { + const file = f.key_file orelse return true; + if (std.mem.eql(u8, method, "GET") and std.mem.eql(u8, path, "/health")) return true; + var buf: [512]u8 = undefined; + const key = std.mem.trim(u8, std.Io.Dir.cwd().readFile(std.testing.io, file, &buf) catch "", " \r\n"); + const sent = headerIn(head, "authorization") orelse ""; + if (key.len > 0 and std.mem.startsWith(u8, sent, "Bearer ") and std.mem.eql(u8, sent["Bearer ".len..], key)) return true; + f.mutex.lockUncancelable(std.testing.io); + defer f.mutex.unlock(std.testing.io); + f.refused += 1; + return false; } fn accept(f: *Fake) void { @@ -117,6 +140,10 @@ pub const Fake = struct { var parts = std.mem.tokenizeScalar(u8, head[0 .. std.mem.indexOf(u8, head, "\r\n") orelse head.len], ' '); const method = parts.next() orelse return; const path = parts.next() orelse return; + if (!f.authorized(method, path, head)) { + _ = writeAll(c, unauthorized); + return; + } const route = f.record(method, path, head, buf[head_end + 4 .. head_end + 4 + length]) orelse { _ = writeAll(c, "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"); return; @@ -166,6 +193,22 @@ pub const Fake = struct { } }; +/// What the native server answers a request without a valid key. +const unauthorized_body = "{\"error\": {\"message\": \"A valid API key is required\", \"type\": \"invalid_request_error\", \"param\": null, \"code\": \"invalid_api_key\"}}"; +const unauthorized = std.fmt.comptimePrint("HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: Bearer\r\nContent-Type: application/json\r\n" ++ + "Content-Length: {d}\r\nConnection: close\r\n\r\n{s}", .{ unauthorized_body.len, unauthorized_body }); + +/// The value of header ``name`` in a request head, or null. +fn headerIn(head: []const u8, name: []const u8) ?[]const u8 { + var it = std.mem.splitSequence(u8, head, "\r\n"); + _ = it.next(); + while (it.next()) |h| { + const colon = std.mem.indexOfScalar(u8, h, ':') orelse continue; + if (std.ascii.eqlIgnoreCase(h[0..colon], name)) return std.mem.trim(u8, h[colon + 1 ..], " "); + } + return null; +} + fn contentLength(head: []const u8) usize { var it = std.mem.splitSequence(u8, head, "\r\n"); while (it.next()) |h| { diff --git a/zig/src/server/benchmark_server.zig b/zig/src/server/benchmark_server.zig index 035c5707a1c..95593bdc462 100644 --- a/zig/src/server/benchmark_server.zig +++ b/zig/src/server/benchmark_server.zig @@ -1,4 +1,4 @@ -//! The benchmark's own serve child: lock, flags, environment, port, readiness and a stop that always reaps. +//! A command's own serve child, the benchmark's lock, flags and name by default: port, readiness and a stop that reaps. const std = @import("std"); const platform = @import("sys"); const builtin = @import("builtin"); @@ -11,13 +11,36 @@ const Allocator = std.mem.Allocator; const posix = std.posix; pub const served_name = ".tensorfold-benchmark"; -const serving_prefix = "[tensorfold] serving " ++ served_name ++ " at http://127.0.0.1:"; /// What the child serves: this executable, the checkpoint directory and the benchmark's settings. pub const Plan = struct { exe: []const u8, dir: []const u8, backend: []const u8, tokens: u32, context: ?i64, drafter_dir: ?[]const u8, serial: bool, kv_cache: []const u8 = "bf16" }; +/// What a failed start or stop says: the benchmark's words unless a command gives its own. +pub const Words = struct { + log: []const u8 = "Benchmark server could not start; check local checkpoint and directory permissions", + spawn: []const u8 = "Could not start the benchmark server; check the TensorFold installation", + exited: []const u8 = "Benchmark server exited during startup; check the checkpoint and backend toolchain", + timed_out: []const u8 = "Benchmark server startup timed out after", + stuck: []const u8 = "Benchmark server did not exit after termination; cleanup is incomplete", +}; + /// ``argv`` replaces the child's command line (tests use a stand-in); ``tail`` gets an exited child's last log lines. -pub const Options = struct { startup_timeout_s: f64, grace_ms: u32 = 10_000, bench_dir: []const u8, argv: ?[]const []const u8 = null, tail: ?*[]const []const u8 = null }; +pub const Options = struct { + startup_timeout_s: f64, + grace_ms: u32 = 10_000, + bench_dir: []const u8, + argv: ?[]const []const u8 = null, + tail: ?*[]const []const u8 = null, + /// The name the serving line and ``/v1/models`` must show. + served: []const u8 = served_name, + /// Hold ``bench_dir/.lock`` while the child runs; without it ``bench_dir`` only holds the starting child's log. + lock: bool = true, + /// The child in a process group of its own, so a terminal's Ctrl-C reaches only this process. + own_group: bool = false, + /// The child's only API key: TENSORFOLD_API_KEY in its environment and the probes' bearer (none for a benchmark). + key: ?[]const u8 = null, + words: Words = .{}, +}; /// The startup timeout without --startup-timeout: 600 s, plus 6 s per GB of weights past 20 GB, at most 3600 s. pub fn startupTimeout(weight_bytes: u64) f64 { @@ -56,10 +79,15 @@ pub fn environ(a: Allocator, parent: *const std.process.Environ.Map) !std.proces return env; } -/// The port in serve's ``serving .tensorfold-benchmark at http://127.0.0.1:PORT/v1`` line. -pub fn servingPort(log: []const u8) ?u16 { - const at = std.mem.indexOf(u8, log, serving_prefix) orelse return null; - const rest = log[at + serving_prefix.len ..]; +/// The port in serve's first ``serving SERVED at http://127.0.0.1:PORT/v1`` line. +pub fn servingPort(log: []const u8, served: []const u8) ?u16 { + const head = "[tensorfold] serving "; + const tail = " at http://127.0.0.1:"; + var from: usize = 0; + const rest = while (std.mem.indexOfPos(u8, log, from, head)) |at| : (from = at + 1) { + const after = log[at + head.len ..]; + if (std.mem.startsWith(u8, after, served) and std.mem.startsWith(u8, after[served.len..], tail)) break after[served.len + tail.len ..]; + } else return null; var n: usize = 0; while (n < rest.len and std.ascii.isDigit(rest[n])) n += 1; if (n == 0 or !std.mem.startsWith(u8, rest[n..], "/v1")) return null; @@ -107,37 +135,46 @@ pub const Managed = struct { io: std.Io, pid: posix.pid_t, log: std.Io.File, - lock: std.Io.File, + lock: ?std.Io.File, grace_ms: u32, + served: []const u8 = served_name, + stuck: []const u8 = (Words{}).stuck, + key: ?[]const u8 = null, base_url: []const u8 = "", reaped: bool = false, closed: bool = false, - /// Spawns the child and waits until it serves the benchmark name; null with ``problem`` set, or "" when stopped. + /// Spawns the benchmark's child and waits until it serves its name; null with ``problem`` set, or "" when stopped. pub fn start(a: Allocator, io: std.Io, env: *const std.process.Environ.Map, plan: Plan, o: Options, problem: *[]const u8) !?Managed { + return spawn(a, io, env, o.argv orelse try argv(a, plan), o, problem); + } + + /// Spawns ``child_argv`` and waits until it serves ``o.served``; null with ``problem`` set, or "" when stopped. + pub fn spawn(a: Allocator, io: std.Io, env: *const std.process.Environ.Map, child_argv: []const []const u8, o: Options, problem: *[]const u8) !?Managed { var rand: [8]u8 = undefined; io.random(&rand); const log_path = try std.fmt.allocPrint(a, "{s}/.serve-{s}.log", .{ o.bench_dir, std.fmt.bytesToHex(rand, .lower) }); var child_env = try environ(a, env); - const child_argv = o.argv orelse try argv(a, plan); - const lock = lockRun(io, o.bench_dir, problem) orelse return null; + if (o.key) |k| try child_env.put("TENSORFOLD_API_KEY", k); + const lock = if (o.lock) lockRun(io, o.bench_dir, problem) orelse return null else null; const cwd = std.Io.Dir.cwd(); const log = cwd.createFile(io, log_path, .{ .exclusive = true, .read = true, .permissions = .fromMode(0o600) }) catch { - lock.close(io); - problem.* = "Benchmark server could not start; check local checkpoint and directory permissions"; + if (lock) |l| l.close(io); + problem.* = o.words.log; return null; }; - const child = std.process.spawn(io, .{ .argv = child_argv, .environ_map = &child_env, .stdin = .ignore, .stdout = .{ .file = log }, .stderr = .{ .file = log } }) catch { + const group: ?posix.pid_t = if (o.own_group) 0 else null; + const child = std.process.spawn(io, .{ .argv = child_argv, .environ_map = &child_env, .stdin = .ignore, .stdout = .{ .file = log }, .stderr = .{ .file = log }, .pgid = group }) catch { cwd.deleteFile(io, log_path) catch {}; log.close(io); - lock.close(io); - problem.* = "Could not start the benchmark server; check the TensorFold installation"; + if (lock) |l| l.close(io); + problem.* = o.words.spawn; return null; }; stop_flag.guardChild(child.id.?); cwd.deleteFile(io, log_path) catch {}; - var m: Managed = .{ .io = io, .pid = child.id.?, .log = log, .lock = lock, .grace_ms = o.grace_ms }; - const ok = m.ready(a, o.startup_timeout_s, o.tail, problem) catch |e| { + var m: Managed = .{ .io = io, .pid = child.id.?, .log = log, .lock = lock, .grace_ms = o.grace_ms, .served = o.served, .stuck = o.words.stuck, .key = o.key }; + const ok = m.ready(a, o.startup_timeout_s, o.tail, o.words, problem) catch |e| { _ = m.stop(); return e; }; @@ -146,7 +183,7 @@ pub const Managed = struct { return null; } - fn ready(m: *Managed, a: Allocator, timeout_s: f64, tail: ?*[]const []const u8, problem: *[]const u8) !bool { + fn ready(m: *Managed, a: Allocator, timeout_s: f64, tail: ?*[]const []const u8, words: Words, problem: *[]const u8) !bool { var client: std.http.Client = .{ .allocator = std.heap.smp_allocator, .io = m.io }; client.connection_pool.free_size = 0; defer client.deinit(); @@ -159,18 +196,18 @@ pub const Managed = struct { return false; } if (m.exited()) { - problem.* = "Benchmark server exited during startup; check the checkpoint and backend toolchain"; + problem.* = words.exited; if (tail) |t| t.* = try lastLines(a, m.logEnd(&buf)); return false; } if (port == null) { - port = servingPort(m.logEnd(&buf)); + port = servingPort(m.logEnd(&buf), m.served); if (port) |p| m.base_url = try std.fmt.allocPrint(a, "http://127.0.0.1:{d}", .{p}); } - if (port != null and try probe(a, m.io, &client, m.base_url)) return true; + if (port != null and try probe(a, m.io, &client, m.base_url, m.served, m.key)) return true; m.io.sleep(.fromMilliseconds(200), .awake) catch {}; } - problem.* = try std.fmt.allocPrint(a, "Benchmark server startup timed out after {d} s (--startup-timeout, at most 3600); check the checkpoint, GPU memory and backend toolchain", .{timeout_s}); + problem.* = try std.fmt.allocPrint(a, "{s} {d} s (--startup-timeout, at most 3600); check the checkpoint, GPU memory and backend toolchain", .{ words.timed_out, timeout_s }); return false; } @@ -185,20 +222,27 @@ pub const Managed = struct { return m.base_url; } + /// The child's last log lines once it has exited on its own, else null. + pub fn exitedTail(m: *Managed, a: Allocator) !?[]const []const u8 { + if (m.closed or !m.exited()) return null; + var buf: [64 << 10]u8 = undefined; + return try lastLines(a, m.logEnd(&buf)); + } + /// TERM, a grace period, KILL, another; always closes the log and the lock. Null when reaped. pub fn stop(m: *Managed) ?[]const u8 { if (m.closed) return null; m.closed = true; defer { m.log.close(m.io); - m.lock.close(m.io); + if (m.lock) |l| l.close(m.io); } if (m.reaped or m.exited()) return null; posix.kill(m.pid, .TERM) catch {}; if (m.waitExit()) return null; posix.kill(m.pid, .KILL) catch {}; if (m.waitExit()) return null; - return "Benchmark server did not exit after termination; cleanup is incomplete"; + return m.stuck; } fn waitExit(m: *Managed) bool { @@ -287,23 +331,23 @@ fn namesVariable(text: []const u8) bool { return false; } -/// Ready: ``/health`` not warming and ok, and ``/v1/models`` lists the benchmark name. -pub fn probe(a: Allocator, io: std.Io, client: *std.http.Client, base_url: []const u8) !bool { - const health = try getObject(a, io, client, base_url, "/health") orelse return false; +/// Ready: ``/health`` not warming and ok, and ``/v1/models`` lists ``served``; ``key`` goes as both requests' bearer. +pub fn probe(a: Allocator, io: std.Io, client: *std.http.Client, base_url: []const u8, served: []const u8, key: ?[]const u8) !bool { + const health = try getObject(a, io, client, base_url, "/health", key) orelse return false; if (health.get("warming")) |w| if (w == .bool and w.bool) return false; const status_ok = if (health.get("status")) |s| s == .string and std.mem.eql(u8, s.string, "ok") else false; const ok_true = if (health.get("ok")) |o| o == .bool and o.bool else false; if (!status_ok and !ok_true) return false; - const models = try getObject(a, io, client, base_url, "/v1/models") orelse return false; + const models = try getObject(a, io, client, base_url, "/v1/models", key) orelse return false; const data = models.get("data") orelse return false; if (data != .array) return false; - for (data.array) |d| if (d.get("id")) |id| if (id == .string and std.mem.eql(u8, id.string, served_name)) return true; + for (data.array) |d| if (d.get("id")) |id| if (id == .string and std.mem.eql(u8, id.string, served)) return true; return false; } -fn getObject(a: Allocator, io: std.Io, client: *std.http.Client, base_url: []const u8, route: []const u8) !?json.Value { +fn getObject(a: Allocator, io: std.Io, client: *std.http.Client, base_url: []const u8, route: []const u8, key: ?[]const u8) !?json.Value { const url = try std.mem.concat(a, u8, &.{ base_url, route }); - const got = stream.fetch(a, io, client, .{ .url = url, .limit = 64 << 10, .timeout_s = 1 }); + const got = stream.fetch(a, io, client, .{ .url = url, .limit = 64 << 10, .timeout_s = 1, .token = key }); if (got.failed != .none or got.status < 200 or got.status > 299) return null; return switch (try json.parse(a, got.body)) { .ok => |v| if (v == .object) v else null, diff --git a/zig/src/server/benchmark_server_test.zig b/zig/src/server/benchmark_server_test.zig index f10ff7f3bef..7d5aad161c5 100644 --- a/zig/src/server/benchmark_server_test.zig +++ b/zig/src/server/benchmark_server_test.zig @@ -59,9 +59,9 @@ test "the child's environment drops the key, log, salt and token and turns off t } test "the port comes from serve's serving line, whose format serve.zig still prints" { - try std.testing.expectEqual(@as(?u16, 51234), server.servingPort("x\n[tensorfold] serving .tensorfold-benchmark at http://127.0.0.1:51234/v1 (sampling: greedy)\n")); - try std.testing.expectEqual(@as(?u16, null), server.servingPort("[tensorfold] serving other at http://127.0.0.1:5/v1 (")); - try std.testing.expectEqual(@as(?u16, null), server.servingPort("[tensorfold] serving .tensorfold-benchmark at http://127.0.0.1:")); + try std.testing.expectEqual(@as(?u16, 51234), server.servingPort("x\n[tensorfold] serving .tensorfold-benchmark at http://127.0.0.1:51234/v1 (sampling: greedy)\n", server.served_name)); + try std.testing.expectEqual(@as(?u16, null), server.servingPort("[tensorfold] serving other at http://127.0.0.1:5/v1 (", server.served_name)); + try std.testing.expectEqual(@as(?u16, null), server.servingPort("[tensorfold] serving .tensorfold-benchmark at http://127.0.0.1:", server.served_name)); const serve_source = @embedFile("serve.zig"); try std.testing.expect(std.mem.indexOf(u8, serve_source, "\"serving {s} at http://{s}:{d}/v1 (") != null); try std.testing.expect(std.mem.indexOf(u8, serve_source, "\"serving {s} on http://{s}:{d}/v1 (") == null); @@ -205,6 +205,33 @@ test "an engine's load-limit hint before its error is kept with the error, three try lines(&.{ "tensorfold: GLM_LOAD_LIMIT_GB is not a load limit", "error: a", "error: b" }, try server.lastLines(a, "set GLM_LOAD_LIMIT_GB=1\ntensorfold: GLM_LOAD_LIMIT_GB is not a load limit\nerror: a\nerror: b\n")); } +test "only a child given a key gets TENSORFOLD_API_KEY and probes with it; the benchmark's child gets neither" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var s = try Setup.init(a, &tmp); + try s.env.put("TENSORFOLD_API_KEY", "parent-key"); + const routes = try healthy(a, "{\"status\": \"ok\"}", ".tensorfold-benchmark"); + const f = try fake.Fake.start(std.testing.allocator, &routes); + defer f.stop(); + const seen = try std.fs.path.join(a, &.{ s.dir, "key" }); + const script = try std.mem.concat(a, u8, &.{ "printf '[%s]' \"${TENSORFOLD_API_KEY-unset}\" > ", seen, "; ", try serving(a, f.port, "exec sleep 30") }); + var problem: []const u8 = ""; + var plain = (try s.start(script, 10, 10_000, &problem)) orelse return error.TestUnexpectedResult; + _ = plain.stop(); + try std.testing.expectEqualStrings("[unset]", try std.Io.Dir.cwd().readFileAlloc(std.testing.io, seen, a, .limited(256))); + const probes = f.count(); + for (0..probes) |i| try std.testing.expect(f.header(i, "authorization") == null); + const sh = try a.dupe([]const u8, &.{ "/bin/sh", "-c", script }); + var keyed = (try server.Managed.spawn(a, std.testing.io, &s.env, sh, .{ .startup_timeout_s = 10, .bench_dir = s.bench, .key = "child-key" }, &problem)) orelse return error.TestUnexpectedResult; + _ = keyed.stop(); + try std.testing.expectEqualStrings("[child-key]", try std.Io.Dir.cwd().readFileAlloc(std.testing.io, seen, a, .limited(256))); + try std.testing.expect(f.count() > probes); + for (probes..f.count()) |i| try std.testing.expectEqualStrings("Bearer child-key", f.header(i, "authorization").?); +} + test "the startup timeout grows with the weights past 20 GB, 6 s per GB from 600 s, to 3600 s" { try std.testing.expectEqual(@as(f64, 600), server.startupTimeout(0)); try std.testing.expectEqual(@as(f64, 600), server.startupTimeout(20_000_000_000)); diff --git a/zig/src/server/benchmark_sse.zig b/zig/src/server/benchmark_sse.zig index 5641a134b79..f5cd6092640 100644 --- a/zig/src/server/benchmark_sse.zig +++ b/zig/src/server/benchmark_sse.zig @@ -23,12 +23,42 @@ pub fn code(f: Failure) suite.ErrorCode { }; } +/// SSE framing: ``data:`` lines joined until a blank line ends their event, each line and event at most ``max_event``. +pub const Frames = struct { + data: std.ArrayList(u8) = .empty, + lines: usize = 0, + bytes: usize = 0, + + /// One line with its newline: the event it ends, copied into ``a``, else null; other fields are skipped. + pub fn line(f: *Frames, a: Allocator, with_newline: []const u8) error{ InvalidStream, OutOfMemory }!?[]const u8 { + const raw = std.mem.trimEnd(u8, with_newline, "\n"); + if (raw.len > max_event) return error.InvalidStream; + const text = std.mem.trimEnd(u8, raw, "\r"); + if (!std.unicode.utf8ValidateSlice(text)) return error.InvalidStream; + if (text.len == 0) { + defer { + f.data.clearRetainingCapacity(); + f.lines = 0; + f.bytes = 0; + } + return if (f.lines > 0) try a.dupe(u8, f.data.items) else null; + } + if (!std.mem.startsWith(u8, text, "data:")) return null; + var value = text[5..]; + if (value.len > 0 and value[0] == ' ') value = value[1..]; + if (f.lines > 0) try f.data.append(a, '\n'); + try f.data.appendSlice(a, value); + f.lines += 1; + f.bytes += raw.len; + if (f.bytes > max_event) return error.InvalidStream; + return null; + } +}; + /// One attempt's stream state; ``arrived`` stamps are monotonic nanoseconds. pub const Stream = struct { a: Allocator, - data: std.ArrayList(u8) = .empty, - data_lines: usize = 0, - event_bytes: usize = 0, + frames: Frames = .{}, total: usize = 0, first: ?i96 = null, last: ?i96 = null, @@ -48,36 +78,17 @@ pub const Stream = struct { pub fn line(s: *Stream, with_newline: []const u8, arrived: i96) Failure!bool { s.total += with_newline.len; if (s.total > max_stream) return error.InvalidStream; - const raw = std.mem.trimEnd(u8, with_newline, "\n"); - if (raw.len > max_event) return error.InvalidStream; - const text = std.mem.trimEnd(u8, raw, "\r"); - if (!std.unicode.utf8ValidateSlice(text)) return error.InvalidStream; - if (text.len == 0) { - defer { - s.data.clearRetainingCapacity(); - s.data_lines = 0; - s.event_bytes = 0; - } - if (s.data_lines > 0) return s.event(s.data.items, arrived); - return false; - } - if (!std.mem.startsWith(u8, text, "data:")) return false; - var value = text[5..]; - if (value.len > 0 and value[0] == ' ') value = value[1..]; - if (s.data_lines > 0) try s.data.append(s.a, '\n'); - try s.data.appendSlice(s.a, value); - s.data_lines += 1; - s.event_bytes += raw.len; - if (s.event_bytes > max_event) return error.InvalidStream; - return false; + const data = try s.frames.line(s.a, with_newline) orelse return false; + return s.event(data, arrived); } + /// ``text`` is the event's own copy, which the parsed chunk may keep slices of. fn event(s: *Stream, text: []const u8, arrived: i96) Failure!bool { if (std.mem.eql(u8, std.mem.trim(u8, text, " \t\n\r\x0b\x0c"), "[DONE]")) { s.done = true; return true; } - const chunk = switch (try json.parseText(s.a, try s.a.dupe(u8, text))) { + const chunk = switch (try json.parseText(s.a, text)) { .ok => |v| v, .err => return error.InvalidStream, }; diff --git a/zig/src/server/benchmark_stream.zig b/zig/src/server/benchmark_stream.zig index a5766a5db84..3664f00a8df 100644 --- a/zig/src/server/benchmark_stream.zig +++ b/zig/src/server/benchmark_stream.zig @@ -234,7 +234,8 @@ const BodyWait = struct { } }; -fn eventStream(content_type: ?[]const u8) bool { +/// A ``text/event-stream`` reply, parameters aside. +pub fn eventStream(content_type: ?[]const u8) bool { const t = content_type orelse return false; const media = std.mem.trim(u8, t[0 .. std.mem.indexOfScalar(u8, t, ';') orelse t.len], " \t"); return std.ascii.eqlIgnoreCase(media, "text/event-stream"); @@ -319,6 +320,7 @@ pub const Fetch = struct { token: ?[]const u8 = null, limit: usize, timeout_s: f64, + agent: []const u8 = user_agent, }; pub const Fetched = struct { @@ -343,7 +345,7 @@ const FetchTask = struct { var req = x.client.request(x.f.method, uri, .{ .keep_alive = false, .redirect_behavior = .unhandled, - .headers = .{ .authorization = auth, .accept_encoding = .{ .override = "identity" }, .user_agent = .{ .override = user_agent }, .content_type = if (x.f.body != null) .{ .override = "application/json" } else .default }, + .headers = .{ .authorization = auth, .accept_encoding = .{ .override = "identity" }, .user_agent = .{ .override = x.f.agent }, .content_type = if (x.f.body != null) .{ .override = "application/json" } else .default }, .extra_headers = &.{.{ .name = "accept", .value = "application/json" }}, }) catch return; defer req.deinit(); diff --git a/zig/src/server/cancel_ids.zig b/zig/src/server/cancel_ids.zig index 2bb5b2f343e..a520898a2d0 100644 --- a/zig/src/server/cancel_ids.zig +++ b/zig/src/server/cancel_ids.zig @@ -8,7 +8,7 @@ const routes = @import("routes.zig"); const Allocator = std.mem.Allocator; /// A client request's ask: set by the route, read by each of its generation loops (chat_generation.zig). -pub const Entry = struct { asked: std.atomic.Value(bool) = .init(false) }; +pub const Entry = struct { asked: std.atomic.Value(bool) = .init(false), owner: ?[32]u8 = null }; /// The process's client requests by public id (chatcmpl-, cmpl-, resp_), held by openai.runNamed; ids are random. pub var registry: Registry = .{}; @@ -48,11 +48,12 @@ pub const Registry = struct { }; } - /// Asks the request named `id` to stop; false when no running or queued request has it. - pub fn cancel(r: *Registry, io: std.Io, id: []const u8) bool { + /// Ask the caller's request to stop; another key's id is the same miss as an unknown id. + pub fn cancel(r: *Registry, io: std.Io, id: []const u8, owner: ?[32]u8) bool { r.mutex.lockUncancelable(io); defer r.mutex.unlock(io); const e = r.map.get(id) orelse return false; + if (!std.meta.eql(e.owner, owner)) return false; e.asked.store(true, .release); return true; } @@ -82,9 +83,9 @@ pub fn match(route: []const u8) ?[]const u8 { } /// The route's answer: 200 with the id when a request had it, else 404 `request_not_found`. -pub fn answer(io: std.Io, a: Allocator, id: []const u8) !struct { status: u16, body: json.Value } { +pub fn answer(io: std.Io, a: Allocator, id: []const u8, owner: ?[32]u8) !struct { status: u16, body: json.Value } { const o = try json.newObject(a); - if (registry.cancel(io, id)) { + if (registry.cancel(io, id, owner)) { try o.put(a, "id", .{ .string = id }); try o.put(a, "object", .{ .string = "request.cancel" }); try o.put(a, "cancelled", .{ .bool = true }); @@ -137,7 +138,7 @@ pub fn post(srv: *Server, conn: *Conn, a: Allocator, id: []const u8) void { if (keyed) return @import("auth_scope_reply.zig").deny(conn, false, .route); return routes.sendValue(conn, a, 403, refusal(a) catch return); } - const got = answer(srv.io, a, id) catch return conn.sendError(a, 500, "out of memory", null) catch {}; + const got = answer(srv.io, a, id, conn.key_digest) catch return conn.sendError(a, 500, "out of memory", null) catch {}; routes.sendValue(conn, a, got.status, got.body); } @@ -153,11 +154,11 @@ test "a held name is cancelled once asked, dropped when its request ends, and an var e: Entry = .{}; const names_ = [_][]const u8{ "cmpl-test-held", "", "resp_test-held" }; registry.add(io, &names_, &e); - try std.testing.expect(registry.cancel(io, "resp_test-held")); + try std.testing.expect(registry.cancel(io, "resp_test-held", null)); try std.testing.expect(e.asked.load(.acquire)); registry.remove(io, &names_, &e); - try std.testing.expect(!registry.cancel(io, "cmpl-test-held")); - try std.testing.expect(!registry.cancel(io, "cmpl-never")); + try std.testing.expect(!registry.cancel(io, "cmpl-test-held", null)); + try std.testing.expect(!registry.cancel(io, "cmpl-never", null)); } test "with API keys only an admin key may cancel; without keys only a direct loopback caller may" { diff --git a/zig/src/server/chat.zig b/zig/src/server/chat.zig index 8a591e5ddf6..3eb1098fd7f 100644 --- a/zig/src/server/chat.zig +++ b/zig/src/server/chat.zig @@ -5,6 +5,7 @@ const json = @import("json"); const errors = @import("errors.zig"); const fields_mod = @import("fields.zig"); const reply_text = @import("reply_text.zig"); +const recipient_reply = @import("recipient_reply.zig"); const tool_stream = @import("tool_stream.zig"); const prompt_mod = @import("prompt.zig"); const images = @import("images.zig"); @@ -121,13 +122,6 @@ test "Server recovery: token staging allocation failure ends the loop without co } } -/// Python's ``bool(fields.get(key))`` on the sampling fields. -fn flag(f: Value, key: []const u8) ?bool { - const v = f.get(key) orelse return null; - if (v == .null) return null; - return v.truthy(); -} - /// A request rendered and checked but not submitted; it holds the preparing count until generate or release. pub const Prepared = struct { input: Input, @@ -161,13 +155,13 @@ pub fn prepare(srv: *Server, cx: *Cx, input: Input, gone: anytype) Failure!Prepa if (preparing) _ = srv.preparing.fetchAdd(1, .acq_rel); errdefer srv.release(preparing, null); if (gone.check()) return error.Cancelled; - const thinking = input.prompt == null and (flag(f, "enable_thinking") orelse srv.config.enable_thinking); + const thinking = input.prompt == null and (fields_mod.flag(f, "enable_thinking") orelse srv.config.enable_thinking); const instruct = input.prompt == null and !thinking and !input.own; // a client's chat with thinking off may take --instruct-sampling's set const reasoning = thinking and srv.info.capability(.reasoning) and (srv.text.vtable.format != .kimi or input.prompt == null); // the prompt renders `thinking`; the reply reads `reasoning` const asked = if (f.get("reasoning_effort")) |e| (if (e == .string) e.string else null) else null; const effort = srv.effortFor(asked); cx.named_effort = if (input.prompt == null) fields_mod.namedEffort(asked, srv.effort_levels) else null; // a raw prompt has no template - cx.clear_thinking = flag(f, "clear_thinking"); + cx.clear_thinking = fields_mod.flag(f, "clear_thinking"); cx.template_fields = f; const rendered = try prompt_mod.prepare(srv, cx, input, thinking, effort); if (gone.check()) return error.Cancelled; @@ -232,7 +226,7 @@ pub fn prepare(srv: *Server, cx: *Cx, input: Input, gone: anytype) Failure!Prepa request.prompt_logprobs = input.prompt_logprobs; if (try engine_refusal.of(srv.engine, cx, &request)) |message| return cx.refuse(message); if (input.trace) |trace| trace.prepared(&request, thinking, effort); - return .{ .input = input, .request = request, .prompt_len = rendered.ids.len, .received = received, .thinking = thinking, .reasoning = reasoning, .effort = effort, .sampled = sampling != null, .drafts = drafts, .token_ids = flag(f, "return_token_ids") orelse false, .stops = stops_opt, .preparing = preparing, .frames = rendered.frames }; + return .{ .input = input, .request = request, .prompt_len = rendered.ids.len, .received = received, .thinking = thinking, .reasoning = reasoning, .effort = effort, .sampled = sampling != null, .drafts = drafts, .token_ids = fields_mod.flag(f, "return_token_ids") orelse false, .stops = stops_opt, .preparing = preparing, .frames = rendered.frames }; } /// Submit a prepared request and collect its reply; ``sink`` hears the stream (null: not streamed). @@ -275,9 +269,10 @@ pub fn generate(srv: *Server, cx: *Cx, prepared: Prepared, sink: ?Sink, gone: an }; srv.release(preparing, null); // a background request waits only while a foreground one prepares preparing = false; - var gen: Generation = .{ .srv = srv, .a = a, .box = &box, .id = id, .asked = input.cancel, .reply_id = input.id, .seed = if (request.sampling) |v| v.seed else null, .sink = sink, .thinking = prepared.reasoning or (srv.text.vtable.format != .kimi and srv.info.capability(.reasoning) and reply_text.isChannel(srv.markers)), .chat = input.prompt == null, .stops = .{ .strings = stops_opt.strings }, .ignore_eos = stops_opt.ignore_eos, .max_tokens = request.max_tokens, .tools = input.tools, .token_ids = prepared.token_ids, .lp = if (request.logprobs != null) .{ .positions = if (sink) |s| s.tokens != null else false } else null, .loop_stop = request.loop_stop, .single = flag(input.fields, "tool_call_single") orelse false, .recover = input.prompt == null and request.structure == null }; + var gen: Generation = .{ .srv = srv, .a = a, .box = &box, .id = id, .asked = input.cancel, .reply_id = input.id, .seed = if (request.sampling) |v| v.seed else null, .sink = sink, .thinking = prepared.reasoning or (srv.text.vtable.format != .kimi and srv.info.capability(.reasoning) and reply_text.isChannel(srv.markers)), .chat = input.prompt == null, .stops = .{ .strings = stops_opt.strings }, .ignore_eos = stops_opt.ignore_eos, .max_tokens = request.max_tokens, .tools = input.tools, .token_ids = prepared.token_ids, .lp = if (request.logprobs != null) .{ .positions = if (sink) |s| s.tokens != null else false } else null, .loop_stop = request.loop_stop, .single = fields_mod.flag(input.fields, "tool_call_single") orelse false, .recover = input.prompt == null and request.structure == null }; defer srv.noteRequest(prepared.prompt_len, cached_tokens.within(box.cached, prepared.prompt_len), gen.collected.items.len, box.stats.drafted, box.stats.accepted, box.stats.rounds, received, gen.first_ns, gen.last_ns, box.stats.prefill_seconds, if (box.stats.prefill_seconds != null) box.stats.queued_seconds else null); errdefer if (!gen.engine_done) gen.cancel(); // the engine writes to the mailbox until it says finished + if (srv.recipients and input.prompt == null) gen.recipient = try recipient_reply.Reading.of(a, srv.text, request.prompt, input.tools, prepared.reasoning); const result: Failure!Reply = blk: { if (sink) |s| if (s.begin) |begin| begin(s.ctx, prepared.prompt_len) catch break :blk error.Cancelled; if (sink != null and input.tools.len > 0 and srv.text.vtable.format != .kimi) gen.calls = tool_stream.Streamer.init(a, input.tools) catch |e| break :blk e; diff --git a/zig/src/server/chat_cli.zig b/zig/src/server/chat_cli.zig new file mode 100644 index 00000000000..53fdc2c101d --- /dev/null +++ b/zig/src/server/chat_cli.zig @@ -0,0 +1,411 @@ +//! ``tensorfold chat``: a conversation in the terminal with a model it serves itself, or with a server already running. +const std = @import("std"); +const builtin = @import("builtin"); +const json = @import("json"); +const args_mod = @import("chat_cli_args.zig"); +const history = @import("chat_cli_history.zig"); +const turn = @import("chat_cli_turn.zig"); +const child = @import("chat_cli_child.zig"); +const stream = @import("benchmark_stream.zig"); +const stop = @import("benchmark_stop.zig"); +const environment = @import("sys").environment; +const Allocator = std.mem.Allocator; +const Sig = std.posix.SIG; + +const windows = builtin.os.tag == .windows; +/// The serve child waits on POSIX signals, as the benchmark's does, so Windows chats only with a running server. +const windows_child = "starting a server is not supported on Windows yet: run tensorfold serve MODEL, then tensorfold chat --url http://127.0.0.1:8080"; +const Child = if (windows) void else child.Child; +/// The longest line a conversation reads, and the most a piped message holds. +const max_line = 1 << 20; +const max_message = 16 << 20; +const banner = "Chatting with {s}. /help lists the commands; /bye or Ctrl-D ends the chat.\n"; +const prompt_hint = "(Type /bye or press Ctrl-D to end the chat.)\n"; +const cut_note = "The reply stopped at its token limit; --max-tokens raises it."; +const thought_note = "The reply held only reasoning, which is hidden; --show-thinking shows it."; + +/// Everything the command touches, so tests run it with captured writers, fixed input and a stand-in server. +pub const Context = struct { + a: Allocator, + io: std.Io, + environ: *const std.process.Environ.Map, + out: *std.Io.Writer, + err: *std.Io.Writer, + input: *std.Io.Reader, + /// stdin is a terminal: a conversation; otherwise all of stdin is one message. + interactive: bool, + /// stdout is a terminal: reasoning dimmed, a hint while it is hidden, and control characters dropped. + terminal: bool, + self_exe: ?[]const u8 = null, + signals: bool = false, +}; + +pub fn main(init: std.process.Init, argv: []const []const u8) !u8 { + const io = init.io; + var out_buf: [16 << 10]u8 = undefined; + var err_buf: [4 << 10]u8 = undefined; + var in_buf: [16 << 10]u8 = undefined; + var out = std.Io.File.stdout().writerStreaming(io, &out_buf); + var err = std.Io.File.stderr().writerStreaming(io, &err_buf); + var in = std.Io.File.stdin().readerStreaming(io, &in_buf); + defer out.interface.flush() catch {}; + defer err.interface.flush() catch {}; + const ctx: Context = .{ + .a = init.arena.allocator(), + .io = io, + .environ = init.environ_map, + .out = &out.interface, + .err = &err.interface, + .input = &in.interface, + .interactive = std.Io.File.stdin().isTty(io) catch false, + .terminal = std.Io.File.stdout().isTty(io) catch false, + .signals = true, + }; + return command(&ctx, argv); +} + +pub fn command(ctx: *const Context, argv: []const []const u8) !u8 { + var problem: []const u8 = ""; + const args = args_mod.parse(ctx.a, argv, &problem) catch |e| switch (e) { + error.Usage => { + try ctx.err.print("{s}\ntensorfold chat: error: {s}\n", .{ args_mod.usage_line, problem }); + try ctx.err.flush(); + return 2; + }, + error.OutOfMemory => |x| return x, + }; + if (args.help) { + try args_mod.help(ctx.out); + try ctx.out.flush(); + return 0; + } + if (windows and args.url == null) return fail(ctx, windows_child); + // a running server's key comes from TENSORFOLD_API_KEY; the server the chat starts gets a fresh one of its own + const key = if (args.url == null) null else envKey(ctx.environ) catch return fail(ctx, bad_key); + if (comptime !windows) if (ctx.signals) signals.install(); + defer if (comptime !windows) if (ctx.signals) signals.restore(); + // a piped message is read before any server starts, so an empty one costs no model load + var message: ?[]const u8 = null; + if (!ctx.interactive) switch (try piped(ctx)) { + .text => |text| message = text, + .code => |code| return code, + }; + if (args.url) |url| return session(ctx, args, .{ .base = url, .model = args.model, .key = key, .denied = denied(key != null) }, message); + if (comptime windows) return fail(ctx, windows_child) else return served(ctx, args, message); +} + +const bad_key = "TENSORFOLD_API_KEY: expected keys without spaces or control characters, at most 256 bytes each"; + +/// The key ``--url`` sends: TENSORFOLD_API_KEY's first, as serve splits the variable; null when it names none. +fn envKey(environ: *const std.process.Environ.Map) error{Refused}!?[]const u8 { + const text = (environment.path("TENSORFOLD_API_KEY", environ.get("TENSORFOLD_API_KEY")) catch return error.Refused) orelse return null; + var keys = std.mem.splitScalar(u8, text, ','); + while (keys.next()) |raw| { + const key = std.mem.trim(u8, raw, " \t\r\n\x0b\x0c"); + if (key.len == 0) continue; + if (key.len > 256) return error.Refused; + for (key) |ch| if (ch < 0x21 or ch == 0x7f) return error.Refused; + return key; + } + return null; +} + +/// What a running server's 401 adds: whether TENSORFOLD_API_KEY gave the key it refused. +fn denied(sent: bool) []const u8 { + return if (sent) "the server refused the key in TENSORFOLD_API_KEY" else "set TENSORFOLD_API_KEY to a key the server accepts"; +} + +/// The chat with the server it starts: loaded, then the session, then stopped whatever the session's end. +fn served(ctx: *const Context, args: args_mod.Args, message: ?[]const u8) !u8 { + var problem: []const u8 = ""; + var tail: []const []const u8 = &.{}; + const setup: child.Setup = .{ .a = ctx.a, .io = ctx.io, .environ = ctx.environ, .exe = ctx.self_exe, .log_dir = ctx.environ.get("TMPDIR") orelse "/tmp" }; + const plan = try child.plan(setup, args.model.?, args.serve, args.startup_timeout, &problem) orelse return fail(ctx, problem); + try say(ctx.err, "Loading {s}; Ctrl-C cancels.", .{args.model.?}); + var own = try child.start(setup, plan, &tail, &problem) orelse { + if (problem.len == 0) return stop.exitCode(stop.requested() orelse .INT); + const code = try fail(ctx, problem); + try lastLines(ctx, tail); + return code; + }; + errdefer _ = own.managed.stop(); + const code = try session(ctx, args, .{ .base = own.managed.base(), .model = own.served, .key = own.key, .own = &own }, message); + if (own.managed.stop()) |why| { + const failed = try fail(ctx, why); + return if (code == 0) failed else code; + } + return code; +} + +/// An exited child's last log lines after its failure, as the benchmark prints them. +fn lastLines(ctx: *const Context, tail: []const []const u8) !void { + if (tail.len == 1) try ctx.err.print("Last server log line: {s}\n", .{tail[0]}); + if (tail.len > 1) try ctx.err.writeAll("Last server log lines:\n"); + if (tail.len > 1) for (tail) |line| try ctx.err.print(" {s}\n", .{line}); + try ctx.err.flush(); +} + +/// The server a session talks to: its address, the model to ask for, its key, and what its 401 adds. +const Target = struct { base: []const u8, model: ?[]const u8, key: ?[]const u8 = null, denied: ?[]const u8 = null, own: ?*Child = null }; + +const Session = struct { + ctx: *const Context, + /// The chat route. + url: []const u8, + target: Target, + settings: turn.Settings, + show: turn.Show, + history: history.History, + + /// One message and its streamed reply, in an arena of its own that lives until the turn is kept. + fn ask(s: *Session, a: Allocator, message: []const u8) !turn.Ended { + const request = try turn.body(a, s.settings, &s.history, message); + return turn.run(a, s.ctx.io, s.url, s.target.key, request, s.ctx.out, s.show); + } + + /// A finished reply's notes: cut at its token limit, or nothing but reasoning that was hidden. + fn notes(s: *const Session, f: turn.Finished) !void { + if (f.cut) try say(s.ctx.err, cut_note, .{}); + if (f.content.len == 0 and f.reasoned and !s.show.thinking) try say(s.ctx.err, thought_note, .{}); + } + + /// A failed turn said; a conversation goes on (null) unless the server it started has exited. + fn failed(s: *Session, f: turn.Failure) !?u8 { + const hint = if (f.status == 401) s.target.denied else null; + _ = try fail(s.ctx, if (hint) |h| try std.fmt.allocPrint(s.ctx.a, "{s}; {s}", .{ f.reason, h }) else f.reason); + if (comptime !windows) if (f.connect) if (s.target.own) |own| if (try own.managed.exitedTail(s.ctx.a)) |tail| { + try s.ctx.err.writeAll("The model server has exited.\n"); + try lastLines(s.ctx, tail); + return 1; + }; + return if (s.ctx.interactive) null else 1; + } + + /// A message of the conversation: null to read the next line, else the chat's exit code. + fn talk(s: *Session, text: []const u8) !?u8 { + var arena: std.heap.ArenaAllocator = .init(std.heap.smp_allocator); + defer arena.deinit(); + switch (try s.ask(arena.allocator(), text)) { + .finished => |f| { + if (f.content.len > 0) try s.history.keep(text, f.content); + try s.notes(f); + }, + // a stopped reply keeps what it printed, so the next message can redirect it + .stopped => |content| { + const sig = stop.requested() orelse .INT; + if (sig != .INT) return stop.exitCode(sig); + stop.reset(); + if (content.len > 0) try s.history.keep(text, content); + }, + .failed => |f| return s.failed(f), + } + return null; + } +}; + +/// Finds the model and its thinking switch, then holds one exchange (a piped message) or a conversation. +fn session(ctx: *const Context, args: args_mod.Args, target: Target, message: ?[]const u8) !u8 { + var problem: []const u8 = ""; + const url = try stream.endpoint(ctx.a, target.base, true, &problem) orelse return fail(ctx, problem); + const found = try discover(ctx, url, target); + if (found.stopped) |sig| return stop.exitCode(sig); + const model = found.model orelse return fail(ctx, found.problem); + if (args.no_thinking and found.thinking_switch == false) + return fail(ctx, "--no-thinking: this model's chat template cannot turn thinking off (its /v1/models thinking_switch is false)"); + var s: Session = .{ + .ctx = ctx, + .url = url, + .target = target, + .settings = .{ .model = model, .temperature = args.temperature, .max_tokens = args.max_tokens, .no_thinking = args.no_thinking }, + .show = .{ .thinking = args.show_thinking, .terminal = ctx.terminal }, + .history = .{ .a = ctx.a }, + }; + if (args.system) |text| try s.history.setSystem(text); + if (message) |text| { + var arena: std.heap.ArenaAllocator = .init(std.heap.smp_allocator); + defer arena.deinit(); + return switch (try s.ask(arena.allocator(), text)) { + .finished => |f| blk: { + try s.notes(f); + break :blk 0; + }, + .stopped => stop.exitCode(stop.requested() orelse .INT), + .failed => |f| (try s.failed(f)) orelse 1, + }; + } + return converse(&s); +} + +/// The conversation: a prompt, a line, then a command or a turn, until /bye, end of input or a stop signal. +fn converse(s: *Session) !u8 { + const ctx = s.ctx; + try ctx.out.print(banner, .{s.settings.model}); + while (true) { + try ctx.out.writeAll("> "); + try ctx.out.flush(); + var arena: std.heap.ArenaAllocator = .init(std.heap.smp_allocator); + defer arena.deinit(); + const text = switch (readLine(ctx, arena.allocator())) { + .line => |line| line, + .eof => { + try ctx.out.writeAll("\n"); + try ctx.out.flush(); + return 0; + }, + .stopped => |sig| { + if (sig != .INT) return stop.exitCode(sig); + stop.reset(); + try ctx.out.writeAll("\n" ++ prompt_hint); + continue; + }, + .too_long => { + try say(ctx.err, "That line is over 1 MiB and was not sent; pipe long text through stdin instead.", .{}); + continue; + }, + .failed => return fail(ctx, "could not read the terminal"), + }; + switch (history.command(text)) { + .empty => {}, + .bye => return 0, + .help => try ctx.out.writeAll(history.help_text), + .clear => { + s.history.clear(); + try ctx.out.writeAll("Conversation cleared.\n"); + }, + .system => |prompt| { + try s.history.setSystem(prompt); + try ctx.out.writeAll(if (prompt.len == 0) "System prompt removed.\n" else "System prompt set.\n"); + }, + .unknown => |word| try ctx.out.print("Unknown command {s}; /help lists the commands.\n", .{word}), + .say => |said| if (try s.talk(said)) |code| return code, + } + } +} + +const Found = struct { model: ?[]const u8 = null, thinking_switch: ?bool = null, problem: []const u8 = "", stopped: ?Sig = null }; + +/// One bounded look at ``/v1/models``: its first model when none was named, and whether thinking can be turned off. +fn discover(ctx: *const Context, chat_url: []const u8, target: Target) !Found { + var client: std.http.Client = .{ .allocator = std.heap.smp_allocator, .io = ctx.io }; + defer client.deinit(); + const url = try std.mem.concat(ctx.a, u8, &.{ chat_url[0 .. chat_url.len - "/chat/completions".len], "/models" }); + const got = stream.fetch(ctx.a, ctx.io, &client, .{ .url = url, .limit = 4 << 20, .timeout_s = 10, .agent = turn.user_agent, .token = target.key }); + if (got.failed == .stopped) return .{ .stopped = stop.requested() orelse .INT }; + var doc: ?json.Value = null; + if (got.failed == .none and got.status == 200) switch (try json.parse(ctx.a, got.body)) { + .ok => |v| doc = v, + .err => {}, + }; + const name = target.model orelse first(doc) orelse { + if (got.failed == .none and got.status == 401) if (target.denied) |hint| + return .{ .problem = try std.fmt.allocPrint(ctx.a, "no model to chat with: {s} answered HTTP 401; {s}", .{ url, hint }) }; + const why = switch (got.failed) { + .none => if (got.status != 200) try std.fmt.allocPrint(ctx.a, "answered HTTP {d}", .{got.status}) else "listed no models", + .network => "could not connect", + .deadline => "gave no answer in 10 s", + .too_large => "answered with more than 4 MiB", + .stopped => unreachable, + }; + return .{ .problem = try std.fmt.allocPrint(ctx.a, "no model to chat with: {s} {s}; name one after the URL", .{ url, why }) }; + }; + return .{ .model = name, .thinking_switch = if (doc) |d| stream.thinkingSwitch(d, name) else null }; +} + +/// The first ``data[].id`` of a ``/v1/models`` document. +fn first(doc: ?json.Value) ?[]const u8 { + const data = (doc orelse return null).get("data") orelse return null; + if (data != .array or data.array.len == 0) return null; + return data.array[0].strField("id"); +} + +const Read = union(enum) { line: []const u8, eof, too_long, failed, stopped: Sig }; + +/// One typed line, read as its own task so a stop signal ends the wait. +const LineTask = struct { + a: Allocator, + r: *std.Io.Reader, + got: Read = .failed, + done: std.atomic.Value(bool) = .init(false), + + fn go(t: *LineTask) void { + var line: std.Io.Writer.Allocating = .init(t.a); + _ = t.r.streamDelimiterLimit(&line.writer, '\n', .limited(max_line)) catch |e| { + if (e == error.StreamTooLong) _ = t.r.discardDelimiterInclusive('\n') catch 0; + t.got = if (e == error.StreamTooLong) .too_long else .failed; + return; + }; + // the newline is left in the buffer; an empty buffer means the input ended without one + if (t.r.bufferedLen() > 0) { + t.r.toss(1); + t.got = .{ .line = line.written() }; + } else t.got = if (line.written().len == 0) .eof else .{ .line = line.written() }; + } +}; + +fn readLine(ctx: *const Context, a: Allocator) Read { + var task: LineTask = .{ .a = a, .r = ctx.input }; + return switch (stream.bounded(ctx.io, null, LineTask.go, &task)) { + .finished => task.got, + .stopped, .deadline => .{ .stopped = stop.requested() orelse .INT }, + .unavailable => .failed, + }; +} + +const Piped = union(enum) { text: []const u8, code: u8 }; + +/// All of stdin, read as its own task so a stop signal ends the wait. +const AllTask = struct { + a: Allocator, + r: *std.Io.Reader, + text: ?[]u8 = null, + too_long: bool = false, + done: std.atomic.Value(bool) = .init(false), + + fn go(t: *AllTask) void { + t.text = t.r.allocRemaining(t.a, .limited(max_message)) catch |e| { + t.too_long = e == error.StreamTooLong; + return; + }; + } +}; + +/// The piped message, trimmed, or the exit code once its problem is said. +fn piped(ctx: *const Context) !Piped { + var task: AllTask = .{ .a = ctx.a, .r = ctx.input }; + switch (stream.bounded(ctx.io, null, AllTask.go, &task)) { + .finished => {}, + .stopped, .deadline => return .{ .code = stop.exitCode(stop.requested() orelse .INT) }, + .unavailable => return .{ .code = try fail(ctx, "could not read stdin") }, + } + if (task.too_long) return .{ .code = try fail(ctx, "stdin holds more than 16 MiB; a message must be smaller") }; + const text = std.mem.trim(u8, task.text orelse return .{ .code = try fail(ctx, "could not read stdin") }, " \t\r\n"); + if (text.len == 0) return .{ .code = try fail(ctx, "stdin held no message to send") }; + return .{ .text = text }; +} + +/// Ctrl-C, SIGTERM and SIGHUP to the stop flag the waits read; a closed stdout fails a write instead of the process. +const signals = struct { + var pipe_saved: std.posix.Sigaction = undefined; + + fn install() void { + stop.install(); + const ignore: std.posix.Sigaction = .{ .handler = .{ .handler = std.posix.SIG.IGN }, .mask = std.posix.sigemptyset(), .flags = 0 }; + std.posix.sigaction(.PIPE, &ignore, &pipe_saved); + } + + fn restore() void { + std.posix.sigaction(.PIPE, &pipe_saved, null); + stop.restore(); + } +}; + +fn say(w: *std.Io.Writer, comptime fmt: []const u8, args: anytype) !void { + try w.print(fmt ++ "\n", args); + try w.flush(); +} + +fn fail(ctx: *const Context, message: []const u8) !u8 { + try ctx.err.print("tensorfold chat: {s}\n", .{message}); + try ctx.err.flush(); + return 1; +} diff --git a/zig/src/server/chat_cli_args.zig b/zig/src/server/chat_cli_args.zig new file mode 100644 index 00000000000..a584b98beb6 --- /dev/null +++ b/zig/src/server/chat_cli_args.zig @@ -0,0 +1,190 @@ +//! ``tensorfold chat`` flags in one pass, the serve flags after ``--``, the usage line and the help. +const std = @import("std"); +const splitUrl = @import("benchmark_stream.zig").splitUrl; +const Allocator = std.mem.Allocator; + +pub const Args = struct { + help: bool = false, + /// The checkpoint to serve, or the model to ask a ``--url`` server for. + model: ?[]const u8 = null, + url: ?[]const u8 = null, + system: ?[]const u8 = null, + temperature: ?f64 = null, + max_tokens: ?i64 = null, + show_thinking: bool = false, + no_thinking: bool = false, + startup_timeout: ?f64 = null, + /// What follows ``--``: flags for the started ``tensorfold serve``. + serve: []const []const u8 = &.{}, +}; + +pub const usage_line = "usage: tensorfold chat [-h] [--url URL] [--system TEXT] [--temperature T] [--max-tokens N]" ++ + " [--show-thinking | --no-thinking] [--startup-timeout SECONDS] [MODEL] [-- SERVE_FLAGS...]"; + +const Flag = struct { name: []const u8, value: bool = true, help: []const u8 }; + +pub const flags = [_]Flag{ + .{ .name = "--url", .help = "chat with a server already running at this http(s) address instead of starting one" }, + .{ .name = "--system", .help = "the system prompt (/system changes it in the chat)" }, + .{ .name = "--temperature", .help = "sampling temperature, 0 for greedy (default: the server's)" }, + .{ .name = "--max-tokens", .help = "the longest reply in tokens (default: the server's)" }, + .{ .name = "--show-thinking", .value = false, .help = "show the model's reasoning, dimmed, before its answer" }, + .{ .name = "--no-thinking", .value = false, .help = "ask the server to skip thinking (chat_template_kwargs.enable_thinking false)" }, + .{ .name = "--startup-timeout", .help = "seconds the started server gets to load (default: 600, plus 6 per GB of weights past 20 GB, at most 3600)" }, + .{ .name = "--help", .value = false, .help = "show this help message and exit" }, +}; + +fn usage(a: Allocator, problem: *[]const u8, comptime fmt: []const u8, args: anytype) error{ Usage, OutOfMemory } { + problem.* = try std.fmt.allocPrint(a, fmt, args); + return error.Usage; +} + +fn find(name: []const u8) ?Flag { + for (flags) |f| if (std.mem.eql(u8, f.name, name)) return f; + return null; +} + +/// The arguments after ``chat``; ``Usage`` names the problem, and the caller prints the usage line and exits 2. +pub fn parse(a: Allocator, argv: []const []const u8, problem: *[]const u8) error{ Usage, OutOfMemory }!Args { + var out: Args = .{}; + var i: usize = 0; + while (i < argv.len) : (i += 1) { + const token = argv[i]; + if (std.mem.eql(u8, token, "--")) { + out.serve = argv[i + 1 ..]; + break; + } + if (std.mem.eql(u8, token, "-h")) return .{ .help = true }; + if (!std.mem.startsWith(u8, token, "--")) { + if (out.model != null) return usage(a, problem, "unrecognized arguments: {s}", .{token}); + out.model = token; + continue; + } + const eq = std.mem.indexOfScalar(u8, token, '='); + const name = token[0 .. eq orelse token.len]; + const flag = find(name) orelse return usage(a, problem, "unrecognized arguments: {s}", .{token}); + var value: []const u8 = ""; + if (flag.value) { + if (eq) |e| value = token[e + 1 ..] else { + i += 1; + if (i >= argv.len or std.mem.startsWith(u8, argv[i], "--")) return usage(a, problem, "argument {s}: expected one argument", .{name}); + value = argv[i]; + } + } else if (eq) |e| return usage(a, problem, "argument {s}: ignored explicit argument '{s}'", .{ name, token[e + 1 ..] }); + if (is(name, "--help")) return .{ .help = true }; + if (is(name, "--url")) out.url = value; + if (is(name, "--system")) out.system = value; + if (is(name, "--show-thinking")) out.show_thinking = true; + if (is(name, "--no-thinking")) out.no_thinking = true; + if (is(name, "--temperature")) { + const t = std.fmt.parseFloat(f64, value) catch null; + if (t == null or !std.math.isFinite(t.?) or t.? < 0) return usage(a, problem, "argument --temperature: expected a number, 0 (greedy) or more: '{s}'", .{value}); + out.temperature = t; + } + if (is(name, "--max-tokens")) { + const n = std.fmt.parseInt(i64, value, 10) catch 0; + if (n < 1) return usage(a, problem, "argument --max-tokens: expected a positive token count: '{s}'", .{value}); + out.max_tokens = n; + } + if (is(name, "--startup-timeout")) { + const s = std.fmt.parseFloat(f64, value) catch null; + if (s == null or !std.math.isFinite(s.?) or s.? <= 0 or s.? > 3600) return usage(a, problem, "argument --startup-timeout: expected seconds above 0 and at most 3600: '{s}'", .{value}); + out.startup_timeout = s; + } + } + try checks(a, out, problem); + return out; +} + +fn is(x: []const u8, y: []const u8) bool { + return std.mem.eql(u8, x, y); +} + +/// The combinations a chat refuses, the first that fails named. +fn checks(a: Allocator, out: Args, problem: *[]const u8) error{ Usage, OutOfMemory }!void { + if (out.show_thinking and out.no_thinking) return usage(a, problem, "argument --show-thinking: not allowed with argument --no-thinking", .{}); + const url = out.url orelse { + if (out.model == null) return usage(a, problem, "the following arguments are required: MODEL (a model to serve), or --url URL", .{}); + return; + }; + if (splitUrl(url) == null) return usage(a, problem, "argument --url: expected an http or https URL without credentials, query or fragment: '{s}'", .{url}); + if (out.serve.len > 0) return usage(a, problem, "flags after -- go to the server tensorfold chat starts; --url names one already running", .{}); + if (out.startup_timeout != null) return usage(a, problem, "argument --startup-timeout: applies only to the server tensorfold chat starts, not to --url", .{}); +} + +/// ``-h``: the usage line, what the command does and one line per flag. +pub fn help(w: *std.Io.Writer) !void { + try w.print("{s}\n\n", .{usage_line}); + try w.writeAll( + \\Chat with a model in the terminal. tensorfold chat MODEL starts tensorfold serve MODEL on a free loopback port, + \\waits until it is ready, and stops it when the chat ends; --url chats with a server that is already running. + \\When stdin is not a terminal, all of stdin is one message and only the reply is written to stdout. + \\ + \\positional arguments: + \\ MODEL a cached repo ID or checkpoint directory to serve, or with --url the model to ask for + \\ (default with --url: the first in its /v1/models) + \\ SERVE_FLAGS after --, flags for the started tensorfold serve, such as --parallel 1 + \\ + \\options: + \\ + ); + for (flags) |f| try w.print(" {s:<19} {s}\n", .{ f.name, f.help }); + try w.writeAll("\nIn the chat, /help lists the commands: /bye (or Ctrl-D) ends it, /clear, /system TEXT. Ctrl-C stops a reply.\n"); +} + +test "chat CLI: flags, the serve flags after --, and the model or --url a chat needs" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var problem: []const u8 = ""; + const full = try parse(a, &.{ "example-org/model", "--system", "Be brief.", "--temperature=0.5", "--max-tokens", "64", "--show-thinking", "--", "--parallel", "1", "--url" }, &problem); + try std.testing.expectEqualStrings("example-org/model", full.model.?); + try std.testing.expectEqualStrings("Be brief.", full.system.?); + try std.testing.expect(full.temperature.? == 0.5 and full.max_tokens.? == 64 and full.show_thinking and !full.no_thinking); + try std.testing.expectEqual(@as(usize, 3), full.serve.len); + try std.testing.expectEqualStrings("--url", full.serve[2]); + const attached = try parse(a, &.{ "--url", "http://127.0.0.1:8080/v1", "--no-thinking" }, &problem); + try std.testing.expect(attached.model == null and attached.no_thinking and attached.serve.len == 0); + try std.testing.expect((try parse(a, &.{ "m", "-h" }, &problem)).help); + try std.testing.expect((try parse(a, &.{"--help"}, &problem)).help); + try std.testing.expectEqual(@as(?f64, 30), (try parse(a, &.{ "m", "--startup-timeout", "30" }, &problem)).startup_timeout); +} + +test "chat CLI: every refused argument is a usage error that names it" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var problem: []const u8 = ""; + const cases = [_]struct { []const []const u8, []const u8 }{ + .{ &.{}, "the following arguments are required: MODEL (a model to serve), or --url URL" }, + .{ &.{ "a", "b" }, "unrecognized arguments: b" }, + .{ &.{ "m", "--bogus" }, "unrecognized arguments: --bogus" }, + .{ &.{ "m", "--system" }, "argument --system: expected one argument" }, + .{ &.{ "m", "--system", "--no-thinking" }, "argument --system: expected one argument" }, + .{ &.{ "m", "--no-thinking=1" }, "argument --no-thinking: ignored explicit argument '1'" }, + .{ &.{ "m", "--temperature", "-1" }, "argument --temperature: expected a number, 0 (greedy) or more: '-1'" }, + .{ &.{ "m", "--temperature", "inf" }, "argument --temperature: expected a number, 0 (greedy) or more: 'inf'" }, + .{ &.{ "m", "--temperature", "warm" }, "argument --temperature: expected a number, 0 (greedy) or more: 'warm'" }, + .{ &.{ "m", "--max-tokens", "0" }, "argument --max-tokens: expected a positive token count: '0'" }, + .{ &.{ "m", "--max-tokens", "1.5" }, "argument --max-tokens: expected a positive token count: '1.5'" }, + .{ &.{ "m", "--startup-timeout", "3601" }, "argument --startup-timeout: expected seconds above 0 and at most 3600: '3601'" }, + .{ &.{ "m", "--show-thinking", "--no-thinking" }, "argument --show-thinking: not allowed with argument --no-thinking" }, + .{ &.{ "--url", "ftp://127.0.0.1:1" }, "argument --url: expected an http or https URL without credentials, query or fragment: 'ftp://127.0.0.1:1'" }, + .{ &.{ "--url", "http://user:secret@127.0.0.1:1" }, "argument --url: expected an http or https URL without credentials, query or fragment: 'http://user:secret@127.0.0.1:1'" }, + .{ &.{ "--url", "http://127.0.0.1:1", "--", "--parallel", "1" }, "flags after -- go to the server tensorfold chat starts; --url names one already running" }, + .{ &.{ "--url", "http://127.0.0.1:1", "--startup-timeout", "5" }, "argument --startup-timeout: applies only to the server tensorfold chat starts, not to --url" }, + }; + for (cases) |c| { + try std.testing.expectError(error.Usage, parse(a, c[0], &problem)); + try std.testing.expectEqualStrings(c[1], problem); + } +} + +test "chat CLI: the help names every flag and the in-chat commands" { + var out: std.Io.Writer.Allocating = .init(std.testing.allocator); + defer out.deinit(); + try help(&out.writer); + for (flags) |f| try std.testing.expect(std.mem.indexOf(u8, out.written(), f.name) != null); + for ([_][]const u8{ usage_line, "/bye", "/clear", "/system TEXT", "Ctrl-C stops a reply", "-- SERVE_FLAGS" }) |want| + try std.testing.expect(std.mem.indexOf(u8, out.written(), want) != null); +} diff --git a/zig/src/server/chat_cli_child.zig b/zig/src/server/chat_cli_child.zig new file mode 100644 index 00000000000..d9b64f379d1 --- /dev/null +++ b/zig/src/server/chat_cli_child.zig @@ -0,0 +1,116 @@ +//! The server ``tensorfold chat MODEL`` starts through the benchmark's serve child: its flags checked, then ready. +const std = @import("std"); +const cli = @import("cli.zig"); +const cli_config = @import("cli_config.zig"); +const hub = @import("hub.zig"); +const model = @import("benchmark_model.zig"); +const server = @import("benchmark_server.zig"); +const Allocator = std.mem.Allocator; + +/// What a chat's own server says when it fails to start or stop. +pub const words: server.Words = .{ + .log = "Model server could not start; check the checkpoint and directory permissions", + .spawn = "Could not start the model server; check the TensorFold installation", + .exited = "Model server exited during startup; check the checkpoint and backend toolchain", + .timed_out = "Model server startup timed out after", + .stuck = "Model server did not exit after termination; cleanup is incomplete", +}; + +/// What a start needs: the environment, this executable unless tests name another, and where the log is made. +pub const Setup = struct { a: Allocator, io: std.Io, environ: *const std.process.Environ.Map, exe: ?[]const u8 = null, log_dir: []const u8 }; + +/// The started server, the name it serves and the key every request to it carries. +pub const Child = struct { managed: server.Managed, served: []const u8, key: []const u8 }; + +/// The serve child's arguments: the checkpoint, loopback, a free port and the model's own name, then ``extra``. +pub fn argv(a: Allocator, exe: []const u8, dir: []const u8, served: []const u8, extra: []const []const u8) ![]const []const u8 { + const head = [_][]const u8{ exe, "serve", dir, "--host", "127.0.0.1", "--port", "0", "--name", served }; + return std.mem.concat(a, []const u8, &.{ &head, extra }); +} + +/// The name the child will serve, read as serve reads its flags (a ``--name`` after ``--`` wins); null: refused. +pub fn check(a: Allocator, child_argv: []const []const u8, problem: *[]const u8) !?[]const u8 { + var u: cli.Usage = .{}; + const expanded = cli_config.expand(a, child_argv[2..], &u) catch |e| switch (e) { + error.Usage => return refuse(a, problem, u.message), + else => |x| return x, + }; + const parsed = cli.parse(a, expanded.argv, &u) catch |e| switch (e) { + error.Usage => return refuse(a, problem, u.message), + else => |x| return x, + }; + if (!std.mem.eql(u8, parsed.host, "127.0.0.1") or parsed.port != 0) { + problem.* = "--host and --port: tensorfold chat gives the server it starts a free port on 127.0.0.1"; + return null; + } + if (parsed.api_key.len > 0 or parsed.api_key_file != null) { + problem.* = "--api-key and --api-key-file: tensorfold chat sends no key to the server it starts"; + return null; + } + return parsed.name; +} + +fn refuse(a: Allocator, problem: *[]const u8, why: []const u8) !?[]const u8 { + problem.* = try std.fmt.allocPrint(a, "tensorfold serve refuses the flags after --: {s}", .{why}); + return null; +} + +/// A child ready to start: its command line, the name it will serve, how long it gets to load and its key. +pub const Plan = struct { argv: []const []const u8, served: []const u8, timeout_s: f64, key: []const u8 }; + +/// A fresh key for one child, 32 random bytes as hex, so the server answers this chat and no other local user. +pub fn freshKey(a: Allocator, io: std.Io) ![]const u8 { + var raw: [32]u8 = undefined; + io.random(&raw); + return a.dupe(u8, &std.fmt.bytesToHex(raw, .lower)); +} + +/// The plan for ``model_arg``: a cached checkpoint and flags serve takes; null with ``problem`` set. +pub fn plan(s: Setup, model_arg: []const u8, extra: []const []const u8, startup_timeout: ?f64, problem: *[]const u8) !?Plan { + const dir = try hub.resolve(s.a, s.io, s.environ, model_arg, problem) orelse return null; + const exe = s.exe orelse try std.process.executablePathAlloc(s.io, s.a); + const child_argv = try argv(s.a, exe, dir, hub.servedName("", model_arg, dir), extra); + const served = try check(s.a, child_argv, problem) orelse return null; + const timeout_s = startup_timeout orelse server.startupTimeout(model.weightBytes(s.io, dir)); + return .{ .argv = child_argv, .served = served, .timeout_s = timeout_s, .key = try freshKey(s.a, s.io) }; +} + +/// ``p`` started and ready; null with ``problem`` set ("" when stopped) and ``tail`` the child's last log lines. +pub fn start(s: Setup, p: Plan, tail: *[]const []const u8, problem: *[]const u8) !?Child { + const o: server.Options = .{ .startup_timeout_s = p.timeout_s, .bench_dir = s.log_dir, .tail = tail, .served = p.served, .lock = false, .own_group = true, .key = p.key, .words = words }; + const m = try server.Managed.spawn(s.a, s.io, s.environ, p.argv, o, problem) orelse return null; + return .{ .managed = m, .served = p.served, .key = p.key }; +} + +test "chat CLI: the started server's flags are serve's, checked before a spawn; its address and keys stay the chat's" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var problem: []const u8 = ""; + const head = [_][]const u8{ "/opt/example/tensorfold-native", "/models/example" }; + const plain = try argv(a, head[0], head[1], "example", &.{ "--parallel", "1" }); + try std.testing.expectEqualStrings("serve", plain[1]); + try std.testing.expectEqualStrings("example", (try check(a, plain, &problem)).?); + try std.testing.expectEqualStrings("mine", (try check(a, try argv(a, head[0], head[1], "example", &.{ "--name", "mine" }), &problem)).?); + const refused = [_]struct { []const []const u8, []const u8 }{ + .{ &.{ "--port", "9000" }, "--host and --port: tensorfold chat gives the server it starts a free port on 127.0.0.1" }, + .{ &.{"--host=localhost"}, "--host and --port: tensorfold chat gives the server it starts a free port on 127.0.0.1" }, + .{ &.{ "--api-key", "example-key" }, "--api-key and --api-key-file: tensorfold chat sends no key to the server it starts" }, + .{ &.{"--paralel"}, "tensorfold serve refuses the flags after --: unrecognized arguments: --paralel" }, + .{ &.{ "--unix-socket", "/tmp/example.sock" }, "tensorfold serve refuses the flags after --: argument --unix-socket: not allowed with --port" }, + }; + for (refused) |c| { + try std.testing.expect(try check(a, try argv(a, head[0], head[1], "example", c[0]), &problem) == null); + try std.testing.expectEqualStrings(c[1], problem); + } +} + +test "chat CLI: each child's key is 64 hex characters of fresh randomness" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const one = try freshKey(a, std.testing.io); + const two = try freshKey(a, std.testing.io); + try std.testing.expect(one.len == 64 and !std.mem.eql(u8, one, two)); + for (one) |ch| try std.testing.expect(std.ascii.isDigit(ch) or (ch >= 'a' and ch <= 'f')); +} diff --git a/zig/src/server/chat_cli_history.zig b/zig/src/server/chat_cli_history.zig new file mode 100644 index 00000000000..30e70915edc --- /dev/null +++ b/zig/src/server/chat_cli_history.zig @@ -0,0 +1,132 @@ +//! A chat's conversation and its commands: the system prompt, the kept turns, and what a typed line asks for. +const std = @import("std"); +const json = @import("json"); +const Allocator = std.mem.Allocator; + +/// One exchange the next request carries: the user's message and the answer. +pub const Turn = struct { user: []const u8, assistant: []const u8 }; + +pub const History = struct { + /// Holds the kept texts for the whole chat. + a: Allocator, + system: ?[]const u8 = null, + turns: std.ArrayList(Turn) = .empty, + + /// Forgets every turn; the system prompt stays. + pub fn clear(h: *History) void { + h.turns.clearRetainingCapacity(); + } + + /// The system prompt the next request starts with; empty text removes it. + pub fn setSystem(h: *History, text: []const u8) !void { + h.system = if (text.len == 0) null else try h.a.dupe(u8, text); + } + + /// Keeps a copy of a finished or stopped exchange. + pub fn keep(h: *History, user: []const u8, assistant: []const u8) !void { + try h.turns.append(h.a, .{ .user = try h.a.dupe(u8, user), .assistant = try h.a.dupe(u8, assistant) }); + } + + /// The request's messages in ``a``: the system prompt, every kept turn in order, then ``user``. + pub fn messages(h: *const History, a: Allocator, user: []const u8) ![]json.Value { + var out: std.ArrayList(json.Value) = .empty; + if (h.system) |s| try out.append(a, try message(a, "system", s)); + for (h.turns.items) |t| { + try out.append(a, try message(a, "user", t.user)); + try out.append(a, try message(a, "assistant", t.assistant)); + } + try out.append(a, try message(a, "user", user)); + return out.items; + } +}; + +fn message(a: Allocator, role: []const u8, content: []const u8) !json.Value { + const o = try json.newObject(a); + try o.put(a, "role", .{ .string = role }); + try o.put(a, "content", .{ .string = content }); + return .{ .object = o }; +} + +pub const Command = union(enum) { + /// Text to send, trimmed. + say: []const u8, + /// A blank line. + empty, + bye, + clear, + help, + /// ``/system``'s text; empty removes the prompt. + system: []const u8, + /// A ``/word`` that names no command. + unknown: []const u8, +}; + +/// What a typed line asks for: a command when its first character is ``/``, else a message. +pub fn command(line: []const u8) Command { + const raw = std.mem.trimEnd(u8, line, "\r\n"); + if (!std.mem.startsWith(u8, raw, "/")) { + const text = std.mem.trim(u8, raw, " \t"); + return if (text.len == 0) .empty else .{ .say = text }; + } + const end = std.mem.indexOfAny(u8, raw, " \t") orelse raw.len; + const word = raw[0..end]; + const rest = std.mem.trim(u8, raw[end..], " \t"); + if (std.mem.eql(u8, word, "/bye")) return .bye; + if (std.mem.eql(u8, word, "/clear")) return .clear; + if (std.mem.eql(u8, word, "/help")) return .help; + if (std.mem.eql(u8, word, "/system")) return .{ .system = rest }; + return .{ .unknown = word }; +} + +/// ``/help``'s list. +pub const help_text = + \\/bye end the chat (Ctrl-D does too) + \\/clear forget the conversation; the system prompt stays + \\/system TEXT set the system prompt; /system alone removes it + \\/help show this list + \\Ctrl-C stops a reply. A line that starts with a space is sent as it is, even when a / follows. + \\ +; + +test "chat CLI: a typed line is a command only when it starts with /" { + const C = Command; + try std.testing.expectEqualDeep(C{ .say = "hello there" }, command(" hello there \r\n")); + try std.testing.expectEqualDeep(C.empty, command(" \t\n")); + try std.testing.expectEqualDeep(C.bye, command("/bye\n")); + try std.testing.expectEqualDeep(C.clear, command("/clear")); + try std.testing.expectEqualDeep(C.help, command("/help me")); + try std.testing.expectEqualDeep(C{ .system = "Answer in French." }, command("/system Answer in French. \n")); + try std.testing.expectEqualDeep(C{ .system = "" }, command("/system\n")); + try std.testing.expectEqualDeep(C{ .unknown = "/exit" }, command("/exit now")); + try std.testing.expectEqualDeep(C{ .unknown = "/systemd" }, command("/systemd")); + try std.testing.expectEqualDeep(C{ .say = "/etc/hosts holds what?" }, command(" /etc/hosts holds what?")); +} + +test "chat CLI: /clear drops the turns but keeps the system prompt, and /system replaces or removes it" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var h: History = .{ .a = a }; + try std.testing.expectEqualStrings("[{\"role\": \"user\", \"content\": \"hi\"}]", try roles(a, &h, "hi")); + try h.setSystem("Be brief."); + var said = [_]u8{ 'o', 'n', 'e' }; + try h.keep(&said, "1"); + said[0] = 'x'; // the history holds its own copy + try h.keep("two", "2"); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"one\"}, " ++ + "{\"role\": \"assistant\", \"content\": \"1\"}, {\"role\": \"user\", \"content\": \"two\"}, {\"role\": \"assistant\", \"content\": \"2\"}, " ++ + "{\"role\": \"user\", \"content\": \"three\"}]", try roles(a, &h, "three")); + h.clear(); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"again\"}]", try roles(a, &h, "again")); + try h.setSystem("Answer in French."); + try h.keep("q", "r"); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Answer in French.\"}, {\"role\": \"user\", \"content\": \"q\"}, " ++ + "{\"role\": \"assistant\", \"content\": \"r\"}, {\"role\": \"user\", \"content\": \"s\"}]", try roles(a, &h, "s")); + try h.setSystem(""); + try std.testing.expectEqualStrings("[{\"role\": \"user\", \"content\": \"q\"}, {\"role\": \"assistant\", \"content\": \"r\"}, " ++ + "{\"role\": \"user\", \"content\": \"s\"}]", try roles(a, &h, "s")); +} + +fn roles(a: Allocator, h: *const History, user: []const u8) ![]const u8 { + return json.stringify(a, .{ .array = try h.messages(a, user) }, .{}); +} diff --git a/zig/src/server/chat_cli_reply.zig b/zig/src/server/chat_cli_reply.zig new file mode 100644 index 00000000000..106f30255de --- /dev/null +++ b/zig/src/server/chat_cli_reply.zig @@ -0,0 +1,185 @@ +//! One streamed chat reply as its bytes arrive, however reads cut them: answer and reasoning pieces, finish, error. +const std = @import("std"); +const json = @import("json"); +const sse = @import("benchmark_sse.zig"); +const Allocator = std.mem.Allocator; + +pub const Kind = enum { content, reasoning }; + +/// Where each piece goes as it arrives; a failed write stops the reply. +pub const Sink = struct { ctx: *anyopaque, piece: *const fn (*anyopaque, Kind, []const u8) error{WriteFailed}!void }; + +pub const Failure = error{ InvalidStream, WriteFailed, OutOfMemory }; + +/// The bytes one line of a server's error keeps on a terminal. +const error_limit = 2000; + +pub const Reply = struct { + a: Allocator, + sink: Sink, + pending: std.ArrayList(u8) = .empty, + frames: sse.Frames = .{}, + /// The answer so far: what a kept turn holds. + content: std.ArrayList(u8) = .empty, + /// Reasoning arrived, shown or not. + reasoned: bool = false, + finish: ?[]const u8 = null, + /// An error event's message, cleaned for a terminal. + failure: ?[]const u8 = null, + done: bool = false, + + /// Bytes as they were read: whole lines are handled now, a cut line waits for the rest. + pub fn feed(r: *Reply, bytes: []const u8) Failure!void { + var rest = bytes; + while (!r.done) { + const nl = std.mem.indexOfScalar(u8, rest, '\n') orelse { + if (r.pending.items.len + rest.len > sse.max_event + 2) return error.InvalidStream; + try r.pending.appendSlice(r.a, rest); + return; + }; + const whole = rest[0 .. nl + 1]; + rest = rest[nl + 1 ..]; + if (r.pending.items.len == 0) { + try r.line(whole); + continue; + } + try r.pending.appendSlice(r.a, whole); + defer r.pending.clearRetainingCapacity(); + try r.line(r.pending.items); + } + } + + /// The reply ended as a reply should: ``[DONE]``, or a finish reason before the stream closed. + pub fn complete(r: *const Reply) bool { + return r.failure == null and (r.done or r.finish != null); + } + + fn line(r: *Reply, with_newline: []const u8) Failure!void { + const data = try r.frames.line(r.a, with_newline) orelse return; + try r.event(data); + } + + fn event(r: *Reply, data: []const u8) Failure!void { + if (std.mem.eql(u8, std.mem.trim(u8, data, " \t\r\n"), "[DONE]")) { + r.done = true; + return; + } + const chunk = switch (try json.parseText(r.a, data)) { + .ok => |v| v, + .err => return error.InvalidStream, + }; + if (chunk != .object) return error.InvalidStream; + if (chunk.field("error")) |e| { + r.failure = try errorText(r.a, e); + return; + } + const choices = chunk.get("choices") orelse return; // a usage event carries none + if (choices != .array or choices.array.len == 0) return; + const choice = choices.array[0]; + if (choice.get("delta")) |delta| { + const thought = delta.strField("reasoning_content") orelse delta.strField("reasoning"); + if (thought) |t| if (t.len > 0) { + r.reasoned = true; + try r.sink.piece(r.sink.ctx, .reasoning, t); + }; + if (delta.strField("content")) |c| if (c.len > 0) { + try r.content.appendSlice(r.a, c); + try r.sink.piece(r.sink.ctx, .content, c); + }; + } + if (choice.field("finish_reason")) |f| if (f == .string) { + r.finish = f.string; + }; + } +}; + +/// An error event's ``message`` (or the error itself when it is text), without terminal control sequences. +fn errorText(a: Allocator, e: json.Value) ![]const u8 { + const text = e.strField("message") orelse e.str() orelse "the server reported an error without a message"; + return sse.clean(a, text, error_limit); +} + +const Seen = struct { + a: Allocator, + text: std.ArrayList(u8) = .empty, + + fn piece(ctx: *anyopaque, kind: Kind, text: []const u8) error{WriteFailed}!void { + const s: *Seen = @ptrCast(@alignCast(ctx)); + s.text.appendSlice(s.a, if (kind == .reasoning) "" else "") catch return error.WriteFailed; + s.text.appendSlice(s.a, text) catch return error.WriteFailed; + } + + fn sink(s: *Seen) Sink { + return .{ .ctx = s, .piece = piece }; + } +}; + +const content_event = "data: {\"id\": \"x\", \"choices\": [{\"index\": 0, \"delta\": {\"content\": \"Hel\"}, \"finish_reason\": null}]}\n\n"; +const stream_bytes = ": keepalive\n\n" ++ + "data: {\"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"reasoning_content\": \"The user greets.\"}}]}\n\n" ++ + content_event ++ + "data: {\"choices\": [{\"index\": 0, \"delta\": {\"content\": \"lo \\u00e9\\n\"}}]}\r\n\r\n" ++ + "data: {\"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"stop\"}], \"tensorfold\": {\"tokens_per_second\": 1.0}}\n\n" ++ + "data: {\"choices\": [], \"usage\": {\"prompt_tokens\": 3, \"completion_tokens\": 4}}\n\n" ++ + "data: [DONE]\n\n" ++ + "data: {\"choices\": [{\"index\": 0, \"delta\": {\"content\": \"after the end\"}}]}\n\n"; + +/// ``stream_bytes`` fed in reads of ``step`` bytes after a first read of ``cut``, checked as one whole read. +fn playCut(cut: usize, step: usize) !void { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var seen: Seen = .{ .a = a }; + var r: Reply = .{ .a = a, .sink = seen.sink() }; + try r.feed(stream_bytes[0..cut]); + var at = cut; + while (at < stream_bytes.len) : (at = @min(at + step, stream_bytes.len)) try r.feed(stream_bytes[at..@min(at + step, stream_bytes.len)]); + try std.testing.expectEqualStrings("The user greets.Hello \xc3\xa9\n", seen.text.items); + try std.testing.expectEqualStrings("Hello \xc3\xa9\n", r.content.items); + try std.testing.expectEqualStrings("stop", r.finish.?); + try std.testing.expect(r.done and r.complete() and r.failure == null and r.reasoned); +} + +test "chat CLI: a stream's reasoning and answer pieces, finish and [DONE], with reads cut at every byte" { + for (0..stream_bytes.len + 1) |cut| try playCut(cut, stream_bytes.len); + try playCut(0, 1); + try playCut(3, 7); +} + +test "chat CLI: an error event's message is kept, cleaned for a terminal, and the reply is not complete" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var seen: Seen = .{ .a = a }; + var r: Reply = .{ .a = a, .sink = seen.sink() }; + try r.feed(content_event ++ "data: {\"error\": {\"message\": \"This server's maximum context length is 8 tokens\\u001b[2J\", \"type\": \"invalid_request_error\"}}\n\ndata: [DONE]\n\n"); + try std.testing.expectEqualStrings("This server's maximum context length is 8 tokens", r.failure.?); + try std.testing.expect(r.done and !r.complete()); + var plain: Reply = .{ .a = a, .sink = seen.sink() }; + try plain.feed("data: {\"error\": \"overloaded\"}\n\n"); + try std.testing.expectEqualStrings("overloaded", plain.failure.?); + var bare: Reply = .{ .a = a, .sink = seen.sink() }; + try bare.feed("data: {\"error\": {\"code\": 500}}\n\n"); + try std.testing.expectEqualStrings("the server reported an error without a message", bare.failure.?); +} + +test "chat CLI: a stream that ends early, an event that is not JSON and an endless line are told apart" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var seen: Seen = .{ .a = a }; + var cut: Reply = .{ .a = a, .sink = seen.sink() }; + try cut.feed(content_event); + try std.testing.expect(!cut.complete()); + var finished: Reply = .{ .a = a, .sink = seen.sink() }; + try finished.feed("data: {\"choices\": [{\"index\": 0, \"delta\": {\"reasoning\": \"r\"}, \"finish_reason\": \"length\"}]}\n\n"); + try std.testing.expect(finished.complete() and !finished.done and finished.reasoned and finished.content.items.len == 0); + try std.testing.expectEqualStrings("length", finished.finish.?); + var broken: Reply = .{ .a = a, .sink = seen.sink() }; + try std.testing.expectError(error.InvalidStream, broken.feed("data: {\"choices\": [\n\n")); + var long: Reply = .{ .a = a, .sink = seen.sink() }; + const filler = try a.alloc(u8, sse.max_event); + @memset(filler, 'x'); + try long.feed("data: "); + try std.testing.expectError(error.InvalidStream, long.feed(filler)); +} diff --git a/zig/src/server/chat_cli_test.zig b/zig/src/server/chat_cli_test.zig new file mode 100644 index 00000000000..3e55db2d0d3 --- /dev/null +++ b/zig/src/server/chat_cli_test.zig @@ -0,0 +1,527 @@ +//! The chat command against the benchmark's fake server: piped, a conversation, errors, Ctrl-C and its own server. +const std = @import("std"); +const platform = @import("sys"); +const json = @import("json"); +const chat = @import("chat_cli.zig"); +const history = @import("chat_cli_history.zig"); +const stop = @import("benchmark_stop.zig"); +const fake = @import("benchmark_fake.zig"); +const stream = @import("benchmark_stream.zig"); +const Allocator = std.mem.Allocator; + +const Run = struct { + a: Allocator, + env: std.process.Environ.Map, + dir: []const u8, + out: std.Io.Writer.Allocating, + err: std.Io.Writer.Allocating, + stdin: std.Io.Reader = .fixed(""), + /// What each command reads from a fixed stdin, unless ``reader`` names another. + input: []const u8 = "", + reader: ?*std.Io.Reader = null, + interactive: bool = false, + self_exe: ?[]const u8 = null, + + fn init(a: Allocator, tmp: *std.testing.TmpDir) !Run { + var r: Run = .{ .a = a, .env = .init(a), .dir = try fake.tmpPath(a, tmp), .out = .init(a), .err = .init(a) }; + try r.env.put("PATH", "/usr/bin:/bin"); + for ([_][]const u8{ "TMPDIR", "HOME" }) |name| try r.env.put(name, r.dir); + return r; + } + + fn command(r: *Run, argv: []const []const u8) !u8 { + r.out.clearRetainingCapacity(); + r.err.clearRetainingCapacity(); + r.stdin = .fixed(r.input); + const ctx: chat.Context = .{ + .a = r.a, + .io = std.testing.io, + .environ = &r.env, + .out = &r.out.writer, + .err = &r.err.writer, + .input = r.reader orelse &r.stdin, + .interactive = r.interactive, + .terminal = false, + .self_exe = r.self_exe, + }; + return chat.command(&ctx, argv); + } + + fn path(r: *const Run, name: []const u8) ![]const u8 { + return std.fs.path.join(r.a, &.{ r.dir, name }); + } +}; + +const models_doc = "{\"object\": \"list\", \"data\": [{\"id\": \"example-model\", \"capabilities\": {\"thinking_switch\": true}}, {\"id\": \"other-model\"}]}"; + +fn chunk(a: Allocator, delta: []const u8) ![]const u8 { + return fake.event(a, try std.fmt.allocPrint(a, "{{\"choices\": [{{\"index\": 0, \"delta\": {s}, \"finish_reason\": null}}]}}", .{delta})); +} + +/// Reasoning, then "Hello there!" in two events, the second cut across two writes, a finish and [DONE]. +fn streamed(a: Allocator) ![]const fake.Write { + const second = try chunk(a, "{\"content\": \"there!\"}"); + const w = try a.alloc(fake.Write, 3); + const head = try fake.headOf(a, "200 OK", "text/event-stream"); + w[0] = .{ .bytes = try std.mem.concat(a, u8, &.{ head, try chunk(a, "{\"role\": \"assistant\", \"reasoning_content\": \"The user greets me.\"}"), try chunk(a, "{\"content\": \"Hello \"}"), second[0 .. second.len / 2] }), .pause_ms = 30 }; + w[1] = .{ .bytes = second[second.len / 2 ..] }; + w[2] = .{ .bytes = try std.mem.concat(a, u8, &.{ try fake.event(a, "{\"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"stop\"}]}"), try fake.event(a, "[DONE]") }) }; + return w; +} + +/// A server that lists ``models`` and answers the n-th chat request with ``replies[n]`` (the last one after). +fn world(a: Allocator, models: []const u8, replies: []const []const fake.Write) !*fake.Fake { + return worldKeyed(a, models, replies, null); +} + +/// ``world`` as a keyed server, wanting the key ``key_file`` holds on every route but GET /health. +fn worldKeyed(a: Allocator, models: []const u8, replies: []const []const fake.Write, key_file: ?[]const u8) !*fake.Fake { + return fake.Fake.startKeyed(std.testing.allocator, try a.dupe(fake.Route, &.{ + .{ .method = "GET", .path = "/health", .replies = try a.dupe([]const fake.Write, &.{try fake.jsonReply(a, "200 OK", "{\"status\": \"ok\", \"warming\": false}")}) }, + .{ .method = "GET", .path = "/v1/models", .replies = try a.dupe([]const fake.Write, &.{try fake.jsonReply(a, "200 OK", models)}) }, + .{ .method = "POST", .path = "/v1/chat/completions", .replies = replies }, + }), key_file); +} + +fn posts(f: *fake.Fake) usize { + var n: usize = 0; + for (0..f.count()) |i| n += @intFromBool(std.mem.eql(u8, f.request(i).method, "POST")); + return n; +} + +/// The i-th chat request's messages, written back as JSON. +fn sent(a: Allocator, f: *fake.Fake, i: usize) ![]const u8 { + var seen: usize = 0; + for (0..f.count()) |k| if (std.mem.eql(u8, f.request(k).method, "POST")) { + if (seen == i) return json.stringify(a, (try json.parse(a, f.request(k).body)).ok.get("messages").?, .{}); + seen += 1; + }; + return error.TestUnexpectedResult; +} + +/// Polls ``ready`` every 5 ms for up to 5 s, so a broken path fails its test instead of hanging it. +fn waitFor(comptime ready: anytype, arg: anytype) bool { + var waited: u32 = 0; + while (waited < 5000) : (waited += 5) { + if (ready(arg)) return true; + fake.nap(5); + } + return false; +} + +fn hasPost(f: *fake.Fake) bool { + return posts(f) > 0; +} + +fn handled(_: void) bool { + return stop.requested() == null; +} + +test "chat CLI: a piped message to --url asks for the server's first model and prints only its answer" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{try streamed(a)})); + defer f.stop(); + r.input = " Say hello.\n"; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, "/v1") })); + try std.testing.expectEqualStrings("Hello there!\n", r.out.written()); + try std.testing.expectEqualStrings("", r.err.written()); + try std.testing.expectEqual(@as(usize, 2), f.count()); + try std.testing.expectEqualStrings("/v1/models", f.request(0).path); + try std.testing.expectEqualStrings("{\"model\": \"example-model\", \"messages\": [{\"role\": \"user\", \"content\": \"Say hello.\"}], \"stream\": true}", f.request(1).body); + try std.testing.expectEqualStrings("TensorFold-chat/1", f.header(1, "user-agent").?); + try std.testing.expect(f.header(0, "authorization") == null and f.header(1, "authorization") == null); + try std.testing.expectEqualStrings("text/event-stream", f.header(1, "accept").?); + r.input = "Say hello."; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, ""), "other-model", "--show-thinking", "--system", "Be brief.", "--temperature", "0", "--max-tokens", "32" })); + try std.testing.expectEqualStrings("The user greets me.\n\nHello there!\n", r.out.written()); + try std.testing.expectEqualStrings("{\"model\": \"other-model\", \"messages\": [{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"Say hello.\"}], " ++ + "\"stream\": true, \"max_tokens\": 32, \"temperature\": 0.0}", f.request(3).body); +} + +test "chat CLI: a reply of hidden reasoning alone, or one cut at its token limit, says so on stderr" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const head = try fake.headOf(a, "200 OK", "text/event-stream"); + const cut = try fake.event(a, "{\"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"length\"}]}"); + const thought = try a.dupe(fake.Write, &.{.{ .bytes = try std.mem.concat(a, u8, &.{ head, try chunk(a, "{\"reasoning_content\": \"Let me think\"}"), cut, try fake.event(a, "[DONE]") }) }}); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{thought})); + defer f.stop(); + r.input = "hi"; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqualStrings("", r.out.written()); + try std.testing.expectEqualStrings("The reply stopped at its token limit; --max-tokens raises it.\n" ++ + "The reply held only reasoning, which is hidden; --show-thinking shows it.\n", r.err.written()); + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, ""), "--show-thinking" })); + try std.testing.expectEqualStrings("Let me think\n", r.out.written()); + try std.testing.expectEqualStrings("The reply stopped at its token limit; --max-tokens raises it.\n", r.err.written()); +} + +test "chat CLI: --url sends TENSORFOLD_API_KEY's first key as the bearer, and a 401 names the variable" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const key_file = try r.path("server-key"); + try std.Io.Dir.cwd().writeFile(std.testing.io, .{ .sub_path = key_file, .data = "example-key-1\n" }); + const f = try worldKeyed(a, models_doc, try a.dupe([]const fake.Write, &.{try streamed(a)}), key_file); + defer f.stop(); + const url = try f.url(a, ""); + r.input = "hi"; + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", url })); + try std.testing.expectEqualStrings(try std.fmt.allocPrint(a, "tensorfold chat: no model to chat with: {s}/v1/models answered HTTP 401; " ++ + "set TENSORFOLD_API_KEY to a key the server accepts\n", .{url}), r.err.written()); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", url, "example-model" })); + try std.testing.expectEqualStrings("tensorfold chat: HTTP 401: A valid API key is required; set TENSORFOLD_API_KEY to a key the server accepts\n", r.err.written()); + try r.env.put("TENSORFOLD_API_KEY", "wrong-key"); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", url, "example-model" })); + try std.testing.expectEqualStrings("tensorfold chat: HTTP 401: A valid API key is required; the server refused the key in TENSORFOLD_API_KEY\n", r.err.written()); + try std.testing.expectEqual(@as(usize, 5), f.refusals()); + try std.testing.expectEqual(@as(usize, 0), f.count()); + try r.env.put("TENSORFOLD_API_KEY", " ,example-key-1, example-key-2"); + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", url })); + try std.testing.expectEqualStrings("Hello there!\n", r.out.written()); + try std.testing.expect(f.refusals() == 5 and f.count() == 2); + for (0..f.count()) |i| try std.testing.expectEqualStrings("Bearer example-key-1", f.header(i, "authorization").?); + try r.env.put("TENSORFOLD_API_KEY", "two words"); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", url })); + try std.testing.expectEqualStrings("tensorfold chat: TENSORFOLD_API_KEY: expected keys without spaces or control characters, at most 256 bytes each\n", r.err.written()); + try std.testing.expect(f.refusals() == 5 and f.count() == 2); +} + +test "chat CLI: --no-thinking sends the documented switch, and is refused before any turn when the model has none" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{try streamed(a)})); + defer f.stop(); + r.input = "hi\n"; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, ""), "--no-thinking" })); + const body = (try json.parse(a, f.request(1).body)).ok; + try std.testing.expect(body.get("chat_template_kwargs").?.get("enable_thinking").?.bool == false); + const g = try world(a, "{\"data\": [{\"id\": \"example-model\", \"capabilities\": {\"thinking_switch\": false}}]}", try a.dupe([]const fake.Write, &.{try streamed(a)})); + defer g.stop(); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", try g.url(a, ""), "--no-thinking" })); + try std.testing.expectEqualStrings("tensorfold chat: --no-thinking: this model's chat template cannot turn thinking off (its /v1/models thinking_switch is false)\n", r.err.written()); + try std.testing.expectEqual(@as(usize, 0), posts(g)); +} + +test "chat CLI: a refusal, an error event, an unreachable server and an empty message are printed plainly and exit 1" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const refusal = try fake.jsonReply(a, "400 Bad Request", "{\"error\": {\"message\": \"This server's maximum context length is 8 tokens\", \"type\": \"invalid_request_error\"}}"); + const failing = try a.dupe(fake.Write, &.{.{ .bytes = try std.mem.concat(a, u8, &.{ try fake.headOf(a, "200 OK", "text/event-stream"), try chunk(a, "{\"content\": \"Par\"}"), try fake.event(a, "{\"error\": {\"message\": \"generation failed\", \"type\": \"server_error\"}}"), try fake.event(a, "[DONE]") }) }}); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{ refusal, failing })); + defer f.stop(); + r.input = "hi"; + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqualStrings("tensorfold chat: HTTP 400: This server's maximum context length is 8 tokens\n", r.err.written()); + try std.testing.expectEqualStrings("", r.out.written()); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqualStrings("Par\n", r.out.written()); + try std.testing.expectEqualStrings("tensorfold chat: generation failed\n", r.err.written()); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", "http://127.0.0.1:1", "example-model" })); + try std.testing.expectEqualStrings("tensorfold chat: could not reach the server at http://127.0.0.1:1/v1/chat/completions\n", r.err.written()); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", "http://127.0.0.1:1" })); + try std.testing.expectEqualStrings("tensorfold chat: no model to chat with: http://127.0.0.1:1/v1/models could not connect; name one after the URL\n", r.err.written()); + const before = f.count(); + r.input = " \n\t\n"; + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqualStrings("tensorfold chat: stdin held no message to send\n", r.err.written()); + try std.testing.expectEqual(before, f.count()); + try std.testing.expectEqual(@as(u8, 2), try r.command(&.{ "--url", "http://127.0.0.1:1", "--", "--parallel", "1" })); + try std.testing.expect(std.mem.endsWith(u8, r.err.written(), "tensorfold chat: error: flags after -- go to the server tensorfold chat starts; --url names one already running\n")); +} + +test "chat CLI: a conversation keeps its turns, /system and /clear shape the next request, and a failed turn is not kept" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const ok = try streamed(a); + const refusal = try fake.jsonReply(a, "503 Service Unavailable", "{\"error\": {\"message\": \"draining\"}}"); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{ ok, ok, refusal, ok })); + defer f.stop(); + r.interactive = true; + r.input = "first\n/system Be brief.\nsecond\n/clear\nlost\n/nope\n/help\n\n /etc holds what?\n"; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqual(@as(usize, 4), posts(f)); + try std.testing.expectEqualStrings("[{\"role\": \"user\", \"content\": \"first\"}]", try sent(a, f, 0)); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"first\"}, " ++ + "{\"role\": \"assistant\", \"content\": \"Hello there!\"}, {\"role\": \"user\", \"content\": \"second\"}]", try sent(a, f, 1)); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"lost\"}]", try sent(a, f, 2)); + try std.testing.expectEqualStrings("[{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"/etc holds what?\"}]", try sent(a, f, 3)); + const out = r.out.written(); + try std.testing.expect(std.mem.startsWith(u8, out, "Chatting with example-model. /help lists the commands; /bye or Ctrl-D ends the chat.\n> Hello there!\n> System prompt set.\n> ")); + for ([_][]const u8{ "Conversation cleared.\n", "Unknown command /nope; /help lists the commands.\n", history.help_text }) |want| + try std.testing.expect(std.mem.indexOf(u8, out, want) != null); + try std.testing.expect(std.mem.endsWith(u8, out, "> Hello there!\n> \n")); + try std.testing.expectEqualStrings("tensorfold chat: HTTP 503: draining\n", r.err.written()); + r.input = "/bye\nnever sent\n"; + try std.testing.expectEqual(@as(u8, 0), try r.command(&.{ "--url", try f.url(a, "") })); + try std.testing.expectEqual(@as(usize, 4), posts(f)); +} + +/// A conversation read from a pipe that a test thread writes into, as a terminal's lines arrive. +const Pipe = struct { + fds: [2]std.posix.fd_t = .{ -1, -1 }, + buf: [256]u8 = undefined, + file: std.Io.File.Reader = undefined, + + fn open(p: *Pipe) bool { + if (platform.c.pipe(&p.fds) != 0) return false; + p.file = (std.Io.File{ .handle = p.fds[0], .flags = .{ .nonblocking = false } }).readerStreaming(std.testing.io, &p.buf); + return true; + } + + fn close(p: *Pipe) void { + for (p.fds) |fd| _ = platform.c.close(fd); + } + + fn send(p: *const Pipe, text: []const u8) void { + _ = platform.c.write(p.fds[1], text.ptr, text.len); + } +}; + +test "chat CLI: Ctrl-C during a reply stops it at once, keeps what it printed, and the conversation goes on" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + stop.reset(); + defer stop.reset(); + var gate: std.Io.Event = .unset; + const trickle = try a.dupe(fake.Write, &.{ .{ .bytes = try std.mem.concat(a, u8, &.{ try fake.headOf(a, "200 OK", "text/event-stream"), try chunk(a, "{\"content\": \"Once upon\"}") }), .after = &gate }, .{ .bytes = try chunk(a, "{\"content\": \" a time\"}") } }); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{ trickle, try streamed(a) })); + defer { + gate.set(io); + f.stop(); + } + var pipe: Pipe = .{}; + if (!pipe.open()) return error.SkipZigTest; + defer pipe.close(); + r.interactive = true; + r.reader = &pipe.file.interface; + const Typist = struct { + fn run(p: *const Pipe, fk: *fake.Fake, g: *std.Io.Event) void { + p.send("Tell me a long story.\n"); + if (waitFor(hasPost, fk)) fake.nap(300); + stop.request(.INT); + if (!waitFor(handled, {})) g.set(std.testing.io); // a reply that never stopped finishes, and the test fails + p.send("Shorter, please.\n/bye\n"); + } + }; + const started = std.Io.Clock.awake.now(io).toMilliseconds(); + const code = blk: { + const t = try std.Thread.spawn(.{}, Typist.run, .{ &pipe, f, &gate }); + defer t.join(); + break :blk try r.command(&.{ "--url", try f.url(a, "") }); + }; + try std.testing.expectEqual(@as(u8, 0), code); + try std.testing.expect(!gate.isSet() and std.Io.Clock.awake.now(io).toMilliseconds() - started < 5000); + try std.testing.expectEqualStrings("[{\"role\": \"user\", \"content\": \"Tell me a long story.\"}, {\"role\": \"assistant\", \"content\": \"Once upon\"}, " ++ + "{\"role\": \"user\", \"content\": \"Shorter, please.\"}]", try sent(a, f, 1)); + try std.testing.expect(std.mem.indexOf(u8, r.out.written(), "> Once upon\n> Hello there!\n> ") != null); +} + +test "chat CLI: Ctrl-C at the prompt says how to end the chat and reads on" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + stop.reset(); + defer stop.reset(); + const f = try world(a, models_doc, try a.dupe([]const fake.Write, &.{try streamed(a)})); + defer f.stop(); + var pipe: Pipe = .{}; + if (!pipe.open()) return error.SkipZigTest; + defer pipe.close(); + r.interactive = true; + r.reader = &pipe.file.interface; + const Typist = struct { + fn listed(fk: *fake.Fake) bool { + return fk.count() > 0; + } + fn run(p: *const Pipe, fk: *fake.Fake) void { + if (waitFor(listed, fk)) fake.nap(300); + stop.request(.INT); + _ = waitFor(handled, {}); + p.send("/bye\n"); + } + }; + const code = blk: { + const t = try std.Thread.spawn(.{}, Typist.run, .{ &pipe, f }); + defer t.join(); + break :blk try r.command(&.{ "--url", try f.url(a, "") }); + }; + try std.testing.expectEqual(@as(u8, 0), code); + try std.testing.expect(std.mem.endsWith(u8, r.out.written(), "> \n(Type /bye or press Ctrl-D to end the chat.)\n> ")); + try std.testing.expectEqual(@as(usize, 0), posts(f)); +} + +/// A serve stand-in that records its pid and arguments, says ``serving`` on ``port`` if given, then runs ``then``. +fn standIn(r: *Run, port: ?u16, then: []const u8) !void { + const script = try r.path("serve-stand-in"); + const serving = if (port) |p| try std.fmt.allocPrint(r.a, "printf '[tensorfold] serving example-checkpoint at http://127.0.0.1:%s/v1 (x)\\n' {d}\n", .{p}) else ""; + const key = try std.fmt.allocPrint(r.a, "printf '%s' \"$TENSORFOLD_API_KEY\" > {s}\n", .{try r.path("key")}); + const text = try std.fmt.allocPrint(r.a, "#!/bin/sh\necho $$ > {s}\nprintf '%s\\n' \"$@\" > {s}\n{s}printf 'loading\\n'\n{s}{s}\n", .{ try r.path("pid"), try r.path("args"), key, serving, then }); + try std.Io.Dir.cwd().writeFile(std.testing.io, .{ .sub_path = script, .data = text, .flags = .{ .permissions = .fromMode(0o755) } }); + try std.Io.Dir.cwd().createDirPath(std.testing.io, try r.path("example-checkpoint")); + r.self_exe = script; +} + +fn childPid(r: *Run) ?std.posix.pid_t { + const text = std.Io.Dir.cwd().readFileAlloc(std.testing.io, r.path("pid") catch return null, r.a, .limited(64)) catch return null; + return std.fmt.parseInt(std.posix.pid_t, std.mem.trim(u8, text, " \n"), 10) catch null; +} + +fn gone(pid: std.posix.pid_t) bool { + std.posix.kill(pid, @fromBackingInt(0)) catch |e| return e == error.ProcessNotFound; + return false; +} + +extern "c" fn getpgid(pid: std.posix.pid_t) std.posix.pid_t; + +const sh_models = "{\"data\": [{\"id\": \"example-checkpoint\"}]}"; + +test "chat CLI: MODEL starts its own serve child in a process group of its own, keyed, chats through it and stops it" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + try r.env.put("TENSORFOLD_API_KEY", "example-user-key"); + var gate: std.Io.Event = .unset; + const held = try a.dupe(fake.Write, try streamed(a)); + held[0].after = &gate; + const f = try worldKeyed(a, sh_models, try a.dupe([]const fake.Write, &.{held}), try r.path("key")); + defer { + gate.set(io); + f.stop(); + } + try standIn(&r, f.port, "exec sleep 30"); + r.input = "hi\n"; + const Checker = struct { + group: std.posix.pid_t = -1, + pid: std.posix.pid_t = -1, + fn run(c: *@This(), fk: *fake.Fake, run_: *Run, g: *std.Io.Event) void { + if (waitFor(hasPost, fk)) if (childPid(run_)) |pid| { + c.pid = pid; + c.group = getpgid(pid); + }; + g.set(std.testing.io); + } + }; + var checker: Checker = .{}; + const code = blk: { + const t = try std.Thread.spawn(.{}, Checker.run, .{ &checker, f, &r, &gate }); + defer t.join(); + break :blk try r.command(&.{ try r.path("example-checkpoint"), "--startup-timeout", "20", "--", "--parallel", "1" }); + }; + try std.testing.expectEqual(@as(u8, 0), code); + try std.testing.expectEqualStrings("Hello there!\n", r.out.written()); + try std.testing.expectEqualStrings(try std.fmt.allocPrint(a, "Loading {s}; Ctrl-C cancels.\n", .{try r.path("example-checkpoint")}), r.err.written()); + try std.testing.expect(checker.pid > 0 and checker.group == checker.pid and gone(checker.pid)); + const args = try std.Io.Dir.cwd().readFileAlloc(io, try r.path("args"), a, .limited(4096)); + const want = try std.fmt.allocPrint(a, "serve\n{s}\n--host\n127.0.0.1\n--port\n0\n--name\nexample-checkpoint\n--parallel\n1\n", .{try r.path("example-checkpoint")}); + try std.testing.expectEqualStrings(want, args); + // the child's key came in its environment alone, fresh, never the user's, and the chat printed it nowhere + const key = try std.Io.Dir.cwd().readFileAlloc(io, try r.path("key"), a, .limited(256)); + try std.testing.expect(key.len == 64 and !std.mem.eql(u8, key, "example-user-key")); + for ([_][]const u8{ r.out.written(), r.err.written(), args }) |text| try std.testing.expect(std.mem.indexOf(u8, text, key) == null); + const bearer = try std.mem.concat(a, u8, &.{ "Bearer ", key }); + try std.testing.expect(f.refusals() == 0 and f.count() >= 4); + for (0..f.count()) |i| try std.testing.expectEqualStrings(bearer, f.header(i, "authorization").?); + var client: std.http.Client = .{ .allocator = std.heap.smp_allocator, .io = io }; + defer client.deinit(); + const anonymous = stream.fetch(a, io, &client, .{ .url = try f.url(a, "/v1/models"), .limit = 4096, .timeout_s = 5 }); + try std.testing.expect(anonymous.failed == .none and anonymous.status == 401 and f.refusals() == 1); +} + +test "chat CLI: its own server's startup failure shows the server's last line; refused flags and an uncached model start nothing" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const f = try world(a, sh_models, try a.dupe([]const fake.Write, &.{try streamed(a)})); + defer f.stop(); + try standIn(&r, null, "printf '\\033[31merror: cannot read tokenizer.json\\033[0m\\n'; exit 3"); + r.input = "hi\n"; + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ try r.path("example-checkpoint"), "--startup-timeout", "20" })); + try std.testing.expect(std.mem.endsWith(u8, r.err.written(), "tensorfold chat: Model server exited during startup; check the checkpoint and backend toolchain\n" ++ + "Last server log line: error: cannot read tokenizer.json\n")); + try std.testing.expectEqual(@as(usize, 0), posts(f)); + try std.Io.Dir.cwd().deleteFile(std.testing.io, try r.path("pid")); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{ try r.path("example-checkpoint"), "--", "--port", "8080" })); + try std.testing.expectEqualStrings("tensorfold chat: --host and --port: tensorfold chat gives the server it starts a free port on 127.0.0.1\n", r.err.written()); + try std.testing.expectEqual(@as(u8, 1), try r.command(&.{"example-org/not-cached"})); + try std.testing.expect(std.mem.indexOf(u8, r.err.written(), "run tensorfold pull example-org/not-cached first") != null); + try std.testing.expect(childPid(&r) == null); +} + +test "chat CLI: when its own server exits mid-conversation the chat ends with the server's last lines" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var r = try Run.init(a, &tmp); + const closes = try a.dupe(fake.Write, &.{}); + const f = try world(a, sh_models, try a.dupe([]const fake.Write, &.{closes})); + defer f.stop(); + try standIn(&r, f.port, "printf 'error: the GPU was lost\\n'; exec sleep 30"); + var pipe: Pipe = .{}; + if (!pipe.open()) return error.SkipZigTest; + defer pipe.close(); + r.interactive = true; + r.reader = &pipe.file.interface; + const Typist = struct { + fn listed(fk: *fake.Fake) bool { + var n: usize = 0; + for (0..fk.count()) |i| n += @intFromBool(std.mem.eql(u8, fk.request(i).path, "/v1/models")); + return n >= 2; // the readiness probe's, then the chat's own look + } + fn run(p: *const Pipe, fk: *fake.Fake, run_: *Run) void { + if (waitFor(listed, fk)) if (childPid(run_)) |pid| { + _ = platform.c.kill(pid, .KILL); + fake.nap(200); + }; + p.send("hello\n/bye\n"); + } + }; + const code = blk: { + const t = try std.Thread.spawn(.{}, Typist.run, .{ &pipe, f, &r }); + defer t.join(); + break :blk try r.command(&.{ try r.path("example-checkpoint"), "--startup-timeout", "20" }); + }; + try std.testing.expectEqual(@as(u8, 1), code); + try std.testing.expect(std.mem.endsWith(u8, r.err.written(), "/v1/chat/completions\nThe model server has exited.\nLast server log line: error: the GPU was lost\n")); +} diff --git a/zig/src/server/chat_cli_turn.zig b/zig/src/server/chat_cli_turn.zig new file mode 100644 index 00000000000..e39f533b04c --- /dev/null +++ b/zig/src/server/chat_cli_turn.zig @@ -0,0 +1,276 @@ +//! One chat turn over HTTP: the request body, the streamed reply printed as it arrives, and how the turn ended. +const std = @import("std"); +const json = @import("json"); +const stream = @import("benchmark_stream.zig"); +const sse = @import("benchmark_sse.zig"); +const reply = @import("chat_cli_reply.zig"); +const History = @import("chat_cli_history.zig").History; +const Allocator = std.mem.Allocator; + +pub const user_agent = "TensorFold-chat/1"; +/// One read's room; the reply checks its own line limit as lines arrive. +const read_buffer = 64 << 10; + +/// What every request of a chat sends besides its messages. +pub const Settings = struct { model: []const u8, temperature: ?f64 = null, max_tokens: ?i64 = null, no_thinking: bool = false }; + +/// How a reply is shown: reasoning dimmed or hidden, and on a terminal its styles and only printable text. +pub const Show = struct { thinking: bool = false, terminal: bool = false }; + +/// A finished reply: its answer, whether it stopped at its token limit, and whether reasoning came. +pub const Finished = struct { content: []const u8, cut: bool, reasoned: bool }; + +/// Refused, failed or never sent: why, whether the server could not be reached, and a refusal's HTTP status. +pub const Failure = struct { reason: []const u8, connect: bool = false, status: u16 = 0 }; + +pub const Ended = union(enum) { + finished: Finished, + /// A stop signal ended it; the answer printed so far. + stopped: []const u8, + failed: Failure, +}; + +/// The streamed request: the model, the messages, then the settings the chat was given. +pub fn body(a: Allocator, s: Settings, history: *const History, user: []const u8) ![]u8 { + const o = try json.newObject(a); + try o.put(a, "model", .{ .string = s.model }); + try o.put(a, "messages", .{ .array = try history.messages(a, user) }); + try o.put(a, "stream", .{ .bool = true }); + if (s.max_tokens) |n| try o.put(a, "max_tokens", try json.intValue(a, n)); + if (s.temperature) |t| try o.put(a, "temperature", .{ .float = t }); + if (s.no_thinking) { + const kw = try json.newObject(a); + try kw.put(a, "enable_thinking", .{ .bool = false }); + try o.put(a, "chat_template_kwargs", .{ .object = kw }); + } + return json.stringify(a, .{ .object = o }, .{}); +} + +/// One streamed turn to ``url``, the chat route, printed to ``out`` as it arrives; a stop signal ends it ``stopped``. +pub fn run(a: Allocator, io: std.Io, url: []const u8, key: ?[]const u8, request: []u8, out: *std.Io.Writer, show: Show) !Ended { + var client: std.http.Client = .{ .allocator = std.heap.smp_allocator, .io = io }; + client.connection_pool.free_size = 0; + defer client.deinit(); + var printer: Printer = .{ .io = io, .out = out, .show = show }; + var r: reply.Reply = .{ .a = a, .sink = printer.sink() }; + const bearer = if (key) |k| try std.fmt.allocPrint(a, "Bearer {s}", .{k}) else null; + var x: Exchange = .{ .a = a, .io = io, .client = &client, .uri = try std.Uri.parse(url), .bearer = bearer, .body = request, .reply = &r }; + const ended = stream.bounded(io, null, Exchange.run, &x); + printer.end(); + switch (ended) { + .stopped, .deadline => return .{ .stopped = r.content.items }, + .unavailable => return .{ .failed = .{ .reason = "could not start the request" } }, + .finished => {}, + } + if (x.failure) |f| return .{ .failed = .{ .reason = try x.reason(f, url), .connect = f == .connect, .status = x.status } }; + if (r.failure) |why| return .{ .failed = .{ .reason = why } }; + if (!r.complete()) return .{ .failed = .{ .reason = "the server closed the stream before the reply finished" } }; + return .{ .finished = .{ .content = r.content.items, .cut = std.mem.eql(u8, r.finish orelse "", "length"), .reasoned = r.reasoned } }; +} + +const Failed = enum { connect, lost, http, not_events, stream, output }; + +/// The request as its own task, so a stop signal ends the wait and closes the stream. +const Exchange = struct { + a: Allocator, + io: std.Io, + client: *std.http.Client, + uri: std.Uri, + /// ``Bearer KEY``, when the server wants a key. + bearer: ?[]const u8, + body: []u8, + reply: *reply.Reply, + status: u16 = 0, + refused: []const u8 = "", + content_type: []const u8 = "", + failure: ?Failed = null, + done: std.atomic.Value(bool) = .init(false), + + fn run(x: *Exchange) void { + const auth: std.http.Client.Request.Headers.Value = if (x.bearer) |b| .{ .override = b } else .omit; + var req = x.client.request(.POST, x.uri, .{ + .keep_alive = false, + .redirect_behavior = .unhandled, + .headers = .{ .authorization = auth, .content_type = .{ .override = "application/json" }, .accept_encoding = .{ .override = "identity" }, .user_agent = .{ .override = user_agent } }, + .extra_headers = &.{.{ .name = "accept", .value = "text/event-stream" }}, + }) catch { + x.failure = .connect; + return; + }; + defer req.deinit(); + req.sendBodyComplete(x.body) catch { + x.failure = .connect; + return; + }; + var resp = req.receiveHead(&.{}) catch { + x.failure = .connect; + return; + }; + if (resp.head.status.class() != .success) { + x.failure = .http; + x.status = @backingInt(resp.head.status); + x.refused = stream.errorBody(x.a, x.io, &resp); + return; + } + if (!stream.eventStream(resp.head.content_type)) { + x.failure = .not_events; + x.content_type = x.a.dupe(u8, resp.head.content_type orelse "none") catch ""; + return; + } + const transfer = x.a.alloc(u8, read_buffer) catch { + x.failure = .stream; + return; + }; + const r = resp.reader(transfer); + while (!x.reply.done) { + const got = r.peekGreedy(1) catch |e| switch (e) { + error.EndOfStream => return, + error.ReadFailed => { + x.failure = .lost; + return; + }, + }; + x.reply.feed(got) catch |e| { + x.failure = if (e == error.WriteFailed) .output else .stream; + return; + }; + r.toss(got.len); + } + } + + fn reason(x: *const Exchange, f: Failed, url: []const u8) ![]const u8 { + return switch (f) { + .connect => try std.fmt.allocPrint(x.a, "could not reach the server at {s}", .{url}), + .lost => "the connection to the server broke during the reply", + .http => try sse.refusal(x.a, x.status, x.refused), + .not_events => try std.fmt.allocPrint(x.a, "the server answered with {s}, not an event stream", .{try sse.clean(x.a, x.content_type, sse.line_limit)}), + .stream => "the server sent a malformed event stream", + .output => "could not write the reply", + }; + } +}; + +const dim = "\x1b[2m"; +const plain = "\x1b[0m"; +const clear_line = "\r\x1b[K"; + +/// Pieces to ``out`` as they arrive, flushed at once, styled as ``show`` asks. +const Printer = struct { + io: std.Io, + out: *std.Io.Writer, + show: Show, + /// Shown reasoning is open: dimmed on a terminal, and a blank line comes before the answer. + thinking: bool = false, + /// The "thinking..." hint for hidden reasoning is on the line. + hinted: bool = false, + answered: bool = false, + /// The last byte written was not a newline. + open_line: bool = false, + + fn sink(p: *Printer) reply.Sink { + return .{ .ctx = p, .piece = piece }; + } + + fn piece(ctx: *anyopaque, kind: reply.Kind, text: []const u8) error{WriteFailed}!void { + const p: *Printer = @ptrCast(@alignCast(ctx)); + // a stop waits for this write, so a stopped reply never leaves a style or a character half written + const old = p.io.swapCancelProtection(.blocked); + defer _ = p.io.swapCancelProtection(old); + try p.write(kind, text); + try p.out.flush(); + } + + fn write(p: *Printer, kind: reply.Kind, text: []const u8) error{WriteFailed}!void { + if (kind == .reasoning and !p.show.thinking) { + if (!p.show.terminal or p.hinted or p.answered) return; + try p.out.writeAll(dim ++ "thinking..." ++ plain); + p.hinted = true; + return; + } + if (p.hinted) try p.out.writeAll(clear_line); + p.hinted = false; + if (kind == .reasoning and !p.thinking) { + if (p.show.terminal) try p.out.writeAll(dim); + p.thinking = true; + } + if (kind == .content and p.thinking) { + if (p.show.terminal) try p.out.writeAll(plain); + try p.out.writeAll(if (p.open_line) "\n\n" else "\n"); + p.thinking = false; + p.open_line = false; + } + if (kind == .content) p.answered = true; + if (text.len == 0) return; + if (p.show.terminal) try printable(p.out, text) else try p.out.writeAll(text); + p.open_line = text[text.len - 1] != '\n'; + } + + /// After the reply: the hint gone, styles off and the cursor at the start of a line. + fn end(p: *Printer) void { + if (p.hinted) p.out.writeAll(clear_line) catch {}; + if (p.thinking and p.show.terminal) p.out.writeAll(plain) catch {}; + if (p.open_line) p.out.writeAll("\n") catch {}; + p.out.flush() catch {}; + } +}; + +/// ``text`` without control characters besides newline and tab, so a reply cannot move the cursor or restyle. +fn printable(out: *std.Io.Writer, text: []const u8) error{WriteFailed}!void { + var start: usize = 0; + var i: usize = 0; + while (i < text.len) { + const c = text[i]; + const c1 = c == 0xc2 and i + 1 < text.len and text[i + 1] >= 0x80 and text[i + 1] < 0xa0; + const drop: usize = if (c1) 2 else if ((c < 0x20 and c != '\n' and c != '\t') or c == 0x7f) 1 else 0; + if (drop == 0) { + i += 1; + continue; + } + try out.writeAll(text[start..i]); + i += drop; + start = i; + } + try out.writeAll(text[start..]); +} + +test "chat CLI: the request body sends the history, stream and only the settings given" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var h: History = .{ .a = a }; + try h.setSystem("Be brief."); + try h.keep("one", "1"); + try std.testing.expectEqualStrings("{\"model\": \"m\", \"messages\": [{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"one\"}, " ++ + "{\"role\": \"assistant\", \"content\": \"1\"}, {\"role\": \"user\", \"content\": \"two\"}], \"stream\": true}", try body(a, .{ .model = "m" }, &h, "two")); + h.clear(); + try std.testing.expectEqualStrings("{\"model\": \"m\", \"messages\": [{\"role\": \"system\", \"content\": \"Be brief.\"}, {\"role\": \"user\", \"content\": \"q\"}], " ++ + "\"stream\": true, \"max_tokens\": 64, \"temperature\": 0.0, \"chat_template_kwargs\": {\"enable_thinking\": false}}", try body(a, .{ .model = "m", .temperature = 0, .max_tokens = 64, .no_thinking = true }, &h, "q")); +} + +test "chat CLI: on a terminal hidden reasoning shows a hint, shown reasoning is dimmed, and control characters are dropped" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const io = std.testing.io; + const cases = [_]struct { Show, []const u8 }{ + .{ .{}, "Hi \x1b[31mthere\x07\r\xc2\x9b\n" }, + .{ .{ .terminal = true }, dim ++ "thinking..." ++ plain ++ clear_line ++ "Hi [31mthere\n" }, + .{ .{ .thinking = true }, "Let me see.\n\nHi \x1b[31mthere\x07\r\xc2\x9b\n" }, + .{ .{ .thinking = true, .terminal = true }, dim ++ "Let me see." ++ plain ++ "\n\nHi [31mthere\n" }, + }; + for (cases) |c| { + var out: std.Io.Writer.Allocating = .init(a); + var p: Printer = .{ .io = io, .out = &out.writer, .show = c[0] }; + try Printer.piece(&p, .reasoning, "Let me "); + try Printer.piece(&p, .reasoning, "see."); + try Printer.piece(&p, .content, "Hi \x1b[31mthere\x07\r\xc2\x9b"); + if (!c[0].thinking) try Printer.piece(&p, .reasoning, "reasoning after the answer is never hinted"); + p.end(); + try std.testing.expectEqualStrings(c[1], out.written()); + } + var out: std.Io.Writer.Allocating = .init(a); + var stopped: Printer = .{ .io = io, .out = &out.writer, .show = .{ .thinking = true, .terminal = true } }; + try Printer.piece(&stopped, .reasoning, "cut off"); + stopped.end(); + try std.testing.expectEqualStrings(dim ++ "cut off" ++ plain ++ "\n", out.written()); +} diff --git a/zig/src/server/chat_generation.zig b/zig/src/server/chat_generation.zig index 3868f69293c..0c5bbfb3c3d 100644 --- a/zig/src/server/chat_generation.zig +++ b/zig/src/server/chat_generation.zig @@ -4,6 +4,7 @@ const api = @import("engine_api"); const json = @import("json"); const chat = @import("chat.zig"); const reply_text = @import("reply_text.zig"); +const recipient_reply = @import("recipient_reply.zig"); const tool_stream = @import("tool_stream.zig"); const tool_parse = @import("tool_parse.zig"); const tool_lfm2 = @import("tool_lfm2.zig"); @@ -55,6 +56,7 @@ pub const Generation = struct { token_ids: bool, // "return_token_ids": the response's tensorfold block carries the reply's token ids tools: []const Value, calls: ?tool_stream.Streamer = null, + recipient: ?recipient_reply.Reading = null, // a chat whose reply is messages to recipients (Muse Spark's) collected: std.ArrayList(u32) = .empty, visible: reply_text.Incremental = .{}, kimi: ?@import("kimi_reply.zig").Stream = null, @@ -151,10 +153,12 @@ pub const Generation = struct { const text = try @import("tool_minimax.zig").dsml(g.a, raw_visible, g.tools); // MiniMax-M3's calls as DSML var answer = text; var thought: []const u8 = ""; - if (g.thinking) { - const original_close = try g.visible.closeOf(g.a, reply_text.decodeText, g.srv.text, g.srv.close_id); - const close = try @import("tool_minimax.zig").closeAfterRewrite(g.a, raw_visible, g.tools, original_close); - const split = try reply_text.splitThinkingAt(g.a, text, false, g.srv.markers, close); + if (g.thinking or g.recipient != null) { + const split = if (g.recipient) |*r| try r.split(g.a, text, .streaming) else blk: { + const original_close = try g.visible.closeOf(g.a, reply_text.decodeText, g.srv.text, g.srv.close_id); + const close = try @import("tool_minimax.zig").closeAfterRewrite(g.a, raw_visible, g.tools, original_close); + break :blk try reply_text.splitThinkingAt(g.a, text, false, g.srv.markers, close); + }; thought = g.streamed_reasoning.after(reply_text.pyStrip(split.reasoning), true); // the whole reply strips it if (thought.len > 0) try g.streamed_reasoning.set(g.a, reply_text.pyStrip(split.reasoning), thought); answer = split.answer; @@ -303,11 +307,12 @@ pub const Generation = struct { const text = if (close.len > 0) try std.mem.concat(a, u8, &.{ visible, close }) else visible; var content: []const u8 = text; var reasoning: ?[]const u8 = null; + const read = g.thinking or g.recipient != null; // the reply's split text is its content if (native) |n| { const r = reply_text.pyStrip(n.reasoning); reasoning = if (r.len > 0) r else null; - } else if (g.thinking) { - const split = try reply_text.splitThinkingAt(a, text, true, g.srv.markers, close_at.?); + } else if (read) { + const split = if (g.recipient) |*r| try r.split(a, text, if (std.mem.eql(u8, reason, "length")) .cut else if (g.stops.matched(raw) != null) .stopped else .ended) else try reply_text.splitThinkingAt(a, text, true, g.srv.markers, close_at.?); const r = reply_text.pyStrip(split.reasoning); reasoning = if (r.len > 0) r else null; content = split.answer; @@ -325,17 +330,17 @@ pub const Generation = struct { const thought = g.streamed_reasoning.text.items; if (reasoning) |r| if (std.mem.startsWith(u8, r, thought) and r.len > thought.len) try g.emit(sink, try deltaOf(a, "reasoning_content", r[thought.len..])); - const shown = if (g.calls != null) try tool_stream.endProse(a, content, if (g.thinking) content else text, g.tools, reason, g.single) else content; + const shown = if (g.calls != null) try tool_stream.endProse(a, content, if (read) content else text, g.tools, reason, g.single) else content; const sent = g.streamed.text.items; const rest = if (std.mem.startsWith(u8, shown, sent) and shown.len > sent.len) shown[sent.len..] else ""; if (rest.len > 0) try g.emit(sink, .{ .string = rest }); if (g.calls) |*c| { // the streamer reads the closers as markup the model wrote, so the call ends with the same deltas var out: std.ArrayList(Value) = .empty; - const final_text = if (g.thinking) content else text; + const final_text = if (read) content else text; if (std.mem.eql(u8, reason, "length")) { try c.finishCut(final_text, &out); - } else if (close.len > 0 or c.streamed) { + } else if (close.len > 0 or c.streamed or g.recipient != null) { try c.finish(final_text, &out); } for (out.items) |d| try g.emit(sink, d); diff --git a/zig/src/server/cli.zig b/zig/src/server/cli.zig index b24fb209200..beb45b7fc4d 100644 --- a/zig/src/server/cli.zig +++ b/zig/src/server/cli.zig @@ -22,7 +22,6 @@ pub const Flag = struct { path: bool = false, }; const backend_values: []const []const u8 = if (builtin.os.tag == .macos) &.{ "auto", "mlx" } else if (served("--backend=rocm")) &.{ "auto", "rocm" } else &.{ "auto", "cuda" }; - /// The flags past the common ones the binary's backend serves, from its root's `serves` (test roots: none). const native_serves: []const []const u8 = if (@hasDecl(@import("root"), "serves")) @import("root").serves else &.{}; @@ -59,6 +58,7 @@ pub const flags = [_]Flag{ .{ .name = "--api-key-file", .path = true, .native = true }, .{ .name = "--metrics-open", .kind = .store_true, .native = true }, .{ .name = "--dashboard", .kind = .store_true, .native = true }, + .{ .name = "--log-json", .kind = .store_true, .native = true }, .{ .name = "--vision", .kind = .store_true, .native = true }, .{ .name = "--vision-urls", .kind = .store_true, .native = true }, .{ .name = "--vision-pdf", .kind = .store_true, .native = true }, @@ -189,6 +189,7 @@ pub const Args = struct { api_key_file: ?[]const u8 = null, metrics_open: bool = false, dashboard: bool = false, + log_json: bool = false, // --log-json: access, ended and refused lines as one JSON object each context: ?i64 = null, profile: api.profile.Profile = .stable, max_frames: ?u32 = null, @@ -455,7 +456,7 @@ fn apply(a: Allocator, out: *Args, name: []const u8, value: ?[]const u8, u: *Usa const p = try int(u, a, name, v); if (p < 0 or p > 65535) return fail(u, a, "argument --port: invalid port: '{s}'", .{v}); out.port = @intCast(p); - } else if (is(name, "--unix-socket")) out.unix_socket = v else if (is(name, "--name")) out.name = v else if (is(name, "--alias")) try repeated.alias.append(a, v) else if (is(name, "--name-priority")) try repeated.priorities.append(a, v) else if (is(name, "--api-key")) try repeated.keys.append(a, v) else if (is(name, "--api-key-file")) out.api_key_file = v else if (is(name, "--metrics-open")) out.metrics_open = true else if (is(name, "--dashboard")) out.dashboard = true else if (is(name, "--context")) out.context = try int(u, a, name, v) else if (is(name, "--speed-up")) out.speed_up = v else if (is(name, "--prompt-cache-gib")) out.prompt_cache_gib = try gib(u, a, name, v) else if (is(name, "--prompt-cache-over-cap")) out.prompt_cache_over_cap = true else if (is(name, "--learn")) out.learn = true else if (is(name, "--learn-dir")) { + } else if (is(name, "--unix-socket")) out.unix_socket = v else if (is(name, "--name")) out.name = v else if (is(name, "--alias")) try repeated.alias.append(a, v) else if (is(name, "--name-priority")) try repeated.priorities.append(a, v) else if (is(name, "--api-key")) try repeated.keys.append(a, v) else if (is(name, "--api-key-file")) out.api_key_file = v else if (is(name, "--metrics-open")) out.metrics_open = true else if (is(name, "--dashboard")) out.dashboard = true else if (is(name, "--log-json")) out.log_json = true else if (is(name, "--context")) out.context = try int(u, a, name, v) else if (is(name, "--speed-up")) out.speed_up = v else if (is(name, "--prompt-cache-gib")) out.prompt_cache_gib = try gib(u, a, name, v) else if (is(name, "--prompt-cache-over-cap")) out.prompt_cache_over_cap = true else if (is(name, "--learn")) out.learn = true else if (is(name, "--learn-dir")) { out.learn = true; out.learn_dir = v; } else if (is(name, "--prompt-cache-disk")) { diff --git a/zig/src/server/cli_test.zig b/zig/src/server/cli_test.zig index db4cadfa8f1..065314af1ad 100644 --- a/zig/src/server/cli_test.zig +++ b/zig/src/server/cli_test.zig @@ -283,8 +283,8 @@ test "parse and capabilities share the table" { try std.testing.expectEqualStrings("notes", on.compact_memory.?); try std.testing.expectEqualStrings("graph.json", (try parse(a, &.{ "m", "--slide-graph", "graph.json" }, &u)).slide_graph.?); try std.testing.expect((try parse(a, &.{ "m", "--slide" }, &u)).slide); - try std.testing.expect((try parse(a, &.{ "m", "--cortheon" }, &u)).cortheon and !(try parse(a, &.{"m"}, &u)).cortheon); - try std.testing.expect(std.mem.indexOf(u8, doc, "\"--cortheon\": {}") != null); + try std.testing.expect((try parse(a, &.{ "m", "--cortheon" }, &u)).cortheon and !(try parse(a, &.{"m"}, &u)).cortheon and !(try parse(a, &.{"m"}, &u)).log_json and (try parse(a, &.{ "m", "--log-json" }, &u)).log_json); + try std.testing.expect(std.mem.indexOf(u8, doc, "\"--cortheon\": {}") != null and std.mem.indexOf(u8, doc, "\"--log-json\": {}") != null); try std.testing.expectEqual(@as(?f64, 0.5), (try parse(a, &.{ "m", "--compact-at", "0.5" }, &u)).compact_fraction); try std.testing.expectError(error.Usage, parse(a, &.{ "m", "--compact-at", "0" }, &u)); try std.testing.expectError(error.Usage, parse(a, &.{ "m", "--compact-at", "2" }, &u)); diff --git a/zig/src/server/device/profile_test.zig b/zig/src/server/device/profile_test.zig index e59ba49b047..2a3a78cd940 100644 --- a/zig/src/server/device/profile_test.zig +++ b/zig/src/server/device/profile_test.zig @@ -76,6 +76,37 @@ test "device profile: a scan saves, reads back whole, and stays until the hardwa try t.expectEqual(@as(?profile.Due, .hardware), (try scan.current(a, t.io, file, more, newer, "x", false, false)).scanned); } +test "device profile: a changed Mac wired limit refreshes the saved budget" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const root = try folder(a); + defer std.Io.Dir.cwd().deleteTree(t.io, root) catch {}; + const file = try std.fs.path.join(a, &.{ root, ".tensorfold", "device.json" }); + const mac = try parse.macos(a, "aarch64", fx.m1_max_wired); + const bin: scan.Binary = .{ .version = "test", .offer = .{ .version = "test", .backends = &.{"metal"} } }; + const original = try scan.current(a, t.io, file, mac, bin, "2026-11-13T01:00:00Z", false, true); + try t.expect(original.saved and original.support.budget > 0); + const unchanged = try scan.current(a, t.io, file, mac, bin, "2026-11-13T02:00:00Z", false, true); + try t.expectEqual(@as(?profile.Due, null), unchanged.scanned); + try t.expect(scan.fresh(a, t.io, file, mac, bin.version) != null); + + var limited = mac; + limited.gpu_wired_limit = bin.offer.margin; + const stale = scan.fresh(a, t.io, file, limited, bin.version); + const lower = try scan.current(a, t.io, file, limited, bin, "2026-11-13T03:00:00Z", false, true); + try t.expectEqual(@as(?profile.Due, .hardware), lower.scanned); + try t.expect(stale == null); + try t.expect(lower.saved); + try t.expectEqual(limited.gpu_wired_limit, lower.doc.machine.gpu_wired_limit); + try t.expectEqual(@as(u64, 0), lower.support.budget); + try t.expect(scan.fresh(a, t.io, file, limited, bin.version) != null); + + const restored = try scan.current(a, t.io, file, mac, bin, "2026-11-13T04:00:00Z", false, true); + try t.expectEqual(@as(?profile.Due, .hardware), restored.scanned); + try t.expectEqual(original.support.budget, restored.support.budget); +} + test "device profile: a driver that does not answer keeps the OS's listing and a quick scan" { var arena: std.heap.ArenaAllocator = .init(t.allocator); defer arena.deinit(); diff --git a/zig/src/server/device/scan.zig b/zig/src/server/device/scan.zig index 6bcac9fc537..c239aa2a191 100644 --- a/zig/src/server/device/scan.zig +++ b/zig/src/server/device/scan.zig @@ -24,12 +24,19 @@ pub const Current = struct { saved: bool = false, }; +fn rescanReason(old: ?profile.Doc, quick: Machine, version: []const u8, asked: bool, want_full: bool) ?profile.Due { + const saved = old orelse return .missing; + const fp = machine.fingerprint(quick); + if (profile.due(saved, &fp, version, asked, want_full)) |why| return why; + if (quick.os == .macos and saved.machine.gpu_wired_limit != quick.gpu_wired_limit) return .hardware; + return null; +} + /// `quick` is this call's own listing (read.quick); `full` asks the driver when the profile is only a quick one. pub fn current(a: Allocator, io: std.Io, file: ?[]const u8, quick: Machine, bin: Binary, now: []const u8, asked: bool, full: bool) !Current { - const fp = machine.fingerprint(quick); const old = if (file) |f| profile.load(a, io, f) else null; const ask = full and bin.driver != null and quick.os != .macos; - const why = profile.due(old, &fp, bin.version, asked, ask) orelse { + const why = rescanReason(old, quick, bin.version, asked, ask) orelse { const doc = old.?; return .{ .doc = doc, .support = try support.derive(a, doc.machine, bin.offer) }; }; @@ -41,6 +48,7 @@ pub fn current(a: Allocator, io: std.Io, file: ?[]const u8, quick: Machine, bin: kind = .full; }; const s = try support.derive(a, m, bin.offer); + const fp = machine.fingerprint(quick); const doc: profile.Doc = .{ .scanned_at = now, .binary_version = bin.version, .fingerprint = try a.dupe(u8, &fp), .scan = kind, .machine = m, .support = s }; var saved = false; if (file) |f| { @@ -52,9 +60,8 @@ pub fn current(a: Allocator, io: std.Io, file: ?[]const u8, quick: Machine, bin: /// The saved profile when it is current for this machine and binary; null otherwise. Never scans or writes. pub fn fresh(a: Allocator, io: std.Io, file: ?[]const u8, quick: Machine, version: []const u8) ?profile.Doc { - const fp = machine.fingerprint(quick); const old = profile.load(a, io, file orelse return null) orelse return null; - return if (profile.due(old, &fp, version, false, false) == null) old else null; + return if (rescanReason(old, quick, version, false, false) == null) old else null; } /// The driver's GPUs in its own order (CUDA's ordinals), in place of the OS's listing of that vendor; the rest after. diff --git a/zig/src/server/engines.zig b/zig/src/server/engines.zig index dca07818f41..7aa4f7f8f57 100644 --- a/zig/src/server/engines.zig +++ b/zig/src/server/engines.zig @@ -25,6 +25,9 @@ pub fn environment(a: Allocator, args: cli.Args) !?[]const u8 { /// The serve flags past the common ones the backend lists (tensor parallelism, MTP, kept entries, policy). pub const serves: []const []const u8 = if (@hasDecl(native, "serves")) native.serves else &.{}; +/// Whether this binary's engines use Metal 4 (the DeepSeek server's do): the Metal wrapper compiles it in only then. +pub const metal4: bool = @hasDecl(native, "metal4") and native.metal4; + /// The backend's std options when it has any (HIP: no alternate signal stack for RCCL's threads); else the defaults. pub const std_options: std.Options = @import("std_options.zig").of(native); diff --git a/zig/src/server/fields.zig b/zig/src/server/fields.zig index aad8720a231..c1449a84bb3 100644 --- a/zig/src/server/fields.zig +++ b/zig/src/server/fields.zig @@ -22,6 +22,13 @@ pub fn typeName(v: Value) []const u8 { }; } +/// Python's ``bool(fields.get(key))`` on the sampling fields. +pub fn flag(f: Value, key: []const u8) ?bool { + const v = f.get(key) orelse return null; + if (v == .null) return null; + return v.truthy(); +} + /// ``fields.get`` on a body that is not an object fails as Python's AttributeError does. pub fn requireObject(cx: *Cx, v: Value) errors.Refused!void { if (v != .object) return cx.fail(.other, "'{s}' object has no attribute 'get'", .{typeName(v)}); diff --git a/zig/src/server/http_conn.zig b/zig/src/server/http_conn.zig index ca25f31be3d..3a02d3dc6f7 100644 --- a/zig/src/server/http_conn.zig +++ b/zig/src/server/http_conn.zig @@ -62,6 +62,8 @@ pub const Conn = struct { method: []const u8 = "", path: []const u8 = "", requestline: []const u8 = "", + /// The reply id once assigned (chatcmpl-, cmpl-, speech-, images-); null until then. + id: ?[]const u8 = null, headers: []Header = &.{}, key_label: ?[]const u8 = null, cors_vary: bool = false, @@ -239,6 +241,7 @@ pub const Conn = struct { c.cors_vary = false; c.key_scopes = scope.full; c.key_digest = null; + c.id = null; c.counted = false; c.response_complete = false; const raw = c.readLine(a, max_line + 1, if (idle) c.timeouts.idle_ms else c.timeouts.read_ms) catch |e| switch (e) { diff --git a/zig/src/server/images_generations.zig b/zig/src/server/images_generations.zig index 199ef3ef3f8..8874e8fb768 100644 --- a/zig/src/server/images_generations.zig +++ b/zig/src/server/images_generations.zig @@ -57,6 +57,7 @@ pub fn post(srv: *Server, c: *Conn, a: Allocator) !void { }; var cx: Cx = .{ .a = a }; const id = try ids.make(a, "images-", 32); + c.id = id; const received = clock.nowNs(srv.io); var png: std.ArrayList(u8) = .empty; defer png.deinit(srv.gpa); diff --git a/zig/src/server/late_system.zig b/zig/src/server/late_system.zig new file mode 100644 index 00000000000..b63efe0052e --- /dev/null +++ b/zig/src/server/late_system.zig @@ -0,0 +1,14 @@ +//! The startup probe for a template's late system role. +const std = @import("std"); +const json = @import("json"); +const model_text = @import("model_text.zig"); +const Allocator = std.mem.Allocator; + +/// ``template_late_system``: "system" when the template keeps a later system message in place, else "user". +pub fn lateSystem(a: Allocator, text: model_text.Text) ![]const u8 { + const probe_text = "tensorfold-late-system-probe"; + const probe = (try json.parse(a, "[{\"role\": \"system\", \"content\": \"s\"}, {\"role\": \"user\", \"content\": \"u\"}, {\"role\": \"assistant\", \"content\": \"a\"}, {\"role\": \"system\", \"content\": \"tensorfold-late-system-probe\"}, {\"role\": \"user\", \"content\": \"v\"}]")).ok; + var problem: []const u8 = ""; + const rendered = text.render(a, probe, .{ .add_generation_prompt = false }, &problem) catch return "user"; + return if (std.mem.indexOf(u8, rendered.text, probe_text) != null) "system" else "user"; +} diff --git a/zig/src/server/late_system_test.zig b/zig/src/server/late_system_test.zig index 4d9402dbe53..a93bd95c8de 100644 --- a/zig/src/server/late_system_test.zig +++ b/zig/src/server/late_system_test.zig @@ -335,7 +335,7 @@ test "tool reply prose survives whole chat, Messages and Responses and their war try std.testing.expectEqualStrings("function_call", items[1].get("type").?.string); try std.testing.expectEqualStrings("{\"q\":\"a\"}", items[1].get("arguments").?.string); call_id = items[1].get("call_id").?.string; - const stored = (try srv.store.get(srv.io, a, body.get("id").?.string)).?; + const stored = (try srv.store.get(srv.io, a, body.get("id").?.string, null)).?; try std.testing.expectEqualStrings(retained_prose, stored.get("output").?.array[0].get("content").?.array[0].get("text").?.string); }, else => unreachable, diff --git a/zig/src/server/log.zig b/zig/src/server/log.zig index 1da1af78a5c..2278b82a49b 100644 --- a/zig/src/server/log.zig +++ b/zig/src/server/log.zig @@ -10,6 +10,7 @@ var shown = false; // the live line is on screen var line_start = true; // the newest write ended its line, so a redraw cannot split it var quiet = false; var stamped = false; // TENSORFOLD_LOG_TIME: each log line starts with its UTC time +var json_log = false; // --log-json: access, ended and refused lines as one JSON object each pub const Test = if (@import("builtin").is_test) struct { pub threadlocal var sink: ?struct { ctx: *anyopaque, call: *const fn (*anyopaque, []const u8) void } = null; @@ -27,6 +28,11 @@ pub fn timeWanted(text: ?[]const u8) bool { return std.mem.eql(u8, s, "1") or std.ascii.eqlIgnoreCase(s, "on"); } +/// --log-json: access, ended and refused lines as compact JSON; off (the default) keeps the text lines. +pub fn setJson(on: bool) void { + json_log = on; +} + /// ``2026-10-30T18:54:04.123Z``: a UTC time given in milliseconds since the epoch, an earlier one as the epoch. pub fn utcTime(buf: *[24]u8, ms: i64) []const u8 { const t: u64 = @intCast(@max(ms, 0)); @@ -175,20 +181,127 @@ fn label_suffix(label: []const u8) []const u8 { return std.fmt.bufPrint(&suffix_buf, " key={s}", .{label}) catch " key=?"; } -/// The access line ``send_response`` prints: ``ip "GET / HTTP/1.1" 200 -``. +/// A JSON string in at most ``cap`` bytes with its quotes, cut before an escape or character that would not fit. +fn jsonString(w: *std.Io.Writer, s: []const u8, cap: usize) void { + const room = @min(cap, w.buffer.len - w.end); + if (room < 2) return; + const limit = w.end + room - 1; // the closing quote always fits + w.writeByte('"') catch return; + var i: usize = 0; + while (i < s.len) { + const b = s[i]; + const c1 = b == 0xc2 and i + 1 < s.len and s[i + 1] >= 0x80 and s[i + 1] <= 0x9f; + var esc: [6]u8 = undefined; + var step: usize = 1; + const piece: []const u8 = if (c1 or b < 0x20 or b == 0x7f) blk: { + if (c1) step = 2; + break :blk std.fmt.bufPrint(&esc, "\\u00{x:0>2}", .{s[i + step - 1]}) catch unreachable; + } else if (b == '"' or b == '\\') blk: { + esc[0] = '\\'; + esc[1] = b; + break :blk esc[0..2]; + } else blk: { + step = @min(std.unicode.utf8ByteSequenceLength(b) catch 1, s.len - i); + break :blk s[i .. i + step]; + }; + if (w.end + piece.len > limit) break; + w.writeAll(piece) catch return; + i += step; + } + w.writeByte('"') catch return; +} + +const json_field_cap = 256; // ids, peers, key labels and error names +const json_request_cap = 4096; // the request line, of up to 65,536 bytes, so the whole line stays one parsable object + +fn jsonKey(w: *std.Io.Writer, first: *bool, key: []const u8) void { + if (!first.*) w.writeByte(',') catch return; + first.* = false; + jsonString(w, key, json_field_cap); + w.writeByte(':') catch return; +} + +fn jsonAccess(buf: []u8, c: *const Conn, code: u16) []const u8 { + var w: std.Io.Writer = .fixed(buf); + var first = true; + w.writeByte('{') catch {}; + jsonKey(&w, &first, "event"); + jsonString(&w, "access", json_field_cap); + if (c.id) |id| { + jsonKey(&w, &first, "id"); + jsonString(&w, id, json_field_cap); + } + jsonKey(&w, &first, "status"); + w.print("{d}", .{code}) catch {}; + jsonKey(&w, &first, "peer"); + jsonString(&w, c.peer, json_field_cap); + jsonKey(&w, &first, "request"); + jsonString(&w, c.requestline, json_request_cap); + if (c.auth_enabled) { + jsonKey(&w, &first, "key"); + jsonString(&w, c.key_label orelse "unauthenticated", json_field_cap); + } + w.writeByte('}') catch {}; + return w.buffered(); +} + +fn jsonEnded(buf: []u8, id: []const u8, why: ?[]const u8, prompt: usize, tokens: usize, after: f64) []const u8 { + var w: std.Io.Writer = .fixed(buf); + var first = true; + w.writeByte('{') catch {}; + jsonKey(&w, &first, "event"); + jsonString(&w, "ended", json_field_cap); + jsonKey(&w, &first, "id"); + jsonString(&w, id, json_field_cap); + jsonKey(&w, &first, "reason"); + if (why) |e| { + var reason: [320]u8 = undefined; + jsonString(&w, std.fmt.bufPrint(&reason, "error ({s})", .{e}) catch "error", json_field_cap); + } else jsonString(&w, "client-left", json_field_cap); + jsonKey(&w, &first, "prompt"); + w.print("{d}", .{prompt}) catch {}; + jsonKey(&w, &first, "tokens"); + w.print("{d}", .{tokens}) catch {}; + jsonKey(&w, &first, "after"); + w.print("{d:.2}", .{after}) catch {}; + w.writeByte('}') catch {}; + return w.buffered(); +} + +/// The access line ``send_response`` prints: ``ip "GET / HTTP/1.1" 200 -``; JSON when ``--log-json``. pub fn request(c: *const Conn, code: u16) void { + if (json_log) { + var buf: [8192]u8 = undefined; + line("{s}", .{jsonAccess(&buf, c, code)}); + return; + } line("{s} \"{s}\" {d} -{s}", .{ c.peer, c.requestline, code, keySuffix(c) }); } /// ``refused : ``, the message cut to 300 characters: why a request got an error reply. pub fn refused(buf: []u8, id: []const u8, message: []const u8) []const u8 { + const cut = message[0 .. message.len - afterChars(message, 300).len]; + if (json_log) { + var w: std.Io.Writer = .fixed(buf); + var first = true; + w.writeByte('{') catch {}; + jsonKey(&w, &first, "event"); + jsonString(&w, "refused", json_field_cap); + jsonKey(&w, &first, "id"); + jsonString(&w, id, json_field_cap); + jsonKey(&w, &first, "reason"); + jsonString(&w, cut, (buf.len -| w.end) -| 1); // room for the closing brace + w.writeByte('}') catch {}; + return w.buffered(); + } var w: std.Io.Writer = .fixed(buf); - w.print("refused {s}: {s}", .{ id, message[0 .. message.len - afterChars(message, 300).len] }) catch {}; + w.print("refused {s}: {s}", .{ id, cut }) catch {}; return w.buffered(); } /// ``ended reason=...``: a request ending without its reply, because its client left (``why`` null) or it failed. pub fn ended(buf: []u8, id: []const u8, why: ?[]const u8, prompt: usize, tokens: usize, after: f64) []const u8 { + if (json_log) return jsonEnded(buf, id, why, prompt, tokens, after); var w: std.Io.Writer = .fixed(buf); w.print("ended {s} reason=", .{id}) catch {}; if (why) |e| w.print("error ({s})", .{e}) catch {} else w.writeAll("client-left") catch {}; diff --git a/zig/src/server/log_test.zig b/zig/src/server/log_test.zig new file mode 100644 index 00000000000..26cbf22d06f --- /dev/null +++ b/zig/src/server/log_test.zig @@ -0,0 +1,194 @@ +//! Tests for the text and --log-json request lines in log.zig. +const std = @import("std"); +const log = @import("log.zig"); +const Conn = @import("http_conn.zig").Conn; +const Test = log.Test; +const setJson = log.setJson; +const request = log.request; +const ended = log.ended; +const refused = log.refused; +const line = log.line; + +const JsonLogTest = struct { + const Capture = struct { + bytes: [4 * 8192 + 1]u8 = undefined, + len: usize = 0, + fn call(ctx: *anyopaque, bytes: []const u8) void { + const c: *@This() = @ptrCast(@alignCast(ctx)); + @memcpy(c.bytes[0..bytes.len], bytes); + c.len = bytes.len; + } + fn line(c: *const @This()) []const u8 { + return c.bytes[0..c.len]; + } + fn payload(c: *const @This()) []const u8 { + const prefix = "[tensorfold] "; + return c.bytes[prefix.len .. c.len - 1]; + } + }; + + fn sink(c: *Capture) void { + Test.sink = .{ .ctx = c, .call = Capture.call }; + } +}; + +test "default request log: access, ended and refused lines stay text" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(false); + var conn = try Conn.init(std.testing.allocator, 0, "127.0.0.1"); + defer conn.deinit(); + conn.requestline = "GET / HTTP/1.1"; + conn.id = "chatcmpl-1"; + request(&conn, 200); + try std.testing.expectEqualStrings("[tensorfold] 127.0.0.1 \"GET / HTTP/1.1\" 200 -\n", c.line()); + var buf: [1400]u8 = undefined; + line("{s}", .{ended(&buf, "chatcmpl-1", null, 12, 3, 0.5)}); + try std.testing.expectEqualStrings("[tensorfold] ended chatcmpl-1 reason=client-left prompt=12 tokens=3 after=0.50s\n", c.line()); + line("{s}", .{refused(&buf, "cmpl-1", "short")}); + try std.testing.expectEqualStrings("[tensorfold] refused cmpl-1: short\n", c.line()); +} + +test "json request log: access includes the id when known" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(true); + defer setJson(false); + var conn = try Conn.init(std.testing.allocator, 0, "127.0.0.1"); + defer conn.deinit(); + conn.requestline = "POST /v1/chat/completions HTTP/1.1"; + conn.id = "chatcmpl-1"; + request(&conn, 200); + try std.testing.expectEqual(@as(u8, '\n'), c.line()[c.len - 1]); + try std.testing.expectEqual(@as(usize, 1), std.mem.count(u8, c.line(), "\n")); + const parsed = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer parsed.deinit(); + const o = parsed.value.object; + try std.testing.expectEqualStrings("access", o.get("event").?.string); + try std.testing.expectEqualStrings("chatcmpl-1", o.get("id").?.string); + try std.testing.expectEqual(@as(i64, 200), o.get("status").?.integer); + try std.testing.expectEqualStrings("127.0.0.1", o.get("peer").?.string); + try std.testing.expectEqualStrings("POST /v1/chat/completions HTTP/1.1", o.get("request").?.string); + conn.id = null; + request(&conn, 503); + const parsed2 = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer parsed2.deinit(); + try std.testing.expectEqualStrings("access", parsed2.value.object.get("event").?.string); + try std.testing.expect(parsed2.value.object.get("id") == null); + try std.testing.expectEqual(@as(i64, 503), parsed2.value.object.get("status").?.integer); +} + +test "json request log: ended includes id and tokens; refused invents none" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(true); + defer setJson(false); + var buf: [1400]u8 = undefined; + line("{s}", .{ended(&buf, "chatcmpl-1", null, 12, 3, 0.5)}); + try std.testing.expectEqual(@as(usize, 1), std.mem.count(u8, c.line(), "\n")); + const ended_json = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer ended_json.deinit(); + const e = ended_json.value.object; + try std.testing.expectEqualStrings("ended", e.get("event").?.string); + try std.testing.expectEqualStrings("chatcmpl-1", e.get("id").?.string); + try std.testing.expectEqual(@as(i64, 12), e.get("prompt").?.integer); + try std.testing.expectEqual(@as(i64, 3), e.get("tokens").?.integer); + try std.testing.expectEqualStrings("client-left", e.get("reason").?.string); + try std.testing.expect(e.get("status") == null); + line("{s}", .{ended(&buf, "chatcmpl-1", "OutOfMemory", 12, 0, 1.25)}); + const err_json = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer err_json.deinit(); + try std.testing.expectEqualStrings("error (OutOfMemory)", err_json.value.object.get("reason").?.string); + try std.testing.expectEqual(@as(i64, 0), err_json.value.object.get("tokens").?.integer); + line("{s}", .{refused(&buf, "cmpl-1", "short")}); + const refused_json = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer refused_json.deinit(); + const r = refused_json.value.object; + try std.testing.expectEqualStrings("refused", r.get("event").?.string); + try std.testing.expectEqualStrings("cmpl-1", r.get("id").?.string); + try std.testing.expectEqualStrings("short", r.get("reason").?.string); + try std.testing.expect(r.get("prompt") == null); + try std.testing.expect(r.get("tokens") == null); +} + +test "json request log: secrets stay out of the line" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(true); + defer setJson(false); + var conn = try Conn.init(std.testing.allocator, 0, "127.0.0.1"); + defer conn.deinit(); + conn.requestline = "GET /health HTTP/1.1"; + var headers = [_]@import("http_conn.zig").Header{.{ .name = "Authorization", .value = "Bearer sk-secret-value" }}; + conn.headers = &headers; + conn.auth_enabled = true; + conn.key_label = "cli-1"; + request(&conn, 200); + const line_text = c.line(); + try std.testing.expect(std.mem.indexOf(u8, line_text, "sk-secret-value") == null); + try std.testing.expect(std.mem.indexOf(u8, line_text, "Bearer") == null); + try std.testing.expect(std.mem.indexOf(u8, line_text, "Authorization") == null); + const parsed = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer parsed.deinit(); + try std.testing.expectEqualStrings("cli-1", parsed.value.object.get("key").?.string); + conn.requestline = "GET / \"quoted\" HTTP/1.1"; + request(&conn, 400); + const quoted = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer quoted.deinit(); + try std.testing.expectEqualStrings("GET / \"quoted\" HTTP/1.1", quoted.value.object.get("request").?.string); +} + +test "json request log: a request line over 8 KiB still parses" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(true); + defer setJson(false); + var conn = try Conn.init(std.testing.allocator, 0, "127.0.0.1"); + defer conn.deinit(); + const long = try std.testing.allocator.alloc(u8, "GET /".len + 9000 + " HTTP/1.1".len); + defer std.testing.allocator.free(long); + @memcpy(long[0..5], "GET /"); + @memset(long[5 .. 5 + 9000], 'a'); + @memcpy(long[5 + 9000 ..], " HTTP/1.1"); + conn.requestline = long; + conn.auth_enabled = true; + request(&conn, 401); + try std.testing.expectEqual(@as(usize, 1), std.mem.count(u8, c.line(), "\n")); + const parsed = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer parsed.deinit(); + const o = parsed.value.object; + try std.testing.expectEqualStrings("access", o.get("event").?.string); + try std.testing.expect(std.mem.startsWith(u8, long, o.get("request").?.string)); + try std.testing.expectEqualStrings("unauthenticated", o.get("key").?.string); + @memset(long, 0x01); + conn.requestline = long; + request(&conn, 400); + const controls = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer controls.deinit(); + try std.testing.expect(controls.value.object.get("request").?.string.len > 0); +} + +test "json request log: a refusal of control bytes still parses" { + var c: JsonLogTest.Capture = .{}; + JsonLogTest.sink(&c); + defer Test.sink = null; + setJson(true); + defer setJson(false); + var message: [300]u8 = undefined; + @memset(&message, 0x01); + var buf: [1024]u8 = undefined; + line("{s}", .{refused(&buf, "cmpl-1", &message)}); + const parsed = try std.json.parseFromSlice(std.json.Value, std.testing.allocator, c.payload(), .{}); + defer parsed.deinit(); + const r = parsed.value.object; + try std.testing.expectEqualStrings("refused", r.get("event").?.string); + try std.testing.expectEqualStrings("cmpl-1", r.get("id").?.string); + const reason = r.get("reason").?.string; + try std.testing.expect(reason.len > 0 and reason.len < message.len); + for (reason) |b| try std.testing.expectEqual(@as(u8, 0x01), b); +} diff --git a/zig/src/server/main.zig b/zig/src/server/main.zig index 74ab43f1f23..13e84c57ac2 100644 --- a/zig/src/server/main.zig +++ b/zig/src/server/main.zig @@ -19,11 +19,12 @@ const benchmark = @import("benchmark.zig"); const checkpoint_cli = @import("checkpoint_cli"); const pdf_worker = @import("pdf_worker.zig"); const web_cli = @import("web_cli.zig"); +const chat_cli = @import("chat_cli.zig"); const launch_cli = @import("launch_cli.zig"); const device_cli = @import("device_cli.zig"); const usage_line = "usage: tensorfold serve [-h] [--config FILE.toml] [--host HOST] [--port PORT] [--unix-socket PATH] [--name NAME] [--chat-template FILE]" ++ - " [--alias ALIAS] [--allowed-host NAME] [--allowed-origin ORIGIN] [--cors-origin ORIGIN] [--api-key API_KEY] [--api-key-file API_KEY_FILE] [--metrics-open] [--dashboard]" ++ + " [--alias ALIAS] [--allowed-host NAME] [--allowed-origin ORIGIN] [--cors-origin ORIGIN] [--api-key API_KEY] [--api-key-file API_KEY_FILE] [--metrics-open] [--dashboard] [--log-json]" ++ " [--max-inflight N] [--max-inflight-per-key N] [--requests-per-second N] [--request-burst N]" ++ " [--max-connections N] [--max-connections-per-address N] [--trusted-proxy ADDRESS]" ++ " [--context CONTEXT] [--profile stable] [--speed-up SETTINGS] [--prompt-cache-gib PROMPT_CACHE_GIB] [--prompt-cache-disk DIR]" ++ @@ -54,6 +55,9 @@ pub const serves = engines.serves; pub const std_options = engines.std_options; +/// Read by the Metal wrapper at compile time: Metal 4 only in a binary whose engines use it. +pub const tf_metal4 = engines.metal4; + pub fn main(init: std.process.Init) !u8 { const entry = std.Io.Clock.awake.now(init.io).toNanoseconds(); const gpa = init.gpa; @@ -69,7 +73,7 @@ pub fn main(init: std.process.Init) !u8 { // help and a bare run lead with what this machine runs: the saved profile, or a quick scan with no driver if (argv.len == 2 and (std.mem.eql(u8, argv[1], "--help") or std.mem.eql(u8, argv[1], "-h") or std.mem.eql(u8, argv[1], "help"))) { try std.Io.File.stdout().writeStreamingAll(io, device_cli.summary(init)); - try std.Io.File.stdout().writeStreamingAll(io, "usage: tensorfold-native --version | capabilities --json | device [--json] [--rescan] | models [--json] | info MODEL | pull REPO[@REVISION] | rm REPO[@REVISION] | slide rollback FOLDER | web [ARGS...] | launch [args...] | slide audit [flags] | serve MODEL [flags] | benchmark MODEL [flags]\n" ++ usage_line); + try std.Io.File.stdout().writeStreamingAll(io, "usage: tensorfold-native --version | capabilities --json | device [--json] [--rescan] | models [--json] | info MODEL | pull REPO[@REVISION] | rm REPO[@REVISION] | slide rollback FOLDER | web [ARGS...] | launch [args...] | slide audit [flags] | serve MODEL [flags] | benchmark MODEL [flags] | chat [MODEL] [flags]\n" ++ usage_line); return 0; } if (argv.len >= 2 and std.mem.eql(u8, argv[1], "device")) return device_cli.main(init, argv[2..]); @@ -110,8 +114,10 @@ pub fn main(init: std.process.Init) !u8 { return 2; } else return benchmark.main(init, argv[2..], engines.capabilities(a)); } + // a chat with a running server works on every platform; chat_cli.zig refuses its own serve child on Windows + if (argv.len >= 2 and std.mem.eql(u8, argv[1], "chat")) return chat_cli.main(init, argv[2..]); if (argv.len < 2 or !std.mem.eql(u8, argv[1], "serve")) { - std.debug.print("{s}usage: tensorfold-native capabilities --json | device [--json] [--rescan] | models [--json] | info MODEL | pull REPO[@REVISION] | rm REPO[@REVISION] | slide rollback FOLDER | launch [args...] | slide audit [flags] | serve MODEL [flags] | benchmark MODEL [flags]\n", .{if (argv.len < 2) device_cli.summary(init) else ""}); + std.debug.print("{s}usage: tensorfold-native capabilities --json | device [--json] [--rescan] | models [--json] | info MODEL | pull REPO[@REVISION] | rm REPO[@REVISION] | slide rollback FOLDER | launch [args...] | slide audit [flags] | serve MODEL [flags] | benchmark MODEL [flags] | chat [MODEL] [flags]\n", .{if (argv.len < 2) device_cli.summary(init) else ""}); return 2; } const started = std.Io.Clock.awake.now(io).toNanoseconds(); diff --git a/zig/src/server/models_id_test.zig b/zig/src/server/models_id_test.zig new file mode 100644 index 00000000000..345b69688a6 --- /dev/null +++ b/zig/src/server/models_id_test.zig @@ -0,0 +1,102 @@ +//! GET /v1/models/{id} through the dispatcher: the listing's entry by id or alias, escaped or raw, else a 404. +const std = @import("std"); +const json = @import("json"); +const Server = @import("server.zig").Server; +const Conn = @import("http_conn.zig").Conn; +const routes = @import("routes.zig"); +const discovery = @import("models_input_types_test.zig"); +const t = std.testing; + +const Reply = struct { status: []const u8, body: json.Value }; + +/// A GET of `path` as the dispatcher answers it: the status line and the JSON body. +fn get(a: std.mem.Allocator, srv: *Server, path: []const u8) !Reply { + var wire: discovery.Wire = .{ .out = .init(a) }; + var conn: Conn = .{ .fd = -1, .peer = "", .buf = &.{}, .gpa = a, .version = "HTTP/1.1", .method = "GET", .path = path, .write_hooks = .{ .ctx = &wire, .write = discovery.Wire.write } }; + routes.dispatch(srv, &conn, a); + const bytes = wire.out.written(); + const split = std.mem.indexOf(u8, bytes, "\r\n\r\n") orelse return error.NoReply; + return .{ .status = bytes[0..std.mem.indexOf(u8, bytes, "\r\n").?], .body = (try json.parse(a, bytes[split + 4 ..])).ok }; +} + +/// An entry's JSON with its created time zeroed: two reads may fall in different seconds. +fn timeless(a: std.mem.Allocator, entry: json.Value) ![]const u8 { + try entry.object.put(a, "created", .{ .int = "0" }); + return json.stringify(a, entry, .{}); +} + +fn served() Server { + var srv = discovery.server(null, true); + srv.config.model_ids = &.{ "model", "alias", "example-org/model", "50%off" }; + return srv; +} + +test "model discovery by id: the served name and every alias return the listing's own entry" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var srv = served(); + const listed = try discovery.listed(a, &srv); + for (srv.config.model_ids, listed) |id, entry| { + for ([_][]const u8{ "/v1/models/", "/models/" }) |head| { + const got = try get(a, &srv, try std.mem.concat(a, u8, &.{ head, id })); + try t.expectEqualStrings("HTTP/1.1 200 OK", got.status); + try t.expectEqualStrings(try timeless(a, entry), try timeless(a, got.body)); + } + } +} + +test "model discovery by id: an org/name id is found raw, escaped with %2F or %2f, and past a query or slash" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var srv = served(); + const paths = [_][]const u8{ + "/v1/models/example-org/model", "/v1/models/example-org%2Fmodel", "/models/example-org%2fmodel", + "/v1/models/%65xample-org/model", "/v1/models/example-org/model/?x=1", + }; + for (paths) |path| { + const got = try get(a, &srv, path); + try t.expectEqualStrings("HTTP/1.1 200 OK", got.status); + try t.expectEqualStrings("example-org/model", got.body.strField("id").?); + try t.expectEqualStrings("model", got.body.strField("object").?); + } + // a % that escapes no hex pair leaves the id as written; %25 is the escaped percent sign + for ([_][]const u8{ "/v1/models/50%off", "/v1/models/50%25off" }) |path| + try t.expectEqualStrings("50%off", (try get(a, &srv, path)).body.strField("id").?); +} + +test "model discovery by id: any other id is a 404 model_not_found naming the decoded id" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var srv = served(); + const cases = [_][2][]const u8{ + .{ "/v1/models/missing", "model 'missing' is not served here" }, + .{ "/v1/models/example-org%2Fmissing", "model 'example-org/missing' is not served here" }, + .{ "/models/MODEL", "model 'MODEL' is not served here" }, + .{ "/v1/models/example-org", "model 'example-org' is not served here" }, + }; + for (cases) |c| { + const got = try get(a, &srv, c[0]); + try t.expectEqualStrings("HTTP/1.1 404 Not Found", got.status); + const err = got.body.get("error").?; + try t.expectEqualStrings(c[1], err.strField("message").?); + try t.expectEqualStrings("invalid_request_error", err.strField("type").?); + try t.expectEqualStrings("model", err.strField("param").?); + try t.expectEqualStrings("model_not_found", err.strField("code").?); + } +} + +test "model discovery by id: a path ending in /models still lists every model" { + var arena: std.heap.ArenaAllocator = .init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var srv = served(); + for ([_][]const u8{ "/v1/models", "/models/", "/v1/models/model/models", "/models/models" }) |path| { + const got = try get(a, &srv, path); + try t.expectEqualStrings("HTTP/1.1 200 OK", got.status); + try t.expectEqualStrings("list", got.body.strField("object").?); + try t.expectEqual(srv.config.model_ids.len, got.body.get("data").?.array.len); + } +} diff --git a/zig/src/server/models_input_types_test.zig b/zig/src/server/models_input_types_test.zig index 2e39c9a92d0..8f0743b99c5 100644 --- a/zig/src/server/models_input_types_test.zig +++ b/zig/src/server/models_input_types_test.zig @@ -9,9 +9,9 @@ const messages = @import("messages.zig"); const images = @import("images.zig"); const t = std.testing; -const Wire = struct { +pub const Wire = struct { out: std.Io.Writer.Allocating, - fn write(ctx: *anyopaque, bytes: []const u8) error{Closed}!void { + pub fn write(ctx: *anyopaque, bytes: []const u8) error{Closed}!void { const self: *Wire = @ptrCast(@alignCast(ctx)); self.out.writer.writeAll(bytes) catch return error.Closed; } @@ -41,7 +41,7 @@ fn noTemplate(_: *anyopaque) []const u8 { } /// A server with only discovery's and media's fields set: no engine, model or tokenizer. -fn server(vision: ?api.Vision, video_decoder: bool) Server { +pub fn server(vision: ?api.Vision, video_decoder: bool) Server { var srv: Server = undefined; srv.io = t.io; srv.info = .{ .vision = vision }; @@ -57,7 +57,7 @@ fn server(vision: ?api.Vision, video_decoder: bool) Server { } /// GET /v1/models' `data`, as a client reads it. -fn listed(a: std.mem.Allocator, srv: *Server) ![]json.Value { +pub fn listed(a: std.mem.Allocator, srv: *Server) ![]json.Value { var wire: Wire = .{ .out = .init(a) }; var conn: Conn = .{ .fd = -1, .peer = "", .buf = &.{}, .gpa = a, .version = "HTTP/1.1", .method = "GET", .write_hooks = .{ .ctx = &wire, .write = Wire.write } }; try @import("status_routes.zig").models(srv, &conn, a); diff --git a/zig/src/server/ocr/budget.zig b/zig/src/server/ocr/budget.zig index df62906b28b..d2dcbc4c654 100644 --- a/zig/src/server/ocr/budget.zig +++ b/zig/src/server/ocr/budget.zig @@ -1,10 +1,11 @@ -//! A request's image-encode budget (docs/api.md OCR: Pages and budgets). +//! A request's page budget and image-encode budget (docs/api.md OCR: Pages and budgets). +const pdf = @import("../pdf.zig"); const types = @import("types.zig"); const Fault = types.Fault; /// The most images one request may encode. pub const max_count = 256; -/// The encoded bytes every request may hold, and what each page adds. +/// The encoded bytes every request may hold, and what each selected page adds. pub const base_bytes = 16 << 20; pub const page_bytes = 2 << 20; /// Encoded pixels may reach this many times the request's page pixels. @@ -12,6 +13,23 @@ pub const pixel_factor = 4; /// The unreadable-page reason for any encode limit. pub const over_message = "too many image regions"; +/// Pages a request may still read: images count 1 each, PDF pages as selected. +pub const Pages = struct { + left: u32, + + /// ``TENSORFOLD_MAX_PDF_PAGES`` (default and ceiling 16); ``--vision-max-images`` does not apply. + pub fn init() Pages { + return .{ .left = pdf.maxPagesLimit(0) }; + } + + /// Takes ``n`` pages; false, and nothing taken, when fewer than ``n`` are left. + pub fn take(p: *Pages, n: u32) bool { + if (n > p.left) return false; + p.left -= n; + return true; + } +}; + /// The crops a request has encoded, against its limits. pub const Encodes = struct { count: u32 = 0, diff --git a/zig/src/server/ocr/budget_test.zig b/zig/src/server/ocr/budget_test.zig index 9c9f8b487a2..31d334f119b 100644 --- a/zig/src/server/ocr/budget_test.zig +++ b/zig/src/server/ocr/budget_test.zig @@ -1,9 +1,20 @@ -//! The image-encode budget (docs/api.md OCR: Pages and budgets). +//! The page budget and the image-encode budget (docs/api.md OCR: Pages and budgets). const std = @import("std"); const budget = @import("budget.zig"); const types = @import("types.zig"); const t = std.testing; +test "ocr budget: pages default to at most 16 and take only what is left" { + const p = budget.Pages.init(); + try t.expect(p.left >= 1 and p.left <= 16); + var q: budget.Pages = .{ .left = 3 }; + try t.expect(q.take(2)); + try t.expect(!q.take(2)); + try t.expectEqual(@as(u32, 1), q.left); + try t.expect(q.take(1)); + try t.expect(!q.take(1)); +} + test "ocr budget: the 257th encode faults before it runs" { var fault: types.Fault = undefined; var e = budget.Encodes.init(1 << 30, 1); diff --git a/zig/src/server/ocr/fetch.zig b/zig/src/server/ocr/fetch.zig index 2da7af279ac..dc99305de3e 100644 --- a/zig/src/server/ocr/fetch.zig +++ b/zig/src/server/ocr/fetch.zig @@ -8,14 +8,16 @@ const pdf = @import("../pdf.zig"); /// The fetched bytes, or the words of a refusal (bad input). pub const Got = union(enum) { bytes: []const u8, refused: []const u8 }; -/// ``url`` fetched when --vision-urls gave a fetcher: an image, at most 32 MiB. -pub fn https(a: Allocator, fetch: ?images.Fetch, url: []const u8) Allocator.Error!Got { +/// ``url`` fetched when --vision-urls gave a fetcher: an image, or a PDF too when ``pdf_on``; at most 32 MiB. +pub fn https(a: Allocator, fetch: ?images.Fetch, url: []const u8, pdf_on: bool) Allocator.Error!Got { if (!std.mem.startsWith(u8, url, "https://")) return .{ .refused = "documents require data URLs or public HTTPS URLs" }; const f = fetch orelse return .{ .refused = "document URLs are off on this server; send a data URL, or start the server with --vision-urls" }; if (url.len > media_fetch.max_url_chars) return .{ .refused = "document URL is too long" }; + const with_pdf = media_fetch.image_media ++ [_][]const u8{"application/pdf"}; + const media: []const []const u8 = if (pdf_on) &with_pdf else &media_fetch.image_media; var failure: media_fetch.Failure = .{}; const deadline = std.Io.Clock.awake.now(f.io).addDuration(.fromSeconds(media_fetch.timeout_s)); - const bytes = f.get(f.ctx, a, f.io, url, pdf.max_pdf_bytes, deadline, &media_fetch.image_media, &failure) catch |e| switch (e) { + const bytes = f.get(f.ctx, a, f.io, url, pdf.max_pdf_bytes, deadline, media, &failure) catch |e| switch (e) { error.OutOfMemory => return error.OutOfMemory, error.Media => return .{ .refused = failure.text }, }; diff --git a/zig/src/server/ocr/mistral.zig b/zig/src/server/ocr/mistral.zig index 89d24ee6ee4..f9bd52d6da9 100644 --- a/zig/src/server/ocr/mistral.zig +++ b/zig/src/server/ocr/mistral.zig @@ -6,9 +6,11 @@ const errors = @import("../errors.zig"); const images = @import("../images.zig"); const http_body = @import("../http_body.zig"); const openai = @import("../openai.zig"); +const pdf = @import("../pdf.zig"); const Conn = @import("../http_conn.zig").Conn; const Server = @import("../server.zig").Server; const types = @import("types.zig"); +const budget = @import("budget.zig"); const run = @import("run.zig"); const fetch = @import("fetch.zig"); const reply = @import("mistral_reply.zig"); @@ -18,12 +20,17 @@ const Step = run.Step; pub const Options = reply.Options; -/// What decoding needs from the server: the URL fetcher. +/// The most page entries a ``pages`` value may name before expansion (a range counts its length). +pub const max_page_entries = 1024; + +/// What decoding needs from the server: the PDF switch, the URL fetcher and the page budget. pub const Facts = struct { + pdf: bool, fetch: ?images.Fetch, + pages_left: u32, pub fn of(srv: *const Server) Facts { - return .{ .fetch = if (srv.config.vision_urls) images.Fetch.network(srv.io) else null }; + return .{ .pdf = srv.config.vision_pdf, .fetch = if (srv.config.vision_urls) images.Fetch.network(srv.io) else null, .pages_left = budget.Pages.init().left }; } }; @@ -91,8 +98,7 @@ pub fn decode(a: Allocator, body: Value, facts: Facts, fault: *Fault) Step!Reque const ok = v == .string and (std.mem.eql(u8, v.string, "word") or std.mem.eql(u8, v.string, "page") or std.mem.eql(u8, v.string, "block")); if (!ok) return bad(a, fault, &.{ "body", "confidence_scores_granularity" }, "confidence_scores_granularity must be \"word\", \"page\", \"block\" or null", .{}); } - // this route reads one page image: pages selects PDF pages, and a PDF document is refused - if (body.field("pages") != null) return bad(a, fault, &.{ "body", "pages" }, "pages selects pages of a PDF document; POST /v1/ocr reads one page image", .{}); + const pages: ?[]const u32 = if (body.field("pages")) |v| try pageList(a, fault, v, facts.pages_left) else null; const bytes = try document(a, fault, body, facts); const image = switch (images.sniff(bytes)) { .png, .jpeg, .webp => true, @@ -100,9 +106,14 @@ pub fn decode(a: Allocator, body: Value, facts: Facts, fault: *Fault) Step!Reque }; // the image signature first: a PNG text chunk or a JPEG comment may hold "%PDF-" const is_pdf = !image and std.mem.indexOf(u8, bytes[0..@min(bytes.len, 1024)], "%PDF-") != null; - if (is_pdf) return bad(a, fault, &.{ "body", "document" }, "PDF documents are not read on POST /v1/ocr; send each page as a PNG, JPEG or WebP image", .{}); - if (!image) return bad(a, fault, &.{ "body", "document" }, "the document is not a PNG, JPEG or WebP image", .{}); - return .{ .options = o, .source = .{ .bytes = bytes }, .doc_size = bytes.len }; + if (is_pdf) { + if (!facts.pdf) return bad(a, fault, &.{ "body", "document" }, "{s}", .{pdf.off_message}); + const sel: pdf.Selection = if (pages) |l| .{ .list = l } else .{ .all_within = std.math.maxInt(u32) }; + return .{ .options = o, .source = .{ .bytes = bytes, .kind = .pdf, .sel = sel }, .doc_size = bytes.len }; + } + if (!image) return bad(a, fault, &.{ "body", "document" }, "the document is not a PDF, PNG, JPEG or WebP file", .{}); + if (pages) |l| if (l.len != 1 or l[0] != 0) return bad(a, fault, &.{ "body", "pages" }, "an image has one page; pages may select only page 0", .{}); + return .{ .options = o, .source = .{ .bytes = bytes, .kind = .image, .sel = .{ .all_within = 1 } }, .doc_size = bytes.len }; } fn flag(a: Allocator, fault: *Fault, body: Value, name: []const u8) Step!?bool { @@ -117,6 +128,63 @@ fn count(a: Allocator, fault: *Fault, body: Value, name: []const u8) Step!?u64 { return std.fmt.parseInt(u64, v.int, 10) catch std.math.maxInt(u64); // past u64: no bound, as an unbounded count } +/// ``pages`` (indices, or a string of ``n`` and ``a-b`` ranges) as sorted distinct indices, bounded before expanding. +pub fn pageList(a: Allocator, fault: *Fault, v: Value, left: u32) Step![]const u32 { + const loc: []const []const u8 = &.{ "body", "pages" }; + var ranges: std.ArrayList([2]u32) = .empty; + var sum: u64 = 0; + switch (v) { + .array => |items| for (items) |item| { + const n = (if (item == .int) std.fmt.parseInt(u32, item.int, 10) catch null else null) orelse + return bad(a, fault, loc, "pages must hold page indices from 0 to 4294967295", .{}); + sum += 1; + if (sum > max_page_entries) return bad(a, fault, loc, "pages selects too many pages", .{}); + try ranges.append(a, .{ n, n }); + }, + .string => |s| if (std.mem.trim(u8, s, " \t").len > 0) { + var it = std.mem.splitScalar(u8, s, ','); + while (it.next()) |raw| { + const part = std.mem.trim(u8, raw, " \t"); + const dash = std.mem.indexOfScalar(u8, part, '-'); + const lo = try index(a, fault, if (dash) |d| part[0..d] else part); + const hi = if (dash) |d| try index(a, fault, part[d + 1 ..]) else lo; + if (lo > hi) return bad(a, fault, loc, "pages range {s} runs backwards", .{part}); + sum += @as(u64, hi) - lo + 1; + if (sum > max_page_entries) return bad(a, fault, loc, "pages selects too many pages", .{}); + try ranges.append(a, .{ lo, hi }); + } + }, + else => return bad(a, fault, loc, "pages must be a list of page indices or a string such as \"0,2-4\"", .{}), + } + if (ranges.items.len == 0) return bad(a, fault, loc, "pages selects no pages", .{}); + const all = try a.alloc(u32, @intCast(sum)); + var k: usize = 0; + for (ranges.items) |r| { + var i = r[0]; + while (true) : (i += 1) { + all[k] = i; + k += 1; + if (i == r[1]) break; + } + } + std.mem.sort(u32, all, {}, std.sort.asc(u32)); + var n: usize = 0; + for (all) |i| if (n == 0 or all[n - 1] != i) { + all[n] = i; + n += 1; + }; + if (n > left) return bad(a, fault, loc, "pages selects {d} pages; a request may read at most {d} (TENSORFOLD_MAX_PDF_PAGES)", .{ n, left }); + return all[0..n]; +} + +fn index(a: Allocator, fault: *Fault, text: []const u8) Step!u32 { + const t = std.mem.trim(u8, text, " \t"); + var digits = t.len > 0; + for (t) |ch| digits = digits and std.ascii.isDigit(ch); + if (digits) if (std.fmt.parseInt(u32, t, 10)) |n| return n else |_| {}; + return bad(a, fault, &.{ "body", "pages" }, "pages: \"{s}\" is not a page index from 0 to 4294967295", .{t}); +} + /// The document's bytes: a data URL, or an https URL fetched when --vision-urls is on. fn document(a: Allocator, fault: *Fault, body: Value, facts: Facts) Step![]const u8 { const doc = body.field("document") orelse return bad(a, fault, &.{ "body", "document" }, "document is required", .{}); @@ -137,7 +205,7 @@ fn document(a: Allocator, fault: *Fault, body: Value, facts: Facts) Step![]const error.OutOfMemory => error.OutOfMemory, error.Refused => bad(a, fault, loc, "{s}", .{cx.message}), }; - return switch (try fetch.https(a, facts.fetch, url)) { + return switch (try fetch.https(a, facts.fetch, url, facts.pdf)) { .bytes => |b| b, .refused => |m| bad(a, fault, loc, "{s}", .{m}), }; diff --git a/zig/src/server/ocr/mistral_test.zig b/zig/src/server/ocr/mistral_test.zig index ac081aee845..1646f3e379d 100644 --- a/zig/src/server/ocr/mistral_test.zig +++ b/zig/src/server/ocr/mistral_test.zig @@ -1,4 +1,4 @@ -//! Mistral /v1/ocr request decoding (field refusals), table forms and the error envelope. +//! Mistral /v1/ocr request decoding (pages bounds, field refusals), table forms and the error envelope. const std = @import("std"); const api = @import("engine_api"); const json = @import("json"); @@ -17,7 +17,46 @@ fn value(a: Allocator, text: []const u8) !json.Value { }; } -const facts: mistral.Facts = .{ .fetch = null }; +/// ``pages`` decoded against a 16-page budget: the indices, or the fault's message. +fn pages(a: Allocator, text: []const u8, fault: *types.Fault) ![]const u32 { + return mistral.pageList(a, fault, try value(a, text), 16); +} + +test "ocr mistral: pages bounds hold before any allocation and dedupe within the page budget" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var fault: types.Fault = undefined; + try t.expectError(error.Faulted, pages(a, "\"0-4294967295\"", &fault)); + try t.expectEqualStrings("pages selects too many pages", fault.message); + try t.expectEqual(types.Class.bad_input, fault.class); + try t.expectEqualStrings("pages", fault.loc[1]); + try t.expectError(error.Faulted, pages(a, "\"0-99999999999\"", &fault)); + try t.expect(std.mem.indexOf(u8, fault.message, "99999999999") != null); + var hundred: std.ArrayList(u8) = .empty; + var two_thousand: std.ArrayList(u8) = .empty; + for ([_]struct { *std.ArrayList(u8), usize }{ .{ &hundred, 100 }, .{ &two_thousand, 2000 } }) |c| { + try c[0].append(a, '['); + for (0..c[1]) |i| try c[0].appendSlice(a, if (i == 0) "0" else ",0"); + try c[0].append(a, ']'); + } + try t.expectEqualSlices(u32, &.{0}, try pages(a, hundred.items, &fault)); + try t.expectError(error.Faulted, pages(a, two_thousand.items, &fault)); + try t.expectEqualStrings("pages selects too many pages", fault.message); + const sixteen = try pages(a, "\"0-15,0-15\"", &fault); + try t.expectEqual(@as(usize, 16), sixteen.len); + try t.expectEqual(@as(u32, 15), sixteen[15]); + try t.expectEqualSlices(u32, &.{ 0, 2, 3, 4, 7 }, try pages(a, "\" 7 , 2 - 4,0\"", &fault)); + try t.expectEqualSlices(u32, &.{ 1, 3 }, try pages(a, "[3, 1, 3]", &fault)); + try t.expectError(error.Faulted, pages(a, "\"0-16\"", &fault)); + try t.expect(std.mem.indexOf(u8, fault.message, "TENSORFOLD_MAX_PDF_PAGES") != null); + for ([_][]const u8{ "\"4-2\"", "\"\"", "[]", "\"1,,2\"", "\"x\"", "[-1]", "[1.0]", "true", "\"-3\"" }) |bad| { + try t.expectError(error.Faulted, pages(a, bad, &fault)); + try t.expectEqual(types.Class.bad_input, fault.class); + } +} + +const facts: mistral.Facts = .{ .pdf = false, .fetch = null, .pages_left = 16 }; /// A request body around ``doc`` (a document object) and ``extra`` fields. fn body(a: Allocator, doc: []const u8, extra: []const u8) !json.Value { @@ -42,16 +81,17 @@ test "ocr mistral: explicit nulls mean absent, and each document form decodes" { const doc = try imageDoc(a); const r = try mistral.decode(a, try body(a, doc, nulls), facts, &fault); try t.expectEqual(mistral.Options{}, r.options); + try t.expect(r.source.kind == .image); try t.expectEqual(r.source.bytes.len, r.doc_size); - // image_url as {url, detail}, and document_url with an image data URL + // image_url as {url, detail}, document_url with an image data URL, and pages [0] or "0" on an image const url = doc[std.mem.indexOf(u8, doc, "data:").? .. doc.len - 2]; for ([_][]const u8{ try std.fmt.allocPrint(a, "{{\"type\": \"image_url\", \"image_url\": {{\"url\": \"{s}\", \"detail\": \"high\"}}}}", .{url}), try std.fmt.allocPrint(a, "{{\"type\": \"document_url\", \"document_url\": \"{s}\", \"document_name\": \"scan\"}}", .{url}), - }) |d| { - const got = try mistral.decode(a, try body(a, d, ""), facts, &fault); + }) |d| for ([_][]const u8{ "", ", \"pages\": [0]", ", \"pages\": \"0\"" }) |extra| { + const got = try mistral.decode(a, try body(a, d, extra), facts, &fault); try t.expectEqualSlices(u8, r.source.bytes, got.source.bytes); - } + }; const set = try mistral.decode(a, try body(a, doc, ", \"table_format\": \"html\", \"extract_header\": true, \"include_blocks\": false, \"image_limit\": 2, \"image_min_size\": 9, \"confidence_scores_granularity\": \"word\""), facts, &fault); try t.expectEqual(mistral.Options{ .tables = .html, .header = true, .blocks = false, .image_limit = 2, .image_min_size = 9 }, set.options); } @@ -69,16 +109,15 @@ test "ocr mistral: content-changing and malformed fields are refused with their .{ .doc = doc, .extra = ", \"include_image_base64\": \"yes\"", .field = "include_image_base64", .says = "must be a boolean" }, .{ .doc = doc, .extra = ", \"image_limit\": -1", .field = "image_limit", .says = "non-negative integer" }, .{ .doc = doc, .extra = ", \"confidence_scores_granularity\": \"line\"", .field = "confidence_scores_granularity", .says = "must be" }, - .{ .doc = doc, .extra = ", \"pages\": [0]", .field = "pages", .says = "pages selects pages of a PDF document; POST /v1/ocr reads one page image" }, - .{ .doc = doc, .extra = ", \"pages\": \"0-2\"", .field = "pages", .says = "pages selects pages of a PDF document" }, + .{ .doc = doc, .extra = ", \"pages\": [1]", .field = "pages", .says = "only page 0" }, .{ .doc = doc, .extra = ", \"model\": 3", .field = "model", .says = "model must be" }, .{ .doc = "{\"type\": \"file\", \"file_id\": \"f\"}", .extra = "", .field = "document", .says = "file documents are not supported; send document_url with a data URL" }, .{ .doc = "{\"type\": \"document_url\", \"document_url\": \"https://example.com/a.pdf\"}", .extra = "", .field = "document", .says = "--vision-urls" }, .{ .doc = "{\"type\": \"image_url\", \"image_url\": \"http://example.com/a.png\"}", .extra = "", .field = "document", .says = "public HTTPS URLs" }, .{ .doc = "{\"type\": \"image_url\", \"image_url\": \"data:image/png;base64,!!\"}", .extra = "", .field = "document", .says = "invalid document data URL encoding" }, - .{ .doc = "{\"type\": \"image_url\", \"image_url\": \"data:text/plain,hello\"}", .extra = "", .field = "document", .says = "the document is not a PNG, JPEG or WebP image" }, + .{ .doc = "{\"type\": \"image_url\", \"image_url\": \"data:text/plain,hello\"}", .extra = "", .field = "document", .says = "not a PDF, PNG, JPEG or WebP" }, .{ .doc = "{\"type\": \"video_url\"}", .extra = "", .field = "document", .says = "document.type must be" }, - .{ .doc = pdf_doc, .extra = "", .field = "document", .says = "PDF documents are not read on POST /v1/ocr; send each page as a PNG, JPEG or WebP image" }, + .{ .doc = pdf_doc, .extra = "", .field = "document", .says = "--vision-pdf" }, }; for (cases) |c| { var fault: types.Fault = undefined; @@ -167,7 +206,8 @@ test "ocr mistral: a PNG whose text chunk says %PDF- is an image, not a PDF" { const b64 = try a.alloc(u8, enc.calcSize(png.len)); const doc = try std.fmt.allocPrint(a, "{{\"type\": \"image_url\", \"image_url\": \"data:image/png;base64,{s}\"}}", .{enc.encode(b64, png)}); var fault: types.Fault = undefined; - // a PDF document would be refused; the image is read + // with --vision-pdf off a PDF would be refused; the image is read const req = try mistral.decode(a, try body(a, doc, ""), facts, &fault); + try t.expectEqual(.image, req.source.kind); try t.expectEqual(png.len, req.source.bytes.len); } diff --git a/zig/src/server/ocr/run.zig b/zig/src/server/ocr/run.zig index dfd68630d0f..d6ecdffd117 100644 --- a/zig/src/server/ocr/run.zig +++ b/zig/src/server/ocr/run.zig @@ -46,8 +46,10 @@ pub fn gate(srv: *const Server, a: Allocator, fault: *Fault) Step!void { if (srv.info.vision == null) return fault.fail(a, .bad_input, "{s}", .{no_vision}); } -/// One page to read: its encoded image and its pixel count. -const Planned = struct { bytes: []const u8, pixels: u64 }; +/// Where a page's encoded image comes from: an image source's bytes, or a measured PDF page rendered just before use. +const Origin = union(enum) { image: []const u8, pdf: struct { bytes: []const u8, width: u32, height: u32 } }; +/// One page to read: its index in its source, where its image comes from, its DPI and its pixel count. +const Planned = struct { index: u32, origin: Origin, dpi: u32, pixels: u64 }; /// Reads every page of ``sources`` in order into ``sink``; ``a`` is the request arena, ``gone`` says the client left. pub fn run(srv: *Server, a: Allocator, sources: []const Source, sink: PageSink, fault: *Fault, gone: anytype) Step!void { @@ -55,7 +57,7 @@ pub fn run(srv: *Server, a: Allocator, sources: []const Source, sink: PageSink, const reader = srv.info.ocr.?; const id = try ids.make(a, "ocr-", 24); if (gone.check()) return error.Cancelled; - const pages = try plan(srv, a, sources, fault); + const pages = try plan(srv, a, sources, fault, gone); var total: u64 = 0; for (pages) |p| total +|= p.pixels; // one limit for the whole request, from every page's pixels, so no encode depends on the order of the pages @@ -66,11 +68,45 @@ pub fn run(srv: *Server, a: Allocator, sources: []const Source, sink: PageSink, } } -/// Every source's page, its pixels counted before any inference. -fn plan(srv: *const Server, a: Allocator, sources: []const Source, fault: *Fault) Step![]const Planned { - const out = try a.alloc(Planned, sources.len); - for (sources, out) |s, *p| p.* = .{ .bytes = s.bytes, .pixels = try imagePixels(srv, a, s.bytes, fault) }; - return out; +/// Every source's pages within one page budget; PDFs are measured here, so a bad page fails before any inference. +fn plan(srv: *const Server, a: Allocator, sources: []const Source, fault: *Fault, gone: anytype) Step![]const Planned { + var left = budget.Pages.init(); + const cap = left.left; + // pdf.zig's running budget; images count among its pages, so its page-limit refusal names the request's totals + var used: pdf.Budget = .{}; + var cx: Cx = .{ .a = a }; + var out: std.ArrayList(Planned) = .empty; + for (sources) |s| { + switch (s.kind) { + .image => { + if (!left.take(1)) return overBudget(a, fault, cap); + used.pdf_pages_used += 1; + const px = try imagePixels(srv, a, s.bytes, fault); + try out.append(a, .{ .index = 0, .origin = .{ .image = s.bytes }, .dpi = 72, .pixels = px }); + }, + .pdf => { + if (!srv.config.vision_pdf) return fault.fail(a, .bad_input, "{s}", .{pdf.off_message}); + const sel: pdf.Selection = switch (s.sel) { + .all_within => |n| .{ .all_within = @min(n, left.left) }, + .first => |n| .{ .first = @min(n, left.left) }, + .list => |l| if (l.len > left.left) return overBudget(a, fault, cap) else s.sel, + }; + // a client that left must not hold the shared renderer for its deadline + if (gone.check()) return error.Cancelled; + // sizes and DPI only: each page renders alone just before its generation (onePage) + const r = pdf.measurePages(&cx, s.bytes, sel, pdf.ocrCaps(cap), &used, gone) catch |e| return switch (e) { + error.Cancelled => error.Cancelled, // it left while another request held the renderer + else => |refusal| refused(a, &cx, fault, refusal), + }; + if (!left.take(@intCast(r.pages.len))) return overBudget(a, fault, cap); + for (r.pages) |p| { + const origin: Origin = .{ .pdf = .{ .bytes = s.bytes, .width = p.width, .height = p.height } }; + try out.append(a, .{ .index = p.index, .origin = origin, .dpi = p.dpi, .pixels = @as(u64, p.width) * p.height }); + } + }, + } + } + return out.items; } /// An image's pixel count from its header, else from one decode within the page limit (freed at once). @@ -89,44 +125,70 @@ fn decodeFault(a: Allocator, fault: *Fault, e: picture.Error) Step { }; } -/// An image is page 0 of its source: the index its reply and its messages give. -const page_index = 0; +fn overBudget(a: Allocator, fault: *Fault, cap: u32) Step { + return fault.fail(a, .bad_input, "a request may read at most {d} pages (TENSORFOLD_MAX_PDF_PAGES); this one selects more", .{cap}); +} + +fn refused(a: Allocator, cx: *const Cx, fault: *Fault, e: errors.Refused) Step { + return switch (e) { + error.Refused => Fault.fromCx(a, cx, fault), + error.OutOfMemory => error.OutOfMemory, + }; +} + +/// One measured PDF page rendered alone into ``pa``; a size other than its measure's is an internal fault. +fn renderOne(a: Allocator, pa: Allocator, doc: []const u8, index: u32, width: u32, height: u32, fault: *Fault, gone: anytype) Step![]const u8 { + var cx: Cx = .{ .a = pa }; + var used: pdf.Budget = .{}; + const list = [_]u32{index}; + const r = pdf.renderPages(&cx, doc, .{ .list = &list }, pdf.ocrCaps(1), &used, gone) catch |e| return switch (e) { + error.Cancelled => error.Cancelled, // it left while another request held the renderer + else => |refusal| refused(a, &cx, fault, refusal), + }; + if (r.pages.len != 1 or r.pages[0].width != width or r.pages[0].height != height) + return fault.fail(a, .internal, "page {d}: the rendered page's size differs from its measure", .{index}); + return r.pages[0].jpeg; +} /// One page in its own arena: decode, generate, parse, validate, then the sink while the pixels live. fn onePage(srv: *Server, a: Allocator, reader: api.ocr.Ocr, id: []const u8, p: Planned, sink: PageSink, enc: *budget.Encodes, fault: *Fault, gone: anytype) Step!void { var arena = std.heap.ArenaAllocator.init(srv.gpa); defer arena.deinit(); const pa = arena.allocator(); - const bytes = p.bytes; + // a PDF page's JPEG lives in the page arena and goes with it, so one rendered page is in memory at a time + const bytes = switch (p.origin) { + .image => |b| b, + .pdf => |doc| try renderOne(a, pa, doc.bytes, p.index, doc.width, doc.height, fault, gone), + }; const rgb = picture.decodeWithLimits(srv.io, pa, bytes, .{ .pixels = max_page_pixels }) catch |e| return decodeFault(a, fault, e); const w: u32 = @intCast(rgb.width); const h: u32 = @intCast(rgb.height); // the budget was planned from the header; pixels that disagree (an EXIF turn keeps the product) fail the request - if (@min(@as(u64, w) * h, max_page_pixels) != p.pixels) return fault.fail(a, .bad_input, "page {d}: the image's header and its pixels disagree", .{page_index}); + if (@min(@as(u64, w) * h, max_page_pixels) != p.pixels) return fault.fail(a, .bad_input, "page {d}: the image's header and its pixels disagree", .{p.index}); var pcx: Cx = .{ .a = pa }; - const got = try generate(srv, &pcx, a, reader, id, bytes, fault, gone); + const got = try generate(srv, &pcx, a, reader, id, p, bytes, fault, gone); const parsed = reader.parse(pa, got.content, .{ .width = w, .height = h }, got.frame) catch |e| { if (e == error.OutOfMemory) return error.OutOfMemory; - if (e != error.Unreadable) return fault.fail(a, .internal, "page {d}: the OCR reader failed ({s})", .{ page_index, @errorName(e) }); - log.line("{s}: page {d}: the model's output does not follow its format: {s}", .{ id, page_index, got.content }); - return fault.fail(a, .unreadable, "page {d}: the model's output does not follow its format", .{page_index}); + if (e != error.Unreadable) return fault.fail(a, .internal, "page {d}: the OCR reader failed ({s})", .{ p.index, @errorName(e) }); + log.line("{s}: page {d}: the model's output does not follow its format: {s}", .{ id, p.index, got.content }); + return fault.fail(a, .unreadable, "page {d}: the model's output does not follow its format", .{p.index}); }; const blocks = try a.alloc(api.ocr.OcrBlock, parsed.len); for (parsed, blocks) |b, *o| { const quad = geometry.validate(b.quad, w, h) catch { - log.line("{s}: page {d}: a box is not finite: {s}", .{ id, page_index, got.content }); - return fault.fail(a, .unreadable, "page {d}: the model's output has a box that is not finite", .{page_index}); + log.line("{s}: page {d}: a box is not finite: {s}", .{ id, p.index, got.content }); + return fault.fail(a, .unreadable, "page {d}: the model's output has a box that is not finite", .{p.index}); }; o.* = .{ .content = try a.dupe(u8, b.content), .quad = quad, .kind = b.kind }; } - const page: OcrPage = .{ .index = page_index, .width = w, .height = h, .dpi = 72, .blocks = blocks }; + const page: OcrPage = .{ .index = p.index, .width = w, .height = h, .dpi = p.dpi, .blocks = blocks }; try sink.page(sink.ctx, a, &page, rgb, enc, fault); } const Generated = struct { content: []const u8, frame: api.Size }; /// The page as one user turn (image, then the reader's prompt) through chat.prepare and chat.generate, greedy. -fn generate(srv: *Server, pcx: *Cx, a: Allocator, reader: api.ocr.Ocr, id: []const u8, bytes: []const u8, fault: *Fault, gone: anytype) Step!Generated { +fn generate(srv: *Server, pcx: *Cx, a: Allocator, reader: api.ocr.Ocr, id: []const u8, p: Planned, bytes: []const u8, fault: *Fault, gone: anytype) Step!Generated { const pa = pcx.a; const mime: []const u8 = switch (images.sniff(bytes)) { .png => "image/png", @@ -146,7 +208,7 @@ fn generate(srv: *Server, pcx: *Cx, a: Allocator, reader: api.ocr.Ocr, id: []con return fault.fail(a, .internal, "the model's image step reported no frame", .{}); }; const reply = chat.generate(srv, pcx, prepared, null, gone) catch |e| return chatFault(a, pcx, fault, e); - finished(a, fault, reply.finish_reason, page_index, gone) catch |e| { + finished(a, fault, reply.finish_reason, p.index, gone) catch |e| { if (e == error.Faulted and fault.class == .unreadable) log.line("{s}: {s}: {s}", .{ id, fault.message, reply.content }); // the message names the page return e; }; diff --git a/zig/src/server/ocr/run_pdf_test.zig b/zig/src/server/ocr/run_pdf_test.zig new file mode 100644 index 00000000000..d3b212cc902 --- /dev/null +++ b/zig/src/server/ocr/run_pdf_test.zig @@ -0,0 +1,105 @@ +//! One rendered PDF page at a time: a scripted render worker answers each call in turn, the sink counts them per page. +const std = @import("std"); +const builtin = @import("builtin"); +const picture = @import("core").picture; +const jpeg_out = @import("../jpeg_out.zig"); +const log = @import("../log.zig"); +const pdf = @import("../pdf.zig"); +const worker = @import("../pdf_worker.zig"); +const run = @import("run.zig"); +const types = @import("types.zig"); +const budget = @import("budget.zig"); +const harness = @import("harness_test.zig"); +const t = std.testing; +const Allocator = std.mem.Allocator; + +const Gone = struct { + pub fn check(_: @This()) bool { + return false; + } +}; + +/// The script the server starts as its render worker: it reads the request and answers the n-th call with reply.bin. +const script = + \\#!/bin/sh + \\cd "$(dirname "$0")" || exit 1 + \\cat >/dev/null + \\n=$(cat calls 2>/dev/null || echo 0) + \\echo $((n + 1)) >calls + \\exec cat "reply$n.bin" +; + +/// A worker reply frame for a two-page document: each page at 400 x 400 and 144 DPI with `jpeg` (empty: measured). +fn frame(a: Allocator, indices: []const u32, jpeg: []const u8) ![]const u8 { + var out: std.ArrayList(u8) = .empty; + try out.append(a, 0); + for ([_]u32{ @intCast(indices.len), 2 }) |v| try out.appendSlice(a, &std.mem.toBytes(std.mem.nativeToLittle(u32, v))); + for (indices) |i| { + for ([_]u32{ i, 400, 400, 144, @intCast(jpeg.len) }) |v| try out.appendSlice(a, &std.mem.toBytes(std.mem.nativeToLittle(u32, v))); + try out.appendSlice(a, jpeg); + } + return out.items; +} + +/// Records, as each page reaches the sink, how many times the render worker had been started. +const Order = struct { + dir: std.Io.Dir, + calls: std.ArrayList(u32) = .empty, + indices: std.ArrayList(u32) = .empty, + widths: std.ArrayList(u32) = .empty, + fn sink(o: *Order) run.PageSink { + return .{ .ctx = o, .page = page }; + } + fn page(ctx: *anyopaque, a: Allocator, p: *const types.OcrPage, rgb: picture.Rgb, _: *budget.Encodes, _: *types.Fault) run.Step!void { + const o: *Order = @ptrCast(@alignCast(ctx)); + const calls: u32 = blk: { // 0 when the count cannot be read, which the test then reports + const text = o.dir.readFileAlloc(t.io, "calls", a, .limited(64)) catch break :blk 0; + break :blk std.fmt.parseInt(u32, std.mem.trim(u8, text, " \n"), 10) catch 0; + }; + try o.calls.append(a, calls); + try o.indices.append(a, p.index); + try o.widths.append(a, @intCast(rgb.width)); + } +}; + +test "ocr run: PDF pages are measured first, and page k renders only after page k-1's sink returned" { + if (comptime builtin.os.tag == .windows) return error.SkipZigTest; // the worker is POSIX only; Windows renders in process + log.init(t.io, false); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + // the parent opens PDFium before it starts a worker; the pages decode through the pinned libjpeg-turbo + if (jpeg_out.loadDynLib(pdf.PdfiumFns, .pdfium, a) == null) return error.SkipZigTest; + const rgb = try a.alloc(u8, 400 * 400 * 3); + @memset(rgb, 0xC0); + const jpeg = jpeg_out.encodeRgb(a, rgb, 400, 400, 85) catch |e| return if (e == error.NoLibrary) error.SkipZigTest else e; + _ = picture.decode(t.io, a, jpeg) catch |e| return switch (e) { + error.NoJpegLibrary, error.JpegLibraryVersion => error.SkipZigTest, + else => e, + }; + var tmp = t.tmpDir(.{}); + defer tmp.cleanup(); + // call 0 measures both pages (no JPEG bytes); calls 1 and 2 render page 0 and page 1, one page each + try tmp.dir.writeFile(t.io, .{ .sub_path = "reply0.bin", .data = try frame(a, &.{ 0, 1 }, "") }); + try tmp.dir.writeFile(t.io, .{ .sub_path = "reply1.bin", .data = try frame(a, &.{0}, jpeg) }); + try tmp.dir.writeFile(t.io, .{ .sub_path = "reply2.bin", .data = try frame(a, &.{1}, jpeg) }); + try tmp.dir.writeFile(t.io, .{ .sub_path = "worker", .data = script, .flags = .{ .permissions = .fromMode(0o755) } }); + const saved = worker.server_exe; + defer worker.server_exe = saved; + worker.server_exe = try std.fs.path.join(a, &.{ try tmp.dir.realPathFileAlloc(t.io, ".", a), "worker" }); + var h: harness.Harness = .{ .replies = &.{ .{ .text = "text 0 0 10 10\na" }, .{ .text = "text 0 0 10 10\nb" } } }; + try h.start(.{ .served_name = "m", .model_ids = &.{"m"}, .enable_thinking = false, .use_drafts = false, .vision_pdf = true }); + defer h.stop(); + var order: Order = .{ .dir = tmp.dir }; + var fault: types.Fault = undefined; + const doc: types.Source = .{ .bytes = pdf.minimal_two_page_pdf, .kind = .pdf, .sel = .{ .all_within = 16 } }; + run.run(h.srv, a, &.{doc}, order.sink(), &fault, Gone{}) catch |e| { + if (e == error.Faulted) std.debug.print("ocr run: {s}\n", .{fault.message}); + return e; + }; + try t.expectEqualSlices(u32, &.{ 0, 1 }, order.indices.items); + try t.expectEqualSlices(u32, &.{ 400, 400 }, order.widths.items); + // page 0's sink saw the measure and its own render only; page 1 rendered after it returned + try t.expectEqualSlices(u32, &.{ 2, 3 }, order.calls.items); + try t.expectEqual(@as(usize, 2), h.next); +} diff --git a/zig/src/server/ocr/run_test.zig b/zig/src/server/ocr/run_test.zig index 066a76d922a..ba639072ad7 100644 --- a/zig/src/server/ocr/run_test.zig +++ b/zig/src/server/ocr/run_test.zig @@ -55,7 +55,7 @@ const Seen = struct { }; fn imageSource(a: Allocator, w: u32, h: u32) !types.Source { - return .{ .bytes = try harness.png(a, w, h) }; + return .{ .bytes = try harness.png(a, w, h), .kind = .image, .sel = .{ .all_within = 1 } }; } test "ocr run: blocks scale from the frame, quads are validated, and the sink sees the live pixels" { @@ -101,7 +101,7 @@ test "ocr run: a missing frame releases the prepared request and fails as intern try t.expectError(error.Cancelled, run.run(h.srv, a, &.{try imageSource(a, 8, 8)}, seen.sink(), &fault, Gone{ .left = true })); } -test "ocr run: undecodable bytes refuse before any generation" { +test "ocr run: the page budget, undecodable bytes and the gate refuse before any generation" { var arena = std.heap.ArenaAllocator.init(t.allocator); defer arena.deinit(); const a = arena.allocator(); @@ -110,9 +110,18 @@ test "ocr run: undecodable bytes refuse before any generation" { defer h.stop(); var seen: Seen = .{}; var fault: types.Fault = undefined; - const junk: types.Source = .{ .bytes = "\x89PNG\r\n\x1a\nnope" }; + const one = try imageSource(a, 8, 8); + const many = try a.alloc(types.Source, budget.Pages.init().left + 1); + @memset(many, one); + try t.expectError(error.Faulted, run.run(h.srv, a, many, seen.sink(), &fault, Gone{})); + try t.expectEqual(types.Class.bad_input, fault.class); + try t.expect(std.mem.indexOf(u8, fault.message, "TENSORFOLD_MAX_PDF_PAGES") != null); + const junk: types.Source = .{ .bytes = "\x89PNG\r\n\x1a\nnope", .kind = .image, .sel = .{ .all_within = 1 } }; try t.expectError(error.Faulted, run.run(h.srv, a, &.{junk}, seen.sink(), &fault, Gone{})); try t.expectEqual(types.Class.bad_input, fault.class); + const doc: types.Source = .{ .bytes = "%PDF-1.4\n", .kind = .pdf, .sel = .{ .all_within = 16 } }; + try t.expectError(error.Faulted, run.run(h.srv, a, &.{doc}, seen.sink(), &fault, Gone{})); + try t.expect(std.mem.indexOf(u8, fault.message, "--vision-pdf") != null); try t.expectEqual(@as(usize, 0), h.next); } @@ -191,7 +200,7 @@ test "ocr run: an image whose first header and its pixels disagree is refused be for (orders) |o| { var seen: Seen = .{}; var fault: types.Fault = undefined; - const src: types.Source = .{ .bytes = try twoHeaders(a, o[0], o[1]) }; + const src: types.Source = .{ .bytes = try twoHeaders(a, o[0], o[1]), .kind = .image, .sel = .{ .all_within = 1 } }; try t.expectError(error.Faulted, run.run(h.srv, a, &.{src}, seen.sink(), &fault, Gone{})); try t.expectEqual(types.Class.bad_input, fault.class); try t.expectEqualStrings("page 0: the image's header and its pixels disagree", fault.message); @@ -200,6 +209,35 @@ test "ocr run: an image whose first header and its pixels disagree is refused be try t.expectEqual(@as(usize, 0), h.next); } +/// A client that leaves after ``after`` checks. +const LeavesAfter = struct { + checks: *u32, + after: u32, + pub fn check(g: @This()) bool { + g.checks.* += 1; + return g.checks.* > g.after; + } +}; + +test "ocr run: a client that left renders no PDF and generates no page" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var h: Harness = .{}; + try h.start(.{ .served_name = "m", .model_ids = &.{"m"}, .enable_thinking = false, .use_drafts = false, .vision_pdf = true }); + defer h.stop(); + var seen: Seen = .{}; + var fault: types.Fault = undefined; + // not a renderable document: a render would refuse it, so Cancelled shows no render was tried + const doc: types.Source = .{ .bytes = "%PDF-1.4\nnot a document", .kind = .pdf, .sel = .{ .all_within = 16 } }; + for ([_]u32{ 0, 1 }) |after| { + var checks: u32 = 0; + try t.expectError(error.Cancelled, run.run(h.srv, a, &.{ try imageSource(a, 8, 8), doc }, seen.sink(), &fault, LeavesAfter{ .checks = &checks, .after = after })); + try t.expectEqual(after + 1, checks); + } + try t.expectEqual(@as(usize, 0), h.next); +} + const page_text = "page_header 0 0 100 5\nRunning head\n;;\n" ++ "title 10 5 90 10\n# Report\n;;\n" ++ diff --git a/zig/src/server/ocr/types.zig b/zig/src/server/ocr/types.zig index f2251a7cdf5..014913802c6 100644 --- a/zig/src/server/ocr/types.zig +++ b/zig/src/server/ocr/types.zig @@ -3,13 +3,14 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const api = @import("engine_api"); const errors = @import("../errors.zig"); +const pdf = @import("../pdf.zig"); /// One page of a request: its index in the source document, the pixel size its quads refer to, and its blocks. pub const OcrPage = struct { index: u32, // 0-based page index in the source document width: u32, height: u32, - dpi: u32, // 72 for an image + dpi: u32, // render DPI of a PDF page; 72 for an image blocks: []api.ocr.OcrBlock, // validated, reading order }; @@ -44,7 +45,9 @@ pub const Fault = struct { } }; -/// One document of a request: a page image. +/// One document of a request: an image or a PDF and the pages chosen from it. pub const Source = struct { bytes: []const u8, + kind: enum { image, pdf }, + sel: pdf.Selection, }; diff --git a/zig/src/server/openai.zig b/zig/src/server/openai.zig index 1b5987da538..3b23478828c 100644 --- a/zig/src/server/openai.zig +++ b/zig/src/server/openai.zig @@ -168,6 +168,7 @@ pub fn run(srv: *Server, a: Allocator, out: Out, gone: Gone, is_chat: bool, raw: pub fn runNamed(srv: *Server, a: Allocator, out: Out, gone: Gone, is_chat: bool, raw: Value, format: ?[]const u8, client_thinking: bool, skip_request_log: bool) void { const field: []const u8 = if (is_chat) "messages" else "prompt"; const id = ids.make(a, if (is_chat) "chatcmpl-" else "cmpl-", 32) catch return; + gone.conn.id = id; var cx: Cx = .{ .a = a, .skip_request_log = skip_request_log }; // TENSORFOLD_REQUEST_JOURNAL: off, `observed` is `out` and the trace does nothing var trace: @import("request_trace.zig").Trace = .{ .journal = srv.config.journal, .a = a, .id = id, .parent = out }; @@ -183,7 +184,7 @@ pub fn runNamed(srv: *Server, a: Allocator, out: Out, gone: Gone, is_chat: bool, }; p.input.id = id; // held until the reply is written: POST /v1/requests/{id}/cancel finds the request by each id its client gets - var asked: cancel_ids.Entry = .{}; + var asked: cancel_ids.Entry = .{ .owner = gone.conn.key_digest }; const names = [_][]const u8{ id, cancel_ids.alias orelse "" }; cancel_ids.registry.add(srv.io, &names, &asked); defer cancel_ids.registry.remove(srv.io, &names, &asked); @@ -332,7 +333,7 @@ pub const Run = struct { message.put(r.a, "content", if (calls != null and reply.content.len == 0) .null else .{ .string = reply.content }) catch return; if (calls) |c| message.put(r.a, "tool_calls", .{ .array = c }) catch return; if (r.turn) |t| t.remember(r.a, r.plan.input, .{ .object = message }); - warm.reply(r.srv, r.plan.input, .{ .object = message }, reply.thinking, reply.effort, reply.prompt_tokens); + warm.reply(r.srv, r.plan.input, .{ .object = message }, reply.reasoning, reply.thinking, reply.effort, reply.prompt_tokens); } fn wholeBody(r: *Run, o: *json.Object, reply: *const chat.Reply, calls: ?[]Value) Allocator.Error!void { diff --git a/zig/src/server/pdf.zig b/zig/src/server/pdf.zig index 837bbc02661..6276f91e3b4 100644 --- a/zig/src/server/pdf.zig +++ b/zig/src/server/pdf.zig @@ -1,5 +1,6 @@ //! PDF document input (--vision --vision-pdf): renders PDF pages via PDFium and libjpeg-turbo in a bounded worker. const std = @import("std"); +const builtin = @import("builtin"); const sys = @import("sys"); const json = @import("json"); const errors = @import("errors.zig"); @@ -19,7 +20,19 @@ pub const render_timeout_ns: i96 = 10 * std.time.ns_per_s; pub const max_child_heap_bytes: u64 = 1 << 30; pub const off_message = "PDF inputs are off on this server; start the server with --vision --vision-pdf"; -pub const Budget = struct { images_used: u32 = 0, pdf_pages_used: u32 = 0, encoded_bytes: usize = 0, pixels_used: u64 = 0 }; +pub const Budget = struct { + images_used: u32 = 0, + pdf_pages_used: u32 = 0, + encoded_bytes: usize = 0, + pixels_used: u64 = 0, + /// Counts one rendered page of `px` pixels and `len` JPEG bytes. + pub fn add(b: *Budget, px: u64, len: usize) void { + b.pdf_pages_used += 1; + b.images_used += 1; + b.pixels_used += px; + b.encoded_bytes += len; + } +}; pub const IfsdkPause = extern struct { version: c_int = 1, NeedToPauseNow: *const fn (*IfsdkPause) callconv(.c) c_int, user: ?*anyopaque = null }; pub const PdfiumFns = struct { @@ -164,21 +177,112 @@ pub fn decodeFileData(cx: *Cx, raw: []const u8) errors.Refused![]const u8 { return bytes; } +/// Which pages `renderPages` renders, by 0-based index. +pub const Selection = union(enum) { + /// Every page; refused when the document has more (the page budget left). + all_within: u32, + /// The first n pages; the rest are dropped (PaddleX). + first: u32, + /// These indices, ascending and distinct; one past the last page is refused. + list: []const u32, +}; +/// One call's limits over the caller's running Budget; `infra` is the error kind of a renderer failure. +pub const Caps = struct { request_pixels: u64, request_bytes: usize, page_bytes: usize, max_images: u32, infra: errors.Kind }; +/// A rendered page: its 0-based index, JPEG bytes, pixel size and the DPI it was rendered at. +pub const Page = struct { index: u32, jpeg: []const u8, width: u32, height: u32, dpi: u32 }; +/// The rendered pages in selection order, and the document's page count. +pub const Rendered = struct { pages: []Page, total: u32 }; +/// One render call as the in-process renderer and the POSIX worker (pdf_worker.zig) take it. +pub const Job = struct { + pdf_bytes: []const u8, + sel: Selection, + caps: Caps, + deadline_ns: i96, + /// Each selected page's index, size and DPI from its geometry alone: no bitmap, no JPEG (`jpeg` empty). + measure: bool = false, +}; + +/// A rendered page's shortest and longest side in pixels and its highest DPI, from pageDimensions. +pub const min_side: u32 = 28; +pub const max_side: u32 = 2048; +pub const max_dpi: u32 = 144; + +/// Chat caps: 32 MP, 20 MB encoded, 10 MB a page and `max_images` images (0: no cap); a renderer failure is a 400. +pub fn chatCaps(max_images: u32) Caps { + return .{ .request_pixels = max_request_pixels, .request_bytes = images.max_request_bytes, .page_bytes = images.max_image_bytes, .max_images = max_images, .infra = .request }; +} + +/// An OCR call's caps for `pages` pages: 2048 px a side and 10 MB each, no image cap; a renderer failure is a 500. +pub fn ocrCaps(pages: u32) Caps { + return .{ .request_pixels = @as(u64, pages) * max_side * max_side, .request_bytes = @as(usize, pages) * images.max_image_bytes, .page_bytes = images.max_image_bytes, .max_images = 0, .infra = .server }; +} + /// Renders all pages of `pdf_bytes` within the request-wide `budget` into `image_url` parts appended to `parts`. pub fn expandBytes(cx: *Cx, pdf_bytes: []const u8, image_type: []const u8, max_images: u32, max_pages: u32, budget: *Budget, parts: *std.ArrayList(Value)) errors.Refused!void { + const sel: Selection = .{ .all_within = @max(@as(u32, 1), max_pages) -| budget.pdf_pages_used }; + const r = try renderPages(cx, pdf_bytes, sel, chatCaps(max_images), budget, null); + for (r.pages) |p| try appendImageUrlPart(cx.a, parts, image_type, try makeDataUrl(cx.a, "image/jpeg", p.jpeg)); +} + +/// renderPages' errors: a probe's `error.Cancelled` besides the refusals; without a probe (chat) the refusals alone. +pub fn RenderError(comptime Gone: type) type { + return if (Gone == @TypeOf(null)) errors.Refused else errors.Refused || error{Cancelled}; +} + +/// Renders `sel` within `caps` and the running `budget`, one worker a call; `gone`: null or a probe, asked once locked. +pub fn renderPages(cx: *Cx, pdf_bytes: []const u8, sel: Selection, caps: Caps, budget: *Budget, gone: anytype) RenderError(@TypeOf(gone))!Rendered { + return call(cx, pdf_bytes, sel, caps, budget, gone, false); +} + +/// renderPages' admission, sizes and DPI with no page rendered: each page charged with no bytes, its `jpeg` empty. +pub fn measurePages(cx: *Cx, pdf_bytes: []const u8, sel: Selection, caps: Caps, budget: *Budget, gone: anytype) RenderError(@TypeOf(gone))!Rendered { + return call(cx, pdf_bytes, sel, caps, budget, gone, true); +} + +fn call(cx: *Cx, pdf_bytes: []const u8, sel: Selection, caps: Caps, budget: *Budget, gone: anytype, measure: bool) RenderError(@TypeOf(gone))!Rendered { const jf = jpeg_out.get(cx.a) orelse return cx.fail(.unimplemented, "{s}", .{sys.optional_libraries.spec(.jpeg).message}); const io = log.io(); pdfium_mutex.lockUncancelable(io); defer pdfium_mutex.unlock(io); + // a client that left while queued here starts no worker with a fresh deadline ahead of live requests + if (@TypeOf(gone) != @TypeOf(null) and gone.check()) return error.Cancelled; if (pdfium_state == .unknown) pdfium_state = findPdfium(cx.a); const f = if (pdfium_state == .ready) pdfium_state.ready else return cx.fail(.unimplemented, "{s}", .{sys.optional_libraries.spec(.pdfium).message}); - const deadline_ns = std.Io.Clock.awake.now(io).toNanoseconds() + render_timeout_ns; - var jpegs: std.ArrayList([]const u8) = .empty; - if (comptime sys.windows) try renderInProcess(cx, f, jf, pdf_bytes, max_images, max_pages, deadline_ns, budget, &jpegs) else { - const cmd = worker.argv(cx.a) catch return cx.refuse("PDF rendering worker process could not be started"); - try worker.render(cx, cmd, pdf_bytes, max_images, max_pages, deadline_ns, budget, &jpegs); - } - for (jpegs.items) |jb| try appendImageUrlPart(cx.a, parts, image_type, try makeDataUrl(cx.a, "image/jpeg", jb)); + const job: Job = .{ .pdf_bytes = pdf_bytes, .sel = sel, .caps = caps, .deadline_ns = std.Io.Clock.awake.now(io).toNanoseconds() + render_timeout_ns, .measure = measure }; + var pages: std.ArrayList(Page) = .empty; + const total = if (comptime sys.windows) try renderInProcess(cx, f, jf, job, budget, &pages) else blk: { + const cmd = worker.argv(cx.a) catch return cx.fail(caps.infra, "PDF rendering worker process could not be started", .{}); + break :blk try worker.render(cx, cmd, job, budget, &pages); + }; + return .{ .pages = pages.items, .total = total }; +} + +/// How many pages `sel` takes from `total`, refused over the page or image budget; pdf_worker.zig checks with it too. +pub fn admitCount(cx: *Cx, sel: Selection, caps: Caps, budget: *const Budget, total: u32) errors.Refused!u32 { + if (total == 0) return cx.refuse("PDF document contains no pages"); + const count: u32 = switch (sel) { + .all_within => |n| if (total <= n) total else return cx.fail(.request, "a PDF may have at most {d} pages (--vision-max-images, TENSORFOLD_MAX_PDF_PAGES); this request has {d}", .{ budget.pdf_pages_used +| n, budget.pdf_pages_used +| total }), + .first => |n| @min(n, total), + .list => |l| for (l, 0..) |i, k| { + if (k > 0 and i <= l[k - 1]) return cx.refuse("PDF page indices must be ascending and distinct"); + if (i >= total) return cx.fail(.request, "page {d} is out of range; the document has {d} pages", .{ i, total }); + } else @intCast(l.len), + }; + if (caps.max_images > 0 and budget.images_used +| count > caps.max_images) + return cx.fail(.request, "a request may hold at most {d} images (--vision-max-images); it has {d}", .{ caps.max_images, budget.images_used +| count }); + return count; +} + +/// The index of the selection's `k`-th page. +pub fn pageAt(sel: Selection, k: u32) u32 { + return if (sel == .list) sel.list[k] else k; +} + +/// Refuses a page of `px` pixels and `len` JPEG bytes (0 before the encode: some room must be left) over `caps`. +pub fn checkPage(cx: *Cx, caps: Caps, budget: *const Budget, px: u64, len: usize) errors.Refused!void { + if (budget.pixels_used +| px > caps.request_pixels) return cx.fail(.request, "the request's images exceed the {d}-megapixel limit", .{caps.request_pixels >> 20}); + if (len > caps.page_bytes) return cx.fail(.request, "rendered PDF page exceeds the {d} MB image byte limit", .{caps.page_bytes >> 20}); + if (budget.encoded_bytes +| @max(len, 1) > caps.request_bytes) return cx.fail(.request, "the request's images exceed {d} MB encoded", .{caps.request_bytes >> 20}); } const PauseState = struct { @@ -193,85 +297,94 @@ const PauseState = struct { } }; +fn expired(deadline_ns: i96) bool { + return std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns; +} + pub const render_flags: c_int = 0x01; // FPDF_ANNOT; 0x10 is REVERSE_BYTE_ORDER, RGBA where the JPEG reads BGRA -fn renderPageWithDeadline(cx: *Cx, f: PdfiumFns, bmp: ?*anyopaque, page: ?*anyopaque, w: c_int, h: c_int, idx: usize, deadline_ns: i96) errors.Refused!void { +fn renderPageWithDeadline(cx: *Cx, f: PdfiumFns, job: Job, bmp: ?*anyopaque, page: ?*anyopaque, w: c_int, h: c_int, idx: usize) errors.Refused!void { if (f.FPDF_RenderPageBitmap_Start != null and f.FPDF_RenderPage_Continue != null and f.FPDF_RenderPage_Close != null) { - var state: PauseState = .{ .pause = .{ .version = 1, .NeedToPauseNow = PauseState.check }, .deadline_ns = deadline_ns }; + var state: PauseState = .{ .pause = .{ .version = 1, .NeedToPauseNow = PauseState.check }, .deadline_ns = job.deadline_ns }; var status = f.FPDF_RenderPageBitmap_Start.?(bmp, page, 0, 0, w, h, 0, render_flags, &state.pause); while (status == 1) { - if (state.timed_out or std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns) { + if (state.timed_out or expired(job.deadline_ns)) { f.FPDF_RenderPage_Close.?(page); - return cx.refuse("PDF rendering timed out"); + return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); } status = f.FPDF_RenderPage_Continue.?(page, &state.pause); } f.FPDF_RenderPage_Close.?(page); - if (state.timed_out or std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns) return cx.refuse("PDF rendering timed out"); + if (state.timed_out or expired(job.deadline_ns)) return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); if (status == 3) return cx.refuse(try std.fmt.allocPrint(cx.a, "PDF page {d} could not be rendered", .{idx + 1})); return; } f.FPDF_RenderPageBitmap(bmp, page, 0, 0, w, h, 0, render_flags); - if (std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns) return cx.refuse("PDF rendering timed out"); + if (expired(job.deadline_ns)) return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); } -pub fn renderInProcess(cx: *Cx, f: PdfiumFns, jf: jpeg_out.Fns, pdf_bytes: []const u8, max_images: u32, max_pages: u32, deadline_ns: i96, budget: *Budget, out_jpegs: *std.ArrayList([]const u8)) errors.Refused!void { - if (pdf_bytes.len > std.math.maxInt(c_int)) return cx.refuse("PDF exceeds the encoded byte limit"); - if (std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns) return cx.refuse("PDF rendering timed out"); - const doc = f.FPDF_LoadMemDocument(pdf_bytes.ptr, @intCast(pdf_bytes.len), null) orelse +/// Renders `job` in this process (Windows, and the POSIX worker); returns the document's page count. +pub fn renderInProcess(cx: *Cx, f: PdfiumFns, jf: jpeg_out.Fns, job: Job, budget: *Budget, out: *std.ArrayList(Page)) errors.Refused!u32 { + if (job.pdf_bytes.len > std.math.maxInt(c_int)) return cx.refuse("PDF exceeds the encoded byte limit"); + if (expired(job.deadline_ns)) return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); + const doc = f.FPDF_LoadMemDocument(job.pdf_bytes.ptr, @intCast(job.pdf_bytes.len), null) orelse return cx.refuse("PDF document could not be opened (corrupt or password-protected)"); defer f.FPDF_CloseDocument(doc); - const total_pages = f.FPDF_GetPageCount(doc); - if (total_pages <= 0) return cx.refuse("PDF document contains no pages"); - const pages: u32 = @intCast(total_pages); - const limit: u32 = @max(@as(u32, 1), max_pages); - if (budget.pdf_pages_used + pages > limit) - return cx.refuse(try std.fmt.allocPrint(cx.a, "a PDF may have at most {d} pages (--vision-max-images, TENSORFOLD_MAX_PDF_PAGES); this request has {d}", .{ limit, budget.pdf_pages_used + pages })); - if (max_images > 0 and budget.images_used + pages > max_images) - return cx.refuse(try std.fmt.allocPrint(cx.a, "a request may hold at most {d} images (--vision-max-images); it has {d}", .{ max_images, budget.images_used + pages })); - for (0..pages) |idx| { - if (std.Io.Clock.awake.now(log.io()).toNanoseconds() >= deadline_ns) return cx.refuse("PDF rendering timed out"); + const total: u32 = @intCast(@max(0, f.FPDF_GetPageCount(doc))); + const count = try admitCount(cx, job.sel, job.caps, budget, total); + for (0..count) |k| { + const idx = pageAt(job.sel, @intCast(k)); + if (expired(job.deadline_ns)) return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); const page = f.FPDF_LoadPage(doc, @intCast(idx)) orelse return cx.refuse(try std.fmt.allocPrint(cx.a, "PDF page {d} could not be rendered", .{idx + 1})); defer f.FPDF_ClosePage(page); const dims = pageDimensions(f.FPDF_GetPageWidthF(page), f.FPDF_GetPageHeightF(page)); - const page_pixels = @as(u64, @intCast(dims[0])) * @as(u64, @intCast(dims[1])); - if (budget.pixels_used + page_pixels > max_request_pixels) return cx.refuse("the request's images exceed the 32-megapixel limit"); - if (budget.encoded_bytes >= images.max_request_bytes) return cx.refuse("the request's images exceed 20 MB encoded"); - const bmp = f.FPDFBitmap_Create(dims[0], dims[1], 0) orelse return error.OutOfMemory; + const page_pixels = @as(u64, @intCast(dims.w)) * @as(u64, @intCast(dims.h)); + try checkPage(cx, job.caps, budget, page_pixels, 0); + if (job.measure) { + // the parent's deadline guards the POSIX worker; in process, a load past the deadline must not pass + if (expired(job.deadline_ns)) return cx.fail(job.caps.infra, "PDF rendering timed out", .{}); + budget.add(page_pixels, 0); + try out.append(cx.a, .{ .index = idx, .jpeg = &.{}, .width = @intCast(dims.w), .height = @intCast(dims.h), .dpi = pageDpi(dims) }); + continue; + } + const bmp = f.FPDFBitmap_Create(dims.w, dims.h, 0) orelse return error.OutOfMemory; defer f.FPDFBitmap_Destroy(bmp); const stride = f.FPDFBitmap_GetStride(bmp); const buf_ptr = f.FPDFBitmap_GetBuffer(bmp) orelse return error.OutOfMemory; - if (stride < dims[0] * 4) return cx.refuse("PDF page bitmap has invalid stride"); + if (stride < dims.w * 4) return cx.refuse("PDF page bitmap has invalid stride"); const bgra: [*]u8 = @ptrCast(buf_ptr); - const total_bytes = @as(usize, @intCast(stride)) * @as(usize, @intCast(dims[1])); + const total_bytes = @as(usize, @intCast(stride)) * @as(usize, @intCast(dims.h)); @memset(bgra[0..total_bytes], 0xFF); - try renderPageWithDeadline(cx, f, bmp, page, dims[0], dims[1], idx, deadline_ns); - const jpeg_bytes = jpeg_out.encodeBgra(cx.a, jf, bgra[0..total_bytes], @intCast(dims[0]), @intCast(dims[1]), @intCast(stride)) catch |err| switch (err) { + try renderPageWithDeadline(cx, f, job, bmp, page, dims.w, dims.h, idx); + const jpeg_bytes = jpeg_out.encodeBgra(cx.a, jf, bgra[0..total_bytes], @intCast(dims.w), @intCast(dims.h), @intCast(stride)) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, error.EncodeFailed => return cx.refuse("rendered PDF page could not be encoded as JPEG"), }; - if (jpeg_bytes.len > images.max_image_bytes) return cx.refuse("rendered PDF page exceeds the 10 MB image byte limit"); - if (budget.encoded_bytes + jpeg_bytes.len > images.max_request_bytes) return cx.refuse("the request's images exceed 20 MB encoded"); - budget.pdf_pages_used += 1; - budget.images_used += 1; - budget.pixels_used += page_pixels; - budget.encoded_bytes += jpeg_bytes.len; - try out_jpegs.append(cx.a, jpeg_bytes); + try checkPage(cx, job.caps, budget, page_pixels, jpeg_bytes.len); + budget.add(page_pixels, jpeg_bytes.len); + try out.append(cx.a, .{ .index = idx, .jpeg = jpeg_bytes, .width = @intCast(dims.w), .height = @intCast(dims.h), .dpi = pageDpi(dims) }); } + return total; +} + +const Dims = struct { w: c_int, h: c_int, scale: f32 }; +/// round(72 x scale), at least 1: a huge page's scale can round to 0 DPI. +fn pageDpi(dims: Dims) u32 { + return @max(1, @as(u32, @intFromFloat(@round(72.0 * dims.scale)))); } -fn pageDimensions(pw_raw: f32, ph_raw: f32) [2]c_int { +fn pageDimensions(pw_raw: f32, ph_raw: f32) Dims { const pw: f32 = if (std.math.isFinite(pw_raw) and pw_raw > 1.0) pw_raw else 595.0; const ph: f32 = if (std.math.isFinite(ph_raw) and ph_raw > 1.0) ph_raw else 842.0; - var scale: f32 = 2.0; // 144 DPI baseline - const max_side: f32 = 2048.0; + var scale: f32 = @as(f32, @floatFromInt(max_dpi)) / 72.0; // 144 DPI baseline + const side: f32 = @floatFromInt(max_side); const max_area: f32 = 3_600_000.0; - if (pw * scale > max_side) scale = max_side / pw; - if (ph * scale > max_side) scale = max_side / ph; + if (pw * scale > side) scale = side / pw; + if (ph * scale > side) scale = side / ph; if ((pw * scale) * (ph * scale) > max_area) scale = @sqrt(max_area / (pw * ph)); - const w: c_int = @max(28, @min(4096, @as(c_int, @intFromFloat(@round(pw * scale))))); - const h: c_int = @max(28, @min(4096, @as(c_int, @intFromFloat(@round(ph * scale))))); - return .{ w, h }; + const w: c_int = @max(min_side, @min(4096, @as(c_int, @intFromFloat(@round(pw * scale))))); + const h: c_int = @max(min_side, @min(4096, @as(c_int, @intFromFloat(@round(ph * scale))))); + return .{ .w = w, .h = h, .scale = scale }; } /// The width and height a baseline or progressive JPEG's frame header names, or null when it has none. @@ -332,8 +445,118 @@ test "decodeFileData and parseChildReply validate untrusted input and recompute try std.testing.expect(std.mem.indexOf(u8, url_cx.message, "URLs are not accepted") != null); var bad_reply_cx: Cx = .{ .a = a }; var budget: Budget = .{}; - var jpegs: std.ArrayList([]const u8) = .empty; - try std.testing.expectError(error.Refused, worker.parseChildReply(&bad_reply_cx, &.{ 1, 0xFF, 3, 0, 0, 0, 'b', 'a', 'd' }, 4, 4, &budget, &jpegs)); + var pages: std.ArrayList(Page) = .empty; + const reply = [_]u8{ 1, 0, 3, 0, 0, 0, 'b', 'a', 'd' }; + try std.testing.expectError(error.Refused, worker.parseChildReply(&bad_reply_cx, &reply, .{ .all_within = 4 }, false, chatCaps(4), &budget, &pages)); try std.testing.expectEqual(errors.Kind.request, bad_reply_cx.kind); try std.testing.expectEqualStrings("bad", bad_reply_cx.message); } + +/// Renders `sel` of the two-page fixture in this process by `timeout_ns`; skips without PDFium or libjpeg-turbo. +fn renderFixture(cx: *Cx, sel: Selection, caps: Caps, budget: *Budget, timeout_ns: i96) !Rendered { + const jf = jpeg_out.get(cx.a) orelse return error.SkipZigTest; + const f = jpeg_out.loadDynLib(PdfiumFns, .pdfium, cx.a) orelse return error.SkipZigTest; + f.FPDF_InitLibrary(); // a test runner cannot be the worker (pdf_worker_test.zig renders through it) + var pages: std.ArrayList(Page) = .empty; + const job: Job = .{ .pdf_bytes = minimal_two_page_pdf, .sel = sel, .caps = caps, .deadline_ns = std.Io.Clock.awake.now(log.io()).toNanoseconds() + timeout_ns }; + const total = try renderInProcess(cx, f, jf, job, budget, &pages); + return .{ .pages = pages.items, .total = total }; +} + +test "pdf pages: a list renders only its pages, with their indices, size and DPI" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var cx: Cx = .{ .a = a }; + var budget: Budget = .{}; + const r = try renderFixture(&cx, .{ .list = &.{1} }, ocrCaps(16), &budget, render_timeout_ns); + try std.testing.expectEqual(@as(u32, 2), r.total); + try std.testing.expectEqual(@as(usize, 1), r.pages.len); + const p = r.pages[0]; + try std.testing.expectEqual(Page{ .index = 1, .jpeg = p.jpeg, .width = 400, .height = 400, .dpi = 144 }, p); + try std.testing.expectEqual([2]u32{ 400, 400 }, jpegSize(p.jpeg).?); + try std.testing.expectEqual(Budget{ .images_used = 1, .pdf_pages_used = 1, .encoded_bytes = p.jpeg.len, .pixels_used = 400 * 400 }, budget); + var out_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, renderFixture(&out_cx, .{ .list = &.{ 0, 2 } }, ocrCaps(16), &budget, render_timeout_ns)); + try std.testing.expectEqualStrings("page 2 is out of range; the document has 2 pages", out_cx.message); + try std.testing.expectEqual(errors.Kind.request, out_cx.kind); +} + +test "pdf pages: first(1) renders page 0 and reports the document's two pages" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + var cx: Cx = .{ .a = arena.allocator() }; + var budget: Budget = .{}; + const r = try renderFixture(&cx, .{ .first = 1 }, chatCaps(4), &budget, render_timeout_ns); + try std.testing.expectEqual(@as(u32, 2), r.total); + try std.testing.expectEqual(@as(usize, 1), r.pages.len); + try std.testing.expectEqual(@as(u32, 0), r.pages[0].index); + try std.testing.expectEqual(@as(u32, 1), budget.pdf_pages_used); +} + +test "pdf pages: a renderer deadline is a server error under OCR caps and a request error under chat caps" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + for ([_]Caps{ ocrCaps(16), chatCaps(4) }) |caps| { + var cx: Cx = .{ .a = arena.allocator() }; + var budget: Budget = .{}; + if (renderFixture(&cx, .{ .all_within = 16 }, caps, &budget, 0)) |_| return error.TestUnexpectedResult else |err| if (err != error.Refused) return err; + try std.testing.expectEqual(caps.infra, cx.kind); + try std.testing.expectEqualStrings("PDF rendering timed out", cx.message); + try std.testing.expectEqual(Budget{}, budget); + } +} + +test "pdf pages: a huge page fits 2048 px a side and keeps a DPI of at least 1" { + const dims = pageDimensions(400_000, 200_000); + try std.testing.expectEqual(@as(c_int, 2048), dims.w); + try std.testing.expectEqual(@as(c_int, 1024), dims.h); + try std.testing.expectEqual(@as(u32, 0), @as(u32, @intFromFloat(@round(72.0 * dims.scale)))); + try std.testing.expectEqual(@as(u32, 1), pageDpi(dims)); + try std.testing.expectEqual(max_dpi, pageDpi(pageDimensions(200, 200))); +} + +/// A cancellation probe that counts its calls, says whether the renderer was held then, and reports `left`. +const Probe = struct { + left: bool, + calls: u32 = 0, + held: bool = false, + pub fn check(p: *Probe) bool { + p.calls += 1; + p.held = !pdfium_mutex.tryLock(); + if (!p.held) pdfium_mutex.unlock(log.io()); + return p.left; + } +}; + +test "pdf pages: a client that left while queued for the renderer gets Cancelled and starts no worker" { + if (comptime builtin.os.tag == .windows) return error.SkipZigTest; // Windows renders in process, with no worker to refuse + log.init(std.testing.io, false); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + if (jpeg_out.get(a) == null) return error.SkipZigTest; // without libjpeg-turbo the call refuses before the lock + // a worker start would refuse with "could not be started", never Cancelled + const saved = worker.server_exe; + defer worker.server_exe = saved; + worker.server_exe = "/nonexistent/tensorfold-native"; + var budget: Budget = .{}; + var cx: Cx = .{ .a = a }; + var left: Probe = .{ .left = true }; + try std.testing.expectError(error.Cancelled, renderPages(&cx, minimal_two_page_pdf, .{ .all_within = 16 }, ocrCaps(16), &budget, &left)); + try std.testing.expectEqual(@as(u32, 1), left.calls); + try std.testing.expect(left.held); // asked with the renderer held: after the wait, before any worker + try std.testing.expectEqual(Budget{}, budget); + try std.testing.expectEqualStrings("", cx.message); + // a client still there, and chat's null probe (whose error set stays Refused), take the same path past the check + comptime std.debug.assert(RenderError(@TypeOf(null)) == errors.Refused); + var here: Probe = .{ .left = false }; + var here_cx: Cx = .{ .a = a }; + var chat_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, renderPages(&here_cx, minimal_two_page_pdf, .{ .all_within = 16 }, chatCaps(4), &budget, &here)); + try std.testing.expectError(error.Refused, renderPages(&chat_cx, minimal_two_page_pdf, .{ .all_within = 16 }, chatCaps(4), &budget, null)); + try std.testing.expectEqual(@as(u32, 1), here.calls); + try std.testing.expectEqualStrings(chat_cx.message, here_cx.message); + try std.testing.expectEqual(chat_cx.kind, here_cx.kind); + try std.testing.expectEqual(Budget{}, budget); +} diff --git a/zig/src/server/pdf_measure_test.zig b/zig/src/server/pdf_measure_test.zig new file mode 100644 index 00000000000..1883bfc65c0 --- /dev/null +++ b/zig/src/server/pdf_measure_test.zig @@ -0,0 +1,94 @@ +//! Measured PDF pages (Job.measure): each selected page's size and DPI without a bitmap or a JPEG, as OCR plans them. +const std = @import("std"); +const builtin = @import("builtin"); +const errors = @import("errors.zig"); +const jpeg_out = @import("jpeg_out.zig"); +const log = @import("log.zig"); +const pdf = @import("pdf.zig"); +const worker = @import("pdf_worker.zig"); +const Cx = errors.Cx; +const t = std.testing; + +/// `sel` of the two-page fixture in this process, measured or rendered; skips without PDFium or libjpeg-turbo. +fn fixture(cx: *Cx, sel: pdf.Selection, caps: pdf.Caps, budget: *pdf.Budget, measure: bool) !pdf.Rendered { + log.init(t.io, false); + const jf = jpeg_out.get(cx.a) orelse return error.SkipZigTest; + const f = jpeg_out.loadDynLib(pdf.PdfiumFns, .pdfium, cx.a) orelse return error.SkipZigTest; + f.FPDF_InitLibrary(); // a test runner cannot be the worker (pdf_worker_test.zig measures through it) + var pages: std.ArrayList(pdf.Page) = .empty; + const job: pdf.Job = .{ .pdf_bytes = pdf.minimal_two_page_pdf, .sel = sel, .caps = caps, .deadline_ns = std.Io.Clock.awake.now(log.io()).toNanoseconds() + pdf.render_timeout_ns, .measure = measure }; + const total = try pdf.renderInProcess(cx, f, jf, job, budget, &pages); + return .{ .pages = pages.items, .total = total }; +} + +test "pdf measure: both pages' sizes and DPI equal a real render's, with no JPEG bytes and no bytes charged" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + var cx: Cx = .{ .a = arena.allocator() }; + var measured_budget: pdf.Budget = .{}; + var rendered_budget: pdf.Budget = .{}; + const measured = try fixture(&cx, .{ .all_within = 16 }, pdf.ocrCaps(16), &measured_budget, true); + const rendered = try fixture(&cx, .{ .all_within = 16 }, pdf.ocrCaps(16), &rendered_budget, false); + try t.expectEqual(@as(u32, 2), measured.total); + try t.expectEqual(@as(usize, 2), measured.pages.len); + for (measured.pages, rendered.pages) |m, r| { + try t.expectEqual(@as(usize, 0), m.jpeg.len); + try t.expectEqual(pdf.Page{ .index = r.index, .jpeg = m.jpeg, .width = r.width, .height = r.height, .dpi = r.dpi }, m); + try t.expectEqual([2]u32{ m.width, m.height }, pdf.jpegSize(r.jpeg).?); + } + try t.expectEqual(pdf.Budget{ .images_used = 2, .pdf_pages_used = 2, .encoded_bytes = 0, .pixels_used = rendered_budget.pixels_used }, measured_budget); +} + +/// Expects `sel` of the fixture refused, measured or rendered; a missing library still skips the test. +fn expectRefused(cx: *Cx, sel: pdf.Selection, budget: *pdf.Budget, measure: bool) !void { + if (fixture(cx, sel, pdf.ocrCaps(16), budget, measure)) |_| return error.TestUnexpectedResult else |e| switch (e) { + error.Refused => {}, + else => return e, + } +} + +test "pdf measure: a selection over the page budget is refused whole, as a render refuses it" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + for ([_]bool{ true, false }) |measure| { + var cx: Cx = .{ .a = a }; + var budget: pdf.Budget = .{}; + try expectRefused(&cx, .{ .all_within = 1 }, &budget, measure); + try t.expectEqualStrings("a PDF may have at most 1 pages (--vision-max-images, TENSORFOLD_MAX_PDF_PAGES); this request has 2", cx.message); + try t.expectEqual(pdf.Budget{}, budget); + var out_cx: Cx = .{ .a = a }; + try expectRefused(&out_cx, .{ .list = &.{ 0, 2 } }, &budget, measure); + try t.expectEqualStrings("page 2 is out of range; the document has 2 pages", out_cx.message); + } +} + +test "pdf measure: a worker frame without JPEG bytes passes only for a measure, and one with them only for a render" { + if (comptime builtin.os.tag == .windows) return error.SkipZigTest; // the worker is POSIX only; Windows renders in process + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + // first(1) of a two-page document: page 0 at 400 x 400 and 144 DPI, its JPEG length 0 + const sized = [_]u8{ 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0x90, 1, 0, 0, 0x90, 1, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0 }; + var budget: pdf.Budget = .{}; + var pages: std.ArrayList(pdf.Page) = .empty; + var cx: Cx = .{ .a = a }; + try t.expectEqual(@as(u32, 2), try worker.parseChildReply(&cx, &sized, .{ .first = 1 }, true, pdf.ocrCaps(4), &budget, &pages)); + try t.expectEqual(pdf.Page{ .index = 0, .jpeg = pages.items[0].jpeg, .width = 400, .height = 400, .dpi = 144 }, pages.items[0]); + try t.expectEqual(@as(usize, 0), pages.items[0].jpeg.len); + try t.expectEqual(pdf.Budget{ .images_used = 1, .pdf_pages_used = 1, .pixels_used = 400 * 400 }, budget); + // the same frame for a render is a renderer failure of the caller's kind, and leaves the budget alone + for ([_]pdf.Caps{ pdf.ocrCaps(4), pdf.chatCaps(4) }) |caps| { + var render_cx: Cx = .{ .a = a }; + var fresh: pdf.Budget = .{}; + try t.expectError(error.Refused, worker.parseChildReply(&render_cx, &sized, .{ .first = 1 }, false, caps, &fresh, &pages)); + try t.expectEqual(caps.infra, render_cx.kind); + try t.expectEqual(pdf.Budget{}, fresh); + } + // a page with bytes in a measure's frame is refused too + const with_bytes = [_]u8{ 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0x90, 1, 0, 0, 0x90, 1, 0, 0, 144, 0, 0, 0, 1, 0, 0, 0, 0xFF }; + var bytes_cx: Cx = .{ .a = a }; + var fresh: pdf.Budget = .{}; + try t.expectError(error.Refused, worker.parseChildReply(&bytes_cx, &with_bytes, .{ .first = 1 }, true, pdf.ocrCaps(4), &fresh, &pages)); + try t.expectEqual(errors.Kind.server, bytes_cx.kind); +} diff --git a/zig/src/server/pdf_worker.zig b/zig/src/server/pdf_worker.zig index 099b751a447..f897a5999c2 100644 --- a/zig/src/server/pdf_worker.zig +++ b/zig/src/server/pdf_worker.zig @@ -3,12 +3,12 @@ const std = @import("std"); const builtin = @import("builtin"); const sys = @import("sys"); const errors = @import("errors.zig"); -const images = @import("images.zig"); const log = @import("log.zig"); const pdf = @import("pdf.zig"); const jpeg_out = @import("jpeg_out.zig"); const Cx = errors.Cx; const Budget = pdf.Budget; +const Page = pdf.Page; const Allocator = std.mem.Allocator; /// The hidden argument that makes tensorfold-native run only the PDF render worker (main.zig). @@ -16,9 +16,28 @@ pub const arg = "--pdf-render-worker"; /// The binary started as the worker when set: tests name the server binary, since a test runner cannot be the worker. pub var server_exe: ?[]const u8 = null; const failed = "PDF rendering exceeded resource limits or failed"; +/// Reply: 0, count, total, per page index, width, height, dpi, length (u32s) and JPEG; 1, kind, length, message; 2. +const page_head = 5 * 4; // a page's five u32s +/// The most page indices a selection list may send the worker. +const max_list: u32 = 1 << 16; -/// The parent's request on the worker's stdin, ahead of the PDF bytes; both ends are the same build. -const Request = extern struct { remaining_ns: u64, encoded_bytes: u64, pixels_used: u64, pdf_len: u64, max_images: u32, max_pages: u32, images_used: u32, pdf_pages_used: u32 }; +/// The parent's request on the worker's stdin, ahead of a list selection's indices and the PDF bytes; same build. +const Request = extern struct { + remaining_ns: u64, + encoded_bytes: u64, + pixels_used: u64, + pdf_len: u64, + request_pixels: u64, + request_bytes: u64, + page_bytes: u64, + max_images: u32, + images_used: u32, + pdf_pages_used: u32, + sel_kind: u32, // pdf.Selection's tag + sel_n: u32, // all_within's or first's count, or the list's length + infra: u32, // caps.infra + measure: u32, // 1: job.measure, sizes without bitmaps or JPEGs +}; /// This executable and the hidden argument; Linux's /proc/self/exe still names the running file once it is replaced. pub fn argv(a: Allocator) ![]const []const u8 { @@ -26,41 +45,64 @@ pub fn argv(a: Allocator) ![]const []const u8 { return a.dupe([]const u8, &.{ exe, arg }); } -/// Renders `pdf_bytes` in a fresh worker started from `cmd`, killed at `deadline_ns`, and checks its reply. -pub fn render(cx: *Cx, cmd: []const []const u8, pdf_bytes: []const u8, max_images: u32, max_pages: u32, deadline_ns: i96, budget: *Budget, out_jpegs: *std.ArrayList([]const u8)) errors.Refused!void { +/// Renders `job` in a fresh worker started from `cmd`, killed at its deadline; returns the document's page count. +pub fn render(cx: *Cx, cmd: []const []const u8, job: pdf.Job, budget: *Budget, out: *std.ArrayList(Page)) errors.Refused!u32 { + const infra = job.caps.infra; + const list: []const u32 = if (job.sel == .list) job.sel.list else &.{}; + if (list.len > max_list) return cx.fail(.request, "a PDF page selection may name at most {d} pages", .{max_list}); const io = log.io(); - var child = std.process.spawn(io, .{ .argv = cmd, .stdin = .pipe, .stdout = .pipe }) catch return cx.refuse("PDF rendering worker process could not be started"); + var child = std.process.spawn(io, .{ .argv = cmd, .stdin = .pipe, .stdout = .pipe }) catch return cx.fail(infra, "PDF rendering worker process could not be started", .{}); defer if (child.id) |pid| { std.posix.kill(pid, .KILL) catch {}; _ = child.wait(io) catch {}; }; - const left = deadline_ns - std.Io.Clock.awake.now(io).toNanoseconds(); - const req: Request = .{ .remaining_ns = @intCast(@max(0, left)), .encoded_bytes = budget.encoded_bytes, .pixels_used = budget.pixels_used, .pdf_len = pdf_bytes.len, .max_images = max_images, .max_pages = max_pages, .images_used = budget.images_used, .pdf_pages_used = budget.pdf_pages_used }; + const left = job.deadline_ns - std.Io.Clock.awake.now(io).toNanoseconds(); + const n: u32 = switch (job.sel) { + .all_within, .first => |k| k, + .list => |l| @intCast(l.len), + }; + const req: Request = .{ + .remaining_ns = @intCast(@max(0, left)), + .encoded_bytes = budget.encoded_bytes, + .pixels_used = budget.pixels_used, + .pdf_len = job.pdf_bytes.len, + .request_pixels = job.caps.request_pixels, + .request_bytes = job.caps.request_bytes, + .page_bytes = job.caps.page_bytes, + .max_images = job.caps.max_images, + .images_used = budget.images_used, + .pdf_pages_used = budget.pdf_pages_used, + .sel_kind = @backingInt(std.meta.activeTag(job.sel)), + .sel_n = n, + .infra = @backingInt(infra), + .measure = @intFromBool(job.measure), + }; const in = child.stdin.?.handle; const nonblock: u32 = @bitCast(std.c.O{ .NONBLOCK = true }); _ = std.c.fcntl(in, std.c.F.SETFL, std.c.fcntl(in, std.c.F.GETFL) | @as(c_int, @bitCast(nonblock))); - _ = sendAll(in, std.mem.asBytes(&req), deadline_ns) and sendAll(in, pdf_bytes, deadline_ns); + _ = sendAll(in, std.mem.asBytes(&req), job.deadline_ns) and sendAll(in, std.mem.sliceAsBytes(list), job.deadline_ns) and sendAll(in, job.pdf_bytes, job.deadline_ns); child.stdin.?.close(io); child.stdin = null; - const frame = readChildPipe(cx.a, child.stdout.?.handle, deadline_ns, images.max_request_bytes + (64 << 10)) catch |err| switch (err) { + const frame = readChildPipe(cx.a, child.stdout.?.handle, job.deadline_ns, job.caps.request_bytes +| (1 << 20)) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, - error.Timeout => return cx.refuse("PDF rendering timed out"), - error.Overflow => return cx.refuse("the request's images exceed 20 MB encoded"), + error.Timeout => return cx.fail(infra, "PDF rendering timed out", .{}), + // chat keeps its byte-limit message; under OCR an oversized reply is a renderer failure + error.Overflow => return if (infra == .request) cx.fail(infra, "the request's images exceed {d} MB encoded", .{job.caps.request_bytes >> 20}) else cx.fail(infra, failed, .{}), }; - const term = child.wait(io) catch return cx.refuse(failed); - return reply(cx, term, frame, max_images, max_pages, budget, out_jpegs); + const term = child.wait(io) catch return cx.fail(infra, failed, .{}); + return reply(cx, term, frame, job.sel, job.measure, job.caps, budget, out); } /// A worker the kernel stopped at a limit keeps the limit message; any other signal is named as a crash. -fn reply(cx: *Cx, term: std.process.Child.Term, frame: []const u8, max_images: u32, max_pages: u32, budget: *Budget, out_jpegs: *std.ArrayList([]const u8)) errors.Refused!void { +fn reply(cx: *Cx, term: std.process.Child.Term, frame: []const u8, sel: pdf.Selection, measure: bool, caps: pdf.Caps, budget: *Budget, out: *std.ArrayList(Page)) errors.Refused!u32 { if (term == .signal) switch (term.signal) { - .KILL, .XCPU, .XFSZ => return cx.refuse(failed), + .KILL, .XCPU, .XFSZ => return cx.fail(caps.infra, failed, .{}), else => |sig| if (std.enums.tagName(std.posix.SIG, sig)) |name| - return cx.fail(.request, "the PDF render worker crashed (SIG{s})", .{name}) + return cx.fail(caps.infra, "the PDF render worker crashed (SIG{s})", .{name}) else - return cx.fail(.request, "the PDF render worker crashed (signal {d})", .{@backingInt(sig)}), + return cx.fail(caps.infra, "the PDF render worker crashed (signal {d})", .{@backingInt(sig)}), }; - return parseChildReply(cx, frame, max_images, max_pages, budget, out_jpegs); + return parseChildReply(cx, frame, sel, measure, caps, budget, out); } fn ready(fd: c_int, events: i16, deadline_ns: i96) bool { @@ -97,49 +139,52 @@ fn readChildPipe(a: Allocator, fd: c_int, deadline_ns: i96, max_bytes: usize) er return out.items; } -pub fn parseChildReply(cx: *Cx, frame: []const u8, max_images: u32, max_pages: u32, budget: *Budget, out_jpegs: *std.ArrayList([]const u8)) errors.Refused!void { - if (frame.len == 0) return cx.refuse(failed); +fn readU32(bytes: []const u8, at: usize) u32 { + return std.mem.readInt(u32, bytes[at..][0..4], .little); +} + +/// Checks the frame against `sel`, `caps` and the running `budget`, appends its pages; a measure's pages carry no JPEG. +pub fn parseChildReply(cx: *Cx, frame: []const u8, sel: pdf.Selection, measure: bool, caps: pdf.Caps, budget: *Budget, out: *std.ArrayList(Page)) errors.Refused!u32 { + if (frame.len == 0) return cx.fail(caps.infra, failed, .{}); switch (frame[0]) { 0 => { - if (frame.len < 5) return cx.refuse(failed); - const count = std.mem.readInt(u32, frame[1..5], .little); - if (count == 0) return cx.refuse("PDF document contains no pages"); - const limit: u32 = @max(@as(u32, 1), max_pages); - if (budget.pdf_pages_used +| count > limit) - return cx.refuse(try std.fmt.allocPrint(cx.a, "a PDF may have at most {d} pages (--vision-max-images, TENSORFOLD_MAX_PDF_PAGES); this request has {d}", .{ limit, budget.pdf_pages_used +| count })); - if (max_images > 0 and budget.images_used +| count > max_images) - return cx.refuse(try std.fmt.allocPrint(cx.a, "a request may hold at most {d} images (--vision-max-images); it has {d}", .{ max_images, budget.images_used +| count })); - var pos: usize = 5; - for (0..count) |_| { - if (pos + 4 > frame.len) return cx.refuse(failed); - const len: usize = std.mem.readInt(u32, frame[pos..][0..4], .little); - pos += 4; - if (len == 0 or pos + len > frame.len) return cx.refuse(failed); - if (len > images.max_image_bytes) return cx.refuse("rendered PDF page exceeds the 10 MB image byte limit"); - if (budget.encoded_bytes + len > images.max_request_bytes) return cx.refuse("the request's images exceed 20 MB encoded"); + if (frame.len < 9) return cx.fail(caps.infra, failed, .{}); + const count = readU32(frame, 1); + const total = readU32(frame, 5); + if (count > total or count != try pdf.admitCount(cx, sel, caps, budget, total)) return cx.fail(caps.infra, failed, .{}); + var pos: usize = 9; + for (0..count) |k| { + if (frame.len - pos < page_head) return cx.fail(caps.infra, failed, .{}); + const index, const width, const height, const dpi, const len = .{ readU32(frame, pos), readU32(frame, pos + 4), readU32(frame, pos + 8), readU32(frame, pos + 12), readU32(frame, pos + 16) }; + pos += page_head; + if (index != pdf.pageAt(sel, @intCast(k)) or dpi == 0 or dpi > pdf.max_dpi or (len == 0) != measure or frame.len - pos < len) + return cx.fail(caps.infra, failed, .{}); const jb = frame[pos .. pos + len]; - const size = pdf.jpegSize(jb) orelse return cx.refuse("rendered PDF page could not be encoded as JPEG"); - const px = @as(u64, size[0]) * size[1]; - if (budget.pixels_used + px > pdf.max_request_pixels) return cx.refuse("the request's images exceed the 32-megapixel limit"); - budget.pdf_pages_used += 1; - budget.images_used += 1; - budget.encoded_bytes += len; - budget.pixels_used += px; - try out_jpegs.append(cx.a, jb); + if (!measure) { + const size = pdf.jpegSize(jb) orelse return cx.fail(caps.infra, "rendered PDF page could not be encoded as JPEG", .{}); + if (size[0] != width or size[1] != height) return cx.fail(caps.infra, failed, .{}); + } + if (@min(width, height) < pdf.min_side or @max(width, height) > pdf.max_side) return cx.fail(caps.infra, failed, .{}); + const px = @as(u64, width) * height; + try pdf.checkPage(cx, caps, budget, px, len); + budget.add(px, len); + try out.append(cx.a, .{ .index = index, .jpeg = jb, .width = width, .height = height, .dpi = dpi }); pos += len; } - if (pos != frame.len) return cx.refuse(failed); + if (pos != frame.len) return cx.fail(caps.infra, failed, .{}); + return total; }, 1 => { - if (frame.len < 6) return cx.refuse("PDF rendering failed"); - cx.kind = std.enums.fromInt(errors.Kind, frame[1]) orelse .request; - const len: usize = std.mem.readInt(u32, frame[2..6], .little); - if (6 + len != frame.len) return cx.refuse("PDF rendering failed"); + if (frame.len < 6) return cx.fail(caps.infra, "PDF rendering failed", .{}); + const kind = std.enums.fromInt(errors.Kind, frame[1]) orelse return cx.fail(caps.infra, "PDF rendering failed", .{}); + const len: usize = readU32(frame, 2); + if (6 + len != frame.len) return cx.fail(caps.infra, "PDF rendering failed", .{}); + cx.kind = kind; cx.message = frame[6 .. 6 + len]; return error.Refused; }, 2 => return error.OutOfMemory, - else => return cx.refuse(failed), + else => return cx.fail(caps.infra, failed, .{}), } } @@ -148,13 +193,14 @@ pub fn serve() noreturn { closeRange(3, ~@as(c_uint, 0)); var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); var cx: Cx = .{ .a = arena.allocator() }; - var jpegs: std.ArrayList([]const u8) = .empty; - if (work(&cx, &jpegs)) |_| { + var pages: std.ArrayList(Page) = .empty; + if (work(&cx, &pages)) |total| { _ = writeAll(1, &.{0}); - _ = writeInt(u32, 1, @intCast(jpegs.items.len)); - for (jpegs.items) |jb| { - _ = writeInt(u32, 1, @intCast(jb.len)); - _ = writeAll(1, jb); + _ = writeInt(u32, 1, @intCast(pages.items.len)); + _ = writeInt(u32, 1, total); + for (pages.items) |p| { + for ([_]u32{ p.index, p.width, p.height, p.dpi, @intCast(p.jpeg.len) }) |v| _ = writeInt(u32, 1, v); + _ = writeAll(1, p.jpeg); } } else |err| switch (err) { error.OutOfMemory => _ = writeAll(1, &.{2}), @@ -167,19 +213,34 @@ pub fn serve() noreturn { std.c._exit(0); } -fn work(cx: *Cx, jpegs: *std.ArrayList([]const u8)) errors.Refused!void { +fn work(cx: *Cx, pages: *std.ArrayList(Page)) errors.Refused!u32 { var req: Request = undefined; if (!readAll(0, std.mem.asBytes(&req)) or req.pdf_len > pdf.max_pdf_bytes) return cx.refuse(failed); const deadline_ns = std.Io.Clock.awake.now(log.io()).toNanoseconds() + req.remaining_ns; + const infra = std.enums.fromInt(errors.Kind, req.infra) orelse return cx.refuse(failed); + const Tag = std.meta.Tag(pdf.Selection); + const sel: pdf.Selection = switch (req.sel_kind) { + @backingInt(Tag.all_within) => .{ .all_within = req.sel_n }, + @backingInt(Tag.first) => .{ .first = req.sel_n }, + @backingInt(Tag.list) => blk: { + if (req.sel_n > max_list) return cx.fail(infra, failed, .{}); + const list = try cx.a.alloc(u32, req.sel_n); + if (!readAll(0, std.mem.sliceAsBytes(list))) return cx.fail(infra, failed, .{}); + break :blk .{ .list = list }; + }, + else => return cx.fail(infra, failed, .{}), + }; const pdf_bytes = try cx.a.alloc(u8, @intCast(req.pdf_len)); - if (!readAll(0, pdf_bytes)) return cx.refuse(failed); + if (!readAll(0, pdf_bytes)) return cx.fail(infra, failed, .{}); applyChildLimits(); const libs = sys.optional_libraries; const f = jpeg_out.loadDynLib(pdf.PdfiumFns, .pdfium, cx.a) orelse return cx.fail(.unimplemented, "{s}", .{libs.spec(.pdfium).message}); const jf = jpeg_out.loadDynLib(jpeg_out.Fns, .jpeg, cx.a) orelse return cx.fail(.unimplemented, "{s}", .{libs.spec(.jpeg).message}); f.FPDF_InitLibrary(); + const caps: pdf.Caps = .{ .request_pixels = req.request_pixels, .request_bytes = @intCast(req.request_bytes), .page_bytes = @intCast(req.page_bytes), .max_images = req.max_images, .infra = infra }; var budget: Budget = .{ .images_used = req.images_used, .pdf_pages_used = req.pdf_pages_used, .encoded_bytes = @intCast(req.encoded_bytes), .pixels_used = req.pixels_used }; - return pdf.renderInProcess(cx, f, jf, pdf_bytes, req.max_images, req.max_pages, deadline_ns, &budget, jpegs); + if (req.measure > 1) return cx.fail(infra, failed, .{}); + return pdf.renderInProcess(cx, f, jf, .{ .pdf_bytes = pdf_bytes, .sel = sel, .caps = caps, .deadline_ns = deadline_ns, .measure = req.measure == 1 }, &budget, pages); } fn applyChildLimits() void { @@ -239,15 +300,21 @@ fn writeInt(comptime T: type, fd: c_int, val: T) bool { return writeAll(fd, &b); } -fn fakeWorker(a: Allocator, script: []const u8, ms: i96) ![]const u8 { +/// A refused render of the two-page fixture by a `script` worker under `caps`, within `ms`; the budget stays untouched. +fn fakeWorkerCx(a: Allocator, script: []const u8, ms: i96, caps: pdf.Caps) !Cx { log.init(std.testing.io, false); var cx: Cx = .{ .a = a }; var budget: Budget = .{}; - var jpegs: std.ArrayList([]const u8) = .empty; + var pages: std.ArrayList(Page) = .empty; const deadline_ns = std.Io.Clock.awake.now(log.io()).toNanoseconds() + ms * std.time.ns_per_ms; - try std.testing.expectError(error.Refused, render(&cx, &.{ "/bin/sh", "-c", script }, pdf.minimal_two_page_pdf, 4, 4, deadline_ns, &budget, &jpegs)); + const job: pdf.Job = .{ .pdf_bytes = pdf.minimal_two_page_pdf, .sel = .{ .all_within = 4 }, .caps = caps, .deadline_ns = deadline_ns }; + try std.testing.expectError(error.Refused, render(&cx, &.{ "/bin/sh", "-c", script }, job, &budget, &pages)); try std.testing.expectEqual(Budget{}, budget); - return cx.message; + return cx; +} + +fn fakeWorker(a: Allocator, script: []const u8, ms: i96) ![]const u8 { + return (try fakeWorkerCx(a, script, ms, pdf.chatCaps(4))).message; } test "PDF render worker: a worker killed by a signal is named as a crash; a limit or a missing reply keeps today's message" { @@ -262,8 +329,8 @@ test "PDF render worker: a worker killed by a signal is named as a crash; a limi for ([_]std.process.Child.Term{ .{ .signal = .KILL }, .{ .signal = .XCPU }, .{ .signal = .XFSZ }, .{ .signal = .ABRT } }) |term| { var cx: Cx = .{ .a = a }; var budget: Budget = .{}; - var jpegs: std.ArrayList([]const u8) = .empty; - try std.testing.expectError(error.Refused, reply(&cx, term, &.{ 0, 0, 0, 0, 0 }, 4, 4, &budget, &jpegs)); + var pages: std.ArrayList(Page) = .empty; + try std.testing.expectError(error.Refused, reply(&cx, term, &.{ 0, 0, 0, 0, 0 }, .{ .all_within = 4 }, false, pdf.chatCaps(4), &budget, &pages)); try std.testing.expectEqualStrings(if (term.signal == .ABRT) "the PDF render worker crashed (SIGABRT)" else failed, cx.message); } } @@ -276,3 +343,37 @@ test "PDF render worker: a worker past its deadline is killed and reported as ti try std.testing.expectEqualStrings("PDF rendering timed out", try fakeWorker(arena.allocator(), "exec sleep 30", 300)); try std.testing.expect(std.Io.Clock.awake.now(log.io()).toNanoseconds() - started < 10 * std.time.ns_per_s); } + +test "pdf pages: a malformed worker frame, a crash or an oversized reply is a renderer failure of the caller's kind" { + if (comptime builtin.os.tag == .windows) return error.SkipZigTest; // the worker is POSIX only; Windows renders in process + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var budget: Budget = .{}; + var pages: std.ArrayList(Page) = .empty; + const ocr = pdf.ocrCaps(4); + const index_wrong = [_]u8{ 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 28, 0, 0, 0, 144, 0, 0, 0, 1, 0, 0, 0, 0xFF }; + const sof = [_]u8{ 0xFF, 0xD8, 0xFF, 0xC0, 0, 11, 8, 0x10, 0, 0x10, 0, 1, 1, 0x11, 0 }; // a 4096 x 4096 frame header + const too_big = [_]u8{ 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0, 0x10, 0, 0, 144, 0, 0, 0, sof.len, 0, 0, 0 } ++ sof; + const bad_kind = [_]u8{ 1, 0xFF, 3, 0, 0, 0, 'b', 'a', 'd' }; + const frames = [_][]const u8{ &.{}, &.{ 0, 1 }, &.{ 1, 0 }, &.{ 0, 1, 0, 0, 0, 2, 0, 0, 0 }, &index_wrong, &.{9}, &bad_kind }; + for ([_]pdf.Caps{ ocr, pdf.chatCaps(4) }) |caps| { + for (frames) |frame| { + var cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, parseChildReply(&cx, frame, .{ .first = 2 }, false, caps, &budget, &pages)); + try std.testing.expectEqual(caps.infra, cx.kind); + } + var cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, parseChildReply(&cx, &too_big, .{ .first = 1 }, false, caps, &budget, &pages)); + try std.testing.expectEqual(caps.infra, cx.kind); + // a crash, and a reply past the caps' encoded bytes, are the caller's kind too + try std.testing.expectEqual(caps.infra, (try fakeWorkerCx(a, "cat >/dev/null; kill -SEGV $$", 10_000, caps)).kind); + } + const over = try fakeWorkerCx(a, "cat >/dev/null; head -c 2000000 /dev/zero", 10_000, pdf.ocrCaps(0)); + try std.testing.expectEqualStrings(failed, over.message); + try std.testing.expectEqual(errors.Kind.server, over.kind); + try std.testing.expectEqual(Budget{}, budget); + try std.testing.expectEqual(@as(usize, 0), pages.items.len); + var oom_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.OutOfMemory, parseChildReply(&oom_cx, &.{2}, .{ .first = 2 }, false, ocr, &budget, &pages)); +} diff --git a/zig/src/server/pdf_worker_test.zig b/zig/src/server/pdf_worker_test.zig index 446f093a483..da210c97bd8 100644 --- a/zig/src/server/pdf_worker_test.zig +++ b/zig/src/server/pdf_worker_test.zig @@ -16,6 +16,11 @@ fn useServer() void { worker.server_exe = @import("pdf_worker_exe").path; } +/// One render of `pdf_bytes` by the render deadline. +fn job(pdf_bytes: []const u8, sel: pdf.Selection, caps: pdf.Caps) pdf.Job { + return .{ .pdf_bytes = pdf_bytes, .sel = sel, .caps = caps, .deadline_ns = std.Io.Clock.awake.now(std.testing.io).toNanoseconds() + pdf.render_timeout_ns }; +} + fn expectMissingLibrary(cx: Cx) !void { const libs = sys.optional_libraries; try std.testing.expectEqual(errors.Kind.unimplemented, cx.kind); @@ -29,15 +34,15 @@ test "tensorfold-native PDF render worker: renders a text PDF in its spawned wor const a = arena.allocator(); var cx: Cx = .{ .a = a }; var budget: pdf.Budget = .{}; - var jpegs: std.ArrayList([]const u8) = .empty; - const deadline_ns = std.Io.Clock.awake.now(std.testing.io).toNanoseconds() + pdf.render_timeout_ns; - worker.render(&cx, try worker.argv(a), text_pdf, 4, 4, deadline_ns, &budget, &jpegs) catch |err| { + var pages: std.ArrayList(pdf.Page) = .empty; + const total = worker.render(&cx, try worker.argv(a), job(text_pdf, .{ .all_within = 4 }, pdf.chatCaps(4)), &budget, &pages) catch |err| { try std.testing.expectEqual(error.Refused, err); return expectMissingLibrary(cx); }; - try std.testing.expectEqual(@as(usize, 1), jpegs.items.len); - try std.testing.expectEqual(pdf.Budget{ .images_used = 1, .pdf_pages_used = 1, .encoded_bytes = jpegs.items[0].len, .pixels_used = 400 * 400 }, budget); - try std.testing.expectEqual([2]u32{ 400, 400 }, pdf.jpegSize(jpegs.items[0]).?); + try std.testing.expectEqual(@as(u32, 1), total); + try std.testing.expectEqual(@as(usize, 1), pages.items.len); + try std.testing.expectEqual(pdf.Budget{ .images_used = 1, .pdf_pages_used = 1, .encoded_bytes = pages.items[0].jpeg.len, .pixels_used = 400 * 400 }, budget); + try std.testing.expectEqual([2]u32{ 400, 400 }, pdf.jpegSize(pages.items[0].jpeg).?); } test "tensorfold-native PDF render worker: libpdfium renders in the spawned worker and enforces request-wide page, byte and pixel caps" { @@ -65,3 +70,74 @@ test "tensorfold-native PDF render worker: libpdfium renders in the spawned work try std.testing.expectError(error.Refused, pdf.expandBytes(&second_cx, pdf.minimal_two_page_pdf, "image_url", 4, 3, &budget, &parts)); try std.testing.expect(std.mem.indexOf(u8, second_cx.message, "at most 3 pages") != null); } + +test "tensorfold-native PDF render worker: a list selection renders only its pages, with their indices, size and DPI" { + useServer(); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var cx: Cx = .{ .a = a }; + var budget: pdf.Budget = .{}; + var pages: std.ArrayList(pdf.Page) = .empty; + const total = worker.render(&cx, try worker.argv(a), job(pdf.minimal_two_page_pdf, .{ .list = &.{1} }, pdf.ocrCaps(16)), &budget, &pages) catch |err| { + try std.testing.expectEqual(error.Refused, err); + return expectMissingLibrary(cx); + }; + try std.testing.expectEqual(@as(u32, 2), total); + try std.testing.expectEqual(@as(usize, 1), pages.items.len); + const p = pages.items[0]; + try std.testing.expectEqual(pdf.Page{ .index = 1, .jpeg = p.jpeg, .width = 400, .height = 400, .dpi = 144 }, p); + var out_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, worker.render(&out_cx, try worker.argv(a), job(pdf.minimal_two_page_pdf, .{ .list = &.{ 0, 2 } }, pdf.ocrCaps(16)), &budget, &pages)); + try std.testing.expectEqualStrings("page 2 is out of range; the document has 2 pages", out_cx.message); + try std.testing.expectEqual(errors.Kind.request, out_cx.kind); +} + +test "tensorfold-native PDF render worker: two chat PDFs share one request budget" { + useServer(); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var parts: std.ArrayList(Value) = .empty; + var budget: pdf.Budget = .{}; + for (0..2) |_| { + var cx: Cx = .{ .a = a }; + pdf.expandBytes(&cx, pdf.minimal_two_page_pdf, "image_url", 4, 4, &budget, &parts) catch |err| { + if (err == error.Refused and cx.kind == .unimplemented) return expectMissingLibrary(cx); + return err; + }; + } + try std.testing.expectEqual(@as(usize, 4), parts.items.len); + try std.testing.expectEqual(@as(u32, 4), budget.pdf_pages_used); + try std.testing.expectEqual(@as(u64, 4 * 400 * 400), budget.pixels_used); + var pages_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, pdf.expandBytes(&pages_cx, pdf.minimal_two_page_pdf, "image_url", 4, 4, &budget, &parts)); + try std.testing.expectEqualStrings("a PDF may have at most 4 pages (--vision-max-images, TENSORFOLD_MAX_PDF_PAGES); this request has 6", pages_cx.message); + var images_cx: Cx = .{ .a = a }; + try std.testing.expectError(error.Refused, pdf.expandBytes(&images_cx, pdf.minimal_two_page_pdf, "image_url", 4, 8, &budget, &parts)); + try std.testing.expectEqualStrings("a request may hold at most 4 images (--vision-max-images); it has 6", images_cx.message); + try std.testing.expectEqual(@as(usize, 4), parts.items.len); +} + +test "tensorfold-native PDF render worker: a measure returns each page's size and DPI with no JPEG bytes" { + useServer(); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var cx: Cx = .{ .a = a }; + var budget: pdf.Budget = .{}; + var pages: std.ArrayList(pdf.Page) = .empty; + var measure = job(pdf.minimal_two_page_pdf, .{ .all_within = 16 }, pdf.ocrCaps(16)); + measure.measure = true; + const total = worker.render(&cx, try worker.argv(a), measure, &budget, &pages) catch |err| { + try std.testing.expectEqual(error.Refused, err); + return expectMissingLibrary(cx); + }; + try std.testing.expectEqual(@as(u32, 2), total); + try std.testing.expectEqual(@as(usize, 2), pages.items.len); + for (pages.items, 0..) |p, i| { + try std.testing.expectEqual(@as(usize, 0), p.jpeg.len); + try std.testing.expectEqual(pdf.Page{ .index = @intCast(i), .jpeg = p.jpeg, .width = 400, .height = 400, .dpi = 144 }, p); + } + try std.testing.expectEqual(pdf.Budget{ .images_used = 2, .pdf_pages_used = 2, .pixels_used = 2 * 400 * 400 }, budget); +} diff --git a/zig/src/server/prompt.zig b/zig/src/server/prompt.zig index 763a683e4b9..a4c224a59d7 100644 --- a/zig/src/server/prompt.zig +++ b/zig/src/server/prompt.zig @@ -49,7 +49,7 @@ pub fn renderStarts(srv: *Server, cx: *Cx, messages: Value, tools: []const Value .tools = if (tools.len > 0) Value{ .array = @constCast(tools) } else null, .add_generation_prompt = generation, .enable_thinking = thinking, - .reasoning_effort = if (thinking) effort else cx.named_effort, // off: only an effort the request named + .reasoning_effort = if (thinking) effort else cx.named_effort orelse srv.off_effort, .clear_thinking = cx.clear_thinking, .tool_choice = cx.template_fields.get("tool_choice"), .response_format = cx.template_fields.get("response_format"), diff --git a/zig/src/server/recipient_cut_test.zig b/zig/src/server/recipient_cut_test.zig new file mode 100644 index 00000000000..6b619a25a0f --- /dev/null +++ b/zig/src/server/recipient_cut_test.zig @@ -0,0 +1,69 @@ +//! A recipient reply max_tokens cuts inside a call message: its cut call, whole and streamed, as #1299's GLM call. +const std = @import("std"); +const harness = @import("recipient_reply_test.zig"); +const Text = harness.Text; + +const head = "{\"model\":\"test-model\",\"messages\":[{\"role\":\"user\",\"content\":\"x\"}]," ++ + "\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"write_file\",\"parameters\":{\"type\":\"object\"," ++ + "\"properties\":{\"path\":{\"type\":\"string\"},\"content\":{\"type\":\"string\"},\"limit\":{\"type\":\"integer\"}}}}}]"; +const thought = " to=self<|message|>A file is needed.<|eom|>"; +const call = "<|start|>assistant to=write_file<|message|>"; +const path = "\n\nnotes.txt\n"; +const opened = path ++ "The history of"; +const rest = " the bicycle\n\n<|eot|>"; +const args = "{\"path\":\"notes.txt\",\"content\":\"The history of"; + +/// `cut` then `rest`, max_tokens at `cut`'s end: whole and streamed replies agree at every stride (null: unchecked). +fn expectCut(cut: []const u8, calls: usize, arguments: []const u8, content: ?[]const u8, extra: []const u8) !void { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var text: Text = .{}; + const n = (try text.tokens(a, cut)).len; + const body = try std.fmt.allocPrint(a, "{s},\"max_tokens\":{d}{s}", .{ head, n, extra }); + var whole = try harness.send(.{}, try std.mem.concat(a, u8, &.{ cut, rest }), 4096, try std.mem.concat(a, u8, &.{ body, "}" })); + defer whole.deinit(); + try std.testing.expectEqual(@as(u16, 200), whole.status); + for ([_]usize{ 1, 3, 7, 4096 }) |stride| { + var streamed = try harness.send(.{}, try std.mem.concat(a, u8, &.{ cut, rest }), stride, try std.mem.concat(a, u8, &.{ body, ",\"stream\":true}" })); + defer streamed.deinit(); + for ([_]*const harness.Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqual(calls, s.calls); + try std.testing.expectEqualStrings(arguments, s.arguments.items); + if (content) |c| try std.testing.expectEqualStrings(c, s.content.items); + for ([_][]const u8{ "atem", "\n\na.txt" ++ + "\n\n<|eom|>"; + try expectCut(thought ++ first ++ call ++ opened, 2, "{\"path\":\"a.txt\"}" ++ args, "", ""); + // inside a value's closer, between parameters, inside a parameter's name and after the invoke closed + try expectCut(thought ++ call ++ opened ++ "\n\n12"; + try expectCut(thought ++ call ++ limit, 1, "{\"limit\":12", "", ""); +} + +test "recipient cut: a call cut before its invoke names the tool is the header's call" { + inline for (.{ "", "\nassistant to=write_fi", 0, "", "", ""); +} + +test "recipient cut: the one-call policy hides the cut call" { + try expectCut(thought ++ call ++ opened, 0, "", null, ",\"parallel_tool_calls\":false"); +} diff --git a/zig/src/server/recipient_reply.zig b/zig/src/server/recipient_reply.zig new file mode 100644 index 00000000000..c2fdcb4f5c1 --- /dev/null +++ b/zig/src/server/recipient_reply.zig @@ -0,0 +1,270 @@ +//! Replies written as messages to recipients: `<|start|>assistant to=R<|message|>body<|eom|>`, the last one `<|eot|>`. +const std = @import("std"); +const json = @import("json"); +const reply_text = @import("reply_text.zig"); +const tool_specs = @import("tool_specs.zig"); +const Allocator = std.mem.Allocator; +const Value = json.Value; +const Split = reply_text.Split; +const findTag = reply_text.findTag; + +const start = "<|start|>"; +const message = "<|message|>"; +const ends = [_][]const u8{ "<|eom|>", "<|eot|>" }; +const closers = ends ++ [_][]const u8{start}; +const block = ""; +const block_close = ""; +const invoke = "" } }; + var out: std.ArrayList(u8) = .empty; + var i: usize = 0; + outer: while (i < s.len) { + for (escapes) |e| if (std.mem.startsWith(u8, s[i..], e[0])) { + try out.appendSlice(a, e[1]); + i += e[0].len; + continue :outer; + }; + try out.append(a, s[i]); + i += 1; + } + return out.items; +} + +/// The offered tool's spelling of `name`, as tool_parse matches a call's name; null: not offered. +fn offered(a: Allocator, name: []const u8, tools: []const Value) Allocator.Error!?[]const u8 { + for (tools) |tool| { + const spelled = try tool_specs.toolName(a, tool); + if (spelled.len > 0 and std.ascii.eqlIgnoreCase(spelled, name)) return spelled; + } + return null; +} + +/// A call message as the `` markup tool_parse reads, a cut one left open; null: keep the model's text. +pub fn calls(a: Allocator, body: []const u8, recipient: []const u8, tools: []const Value, end: End) Allocator.Error!?[]const u8 { + if (tools.len == 0 or end == .stopped) return null; // no tools offered, or a stop string inside the call + const cut = end == .cut; + const lead = reply_text.pyLstrip(body); + if (!std.mem.startsWith(u8, lead, block) and !(cut and std.mem.startsWith(u8, block, lead))) return null; + var out: std.ArrayList(u8) = .empty; + var pos: usize = 0; + while (findTag(body, pos, invoke)) |s| { + const q = std.mem.indexOfPos(u8, body, s + invoke.len, "\">") orelse break; // its name is still being written + const name = (try offered(a, try unescape(a, body[s + invoke.len .. q]), tools)) orelse return null; + const close = std.mem.indexOfPos(u8, body, q, invoke_close); + const stop = close orelse body.len; + if (out.items.len > 0) try out.append(a, '\n'); + try out.print(a, "\n\n", .{name}); + var p = q + 2; + while (findTag(body[0..stop], p, parameter)) |ps| { + const pq = std.mem.indexOfPos(u8, body[0..stop], ps + parameter.len, "\">") orelse break; // a cut name + const pe = std.mem.indexOfPos(u8, body[0..stop], pq + 2, parameter_close); + const value = body[pq + 2 .. pe orelse stop - (if (cut) reply_text.partialTag(body[pq + 2 .. stop], parameter_close) else 0)]; + try out.print(a, "\n{s}", .{ try unescape(a, body[ps + parameter.len .. pq]), value }); + if (pe == null and cut) return out.items; // a cut value: its closers never came + try out.appendSlice(a, "\n\n"); + p = pe orelse stop; + } + if (close == null and cut) return out.items; // cut between its parameters + try out.appendSlice(a, "\n"); + pos = if (close) |c| c + invoke_close.len else stop; + if (cut and findTag(body, pos, invoke) == null and findTag(body, pos, block_close) == null) return out.items; // block open + try out.appendSlice(a, ""); + } + if (out.items.len == 0 and cut and findTag(body, 0, block_close) == null) { // cut before its invoke names it + const name = (try offered(a, recipient, tools)) orelse return null; + return try std.fmt.allocPrint(a, "\n\n", .{name}); + } + return if (out.items.len > 0) out.items else null; +} + +/// The open message of a reply being read: its kind, recipient and body start, how far it was scanned and sent. +const Open = struct { kind: Kind, recipient: []const u8, b0: usize, scan: usize, sent: usize = 0, begun: bool = false }; + +/// The longest closer less a byte: a closer that began before a scan's end is found from this far back. +const reach = blk: { + var n: usize = 0; + for (closers) |e| n = @max(n, e.len); + break :blk n - 1; +}; + +/// `bytes` after `out`'s; a full list moves to a buffer twice the size, the old left intact for earlier splits. +fn keep(a: Allocator, out: *std.ArrayList(u8), bytes: []const u8) Allocator.Error!void { + if (out.items.len + bytes.len > out.capacity) { + const cap = @max(256, 2 * (out.items.len + bytes.len)); + const mem = try a.alloc(u8, cap); + @memcpy(mem[0..out.items.len], out.items); + out.items = mem[0..out.items.len]; + out.capacity = cap; + } + out.appendSliceAssumeCapacity(bytes); +} + +/// A message's new text since the last call, its end's whitespace held back (the finished reply strips it). +fn grow(a: Allocator, out: *std.ArrayList(u8), o: *Open, text: []const u8) Allocator.Error!void { + const body = reply_text.pyRstrip(text); + var piece = body[@min(o.sent, body.len)..]; + o.sent = @max(o.sent, body.len); + if (!o.begun) { + piece = reply_text.pyLstrip(piece); + if (piece.len == 0) return; + o.begun = true; + if (out.items.len > 0) try keep(a, out, "\n\n"); + } + try keep(a, out, piece); +} + +/// How one chat's reply reads: the message its prompt left open, the request's tools and thinking switch. +pub const Reading = struct { + /// The prompt after its last `<|start|>` when no end follows it (`assistant`, or `assistant to=self<|message|>`). + lead: []const u8 = "", + tools: []const Value = &.{}, + /// Thinking on: `self` messages are the reasoning; off, they stay out of the reply. + reasoning: bool = true, + /// What a streamed reply's text gave so far: each call reads only the bytes after the last (the reply grows). + st: State = .{}, + + const State = struct { + ready: bool = false, + at: usize = 0, // the reply read up to here: closed messages before it, or the open message's body start + open: ?Open = null, + any: bool = false, // a message seen + first: bool = true, // the next header is the reply's first, which the prompt's lead begins + reasoning: std.ArrayList(u8) = .empty, + answer: std.ArrayList(u8) = .empty, + len: usize = 0, // the reply's length at the last call, and its last bytes (the same reply grew since) + tail: [32]u8 = undefined, + tail_n: usize = 0, + }; + + pub fn of(a: Allocator, text: anytype, prompt: []const u32, tools: []const Value, thinking: bool) Allocator.Error!Reading { + var r: Reading = .{ .tools = tools, .reasoning = thinking }; + const id = text.tokenId(start) orelse return r; + const at = std.mem.lastIndexOfScalar(u32, prompt, id) orelse return r; + const lead = try text.decode(a, prompt[at + 1 ..]); + for (ends) |e| if (std.mem.indexOf(u8, lead, e) != null) return r; + r.lead = lead; + return r; + } + + /// A fresh read: new lists (an earlier split's text stays as it was), the lead's open message if it has one. + fn restart(r: *Reading, a: Allocator) Allocator.Error!void { + r.st = .{ .ready = true }; + const m = findTag(r.lead, 0, message) orelse return; + var header = r.lead[0..m]; + if (std.mem.startsWith(u8, header, start)) header = header[start.len..]; + r.st.open = .{ .kind = kindOf(header), .recipient = try a.dupe(u8, recipientOf(header) orelse ""), .b0 = 0, .scan = 0 }; + r.st.any = true; + r.st.first = false; + } + + /// Whether `reply` is the last call's reply grown (else the read starts over). + fn grew(r: *const Reading, reply: []const u8) bool { + const st = &r.st; + if (!st.ready or reply.len < st.len) return false; + return std.mem.eql(u8, reply[st.len - st.tail_n .. st.len], st.tail[0..st.tail_n]); + } + + fn mark(r: *Reading, reply: []const u8) void { + r.st.len = reply.len; + r.st.tail_n = @min(reply.len, r.st.tail.len); + @memcpy(r.st.tail[0..r.st.tail_n], reply[reply.len - r.st.tail_n ..]); + } + + /// A reply with no header at its start (none in the prompt's lead): all of it is the answer, streamed as it comes. + fn plain(r: *const Reading, reply: []const u8, end: End) ?[]const u8 { + if (r.st.any) return null; + const p = reply_text.pyLstrip(reply); + if (std.mem.startsWith(u8, p, "<|") or std.mem.startsWith(u8, p, "to=")) return null; + if (end == .streaming and (p.len == 0 or std.mem.startsWith(u8, "<|", p) or std.mem.startsWith(u8, "to=", p))) return ""; + return reply_text.pyStrip(p); + } + + /// An open message's text into the split: reasoning and answer as they grow, a call once closed or at the end. + fn body(r: *Reading, a: Allocator, o: *Open, text: []const u8, done: bool, as: End) Allocator.Error!void { + switch (o.kind) { + .reasoning => if (r.reasoning) try grow(a, &r.st.reasoning, o, text), + .answer => try grow(a, &r.st.answer, o, text), + .call => if (done and !o.begun) try grow(a, &r.st.answer, o, (try calls(a, text, o.recipient, r.tools, as)) orelse text), + } + } + + /// (reasoning, answer) so far; a stream holds back open headers, calls and partial markers, so each split grows. + pub fn split(r: *Reading, a: Allocator, reply: []const u8, end: End) Allocator.Error!Split { + if (!r.grew(reply)) try r.restart(a); + defer r.mark(reply); + if (r.plain(reply, end)) |p| return .{ .reasoning = "", .answer = p }; + const st = &r.st; + while (true) { + if (st.open == null) { // the next header, the lead before the reply's first + const m = findTag(reply, st.at, message) orelse break; + var header = reply[st.at..m]; + if (st.first) header = try std.mem.concat(a, u8, &.{ r.lead, header }); + if (std.mem.startsWith(u8, header, start)) header = header[start.len..]; + st.first = false; + st.any = true; + st.open = .{ .kind = kindOf(header), .recipient = try a.dupe(u8, recipientOf(header) orelse ""), .b0 = m + message.len, .scan = m + message.len }; + st.at = m + message.len; + } + const o = &st.open.?; + var b1 = reply.len; + var next = reply.len; + var closed = false; + for (closers) |e| if (findTag(reply[0..b1], o.scan, e)) |at| { + b1 = at; + next = if (std.mem.eql(u8, e, start)) at else at + e.len; + closed = true; + }; + if (closed) { + try r.body(a, o, reply[o.b0..b1], true, .ended); + st.open = null; + st.at = next; + continue; + } + o.scan = @max(o.b0, reply.len -| reach); // a closer begun before the end is found next call + if (end == .streaming) { + var held: usize = 0; + for (closers) |e| held = @max(held, reply_text.partialTag(reply[o.b0..], e)); + try r.body(a, o, reply[o.b0 .. reply.len - held], false, end); + } else try r.body(a, o, reply[o.b0..], true, end); + break; + } + if (!st.any and end != .streaming) { // no message markup at all; a header the reply was cut in is no answer + const p = reply_text.pyStrip(reply); + return .{ .reasoning = "", .answer = if (std.mem.startsWith(u8, p, "to=")) "" else p }; + } + return .{ .reasoning = st.reasoning.items, .answer = st.answer.items }; + } +}; diff --git a/zig/src/server/recipient_reply_test.zig b/zig/src/server/recipient_reply_test.zig new file mode 100644 index 00000000000..d08480daa9e --- /dev/null +++ b/zig/src/server/recipient_reply_test.zig @@ -0,0 +1,431 @@ +//! Recipient replies (Muse Spark's template) split into reasoning, answer and calls, while Harmony replies keep theirs. +const std = @import("std"); +const api = @import("engine_api"); +const server = @import("root.zig"); +const json = server.json; +const model_text = @import("model_text.zig"); +const openai = @import("openai.zig"); +const recipient_reply = @import("recipient_reply.zig"); +const reply_text = @import("reply_text.zig"); +const tool_parse = @import("tool_parse.zig"); +const Conn = @import("http_conn.zig").Conn; + +const muse_markers = [_][]const u8{ "<|start|>", "<|message|>", "<|eom|>", "<|eot|>" }; +const harmony_markers = [_][]const u8{ "<|start|>", "<|message|>", "<|channel|>", "<|end|>", "<|return|>", "<|call|>" }; +const muse_eos = [_]u32{303}; // <|eot|> +const harmony_eos = [_]u32{304}; // <|return|> +const muse_template = "{%- set reasoning_effort_map = {'low': 8, 'xhigh': 512} -%}{{- '<|start|>assistant to=self<|message|>' -}}"; +const harmony_template = "{{- '<|start|>assistant<|channel|>commentary to=functions.' ~ name ~ '<|message|>' -}}"; +const all_bytes = blk: { + var all: [256]u8 = undefined; + for (&all, 0..) |*b, i| b.* = i; + break :blk all; +}; + +/// Bytes as tokens and each marker of the format as one token from 300; every prompt renders as `prompt`. +pub const Text = struct { + harmony: bool = false, + prompt: []const u8 = "prompt<|start|>assistant", // rendered after `effort=E;`, the effort the template heard + + fn text(t: *@This()) model_text.Text { + return .{ .ctx = t, .vtable = &.{ .encode = encode, .decode = decode, .token_id = tokenId, .token_string = tokenString, .vocab_size = vocabSize, .eos_ids = eosIds, .render = render, .template_source = templateSource } }; + } + + fn markers(t: *const Text) []const []const u8 { + return if (t.harmony) &harmony_markers else &muse_markers; + } + + fn piece(t: *const Text, id: u32) []const u8 { + return if (id >= 300) t.markers()[id - 300] else all_bytes[id..][0..1]; + } + + /// The reply's tokens: each marker the text spells is its token, every other byte its own. + pub fn tokens(t: *const Text, a: std.mem.Allocator, s: []const u8) ![]const u32 { + var out: std.ArrayList(u32) = .empty; + var i: usize = 0; + next: while (i < s.len) { + for (t.markers(), 0..) |m, k| if (std.mem.startsWith(u8, s[i..], m)) { + try out.append(a, @intCast(300 + k)); + i += m.len; + continue :next; + }; + try out.append(a, s[i]); + i += 1; + } + return out.items; + } + + fn encode(ctx: *anyopaque, a: std.mem.Allocator, input: []const u8, _: bool) model_text.Error![]u32 { + const t: *Text = @ptrCast(@alignCast(ctx)); + return @constCast(try t.tokens(a, input)); + } + + fn decode(ctx: *anyopaque, a: std.mem.Allocator, ids: []const u32) std.mem.Allocator.Error![]u8 { + const t: *Text = @ptrCast(@alignCast(ctx)); + var out: std.ArrayList(u8) = .empty; + for (ids) |id| try out.appendSlice(a, t.piece(id)); + return out.items; + } + + fn tokenId(ctx: *anyopaque, p: []const u8) ?u32 { + const t: *Text = @ptrCast(@alignCast(ctx)); + for (t.markers(), 0..) |m, k| if (std.mem.eql(u8, m, p)) return @as(u32, @intCast(300 + k)); + return null; + } + + fn tokenString(ctx: *anyopaque, a: std.mem.Allocator, id: u32) std.mem.Allocator.Error![]u8 { + return decode(ctx, a, &.{id}); + } + + fn vocabSize(_: *anyopaque) u32 { + return 310; + } + + fn eosIds(ctx: *anyopaque) []const u32 { + const t: *Text = @ptrCast(@alignCast(ctx)); + return if (t.harmony) &harmony_eos else &muse_eos; + } + + fn render(ctx: *anyopaque, a: std.mem.Allocator, _: json.Value, o: model_text.RenderOptions, _: *[]const u8) model_text.Error!model_text.Rendered { + const t: *Text = @ptrCast(@alignCast(ctx)); + return .{ .text = try std.mem.concat(a, u8, &.{ "effort=", o.reasoning_effort orelse "none", ";", t.prompt }) }; + } + + fn templateSource(ctx: *anyopaque) []const u8 { + const t: *Text = @ptrCast(@alignCast(ctx)); + return if (t.harmony) harmony_template else muse_template; + } +}; + +/// Answers `reply` in chunks of `stride` tokens. +pub const Script = struct { + reply: []const u32, + stride: usize, + eos: u32, + effort: [8]u8 = undefined, // the effort the submitted prompt was rendered with + effort_len: usize = 0, + + fn engine(e: *@This()) api.Engine { + return .{ .ctx = e, .vtable = &.{ .info = info, .submit = submit, .cancel = cancel, .status = status, .memory = memory } }; + } + + fn info(_: *anyopaque) api.Info { + return .{ .context_window = 4096 }; + } + + fn submit(ctx: *anyopaque, id: api.Id, request: *const api.Request, sink: api.Sink) api.SubmitError!void { + const e: *Script = @ptrCast(@alignCast(ctx)); + const named = request.prompt["effort=".len..]; + e.effort_len = std.mem.indexOfScalar(u32, named, ';').?; + for (named[0..e.effort_len], e.effort[0..e.effort_len]) |t, *b| b.* = @intCast(t); + sink.event(sink.ctx, id, &.{ .prefilled = 0 }); + var at: usize = 0; + while (at < e.reply.len) : (at = @min(at + e.stride, e.reply.len)) { + sink.event(sink.ctx, id, &.{ .tokens = e.reply[at..@min(at + e.stride, e.reply.len)] }); + } + const ended = e.reply.len > 0 and e.reply[e.reply.len - 1] == e.eos; + sink.event(sink.ctx, id, &.{ .finished = .{ .reason = if (ended) .stop else .length } }); + } + + fn cancel(_: *anyopaque, _: api.Id) void {} + + fn status(_: *anyopaque, out: *api.Status, _: []u32) void { + out.* = .{}; + } + + fn memory(_: *anyopaque, _: bool) ?api.Memory { + return null; + } +}; + +/// What a reply showed its client, whole or streamed: reasoning, content, the calls begun and their arguments. +pub const Shown = struct { + reasoning: std.ArrayList(u8) = .empty, + content: std.ArrayList(u8) = .empty, + arguments: std.ArrayList(u8) = .empty, + calls: usize = 0, + status: u16 = 0, + length: bool = false, // finish_reason "length" + effort: [8]u8 = undefined, + effort_len: usize = 0, + + fn out(s: *Shown) openai.Out { + return .{ .ctx = s, .vt = &.{ .open = open, .event = event, .reply = reply } }; + } + + pub fn deinit(s: *Shown) void { + for ([_]*std.ArrayList(u8){ &s.reasoning, &s.content, &s.arguments }) |l| l.deinit(std.testing.allocator); + } + + /// One message or delta object: its text fields appended, each call with an id counted, arguments appended. + fn take(s: *Shown, choice: json.Value, key: []const u8) !void { + if (choice.strField("finish_reason")) |f| s.length = s.length or std.mem.eql(u8, f, "length"); + const m = choice.get(key) orelse return; + const g = std.testing.allocator; + if (m.get("reasoning_content")) |v| if (v == .string) try s.reasoning.appendSlice(g, v.string); + if (m.get("content")) |v| if (v == .string) try s.content.appendSlice(g, v.string); + const list = m.get("tool_calls") orelse return; + if (list != .array) return; + for (list.array) |call| { + if (call.get("id") != null) s.calls += 1; + const f = call.get("function") orelse continue; + if (f.strField("arguments")) |args| try s.arguments.appendSlice(g, args); + } + } + + fn open(_: *anyopaque, _: usize) error{Closed}!void {} + + fn event(ctx: *anyopaque, payload: ?json.Value) error{Closed}!void { + const s: *Shown = @ptrCast(@alignCast(ctx)); + const p = payload orelse return; + const choices = p.get("choices") orelse return; + if (choices != .array or choices.array.len == 0) return; + s.take(choices.array[0], "delta") catch return error.Closed; + } + + fn reply(ctx: *anyopaque, status: u16, payload: json.Value) void { + const s: *Shown = @ptrCast(@alignCast(ctx)); + s.status = status; + const choices = payload.get("choices") orelse return; + if (choices != .array or choices.array.len == 0) return; + s.take(choices.array[0], "message") catch return; + } +}; + +/// `body` answered with `reply`'s tokens, `stride` at a time; the engine stops at the end token or after the reply. +pub fn send(settings: Text, reply: []const u8, stride: usize, body: []const u8) !Shown { + var text = settings; + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var backend: Script = .{ .reply = try text.tokens(a, reply), .stride = stride, .eos = Text.eosIds(&text)[0] }; + var srv = try server.Server.init(std.testing.allocator, std.testing.io, backend.engine(), text.text(), .{ + .served_name = "test-model", + .model_ids = &.{"test-model"}, + .enable_thinking = true, + .use_drafts = false, + }, null); + defer srv.deinit(); + const raw = (try json.parse(a, body)).ok; + var conn: Conn = .{ .fd = -1, .peer = "", .buf = &.{}, .gpa = a }; + var shown: Shown = .{}; + openai.run(srv, a, shown.out(), .{ .conn = &conn }, true, raw); + @memcpy(shown.effort[0..backend.effort_len], backend.effort[0..backend.effort_len]); + shown.effort_len = backend.effort_len; + return shown; +} + +const ask = "{\"model\":\"test-model\",\"messages\":[{\"role\":\"user\",\"content\":\"x\"}],\"max_tokens\":1024"; +const no_thinking = ",\"chat_template_kwargs\":{\"enable_thinking\":false}"; +const weather = ",\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"parameters\":{\"type\":\"object\"," ++ + "\"properties\":{\"city\":{\"type\":\"string\"},\"days\":{\"type\":\"integer\"}}}}}]"; + +fn atem(comptime city: []const u8, comptime days: []const u8) []const u8 { + return "\n\n" ++ city ++ + "\n" ++ days ++ "\n\n"; +} + +const chat_reply = " to=self<|message|>The sky question is simple.<|eom|><|start|>assistant to=user<|message|>Blue sky.<|eot|>"; +const call_reply = " to=self<|message|>Two forecasts are needed.<|eom|><|start|>assistant to=commentary<|message|>Checking both." ++ + "<|eom|><|start|>assistant to=get_weather<|message|>" ++ atem("Paris", "3") ++ "<|eom|><|start|>assistant to=get_weather" ++ + "<|message|>" ++ atem("Oslo", "1") ++ "<|eot|>"; +const harmony_reply = "<|channel|>analysis<|message|>Think.<|end|><|start|>assistant<|channel|>final<|message|>Blue sky.<|return|>"; + +test "recipient replies: detected from the markers and the template, never for Harmony's tokens" { + var muse: Text = .{}; + var harmony: Text = .{ .harmony = true }; + try std.testing.expect(recipient_reply.detect(muse.text())); + try std.testing.expect(!recipient_reply.detect(harmony.text())); +} + +test "recipient replies: a split while streaming only grows, holds calls back, and the finished split extends it" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const reply = call_reply[0 .. call_reply.len - "<|eot|>".len]; + var reading: recipient_reply.Reading = .{ .lead = "assistant", .tools = (try json.parse(a, weather[",\"tools\":".len..])).ok.array }; + const done = try reading.split(a, reply, .ended); + try std.testing.expectEqualStrings("Two forecasts are needed.", done.reasoning); + const xml = "\n\n\n{s}\n\n\n{s}\n\n" ++ + "\n"; + const want = try std.fmt.allocPrint(a, "Checking both.\n\n" ++ xml ++ "\n\n" ++ xml, .{ "Paris", "3", "Oslo", "1" }); + try std.testing.expectEqualStrings(want, done.answer); + var last: reply_text.Split = .{ .reasoning = "", .answer = "" }; + for (1..reply.len + 1) |n| { + const s = try reading.split(a, reply[0..n], .streaming); + try std.testing.expect(std.mem.startsWith(u8, s.reasoning, last.reasoning)); + try std.testing.expect(std.mem.startsWith(u8, s.answer, last.answer)); + try std.testing.expect(std.mem.indexOf(u8, s.answer, "<|") == null and std.mem.indexOf(u8, s.answer, "atem") == null); + try std.testing.expect(std.mem.startsWith(u8, done.answer, s.answer)); + last = s; + } + try std.testing.expect(std.mem.indexOf(u8, last.answer, "Oslo") == null); // the open call waits for the reply's end + try std.testing.expectEqualStrings("plain", (try reading.split(a, " plain ", .ended)).answer); +} + +test "recipient replies: atem calls become OpenAI calls with schema-typed arguments" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const tools = (try json.parse(a, weather[",\"tools\":".len..])).ok.array; + const body = atem("Rio de Janeiro", "4"); + const parsed = try tool_parse.parse(a, (try recipient_reply.calls(a, body, "get_weather", tools, .ended)).?, tools, null); + try std.testing.expectEqualStrings("", parsed.content); + const f = parsed.calls.?[0].get("function").?; + try std.testing.expectEqualStrings("get_weather", f.strField("name").?); + try std.testing.expectEqualStrings("{\"city\":\"Rio de Janeiro\",\"days\":4}", f.strField("arguments").?); + const amp = (try json.parse(a, "[{\"type\":\"function\",\"function\":{\"name\":\"a&b\"}}]")).ok.array; + const named = (try recipient_reply.calls(a, "\n\n", "a&b", amp, .ended)).?; + try std.testing.expectEqualStrings("\n\n\n", named); + try std.testing.expect((try recipient_reply.calls(a, "no calls here", "get_weather", tools, .ended)) == null); +} + +test "recipient replies: whole and streamed chats show the same reasoning, answer and calls" { + const cases = [_]struct { reply: []const u8, body: []const u8, content: []const u8, reasoning: []const u8, arguments: []const u8, calls: usize }{ + .{ .reply = chat_reply, .body = ask ++ "}", .content = "Blue sky.", .reasoning = "The sky question is simple.", .arguments = "", .calls = 0 }, + .{ .reply = call_reply, .body = ask ++ weather ++ "}", .content = "Checking both.", .reasoning = "Two forecasts are needed.", .arguments = "{\"city\":\"Paris\",\"days\":3}{\"city\":\"Oslo\",\"days\":1}", .calls = 2 }, + }; + for (cases) |c| { + var whole = try send(.{}, c.reply, 4096, c.body); + defer whole.deinit(); + try std.testing.expectEqual(@as(u16, 200), whole.status); + for ([_]usize{ 1, 7, 4096 }) |stride| { + const streamed_body = try std.mem.concat(std.testing.allocator, u8, &.{ c.body[0 .. c.body.len - 1], ",\"stream\":true}" }); + defer std.testing.allocator.free(streamed_body); + var streamed = try send(.{}, c.reply, stride, streamed_body); + defer streamed.deinit(); + for ([_]*const Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqualStrings(c.content, s.content.items); + try std.testing.expectEqualStrings(c.reasoning, s.reasoning.items); + try std.testing.expectEqualStrings(c.arguments, s.arguments.items); + try std.testing.expectEqual(c.calls, s.calls); + } + } + } +} + +test "recipient replies: a Harmony reply keeps its final channel as content and analysis as reasoning" { + var whole = try send(.{ .harmony = true }, harmony_reply, 4096, ask ++ no_thinking ++ "}"); + defer whole.deinit(); + var streamed = try send(.{ .harmony = true }, harmony_reply, 1, ask ++ no_thinking ++ ",\"stream\":true}"); + defer streamed.deinit(); + for ([_]*const Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqualStrings("Blue sky.", s.content.items); + try std.testing.expectEqualStrings("Think.", s.reasoning.items); + } +} + +test "recipient replies: a prompt that opened the self message keeps the reasoning that follows it" { + const opened: Text = .{ .prompt = "prompt<|start|>assistant to=self<|message|>" }; + const reply = "The sky question is simple.<|eom|><|start|>assistant to=user<|message|>Blue sky.<|eot|>"; + var whole = try send(opened, reply, 4096, ask ++ "}"); + defer whole.deinit(); + for ([_]usize{ 1, 7, 4096 }) |stride| { + var streamed = try send(opened, reply, stride, ask ++ ",\"stream\":true}"); + defer streamed.deinit(); + for ([_]*const Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqualStrings("Blue sky.", s.content.items); + try std.testing.expectEqualStrings("The sky question is simple.", s.reasoning.items); + } + // cut while it still reasons: the reasoning so far, no answer + var cut = try send(opened, "Still weighing the sky", stride, ask ++ ",\"stream\":true}"); + defer cut.deinit(); + try std.testing.expectEqualStrings("Still weighing the sky", cut.reasoning.items); + try std.testing.expectEqualStrings("", cut.content.items); + } +} + +test "recipient replies: a call to no offered tool stays as the model wrote it, never as other markup" { + const time = ",\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_time\",\"parameters\":{\"type\":\"object\"}}}]"; + const want = comptime "Checking both.\n\n" ++ atem("Paris", "3") ++ "\n\n" ++ atem("Oslo", "1"); + for ([_][]const u8{ "", time }) |tools| { + const body = try std.mem.concat(std.testing.allocator, u8, &.{ ask, tools, "}" }); + defer std.testing.allocator.free(body); + var whole = try send(.{}, call_reply, 4096, body); + defer whole.deinit(); + for ([_]usize{ 1, 7, 4096 }) |stride| { + const streamed_body = try std.mem.concat(std.testing.allocator, u8, &.{ ask, tools, ",\"stream\":true}" }); + defer std.testing.allocator.free(streamed_body); + var streamed = try send(.{}, call_reply, stride, streamed_body); + defer streamed.deinit(); + for ([_]*const Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqualStrings(want, s.content.items); + try std.testing.expectEqual(@as(usize, 0), s.calls); + } + } + } +} + +test "recipient replies: thinking off keeps self messages out of the reply and the template at its lowest effort" { + for ([_][]const u8{ no_thinking, ",\"reasoning_effort\":\"none\"" }) |off| { + const body = try std.mem.concat(std.testing.allocator, u8, &.{ ask, off, "}" }); + defer std.testing.allocator.free(body); + var whole = try send(.{}, chat_reply, 4096, body); + defer whole.deinit(); + const streamed_body = try std.mem.concat(std.testing.allocator, u8, &.{ ask, off, ",\"stream\":true}" }); + defer std.testing.allocator.free(streamed_body); + for ([_]usize{ 1, 7 }) |stride| { + var streamed = try send(.{}, chat_reply, stride, streamed_body); + defer streamed.deinit(); + for ([_]*const Shown{ &whole, &streamed }) |s| { + try std.testing.expectEqualStrings("Blue sky.", s.content.items); + try std.testing.expectEqualStrings("", s.reasoning.items); + try std.testing.expectEqualStrings("low", s.effort[0..s.effort_len]); + } + } + } + // thinking on: the template's default effort, or the named level nearest the request's + var on = try send(.{}, chat_reply, 4096, ask ++ "}"); + defer on.deinit(); + try std.testing.expectEqualStrings("none", on.effort[0..on.effort_len]); + try std.testing.expectEqualStrings("The sky question is simple.", on.reasoning.items); + var high = try send(.{}, chat_reply, 4096, ask ++ ",\"reasoning_effort\":\"high\"}"); + defer high.deinit(); + try std.testing.expectEqualStrings("xhigh", high.effort[0..high.effort_len]); +} + +test "recipient replies: a streamed read goes on from the last call and equals a fresh read at every length" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const tools = (try json.parse(a, weather[",\"tools\":".len..])).ok.array; + const spaced = " to=self<|message|>Think.\n\nMore.\n\n<|eom|><|start|>assistant to=user<|message|>Done. \n<|eot|>"; + for ([_][]const u8{ chat_reply, call_reply, " to=self<|message|>x<|eo", spaced }) |reply| for ([_][]const u8{ "assistant", "assistant to=self<|message|>" }) |lead| { + var going: recipient_reply.Reading = .{ .lead = lead, .tools = tools }; + for (1..reply.len + 1) |n| { + var fresh: recipient_reply.Reading = .{ .lead = lead, .tools = tools }; + const want = try fresh.split(a, reply[0..n], .streaming); + const got = try going.split(a, reply[0..n], .streaming); + try std.testing.expectEqualStrings(want.reasoning, got.reasoning); + try std.testing.expectEqualStrings(want.answer, got.answer); + for ([_][]const u8{ got.reasoning, got.answer }) |t| try std.testing.expect(t.len == 0 or !std.ascii.isWhitespace(t[t.len - 1])); + } + for ([_]recipient_reply.End{ .ended, .cut }) |end| { + var fresh: recipient_reply.Reading = .{ .lead = lead, .tools = tools }; + var done = going; + const want = try fresh.split(a, reply, end); + const got = try done.split(a, reply, end); + try std.testing.expectEqualStrings(want.reasoning, got.reasoning); + try std.testing.expectEqualStrings(want.answer, got.answer); + } + }; +} + +test "recipient replies: a reply with no markup streams as it comes; one that may still be a header waits" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var r: recipient_reply.Reading = .{ .lead = "assistant" }; + const reply = " Blue sky, mostly. "; + var last: []const u8 = ""; + for (1..reply.len + 1) |n| { + const s = (try r.split(a, reply[0..n], .streaming)).answer; + try std.testing.expect(std.mem.startsWith(u8, s, last) and std.mem.startsWith(u8, "Blue sky, mostly.", s)); + last = s; + } + try std.testing.expectEqualStrings("Blue sky, mostly", (try r.split(a, reply[0 .. reply.len - 2], .streaming)).answer); + try std.testing.expectEqualStrings("Blue sky, mostly.", (try r.split(a, reply, .ended)).answer); + var h: recipient_reply.Reading = .{ .lead = "assistant" }; + for ([_][]const u8{ " t", " to", " to=se", " <" }) |p| try std.testing.expectEqualStrings("", (try h.split(a, p, .streaming)).answer); + try std.testing.expectEqualStrings("hi", (try h.split(a, " to=user<|message|>hi", .streaming)).answer); +} diff --git a/zig/src/server/responses.zig b/zig/src/server/responses.zig index d49ffe84a1e..0cc0faae812 100644 --- a/zig/src/server/responses.zig +++ b/zig/src/server/responses.zig @@ -51,7 +51,7 @@ fn refusal(a: Allocator, message: []const u8, param: ?[]const u8) !Value { /// GET /v1/responses/{id}: a background response while it runs (responses_background.zig), else the stored one. pub fn get(srv: *Server, conn: *Conn, a: Allocator, rid: []const u8) void { - const found = srv.background_jobs.poll(srv.io, a, rid) orelse (srv.store.get(srv.io, a, rid) catch null); + const found = srv.background_jobs.poll(srv.io, a, rid, conn.key_digest) orelse (srv.store.get(srv.io, a, rid, conn.key_digest) catch null); const v = found orelse return notStored(conn, a, rid); if (json.truthyField(v, "background") and background.streamAsked(conn.path)) return refuse(conn, a, "streaming a background response is not supported: GET it without stream=true and poll its status", 400, "stream"); @@ -64,8 +64,8 @@ pub fn notStored(conn: *Conn, a: Allocator, rid: []const u8) void { pub fn delete(srv: *Server, conn: *Conn, a: Allocator, rid: ?[]const u8) void { const id = rid orelse ""; - const running = id.len > 0 and srv.background_jobs.forget(srv.io, id); // it stops, and its end is not kept - if (rid == null or id.len == 0 or !(srv.store.delete(srv.io, id) or running)) { + const running = id.len > 0 and srv.background_jobs.forget(srv.io, id, conn.key_digest); // it stops, and its end is not kept + if (rid == null or id.len == 0 or !(srv.store.delete(srv.io, id, conn.key_digest) or running)) { const shown = if (rid) |r| pyrepr.repr(a, .{ .string = r }) catch r else "None"; return refuse(conn, a, std.fmt.allocPrint(a, "no stored response has id {s}", .{shown}) catch return, 404, "response_id"); } @@ -92,9 +92,9 @@ pub fn postGated(srv: *Server, conn: *Conn, a: Allocator, held: ?*request_gate.H // a restricted key is stateless here: checked before any stored conversation is read if (@import("auth_scope.zig").responseDenial(conn.key_scopes, body)) |why| return @import("auth_scope_reply.zig").deny(conn, false, why); - if (body.get("previous_response_id")) |p| if (p == .string and srv.background_jobs.running(srv.io, p.string)) + if (body.get("previous_response_id")) |p| if (p == .string and srv.background_jobs.running(srv.io, p.string, conn.key_digest)) return refuse(conn, a, "previous_response_id names a background response still in progress: poll it until it ends", 400, "previous_response_id"); - const history: store_mod.History = .{ .store = &srv.store, .io = srv.io }; + const history: store_mod.History = .{ .store = &srv.store, .io = srv.io, .owner = conn.key_digest }; const t = translate_mod.translate(&cx, body, history) catch return refuse(conn, a, cx.message, 400, null); if (t.background) return background.create(srv, conn, a, body, t, held); switch (turn(srv, a, conn, &cx, body, t, @import("responses_sink.zig").sse(conn), .{})) { @@ -135,7 +135,7 @@ pub fn turn(srv: *Server, a: Allocator, conn: *Conn, cx: *Cx, body: Value, t: tr } // a reply with tools gets its rows once its calls are parsed: each item's done events wait for them const late = json.truthyField(t.chat, "logprobs") and json.truthyField(t.chat, "tools"); - var reply: Reply = .{ .srv = srv, .a = a, .sink = sink, .base = base, .streaming = t.stream, .keep = t.store, .added = t.added, .cx = cx, .call_ids = .{ .key = &srv.tool_ids, .body = t.chat }, .whole_history = opts.whole_history, .late_rows = late }; + var reply: Reply = .{ .srv = srv, .a = a, .sink = sink, .base = base, .streaming = t.stream, .keep = t.store, .added = t.added, .cx = cx, .owner = conn.key_digest, .call_ids = .{ .key = &srv.tool_ids, .body = t.chat }, .whole_history = opts.whole_history, .late_rows = late }; var out: Wire = .{ .reply = &reply }; cancel_ids.alias = base.get("id").?.string; // the cancel route takes the response's id too defer cancel_ids.alias = null; @@ -147,9 +147,9 @@ pub fn turn(srv: *Server, a: Allocator, conn: *Conn, cx: *Cx, body: Value, t: tr } /// A ``generate: false`` turn: created, in progress, then completed with no output and ``prompt_tokens`` of input. -pub fn warmup(srv: *Server, a: Allocator, cx: *Cx, body: Value, t: translate_mod.Request, sink: Sink, prompt_tokens: usize, opts: TurnOptions) ?Value { +pub fn warmup(srv: *Server, a: Allocator, cx: *Cx, body: Value, t: translate_mod.Request, sink: Sink, prompt_tokens: usize, opts: TurnOptions, owner: ?[32]u8) ?Value { const base = newBase(srv, a, body, t) catch return null; - var reply: Reply = .{ .srv = srv, .a = a, .sink = sink, .base = base, .streaming = true, .keep = t.store, .added = t.added, .cx = cx, .call_ids = .{ .key = &srv.tool_ids, .body = t.chat }, .whole_history = opts.whole_history, .warmup = true }; + var reply: Reply = .{ .srv = srv, .a = a, .sink = sink, .base = base, .streaming = true, .keep = t.store, .added = t.added, .cx = cx, .owner = owner, .call_ids = .{ .key = &srv.tool_ids, .body = t.chat }, .whole_history = opts.whole_history, .warmup = true }; const usage = json.newObject(a) catch return null; usage.put(a, "prompt_tokens", json.intValue(a, prompt_tokens) catch return null) catch return null; usage.put(a, "completion_tokens", .{ .int = "0" }) catch return null; @@ -210,10 +210,10 @@ const Wire = struct { w.payload = payload; } }; - /// A Response built from chat-completion deltas, in order: reasoning, text, calls; streamed as typed events. const Reply = struct { srv: *Server, + owner: ?[32]u8, a: Allocator, sink: Sink, base: *json.Object, @@ -497,10 +497,10 @@ const Reply = struct { /// Keeps the final response: chained to its stored parent, or whole when the parent came from elsewhere. fn store(r: *Reply, final: Value) void { const s = &r.srv.store; - const earlier = r.whole_history orelse return s.put(r.srv.io, r.cx, final, r.added) catch {}; + const earlier = r.whole_history orelse return s.put(r.srv.io, r.cx, final, r.added, r.owner) catch {}; const from_output = translate_mod.messages(r.cx, final.get("output").?.array) catch return; const all = std.mem.concat(r.cx.a, Value, &.{ earlier, r.added, from_output }) catch return; - s.putWhole(r.srv.io, r.cx, final, all) catch {}; + s.putWhole(r.srv.io, r.cx, final, all, r.owner) catch {}; } fn fail(r: *Reply, problem: Value) E!void { @@ -562,7 +562,7 @@ test "a call delta that names no id takes the chat run's id at its index, and on const key: ids.Key = .of(ids.test_key_text); const chat = (try json.parse(a, "{\"model\":\"m\",\"messages\":[{\"role\":\"user\",\"content\":\"x\"}]}")).ok; var cx: Cx = .{ .a = a }; - var reply: Reply = .{ .srv = undefined, .a = a, .sink = undefined, .base = try json.newObject(a), .streaming = false, .keep = false, .added = &.{}, .cx = &cx, .call_ids = .{ .key = &key, .body = chat } }; + var reply: Reply = .{ .srv = undefined, .a = a, .sink = undefined, .base = try json.newObject(a), .streaming = false, .keep = false, .added = &.{}, .cx = &cx, .owner = null, .call_ids = .{ .key = &key, .body = chat } }; try reply.delta((try json.parse(a, "{\"tool_calls\":[{\"index\":1,\"function\":{\"name\":\"f\"}},{\"index\":2,\"id\":\"call_sent\",\"function\":{\"name\":\"f\"}}]}")).ok, null); var calls: ids.Calls = .{ .key = &key, .body = chat }; try std.testing.expectEqualStrings(try calls.id(a, 0, 1), reply.items.items[0].get("call_id").?.string); @@ -576,7 +576,7 @@ test "Server recovery: Responses grows reasoning, text and interleaved call argu var cx: Cx = .{ .a = a }; var srv: Server = undefined; const key: ids.Key = .of(ids.test_key_text); - var r: Reply = .{ .srv = &srv, .a = a, .sink = undefined, .base = try json.newObject(a), .streaming = false, .keep = false, .added = &.{}, .cx = &cx, .call_ids = .{ .key = &key, .body = .null } }; + var r: Reply = .{ .srv = &srv, .a = a, .sink = undefined, .base = try json.newObject(a), .streaming = false, .keep = false, .added = &.{}, .cx = &cx, .owner = null, .call_ids = .{ .key = &key, .body = .null } }; const chunk = "abcdefgh"; for ([_][]const u8{ "reasoning", "message" }) |kind| { for (0..3000) |_| try r.write(kind, chunk, null); diff --git a/zig/src/server/responses_background.zig b/zig/src/server/responses_background.zig index f339ca3f105..f5364cb07c5 100644 --- a/zig/src/server/responses_background.zig +++ b/zig/src/server/responses_background.zig @@ -29,8 +29,8 @@ pub const Manager = struct { closed: bool = false, limits: Limits = .{}, - fn find(m: *Manager, id: []const u8) ?*Job { - for (m.jobs.items) |j| if (!j.deleted and std.mem.eql(u8, j.id, id)) return j; + fn find(m: *Manager, id: []const u8, owner: ?[32]u8) ?*Job { + for (m.jobs.items) |j| if (!j.deleted and std.mem.eql(u8, j.id, id) and std.meta.eql(j.key, owner)) return j; return null; } @@ -65,39 +65,39 @@ pub const Manager = struct { } /// GET's answer for a queued or running response, copied into `a`; null when none has `id`. - pub fn poll(m: *Manager, io: std.Io, a: Allocator, id: []const u8) ?Value { + pub fn poll(m: *Manager, io: std.Io, a: Allocator, id: []const u8, owner: ?[32]u8) ?Value { m.mutex.lockUncancelable(io); defer m.mutex.unlock(io); - const j = m.find(id) orelse return null; + const j = m.find(id, owner) orelse return null; return j.snapshot(a) catch null; } /// Whether `id` names a response still queued or running. - pub fn running(m: *Manager, io: std.Io, id: []const u8) bool { + pub fn running(m: *Manager, io: std.Io, id: []const u8, owner: ?[32]u8) bool { m.mutex.lockUncancelable(io); defer m.mutex.unlock(io); - return m.find(id) != null; + return m.find(id, owner) != null; } /// DELETE of a queued or running response: it stops, and its end is not stored; false when none has `id`. - pub fn forget(m: *Manager, io: std.Io, id: []const u8) bool { + pub fn forget(m: *Manager, io: std.Io, id: []const u8, owner: ?[32]u8) bool { m.mutex.lockUncancelable(io); defer m.mutex.unlock(io); - const j = m.find(id) orelse return false; + const j = m.find(id, owner) orelse return false; j.deleted = true; j.stop(); return true; } /// Cancels `id` and waits briefly for its end; the response as it stands if still running, null if it ended. - fn cancel(m: *Manager, io: std.Io, a: Allocator, id: []const u8) ?Value { + fn cancel(m: *Manager, io: std.Io, a: Allocator, id: []const u8, owner: ?[32]u8) ?Value { m.mutex.lockUncancelable(io); defer m.mutex.unlock(io); - (m.find(id) orelse return null).stop(); + (m.find(id, owner) orelse return null).stop(); const wait: std.Io.Timeout = .{ .duration = .{ .raw = .fromMilliseconds(cancel_wait_ms), .clock = .awake } }; const deadline = wait.toDeadline(io); - while (m.find(id) != null) m.ended.waitTimeout(io, &m.mutex, deadline) catch break; - const j = m.find(id) orelse return null; + while (m.find(id, owner) != null) m.ended.waitTimeout(io, &m.mutex, deadline) catch break; + const j = m.find(id, owner) orelse return null; return j.snapshot(a) catch null; } @@ -118,7 +118,7 @@ pub const Manager = struct { m.mutex.lockUncancelable(srv.io); defer m.mutex.unlock(srv.io); // stored before the job leaves `jobs`, so a poll always finds one of the two - if (!j.deleted) if (j.ending(cx.a, got)) |final| srv.store.put(srv.io, cx, final, j.t.added) catch |e| + if (!j.deleted) if (j.ending(cx.a, got)) |final| srv.store.put(srv.io, cx, final, j.t.added, j.key) catch |e| log.line("background response {s} was not stored: {s}", .{ j.id, @errorName(e) }); j.held.release(); for (m.jobs.items, 0..) |x, i| if (x == j) { @@ -183,7 +183,7 @@ const Job = struct { fn stop(j: *Job) void { if (j.cancelled) return; j.cancelled = true; - if (!cancel_ids.registry.cancel(j.srv.io, j.id)) j.dropped.store(true, .release); + if (!cancel_ids.registry.cancel(j.srv.io, j.id, j.key)) j.dropped.store(true, .release); } fn gone(ctx: *anyopaque) bool { @@ -205,7 +205,7 @@ const Job = struct { /// The turn as a whole (unstreamed) POST runs it, on a connection that is gone only when cancelled. fn work(j: *Job, cx: *errors.Cx) ?Value { - var conn: Conn = .{ .fd = -1, .peer = "", .buf = &.{}, .gpa = cx.a, .gone_hook = .{ .ctx = j, .call = gone } }; + var conn: Conn = .{ .fd = -1, .peer = "", .buf = &.{}, .gpa = cx.a, .gone_hook = .{ .ctx = j, .call = gone }, .key_digest = j.key }; const sink: Sink = .{ .ctx = j, .vt = &.{ .open = quiet, .event = unheard, .keepalive = quiet } }; return switch (responses.turn(j.srv, cx.a, &conn, cx, .null, j.t, sink, .{ .base = j.base })) { .whole => |v| v, @@ -283,8 +283,8 @@ pub fn cancelPath(route: []const u8) ?[]const u8 { /// POST /v1/responses/{id}/cancel: the cancelled response; again for one already cancelled; 400 for any other end. pub fn cancel(srv: *Server, conn: *Conn, a: Allocator, id: []const u8) void { - if (srv.background_jobs.cancel(srv.io, a, id)) |still| return routes.sendValue(conn, a, 200, still); - const kept = (srv.store.get(srv.io, a, id) catch null) orelse return responses.notStored(conn, a, id); + if (srv.background_jobs.cancel(srv.io, a, id, conn.key_digest)) |still| return routes.sendValue(conn, a, 200, still); + const kept = (srv.store.get(srv.io, a, id, conn.key_digest) catch null) orelse return responses.notStored(conn, a, id); if (!json.truthyField(kept, "background")) return responses.refuse(conn, a, "only a response created with background: true can be cancelled", 400, "response_id"); const status = json.strOr(kept.get("status")); if (std.mem.eql(u8, status, "cancelled")) return routes.sendValue(conn, a, 200, kept); diff --git a/zig/src/server/responses_background_test.zig b/zig/src/server/responses_background_test.zig index e9789e27b3a..a5b1bf8e3eb 100644 --- a/zig/src/server/responses_background_test.zig +++ b/zig/src/server/responses_background_test.zig @@ -197,6 +197,49 @@ fn textOf(v: json.Value) []const u8 { const long = "{\"model\":\"m\",\"input\":\"hi\",\"background\":true,\"max_output_tokens\":100000}"; +test "Responses owner: background jobs keep their creating key while running and after cancellation" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var lane: Lane = .{ .io = t.io, .arena = .init(t.allocator) }; + try lane.start(); + defer lane.deinit(); + const srv = try serve(&lane); + defer srv.deinit(); + const created = try send(srv, a, "POST", "/v1/responses", long, 1); + try t.expectEqual(@as(u16, 200), created.status); + const id = created.body.strField("id").?; + const url = try urlOf(a, id, ""); + const cancel = try urlOf(a, id, "/cancel"); + const request_cancel = try std.fmt.allocPrint(a, "/v1/requests/{s}/cancel", .{id}); + const child = try std.fmt.allocPrint(a, "{{\"input\":\"x\",\"previous_response_id\":\"{s}\"}}", .{id}); + try lane.waitFirstTokens(1); + for ([_]?u8{ 2, null }) |foreign| { + try t.expectEqual(@as(u16, 404), (try send(srv, a, "GET", url, "", foreign)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "DELETE", url, "", foreign)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "POST", cancel, "", foreign)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "POST", request_cancel, "", foreign)).status); + const refused = try send(srv, a, "POST", "/v1/responses", child, foreign); + try t.expectEqual(@as(u16, 400), refused.status); + try t.expect(std.mem.indexOf(u8, refused.body.get("error").?.strField("message").?, "is not stored here") != null); + } + try t.expectEqual(@as(usize, 0), lane.cancels.load(.monotonic)); + try t.expectEqual(@as(u16, 200), (try send(srv, a, "GET", url, "", 1)).status); + const cancelled = try send(srv, a, "POST", cancel, "", 1); + try t.expectEqual(@as(u16, 200), cancelled.status); + try t.expectEqualStrings("cancelled", cancelled.body.strField("status").?); + try waitFor(idle, .{srv}); + try t.expectEqual(@as(usize, 1), lane.cancels.load(.monotonic)); + try t.expectEqual(@as(u16, 200), (try send(srv, a, "GET", url, "", 1)).status); + for ([_]?u8{ 2, null }) |foreign| { + try t.expectEqual(@as(u16, 404), (try send(srv, a, "GET", url, "", foreign)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "DELETE", url, "", foreign)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "POST", cancel, "", foreign)).status); + } + try t.expectEqual(@as(u16, 200), (try send(srv, a, "DELETE", url, "", 1)).status); + try t.expectEqual(@as(u16, 404), (try send(srv, a, "GET", url, "", 1)).status); +} + test "background Responses: optional rows keep the queued id and reply, explicit unavailable rows refuse" { var arena = std.heap.ArenaAllocator.init(t.allocator); defer arena.deinit(); diff --git a/zig/src/server/responses_owner_socket_test.zig b/zig/src/server/responses_owner_socket_test.zig new file mode 100644 index 00000000000..d3f8221e9c3 --- /dev/null +++ b/zig/src/server/responses_owner_socket_test.zig @@ -0,0 +1,142 @@ +//! Stored and running Responses stay with their creating key over HTTP and WebSocket. +const std = @import("std"); +const json = @import("json"); +const client = @import("responses_ws_client_test.zig"); +const Fixture = @import("responses_ws_test.zig").Fixture; +const cancels = @import("cancel_ids.zig"); +const t = std.testing; +const A = std.mem.Allocator; +const key_a = "owner-test-a"; +const key_b = "owner-test-b"; + +fn id(a: A, reply: client.Reply) ![]const u8 { + try t.expectEqual(@as(u16, 200), reply.status); + return (try json.parse(a, reply.body)).ok.strField("id").?; +} + +fn path(a: A, rid: []const u8) ![]u8 { + return std.fmt.allocPrint(a, "/v1/responses/{s}", .{rid}); +} + +fn next(a: A, rid: []const u8) ![]u8 { + return std.fmt.allocPrint(a, "{{\"input\":\"next\",\"previous_response_id\":\"{s}\"}}", .{rid}); +} + +fn sameMiss(a: A, foreign: client.Reply, missing: client.Reply, rid: []const u8) !void { + try t.expectEqual(missing.status, foreign.status); + const one = try std.mem.replaceOwned(u8, a, foreign.body, rid, ""); + const two = try std.mem.replaceOwned(u8, a, missing.body, "resp_missing", ""); + try t.expectEqualStrings(two, one); +} + +test "Responses owner socket: another full key cannot read, continue or delete a stored response" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.start(t.allocator, t.io, .{ .api_key = &.{ key_a, key_b } }); + errdefer f.stop() catch {}; + const rid = try id(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key_a, "{\"input\":\"private A turn\"}")); + const stored = try path(a, rid); + const missing = "/v1/responses/resp_missing"; + try sameMiss(a, try client.http(a, f.io, f.port, "GET", stored, key_b, ""), try client.http(a, f.io, f.port, "GET", missing, key_b, ""), rid); + try sameMiss(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key_b, try next(a, rid)), try client.http(a, f.io, f.port, "POST", "/v1/responses", key_b, try next(a, "resp_missing")), rid); + try sameMiss(a, try client.http(a, f.io, f.port, "DELETE", stored, key_b, ""), try client.http(a, f.io, f.port, "DELETE", missing, key_b, ""), rid); + _ = try id(a, try client.http(a, f.io, f.port, "GET", stored, key_a, "")); + const child = try id(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key_a, try next(a, rid))); + try t.expectEqual(@as(u16, 404), (try client.http(a, f.io, f.port, "GET", try path(a, child), key_b, "")).status); + try t.expectEqual(@as(u16, 200), (try client.http(a, f.io, f.port, "DELETE", stored, key_a, "")).status); + try t.expectEqual(@as(u16, 404), (try client.http(a, f.io, f.port, "GET", stored, key_a, "")).status); + try f.stop(); +} + +test "Responses owner socket: WebSocket stored history and warmup use the authenticated key" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.start(t.allocator, t.io, .{ .api_key = &.{ key_a, key_b } }); + errdefer f.stop() catch {}; + const rid = try id(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key_a, "{\"input\":\"A stored turn\"}")); + var b: client.Client = undefined; + try b.open(a, f.io, f.port, key_b); + var b_open = true; + defer if (b_open) b.close(); + const wrong = try b.turn(a, try std.fmt.allocPrint(a, "{{\"type\":\"response.create\",\"input\":\"x\",\"previous_response_id\":\"{s}\"}}", .{rid})); + const unknown = try b.turn(a, "{\"type\":\"response.create\",\"input\":\"x\",\"previous_response_id\":\"resp_missing\"}"); + try t.expectEqualStrings("error", client.last(wrong).strField("type").?); + try t.expectEqualStrings(client.code(unknown), client.code(wrong)); + try t.expectEqualStrings("previous_response_not_found", client.code(wrong)); + var own: client.Client = undefined; + try own.open(a, f.io, f.port, key_a); + var own_open = true; + defer if (own_open) own.close(); + const warm = try own.turn(a, "{\"type\":\"response.create\",\"input\":\"owned warmup\",\"generate\":false}"); + const warm_id = client.final(warm).strField("id").?; + _ = try id(a, try client.http(a, f.io, f.port, "GET", try path(a, warm_id), key_a, "")); + try t.expectEqual(@as(u16, 404), (try client.http(a, f.io, f.port, "GET", try path(a, warm_id), key_b, "")).status); + var again: client.Client = undefined; + try again.open(a, f.io, f.port, key_a); + var again_open = true; + defer if (again_open) again.close(); + const continued = try again.turn(a, try std.fmt.allocPrint(a, "{{\"type\":\"response.create\",\"input\":\"next\",\"previous_response_id\":\"{s}\"}}", .{warm_id})); + try t.expectEqualStrings("response.completed", client.last(continued).strField("type").?); + again.close(); + again_open = false; + own.close(); + own_open = false; + b.close(); + b_open = false; + try f.stop(); +} + +fn running(a: A, io: std.Io) ![]const u8 { + const until = std.Io.Clock.awake.now(io).toNanoseconds() + 5 * std.time.ns_per_s; + while (std.Io.Clock.awake.now(io).toNanoseconds() < until) { + for (try cancels.registry.held(io, a)) |name| if (std.mem.startsWith(u8, name, "resp_")) return name; + try std.Io.sleep(io, .fromMilliseconds(1), .awake); + } + return error.ResponseDidNotStart; +} + +test "Responses owner socket: another full key cannot cancel a running response or read its cancelled result" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.start(t.allocator, t.io, .{ .api_key = &.{ key_a, key_b } }); + errdefer f.stop() catch {}; + var c: client.Client = undefined; + try c.open(a, f.io, f.port, key_a); + var c_open = true; + defer if (c_open) c.close(); + try c.send(a, "{\"type\":\"response.create\",\"input\":\"hold @hang\"}"); + const rid = try running(a, f.io); + const route = try std.fmt.allocPrint(a, "/v1/requests/{s}/cancel", .{rid}); + const missing = "/v1/requests/resp_missing/cancel"; + try sameMiss(a, try client.http(a, f.io, f.port, "POST", route, key_b, ""), try client.http(a, f.io, f.port, "POST", missing, key_b, ""), rid); + try t.expectEqual(@as(u16, 200), (try client.http(a, f.io, f.port, "POST", route, key_a, "")).status); + const done = try c.until(a); + try t.expectEqualStrings("cancelled", client.final(done).strField("status").?); + _ = try id(a, try client.http(a, f.io, f.port, "GET", try path(a, rid), key_a, "")); + try t.expectEqual(@as(u16, 404), (try client.http(a, f.io, f.port, "GET", try path(a, rid), key_b, "")).status); + c.close(); + c_open = false; + try f.stop(); +} + +test "Responses owner socket: a single key and a keyless server retain read, continue and delete" { + for ([_]?[]const u8{ key_a, null }) |key| { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.start(t.allocator, t.io, .{ .api_key = if (key != null) &.{key_a} else &.{} }); + errdefer f.stop() catch {}; + const rid = try id(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key, "{\"input\":\"owned\"}")); + _ = try id(a, try client.http(a, f.io, f.port, "GET", try path(a, rid), key, "")); + _ = try id(a, try client.http(a, f.io, f.port, "POST", "/v1/responses", key, try next(a, rid))); + try t.expectEqual(@as(u16, 200), (try client.http(a, f.io, f.port, "DELETE", try path(a, rid), key, "")).status); + try f.stop(); + } +} diff --git a/zig/src/server/responses_owner_test.zig b/zig/src/server/responses_owner_test.zig new file mode 100644 index 00000000000..67b348a58e9 --- /dev/null +++ b/zig/src/server/responses_owner_test.zig @@ -0,0 +1,226 @@ +//! Responses ownership through production handlers and key matching, without a listening socket. +const std = @import("std"); +const json = @import("json"); +const api = @import("engine_api"); +const server = @import("server.zig"); +const auth = @import("auth.zig"); +const harness = @import("ocr/harness_test.zig"); +const cancels = @import("cancel_ids.zig"); +const t = std.testing; +const A = std.mem.Allocator; +const key_a = "owner-test-a"; +const key_b = "owner-test-b"; +const Reply = struct { status: u16, body: []const u8 }; + +const Fixture = struct { + srv: *server.Server, + keys: auth.Store, + text: @import("stream_preflight_test.zig").TestText = .{}, + probe: bool = false, + foreign: u16 = 0, + own: u16 = 0, + asked_by_other: bool = false, + foreign_body: ?[]u8 = null, + submitted: usize = 0, + + fn init(f: *Fixture, keys: []const []const u8) !void { + var why: []const u8 = ""; + f.* = .{ .srv = undefined, .keys = try auth.Store.init(t.allocator, keys, "", null, false, &why) }; + errdefer f.keys.deinit(); + f.srv = try server.Server.init(t.allocator, t.io, f.engine(), f.text.text(), .{ .served_name = "m", .model_ids = &.{"m"}, .enable_thinking = false, .use_drafts = false }, &f.keys); + } + fn deinit(f: *Fixture) void { + f.srv.deinit(); + f.keys.deinit(); + if (f.foreign_body) |body| t.allocator.free(body); + } + fn http(f: *Fixture, a: A, method: []const u8, route: []const u8, key: ?[]const u8, body: []const u8) !Reply { + var wire: harness.Wire = .{ .a = a }; + const conn = try harness.request(a, &wire, route, "application/json", body); + conn.method = method; + conn.peer = "127.0.0.1"; + conn.auth_enabled = f.keys.enabled(); + if (key) |value| { + const bearer = try std.fmt.allocPrint(a, "Bearer {s}", .{value}); + const matched = f.keys.matchIdentity(a, bearer, null) orelse return error.TestKeyDidNotMatch; + conn.key_digest = matched.digest; + conn.key_label = matched.label; + conn.key_scopes = matched.scopes; + } + f.srv.dispatch(conn, a); + return .{ .status = wire.status(), .body = wire.bytes.items[wire.head().len..] }; + } + fn engine(f: *Fixture) api.Engine { + return .{ .ctx = f, .vtable = &.{ .info = info, .submit = submit, .cancel = cancel, .status = status, .memory = memory } }; + } + fn info(_: *anyopaque) api.Info { + return .{ .context_window = 4096 }; + } + fn submit(ptr: *anyopaque, rid: api.Id, _: *const api.Request, sink: api.Sink) api.SubmitError!void { + const f: *Fixture = @ptrCast(@alignCast(ptr)); + f.submitted += 1; + sink.event(sink.ctx, rid, &.{ .prefilled = 0 }); + sink.event(sink.ctx, rid, &.{ .tokens = &.{ 'o', 'k' } }); + if (f.probe) { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const name = cancels.alias orelse return error.Busy; + const route = std.fmt.allocPrint(a, "/v1/requests/{s}/cancel", .{name}) catch return error.Busy; + const other = f.http(a, "POST", route, key_b, "") catch return error.Busy; + f.foreign = other.status; + f.foreign_body = t.allocator.dupe(u8, other.body) catch return error.Busy; + cancels.registry.mutex.lockUncancelable(t.io); + f.asked_by_other = cancels.registry.map.get(name).?.asked.load(.acquire); + cancels.registry.mutex.unlock(t.io); + f.own = (f.http(a, "POST", route, key_a, "") catch return error.Busy).status; + } + sink.event(sink.ctx, rid, &.{ .finished = .{ .reason = if (f.probe) .cancelled else .stop } }); + } + fn cancel(_: *anyopaque, _: api.Id) void {} + fn status(_: *anyopaque, out: *api.Status, _: []u32) void { + out.* = .{}; + } + fn memory(_: *anyopaque, _: bool) ?api.Memory { + return null; + } +}; + +fn id(a: A, reply: Reply) ![]const u8 { + try t.expectEqual(@as(u16, 200), reply.status); + return (try json.parse(a, reply.body)).ok.strField("id").?; +} +fn path(a: A, rid: []const u8) ![]u8 { + return std.fmt.allocPrint(a, "/v1/responses/{s}", .{rid}); +} +fn next(a: A, rid: []const u8) ![]u8 { + return std.fmt.allocPrint(a, "{{\"input\":\"next\",\"previous_response_id\":\"{s}\"}}", .{rid}); +} +fn sameMiss(a: A, foreign: Reply, missing: Reply, rid: []const u8) !void { + try t.expectEqual(missing.status, foreign.status); + const one = try std.mem.replaceOwned(u8, a, foreign.body, rid, ""); + const two = try std.mem.replaceOwned(u8, a, missing.body, "resp_missing", ""); + try t.expectEqualStrings(two, one); +} + +test "Responses owner: another full key cannot read, continue or delete a stored response" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.init(&.{ key_a, key_b }); + defer f.deinit(); + const rid = try id(a, try f.http(a, "POST", "/v1/responses", key_a, "{\"input\":\"private A turn\"}")); + const stored = try path(a, rid); + const missing = "/v1/responses/resp_missing"; + try sameMiss(a, try f.http(a, "GET", stored, key_b, ""), try f.http(a, "GET", missing, key_b, ""), rid); + try sameMiss(a, try f.http(a, "POST", "/v1/responses", key_b, try next(a, rid)), try f.http(a, "POST", "/v1/responses", key_b, try next(a, "resp_missing")), rid); + try sameMiss(a, try f.http(a, "DELETE", stored, key_b, ""), try f.http(a, "DELETE", missing, key_b, ""), rid); + _ = try id(a, try f.http(a, "GET", stored, key_a, "")); + const child = try id(a, try f.http(a, "POST", "/v1/responses", key_a, try next(a, rid))); + try t.expectEqual(@as(u16, 404), (try f.http(a, "GET", try path(a, child), key_b, "")).status); + try t.expectEqual(@as(u16, 200), (try f.http(a, "DELETE", stored, key_a, "")).status); +} + +test "Responses owner: another full key cannot signal a running Responses cancellation" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.init(&.{ key_a, key_b }); + defer f.deinit(); + f.probe = true; + const made = try f.http(a, "POST", "/v1/responses", key_a, "{\"input\":\"cancel this A turn\"}"); + const rid = try id(a, made); + try t.expectEqual(@as(u16, 404), f.foreign); + try t.expect(!f.asked_by_other); + try t.expectEqual(@as(u16, 200), f.own); + const unknown = try f.http(a, "POST", try std.fmt.allocPrint(a, "/v1/requests/{s}/cancel", .{rid}), key_b, ""); + try t.expectEqual(@as(u16, 404), unknown.status); + try t.expectEqualStrings(unknown.body, f.foreign_body.?); + try t.expectEqualStrings("cancelled", (try json.parse(a, made.body)).ok.strField("status").?); + _ = try id(a, try f.http(a, "GET", try path(a, rid), key_a, "")); + try t.expectEqual(@as(u16, 404), (try f.http(a, "GET", try path(a, rid), key_b, "")).status); +} + +test "Responses owner: single-key and keyless read, continuation and deletion stay unchanged" { + for ([_]?[]const u8{ key_a, null }) |key| { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.init(if (key != null) &.{key_a} else &.{}); + defer f.deinit(); + const rid = try id(a, try f.http(a, "POST", "/v1/responses", key, "{\"input\":\"owned\"}")); + _ = try id(a, try f.http(a, "GET", try path(a, rid), key, "")); + _ = try id(a, try f.http(a, "POST", "/v1/responses", key, try next(a, rid))); + try t.expectEqual(@as(u16, 200), (try f.http(a, "DELETE", try path(a, rid), key, "")).status); + } +} + +const Events = struct { + count: usize = 0, + fn sink(e: *Events) @import("responses_sink.zig").Sink { + return .{ .ctx = e, .vt = &.{ .open = open, .event = event, .keepalive = keepalive } }; + } + fn open(_: *anyopaque) error{Closed}!void {} + fn keepalive(_: *anyopaque) error{Closed}!void {} + fn event(ptr: *anyopaque, _: A, _: []const u8, _: *json.Object) error{Closed}!void { + const e: *Events = @ptrCast(@alignCast(ptr)); + e.count += 1; + } +}; + +test "Responses owner: a stored warmup records its creator without a generation request" { + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var f: Fixture = undefined; + try f.init(&.{ key_a, key_b }); + defer f.deinit(); + var cx: @import("errors.zig").Cx = .{ .a = a }; + const body = (try json.parse(a, "{\"input\":\"warmup\"}")).ok; + const NoHistory = struct { + pub fn conversation(_: @This(), c: *@import("errors.zig").Cx, _: json.Value) @import("errors.zig").Refused![]json.Value { + return c.refuse("no earlier turn"); + } + }; + const translated = try @import("responses_translate.zig").translate(&cx, body, NoHistory{}); + const matched = f.keys.matchIdentity(a, "Bearer " ++ key_a, null).?; + var events: Events = .{}; + const made = @import("responses.zig").warmup(f.srv, a, &cx, body, translated, events.sink(), 6, .{}, matched.digest) orelse return error.WarmupFailed; + try t.expect(events.count >= 3); + try t.expectEqual(@as(usize, 0), f.submitted); + const rid = made.strField("id").?; + _ = try id(a, try f.http(a, "GET", try path(a, rid), key_a, "")); + try t.expectEqual(@as(u16, 404), (try f.http(a, "GET", try path(a, rid), key_b, "")).status); +} + +test "Responses owner: every chain ancestor and keyless entry keeps its own identity" { + const store = @import("responses_store.zig"); + var arena = std.heap.ArenaAllocator.init(t.allocator); + defer arena.deinit(); + const a = arena.allocator(); + var cx: @import("errors.zig").Cx = .{ .a = a }; + var s: store.Store = .{ .gpa = t.allocator }; + defer s.deinit(); + const one: [32]u8 = @splat(1); + const two: [32]u8 = @splat(2); + var messages = [_]json.Value{(try json.parse(a, "{\"role\":\"user\",\"content\":\"private\"}")).ok}; + try s.put(t.io, &cx, (try json.parse(a, "{\"id\":\"resp_b\",\"output\":[]}")).ok, &messages, two); + try s.put(t.io, &cx, (try json.parse(a, "{\"id\":\"resp_a\",\"previous_response_id\":\"resp_b\",\"output\":[]}")).ok, &messages, one); + try s.put(t.io, &cx, (try json.parse(a, "{\"id\":\"resp_plain\",\"output\":[]}")).ok, &messages, null); + const ha: store.History = .{ .store = &s, .io = t.io, .owner = one }; + const hb: store.History = .{ .store = &s, .io = t.io, .owner = two }; + const hp: store.History = .{ .store = &s, .io = t.io, .owner = null }; + try t.expect(ha.lookup(&cx, "resp_a") == null); + try t.expect(hb.lookup(&cx, "resp_a") == null); + try t.expect(hp.lookup(&cx, "resp_a") == null); + try t.expect(ha.lookup(&cx, "resp_plain") == null); + try t.expectEqual(@as(usize, 1), hp.lookup(&cx, "resp_plain").?.len); + try s.putWhole(t.io, &cx, (try json.parse(a, "{\"id\":\"resp_whole\",\"previous_response_id\":\"resp_b\",\"output\":[]}")).ok, &messages, one); + try t.expectEqual(@as(usize, 1), ha.lookup(&cx, "resp_whole").?.len); + try t.expect(hb.lookup(&cx, "resp_whole") == null); + try t.expect((try s.get(t.io, a, "resp_whole", null)) == null); + try t.expect(!(try s.get(t.io, a, "resp_whole", one)).?.has("owner")); +} diff --git a/zig/src/server/responses_store.zig b/zig/src/server/responses_store.zig index fffc21d6d4a..75e9fcdaf39 100644 --- a/zig/src/server/responses_store.zig +++ b/zig/src/server/responses_store.zig @@ -1,4 +1,4 @@ -//! The Responses store: the newest finished responses with their messages, and the chains they continue. +//! The Responses store: finished responses and their chains, each visible only to its creating key identity. const std = @import("std"); const json = @import("json"); const errors = @import("errors.zig"); @@ -15,6 +15,7 @@ const Entry = struct { parent: ?[]const u8, messages: []Value, size: usize, + owner: ?[32]u8, }; /// The newest stored responses, in memory, for GET, DELETE and ``previous_response_id``. @@ -37,27 +38,28 @@ pub const Store = struct { gpa.destroy(e); } - fn find(s: *Store, id: []const u8) ?usize { - for (s.entries.items, 0..) |e, i| if (std.mem.eql(u8, e.id, id)) return i; + fn find(s: *Store, id: []const u8, owner: ?[32]u8) ?usize { + for (s.entries.items, 0..) |e, i| if (std.mem.eql(u8, e.id, id) and std.meta.eql(e.owner, owner)) return i; return null; } /// Keeps a finished response with the messages it added; the oldest go past 1,024 entries or 256 MiB. - pub fn put(s: *Store, io: std.Io, cx: *Cx, response: Value, added: []const Value) !void { + pub fn put(s: *Store, io: std.Io, cx: *Cx, response: Value, added: []const Value, owner: ?[32]u8) !void { const from_output = try translate_mod.messages(cx, response.get("output").?.array); const all = try std.mem.concat(cx.a, Value, &.{ added, from_output }); - return s.insert(io, cx, response, all, true); + return s.insert(io, cx, response, all, true, owner); } /// Keeps a finished response with its whole conversation and no stored parent (its public fields stay as sent). - pub fn putWhole(s: *Store, io: std.Io, cx: *Cx, response: Value, messages: []Value) !void { - return s.insert(io, cx, response, messages, false); + pub fn putWhole(s: *Store, io: std.Io, cx: *Cx, response: Value, messages: []Value, owner: ?[32]u8) !void { + return s.insert(io, cx, response, messages, false, owner); } /// One entry for ``response`` with these messages; ``chained`` links it to its ``previous_response_id``. - fn insert(s: *Store, io: std.Io, cx: *Cx, response: Value, messages: []Value, chained: bool) !void { + fn insert(s: *Store, io: std.Io, cx: *Cx, response: Value, messages: []Value, chained: bool, owner: ?[32]u8) !void { const e = try s.gpa.create(Entry); e.arena = .init(s.gpa); + e.owner = owner; errdefer free(s.gpa, e); const a = e.arena.allocator(); e.response = try json.deepCopy(a, response); @@ -68,7 +70,7 @@ pub const Store = struct { e.size = (try json.stringify(cx.a, e.response, .{})).len + (try json.stringify(cx.a, .{ .array = e.messages }, .{})).len; s.mutex.lockUncancelable(io); defer s.mutex.unlock(io); - if (s.find(e.id)) |i| { + if (s.find(e.id, owner)) |i| { const old = s.entries.orderedRemove(i); s.bytes -= old.size; free(s.gpa, old); @@ -82,17 +84,17 @@ pub const Store = struct { } } - pub fn get(s: *Store, io: std.Io, a: Allocator, id: []const u8) !?Value { + pub fn get(s: *Store, io: std.Io, a: Allocator, id: []const u8, owner: ?[32]u8) !?Value { s.mutex.lockUncancelable(io); defer s.mutex.unlock(io); - const i = s.find(id) orelse return null; + const i = s.find(id, owner) orelse return null; return try json.deepCopy(a, s.entries.items[i].response); } - pub fn delete(s: *Store, io: std.Io, id: []const u8) bool { + pub fn delete(s: *Store, io: std.Io, id: []const u8, owner: ?[32]u8) bool { s.mutex.lockUncancelable(io); defer s.mutex.unlock(io); - const i = s.find(id) orelse return false; + const i = s.find(id, owner) orelse return false; const old = s.entries.orderedRemove(i); s.bytes -= old.size; free(s.gpa, old); @@ -104,6 +106,7 @@ pub const Store = struct { pub const History = struct { store: *Store, io: std.Io, + owner: ?[32]u8, pub fn conversation(h: History, cx: *Cx, rid: Value) errors.Refused![]Value { if (rid != .string) return cx.refuse("previous_response_id must be a string"); @@ -131,7 +134,7 @@ pub const History = struct { var chain: std.ArrayList([]Value) = .empty; var at: ?[]const u8 = id; while (at) |x| { - const i = s.find(x) orelse return .{ .missing = try a.dupe(u8, x) }; + const i = s.find(x, h.owner) orelse return .{ .missing = try a.dupe(u8, x) }; const e = s.entries.orderedRemove(i); s.entries.append(s.gpa, e) catch {}; try chain.append(a, e.messages); @@ -155,16 +158,16 @@ test "a whole response keeps its own conversation and no stored parent, and a lo var cx: Cx = .{ .a = a }; var s: Store = .{ .gpa = std.testing.allocator }; defer s.deinit(); - const h: History = .{ .store = &s, .io = io }; + const h: History = .{ .store = &s, .io = io, .owner = null }; const user = (try json.parse(a, "{\"role\":\"user\",\"content\":\"x\"}")).ok; var one = [_]Value{user}; - try s.put(io, &cx, (try json.parse(a, "{\"id\":\"resp_p\",\"output\":[]}")).ok, &one); - try s.put(io, &cx, (try json.parse(a, "{\"id\":\"resp_d\",\"previous_response_id\":\"resp_p\",\"output\":[]}")).ok, &one); + try s.put(io, &cx, (try json.parse(a, "{\"id\":\"resp_p\",\"output\":[]}")).ok, &one, null); + try s.put(io, &cx, (try json.parse(a, "{\"id\":\"resp_d\",\"previous_response_id\":\"resp_p\",\"output\":[]}")).ok, &one, null); var three = [_]Value{ user, user, user }; - try s.putWhole(io, &cx, (try json.parse(a, "{\"id\":\"resp_c\",\"previous_response_id\":\"resp_p\",\"output\":[]}")).ok, &three); + try s.putWhole(io, &cx, (try json.parse(a, "{\"id\":\"resp_c\",\"previous_response_id\":\"resp_p\",\"output\":[]}")).ok, &three, null); try std.testing.expectEqual(@as(usize, 2), h.lookup(&cx, "resp_d").?.len); try std.testing.expectEqual(@as(usize, 3), h.lookup(&cx, "resp_c").?.len); - try std.testing.expectEqualStrings("resp_p", (try s.get(io, a, "resp_c")).?.get("previous_response_id").?.string); + try std.testing.expectEqualStrings("resp_p", (try s.get(io, a, "resp_c", null)).?.get("previous_response_id").?.string); try std.testing.expect(h.lookup(&cx, "resp_x") == null); try std.testing.expectError(error.Refused, h.conversation(&cx, .{ .string = "resp_x" })); try std.testing.expectEqual(@as(usize, 3), (try h.conversation(&cx, .{ .string = "resp_c" })).len); diff --git a/zig/src/server/responses_ws_turn.zig b/zig/src/server/responses_ws_turn.zig index a7f27e048c4..63cdefc160e 100644 --- a/zig/src/server/responses_ws_turn.zig +++ b/zig/src/server/responses_ws_turn.zig @@ -160,7 +160,7 @@ fn warm(s: *Session, a: Allocator, cx: *Cx, body: Value, t: translate_mod.Reques .refused => |r| return refuse(s, out.stream_id, Problem.fromPayload(r.status, r.payload)), .prepared => |p| { s.srv.release(p.preparing, p.request); - const final = responses.warmup(s.srv, a, cx, body, t, out.sink(), p.prompt_len, opts); + const final = responses.warmup(s.srv, a, cx, body, t, out.sink(), p.prompt_len, opts, s.conn.key_digest); return .{ .status = if (final == null and s.gone and !out.sent) 0 else 200, .final = final, .added = t.added }; }, } @@ -236,7 +236,7 @@ const SocketHistory = struct { return copy; } if (h.store_flag) { - const stored: store_mod.History = .{ .store = &h.session.srv.store, .io = h.session.srv.io }; + const stored: store_mod.History = .{ .store = &h.session.srv.store, .io = h.session.srv.io, .owner = h.session.conn.key_digest }; if (stored.lookup(cx, rid.string)) |messages| { h.earlier = messages; return messages; diff --git a/zig/src/server/root.zig b/zig/src/server/root.zig index 7069ccb3fc5..75003e518b5 100644 --- a/zig/src/server/root.zig +++ b/zig/src/server/root.zig @@ -61,6 +61,8 @@ test { _ = @import("reply_code.zig"); _ = @import("reply_text.zig"); _ = @import("reply_incremental_test.zig"); + _ = @import("recipient_reply_test.zig"); + _ = @import("recipient_cut_test.zig"); _ = @import("tool_parse.zig"); _ = @import("tool_lfm2.zig"); _ = @import("tool_lfm2_stream_test.zig"); @@ -93,6 +95,7 @@ test { _ = @import("chunk_plan.zig"); _ = @import("status_routes.zig"); _ = @import("models_input_types_test.zig"); + _ = @import("models_id_test.zig"); _ = @import("speech.zig"); _ = @import("images_generations.zig"); if (comptime @import("builtin").os.tag != .windows) _ = @import("images_batch_test.zig"); // uses a socketpair test @@ -121,11 +124,13 @@ test { _ = @import("process_memory.zig"); _ = @import("process_resident.zig"); _ = @import("log.zig"); + _ = @import("log_test.zig"); _ = @import("request_log.zig"); _ = @import("request_journal_test.zig"); _ = @import("messages.zig"); _ = @import("pdf.zig"); _ = @import("pdf_flags_test.zig"); + _ = @import("pdf_measure_test.zig"); _ = @import("jpeg_out.zig"); _ = @import("images.zig"); _ = @import("images_video_marker_test.zig"); @@ -160,6 +165,7 @@ test { _ = @import("stream_scan_text.zig"); _ = @import("stream_scan_bench.zig"); _ = @import("stream_memory_wire_test.zig"); + _ = @import("warm_reasoning_test.zig"); _ = @import("stream_scan_stages.zig"); _ = @import("think_tool_tail_test.zig"); _ = @import("deepseek_reply_test.zig"); @@ -248,6 +254,8 @@ test { _ = @import("message_starts_proof_test.zig"); _ = @import("message_marks_test.zig"); _ = @import("responses_store.zig"); + _ = @import("responses_owner_test.zig"); + _ = @import("responses_owner_socket_test.zig"); _ = @import("cortheon/cortheon.zig"); _ = @import("cortheon/cortheon_test.zig"); _ = @import("cortheon/research.zig"); @@ -279,6 +287,18 @@ test { } } +test { + _ = @import("chat_cli_args.zig"); + _ = @import("chat_cli_history.zig"); + _ = @import("chat_cli_reply.zig"); + _ = @import("chat_cli_turn.zig"); + // the chat's own serve child and its runs against fakes use POSIX signals and processes, as the benchmark's do + if (comptime @import("builtin").os.tag != .windows) { + _ = @import("chat_cli_child.zig"); + _ = @import("chat_cli_test.zig"); + } +} + test { _ = @import("slide_retention_test.zig"); _ = @import("slide_shrink_test.zig"); @@ -331,6 +351,7 @@ test { _ = @import("ocr/mistral_test.zig"); _ = @import("ocr/mistral_sdk_test.zig"); _ = @import("ocr/run_test.zig"); + _ = @import("ocr/run_pdf_test.zig"); _ = @import("ocr/size_test.zig"); _ = @import("ocr/prompt_ids_test.zig"); _ = @import("ollama_e2e_test.zig"); diff --git a/zig/src/server/routes.zig b/zig/src/server/routes.zig index 820072b4a30..6748b0bd098 100644 --- a/zig/src/server/routes.zig +++ b/zig/src/server/routes.zig @@ -115,6 +115,7 @@ fn get(srv: *Server, conn: *Conn, a: Allocator) void { if (std.mem.eql(u8, route, "/api/show")) return ollama.show(srv, conn, a); if (std.mem.eql(u8, route, "/api/ps")) return ollama.ps(srv, conn, a); if (std.mem.eql(u8, route, "/api/version")) return ollama.version(srv, conn, a); + if (auth_scope.modelId(route)) |id| return status.model(srv, conn, a, id) catch {}; if (std.mem.endsWith(u8, route, "/models")) return status.models(srv, conn, a) catch {}; unknown(conn, a); } diff --git a/zig/src/server/serve.zig b/zig/src/server/serve.zig index d06e5753a86..b3e37c27ca6 100644 --- a/zig/src/server/serve.zig +++ b/zig/src/server/serve.zig @@ -133,6 +133,7 @@ pub fn validateEnvironment() !void { /// Serves until a stop signal; the process exit status. pub fn run(gpa: Allocator, io: std.Io, args: cli.Args, s: Setup) u8 { validateEnvironment() catch return 1; + log.setJson(args.log_json); stop_requested.store(false, .release); stop_count.store(0, .release); stop_signal.store(0, .release); diff --git a/zig/src/server/server.zig b/zig/src/server/server.zig index 1fcc94daf0e..ed30695d572 100644 --- a/zig/src/server/server.zig +++ b/zig/src/server/server.zig @@ -11,6 +11,7 @@ const request_guard = @import("request_guard.zig"); const metrics = @import("metrics.zig"); const model_text = @import("model_text.zig"); const reply_text = @import("reply_text.zig"); +const recipient_reply = @import("recipient_reply.zig"); const http_conn = @import("http_conn.zig"); const admission = @import("http_admission.zig"); const listener_mod = @import("listener.zig"); @@ -144,9 +145,13 @@ pub const Server = struct { late_system: []const u8 = "system", needs_user_after_tool: bool = false, markers: reply_text.Markers = reply_text.think_markers, + /// Replies are messages to recipients (`to=self` reasoning, `to=user` answer, a tool's name a call). + recipients: bool = false, close_id: ?u32 = null, // the close marker's own token, when the marker is one token chunks: chunk_plan.Plan = .{}, effort_levels: []const []const u8 = &.{}, + /// The effort a recipient template hears with thinking off: it has no switch, so its lowest level, not its default. + off_effort: ?[]const u8 = null, thinking_switch: bool = false, video_decoder: bool = false, // libtfvideo loaded in `init`: with the video offer it decides video input (#3004) eos: []const u32 = &.{}, @@ -238,8 +243,10 @@ pub const Server = struct { const minimax = text.tokenId(reply_text.mm_markers.close) != null; if (minimax) srv.markers = reply_text.mm_markers; srv.close_id = text.tokenId(srv.markers.close); + srv.recipients = recipient_reply.detect(text); const source = text.templateSource(); srv.effort_levels = try fields.effortLevels(a, source); + if (srv.recipients and srv.effort_levels.len > 0) srv.off_effort = fields.coerceEffort("minimal", srv.effort_levels); // MiniMax-M3's template decides on its own; thinking off closes the block in the prompt (prompt.zig) srv.thinking_switch = minimax or std.mem.indexOf(u8, source, "enable_thinking") != null or std.mem.indexOf(u8, source, "thinking_mode") != null; @@ -567,14 +574,7 @@ fn seedBits(v: Value) u64 { if (std.fmt.parseInt(i128, v.int, 10)) |n| return @truncate(@as(u128, @bitCast(n))) else |_| return 0; } -/// ``template_late_system``: "system" when the template keeps a later system message in place, else "user". -fn lateSystem(a: Allocator, text: model_text.Text) ![]const u8 { - const probe_text = "tensorfold-late-system-probe"; - const probe = (try json.parse(a, "[{\"role\": \"system\", \"content\": \"s\"}, {\"role\": \"user\", \"content\": \"u\"}, {\"role\": \"assistant\", \"content\": \"a\"}, {\"role\": \"system\", \"content\": \"tensorfold-late-system-probe\"}, {\"role\": \"user\", \"content\": \"v\"}]")).ok; - var problem: []const u8 = ""; - const rendered = text.render(a, probe, .{ .add_generation_prompt = false }, &problem) catch return "user"; - return if (std.mem.indexOf(u8, rendered.text, probe_text) != null) "system" else "user"; -} +const lateSystem = @import("late_system.zig").lateSystem; /// With image input: whether a user turn holding an image part renders an image placeholder (else a startup warning). fn templateImages(srv: *Server) bool { diff --git a/zig/src/server/speech.zig b/zig/src/server/speech.zig index 608588032eb..b1a04b213b5 100644 --- a/zig/src/server/speech.zig +++ b/zig/src/server/speech.zig @@ -62,6 +62,7 @@ pub fn post(srv: *Server, c: *Conn, a: Allocator) !void { }; var cx: Cx = .{ .a = a }; const id = try ids.make(a, "speech-", 32); + c.id = id; const received = clock.nowNs(srv.io); var metadata: Metadata = .{ .enabled = srv.config.redraw.count() > 0, .register_on = srv.config.redraw.register.on() }; const raw = http_body.readJson(c, &cx) catch |e| return refuse(c, &cx, id, metadata, e); diff --git a/zig/src/server/status_routes.zig b/zig/src/server/status_routes.zig index ed21d5db302..2bca4c16b70 100644 --- a/zig/src/server/status_routes.zig +++ b/zig/src/server/status_routes.zig @@ -1,9 +1,11 @@ -//! GET /health, /v1/models, /metrics, and the opt-in dashboard. +//! GET /health, /v1/models and one model's /v1/models/{id}, /metrics, and the opt-in dashboard. const std = @import("std"); const api = @import("engine_api"); const json = @import("json"); const live = @import("live.zig"); const routes = @import("routes.zig"); +const pyrepr = @import("pyrepr.zig"); +const percentDecode = @import("tool_kinds.zig").percentDecode; const manifest = @import("benchmark_manifest.zig"); const metric_text = @import("metrics.zig"); const Server = @import("server.zig").Server; @@ -79,17 +81,38 @@ pub fn manifestRoute(srv: *Server, conn: *Conn, a: Allocator) !void { } pub fn models(srv: *Server, conn: *Conn, a: Allocator) !void { + const o = try json.newObject(a); + try o.put(a, "object", .{ .string = "list" }); + try o.put(a, "data", .{ .array = try entries(srv, a, srv.config.model_ids) }); + routes.sendValue(conn, a, 200, .{ .object = o }); +} + +/// GET /v1/models/{id}: the listing's entry for a served id or alias, `raw` percent-decoded; else 404 model_not_found. +pub fn model(srv: *Server, conn: *Conn, a: Allocator, raw: []const u8) !void { + const id = (try percentDecode(a, raw)) orelse raw; // a % that escapes no hex pair is read as written + for (srv.config.model_ids) |known| { + if (std.mem.eql(u8, known, id)) return routes.sendValue(conn, a, 200, (try entries(srv, a, &.{known}))[0]); + } + const err = try json.newObject(a); + try err.put(a, "message", .{ .string = try std.fmt.allocPrint(a, "model {s} is not served here", .{try pyrepr.repr(a, .{ .string = id })}) }); + try err.put(a, "type", .{ .string = "invalid_request_error" }); + try err.put(a, "param", .{ .string = "model" }); + try err.put(a, "code", .{ .string = "model_not_found" }); + const o = try json.newObject(a); + try o.put(a, "error", .{ .object = err }); + routes.sendValue(conn, a, 404, .{ .object = o }); +} + +/// The discovery entries for `ids`, as the listing and the one-model route both send them. +fn entries(srv: *Server, a: Allocator, ids: []const []const u8) ![]Value { const info = if (srv.idle_manager) |m| m.readInfo(srv) else srv.info; const created = std.Io.Clock.real.now(srv.io).toSeconds(); - const data = try a.alloc(Value, srv.config.model_ids.len); + const data = try a.alloc(Value, ids.len); const reasoning = try modelReasoning(a, srv); - for (srv.config.model_ids, data) |id, *slot| { + for (ids, data) |id, *slot| { slot.* = try modelValue(a, id, info, created, reasoning, .of(info.vision, srv.video_decoder)); } - const o = try json.newObject(a); - try o.put(a, "object", .{ .string = "list" }); - try o.put(a, "data", .{ .array = data }); - routes.sendValue(conn, a, 200, .{ .object = o }); + return data; } fn modelReasoning(a: Allocator, srv: *const Server) Allocator.Error!?Value { diff --git a/zig/src/server/tool_kinds.zig b/zig/src/server/tool_kinds.zig index 53a9b4f4401..a5a61c4a112 100644 --- a/zig/src/server/tool_kinds.zig +++ b/zig/src/server/tool_kinds.zig @@ -180,8 +180,8 @@ fn resolvePointer(a: Allocator, root: Value, ref: []const u8) Allocator.Error!?V return current; } -/// The fragment with its percent escapes decoded, or null when one is not a hex pair. -fn percentDecode(a: Allocator, text: []const u8) Allocator.Error!?[]const u8 { +/// The text with its percent escapes decoded, or null when one is not a hex pair. +pub fn percentDecode(a: Allocator, text: []const u8) Allocator.Error!?[]const u8 { if (std.mem.indexOfScalar(u8, text, '%') == null) return text; var out: std.ArrayList(u8) = .empty; var i: usize = 0; diff --git a/zig/src/server/warm.zig b/zig/src/server/warm.zig index 5b4629993e8..2885b63126e 100644 --- a/zig/src/server/warm.zig +++ b/zig/src/server/warm.zig @@ -25,13 +25,28 @@ const Pass = struct { } }; -/// Prefill the conversation, `message` (the reply as sent) and the next turn's opening, on `warm_turns` engines. -pub fn reply(srv: *Server, input: chat.Input, message: Value, thinking: bool, effort: ?[]const u8, prompt_len: usize) void { +/// Whether the client sends reasoning back: its latest assistant message has `reasoning_content`. +pub fn echoesReasoning(messages: Value) bool { + if (messages != .array) return false; + var i = messages.array.len; + while (i > 0) { + i -= 1; + const m = messages.array[i]; + if (m != .object) continue; + const role = m.get("role") orelse continue; + if (role != .string or !std.mem.eql(u8, role.string, "assistant")) continue; + return m.get("reasoning_content") != null; + } + return false; +} + +/// Prefill the conversation, the reply as its client will send it back and the next turn's opening (warm_turns). +pub fn reply(srv: *Server, input: chat.Input, message: Value, reasoning: ?[]const u8, thinking: bool, effort: ?[]const u8, prompt_len: usize) void { if (!srv.info.warm_turns or input.prompt != null or input.messages != .array) return; - start(srv, input, message, thinking, effort, prompt_len) catch |e| log.line("next turn: no background prefill ({s})", .{@errorName(e)}); + start(srv, input, message, reasoning, thinking, effort, prompt_len) catch |e| log.line("next turn: no background prefill ({s})", .{@errorName(e)}); } -fn start(srv: *Server, input: chat.Input, message: Value, thinking: bool, effort: ?[]const u8, prompt_len: usize) !void { +fn start(srv: *Server, input: chat.Input, sent: Value, reasoning: ?[]const u8, thinking: bool, effort: ?[]const u8, prompt_len: usize) !void { const p = try srv.gpa.create(Pass); p.* = .{ .gpa = srv.gpa, .arena = .init(srv.gpa), .request = undefined }; var handed = false; @@ -40,6 +55,14 @@ fn start(srv: *Server, input: chat.Input, message: Value, thinking: bool, effort srv.gpa.destroy(p); }; const a = p.arena.allocator(); + var message = sent; + const r = reasoning orelse ""; + if (r.len > 0 and sent == .object and echoesReasoning(input.messages)) { + const copy = try json.newObject(a); + for (sent.object.keys(), sent.object.values()) |k, v| try copy.put(a, k, v); + try copy.put(a, "reasoning_content", .{ .string = r }); + message = .{ .object = copy }; + } const clear = input.fields.get("clear_thinking"); var cx: errors.Cx = .{ .a = a, .clear_thinking = if (clear != null and clear.? == .bool) clear.?.bool else null }; const asked = input.fields.get("reasoning_effort"); diff --git a/zig/src/server/warm_reasoning_test.zig b/zig/src/server/warm_reasoning_test.zig new file mode 100644 index 00000000000..edfb25ae8d6 --- /dev/null +++ b/zig/src/server/warm_reasoning_test.zig @@ -0,0 +1,124 @@ +//! The next turn's background prefill renders the reply as its client will send it back, reasoning included or not. +const std = @import("std"); +const api = @import("engine_api"); +const server = @import("root.zig"); +const json = server.json; +const model_text = @import("model_text.zig"); +const late = @import("late_system_test.zig"); + +/// Renders each message as `[role]`, `reasoning` when it has some, then its content and tool calls. +const Shown = struct { + fn text(t: *@This()) model_text.Text { + var base: late.DropLate = .{}; + var vt = base.text().vtable.*; + vt.render = render; + const held = std.testing.allocator.create(model_text.Text.VTable) catch unreachable; + held.* = vt; + return .{ .ctx = t, .vtable = held }; + } + + fn render(_: *anyopaque, a: std.mem.Allocator, messages: json.Value, _: model_text.RenderOptions, _: *[]const u8) model_text.Error!model_text.Rendered { + var out: std.ArrayList(u8) = .empty; + if (messages != .array) return .{ .text = out.items }; + for (messages.array) |m| { + try out.print(a, "[{s}]", .{late.textOf(m, "role")}); + const r = late.textOf(m, "reasoning_content"); + if (r.len > 0) try out.print(a, "{s}", .{r}); + try out.print(a, "{s}\n", .{late.textOf(m, "content")}); + if (m.get("tool_calls")) |calls| { + try out.appendSlice(a, try json.stringify(a, calls, .{ .compact = true })); + try out.append(a, '\n'); + } + } + return .{ .text = out.items }; + } +}; + +/// late_system_test's Capture with the reasoning capability: replies split their reasoning at ``. +const Thinking = struct { + inner: late.Capture, + + fn engine(e: *@This()) api.Engine { + var vt = e.inner.engine().vtable.*; + vt.info = info; + const held = std.testing.allocator.create(api.Engine.VTable) catch unreachable; + held.* = vt; + return .{ .ctx = &e.inner, .vtable = held }; + } + + fn info(_: *anyopaque) api.Info { + return .{ .warm_turns = true, .reasoning = true }; + } +}; + +const reply = "Because.Before.\n{\"name\":\"lookup\",\"arguments\":{\"q\":\"a\"}}"; +const tools = ",\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"lookup\",\"parameters\":{\"type\":\"object\"}}}]}"; + +fn warmed(e: *Thinking) ![]u8 { + const text = try std.testing.allocator.alloc(u8, e.inner.background_prompt.len); + for (e.inner.background_prompt, text) |id, *byte| byte.* = @intCast(id); + return text; +} + +test "warm turns: the guess carries the reply's reasoning unless the client's history drops it" { + var shown: Shown = .{}; + const t = shown.text(); + defer std.testing.allocator.destroy(t.vtable); + var backend: Thinking = .{ .inner = .{ .reply = reply, .warm_turns = true } }; + const eng = backend.engine(); + defer std.testing.allocator.destroy(eng.vtable); + defer std.testing.allocator.free(backend.inner.prompt); + defer std.testing.allocator.free(backend.inner.background_prompt); + const srv = try server.Server.init(std.testing.allocator, std.testing.io, eng, t, .{ + .served_name = "m", + .model_ids = &.{"m"}, + .enable_thinking = true, + .use_drafts = false, + }, null); + defer srv.deinit(); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + + // a first turn: no assistant message yet, so the guess keeps main's rendering without the reasoning + const first = try late.exchange(srv, "/v1/chat/completions", "{\"model\":\"m\",\"max_tokens\":64,\"messages\":[{\"role\":\"user\",\"content\":\"go\"}]" ++ tools); + defer std.testing.allocator.free(first.body); + try std.testing.expectEqual(@as(u16, 200), first.status); + const message = (try json.parse(a, first.body)).ok.get("choices").?.array[0].get("message").?; + try std.testing.expectEqualStrings("Because.", message.get("reasoning_content").?.string); + const w1 = try warmed(&backend); + defer std.testing.allocator.free(w1); + try std.testing.expect(std.mem.indexOf(u8, w1, "[assistant]Before.") != null); + try std.testing.expect(std.mem.indexOf(u8, w1, "Because.") == null); + + // a client that sent reasoning back keeps getting it in the guess + const echoing = "{\"model\":\"m\",\"max_tokens\":64,\"messages\":[{\"role\":\"user\",\"content\":\"go\"},{\"role\":\"assistant\",\"content\":\"Before.\",\"reasoning_content\":\"Earlier.\",\"tool_calls\":[{\"id\":\"call_1\",\"type\":\"function\",\"function\":{\"name\":\"lookup\",\"arguments\":\"{}\"}}]},{\"role\":\"tool\",\"tool_call_id\":\"call_1\",\"content\":\"x\"}]" ++ tools; + const second = try late.exchange(srv, "/v1/chat/completions", echoing); + defer std.testing.allocator.free(second.body); + try std.testing.expectEqual(@as(u16, 200), second.status); + const w2 = try warmed(&backend); + defer std.testing.allocator.free(w2); + try std.testing.expect(std.mem.indexOf(u8, w2, "[assistant]Earlier.Before.") != null); + try std.testing.expect(std.mem.indexOf(u8, w2, "[assistant]Because.Before.") != null); + + // a client whose history dropped reasoning gets a guess without it, as it will send this reply back + const dropping = "{\"model\":\"m\",\"max_tokens\":64,\"messages\":[{\"role\":\"user\",\"content\":\"go\"},{\"role\":\"assistant\",\"content\":\"Before.\",\"tool_calls\":[{\"id\":\"call_1\",\"type\":\"function\",\"function\":{\"name\":\"lookup\",\"arguments\":\"{}\"}}]},{\"role\":\"tool\",\"tool_call_id\":\"call_1\",\"content\":\"x\"}]" ++ tools; + const third = try late.exchange(srv, "/v1/chat/completions", dropping); + defer std.testing.allocator.free(third.body); + try std.testing.expectEqual(@as(u16, 200), third.status); + const w3 = try warmed(&backend); + defer std.testing.allocator.free(w3); + try std.testing.expect(std.mem.indexOf(u8, w3, "Because.") == null); + try std.testing.expectEqual(@as(usize, 2), std.mem.count(u8, w3, "[assistant]Before.")); +} + +test "warm turns: echoesReasoning reads the latest assistant message, and a conversation with none does not echo" { + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); + defer arena.deinit(); + const a = arena.allocator(); + const echoes = @import("warm.zig").echoesReasoning; + try std.testing.expect(!echoes((try json.parse(a, "[{\"role\":\"user\",\"content\":\"go\"}]")).ok)); + try std.testing.expect(echoes((try json.parse(a, "[{\"role\":\"assistant\",\"content\":\"a\"},{\"role\":\"assistant\",\"content\":\"b\",\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"x\"}]")).ok)); + try std.testing.expect(!echoes((try json.parse(a, "[{\"role\":\"assistant\",\"content\":\"a\",\"reasoning_content\":\"r\"},{\"role\":\"assistant\",\"content\":\"b\"},{\"role\":\"user\",\"content\":\"x\"}]")).ok)); + try std.testing.expect(!echoes(.null)); +} diff --git a/zig/src/server/web_cli.zig b/zig/src/server/web_cli.zig index def31010aed..8170bfdd73c 100644 --- a/zig/src/server/web_cli.zig +++ b/zig/src/server/web_cli.zig @@ -38,9 +38,12 @@ pub fn main(init: std.process.Init, args: []const []const u8, version: Version) pub fn command(ctx: Context, args: []const []const u8, version: Version) !u8 { if (try onPath(ctx, "tensorfold-web")) |app| return launch(ctx, app, args); + const uv = try onPath(ctx, "uv"); + if (uv) |tool| { + if (try inUvToolDir(ctx, tool)) |app| return launch(ctx, app, args); + } try ctx.out.writeAll(description); const spec = try std.fmt.allocPrint(ctx.a, "tensorfold-web @ git+https://github.com/ashhart/TensorFold@v{s}#subdirectory=web", .{version.version}); - const uv = try onPath(ctx, "uv"); if (!version.is_release) { try ctx.out.print("Development build without a release tag; the command below targets the manifest version v{s}.\n", .{version.version}); } else if (uv == null) { @@ -62,19 +65,7 @@ pub fn command(ctx: Context, args: []const []const u8, version: Version) !u8 { return instructions(ctx, spec, false); } if (try onPath(ctx, "tensorfold-web")) |app| return launch(ctx, app, args); - // uv's tool-bin directory need not already be on this process's PATH. - const result = std.process.run(ctx.a, ctx.io, .{ - .argv = &.{ uv.?, "tool", "dir", "--bin" }, - .environ_map = ctx.environ, - .stdout_limit = .limited(4096), - .stderr_limit = .limited(4096), - }) catch return instructions(ctx, spec, false); - defer ctx.a.free(result.stdout); - defer ctx.a.free(result.stderr); - const dir = std.mem.trim(u8, result.stdout, "\r\n"); - if (exitCode(result.term) == 0 and std.fs.path.isAbsolute(dir)) { - if (try inDir(ctx, dir, "tensorfold-web")) |app| return launch(ctx, app, args); - } + if (try inUvToolDir(ctx, uv.?)) |app| return launch(ctx, app, args); try ctx.out.writeAll("uv finished, but its tensorfold-web executable could not be found.\n"); } } @@ -131,6 +122,20 @@ fn onPath(ctx: Context, name: []const u8) !?[]const u8 { return null; } +fn inUvToolDir(ctx: Context, uv: []const u8) !?[]const u8 { + const result = std.process.run(ctx.a, ctx.io, .{ + .argv = &.{ uv, "tool", "dir", "--bin" }, + .environ_map = ctx.environ, + .stdout_limit = .limited(4096), + .stderr_limit = .limited(4096), + }) catch return null; + defer ctx.a.free(result.stdout); + defer ctx.a.free(result.stderr); + const dir = std.mem.trim(u8, result.stdout, "\r\n"); + if (exitCode(result.term) != 0 or !std.fs.path.isAbsolute(dir)) return null; + return inDir(ctx, dir, "tensorfold-web"); +} + fn inDir(ctx: Context, dir: []const u8, name: []const u8) !?[]const u8 { const extensions: []const []const u8 = if (builtin.os.tag == .windows) &.{ ".exe", ".com", ".cmd", ".bat", "" } else &.{""}; for (extensions) |extension| { diff --git a/zig/src/server/web_cli_test.zig b/zig/src/server/web_cli_test.zig index 428d0cdb19b..60fde87a0da 100644 --- a/zig/src/server/web_cli_test.zig +++ b/zig/src/server/web_cli_test.zig @@ -56,7 +56,11 @@ fn check(c: Case) !void { const target_bin = if (c.remote_bin) try std.fs.path.join(a, &.{ root, "other bin" }) else bin; const source = try std.fs.path.join(a, &.{ root, "app-source" }); try tmp.dir.writeFile(io, .{ .sub_path = "app-source", .data = app_script, .flags = .{ .permissions = .fromMode(0o700) } }); - if (c.installed) try tmp.dir.writeFile(io, .{ .sub_path = "bin/tensorfold-web", .data = app_script, .flags = .{ .permissions = .fromMode(0o700) } }); + if (c.installed) try tmp.dir.writeFile(io, .{ + .sub_path = if (c.remote_bin) "other bin/tensorfold-web" else "bin/tensorfold-web", + .data = app_script, + .flags = .{ .permissions = .fromMode(0o700) }, + }); if (c.uv) try tmp.dir.writeFile(io, .{ .sub_path = "bin/uv", .data = uv_script, .flags = .{ .permissions = .fromMode(0o700) } }); var env: std.process.Environ.Map = .init(a); defer env.deinit(); @@ -90,8 +94,15 @@ fn check(c: Case) !void { if (!c.launches) try t.expect(std.mem.indexOf(u8, out.written(), "uv tool install \"" ++ spec ++ "\"") != null); } else try t.expectEqualStrings("", out.written()); const uv_log = tmp.dir.readFileAlloc(io, "uv.log", a, .limited(4096)) catch ""; - const expected_uv = if (!c.installs) "" else if (c.remote_bin or c.missing_after_install) "tool\ninstall\n" ++ spec ++ "\ntool\ndir\n--bin\n" else "tool\ninstall\n" ++ spec ++ "\n"; - try t.expectEqualStrings(expected_uv, uv_log); + const query_tool_dir = "tool\ndir\n--bin\n"; + var expected_uv: std.Io.Writer.Allocating = .init(a); + defer expected_uv.deinit(); + if (c.uv and (!c.installed or c.remote_bin)) try expected_uv.writer.writeAll(query_tool_dir); + if (c.installs) { + try expected_uv.writer.writeAll("tool\ninstall\n" ++ spec ++ "\n"); + if (c.remote_bin or c.missing_after_install) try expected_uv.writer.writeAll(query_tool_dir); + } + try t.expectEqualStrings(expected_uv.written(), uv_log); const launched = tmp.dir.readFileAlloc(io, "launch.log", a, .limited(4096)) catch ""; try t.expectEqualStrings(if (c.launches) "/example path/tensorfold\n--port\n9090\ntwo words\n$(untouched);*\n\n" else "", launched); try t.expectEqualStrings("wrong-binary", env.get("TENSORFOLD_BIN").?); @@ -144,3 +155,8 @@ test "web: failed install never launches" { test "web: missing executable after successful install does not retry" { try check(.{ .missing_after_install = true, .asks = true, .installs = true }); } + +test "web: existing uv tool outside PATH launches without prompting or installing" { + try check(.{ .installed = true, .remote_bin = true, .interactive = false, .no_prompt = true, .expected = 0, .launches = true }); + try check(.{ .installed = true, .remote_bin = true, .answer = "yes\n", .expected = 0, .launches = true }); +} diff --git a/zig/src/tensorfold.zig b/zig/src/tensorfold.zig index d5521bf032f..592144a69f2 100644 --- a/zig/src/tensorfold.zig +++ b/zig/src/tensorfold.zig @@ -119,6 +119,7 @@ test { _ = @import("families/lfm2_moe/state.zig"); _ = @import("families/lfm2_moe/dspark_test.zig"); _ = @import("families/deepseek_v41/metal/glue.zig"); // the launch wrappers' shape refusals, reached by no other test root + _ = @import("families/deepseek_v41/metal/vision.zig"); // its config refusals; no other test root reaches it } pub const lane_projection = @import("core/lane_projection.zig"); diff --git a/zig/src/xpu/cand.zig b/zig/src/xpu/cand.zig new file mode 100644 index 00000000000..9631496a4f2 --- /dev/null +++ b/zig/src/xpu/cand.zig @@ -0,0 +1,37 @@ +//! The card top-k of a sampled row: the candidates a forward keeps beside its greedy tokens, and the host's view. +const std = @import("std"); +const q = @import("qwen27.zig"); +const shape = @import("qwen27_config.zig"); + +pub const TOPK_MAX = 64; // candidates a row keeps on the card (a sampled row with a larger top_k draws on the host) +pub const CAND_WORDS = 132; // a row's words: TOPK_MAX values (fp32 bits), TOPK_MAX ids, the not-finite flag, padding +pub const TOPK_PARTS = (shape.vocab + 1023) / 1024; // topk_part's groups a row, one per 1024 ids +comptime { + if (TOPK_PARTS > 256) @compileError("the card top-k merges at most 262144 ids a row"); +} + +/// The card top-k to keep: `k` candidates a row, copied to `out` ([16][CAND_WORDS] words) before the forward's sync. +pub const Mode = struct { k: u32, out: *[16 * CAND_WORDS]u32, rows: *u32 }; + +/// A row's card top-k: `vals` and `ids` by value, then lower id; `bad`: the row holds a value that is not finite. +pub const Cand = struct { vals: []const f32, ids: []const u32, bad: bool }; + +/// What the host sets and the last forward left: `k` wanted next (0: none), the rows and candidates held, their words. +pub const State = struct { k: u32 = 0, rows: u32 = 0, have: u32 = 0, words: [16 * CAND_WORDS]u32 = @splat(0) }; + +/// Row `row`'s `k` best logits and their ids from the last forward's card top-k; null when it did not keep that many. +pub fn candidates(r: *const q.Runner, row: u32, k: u32) ?Cand { + const c = &r.cand; + if (row >= c.rows or k == 0 or k > c.have) return null; + const w = c.words[row * CAND_WORDS ..][0..CAND_WORDS]; + return .{ .vals = std.mem.bytesAsSlice(f32, std.mem.sliceAsBytes(w[0..k])), .ids = w[TOPK_MAX..][0..k], .bad = w[2 * TOPK_MAX] != 0 }; +} + +/// The card top-k a forward keeps (null when none is wanted); the forward notes its rows after its sync. +pub fn mode(r: *q.Runner) ?Mode { + const c = &r.cand; + c.rows = 0; + if (c.k == 0) return null; + c.have = @min(c.k, TOPK_MAX); + return .{ .k = c.have, .out = &c.words, .rows = &c.rows }; +} diff --git a/zig/src/xpu/dev.zig b/zig/src/xpu/dev.zig index 2dff787fc2c..0e2f76ee901 100644 --- a/zig/src/xpu/dev.zig +++ b/zig/src/xpu/dev.zig @@ -88,6 +88,8 @@ pub const Dev = struct { argmax: ze.H, argmax_part: ze.H, argmax_part_masked: ze.H, + topk_part: ze.H, + topk_merge: ze.H, tap: ze.H, conv_commit: ze.H, repack: ze.H, diff --git a/zig/src/xpu/forward.zig b/zig/src/xpu/forward.zig index 3582f1d14ff..4f7c21e4903 100644 --- a/zig/src/xpu/forward.zig +++ b/zig/src/xpu/forward.zig @@ -15,6 +15,7 @@ const Model = loader.Model; const Proj = loader.Proj; const SPLIT = q.SPLIT; const limits = @import("limits.zig"); +const cand = @import("cand.zig"); const tail = @import("prompt_tail.zig"); const ST_B = q.ST_B; const ST_G = q.ST_G; @@ -61,6 +62,10 @@ pub const Acts = struct { mrows: *anyopaque, // i32 [16]: argmaxMasked's rows mbits: *anyopaque, // u32 [16, MASK_WORDS]: and their grammar bits mtok: *anyopaque, // i32 [16]: and their tokens + tkv: *anyopaque, // topk_part's values f32 [16, 256, TOPK_MAX] … + tki: *anyopaque, // … their ids i32, same shape … + tkf: *anyopaque, // … and each group's not-finite flag i32 [16, 256] + cand: *anyopaque, // u32 [16, CAND_WORDS]: topk_merge's rows ids: *anyopaque, // i32 [maxRows] zeros: *anyopaque, // padding rows of the GDN chunks: k = v = 0, β = 0 … ones: *anyopaque, // … and g = 1 @@ -108,6 +113,10 @@ pub const Acts = struct { .mrows = try d.alloc_(16 * 4), .mbits = try d.alloc_(16 * MASK_WORDS * 4), .mtok = try d.alloc_(16 * 4), + .tkv = try d.alloc_(16 * 256 * cand.TOPK_MAX * 4), + .tki = try d.alloc_(16 * 256 * cand.TOPK_MAX * 4), + .tkf = try d.alloc_(16 * 256 * 4), + .cand = try d.alloc_(16 * cand.CAND_WORDS * 4), .taps = try d.alloc_(rows * 5 * D * 2), .ids = try d.alloc_(rows * 4), .zeros = try d.alloc_(rows * 48 * 128 * 2), @@ -306,8 +315,8 @@ pub fn a8(d: *Dev, a: *Acts, x: *anyopaque, K: u32, T: u32, site: u32) !void { pub var gemm_probe: ?*const fn (*Dev, *Acts, Proj, *anyopaque, u32, usize, u32) anyerror!void = null; /// XPU_FP64_REF: called after a prompt's chunked GDN from position 0, with the state it left (layer i). pub var gdn_probe: ?*const fn (*Dev, *Acts, *anyopaque, u32, usize) anyerror!void = null; -/// prompt: a prompt chunk, prompt kernels at any rows; tree: rows see their ancestors; multi: one row a slot. -pub const Mode = struct { prompt: bool = false, want: Want = .last, stash: bool = false, taps: bool = false, tree: bool = false, multi: ?struct { mt: *anyopaque, pos: *anyopaque, max_pos: u32 } = null }; +/// prompt: a prompt chunk; tree: rows see their ancestors; multi: one row a slot; rows_out, cand: see cand.zig. +pub const Mode = struct { prompt: bool = false, want: Want = .last, stash: bool = false, taps: bool = false, tree: bool = false, multi: ?struct { mt: *anyopaque, pos: *anyopaque, max_pos: u32 } = null, rows_out: ?*[16]i32 = null, cand: ?cand.Mode = null }; /// One forward over `ids` (< q.maxRows() rows) at p0..; the last row's greedy token; ≤ 16 non-prompt rows: GDN serial. pub fn forward(d: *Dev, m: *Model, a: *Acts, ids: []const i32, p0: u32, mode: Mode) !?i32 { @@ -478,8 +487,15 @@ pub fn forward(d: *Dev, m: *Model, a: *Acts, ids: []const i32, p0: u32, mode: Mo try gemm(d, a.pscr, off(fa.h, first * D * 2), off(fa.ahi, first * (D / m.head.gs) * 2), off(fa.alo, first * (D / m.head.gs) * 2), m.head, a.logits, rows); try d.launch(d.k.argmax_part, .{ .x = 256, .y = rows }, .{ a.logits, @as(i32, VOCAB), a.pv, a.pi }); try d.launch(d.k.argmax, .{ .x = rows }, .{ a.pv, a.pi, a.tok }); + if (mode.cand) |c| { + try d.launch(d.k.topk_part, .{ .x = cand.TOPK_PARTS, .y = rows }, .{ a.logits, @as(i32, VOCAB), @as(i32, @intCast(c.k)), a.tkv, a.tki, a.tkf }); + try d.launch(d.k.topk_merge, .{ .x = rows }, .{ a.tkv, a.tki, a.tkf, @as(i32, @intCast(c.k)), @as(i32, cand.TOPK_PARTS), a.cand }); + try ze.check(d.g.api.zeCommandListAppendMemoryCopy(d.list, c.out, a.cand, rows * cand.CAND_WORDS * 4, null, 0, null)); + } var toks: [16]i32 = undefined; try ze.check(d.g.api.zeCommandListAppendMemoryCopy(d.list, &toks, a.tok, rows * 4, null, 0, null)); try d.sync(); + if (mode.cand) |c| c.rows.* = rows; // the candidates are the host's once the copy has landed + if (mode.rows_out) |o| @memcpy(o[0..rows], toks[0..rows]); return toks[rows - 1]; } diff --git a/zig/src/xpu/qwen27.zig b/zig/src/xpu/qwen27.zig index 5bc2e9f6394..e6a23d2b357 100644 --- a/zig/src/xpu/qwen27.zig +++ b/zig/src/xpu/qwen27.zig @@ -30,6 +30,7 @@ pub const profReport = dev.profReport; pub const Proj = loader.Proj; pub const Model = loader.Model; pub const Acts = fwd.Acts; +pub const cand = @import("cand.zig"); pub const embedRows = fwd.embedRows; pub const gemm = fwd.gemm; pub const Want = fwd.Want; @@ -157,6 +158,8 @@ pub const Runner = struct { ckpt: Checkpoint = .{}, host_logits: []f32 = &.{}, block: [16]u32 = @splat(0), // the last verified block's greedy tokens + tok_host: [16]i32 = @splat(0), // the last forward's greedy token of every row, as the card wrote them + cand: cand.State = .{}, // the card top-k of the last step or verify, and how many candidates the next one keeps block_rows: u32 = 0, tree_on: bool = false, // the last verified block was a tree (commitPath) tree_host: [16 * 17]i32 = @splat(0), @@ -268,6 +271,8 @@ pub const Runner = struct { .argmax = try d.kernel(mg, "argmax", 256), .argmax_part = try d.kernel(mg, "argmax_part", 256), .argmax_part_masked = try d.kernel(mg, "argmax_part_masked", 256), + .topk_part = try d.kernel(mg, "topk_part", 256), + .topk_merge = try d.kernel(mg, "topk_merge", 256), .tap = try d.kernel(mg, "tap", 256), .conv_commit = try d.kernel(mg, "conv_commit", 256), .repack = try d.kernel(mg, "repack", 16), @@ -407,6 +412,7 @@ pub const Runner = struct { while (at < ids.len) { const end = chunkEnd(at, ids.len); const want = last and end == ids.len; + r.cand.rows = 0; if (r.pos + (end - at) > r.context) return error.ContextFull; if (try forward(&r.d, &r.model, &r.acts, @ptrCast(ids[at..end]), r.pos, .{ .prompt = true, .want = if (want) .last else .none, .taps = r.taps_on })) |t| r.last = @intCast(t); if (r.taps_on) if (r.on_taps) |cb| try cb.f(cb.ctx, r.acts.taps, @intCast(end - at)); @@ -419,7 +425,7 @@ pub const Runner = struct { pub fn step(r: *Runner, token: u32) !void { if (r.pos + 1 > r.context) return error.ContextFull; const id: i32 = @bitCast(token); // an id past i32 turns negative, which forward refuses - r.last = @intCast((try forward(&r.d, &r.model, &r.acts, &.{id}, r.pos, .{ .taps = r.taps_on })).?); + r.last = @intCast((try forward(&r.d, &r.model, &r.acts, &.{id}, r.pos, .{ .taps = r.taps_on, .cand = r.candMode() })).?); r.pos += 1; if (r.taps_on) if (r.on_taps) |cb| try cb.f(cb.ctx, r.acts.taps, 1); } @@ -428,11 +434,8 @@ pub const Runner = struct { pub fn verify(r: *Runner, ids: []const u32) ![]const u32 { if (ids.len == 0 or ids.len > 16) return error.BadBlock; if (r.pos + ids.len > r.context) return error.ContextFull; - _ = try forward(&r.d, &r.model, &r.acts, @ptrCast(ids), r.pos, .{ .want = .rows, .stash = true, .taps = r.taps_on }); - var toks: [16]i32 = undefined; - try ze.check(r.d.g.api.zeCommandListAppendMemoryCopy(r.d.list, &toks, r.acts.tok, ids.len * 4, null, 0, null)); - try r.d.sync(); - for (r.block[0..ids.len], toks[0..ids.len]) |*o, t| o.* = @intCast(t); + _ = try forward(&r.d, &r.model, &r.acts, @ptrCast(ids), r.pos, .{ .want = .rows, .stash = true, .taps = r.taps_on, .rows_out = &r.tok_host, .cand = r.candMode() }); + for (r.block[0..ids.len], r.tok_host[0..ids.len]) |*o, t| o.* = @intCast(t); r.block_rows = @intCast(ids.len); return r.block[0..ids.len]; } @@ -484,11 +487,8 @@ pub const Runner = struct { } if (r.pos + depth_max + 1 > r.context or r.pos + ids.len > r.context) return error.ContextFull; try ze.check(r.d.g.api.zeCommandListAppendMemoryCopy(r.d.list, r.acts.tree, &r.tree_host, ids.len * 17 * 4, null, 0, null)); - _ = try forward(&r.d, &r.model, &r.acts, @ptrCast(ids), r.pos, .{ .want = .rows, .stash = true, .taps = r.taps_on, .tree = true }); - var toks: [16]i32 = undefined; - try ze.check(r.d.g.api.zeCommandListAppendMemoryCopy(r.d.list, &toks, r.acts.tok, ids.len * 4, null, 0, null)); - try r.d.sync(); - for (r.block[0..ids.len], toks[0..ids.len]) |*o, t| o.* = @intCast(t); + _ = try forward(&r.d, &r.model, &r.acts, @ptrCast(ids), r.pos, .{ .want = .rows, .stash = true, .taps = r.taps_on, .tree = true, .rows_out = &r.tok_host, .cand = r.candMode() }); + for (r.block[0..ids.len], r.tok_host[0..ids.len]) |*o, t| o.* = @intCast(t); r.block_rows = @intCast(ids.len); r.tree_on = true; return r.block[0..ids.len]; @@ -541,6 +541,9 @@ pub const Runner = struct { for (out[0..n], toks[0..n]) |*o, t| o.* = @intCast(t); } + pub const candidates = cand.candidates; + pub const candMode = cand.mode; + /// The logits of row `row` of the last verified block (or of the last forward's row, row 0), fp32 on the host. pub fn rowLogits(r: *Runner, row: u32) ![]const f32 { const raw = try alloc.alloc(f16, VOCAB); diff --git a/zig/src/xpu/runner_multi.zig b/zig/src/xpu/runner_multi.zig index fb6b0bcdf25..66239c0c986 100644 --- a/zig/src/xpu/runner_multi.zig +++ b/zig/src/xpu/runner_multi.zig @@ -101,11 +101,8 @@ pub fn verifyMulti(r: *Runner, wins: []const Win) !void { const d = &r.d; try ze.check(d.g.api.zeCommandListAppendMemoryCopy(d.list, r.acts.mt, &r.mt_host, LAYERS * 16 * 8 * 8, null, 0, null)); try ze.check(d.g.api.zeCommandListAppendMemoryCopy(d.list, r.acts.mpos, &r.pos_host, T * 4, null, 0, null)); - _ = try forward(d, &r.model, &r.acts, @ptrCast(r.ids_host[0..T]), 0, .{ .want = .rows, .stash = true, .taps = r.taps_on, .tree = tree, .multi = .{ .mt = r.acts.mt, .pos = r.acts.mpos, .max_pos = max_pos } }); - var toks: [16]i32 = undefined; - try ze.check(d.g.api.zeCommandListAppendMemoryCopy(d.list, &toks, r.acts.tok, T * 4, null, 0, null)); - try d.sync(); - for (r.block[0..T], toks[0..T]) |*o, t| o.* = @intCast(t); + _ = try forward(d, &r.model, &r.acts, @ptrCast(r.ids_host[0..T]), 0, .{ .want = .rows, .stash = true, .taps = r.taps_on, .tree = tree, .multi = .{ .mt = r.acts.mt, .pos = r.acts.mpos, .max_pos = max_pos }, .rows_out = &r.tok_host, .cand = r.candMode() }); + for (r.block[0..T], r.tok_host[0..T]) |*o, t| o.* = @intCast(t); for (wins, 0..) |w, i| r.multi_slots[i] = w.slot; r.multi_count = @intCast(wins.len); r.multi_tree = tree; diff --git a/zig/src/xpu/tp.zig b/zig/src/xpu/tp.zig new file mode 100644 index 00000000000..d339333e9b6 --- /dev/null +++ b/zig/src/xpu/tp.zig @@ -0,0 +1,279 @@ +//! Multi-GPU Level Zero P2P collectives (TP=1, 2, 4) on Intel Xe2 using cross-device events and a 4-slot P2P ring. +const std = @import("std"); +const ze = @import("ze"); + +pub const MAX_TP = 4; +pub const RING_SLOTS = 4; +pub const MAX_PIPE_STEPS = 256; // 64 layers * 2 collectives = 128 steps per forward; 256 leaves ample headroom +/// Threshold above which 2-shot P2P ReduceScatter + DMA AllGather replaces 1-shot P2P AllReduce. +pub const RS_THRESHOLD_BYTES: usize = 512 * 1024; + +pub const Kernels = struct { + ar2_f16: ze.H, + ar4_f16: ze.H, + rs2_f16: ze.H, + rs4_f16: ze.H, + ar2_bf16: ze.H, + ar4_bf16: ze.H, + ar2_f32: ze.H, + ar4_f32: ze.H, + rs4_f32: ze.H, +}; + +pub const TpComm = struct { + tp: usize, + max_bytes: usize, + send_buf: [MAX_TP][RING_SLOTS]*anyopaque = undefined, + rs_buf: [MAX_TP][RING_SLOTS]*anyopaque = undefined, + k: [MAX_TP]Kernels = undefined, + // [step * 2 * MAX_TP + kind * MAX_TP + rank], kind 0 = send ready, kind 1 = rs ready + events: [MAX_PIPE_STEPS * 2 * MAX_TP]ze.H = @splat(null), + step: usize = 0, + + pub fn init(gpus: []ze.Gpu, tp_bin: []const u8, max_bytes: usize) !TpComm { + if (gpus.len != 1 and gpus.len != 2 and gpus.len != 4) return error.InvalidTpDegree; + var c: TpComm = .{ + .tp = gpus.len, + .max_bytes = (max_bytes + 4095) / 4096 * 4096, + }; + if (c.tp == 1) return c; + + const rs_cap = (c.max_bytes / c.tp + 4095) / 4096 * 4096; + for (gpus, 0..) |*g, r| { + for (0..RING_SLOTS) |s| { + c.send_buf[r][s] = try g.deviceAlloc(c.max_bytes); + c.rs_buf[r][s] = try g.deviceAlloc(rs_cap); + } + const m = try g.module(tp_bin); + c.k[r] = .{ + .ar2_f16 = try loadK(g, m, "tp2_allreduce_f16"), + .ar4_f16 = try loadK(g, m, "tp4_allreduce_f16"), + .rs2_f16 = try loadK(g, m, "tp2_rs_f16"), + .rs4_f16 = try loadK(g, m, "tp4_rs_f16"), + .ar2_bf16 = try loadK(g, m, "tp2_allreduce_bf16"), + .ar4_bf16 = try loadK(g, m, "tp4_allreduce_bf16"), + .ar2_f32 = try loadK(g, m, "tp2_allreduce_f32"), + .ar4_f32 = try loadK(g, m, "tp4_allreduce_f32"), + .rs4_f32 = try loadK(g, m, "tp4_rs_f32"), + }; + } + // Make all ring buffers P2P-resident on every peer device in the shared context. + for (gpus) |*g_dst| { + for (0..c.tp) |r_src| { + for (0..RING_SLOTS) |s| { + try g_dst.makeResident(c.send_buf[r_src][s], c.max_bytes); + try g_dst.makeResident(c.rs_buf[r_src][s], rs_cap); + } + } + } + try ze.Gpu.sharedEvents(gpus, c.events[0 .. MAX_PIPE_STEPS * 2 * c.tp]); + return c; + } + + fn loadK(g: *ze.Gpu, m: ze.H, name: [*:0]const u8) !ze.H { + const k = try g.kernel(m, name); + try ze.check(g.api.zeKernelSetGroupSize(k, 256, 1, 1)); + try g.indirect(k); + return k; + } + + /// Rank `r`'s current P2P send buffer so the preceding GEMM can write directly into it without an extra copy. + pub fn currentSendBuf(c: *const TpComm, r: usize) *anyopaque { + return c.send_buf[r][c.step % RING_SLOTS]; + } + + fn readyEv(c: *TpComm, s: usize, r: usize) ze.H { + return c.events[(s * 2 + 0) * c.tp + r]; + } + + fn rsEv(c: *TpComm, s: usize, r: usize) ze.H { + return c.events[(s * 2 + 1) * c.tp + r]; + } + + /// Synchronizes all `gpus` command lists and resets all consumed pipeline events on the host. + pub fn syncAll(c: *TpComm, gpus: []ze.Gpu, lists: []const ze.H) !void { + for (gpus, lists) |*g, l| { + try ze.check(g.api.zeCommandListHostSynchronize(l, std.math.maxInt(u64))); + } + if (c.tp > 1 and c.step > 0) { + const total_evs = c.step * 2 * c.tp; + for (c.events[0..total_evs]) |ev| { + try ze.check(gpus[0].api.zeEventHostReset(ev)); + } + c.step = 0; + } + } + + /// Queues an async cross-GPU FP16 AllReduce from `src_opt` (or `currentSendBuf(r)` if null) into `dst[r]`. + pub fn allReduceF16(c: *TpComm, gpus: []ze.Gpu, lists: []const ze.H, src_opt: ?[]const *anyopaque, dst: []const *anyopaque, count_f16: usize) !void { + if (c.tp == 1) { + if (src_opt) |src| if (src[0] != dst[0]) { + try ze.check(gpus[0].api.zeCommandListAppendMemoryCopy(lists[0], dst[0], src[0], count_f16 * 2, null, 0, null)); + }; + return; + } + if (c.step >= MAX_PIPE_STEPS) try c.syncAll(gpus, lists); + const bytes = count_f16 * 2; + if (bytes > c.max_bytes or count_f16 % 4 != 0) return error.InvalidAllReduceSize; + + const s = c.step; + const slot = s % RING_SLOTS; + c.step += 1; + + var waits: [MAX_TP]ze.H = undefined; + for (0..c.tp) |r| { + const sb = c.send_buf[r][slot]; + if (src_opt) |src| if (src[r] != sb) { + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], sb, src[r], bytes, null, 0, null)); + }; + const ev = c.readyEv(s, r); + try ze.check(gpus[r].api.zeCommandListAppendSignalEvent(lists[r], ev)); + waits[r] = ev; + } + + const n4: u32 = @intCast(count_f16 / 4); + const use_rs = bytes > RS_THRESHOLD_BYTES and (n4 % @as(u32, @intCast(c.tp)) == 0); + + if (!use_rs) { + const groups: ze.GroupCount = .{ .x = (n4 + 255) / 256 }; + for (0..c.tp) |r| { + const g = &gpus[r]; + if (c.tp == 2) { + const k = c.k[r].ar2_f16; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, dst[r]); + try g.arg(k, 3, @as(i32, @intCast(n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, null, 2, &waits)); + } else { + const k = c.k[r].ar4_f16; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, c.send_buf[2][slot]); + try g.arg(k, 3, c.send_buf[3][slot]); + try g.arg(k, 4, dst[r]); + try g.arg(k, 5, @as(i32, @intCast(n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, null, 4, &waits)); + } + } + } else { + const slice_n4: u32 = n4 / @as(u32, @intCast(c.tp)); + const slice_bytes: usize = @as(usize, slice_n4) * 8; + const groups: ze.GroupCount = .{ .x = (slice_n4 + 255) / 256 }; + var rs_waits: [MAX_TP]ze.H = undefined; + for (0..c.tp) |r| { + const g = &gpus[r]; + const off4: i32 = @intCast(@as(u32, @intCast(r)) * slice_n4); + const rev = c.rsEv(s, r); + rs_waits[r] = rev; + if (c.tp == 2) { + const k = c.k[r].rs2_f16; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, c.rs_buf[r][slot]); + try g.arg(k, 3, off4); + try g.arg(k, 4, @as(i32, @intCast(slice_n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, rev, 2, &waits)); + } else { + const k = c.k[r].rs4_f16; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, c.send_buf[2][slot]); + try g.arg(k, 3, c.send_buf[3][slot]); + try g.arg(k, 4, c.rs_buf[r][slot]); + try g.arg(k, 5, off4); + try g.arg(k, 6, @as(i32, @intCast(slice_n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, rev, 4, &waits)); + } + } + for (0..c.tp) |r| { + try ze.check(gpus[r].api.zeCommandListAppendWaitOnEvents(lists[r], @intCast(c.tp), &rs_waits)); + for (0..c.tp) |src_r| { + const dst_slice: *anyopaque = @ptrFromInt(@intFromPtr(dst[r]) + src_r * slice_bytes); + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], dst_slice, c.rs_buf[src_r][slot], slice_bytes, null, 0, null)); + } + } + } + } + + /// Queues an asynchronous cross-GPU deterministic FP32 AllReduce (used by FlashNext / FP32 partials). + pub fn allReduceF32(c: *TpComm, gpus: []ze.Gpu, lists: []const ze.H, src_opt: ?[]const *anyopaque, dst: []const *anyopaque, count_f32: usize) !void { + if (c.tp == 1) { + if (src_opt) |src| if (src[0] != dst[0]) { + try ze.check(gpus[0].api.zeCommandListAppendMemoryCopy(lists[0], dst[0], src[0], count_f32 * 4, null, 0, null)); + }; + return; + } + if (c.step >= MAX_PIPE_STEPS) try c.syncAll(gpus, lists); + const bytes = count_f32 * 4; + if (bytes > c.max_bytes or count_f32 % 4 != 0) return error.InvalidAllReduceSize; + + const s = c.step; + const slot = s % RING_SLOTS; + c.step += 1; + + var waits: [MAX_TP]ze.H = undefined; + for (0..c.tp) |r| { + const sb = c.send_buf[r][slot]; + if (src_opt) |src| if (src[r] != sb) { + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], sb, src[r], bytes, null, 0, null)); + }; + const ev = c.readyEv(s, r); + try ze.check(gpus[r].api.zeCommandListAppendSignalEvent(lists[r], ev)); + waits[r] = ev; + } + + const n4: u32 = @intCast(count_f32 / 4); + const use_rs = c.tp == 4 and bytes > RS_THRESHOLD_BYTES and (n4 % 4 == 0); + if (!use_rs) { + const groups: ze.GroupCount = .{ .x = (n4 + 255) / 256 }; + for (0..c.tp) |r| { + const g = &gpus[r]; + if (c.tp == 2) { + const k = c.k[r].ar2_f32; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, dst[r]); + try g.arg(k, 3, @as(i32, @intCast(n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, null, 2, &waits)); + } else { + const k = c.k[r].ar4_f32; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, c.send_buf[2][slot]); + try g.arg(k, 3, c.send_buf[3][slot]); + try g.arg(k, 4, dst[r]); + try g.arg(k, 5, @as(i32, @intCast(n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, null, 4, &waits)); + } + } + } else { + const slice_n4: u32 = n4 / 4; + const slice_bytes: usize = @as(usize, slice_n4) * 16; + const groups: ze.GroupCount = .{ .x = (slice_n4 + 255) / 256 }; + var rs_waits: [MAX_TP]ze.H = undefined; + for (0..4) |r| { + const g = &gpus[r]; + const off4: i32 = @intCast(@as(u32, @intCast(r)) * slice_n4); + const rev = c.rsEv(s, r); + rs_waits[r] = rev; + const k = c.k[r].rs4_f32; + try g.arg(k, 0, c.send_buf[0][slot]); + try g.arg(k, 1, c.send_buf[1][slot]); + try g.arg(k, 2, c.send_buf[2][slot]); + try g.arg(k, 3, c.send_buf[3][slot]); + try g.arg(k, 4, c.rs_buf[r][slot]); + try g.arg(k, 5, off4); + try g.arg(k, 6, @as(i32, @intCast(slice_n4))); + try ze.check(g.api.zeCommandListAppendLaunchKernel(lists[r], k, &groups, rev, 4, &waits)); + } + for (0..4) |r| { + try ze.check(gpus[r].api.zeCommandListAppendWaitOnEvents(lists[r], 4, &rs_waits)); + for (0..4) |src_r| { + const dst_slice: *anyopaque = @ptrFromInt(@intFromPtr(dst[r]) + src_r * slice_bytes); + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], dst_slice, c.rs_buf[src_r][slot], slice_bytes, null, 0, null)); + } + } + } + } +}; diff --git a/zig/src/xpu/tp_bench.zig b/zig/src/xpu/tp_bench.zig new file mode 100644 index 00000000000..2b92d04153d --- /dev/null +++ b/zig/src/xpu/tp_bench.zig @@ -0,0 +1,140 @@ +//! Phase 1 benchmark & bit-exactness verification for Level Zero P2P TP=2 and TP=4 collectives on Arc Pro B70. +const std = @import("std"); +const ze = @import("ze"); +const tp_mod = @import("tp.zig"); +const kb = @import("xpu_tp_kernels"); + +fn nowNs() u64 { + var ts: std.c.timespec = undefined; + _ = std.c.clock_gettime(std.c.CLOCK.MONOTONIC, &ts); + return @as(u64, @intCast(ts.sec)) * 1_000_000_000 + @as(u64, @intCast(ts.nsec)); +} + +fn f32ToF16Rte(v: f32) u16 { + const f16_val: f16 = @floatCast(v); + return @bitCast(f16_val); +} + +fn runSuite(tp_deg: usize) !void { + const alloc = std.heap.c_allocator; + var gpus: [4]ze.Gpu = undefined; + ze.Gpu.openPeers(0xe223, gpus[0..tp_deg]) catch |err| { + std.debug.print("skipped TP={d}: {s}\n", .{ tp_deg, @errorName(err) }); + return; + }; + defer ze.Gpu.closePeers(gpus[0..tp_deg]); + + var lists: [4]ze.H = undefined; + for (0..tp_deg) |r| lists[r] = try gpus[r].immediate(0, 0); + + const max_elems: usize = 4096 * 5120; // up to 4096 rows * 5120 fp16 = 40 MB + const max_bytes: usize = max_elems * 2; + var comm = try tp_mod.TpComm.init(gpus[0..tp_deg], &kb.tp, max_bytes); + + var dsts: [4]*anyopaque = undefined; + for (0..tp_deg) |r| dsts[r] = try gpus[r].deviceAlloc(max_bytes); + + // 1. Strict rank-ordered bit-exactness check (with non-associative float magnitudes!) + { + const test_n: usize = 1024 * 5120; // > 512 KB so we also exercise 2-shot ReduceScatter + AllGather! + var host_in: [4][]u16 = undefined; + for (0..tp_deg) |r| { + host_in[r] = try alloc.alloc(u16, test_n); + var prng = std.Random.DefaultPrng.init(0x12345678 + @as(u64, r) * 99991); + const rnd = prng.random(); + for (host_in[r], 0..) |*x, idx| { + // Inject cancellation/non-associative patterns every 4th element + const f: f16 = switch ((idx + r) % 4) { + 0 => 1024.0, + 1 => -1024.0, + 2 => @floatCast((rnd.float(f32) - 0.5) * 2.0), + else => @floatCast((rnd.float(f32) - 0.5) * 0.01), + }; + x.* = @bitCast(f); + } + } + defer for (0..tp_deg) |r| alloc.free(host_in[r]); + + const ref = try alloc.alloc(u16, test_n); + defer alloc.free(ref); + for (0..test_n) |i| { + var s: f32 = 0.0; + for (0..tp_deg) |r| { + const h: f16 = @bitCast(host_in[r][i]); + s += @as(f32, h); + } + ref[i] = f32ToF16Rte(s); + } + + // Check both small (1-shot, 16384 elems = 32 KB) and large (2-shot RS+AG, test_n = 10 MB) + for ([_]usize{ 16384, test_n }) |cnt| { + for (0..tp_deg) |r| { + const sb = comm.currentSendBuf(r); + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], sb, host_in[r].ptr, cnt * 2, null, 0, null)); + } + try comm.allReduceF16(gpus[0..tp_deg], lists[0..tp_deg], null, dsts[0..tp_deg], cnt); + try comm.syncAll(gpus[0..tp_deg], lists[0..tp_deg]); + + const got = try alloc.alloc(u16, cnt); + defer alloc.free(got); + for (0..tp_deg) |r| { + try ze.check(gpus[r].api.zeCommandListAppendMemoryCopy(lists[r], got.ptr, dsts[r], cnt * 2, null, 0, null)); + try ze.check(gpus[r].api.zeCommandListHostSynchronize(lists[r], std.math.maxInt(u64))); + for (0..cnt) |i| { + if (got[i] != ref[i]) { + std.debug.print("MISMATCH TP={d} rank={d} cnt={d} idx={d}: got=0x{x} ref=0x{x}\n", .{ tp_deg, r, cnt, i, got[i], ref[i] }); + return error.BitMismatch; + } + } + } + } + std.debug.print("=== TP={d}: bit-exactness PASSED (1-shot 32 KB & 2-shot 10 MB, all {d} ranks == rank-ordered FP32 ref) ===\n", .{ tp_deg, tp_deg }); + } + + // 2. Latency & Bandwidth benchmarks (128 pipelined AllReduces per forward pass = 64 layers * 2) + const cases = [_]struct { label: []const u8, elems: usize, steps: usize, reps: usize }{ + .{ .label = "decode 1 row (10 KB)", .elems = 1 * 5120, .steps = 128, .reps = 20 }, + .{ .label = "verify 8 rows (80 KB)", .elems = 8 * 5120, .steps = 128, .reps = 20 }, + .{ .label = "tree 16 rows (160 KB)", .elems = 16 * 5120, .steps = 128, .reps = 20 }, + .{ .label = "prefill 512r (5.0 MB)", .elems = 512 * 5120, .steps = 16, .reps = 10 }, + .{ .label = "prefill 1024r (10 MB)", .elems = 1024 * 5120, .steps = 16, .reps = 10 }, + .{ .label = "prefill 4096r (40 MB)", .elems = 4096 * 5120, .steps = 8, .reps = 5 }, + }; + + for (cases) |tc| { + // Warmup + for (0..2) |_| { + for (0..tc.steps) |_| { + try comm.allReduceF16(gpus[0..tp_deg], lists[0..tp_deg], null, dsts[0..tp_deg], tc.elems); + } + try comm.syncAll(gpus[0..tp_deg], lists[0..tp_deg]); + } + var best_ns: u64 = std.math.maxInt(u64); + var total_ns: u64 = 0; + for (0..tc.reps) |_| { + const t0 = nowNs(); + for (0..tc.steps) |_| { + try comm.allReduceF16(gpus[0..tp_deg], lists[0..tp_deg], null, dsts[0..tp_deg], tc.elems); + } + try comm.syncAll(gpus[0..tp_deg], lists[0..tp_deg]); + const dt = nowNs() - t0; + if (dt < best_ns) best_ns = dt; + total_ns += dt; + } + const mean_step_us = @as(f64, @floatFromInt(total_ns)) / @as(f64, @floatFromInt(tc.reps * tc.steps)) / 1e3; + const best_step_us = @as(f64, @floatFromInt(best_ns)) / @as(f64, @floatFromInt(tc.steps)) / 1e3; + const bytes = @as(f64, @floatFromInt(tc.elems * 2)); + // Algbw = payload_bytes / time_s; Busbw = algbw * 2 * (tp - 1) / tp + const alg_gbs = bytes / (best_step_us * 1e-6) / 1e9; + const bus_gbs = alg_gbs * 2.0 * @as(f64, @floatFromInt(tp_deg - 1)) / @as(f64, @floatFromInt(tp_deg)); + const per_layer64_ms = best_step_us * 128.0 / 1e3; + std.debug.print(" {s}: best={d:6.2} us/op (mean={d:6.2} us) | 128-op/tok={d:5.2} ms | algbw={d:5.2} GB/s | busbw={d:5.2} GB/s\n", .{ + tc.label, best_step_us, mean_step_us, per_layer64_ms, alg_gbs, bus_gbs, + }); + } +} + +pub fn main() !void { + try runSuite(2); + try runSuite(4); +} diff --git a/zig/src/xpu/ze.zig b/zig/src/xpu/ze.zig index 20698c218f2..c1cb3bbb2dd 100644 --- a/zig/src/xpu/ze.zig +++ b/zig/src/xpu/ze.zig @@ -21,6 +21,11 @@ pub const Api = struct { zeCommandListAppendLaunchKernel: *const fn (H, H, *const GroupCount, H, u32, ?[*]H) callconv(.c) u32, zeCommandListAppendMemoryCopy: *const fn (H, ?*anyopaque, ?*const anyopaque, usize, H, u32, ?[*]H) callconv(.c) u32, zeCommandListAppendBarrier: *const fn (H, H, u32, ?[*]H) callconv(.c) u32, + zeCommandListAppendSignalEvent: *const fn (H, H) callconv(.c) u32, + zeCommandListAppendWaitOnEvents: *const fn (H, u32, [*]H) callconv(.c) u32, + zeCommandListAppendEventReset: *const fn (H, H) callconv(.c) u32, + zeDeviceCanAccessPeer: *const fn (H, H, *u8) callconv(.c) u32, + zeContextMakeMemoryResident: *const fn (H, H, ?*anyopaque, usize) callconv(.c) u32, zeMemAllocDevice: *const fn (H, *const DeviceAllocDesc, usize, usize, H, *?*anyopaque) callconv(.c) u32, zeMemAllocHost: *const fn (H, *const HostAllocDesc, usize, usize, *?*anyopaque) callconv(.c) u32, zeMemFree: *const fn (H, ?*anyopaque) callconv(.c) u32, @@ -204,6 +209,7 @@ pub const Gpu = struct { device: H, context: H, props: DeviceProperties, + shared_ctx: bool = false, // true on non-owning peers opened by openPeers; closePeers releases the group owned: Owned = .{}, // what close() gives back /// Every allocation, kernel, module, list and event made through this Gpu, destroyed by close(). @@ -235,11 +241,34 @@ pub const Gpu = struct { /// Waits for every list this Gpu made, then destroys what it made and the context (startup errors included). pub fn close(g: *Gpu) void { + if (g.shared_ctx) { + _ = releasePeer(&g.api, g.context, &g.owned, false); + return; + } if (release(&g.api, g.context, &g.owned)) g.lib.close(); } + /// Drains all peer command lists first, then frees resources across the group and closes the shared context. + pub fn closePeers(gpus: []Gpu) void { + if (gpus.len == 0) return; + for (gpus) |*g| for (g.owned.lists.items) |l| if (g.api.zeCommandListHostSynchronize(l, std.math.maxInt(u64)) != 0) { + std.log.warn("XPU: a command list did not drain at closePeers; memory and context stay until the process ends", .{}); + return; + }; + var idx = gpus.len; + while (idx > 1) { + idx -= 1; + _ = releasePeer(&gpus[idx].api, gpus[idx].context, &gpus[idx].owned, false); + } + if (releasePeer(&gpus[0].api, gpus[0].context, &gpus[0].owned, true)) gpus[0].lib.close(); + } + /// `close` before the loader: false, with nothing destroyed, when a list does not drain (it may still run). fn release(api: *const Api, context: H, o: *Owned) bool { + return releasePeer(api, context, o, true); + } + + fn releasePeer(api: *const Api, context: H, o: *Owned, destroy_ctx: bool) bool { for (o.lists.items) |l| if (api.zeCommandListHostSynchronize(l, std.math.maxInt(u64)) != 0) { std.log.warn("XPU: a command list did not drain at close; its memory and context stay until the process ends", .{}); return false; @@ -253,11 +282,19 @@ pub const Gpu = struct { while (it.next()) |p| _ = api.zeMemFree(context, @ptrFromInt(p.*)); o.mems.deinit(own_alloc); inline for (.{ &o.kernels, &o.modules, &o.lists, &o.events, &o.pools }) |l| l.deinit(own_alloc); - _ = api.zeContextDestroy(context); + if (destroy_ctx) _ = api.zeContextDestroy(context); return true; } pub fn open(device_id: u32) Error!Gpu { + var out: [1]Gpu = undefined; + try openPeers(device_id, &out); + return out[0]; + } + + /// Opens `out.len` peer-accessible devices of `device_id` on one driver and one shared Level Zero context. + pub fn openPeers(device_id: u32, out: []Gpu) Error!void { + if (out.len == 0 or out.len > 8) return error.NoDevice; var lib = std.DynLib.open("libze_loader.so.1") catch return error.LoaderUnavailable; errdefer lib.close(); const api = try resolve(Api, &lib); @@ -271,22 +308,66 @@ pub const Gpu = struct { if (drv == null) continue; var nv: u32 = 0; // the count first, as context.enumerate (a padded list holds nulls) try check(api.zeDeviceGet(drv, &nv, null)); - var devs: [8]H = @splat(null); + var devs: [16]H = @splat(null); nv = @min(nv, devs.len); try check(api.zeDeviceGet(drv, &nv, &devs)); + var picked: [8]H = @splat(null); + var props: [8]DeviceProperties = @splat(.{}); + var found: usize = 0; for (devs[0..nv]) |dev| { if (dev == null) continue; var p: DeviceProperties = .{}; try check(api.zeDeviceGetProperties(dev, &p)); if (p.deviceId != device_id) continue; - var ctx: H = null; - try check(api.zeContextCreate(drv, &.{}, &ctx)); - return .{ .lib = lib, .api = api, .driver = drv, .device = dev, .context = ctx, .props = p }; + picked[found] = dev; + props[found] = p; + found += 1; + if (found == out.len) break; + } + if (found < out.len) continue; + if (out.len > 1) { + for (0..out.len) |i| for (0..out.len) |j| if (i != j) { + var can: u8 = 0; + try check(api.zeDeviceCanAccessPeer(picked[i], picked[j], &can)); + if (can == 0) return error.ZeFailed; + }; + } + var ctx: H = null; + try check(api.zeContextCreate(drv, &.{}, &ctx)); + for (out, 0..) |*g, i| { + g.* = .{ + .lib = if (i == 0) lib else undefined, + .api = api, + .driver = drv, + .device = picked[i], + .context = ctx, + .props = props[i], + .shared_ctx = i > 0, + }; } + return; } return error.NoDevice; } + pub fn makeResident(g: *Gpu, ptr: *anyopaque, size: usize) Error!void { + try check(g.api.zeContextMakeMemoryResident(g.context, g.device, ptr, size)); + } + + /// Allocates a pool of `count` device-scoped events visible across `gpus` (owned by `gpus[0]`). + pub fn sharedEvents(gpus: []Gpu, out_events: []H) Error!void { + var devs: [8]H = @splat(null); + for (gpus, 0..) |*g, i| devs[i] = g.device; + var pool: H = null; + try check(gpus[0].api.zeEventPoolCreate(gpus[0].context, &.{ .flags = pool_host_visible, .count = @intCast(out_events.len) }, @intCast(gpus.len), &devs, &pool)); + _ = try keep(&gpus[0].owned.pools, pool, gpus[0].api.zeEventPoolDestroy); + for (out_events, 0..) |*e, i| { + // signal=1 (DEVICE), wait=1 (DEVICE): cross-GPU synchronization without host round-trips + try check(gpus[0].api.zeEventCreate(pool, &.{ .index = @intCast(i), .signal = 1, .wait = 1 }, e)); + _ = try keep(&gpus[0].owned.events, e.*, gpus[0].api.zeEventDestroy); + } + } + /// On-board bytes free and in all by Sysman (by UUID); without Sysman (WSL2) both are the core total, less nothing. pub fn memory(g: *Gpu) Error!struct { free: u64, size: u64 } { if (!sysmanUsable()) { diff --git a/zig/tests/contract/metal_dsv41_limits.zig b/zig/tests/contract/metal_dsv41_limits.zig index c07ab959a3d..6dbb66e8f55 100644 --- a/zig/tests/contract/metal_dsv41_limits.zig +++ b/zig/tests/contract/metal_dsv41_limits.zig @@ -6,6 +6,11 @@ const sources = @import("kernel_sources"); const limits = @import("contract").limits; const Launch = @import("metal_limits.zig").Launch; +/// The tensor-unit prompt expert kernels: built only with tensor units, and the loader has no M1/M2 library. +pub fn tensorOnly(name: []const u8) bool { + return std.mem.startsWith(u8, name, "dsv41 xmma units "); +} + /// The dsv41 launch's sources, or null when the name belongs to another family. pub fn launchOf(a: std.mem.Allocator, device: mtl.Device, d: limits.MetalLaunch, fun: []const u8, comptime assemble: bool) !?Launch { _ = device; diff --git a/zig/tests/contract/metal_limits.zig b/zig/tests/contract/metal_limits.zig index 559cc197916..005e18044e6 100644 --- a/zig/tests/contract/metal_limits.zig +++ b/zig/tests/contract/metal_limits.zig @@ -34,6 +34,8 @@ pub fn requireMapped(d: limits.MetalLaunch) !void { pub fn supported(device: mtl.Device, d: limits.MetalLaunch) bool { if (std.mem.startsWith(u8, d.name, "lfm2 masked prompt ")) return @import("metal_support.zig").tensor(tf.lfm2_moe.source.optionalAvailable(device), d.name); + if (@import("metal_dsv41_limits.zig").tensorOnly(d.name)) + return @import("metal_support.zig").tensor(device.tensorUnits(), d.name); return !std.mem.startsWith(u8, d.name, "qwen27 q8 ") or @import("metal_support.zig").tensor(device.tensorUnits(), d.name); } diff --git a/zig/tests/contract/metal_mapping_test.zig b/zig/tests/contract/metal_mapping_test.zig index 741a7a86218..abf540ea8f8 100644 --- a/zig/tests/contract/metal_mapping_test.zig +++ b/zig/tests/contract/metal_mapping_test.zig @@ -37,3 +37,22 @@ test "Metal launch map: LFM2 masked prompt follows its loader on each device cla try launches.requireMapped(base); try std.testing.expect(launches.supported(.{ .units = false }, base)); } + +test "Metal launch map: DeepSeek-V4.1 tensor-unit expert launches follow their loader" { + var units: usize = 0; + var simd: usize = 0; + for (registry.all_metal) |d| { + if (std.mem.startsWith(u8, d.name, "dsv41 xmma units ")) { + units += 1; + try launches.requireMapped(d); + try std.testing.expect(!launches.supported(.{ .units = false }, d)); + try std.testing.expect(launches.supported(.{ .units = true }, d)); + } else if (std.mem.startsWith(u8, d.name, "dsv41 xmma ")) { + simd += 1; + try launches.requireMapped(d); + try std.testing.expect(launches.supported(.{ .units = false }, d)); + } + } + try std.testing.expectEqual(@as(usize, 4), units); + try std.testing.expectEqual(@as(usize, 4), simd); +} diff --git a/zig/tests/contract/metal_q27_attn_io.zig b/zig/tests/contract/metal_q27_attn_io.zig index 5605c999e06..377198408f5 100644 --- a/zig/tests/contract/metal_q27_attn_io.zig +++ b/zig/tests/contract/metal_q27_attn_io.zig @@ -58,7 +58,7 @@ pub const Io = struct { rig: rig_.Rig, reg: Reg, op: attn.Attention, - tensor: bool, + shared: bool, st: ?at_.State = null, rd: at_.Round = .{}, host: [3][]u16 = .{ &.{}, &.{}, &.{} }, @@ -81,7 +81,7 @@ pub const Io = struct { const lib = try mtl.Library.fromSource(device, text, mtl.CompileOptions.mlx()); defer lib.deinit(); const op = try attn.Attention.init(device, lib); - return .{ .a = a, .rig = .{ .a = a, .device = device, .queue = queue }, .reg = r, .op = op, .tensor = tensor }; + return .{ .a = a, .rig = .{ .a = a, .device = device, .queue = queue }, .reg = r, .op = op, .shared = try tf.qwen27.simd_attention.sharedPrefix(tensor) }; } pub fn deinit(t: *Io) void { @@ -106,7 +106,7 @@ pub const Io = struct { const vt = g.hooks(Io); fn geo(t: *const Io) planning.Geometry { - return at_.geometry(t.reg.heads, t.tensor); + return at_.geometry(t.reg.heads, t.shared); } fn bits(rng: std.Random, xs: []u16) void { diff --git a/zig/tests/contract/metal_q27_attn_rows.zig b/zig/tests/contract/metal_q27_attn_rows.zig index cf4e62089bb..80900cee45c 100644 --- a/zig/tests/contract/metal_q27_attn_rows.zig +++ b/zig/tests/contract/metal_q27_attn_rows.zig @@ -26,11 +26,11 @@ pub const Which = enum { decode, prompt }; /// `control`: values that aren't finite go to P V as they are, so a row's 0 for a key it must not see gives NaN. pub const Reg = struct { heads: at_.Heads, which: Which, control: bool = false }; -/// The control's edit: prompts never pick the masked kernel; decode rows before M5 take the tail (no control). -fn controlEdit(w: Which, tensor: bool) ?at_.Edit { +/// The control's edit: prompts never pick the masked kernel; decode rows off a shared prefix take the tail, no control. +fn controlEdit(w: Which, shared: bool) ?at_.Edit { return switch (w) { .prompt => .{ .from = "if (simd_any(inf != 0) && lane == 0) atomic_fetch_or", .to = "if (false && lane == 0) atomic_fetch_or" }, - .decode => if (tensor) .{ .from = "const bool masked = MASKED && q27_nonfinite(", .to = "const bool masked = false && q27_nonfinite(" } else null, + .decode => if (shared) .{ .from = "const bool masked = MASKED && q27_nonfinite(", .to = "const bool masked = false && q27_nonfinite(" } else null, }; } @@ -77,9 +77,9 @@ pub fn spec(r: Reg) c.Spec { }; } -/// Whether this chip has the control: decode rows before M5 run the tail kernel, whose round sees every key it reads. -pub fn hasControl(w: Which, tensor: bool) bool { - return controlEdit(w, tensor) != null; +/// Whether these rows have the control: off a shared prefix decode rows run the tail kernel, which sees every key. +pub fn hasControl(w: Which, shared: bool) bool { + return controlEdit(w, shared) != null; } fn bf(x: u16) f64 { @@ -91,7 +91,7 @@ pub const Attn = struct { rig: rig_.Rig, reg: Reg, op: attn.Attention, - tensor: bool, + shared: bool, st: ?at_.State = null, rd: at_.Round = .{}, q_in: []u16 = &.{}, @@ -106,11 +106,12 @@ pub const Attn = struct { pub fn init(a: std.mem.Allocator, device: mtl.Device, queue: mtl.Queue, r: Reg) !Attn { const tensor = device.tensorUnits(); if (!tensor) try q.simd_attention.check(device, queue); - const gm = at_.geometry(r.heads, tensor); + const shared = try q.simd_attention.sharedPrefix(tensor); + const gm = at_.geometry(r.heads, shared); const body = try q.simd_attention.grouped(a, tensor, true, gm.group(), gm.kv_heads, false); defer a.free(body); const text = if (!r.control) try a.dupe(u8, body) else edit: { - const e = controlEdit(r.which, tensor) orelse return error.ControlEdit; + const e = controlEdit(r.which, shared) orelse return error.ControlEdit; if (std.mem.count(u8, body, e.from) != 1) return error.ControlEdit; break :edit try std.mem.replaceOwned(u8, a, body, e.from, e.to); }; @@ -118,7 +119,7 @@ pub const Attn = struct { const lib = try mtl.Library.fromSource(device, text, mtl.CompileOptions.mlx()); defer lib.deinit(); const op = try attn.Attention.init(device, lib); - return .{ .a = a, .rig = .{ .a = a, .device = device, .queue = queue }, .reg = r, .op = op, .tensor = tensor }; + return .{ .a = a, .rig = .{ .a = a, .device = device, .queue = queue }, .reg = r, .op = op, .shared = shared }; } pub fn deinit(t: *Attn) void { @@ -143,7 +144,7 @@ pub const Attn = struct { const vt = g.hooks(Attn); fn geo(t: *const Attn) planning.Geometry { - return at_.geometry(t.reg.heads, t.tensor); + return at_.geometry(t.reg.heads, t.shared); } fn at(t: *const Attn, s: usize, hk: usize, row: usize) usize { @@ -161,8 +162,8 @@ pub const Attn = struct { t.rig.reset(); var prng = std.Random.DefaultPrng.init(seed); const rng = prng.random(); - // on an M5 gate 1's decode round is a chain: only a chain's prefix kernel reads keys that a row must not see - const trees = t.reg.which == .decode and !(t.tensor and fill == .nonfinite); + // a shared prefix makes gate 1's decode round a chain: only its prefix kernel reads keys a row must not see + const trees = t.reg.which == .decode and !(t.shared and fill == .nonfinite); t.rd = at_.Round.init(shape, t.reg.which == .prompt, trees, rng); const r = &t.rd; t.q_in = try t.a.alloc(u16, r.rows * nh * D); @@ -191,7 +192,7 @@ pub const Attn = struct { } t.refs[4] = try t.rig.output(r.rows * nh * D * 2); t.st = try at_.State.init(t.a, t.rig.device, r, gm, t.caches[0..r.streams]); - if (t.tensor and t.reg.which == .decode and fill == .nonfinite and !t.st.?.plan.fused) return error.PlantedRoundMissesPrefix; + if (t.shared and t.reg.which == .decode and fill == .nonfinite and !t.st.?.plan.fused) return error.PlantedRoundMissesPrefix; return true; } @@ -357,20 +358,23 @@ pub const Suite = struct { pub fn collect(s: *Suite, only: ?[]const u8) !void { // each chip's control edit must match its source once, checked on every chip, so an M4 run sees a stale M5 edit - for ([_]bool{ false, true }) |units| for (std.enums.values(Which)) |w| if (controlEdit(w, units)) |e| { - const gm = at_.geometry(.q27b, units); - const body = try q.simd_attention.grouped(s.a, units, true, gm.group(), gm.kv_heads, false); - defer s.a.free(body); - if (std.mem.count(u8, body, e.from) != 1) { - std.debug.print("control edit for {s} rows (tensor units {}) matches {d} times, not once: {s}\n", .{ @tagName(w), units, std.mem.count(u8, body, e.from), e.from }); - return error.ControlEdit; - } - }; + for ([_]bool{ false, true }) |units| { + const shared = try q.simd_attention.sharedPrefix(units); + for (std.enums.values(Which)) |w| if (controlEdit(w, shared)) |e| { + const gm = at_.geometry(.q27b, shared); + const body = try q.simd_attention.grouped(s.a, units, true, gm.group(), gm.kv_heads, false); + defer s.a.free(body); + if (std.mem.count(u8, body, e.from) != 1) { + std.debug.print("control edit for {s} rows (tensor units {}) matches {d} times, not once: {s}\n", .{ @tagName(w), units, std.mem.count(u8, body, e.from), e.from }); + return error.ControlEdit; + } + }; + } const tensor = s.device.tensorUnits(); var regs: std.ArrayList(Reg) = .empty; defer regs.deinit(s.a); for (heads) |h| for (std.enums.values(Which)) |w| try regs.append(s.a, .{ .heads = h, .which = w }); - for (std.enums.values(Which)) |w| if (hasControl(w, tensor)) try regs.append(s.a, .{ .heads = .q27b, .which = w, .control = true }); + for (std.enums.values(Which)) |w| if (hasControl(w, try q.simd_attention.sharedPrefix(tensor))) try regs.append(s.a, .{ .heads = .q27b, .which = w, .control = true }); for (regs.items) |r| { if (only) |o| if (std.mem.indexOf(u8, spec(r).name, o) == null) continue; const x = try s.a.create(Attn); diff --git a/zig/tests/cuda/contract_family_sets.zig b/zig/tests/cuda/contract_family_sets.zig index 04049bae661..83cbe1d6ce0 100644 --- a/zig/tests/cuda/contract_family_sets.zig +++ b/zig/tests/cuda/contract_family_sets.zig @@ -21,6 +21,8 @@ pub const Sets = struct { exl3: *@import("contract_exl3.zig").Set, shared_down: *SharedDown, prompt: *Prompt, + muse: *@import("contract_muse.zig").Group, + a: std.mem.Allocator, joint_schema: *@import("contract_joint_schema.zig").Set, idol: *@import("contract_idol.zig").Set, @@ -61,6 +63,8 @@ pub const Sets = struct { prompt.* = Prompt.init(gpu, s, prompt_lane); errdefer prompt.deinit(); try prompt.append(cap, a, list); + const muse = try @import("contract_muse.zig").Group.create(a, gpu, s, list); + errdefer muse.destroy(a); const joint_schema = try @import("contract_joint_schema.zig").Set.init(gpu, s, a, list); errdefer joint_schema.deinit(); const idol = try @import("contract_idol.zig").Set.init(gpu, s, a, list); @@ -79,12 +83,15 @@ pub const Sets = struct { .prompt = prompt, .joint_schema = joint_schema, .idol = idol, + .muse = muse, + .a = a, }; } pub fn deinit(sets: Sets) void { sets.idol.deinit(); sets.joint_schema.deinit(); + sets.muse.destroy(sets.a); sets.prompt.deinit(); sets.gpa.destroy(sets.prompt); sets.shared_down.deinit(); diff --git a/zig/tests/cuda/contract_limits.zig b/zig/tests/cuda/contract_limits.zig index acc133eb369..f67475e248c 100644 --- a/zig/tests/cuda/contract_limits.zig +++ b/zig/tests/cuda/contract_limits.zig @@ -47,7 +47,7 @@ pub fn image(name: []const u8) error{UnknownContractImage}![]const u8 { if (std.mem.eql(u8, name, "h3_image_modulation")) return &h3_image_modulation.bytes; inline for (.{ "qwen4_projection", "qwen4_hc", "qwen4_gdn", "qwen4_ple", "gemma4_ple" }) |n| if (std.mem.eql(u8, name, n)) return @field(kk, n); - inline for (.{ "tree_round", "act_rows", "gdn_prep", "qk_rows", "norms", "moe", "experts", "qwen36_mtp", "nemotron_attention", "nemotron_route", "nemotron_latent", "qmm_group", "qmm_prefill", "lane_gemv", "prompt16", "qmmf", "ck_experts", "nvfp4_experts", "nvfp4_experts_tile", "nvfp4_experts32", "rank_sum", "prefill_attention", "vit", "embed_rows", "route_rows", "flashnext_gdn", "flashnext_batch", "flashnext_hc", "flashnext_attn", "flashnext_mtp", "qwen_vision", "exl3_linear", "exl3_experts", "exl3_candidate", "experts3", "experts3_prefill", "drama3", "drama3_fp8", "drama3_codec", "glm_mm", "glm_dflash", "glm_glue", "glm_ops", "glm_index", "nemotron_mamba", "sample", "qwen35", "qwen35_bf16_rows", "qwen35_keep", "qwen35_kv8", "w4a8_prefill", "qwen35_draft", "ck_lane", "gdn_train", "train_q4", "train_attn", "flashnext_train", "train", "attn_train", "qwen27_train", "tree_attention", "block_attention", "window_attention", "window_pages", "moe_glue", "dense_rows", "qmm", "flashnext_fact", "flashnext_hcf", "flashnext_fexp", "experts_rows", "nemotron_ops", "minimax_m3", "minimax_m3_attn", "experts_bf16", "nemo_audio", "moss_image", "idol", "lfm2_moe", "lfm2", "dots_mocr" }) |n| if (std.mem.eql(u8, name, n)) return @field(kk, n); + inline for (.{ "tree_round", "act_rows", "gdn_prep", "qk_rows", "norms", "moe", "experts", "qwen36_mtp", "nemotron_attention", "nemotron_route", "nemotron_latent", "qmm_group", "qmm_prefill", "lane_gemv", "prompt16", "qmmf", "ck_experts", "nvfp4_experts", "nvfp4_experts_tile", "nvfp4_experts32", "rank_sum", "prefill_attention", "vit", "embed_rows", "route_rows", "flashnext_gdn", "flashnext_batch", "flashnext_hc", "flashnext_attn", "flashnext_mtp", "qwen_vision", "exl3_linear", "exl3_experts", "exl3_candidate", "experts3", "experts3_prefill", "drama3", "drama3_fp8", "drama3_codec", "glm_mm", "glm_dflash", "glm_glue", "glm_ops", "glm_index", "nemotron_mamba", "sample", "qwen35", "qwen35_bf16_rows", "qwen35_keep", "qwen35_kv8", "w4a8_prefill", "qwen35_draft", "ck_lane", "gdn_train", "train_q4", "train_attn", "flashnext_train", "train", "attn_train", "qwen27_train", "tree_attention", "block_attention", "window_attention", "window_pages", "moe_glue", "dense_rows", "qmm", "flashnext_fact", "flashnext_hcf", "flashnext_fexp", "experts_rows", "nemotron_ops", "minimax_m3", "minimax_m3_attn", "experts_bf16", "nemo_audio", "moss_image", "idol", "lfm2_moe", "lfm2", "dots_mocr", "muse_glue", "muse_attention", "muse_linear", "muse_experts2", "muse_dflash", "muse_dflash2" }) |n| if (std.mem.eql(u8, name, n)) return @field(kk, n); if (std.mem.eql(u8, name, "contract_controls")) return if (options.controls) &controls.bytes else &.{}; return error.UnknownContractImage; } diff --git a/zig/tests/cuda/contract_muse.zig b/zig/tests/cuda/contract_muse.zig new file mode 100644 index 00000000000..b5ecb6f92c4 --- /dev/null +++ b/zig/tests/cuda/contract_muse.zig @@ -0,0 +1,247 @@ +//! Muse Spark's CUDA kernels under the contract: glue, attention and drafter against float64, EXL3 as replacements. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const check = @import("check.zig"); +const rig_ = @import("contract_rig.zig"); +const x3 = @import("contract_muse_exl3.zig"); +const norms_k = @import("contract_muse_norms.zig"); +const route_k = @import("contract_muse_route.zig"); +const attn_k = @import("contract_muse_attn.zig"); +const draft_k = @import("contract_muse_draft.zig"); +const sel_k = @import("contract_muse_select.zig"); + +const contract = core.contract; +const c = contract.spec; +const g = contract.gates; +const rows = contract.rows; + +/// A thread's 16 squares at most (kMaxPer), then 32 warps' sums of 32 lanes. +fn rmsDepth(s: c.Shape) usize { + return (s.k + 1023) / 1024 + 12; +} + +const rms_why = "an fp16 output follows the sum of squares as ss^-1/2: a bf16 sum's error is a few output ulps"; + +/// muse_rms: the pre-attention norm on the fp32 residual, and the latent norm on fp16 rows. +pub fn rmsSpec(half: bool) c.Spec { + return .{ + .name = if (half) "cuda muse muse_rms (f16 in, the latent norm)" else "cuda muse muse_rms (f32 in, the residual's norm)", + .accum = .f32, + .depth = rmsDepth, + .ops = 8, + .out = .f16, + .tiles = .{ .{}, .{}, .{ .size = 1024 } }, + .sums = .{ .bf16 = 0, .why = rms_why }, + .served = if (half) &.{ .{ .rows = 8, .n = 4096, .k = 4096 }, .{ .rows = 1, .n = 4096, .k = 4096 } } else &.{ .{ .rows = 8, .n = 8192, .k = 8192 }, .{ .rows = 1, .n = 8192, .k = 8192 } }, + }; +} + +pub const Rms = struct { + rig: rig_.Rig, + half: bool, + f: cuda.Function, + r: ?rows.Rows = null, + x: u64 = 0, + w: u64 = 0, + out: u64 = 0, + + pub fn deinit(self: *Rms) void { + if (self.r) |r| r.deinit(); + self.rig.deinit(); + } + + pub fn kernel(self: *Rms) g.Kernel { + return .{ .spec = rmsSpec(self.half), .ctx = self, .vt = &vt }; + } + + const vt = g.hooks(Rms); + + pub fn prepare(self: *Rms, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.n != shape.k or shape.k == 0 or shape.k > 16 * 1024) return false; + if (self.r) |r| r.deinit(); + self.r = null; + self.rig.reset(); + const a = self.rig.gpu.gpa; + const r = try rows.Rows.init(a, .rms, shape); + self.r = r; + r.fill(fill, seed); + if (self.half) { + const h = try a.alloc(f16, r.x.len); + defer a.free(h); + for (h, r.x) |*o, b| o.* = @floatCast(c.fromBf16(b)); + self.x = try self.rig.input(std.mem.sliceAsBytes(h)); + } else { + const f = try a.alloc(f32, r.x.len); + defer a.free(f); + for (f, r.x) |*o, b| o.* = c.fromBf16(b); + self.x = try self.rig.input(std.mem.sliceAsBytes(f)); + } + const wf = try a.alloc(f32, r.w.len); + defer a.free(wf); + for (wf, r.w) |*o, b| o.* = c.fromBf16(b); + self.w = try self.rig.input(std.mem.sliceAsBytes(wf)); + self.out = try self.rig.output(r.outputs() * 2); + return true; + } + + /// ops.norm's launch: a block of 1,024 threads a row, parts 0. + pub fn run(self: *Rms) !void { + const r = self.r.?; + var a: cuda.Args = .{}; + a.add(self.x); + a.add(@as(c_int, @intFromBool(self.half))); + a.add(self.w); + a.add(self.out); + a.add(@as(c_int, @intCast(r.shape.k))); + a.add(@as(f32, r.eps)); + a.add(@as(c_int, 0)); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(r.shape.rows), .y = 1, .z = 1 }, .block = .{ .x = 1024 } }, self.rig.s, &a); + try self.rig.s.synchronize(); + } + + pub fn count(self: *Rms) usize { + return self.r.?.outputs(); + } + + pub fn reference(self: *Rms, want: []f64, mag: []f64) !void { + return self.r.?.reference(want, mag); + } + + pub fn simulate(self: *Rms, acc: c.Accum, order: g.Order, out: []f64) !void { + return self.r.?.simulate(acc, order, out); + } +}; + +/// The family's registrations, appended to the runner's list. +pub const Group = struct { + mods: [6]?cuda.Module = @splat(null), // glue, linear, experts2, attention, dflash, dflash2 + shared: ?cuda.exl3.Linear = null, + experts: ?cuda.exl3_experts.Experts = null, + rms: [2]Rms = undefined, + lins: [x3.lin_entries.len]x3.Lin = undefined, + grps: [x3.grp_entries.len]x3.Grp = undefined, + norms: [norm_list.len]norms_k.Norm = undefined, + routes: [std.enums.values(route_k.Kind).len]route_k.Route = undefined, + attns: [std.enums.values(attn_k.Kind).len]attn_k.Attn = undefined, + drafts: [std.enums.values(draft_k.Kind).len]draft_k.Draft = undefined, + sels: [std.enums.values(sel_k.Kind).len]sel_k.Sel = undefined, + made: [8]usize = @splat(0), + + const NormEntry = struct { kind: norms_k.Kind, cluster: bool }; + const norm_list = [_]NormEntry{ + .{ .kind = .embed, .cluster = false }, .{ .kind = .gate_res, .cluster = false }, .{ .kind = .gate_x, .cluster = false }, + .{ .kind = .gate_xf, .cluster = false }, .{ .kind = .esum, .cluster = false }, .{ .kind = .gate_res, .cluster = true }, + .{ .kind = .gate_x, .cluster = true }, .{ .kind = .gate_xf, .cluster = true }, .{ .kind = .esum, .cluster = true }, + }; + + fn fnName(comptime T: type, kind: T) [:0]const u8 { + return switch (T) { + route_k.Kind => switch (kind) { + .router => "muse_router", + .topk => "muse_topk", + .argmax => "muse_argmax", + .softcap => "muse_softcap", + .rope => "muse_rope_tables", + }, + attn_k.Kind => switch (kind) { + .prep_rope, .prep_nope => "muse_qk_prep", + .rows_slide, .rows_full => "muse_attn_rows", + .merge_slide, .merge_full => "muse_attn_merge", + }, + draft_k.Kind => switch (kind) { + .embed => "dr_block_embed", + .tap => "dr_tap", + .store => "dr_store", + .take => "dr_take", + .norm_q, .norm_k => "dr_norm_rope", + .attn => "dr_attn", + }, + sel_k.Kind => switch (kind) { + .dense_f32, .dense_f16 => "dfl_dense", + .conv_prep => "dfl_conv_prep", + .conv_finish => "dfl_conv_finish", + .silu => "dfl_silu_mul", + .topk => "dfl_topk", + .walk => "dfl_walk", + }, + else => unreachable, + }; + } + + fn many(group: *Group, comptime T: type, comptime K: type, list: []T, mod: cuda.Module, gpu: check.Gpu, s: cuda.Stream, made: *usize) !void { + inline for (comptime std.enums.values(K), 0..) |kind, i| { + list[i] = .{ .rig = .{ .gpu = gpu, .s = s }, .kind = kind, .f = try mod.function(fnName(K, kind)), .arena = std.heap.ArenaAllocator.init(gpu.gpa) }; + made.* += 1; + } + _ = group; + } + + pub fn init(group: *Group, gpu: check.Gpu, s: cuda.Stream) !void { + errdefer group.deinit(); + const kk = cuda.kernels; + for (&group.mods, [_][]const u8{ kk.muse_glue, kk.muse_linear, kk.muse_experts2, kk.muse_attention, kk.muse_dflash, kk.muse_dflash2 }) |*m, blob| m.* = try cuda.Module.load(gpu.d, blob); + const glue = group.mods[0].?; + group.shared = try cuda.exl3.Linear.load(gpu.d); + group.experts = try cuda.exl3_experts.Experts.load(gpu.d); + for (&group.rms, 0..) |*x, i| { + x.* = .{ .rig = .{ .gpu = gpu, .s = s }, .half = i == 1, .f = try glue.function("muse_rms") }; + group.made[0] += 1; + } + for (x3.lin_entries, &group.lins) |e, *x| { + x.* = try x3.Lin.init(.{ .gpu = gpu, .s = s }, e, group.mods[1].?, &group.shared.?); + group.made[1] += 1; + } + for (x3.grp_entries, &group.grps) |e, *x| { + x.* = .{ .rig = .{ .gpu = gpu, .s = s }, .entry = e, .f = try group.mods[2].?.function("muse_grouped2"), .base = group.experts.?.grouped[2] }; + group.made[2] += 1; + } + for (norm_list, &group.norms) |e, *x| { + const name = switch (e.kind) { + .embed => "muse_embed_norm", + .esum => if (e.cluster) "muse_expert_sum_c" else "muse_expert_sum", + else => if (e.cluster) "muse_gate_norm_c" else "muse_gate_norm", + }; + const base: ?cuda.Function = if (!e.cluster) null else try glue.function(if (e.kind == .esum) "muse_expert_sum" else "muse_gate_norm"); + x.* = .{ .rig = .{ .gpu = gpu, .s = s }, .kind = e.kind, .cluster = e.cluster, .f = try glue.function(name), .base = base, .arena = std.heap.ArenaAllocator.init(gpu.gpa) }; + group.made[3] += 1; + } + try group.many(route_k.Route, route_k.Kind, &group.routes, glue, gpu, s, &group.made[4]); + try group.many(attn_k.Attn, attn_k.Kind, &group.attns, group.mods[3].?, gpu, s, &group.made[5]); + try group.many(draft_k.Draft, draft_k.Kind, &group.drafts, group.mods[4].?, gpu, s, &group.made[6]); + try group.many(sel_k.Sel, sel_k.Kind, &group.sels, group.mods[5].?, gpu, s, &group.made[7]); + } + + pub fn append(group: *Group, a: std.mem.Allocator, kernels: *std.ArrayList(g.Kernel)) !void { + inline for (.{ &group.rms, &group.lins, &group.grps, &group.norms, &group.routes, &group.attns, &group.drafts, &group.sels }, 0..) |list, i| { + for (list[0..group.made[i]]) |*x| try kernels.append(a, x.kernel()); + } + } + + pub fn deinit(group: *Group) void { + inline for (.{ &group.rms, &group.lins, &group.grps, &group.norms, &group.routes, &group.attns, &group.drafts, &group.sels }, 0..) |list, i| { + for (list[0..group.made[i]]) |*x| x.deinit(); + } + group.made = @splat(0); + if (group.experts) |*e| e.unload(); + if (group.shared) |*l| l.unload(); + for (&group.mods) |*m| if (m.*) |*x| x.unload(); + group.* = .{}; + } + + /// A group on the heap, its kernels appended now; `destroy` releases both. + pub fn create(a: std.mem.Allocator, gpu: check.Gpu, s: cuda.Stream, kernels: *std.ArrayList(g.Kernel)) !*Group { + const group = try a.create(Group); + group.* = .{}; + errdefer a.destroy(group); + try group.init(gpu, s); + errdefer group.deinit(); + try group.append(a, kernels); + return group; + } + + pub fn destroy(group: *Group, a: std.mem.Allocator) void { + group.deinit(); + a.destroy(group); + } +}; diff --git a/zig/tests/cuda/contract_muse_attn.zig b/zig/tests/cuda/contract_muse_attn.zig new file mode 100644 index 00000000000..2ab68ce19cc --- /dev/null +++ b/zig/tests/cuda/contract_muse_attn.zig @@ -0,0 +1,497 @@ +//! Muse Spark's decode attention under the contract: QK prep and cache write, chunked rows, merge, against float64. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); +const attn_k = @import("contract_attn.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const rows = core.contract.rows; + +const HD = 64; +const G = 8; +const CK = 256; // forward.CK +const eps: f32 = 1e-5; +const scale: f32 = 0.6841258108; // qk_scale_factor * 64^-0.5 +const window = 2047; // sliding_window - 1 + +/// The 64 squares a lane pairs, then the warp by halves. +fn prepDepth(_: c.Shape) usize { + return 2 + 5 + 1; +} + +/// A score's 64 products (and q times the scale), or a chunk's keys chained for l and o. +fn rowsDepth(s: c.Shape) usize { + return @max(HD + 2, @min(s.k, 2048) + 1); +} + +/// Up to 64 chunks chained, then o_norm's 64 squares by halves. +fn mergeDepth(s: c.Shape) usize { + return s.k + 7; +} + +pub const Kind = enum { prep_rope, prep_nope, rows_slide, rows_full, merge_slide, merge_full }; + +const half_why = "fp16 outputs after ss^-1/2: a bf16 sum's error is a few output ulps"; +const rows_rule = "NaN and infinities in K and V reach the partials as float64's two-pass softmax gives them " ++ + "(planted where no NaN enters the chunk maximum)"; + +pub fn spec(kind: Kind) c.Spec { + const prep = &[_]c.Shape{ .{ .rows = 8, .n = 64, .k = HD }, .{ .rows = 1, .n = 64, .k = HD }, .{ .rows = 32, .n = 64, .k = HD } }; + const slide = &[_]c.Shape{ .{ .rows = 4, .n = 64, .k = 100000 }, .{ .rows = 1, .n = 64, .k = 1500 } }; + const full = &[_]c.Shape{ .{ .rows = 4, .n = 64, .k = 20000 }, .{ .rows = 2, .n = 64, .k = 3000 } }; + const merge = &[_]c.Shape{ .{ .rows = 8, .n = 64, .k = 16 }, .{ .rows = 1, .n = 64, .k = 64 } }; + const msum: c.Sums = .{ .bf16 = 0, .exact = false, .why = half_why }; + return switch (kind) { + .prep_rope => .{ .name = "cuda muse muse_qk_prep (q / k norms, RoPE, the cache write)", .accum = .f32, .depth = prepDepth, .out = .f16, .tiles = .{ .{}, .{ .size = 8, .step = 8, .min = 8 }, .{} }, .served = prep, .sums = .{ .bf16 = 0, .why = half_why } }, + .prep_nope => .{ .name = "cuda muse muse_qk_prep (q / k norms, no RoPE, the cache write)", .accum = .f32, .depth = prepDepth, .out = .f16, .tiles = .{ .{}, .{ .size = 8, .step = 8, .min = 8 }, .{} }, .served = prep, .sums = .{ .bf16 = 0, .why = half_why } }, + .rows_slide => .{ .name = "cuda muse muse_attn_rows (sliding window over a ring, 256-key chunks)", .accum = .f32, .depth = rowsDepth, .out = .f32, .nan = .{ .stated = rows_rule }, .tiles = .{ .{}, .{}, .{ .size = 2048 } }, .served = slide }, + .rows_full => .{ .name = "cuda muse muse_attn_rows (full layer, each row's own chunk width)", .accum = .f32, .depth = rowsDepth, .out = .f32, .nan = .{ .stated = rows_rule }, .tiles = .{ .{}, .{}, .{ .size = 4096 } }, .served = full }, + .merge_slide => .{ .name = "cuda muse muse_attn_merge (sliding: fp16 sigmoid gate)", .accum = .f32, .depth = mergeDepth, .out = .f16, .served = merge, .sums = msum }, + .merge_full => .{ .name = "cuda muse muse_attn_merge (full: fp32 sigmoid gate)", .accum = .f32, .depth = mergeDepth, .out = .f16, .served = merge, .sums = msum }, + }; +} + +/// forward.zig's muse_chunk_keys: a full layer's chunk for a row at p. +fn chunkKeys(p: usize, full: usize) usize { + var b: usize = 4096; + while (b < p + 1) b <<= 1; + b = @min(full, b); + return @max(256, ((b + 63) / 64 + 255) / 256 * 256); +} + +pub const Attn = struct { + rig: rig_.Rig, + kind: Kind, + f: cuda.Function, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + stress: bool = false, + hk: usize = 0, + len: usize = 0, // cache rows a slot + nch: usize = 0, + full: usize = 0, // the full layer's context (CK-rounded) + pos: []i32 = &.{}, + q: []f64 = &.{}, + k: []f64 = &.{}, // prep: k rows; attention: the caches [slots, len, hk, 64] + v: []f64 = &.{}, + tab: [2][]f64 = .{ &.{}, &.{} }, + part: [3][]f64 = .{ &.{}, &.{}, &.{} }, // merge: po, pm, pl + gate: []f64 = &.{}, + dev: [10]u64 = @splat(0), + + pub fn deinit(self: *Attn) void { + self.arena.deinit(); + self.rig.deinit(); + } + + const vt = blk: { + var v = g.hooks(Attn); + v.check = null; + break :blk v; + }; + + pub fn kernel(self: *Attn) g.Kernel { + return .{ .spec = spec(self.kind), .ctx = self, .vt = &vt }; + } + + fn isRows(self: *const Attn) bool { + return self.kind == .rows_slide or self.kind == .rows_full; + } + + /// Keys [start, end) of row r's chunk ch. + fn chunk(self: *const Attn, r: usize, ch: usize) [2]usize { + const p: usize = @intCast(self.pos[r]); + const lo = if (self.kind == .rows_slide) p -| window else 0; + const ck = if (self.kind == .rows_slide) CK else chunkKeys(p, self.full); + const start = lo + ch * ck; + return .{ start, @max(start, @min(start + ck, p + 1)) }; + } + + pub fn prepare(self: *Attn, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.n == 0 or shape.n % G != 0) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + self.shape = shape; + self.stress = fill == .stress; + self.hk = shape.n / G; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + const n = shape.rows; + const H = shape.n; + const nf = fill == .nonfinite; + switch (self.kind) { + .prep_rope, .prep_nope => { + if (shape.k != HD) return false; + self.len = n; + self.pos = try a.alloc(i32, n); + const base = rng.uintLessThan(u32, 4096); + for (self.pos, 0..) |*p, r| p.* = @intCast(base + r); + self.q = try a.alloc(f64, n * H * HD); + self.k = try a.alloc(f64, n * self.hk * HD); + self.v = try a.alloc(f64, n * self.hk * HD); + for ([_][]f64{ self.q, self.k, self.v }) |x| for (x) |*o| { + o.* = if (self.stress) mu.int(rng, -200, 200) else mu.uni(rng, f16, -3, 3); + }; + if (nf) { + self.q[3] = std.math.nan(f64); + self.k[HD + 7] = std.math.inf(f64); + self.k[2 * HD + 1] = -std.math.inf(f64); + self.v[5] = std.math.nan(f64); + } + const tl = (base + n) * HD / 2; + for (&self.tab, 0..) |*t, i| { + t.* = try a.alloc(f64, tl); + for (t.*, 0..) |*o, j| { + const ang = @as(f64, @floatFromInt(j / 32)) / std.math.pow(f64, 500000, @as(f64, @floatFromInt(j % 32)) / 32); + o.* = mu.f32r(if (i == 0) @cos(ang) else @sin(ang)); + } + } + inline for (.{ self.q, self.k, self.v }, 0..) |x, i| self.dev[i] = try mu.put(&self.rig, ga, f16, x); + for (0..2) |i| self.dev[3 + i] = try mu.put(&self.rig, ga, f32, self.tab[i]); + const slot = try a.alloc(i32, n); + @memset(slot, 0); + self.dev[5] = try mu.ints(&self.rig, i32, self.pos); + self.dev[6] = try mu.ints(&self.rig, i32, slot); + self.dev[7] = try self.rig.output(n * H * HD * 2); + self.dev[8] = try self.rig.output(n * self.hk * HD * 2); + self.dev[9] = try self.rig.output(n * self.hk * HD * 2); + }, + .rows_slide, .rows_full => { + if (shape.k < n) return false; + self.pos = try a.alloc(i32, n); + for (self.pos, 0..) |*p, r| p.* = @intCast(shape.k - 1 - r); // row r sees keys up to k - 1 - r + self.full = (shape.k + 4096 + CK - 1) / CK * CK; + self.len = if (self.kind == .rows_slide) window + 1 + 64 else shape.k; // a ring past the window + self.nch = if (self.kind == .rows_slide) (window + 1 + CK - 1) / CK else blk: { + var most: usize = 0; + for (0..n) |r| { + const p: usize = @intCast(self.pos[r]); + most = @max(most, (p + 1 + chunkKeys(p, self.full) - 1) / chunkKeys(p, self.full)); + } + break :blk most + 1; // one chunk past the row's keys: empty + }; + const kv = n * self.len * self.hk * HD; + self.q = try a.alloc(f64, n * H * HD); + self.k = try a.alloc(f64, kv); + self.v = try a.alloc(f64, kv); + for (self.q) |*o| o.* = if (self.stress) 0 else mu.uni(rng, f16, -1, 1); + for (self.k) |*o| o.* = mu.uni(rng, f16, -1, 1); + for (self.v) |*o| o.* = mu.uni(rng, f16, -2, 2); + if (self.stress) try self.mirrorV(rng); + if (nf) { + const at = [_][4]usize{ .{ 0, 5, 0, 3 }, .{ 1, 7, 0, 10 }, .{ 2, 2, 0, 0 } }; + const put = [_]f64{ std.math.nan(f64), std.math.inf(f64), -std.math.inf(f64) }; + for (at, put) |p, x| if (p[0] < n) { + self.v[self.cacheAt(p[0], self.keyOf(p[0], p[1]), p[2]) + p[3]] = x; + }; + if (n > 3) self.k[self.cacheAt(3, self.keyOf(3, 1), 0) + 4] = std.math.inf(f64); + } + const slot = try a.alloc(i32, n); + for (slot, 0..) |*s, r| s.* = @intCast(r); + self.dev[0] = try mu.put(&self.rig, ga, f16, self.q); + self.dev[1] = try mu.put(&self.rig, ga, f16, self.k); + self.dev[2] = try mu.put(&self.rig, ga, f16, self.v); + self.dev[3] = try mu.ints(&self.rig, i32, self.pos); + self.dev[4] = try mu.ints(&self.rig, i32, slot); + const pr = n * H * self.nch; + self.dev[5] = try self.rig.output(pr * HD * 4); + self.dev[6] = try self.rig.output(pr * 4); + self.dev[7] = try self.rig.output(pr * 4); + }, + .merge_slide, .merge_full => { + if (shape.k == 0 or shape.k > 64) return false; + const nch = shape.k; + self.nch = nch; + const pr = n * H * nch; + for (&self.part, [_]usize{ pr * HD, pr, pr }) |*x, l| x.* = try a.alloc(f64, l); + for (0..pr) |i| { + const empty = !self.stress and i % nch == nch - 1 and nch > 1; // a chunk past the row's keys + self.part[1][i] = if (empty) -std.math.inf(f64) else if (self.stress) 0 else mu.uni(rng, f32, -4, 4); + self.part[2][i] = if (empty) 0 else if (self.stress) mu.int(rng, 1, 256) else mu.uni(rng, f32, 1, 64); + const o = self.part[0][i * HD ..][0..HD]; + for (o) |*x| x.* = if (empty) 0 else mu.uni(rng, f32, -16, 16); + } + if (self.stress) for (0..n * H) |hh| { + const terms = try a.alloc(f32, nch); + for (0..HD) |e| { + attn_k.mirrored(rng, terms); // then halves' quarters interleaved: no order meets a term's mirror early + const h = nch / 2; + const q = h / 2; + for (0..nch) |ch| { + const src = if (ch < q) ch else if (ch < 2 * q) h + ch - q else if (ch < 3 * q) ch - q else ch; + self.part[0][(hh * nch + ch) * HD + e] = terms[src]; + } + } + }; + self.gate = try a.alloc(f64, n * H * HD); + for (self.gate) |*x| x.* = mu.uni(rng, f16, -4, 4); + if (nf) { + self.part[0][3] = std.math.nan(f64); // head 0's output + if (H > 1) self.part[0][nch * HD + 9] = std.math.inf(f64); // head 1: inf / L, then inf * 0 + if (H > 2) self.gate[2 * HD + 5] = -std.math.inf(f64); // head 2: sigmoid 0 at one element + } + for (0..3) |i| self.dev[i] = try mu.put(&self.rig, ga, f32, self.part[i]); + self.dev[3] = try mu.put(&self.rig, ga, f16, self.gate); + self.dev[4] = try self.rig.output(n * H * HD * 2); + }, + } + return true; + } + + /// The cache key row of row r's j-th visible key, and its element offset in the caches. + fn keyOf(self: *const Attn, r: usize, j: usize) usize { + return self.chunk(r, 0)[0] + j; + } + + fn cacheAt(self: *const Attn, r: usize, key: usize, kh: usize) usize { + return ((r * self.len + key % self.len) * self.hk + kh) * HD; + } + + /// Gate 4's V: each chunk's values mirrored (integer sums near 2^20, a small result), every score 0 (q = 0). + fn mirrorV(self: *Attn, rng: std.Random) !void { + const a = self.arena.allocator(); + const terms = try a.alloc(f32, 4096); + for (0..self.shape.rows) |r| for (0..self.nch) |ch| { + const se = self.chunk(r, ch); + const nk = se[1] - se[0]; + if (nk == 0) continue; + for (0..self.hk) |kh| for (0..HD) |e| { + attn_k.mirrored(rng, terms[0..nk]); + for (0..nk) |j| self.v[self.cacheAt(r, se[0] + j, kh) + e] = mu.h16(terms[j]); // as the fp16 cache holds it + }; + }; + } + + /// ops.attentionIo's three launches, one at a time. + pub fn run(self: *Attn) !void { + const s = self.rig.s; + const n = self.shape.rows; + const H = self.shape.n; + var a: cuda.Args = .{}; + const d = self.dev; + switch (self.kind) { + .prep_rope, .prep_nope => { + inline for (.{ d[0], d[1], d[2], d[3], d[4] }) |p| a.add(p); + a.add(@as(c_int, @intFromBool(self.kind == .prep_rope))); + inline for (.{ d[5], d[6], d[7], d[8], d[9] }) |p| a.add(p); + inline for (.{ self.len, H, self.hk }) |v| a.add(@as(c_int, @intCast(v))); + a.add(eps); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(n), .y = @intCast(H + self.hk), .z = 1 }, .block = .{ .x = 32 } }, s, &a); + }, + .rows_slide, .rows_full => { + inline for (.{ d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7] }) |p| a.add(p); + a.add(@as(c_int, @intCast(self.len))); + a.add(@as(c_int, @intCast(self.nch))); + a.add(if (self.kind == .rows_slide) @as(c_int, CK) else -@as(c_int, @intCast(self.full))); + a.add(@as(c_int, if (self.kind == .rows_slide) window else 0)); + inline for (.{ H, self.hk }) |v| a.add(@as(c_int, @intCast(v))); + a.add(scale); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(n), .y = @intCast(self.hk), .z = @intCast(self.nch) }, .block = .{ .x = 256 } }, s, &a); + }, + .merge_slide, .merge_full => { + inline for (.{ d[0], d[1], d[2] }) |p| a.add(p); + a.add(@as(c_int, @intCast(self.nch))); + inline for (.{ d[3], d[4] }) |p| a.add(p); + a.add(@as(c_int, @intCast(H))); + a.add(eps); + a.add(@as(c_int, @intFromBool(self.kind == .merge_full))); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(n), .y = @intCast(H / 8), .z = 1 }, .block = .{ .x = 256 } }, s, &a); + }, + } + try s.synchronize(); + } + + pub fn count(self: *Attn) usize { + const n = self.shape.rows; + const H = self.shape.n; + return switch (self.kind) { + .prep_rope, .prep_nope => n * (H + 2 * self.hk) * HD, + .rows_slide, .rows_full => n * H * self.nch * (HD + 2), + .merge_slide, .merge_full => n * H * HD, + }; + } + + pub fn reference(self: *Attn, want: []f64, mag: []f64) !void { + @memset(mag, 0); + return self.eval(.none, .sequential, want, null); + } + + pub fn simulate(self: *Attn, acc: c.Accum, order: g.Order, out: []f64) !void { + return self.eval(acc, order, out, null); + } + + /// First-order propagation of fp32 roundings and 2-ulp exp / rsqrt, doubled; gate 4's rows (scores 0) stay exact. + pub fn bounds(self: *Attn, want: []const f64, mag: []const f64, allow: []f64) !void { + _ = mag; + if (self.stress and self.isRows()) { // exact: the bound as registered, an empty chunk's -inf maximum aside + for (allow, want) |*l, w| if (!std.math.isFinite(w)) { + l.* = mu.allow(.f32, 0, 0); + }; + return; + } + const tmp = try self.arena.allocator().alloc(f64, want.len); + try self.eval(.none, .sequential, tmp, allow); + } + + fn sum(acc: c.Accum, order: g.Order, t: []const f64) f64 { + if (acc != .none) return rows.sumIn(acc, order, t); + var s: f64 = 0; + for (t) |x| s += x; + return s; + } + + fn eval(self: *Attn, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + return switch (self.kind) { + .prep_rope, .prep_nope => self.evalPrep(acc, order, out, err), + .rows_slide, .rows_full => self.evalRows(acc, order, out, err), + .merge_slide, .merge_full => self.evalMerge(acc, order, out, err), + }; + } + + fn evalPrep(self: *Attn, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const n = self.shape.rows; + const H = self.shape.n; + const e_rs = 0.5 * mu.gamma(@floatFromInt(prepDepth(self.shape))) + 3 * mu.u + mu.fast; + var sq: [HD]f64 = undefined; + for (0..n) |r| for (0..H + self.hk) |hh| { + const is_q = hh < H; + const src = if (is_q) self.q[(r * H + hh) * HD ..][0..HD] else self.k[(r * self.hk + hh - H) * HD ..][0..HD]; + for (&sq, src) |*o, x| o.* = x * x; + const rs = 1 / @sqrt(sum(acc, order, &sq) / HD + eps); + const p: usize = @intCast(self.pos[r]); + const at = if (is_q) (r * H + hh) * HD else n * H * HD + ((p % n) * self.hk + hh - H) * HD; // kc: slot 0, row p % n + for (0..32) |l| { + const x0 = src[l] * rs; + const x1 = src[l + 32] * rs; + var y = [2]f64{ x0, x1 }; + var e = [2]f64{ @abs(x0) * (e_rs + mu.u), @abs(x1) * (e_rs + mu.u) }; + if (self.kind == .prep_rope) { + const cs = self.tab[0][p * 32 + l]; + const sn = self.tab[1][p * 32 + l]; + y = .{ x0 * cs - x1 * sn, x1 * cs + x0 * sn }; + const m = [2]f64{ @abs(x0 * cs) + @abs(x1 * sn), @abs(x1 * cs) + @abs(x0 * sn) }; + e = .{ m[0] * (e_rs + 3 * mu.u), m[1] * (e_rs + 3 * mu.u) }; + } + for (0..2) |j| { + out[at + l + 32 * j] = y[j]; + if (err) |el| el[at + l + 32 * j] = mu.allow(.f16, y[j], 2 * e[j]); + } + } + }; + const vat = n * (H + self.hk) * HD; + for (0..n) |r| { + const at = vat + @as(usize, @intCast(self.pos[r])) % n * self.hk * HD; + for (self.v[r * self.hk * HD ..][0 .. self.hk * HD], 0..) |x, i| { + out[at + i] = x; + if (err) |el| el[at + i] = mu.allow(.f16, x, 0); + } + } + } + + fn evalRows(self: *Attn, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const a = self.rig.gpu.gpa; + const n = self.shape.rows; + const H = self.shape.n; + const most = 4096 * 4; + const buf = try a.alloc(f64, 3 * most); + defer a.free(buf); + const sc = buf[0..most]; + const p = buf[most .. 2 * most]; + const t = buf[2 * most ..]; + const pr = n * H * self.nch; + for (0..n) |r| for (0..H) |h| for (0..self.nch) |ch| { + const se = self.chunk(r, ch); + const nk = se[1] - se[0]; + const o = (r * H + h) * self.nch + ch; + const q = self.q[(r * H + h) * HD ..][0..HD]; + var m: f64 = -std.math.inf(f64); + var e_s: f64 = 0; + for (0..nk) |j| { + const kr = self.k[self.cacheAt(r, se[0] + j, h / G)..][0..HD]; + var s: f64 = 0; + var mag: f64 = 0; + for (q, kr) |x, y| { + s += mu.f32r(x * scale) * y; + mag += @abs(x * scale * y); + } + sc[j] = s; + m = @max(m, s); + e_s = @max(e_s, mu.gamma(HD + 2) * mag); + } + for (p[0..nk], sc[0..nk]) |*x, s| x.* = @exp(s - m); + for (t[0..nk]) |*x| x.* = 1; + const l = if (acc == .none) sum(.none, order, p[0..nk]) else sum(acc, order, t[0..nk]) * @as(f64, if (nk > 0) 1 else 0); + const tiles: f64 = @floatFromInt((nk + 31) / 32); + const rel = 2 * e_s + tiles * (2 * mu.fast + 3 * mu.u); + out[pr * HD + o] = if (nk == 0) -std.math.inf(f64) else m; + out[pr * HD + pr + o] = l; + if (err) |el| { + el[pr * HD + o] = if (nk == 0) mu.allow(.f32, 0, 0) else mu.allow(.f32, m, 2 * e_s); + el[pr * HD + pr + o] = mu.allow(.f32, l, 2 * l * (rel + mu.gamma(tiles + 6))); + } + for (0..HD) |e| { + var abs: f64 = 0; + for (t[0..nk], p[0..nk], 0..) |*x, pj, j| { + const vv = self.v[self.cacheAt(r, se[0] + j, h / G) + e]; + x.* = if (acc == .none) pj * vv else vv; + abs += pj * @abs(vv); + } + const y = sum(acc, order, t[0..nk]); + out[o * HD + e] = y; + if (err) |el| el[o * HD + e] = mu.allow(.f32, y, 2 * abs * (rel + mu.gamma(@floatFromInt(nk + 1)))); + } + }; + } + + fn evalMerge(self: *Attn, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const n = self.shape.rows; + const H = self.shape.n; + const nch = self.nch; + const g1 = mu.gamma(@floatFromInt(nch + 1)); + const lo: f64 = 0x1p-11; + var tt: [64]f64 = undefined; + var av: [HD]f64 = undefined; + var ae: [HD]f64 = undefined; + for (0..n * H) |hh| { + const pm = self.part[1][hh * nch ..][0..nch]; + const pl = self.part[2][hh * nch ..][0..nch]; + var M: f64 = -std.math.inf(f64); + for (pm) |x| M = @max(M, x); + for (tt[0..nch], pm, pl) |*x, m, l| x.* = if (l == 0) 0 else l * @exp(m - M); + const L = sum(acc, order, tt[0..nch]); + for (0..HD) |e| { + var abs: f64 = 0; + for (tt[0..nch], 0..) |*x, ch| { + const f = if (pl[ch] == 0) 0 else @exp(pm[ch] - M); + x.* = self.part[0][(hh * nch + ch) * HD + e] * f; + abs += @abs(x.*); + } + av[e] = sum(acc, order, tt[0..nch]) / L; + ae[e] = (abs / L + @abs(av[e])) * (g1 + mu.fast + 2 * mu.u) + @abs(av[e]) * lo; + } + var ss: f64 = 0; + var se: f64 = 0; + for (av, ae) |x, e| { + ss += x * x; + se += 2 * @abs(x) * e; + } + const rs = 1 / @sqrt(ss / HD + eps); + const e_rs = 0.5 * (mu.gamma(7) + if (ss > 0) se / ss else 0) + 3 * mu.u + mu.fast; + for (0..HD) |e| { + const nv = av[e] * rs; + const en = rs * ae[e] + @abs(nv) * (e_rs + mu.u + lo); + const gv = self.gate[hh * HD + e]; + const s = 1 / (1 + @exp(-gv)); + const es = s * (mu.fast + 3 * mu.u + @as(f64, if (self.kind == .merge_slide) lo else 0)); + const y = nv * s; + out[hh * HD + e] = y; + if (err) |el| el[hh * HD + e] = mu.allow(.f16, y, 2 * (s * en + @abs(nv) * es + @abs(y) * mu.u)); + } + } + } +}; diff --git a/zig/tests/cuda/contract_muse_draft.zig b/zig/tests/cuda/contract_muse_draft.zig new file mode 100644 index 00000000000..394fae910eb --- /dev/null +++ b/zig/tests/cuda/contract_muse_draft.zig @@ -0,0 +1,437 @@ +//! Muse Spark's DFlash2 drafter glue under the contract (dflash.cu): exact moves, head norms + RoPE, window attention. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); +const attn_k = @import("contract_attn.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const rows = core.contract.rows; + +const HD = 128; +const B = 8; // block_size +const W = 2048; // sliding_window +const eps: f32 = 1e-5; +const scale: f32 = 0.08838834764831845; // 128^-0.5 + +fn noSums(_: c.Shape) usize { + return 0; +} + +/// A head's 128 squares: 32 lanes by halves, then 4 warps in order. +fn normDepth(_: c.Shape) usize { + return 1 + 5 + 4; +} + +/// A score's 128 products times the scale, or a query's visible keys chained for l and o. +fn attnDepth(_: c.Shape) usize { + return W + B; +} + +pub const Kind = enum { embed, tap, store, take, norm_q, norm_k, attn }; + +const half_why = "fp16 outputs after ss^-1/2: a bf16 sum's error is a few output ulps"; +const attn_rule = "NaN and infinities in K and V reach the outputs as float64's two-pass softmax gives them " ++ + "(planted where no NaN enters a tile's maximum)"; + +pub fn spec(kind: Kind) c.Spec { + const moves = &[_]c.Shape{ .{ .rows = 4, .n = 8192, .k = B }, .{ .rows = 1, .n = 8192, .k = B } }; + const heads = &[_]c.Shape{ .{ .rows = 32, .n = 32, .k = HD }, .{ .rows = 8, .n = 4, .k = HD } }; + return switch (kind) { + .embed => .{ .name = "cuda muse dr_block_embed (anchor rows bf16, mask rows fp32)", .accum = .none, .depth = noSums, .out = .f32, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = moves }, + .tap => .{ .name = "cuda muse dr_tap (fp32 residuals to fp16 tap blocks)", .accum = .none, .depth = noSums, .out = .f16, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = &.{ .{ .rows = 32, .n = 8192, .k = 5 }, .{ .rows = 1, .n = 8192, .k = 5 } } }, + .store => .{ .name = "cuda muse dr_store (v rows into the ring)", .accum = .none, .depth = noSums, .out = .f16, .tiles = .{ .{}, .{ .size = 2, .min = 1 }, .{} }, .served = &.{ .{ .rows = 32, .n = 4, .k = HD }, .{ .rows = 8, .n = 4, .k = HD } } }, + .take => .{ .name = "cuda muse dr_take (a block's mask rows)", .accum = .none, .depth = noSums, .out = .f16, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = moves }, + .norm_q => .{ .name = "cuda muse dr_norm_rope (q heads, fp32 out)", .accum = .f32, .depth = normDepth, .out = .f32, .served = heads }, + .norm_k => .{ .name = "cuda muse dr_norm_rope (k heads into the ring, fp16)", .accum = .f32, .depth = normDepth, .out = .f16, .served = heads, .sums = .{ .bf16 = 0, .why = half_why } }, + .attn => .{ .name = "cuda muse dr_attn (a block's queries over the window, no sinks)", .accum = .f32, .depth = attnDepth, .out = .f16, .nan = .{ .stated = attn_rule }, .tiles = .{ .{}, .{ .size = 8, .step = 8, .min = 8 }, .{} }, .served = &.{ .{ .rows = 2, .n = 32, .k = 6000 }, .{ .rows = 1, .n = 32, .k = 700 } } }, + }; +} + +pub const Draft = struct { + rig: rig_.Rig, + kind: Kind, + f: cuda.Function, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + stress: bool = false, + in: [3][]f64 = .{ &.{}, &.{}, &.{} }, + tab: [2][]f64 = .{ &.{}, &.{} }, + w: []f64 = &.{}, + pos: []i32 = &.{}, + ring: usize = 0, + kv: usize = 0, + dev: [8]u64 = @splat(0), + + pub fn deinit(self: *Draft) void { + self.arena.deinit(); + self.rig.deinit(); + } + + const vt = blk: { + var v = g.hooks(Draft); + v.check = null; + break :blk v; + }; + + pub fn kernel(self: *Draft) g.Kernel { + return .{ .spec = spec(self.kind), .ctx = self, .vt = &vt }; + } + + fn rnd(self: *Draft, rng: std.Random, comptime T: type, n: usize, lo: f64, hi: f64) ![]f64 { + const x = try self.arena.allocator().alloc(f64, n); + for (x) |*v| v.* = mu.uni(rng, T, lo, hi); + return x; + } + + pub fn prepare(self: *Draft, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.n == 0 or shape.k == 0) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + self.shape = shape; + self.stress = fill == .stress; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + const n = shape.rows; + const D = shape.n; + const nan = std.math.nan(f64); + const inf = std.math.inf(f64); + const nf = fill == .nonfinite; + switch (self.kind) { + .embed => { + self.in[0] = try self.rnd(rng, u16, n * D, -2, 2); // the anchors' embedding rows + self.in[1] = try self.rnd(rng, f32, D, -1, 1); // mask_emb + if (nf) { + self.in[0][1] = nan; + self.in[0][D + 2] = inf; + self.in[1][3] = -inf; + } + const toks = try a.alloc(i64, n); + for (toks, 0..) |*t, s| t.* = @intCast(n - 1 - s); + self.dev[0] = try mu.put(&self.rig, ga, u16, self.in[0]); + self.dev[1] = try mu.put(&self.rig, ga, f32, self.in[1]); + self.dev[2] = try mu.ints(&self.rig, i64, toks); + self.dev[3] = try self.rig.output(n * shape.k * D * 4); + }, + .tap => { + self.in[0] = try self.rnd(rng, f32, shape.k * n * D, -1000, 1000); // each tap's residual rows + if (nf) { + self.in[0][0] = nan; + self.in[0][D + 1] = inf; + self.in[0][n * D + 2] = -inf; + } + self.dev[0] = try mu.put(&self.rig, ga, f32, self.in[0]); + self.dev[1] = try self.rig.output(shape.k * n * D * 2); + }, + .store, .take => { + if (self.kind == .store and shape.k != HD) return false; + const len = if (self.kind == .store) n * shape.n * shape.k else n * B * D; + self.in[0] = try self.rnd(rng, f16, len, -8, 8); + if (nf) { + self.in[0][0] = nan; + self.in[0][len / 2 + 1] = inf; + self.in[0][len - 1] = -inf; + } + self.dev[0] = try mu.put(&self.rig, ga, f16, self.in[0]); + if (self.kind == .store) { + self.pos = try a.alloc(i32, n); + const base = rng.uintLessThan(u32, 1 << 20); + for (self.pos, 0..) |*p, r| p.* = @intCast(base + r); + const slot = try a.alloc(i32, n); + @memset(slot, 0); + self.dev[1] = try mu.ints(&self.rig, i32, self.pos); + self.dev[2] = try mu.ints(&self.rig, i32, slot); + self.dev[3] = try self.rig.output(len * 2); + } else self.dev[1] = try self.rig.output(n * (B - 1) * D * 2); + }, + .norm_q, .norm_k => { + if (shape.k != HD) return false; + const nh = shape.n; + self.in[0] = try a.alloc(f64, n * nh * HD); + for (self.in[0]) |*v| v.* = if (self.stress) mu.int(rng, -200, 200) else mu.uni(rng, f16, -3, 3); + self.w = try self.rnd(rng, f32, HD, 0.5, 1.5); + if (nf) { + self.in[0][3] = nan; + self.in[0][HD + 7] = inf; + self.in[0][2 * HD + 70] = -inf; + } + self.pos = try a.alloc(i32, n); + const base = rng.uintLessThan(u32, 8192); + for (self.pos, 0..) |*p, r| p.* = @intCast(base + r); + const tl = (base + n) * 64; + for (&self.tab, 0..) |*t, i| { + t.* = try a.alloc(f64, tl); + for (t.*, 0..) |*o, j| { + const ang = @as(f64, @floatFromInt(j / 64)) / std.math.pow(f64, 500000, @as(f64, @floatFromInt(j % 64)) / 64); + o.* = mu.f32r(if (i == 0) @cos(ang) else @sin(ang)); + } + } + const slot = try a.alloc(i32, n); + @memset(slot, 0); + self.ring = n; + self.dev[0] = try mu.put(&self.rig, ga, f16, self.in[0]); + self.dev[1] = try mu.put(&self.rig, ga, f32, self.w); + for (0..2) |i| self.dev[2 + i] = try mu.put(&self.rig, ga, f32, self.tab[i]); + self.dev[4] = try mu.ints(&self.rig, i32, self.pos); + self.dev[5] = try mu.ints(&self.rig, i32, slot); + self.dev[6] = try self.rig.output(n * nh * HD * (if (self.kind == .norm_q) @as(usize, 4) else 2)); + }, + .attn => return self.prepareAttn(fill, rng), + } + return true; + } + + /// Streams (rows) of B queries at positions p0 .. p0 + B - 1, p0 = k; n query heads over n / 8 KV heads. + fn prepareAttn(self: *Draft, fill: g.Fill, rng: std.Random) !bool { + const sh = self.shape; + if (sh.n % 8 != 0) return false; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + const S = sh.rows; + self.kv = sh.n / 8; + self.ring = W + 2 * B; + self.pos = try a.alloc(i32, S); + for (self.pos, 0..) |*p, s| p.* = @intCast(sh.k - s * 3); // p0 per stream + const cache = S * self.ring * self.kv * HD; + self.in[0] = try a.alloc(f64, S * B * sh.n * HD); + for (self.in[0]) |*v| v.* = if (self.stress) 0 else mu.uni(rng, f32, -1, 1); + self.in[1] = try self.rnd(rng, f16, cache, -1, 1); + self.in[2] = try self.rnd(rng, f16, cache, -2, 2); + if (self.stress) try self.mirrorV(rng); + if (fill == .nonfinite) { + const p0: usize = @intCast(self.pos[0]); + self.in[2][self.cacheAt(0, p0, 0) + 3] = std.math.nan(f64); + self.in[2][self.cacheAt(0, p0 + 2, 0) + 9] = std.math.inf(f64); + self.in[2][self.cacheAt(0, p0 + 4, 1) + 1] = -std.math.inf(f64); + if (S > 1) self.in[1][self.cacheAt(1, @as(usize, @intCast(self.pos[1])) + 1, 0) + 4] = std.math.inf(f64); + } + const slot = try a.alloc(i32, S); + for (slot, 0..) |*s, i| s.* = @intCast(i); + self.dev[0] = try mu.put(&self.rig, ga, f32, self.in[0]); + self.dev[1] = try mu.put(&self.rig, ga, f16, self.in[1]); + self.dev[2] = try mu.put(&self.rig, ga, f16, self.in[2]); + self.dev[3] = try mu.ints(&self.rig, i32, self.pos); + self.dev[4] = try mu.ints(&self.rig, i32, slot); + self.dev[5] = try self.rig.output(S * B * sh.n * HD * 2); + return true; + } + + fn cacheAt(self: *const Draft, s: usize, kp: usize, kh: usize) usize { + return ((s * self.ring + kp % self.ring) * self.kv + kh) * HD; + } + + /// Keys [lo, hi] query b of stream s sees. + fn keys(self: *const Draft, s: usize, b: usize) [2]usize { + const p0: usize = @intCast(self.pos[s]); + return .{ (p0 + b + 1) -| W, p0 + B - 1 }; + } + + /// Gate 4's V: zero where only some of a block's queries look, mirrored over the keys all of them see. + fn mirrorV(self: *Draft, rng: std.Random) !void { + const terms = try self.arena.allocator().alloc(f32, W + B); + for (0..self.shape.rows) |s| { + const all = self.keys(s, B - 1); + const first = self.keys(s, 0)[0]; + for (0..self.kv) |kh| for (0..HD) |e| { + const n = all[1] + 1 - all[0]; + attn_k.mirrored(rng, terms[0..n]); + for (first..all[1] + 1) |kp| self.in[2][self.cacheAt(s, kp, kh) + e] = if (kp < all[0]) 0 else mu.h16(terms[kp - all[0]]); + }; + } + } + + /// dflash2.zig's launches. + pub fn run(self: *Draft) !void { + const s = self.rig.s; + const sh = self.shape; + const n = sh.rows; + const d = self.dev; + var a: cuda.Args = .{}; + var grid: [2]u32 = .{ @intCast(n), 1 }; + var block: u32 = 256; + switch (self.kind) { + .embed => { + inline for (.{ d[0], d[1], d[2], d[3] }) |p| a.add(p); + inline for (.{ sh.k, sh.n }) |v| a.add(@as(c_int, @intCast(v))); + grid[0] = @intCast(n * sh.k); + }, + .tap => { + for (0..sh.k) |j| { + var t: cuda.Args = .{}; + t.add(d[0] + j * n * sh.n * 4); + t.add(d[1]); + inline for (.{ sh.n, sh.k, j }) |v| t.add(@as(c_int, @intCast(v))); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(n), .y = 1, .z = 1 }, .block = .{ .x = 256 } }, s, &t); + } + return s.synchronize(); + }, + .store => { + inline for (.{ d[0], d[1], d[2], d[3] }) |p| a.add(p); + inline for (.{ sh.n, n }) |v| a.add(@as(c_int, @intCast(v))); + }, + .take => { + inline for (.{ d[0], d[1] }) |p| a.add(p); + inline for (.{ B, sh.n }) |v| a.add(@as(c_int, @intCast(v))); + grid[0] = @intCast(n * (B - 1)); + }, + .norm_q, .norm_k => { + inline for (.{ d[0], d[1], d[2], d[3], d[4], d[5] }) |p| a.add(p); + a.add(if (self.kind == .norm_q) d[6] else @as(u64, 0)); + a.add(if (self.kind == .norm_k) d[6] else @as(u64, 0)); + inline for (.{ sh.n, HD, self.ring }) |v| a.add(@as(c_int, @intCast(v))); + a.add(eps); + grid[1] = @intCast(sh.n); + block = HD; + }, + .attn => { + inline for (.{ d[0], d[1], d[2] }) |p| a.add(p); + a.add(@as(u64, 0)); // no sinks, as the drafter's layers + inline for (.{ d[3], d[4], d[5] }) |p| a.add(p); + inline for (.{ B, W, self.ring, sh.n, self.kv }) |v| a.add(@as(c_int, @intCast(v))); + a.add(scale); + grid = .{ @intCast(n * B), @intCast(self.kv) }; + }, + } + try cuda.launch.launch(self.f, .{ .grid = .{ .x = grid[0], .y = grid[1], .z = 1 }, .block = .{ .x = block } }, s, &a); + try s.synchronize(); + } + + pub fn count(self: *Draft) usize { + const sh = self.shape; + return switch (self.kind) { + .embed => sh.rows * sh.k * sh.n, + .tap => sh.k * sh.rows * sh.n, + .store => sh.rows * sh.n * sh.k, + .take => sh.rows * (B - 1) * sh.n, + .norm_q, .norm_k => sh.rows * sh.n * HD, + .attn => sh.rows * B * sh.n * HD, + }; + } + + pub fn reference(self: *Draft, want: []f64, mag: []f64) !void { + @memset(mag, 0); + return self.eval(.none, .sequential, want, null); + } + + pub fn simulate(self: *Draft, acc: c.Accum, order: g.Order, out: []f64) !void { + return self.eval(acc, order, out, null); + } + + /// Moves are exact; norms and attention by first-order propagation, doubled; gate 4's rows (scores 0) stay exact. + pub fn bounds(self: *Draft, want: []const f64, mag: []const f64, allow: []f64) !void { + _ = mag; + if (self.kind != .norm_q and self.kind != .norm_k and self.kind != .attn) return; + if (self.stress and self.kind == .attn) return; + const tmp = try self.arena.allocator().alloc(f64, want.len); + try self.eval(.none, .sequential, tmp, allow); + } + + fn sum(acc: c.Accum, order: g.Order, t: []const f64) f64 { + if (acc != .none) return rows.sumIn(acc, order, t); + var s: f64 = 0; + for (t) |x| s += x; + return s; + } + + fn eval(self: *Draft, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const sh = self.shape; + const n = sh.rows; + const D = sh.n; + switch (self.kind) { + .embed => for (0..n) |s| for (0..sh.k) |b| for (0..D) |i| { + out[(s * sh.k + b) * D + i] = if (b == 0) self.in[0][(n - 1 - s) * D + i] else self.in[1][i]; + }, + .tap => for (0..n) |r| for (0..sh.k) |j| for (0..D) |i| { + out[(r * sh.k + j) * D + i] = self.in[0][(j * n + r) * D + i]; + }, + .store => for (0..n) |r| { + const row = sh.n * sh.k; + const p: usize = @intCast(self.pos[r]); + @memcpy(out[(p % n) * row ..][0..row], self.in[0][r * row ..][0..row]); + }, + .take => for (0..n) |s| for (1..B) |b| { + @memcpy(out[(s * (B - 1) + b - 1) * D ..][0..D], self.in[0][(s * B + b) * D ..][0..D]); + }, + .norm_q, .norm_k => self.evalNorm(acc, order, out, err), + .attn => try self.evalAttn(acc, order, out, err), + } + } + + fn evalNorm(self: *Draft, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) void { + const n = self.shape.rows; + const nh = self.shape.n; + const e_rs = 0.5 * mu.gamma(@floatFromInt(normDepth(self.shape))) + 3 * mu.u + mu.fast; + var sq: [HD]f64 = undefined; + var y: [HD]f64 = undefined; + const e: c.Elem = if (self.kind == .norm_q) .f32 else .f16; + for (0..n) |r| for (0..nh) |h| { + const x = self.in[0][(r * nh + h) * HD ..][0..HD]; + for (&sq, x) |*o, v| o.* = v * v; + const rs = 1 / @sqrt(sum(acc, order, &sq) / HD + eps); + for (&y, x, self.w) |*o, v, w| o.* = v * rs * w; + const p: usize = @intCast(self.pos[r]); + const row = if (self.kind == .norm_q) r else p % self.ring; + for (0..HD) |d| { + const j = d % 64; + const cs = self.tab[0][p * 64 + j]; + const sn = self.tab[1][p * 64 + j]; + const other = if (d < 64) -y[d + 64] else y[d - 64]; + const v = y[d] * cs + other * sn; + const at = (row * nh + h) * HD + d; + out[at] = v; + if (err) |el| el[at] = mu.allow(e, v, 2 * (@abs(y[d] * cs) + @abs(other * sn)) * (e_rs + 4 * mu.u)); + } + }; + } + + fn evalAttn(self: *Draft, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const a = self.rig.gpu.gpa; + const H = self.shape.n; + const most = W + B; + const buf = try a.alloc(f64, 3 * most); + defer a.free(buf); + const sc = buf[0..most]; + const p = buf[most .. 2 * most]; + const t = buf[2 * most ..]; + for (0..self.shape.rows) |s| for (0..B) |b| for (0..H) |h| { + const ks = self.keys(s, b); + const nk = ks[1] + 1 - ks[0]; + const q = self.in[0][((s * B + b) * H + h) * HD ..][0..HD]; + var m: f64 = -std.math.inf(f64); + var e_s: f64 = 0; + for (0..nk) |j| { + const kr = self.in[1][self.cacheAt(s, ks[0] + j, h / (H / self.kv))..][0..HD]; + var dot: f64 = 0; + var mag: f64 = 0; + for (q, kr) |x, y| { + dot += x * y; + mag += @abs(x * y); + } + sc[j] = dot * scale; + m = @max(m, sc[j]); + e_s = @max(e_s, mu.gamma(HD + 1) * mag * scale); + } + for (p[0..nk], sc[0..nk]) |*x, v| x.* = @exp(v - m); + for (t[0..nk]) |*x| x.* = 1; + const l = if (acc == .none) sum(.none, order, p[0..nk]) else sum(acc, order, t[0..nk]); + const tiles: f64 = @floatFromInt((nk + 31) / 32 + 1); + const rel = 2 * e_s + tiles * (2 * mu.fast + 3 * mu.u) + mu.gamma(tiles + 5); + for (0..HD) |e| { + var abs: f64 = 0; + for (t[0..nk], p[0..nk], 0..) |*x, pj, j| { + const vv = self.in[2][self.cacheAt(s, ks[0] + j, h / (H / self.kv)) + e]; + x.* = if (acc == .none) pj * vv else vv; + abs += pj * @abs(vv); + } + const y = sum(acc, order, t[0..nk]) / l; + const o = ((s * B + b) * H + h) * HD + e; + out[o] = y; + if (err) |el| el[o] = mu.allow(.f16, y, 2 * (abs / l) * (2 * rel + mu.gamma(@floatFromInt(nk + 2)))); + } + }; + } +}; diff --git a/zig/tests/cuda/contract_muse_exl3.zig b/zig/tests/cuda/contract_muse_exl3.zig new file mode 100644 index 00000000000..e5723040d42 --- /dev/null +++ b/zig/tests/cuda/contract_muse_exl3.zig @@ -0,0 +1,233 @@ +//! Muse Spark's EXL3 launch forms as replacements of the shared kernels: each must equal their bytes on any input. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const shared = cuda.exl3; + +const rule = "as the shared kernel it replaces gives them: a non-finite input reaches its row through the rotation"; + +fn noDepth(_: c.Shape) usize { + return 0; +} + +/// muse_linear2_k{K2}_w{WK} (32-row passes) for tf_exl3_linear_{K2}_2_{WK}; muse_linear_multi_k{K2} for 4 of them. +pub const LinEntry = struct { k2: u32, wk: u32, multi: bool }; +pub const lin_entries = [_]LinEntry{ + .{ .k2 = 4, .wk = 8, .multi = false }, .{ .k2 = 4, .wk = 4, .multi = false }, .{ .k2 = 6, .wk = 4, .multi = false }, + .{ .k2 = 3, .wk = 8, .multi = false }, .{ .k2 = 4, .wk = 4, .multi = true }, .{ .k2 = 6, .wk = 4, .multi = true }, +}; + +fn linName(e: LinEntry) []const u8 { + inline for (lin_entries) |x| if (x.k2 == e.k2 and x.wk == e.wk and x.multi == e.multi) { + return if (x.multi) std.fmt.comptimePrint("cuda muse muse_linear_multi_k{d} (q, k, v, gate in one launch)", .{x.k2}) else std.fmt.comptimePrint("cuda muse muse_linear2_k{d}_w{d} (32-row passes)", .{ x.k2, x.wk }); + }; + unreachable; +} + +/// No sums declared (gate 4 N/A): bit-equal to the replaced kernel's sums; rotated inputs cannot hold stress integers. +pub fn linSpec(e: LinEntry) c.Spec { + // the served shapes that plan to this entry's warps (exl3.plan): Muse Spark's o, pre / post and the head slice + const wide = &[_]c.Shape{ .{ .rows = 32, .n = 8192, .k = 8192 }, .{ .rows = 17, .n = 8192, .k = 4096 }, .{ .rows = 128, .n = 16384, .k = 8192 } }; + const narrow = &[_]c.Shape{ .{ .rows = 32, .n = 2048, .k = 8192 }, .{ .rows = 24, .n = 4096, .k = 8192 }, .{ .rows = 128, .n = 512, .k = 8192 } }; + const qkvg = &[_]c.Shape{ .{ .rows = 8, .n = 512, .k = 8192 }, .{ .rows = 1, .n = 512, .k = 8192 }, .{ .rows = 16, .n = 1024, .k = 8192 } }; + return .{ + .name = linName(e), + .accum = .none, + .depth = noDepth, + .out = if (e.multi) .f16 else .f32, + .replaces = if (e.multi) "tf_exl3_linear on each of the four" else "tf_exl3_linear", + .nan = .{ .stated = rule }, + .tiles = .{ .{ .size = if (e.multi) 16 else 32, .step = 1, .min = 1 }, .{ .size = 128, .step = 128, .min = 128 }, .{} }, + .served = if (e.multi) qkvg else if (e.wk == 8) wide else narrow, + }; +} + +/// Random EXL3 weights for one layer: trellis words (any bits decode to a finite fp16), scales near 1. +fn layer(rig: *rig_.Rig, a: std.mem.Allocator, rng: std.Random, k: usize, n: usize, k2: u32) !shared.Weight { + const tw = 4 * @as(usize, k2); + const words = try a.alloc(u32, (k / 16) * (n / 16) * tw); + defer a.free(words); + for (words) |*w| w.* = rng.int(u32); + const sc = try a.alloc(f16, k + n); + defer a.free(sc); + for (sc) |*v| v.* = @floatCast(0.5 + rng.float(f32)); + const st = shared.strides(k, n, k2, true); + return .{ .trellis = try rig.input(std.mem.sliceAsBytes(words)), .suh = try rig.input(std.mem.sliceAsBytes(sc[0..k])), .svh = try rig.input(std.mem.sliceAsBytes(sc[k..])), .k = @intCast(k), .n = @intCast(n), .halves = k2, .codebook = .mul1, .stride_k = st.k, .stride_nb = st.nb }; +} + +pub const Lin = struct { + rig: rig_.Rig, + entry: LinEntry, + lin: *const shared.Linear, + f: cuda.Function, + rot: cuda.Function, + w: [4]shared.Weight = undefined, + jobs: usize = 1, + m: usize = 0, + x: u64 = 0, + xh: u64 = 0, + z: u64 = 0, + counters: u64 = 0, + y: u64 = 0, + base: std.ArrayList(u8) = .empty, + msg: [160]u8 = undefined, + + pub fn init(rig: rig_.Rig, e: LinEntry, mod: cuda.Module, lin: *const shared.Linear) !Lin { + const f = if (e.multi) switch (e.k2) { + inline 3, 4, 6 => |k2| try mod.function(std.fmt.comptimePrint("muse_linear_multi_k{d}", .{k2})), + else => return error.Unregistered, + } else switch (e.k2 * 16 + e.wk) { + inline 3 * 16 + 8, 4 * 16 + 8, 4 * 16 + 4, 6 * 16 + 4 => |v| try mod.function(std.fmt.comptimePrint("muse_linear2_k{d}_w{d}", .{ v / 16, v % 16 })), + else => return error.Unregistered, + }; + return .{ .rig = rig, .entry = e, .lin = lin, .f = f, .rot = try mod.function("muse_rot_multi") }; + } + + pub fn deinit(self: *Lin) void { + self.base.deinit(self.rig.gpu.gpa); + self.rig.deinit(); + } + + const vt = g.hooks(Lin); + + pub fn kernel(self: *Lin) g.Kernel { + return .{ .spec = linSpec(self.entry), .ctx = self, .vt = &vt }; + } + + fn ysize(self: *const Lin) usize { + return self.m * self.w[0].n * (if (self.entry.multi) @as(usize, 2) else 4); + } + + pub fn prepare(self: *Lin, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows < 1 or shape.rows > 128 or shape.k % 128 != 0 or shape.n % 128 != 0 or shape.k == 0 or shape.n == 0) return false; + const p = shared.plan(shape.k, shape.n, 192, 8); + if (p.wk != self.entry.wk or (shape.k / 16) % (p.sk * p.wk) != 0) return false; + self.rig.reset(); + const a = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + self.jobs = if (self.entry.multi) 4 else 1; + self.m = shape.rows; + for (0..self.jobs) |j| self.w[j] = try layer(&self.rig, a, rng, shape.k, shape.n, self.entry.k2); + const x = try a.alloc(f16, shape.rows * shape.k); + defer a.free(x); + for (x) |*v| v.* = @floatCast(rng.float(f32) * 2 - 1); + if (fill == .nonfinite) { + x[0] = std.math.nan(f16); + if (shape.rows > 2) x[2 * shape.k + 5] = std.math.inf(f16); + if (shape.rows > 3) x[3 * shape.k + shape.k - 1] = -std.math.inf(f16); + } + self.x = try self.rig.input(std.mem.sliceAsBytes(x)); + self.xh = try self.rig.scratch(4 * shape.rows * shape.k * 2); + self.z = try self.rig.scratch(@max(4 * @as(usize, p.sk) * shape.rows * shape.n * 4, 4)); + self.counters = try self.rig.scratch(4 * shared.Linear.counterBytes(self.w[0])); + self.y = try self.rig.output(self.jobs * self.ysize()); + return true; + } + + /// The family's launches: ops.qkvg's rot_multi + linear_multi, or ops.proj's rot_in + linear2. + pub fn run(self: *Lin) !void { + const s = self.rig.s; + const w0 = self.w[0]; + const p = shared.plan(w0.k, w0.n, 192, 8); + const smem: u32 = @intCast(p.wk * @min(self.m, 8) * 128 * 4); + if (self.entry.multi) { + const Job = extern struct { xh: u64, t: u64, stride_k: i64, stride_nb: i64, svh: u64, bias: u64, y: u64, z: u64, counters: u64, y_dtype: c_int, k: c_int, n: c_int, sk: c_int, b0: c_int, pad: c_int = 0 }; + const Batch = extern struct { j: [4]Job, n: c_int, m: c_int, pad: [2]c_int = .{ 0, 0 } }; + const Rot = extern struct { suh: [4]u64, xh: [4]u64 }; + var rot: Rot = undefined; + var bt: Batch = .{ .j = undefined, .n = 4, .m = @intCast(self.m) }; + const zr = @as(usize, p.sk) * self.m * w0.n * 4; + const cr = shared.Linear.counterBytes(w0); + for (0..4) |j| { + const w = self.w[j]; + rot.suh[j] = w.suh; + rot.xh[j] = self.xh + j * self.m * w.k * 2; + bt.j[j] = .{ .xh = rot.xh[j], .t = w.trellis, .stride_k = @intCast(w.stride_k), .stride_nb = @intCast(w.stride_nb), .svh = w.svh, .bias = 0, .y = self.y + j * self.ysize(), .z = if (p.sk > 1) self.z + j * zr else 0, .counters = self.counters + j * cr, .y_dtype = 0, .k = @intCast(w.k), .n = @intCast(w.n), .sk = @intCast(p.sk), .b0 = @intCast(j * (w.n / 128) * p.sk) }; + } + var ra: cuda.Args = .{}; + ra.add(self.x); + ra.add(@as(c_int, 0)); + ra.add(rot); + ra.add(@as(c_int, @intCast(w0.k))); + try cuda.launch.launch(self.rot, .{ .grid = .{ .x = @intCast((w0.k / 128 + 3) / 4), .y = @intCast(self.m), .z = 4 }, .block = .{ .x = 128 } }, s, &ra); + var la: cuda.Args = .{}; + la.add(bt); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(4 * (w0.n / 128) * p.sk), .y = 1, .z = 1 }, .block = .{ .x = 128 }, .shared = smem }, s, &la); + } else { + var ra: cuda.Args = .{}; + inline for (.{ self.x, w0.suh, self.xh }) |v| ra.add(v); + inline for (.{ 0, self.m, w0.k }) |v| ra.add(@as(i32, @intCast(v))); + try cuda.launch.launch(self.lin.rot_in, .{ .grid = .{ .x = @intCast((w0.k / 128 + 3) / 4), .y = @intCast(self.m), .z = 1 }, .block = .{ .x = 128 } }, s, &ra); + var la: cuda.Args = .{}; + inline for (.{ self.xh, w0.trellis }) |v| la.add(v); + la.add(@as(i64, @intCast(w0.stride_k))); + la.add(@as(i64, @intCast(w0.stride_nb))); + inline for (.{ w0.svh, @as(u64, 0), self.y }) |v| la.add(v); + la.add(@as(c_int, 2)); + la.add(if (p.sk > 1) self.z else @as(u64, 0)); + la.add(self.counters); + inline for (.{ self.m, w0.k, w0.n, p.sk }) |v| la.add(@as(c_int, @intCast(v))); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(w0.n / 128), .y = p.sk, .z = 1 }, .block = .{ .x = p.wk * 32 }, .shared = smem }, s, &la); + } + try s.synchronize(); + } + + pub fn count(self: *Lin) usize { + return self.jobs * self.m * self.w[0].n; + } + + /// Never asked: a replacement's gates 1 and 3 compare bytes (check, replaced), and it declares no sums for gate 4. + pub fn reference(_: *Lin, _: []f64, _: []f64) !void { + return error.ReplacementHasNoFloat64Reference; + } + + /// The shared Linear.matmul on the same inputs, each job into its region. + pub fn replaced(self: *Lin) ![]const u8 { + const a = self.rig.gpu.gpa; + const bytes = self.jobs * self.ysize(); + var tmp = try cuda.DeviceBuffer.alloc(self.rig.gpu.d, bytes); + defer tmp.free(); + var z = try cuda.DeviceBuffer.alloc(self.rig.gpu.d, @as(usize, shared.plan(self.w[0].k, self.w[0].n, 192, 8).sk) * self.m * self.w[0].n * 4 + 4); + defer z.free(); + var cn = try cuda.DeviceBuffer.alloc(self.rig.gpu.d, shared.Linear.counterBytes(self.w[0])); + defer cn.free(); + try cn.fill8(0, self.rig.s.handle); + var xh = try cuda.DeviceBuffer.alloc(self.rig.gpu.d, self.m * self.w[0].k * 2); + defer xh.free(); + for (0..self.jobs) |j| try self.lin.matmul(self.rig.s, self.w[j], self.x, .f16, self.m, tmp.ptr + j * self.ysize(), if (self.entry.multi) .f16 else .f32, xh.ptr, z.ptr, cn.ptr); + try self.rig.s.synchronize(); + try self.base.resize(a, bytes); + try tmp.download(0, self.base.items); + return self.base.items; + } + + /// Gate 1: tf_exl3_linear's bytes on the planted inputs, some of them non-finite. + pub fn check(self: *Lin, at: g.Gate) !?[]const u8 { + const a = self.rig.gpu.gpa; + const got = try a.dupe(u8, try self.rig.outputBytes()); + defer a.free(got); + return mu.sameBytes(&self.msg, got, try self.replaced(), "tf_exl3_linear", linSpec(self.entry).out, at); + } +}; + +/// muse_grouped2 (32-member tiles) for tf_exl3_grouped_2: gate / up (2 matrices, sk 4) and down (1, sk 1). +pub const GrpEntry = struct { mats: u32, k2s: [2]u32 }; +pub const grp_entries = [_]GrpEntry{ .{ .mats = 2, .k2s = .{ 4, 4 } }, .{ .mats = 1, .k2s = .{ 3, 4 } }, .{ .mats = 2, .k2s = .{ 6, 3 } } }; + +pub fn grpSpec(e: GrpEntry) c.Spec { + const names = [_][]const u8{ "cuda muse muse_grouped2 (gate / up, 2 bits)", "cuda muse muse_grouped2 (down, 1.5 and 2 bits)", "cuda muse muse_grouped2 (gate / up, 3 and 1.5 bits)" }; + const i = for (grp_entries, 0..) |x, j| { + if (x.mats == e.mats and x.k2s[0] == e.k2s[0] and x.k2s[1] == e.k2s[1]) break j; + } else unreachable; + const gu = &[_]c.Shape{ .{ .rows = 64, .n = 2048, .k = 4096 }, .{ .rows = 17, .n = 2048, .k = 4096 } }; + const dn = &[_]c.Shape{ .{ .rows = 64, .n = 4096, .k = 2048 }, .{ .rows = 33, .n = 4096, .k = 2048 } }; + return .{ .name = names[i], .accum = .none, .depth = noDepth, .out = .f32, .replaces = "tf_exl3_grouped_2", .nan = .{ .stated = rule }, .tiles = .{ .{ .size = 32, .step = 1, .min = 1 }, .{}, .{} }, .served = if (e.mats == 2) gu else dn }; +} + +pub const Grp = @import("contract_muse_grouped.zig").Grp; diff --git a/zig/tests/cuda/contract_muse_grouped.zig b/zig/tests/cuda/contract_muse_grouped.zig new file mode 100644 index 00000000000..a065773268a --- /dev/null +++ b/zig/tests/cuda/contract_muse_grouped.zig @@ -0,0 +1,165 @@ +//! muse_grouped2 under the contract: tf_exl3_grouped_2's bytes on random routings, widths and members. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const x3 = @import("contract_muse_exl3.zig"); +const mu = @import("contract_muse_util.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const sx = cuda.exl3_experts; + +const E = 16; // experts in the fixture +const slots = 8; // Muse Spark's top 8 + +pub const Grp = struct { + rig: rig_.Rig, + entry: x3.GrpEntry, + f: cuda.Function, + base: cuda.Function, + p: usize = 0, + rows: usize = 0, + k: usize = 0, + n: usize = 0, + sk: usize = 1, + maxu: usize = 0, + dev: [10]u64 = @splat(0), // x0, x1, tp0, tp1, k2_0, k2_1, uids, ucount, members, z + host: std.ArrayList(u8) = .empty, + msg: [160]u8 = undefined, + + pub fn deinit(self: *Grp) void { + self.host.deinit(self.rig.gpu.gpa); + self.rig.deinit(); + } + + const vt = g.hooks(Grp); + + pub fn kernel(self: *Grp) g.Kernel { + return .{ .spec = x3.grpSpec(self.entry), .ctx = self, .vt = &vt }; + } + + fn zBytes(self: *const Grp) usize { + return self.entry.mats * self.sk * self.p * self.n * 4; + } + + pub fn prepare(self: *Grp, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.k % 128 != 0 or shape.n % 128 != 0 or shape.k == 0 or shape.n == 0) return false; + self.sk = sx.plan(shape.k, shape.n, self.entry.mats == 2) catch return false; + self.rig.reset(); + const a = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + self.rows = shape.rows; + self.k = shape.k; + self.n = shape.n; + self.p = shape.rows * slots; + // routing: 8 distinct experts a row; members row * 32 + slot in row order, -1 after the last + const pick = try a.alloc(i32, self.p); + defer a.free(pick); + for (0..self.rows) |r| { + var ids: [E]i32 = undefined; + for (&ids, 0..) |*v, i| v.* = @intCast(i); + rng.shuffle(i32, &ids); + @memcpy(pick[r * slots ..][0..slots], ids[0..slots]); + } + var uids: std.ArrayList(i32) = .empty; + defer uids.deinit(a); + for (0..E) |e| if (std.mem.indexOfScalar(i32, pick, @intCast(e)) != null) try uids.append(a, @intCast(e)); + self.maxu = uids.items.len; + const members = try a.alloc(i32, self.maxu * self.rows); + defer a.free(members); + @memset(members, -1); + for (uids.items, 0..) |e, u| { + var j: usize = 0; + for (pick, 0..) |pe, i| if (pe == e) { + members[u * self.rows + j] = @intCast((i / slots) * 32 + i % slots); + j += 1; + }; + } + // inputs: rotated fp16 rows, one trellis a (matrix, expert) in the stored layout, widths per expert + const xs = try a.alloc(f16, self.p * self.k); + defer a.free(xs); + var ptrs: [2][E]i64 = undefined; + var k2s: [2][E]i32 = undefined; + for (0..2) |m| { + for (xs) |*v| v.* = @floatCast(rng.float(f32) * 2 - 1); + if (fill == .nonfinite) { + xs[m * 3] = if (m == 0) std.math.nan(f16) else std.math.inf(f16); + if (self.p > 2) xs[2 * self.k + 7] = -std.math.inf(f16); + } + self.dev[m] = try self.rig.input(std.mem.sliceAsBytes(xs)); + for (0..E) |e| { + const k2 = self.entry.k2s[e % 2]; + k2s[m][e] = @intCast(k2); + const words = try a.alloc(u32, (self.k / 16) * (self.n / 16) * 4 * k2); + defer a.free(words); + for (words) |*w| w.* = rng.int(u32); + ptrs[m][e] = @intCast(try self.rig.input(std.mem.sliceAsBytes(words))); + } + } + if (self.entry.mats == 1) { + self.dev[1] = self.dev[0]; + ptrs[1] = ptrs[0]; + k2s[1] = k2s[0]; + } + for (0..2) |m| { + self.dev[2 + m] = try self.rig.input(std.mem.sliceAsBytes(&ptrs[m])); + self.dev[4 + m] = try self.rig.input(std.mem.sliceAsBytes(&k2s[m])); + } + self.dev[6] = try self.rig.input(std.mem.sliceAsBytes(uids.items)); + const cnt = [1]i32{@intCast(self.maxu)}; + self.dev[7] = try self.rig.input(std.mem.sliceAsBytes(&cnt)); + self.dev[8] = try self.rig.input(std.mem.sliceAsBytes(members)); + self.dev[9] = try self.rig.output(self.zBytes()); + return true; + } + + /// exl3.zig grouped2's launch: grid (experts, N / 128, mats * sk * member tiles of 32). + pub fn run(self: *Grp) !void { + var a: cuda.Args = .{}; + inline for (0..10) |i| a.add(self.dev[i]); + inline for (.{ self.k, self.n, self.p, self.sk, self.rows, slots }) |v| a.add(@as(i32, @intCast(v))); + const z: u32 = @intCast(self.entry.mats * self.sk * ((self.rows + 31) / 32)); + try cuda.launch.launch(self.f, .{ .grid = .{ .x = @intCast(self.maxu), .y = @intCast(self.n / 128), .z = z }, .block = .{ .x = 128 } }, self.rig.s, &a); + try self.rig.s.synchronize(); + } + + pub fn count(self: *Grp) usize { + return self.zBytes() / 4; + } + + /// Never asked: a replacement's gates 1 and 3 compare bytes (check, replaced), and it declares no sums for gate 4. + pub fn reference(_: *Grp, _: []f64, _: []f64) !void { + return error.ReplacementHasNoFloat64Reference; + } + + /// tf_exl3_grouped_2 as exl3_experts.run launches it, into a buffer poisoned as the rig's output is. + pub fn replaced(self: *Grp) ![]const u8 { + const bytes = self.zBytes(); + var tmp = try cuda.DeviceBuffer.alloc(self.rig.gpu.d, bytes); + defer tmp.free(); + try tmp.fill8(0xff, self.rig.s.handle); + var a: cuda.Args = .{}; + inline for (0..9) |i| a.add(self.dev[i]); + a.add(tmp.ptr); + inline for (.{ self.k, self.n, self.p, self.sk, self.rows, slots, self.maxu, self.entry.mats }) |v| a.add(@as(i32, @intCast(v))); + a.add(@as(i32, 0)); + a.add(@as(i32, 0)); + a.add(@as(i32, -1)); + const z: u32 = @intCast(self.entry.mats * self.sk * ((self.rows + 15) / 16)); + try cuda.launch.launch(self.base, .{ .grid = .{ .x = @intCast(self.maxu), .y = @intCast(self.n / 128), .z = z }, .block = .{ .x = 128 } }, self.rig.s, &a); + try self.rig.s.synchronize(); + try self.host.resize(self.rig.gpu.gpa, bytes); + try tmp.download(0, self.host.items); + return self.host.items; + } + + /// Gate 1: tf_exl3_grouped_2's bytes on the planted inputs, some of them non-finite. + pub fn check(self: *Grp, at: g.Gate) !?[]const u8 { + const a = self.rig.gpu.gpa; + const got = try a.dupe(u8, try self.rig.outputBytes()); + defer a.free(got); + return mu.sameBytes(&self.msg, got, try self.replaced(), "tf_exl3_grouped_2", .f32, at); + } +}; diff --git a/zig/tests/cuda/contract_muse_norms.zig b/zig/tests/cuda/contract_muse_norms.zig new file mode 100644 index 00000000000..38e23818ac8 --- /dev/null +++ b/zig/tests/cuda/contract_muse_norms.zig @@ -0,0 +1,363 @@ +//! Muse Spark's norm glue under the contract against float64; the 8-block cluster forms bit-equal to the block forms. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const rows = core.contract.rows; + +/// A thread's ceil(D / 1024) squares, then 32 lanes and 32 warps (or 8 blocks' 4 warps) by halves. +fn rmsDepth(s: c.Shape) usize { + return (s.k + 1023) / 1024 + 12; +} + +const tiles: [3]c.Tile = .{ .{}, .{}, .{ .size = 1024 } }; +const half_why = "an fp16 output follows the sum of squares as ss^-1/2: a bf16 sum's error is a few output ulps"; +const point = "bf16(fp32(y + y2) * scale) is exllamav3's rounding point, replayed on the host from the kernel's two IEEE fp32 " ++ + "steps (an add, then a multiply: nothing to contract); float64 from there"; + +pub const Kind = enum { embed, gate_res, gate_x, gate_xf, esum }; + +pub fn spec(kind: Kind, cluster: bool) c.Spec { + const hidden = &[_]c.Shape{ .{ .rows = 8, .n = 8192, .k = 8192 }, .{ .rows = 1, .n = 8192, .k = 8192 } }; + const latent = &[_]c.Shape{ .{ .rows = 8, .n = 2048, .k = 4096 }, .{ .rows = 1, .n = 2048, .k = 4096 } }; + const gate_sums: c.Sums = .{ .exact = false, .why = point }; + var s: c.Spec = switch (kind) { + .embed => .{ .name = "cuda muse muse_embed_norm (bf16 rows, fp32 out)", .accum = .f32, .depth = rmsDepth, .ops = 8, .out = .f32, .tiles = tiles, .served = hidden }, + .gate_res => .{ .name = "cuda muse muse_gate_norm (the residual, in place)", .accum = .f32, .depth = rmsDepth, .out = .f32, .in_place = true, .tiles = tiles, .served = hidden, .sums = gate_sums }, + .gate_x => .{ .name = "cuda muse muse_gate_norm (the next norm's fp16 x)", .accum = .f32, .depth = rmsDepth, .out = .f16, .tiles = tiles, .served = hidden, .sums = .{ .bf16 = 0, .exact = false, .why = half_why } }, + .gate_xf => .{ .name = "cuda muse muse_gate_norm (the next norm's fp32 xf)", .accum = .f32, .depth = rmsDepth, .out = .f32, .tiles = tiles, .served = hidden, .sums = gate_sums }, + .esum => .{ .name = "cuda muse muse_expert_sum (8 slots, a rank's fp16 columns)", .accum = .f32, .depth = rmsDepth, .out = .f16, .tiles = tiles, .served = latent, .sums = .{ .bf16 = 0, .exact = false, .why = half_why } }, + }; + if (cluster) { + s.name = switch (kind) { + .embed => unreachable, + .gate_res => "cuda muse muse_gate_norm_c (8 blocks a row: the residual)", + .gate_x => "cuda muse muse_gate_norm_c (8 blocks a row: fp16 x)", + .gate_xf => "cuda muse muse_gate_norm_c (8 blocks a row: fp32 xf)", + .esum => "cuda muse muse_expert_sum_c (8 blocks a row)", + }; + s.replaces = if (kind == .esum) "muse_expert_sum" else "muse_gate_norm"; + s.nan = .{ .stated = "the bytes of the 1,024-thread form, non-finite inputs included" }; + } + return s; +} + +const slots = 8; // Muse Spark's top 8 +const post_eps: f32 = 1e-8; +const next_eps: f32 = 1e-5; + +pub const Norm = struct { + rig: rig_.Rig, + kind: Kind, + cluster: bool = false, + f: cuda.Function, + base: ?cuda.Function = null, + arena: std.heap.ArenaAllocator, + r: ?rows.Rows = null, + shape: c.Shape = undefined, + // host values as the kernel reads them: gate (res, y, y2, scale, ab, w); esum (y, y2, wts, scale) + v: [6][]f64 = undefined, + t: []f64 = &.{}, // the rounding point bf16(fp32(y + y2) * scale) + dev: [8]u64 = @splat(0), + lo: usize = 0, + host: std.ArrayList(u8) = .empty, + msg: [160]u8 = undefined, + + pub fn deinit(self: *Norm) void { + if (self.r) |r| r.deinit(); + self.host.deinit(self.rig.gpu.gpa); + self.arena.deinit(); + self.rig.deinit(); + } + + const vt_ref = blk: { + var v = g.hooks(Norm); + v.check = null; + v.replaced = null; + break :blk v; + }; + const vt_rep = g.hooks(Norm); + + pub fn kernel(self: *Norm) g.Kernel { + return .{ .spec = spec(self.kind, self.cluster), .ctx = self, .vt = if (self.cluster) &vt_rep else &vt_ref }; + } + + fn D(self: *const Norm) usize { + return self.shape.k; + } + + fn outW(self: *const Norm) usize { + return if (self.kind == .esum) @min(self.shape.n, self.shape.k) else self.shape.k; + } + + pub fn prepare(self: *Norm, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.k == 0 or shape.k > 16 * 1024 or shape.rows == 0) return false; + if (self.kind == .esum and shape.n == 0) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + if (self.r) |r| r.deinit(); + self.r = null; + self.shape = shape; + const ga = self.rig.gpu.gpa; + if (self.kind == .embed) return self.prepareEmbed(fill, seed); + const a = self.arena.allocator(); + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + const d = self.D(); + const n = if (self.kind == .esum) shape.rows * slots else shape.rows; // rows of y + const lens = if (self.kind == .esum) [6]usize{ n * d, n * d, n, d, 0, 0 } else [6]usize{ n * d, n * d, n * d, d, 2 * d, d }; + for (&self.v, lens) |*x, l| x.* = try a.alloc(f64, l); + const v = &self.v; + const ys = if (self.kind == .esum) [2]usize{ 0, 1 } else [2]usize{ 1, 2 }; + for (ys) |i| for (v[i]) |*x| { + x.* = if (fill == .stress) mu.int(rng, -16, 16) else mu.uni(rng, f32, -2, 2); + }; + if (self.kind == .esum) { + for (v[2]) |*x| x.* = if (fill == .stress) 1 else mu.uni(rng, f32, 0, 0.5); + for (v[3]) |*x| x.* = if (fill == .stress) 1 else mu.uni(rng, u16, 0.5, 1.5); + self.lo = if (self.outW() < d and seed % 2 == 1) d - self.outW() else 0; // either rank's columns + } else { + for (v[0]) |*x| x.* = if (fill == .stress) mu.int(rng, -64, 64) else mu.uni(rng, f32, -4, 4); + for (v[3]) |*x| x.* = if (fill == .stress) 1 else mu.uni(rng, f32, 0.25, 2); + for (v[4]) |*x| x.* = if (fill == .stress) 1 else mu.uni(rng, f32, 0.5, 1.5); + for (v[5]) |*x| x.* = mu.uni(rng, f32, 0.5, 1.5); + } + if (fill == .nonfinite) { + const y = v[ys[0]]; + y[0] = std.math.nan(f64); // row (or slot) 0: every output NaN + const second: usize = if (self.kind == .esum) slots + 2 else 2; // row 1's third slot, or row 2 + if (n > second) v[ys[1]][second * d + 5] = std.math.inf(f64); // inf * 0 at one column, the rest 0 * finite + if (self.kind == .esum) { + if (n > slots + 1) v[2][slots + 1] = -std.math.inf(f64); // row 1's second slot weight + } else if (shape.rows > 3) v[0][3 * d + d - 1] = -std.math.inf(f64); // res: the next norm's row 3 + } + self.t = try a.alloc(f64, n * d); + for (self.t, 0..) |*o, i| { + const sum: f32 = @as(f32, @floatCast(v[ys[0]][i])) + @as(f32, @floatCast(v[ys[1]][i])); + o.* = mu.bf16r(sum * @as(f32, @floatCast(v[3][i % d]))); + } + for (0..6) |i| { + if (lens[i] == 0) continue; + self.dev[i] = try mu.put(&self.rig, ga, f32, v[i]); + } + const ob = shape.rows * self.outW(); + switch (self.kind) { + .gate_res => { + self.dev[6] = try self.rig.output(ob * 4); + self.dev[7] = try self.rig.scratch(ob * 2 + ob * 4); + }, + .gate_x => { + self.dev[6] = try self.rig.output(ob * 2); + self.dev[7] = try self.rig.scratch(ob * 8); + }, + .gate_xf => { + self.dev[6] = try self.rig.output(ob * 4); + self.dev[7] = try self.rig.scratch(ob * 4 + ob * 2); + }, + .esum => self.dev[6] = try self.rig.output(ob * 2), + .embed => unreachable, + } + return true; + } + + fn prepareEmbed(self: *Norm, fill: g.Fill, seed: u64) !bool { + const ga = self.rig.gpu.gpa; + var r = try rows.Rows.init(ga, .rms, self.shape); + r.eps = next_eps; + self.r = r; + r.fill(fill, seed); + @memset(r.w, c.toBf16(1)); // the weightless embed_norm + const n = self.shape.rows; + const k = self.shape.k; + const table = try self.arena.allocator().alloc(u16, r.x.len); // row i of x at table row n - 1 - i + for (0..n) |i| @memcpy(table[(n - 1 - i) * k ..][0..k], r.x[i * k ..][0..k]); + self.dev[0] = try self.rig.input(std.mem.sliceAsBytes(table)); + const ids = try self.arena.allocator().alloc(i64, n); + for (ids, 0..) |*o, i| o.* = @intCast(n - 1 - i); + self.dev[1] = try mu.ints(&self.rig, i64, ids); + self.dev[2] = try self.rig.output(r.outputs() * 4); + return true; + } + + /// Where the view's buffers sit in a call: res, x, xf (gate) from the output and scratch slots. + fn gateOuts(self: *const Norm, out: u64, extra: u64) [3]u64 { + const ob = self.shape.rows * self.D(); + return switch (self.kind) { + .gate_res => .{ out, extra, extra + ob * 2 }, + .gate_x => .{ extra, out, extra + ob * 4 }, + else => .{ extra, extra + ob * 4, out }, + }; + } + + fn launch(self: *Norm, f: cuda.Function, cluster: bool, out: u64, extra: u64) !void { + const s = self.rig.s; + const n = self.shape.rows; + var a: cuda.Args = .{}; + switch (self.kind) { + .embed => { + inline for (.{ self.dev[0], self.dev[1], self.dev[2] }) |p| a.add(p); + a.add(@as(c_int, @intCast(self.D()))); + a.add(next_eps); + }, + .esum => { + inline for (.{ self.dev[0], self.dev[1], self.dev[2], self.dev[3] }) |p| a.add(p); + a.add(post_eps); + a.add(out); + inline for (.{ self.D(), slots, self.lo, self.outW() }) |v| a.add(@as(c_int, @intCast(v))); + }, + else => { + const o = self.gateOuts(out, extra); + try mu.copy(&self.rig, o[0], self.dev[0], n * self.D() * 4); + inline for (.{ o[0], self.dev[1], self.dev[2], self.dev[3] }) |p| a.add(p); + a.add(@as(c_int, 1)); + a.add(post_eps); + inline for (.{ self.dev[4], self.dev[5] }) |p| a.add(p); + a.add(next_eps); + inline for (.{ o[1], o[2] }) |p| a.add(p); + a.add(@as(c_int, @intCast(self.D()))); + }, + } + const grid: u32 = @intCast(if (cluster) n * 8 else n); + try cuda.launch.launch(f, .{ .grid = .{ .x = grid, .y = 1, .z = 1 }, .block = .{ .x = if (cluster) 128 else 1024 } }, s, &a); + try s.synchronize(); + } + + /// The family's launch: ops.gateNormAt / moe's expert sum (rowLaunch), forward's embed. + pub fn run(self: *Norm) !void { + return self.launch(self.f, self.cluster, self.dev[6], self.dev[7]); + } + + pub fn count(self: *Norm) usize { + return self.shape.rows * self.outW(); + } + + /// Float64 outputs from the rounding point on; mag unused (bounds derives each allowance). + pub fn reference(self: *Norm, want: []f64, mag: []f64) !void { + if (self.kind == .embed) return self.r.?.reference(want, mag); + @memset(mag, 0); + return self.eval(.none, .sequential, want, null); + } + + pub fn simulate(self: *Norm, acc: c.Accum, order: g.Order, out: []f64) !void { + if (self.kind == .embed) return self.r.?.simulate(acc, order, out); + return self.eval(acc, order, out, null); + } + + /// Each output's allowance from first-order propagation of its fp32 roundings (doubled for the second order). + pub fn bounds(self: *Norm, want: []const f64, mag: []const f64, allow: []f64) !void { + _ = mag; + if (self.kind == .embed) return; // the rows family's bound, as registered + const tmp = try self.arena.allocator().alloc(f64, want.len); + try self.eval(.none, .sequential, tmp, allow); + } + + fn sq(acc: c.Accum, order: g.Order, a: std.mem.Allocator, x: []const f64) !f64 { + const t = try a.alloc(f64, x.len); + defer a.free(t); + for (t, x) |*o, v| o.* = v * v; + return if (acc == .none) blk: { + var s: f64 = 0; + for (t) |v| s += v; + break :blk s; + } else rows.sumIn(acc, order, t); + } + + /// Outputs with the sums in `acc` (none: float64), or (err non-null) each output's allowance. + fn eval(self: *Norm, acc: c.Accum, order: g.Order, out: []f64, err: ?[]f64) !void { + const a = self.rig.gpu.gpa; + const d = self.D(); + const df: f64 = @floatFromInt(d); + const g1 = mu.gamma(@floatFromInt(rmsDepth(self.shape))); + const e_rs = 0.5 * g1 + 3 * mu.u + mu.fast; // ss / D, + eps, rsqrtf + const v = self.v; + if (self.kind == .esum) { + const accs = try a.alloc(f64, 2 * d); + defer a.free(accs); + const acc_v = accs[0..d]; + const acc_e = accs[d..]; + for (0..self.shape.rows) |r| { + @memset(accs, 0); + for (0..slots) |k| { + const p = r * slots + k; + const t = self.t[p * d ..][0..d]; + const rs = 1 / @sqrt(try sq(acc, order, a, t) / df + post_eps); + for (acc_v, acc_e, t) |*o, *e, x| { + o.* += x * rs * v[2][p]; + e.* += @abs(x * rs * v[2][p]) * (e_rs + 2 * mu.u + mu.gamma(slots)); + } + } + const w = self.outW(); + for (0..w) |j| { + out[r * w + j] = acc_v[self.lo + j]; + if (err) |e| e[r * w + j] = mu.allow(.f16, acc_v[self.lo + j], 2 * acc_e[self.lo + j]); + } + } + return; + } + const buf = try a.alloc(f64, 2 * d); + defer a.free(buf); + const hv = buf[0..d]; + const he = buf[d..]; + for (0..self.shape.rows) |r| { + const t = self.t[r * d ..][0..d]; + const rs1 = 1 / @sqrt(try sq(acc, order, a, t) / df + post_eps); + var sh: f64 = 0; + for (hv, he, t, 0..) |*o, *e, x, i| { + const ra = v[0][r * d + i] * v[4][i]; + const yb = x * rs1 * v[4][d + i]; + o.* = ra + yb; + e.* = @abs(yb) * (e_rs + mu.u) + 3 * mu.u * (@abs(ra) + @abs(yb)); + sh += 2 * @abs(o.*) * e.*; + } + const ss2 = try sq(acc, order, a, hv); + const rs2 = 1 / @sqrt(ss2 / df + next_eps); + const e_rs2 = 0.5 * (g1 + if (ss2 > 0) sh / ss2 else 0) + 3 * mu.u + mu.fast; + for (hv, he, 0..) |x, e, i| { + const o = x * rs2 * v[5][i]; + const eo = @abs(rs2 * v[5][i]) * e + @abs(o) * (e_rs2 + 2 * mu.u); + const at = r * d + i; + switch (self.kind) { + .gate_res => { + out[at] = x; + if (err) |el| el[at] = mu.allow(.f32, x, 2 * e); + }, + .gate_x, .gate_xf => { + out[at] = o; + if (err) |el| el[at] = mu.allow(if (self.kind == .gate_x) .f16 else .f32, o, 2 * eo); + }, + else => unreachable, + } + } + } + } + + /// The 1,024-thread form on the same inputs, into fresh buffers poisoned as the rig's outputs are. + pub fn replaced(self: *Norm) ![]const u8 { + const d = self.rig.gpu.d; + const ob = self.count() * (if (spec(self.kind, false).out == .f16) @as(usize, 2) else 4); + var out = try cuda.DeviceBuffer.alloc(d, ob); + defer out.free(); + try out.fill8(0xff, self.rig.s.handle); + var extra = try cuda.DeviceBuffer.alloc(d, self.shape.rows * self.D() * 8 + 4); + defer extra.free(); + try self.launch(self.base.?, false, out.ptr, extra.ptr); + try self.host.resize(self.rig.gpu.gpa, ob); + try out.download(0, self.host.items); + return self.host.items; + } + + pub fn check(self: *Norm, at: g.Gate) !?[]const u8 { + const a = self.rig.gpu.gpa; + const got = try a.dupe(u8, try self.rig.outputBytes()); + defer a.free(got); + return mu.sameBytes(&self.msg, got, try self.replaced(), self.baseName(), spec(self.kind, false).out, at); + } + + fn baseName(self: *const Norm) []const u8 { + return if (self.kind == .esum) "muse_expert_sum" else "muse_gate_norm"; + } +}; diff --git a/zig/tests/cuda/contract_muse_route.zig b/zig/tests/cuda/contract_muse_route.zig new file mode 100644 index 00000000000..0f07c99bdf6 --- /dev/null +++ b/zig/tests/cuda/contract_muse_route.zig @@ -0,0 +1,344 @@ +//! Muse Spark's router and head glue under the contract: router, top 8, argmax, soft cap and the RoPE tables. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const dense = core.contract.dense; + +fn noSums(_: c.Shape) usize { + return 0; +} + +/// A lane's k / 32 products in order, then the warp's 32 lanes by halves. +fn laneChain(s: c.Shape) usize { + return (s.k + 31) / 32 + 5; +} + +pub const Kind = enum { router, topk, argmax, softcap, rope }; + +const topk_rule = "the top 8 of sigmoid(logit * mult) + bias, ties to the lower expert, in expert order; weights " ++ + "s / (sum s + 1e-15) * scale within 2^-20 of float64; a NaN score at expert e never leaves its tree node: e = 0 is " ++ + "picked first (every weight NaN), any other e is never picked and hides the experts j = e mod 2^ceil(log2(e + 1))"; +const argmax_rule = "the first NaN, else the first maximum, over both ranks' slices up to the vocabulary"; + +const top = 8; +const mult: f32 = 0.17677669529663687; // output_multiplier +const cap: f32 = 20; // final_logit_softcapping +const theta: f64 = 500000; + +pub fn spec(kind: Kind) c.Spec { + return switch (kind) { + .router => .{ .name = "cuda muse muse_router (fp32 rows times bf16 weights)", .accum = .f32, .depth = laneChain, .out = .f32, .tiles = .{ .{}, .{ .size = 2 }, .{ .size = 256 } }, .served = &.{ .{ .rows = 8, .n = 256, .k = 8192 }, .{ .rows = 1, .n = 256, .k = 8192 } } }, + .topk => .{ .name = "cuda muse muse_topk (sigmoid top 8 of 256)", .accum = .none, .depth = noSums, .out = .raw, .nan = .{ .stated = topk_rule }, .tiles = .{ .{}, .{ .size = 256, .step = 32, .min = 32 }, .{} }, .served = &.{ .{ .rows = 8, .n = 256, .k = top }, .{ .rows = 128, .n = 256, .k = top } } }, + .argmax => .{ .name = "cuda muse muse_argmax (two ranks' head slices)", .accum = .none, .depth = noSums, .out = .raw, .nan = .{ .stated = argmax_rule }, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = &.{ .{ .rows = 8, .n = 202048, .k = 101120 }, .{ .rows = 1, .n = 202048, .k = 101120 } } }, + .softcap => .{ .name = "cuda muse muse_softcap (in place)", .accum = .none, .depth = noSums, .ops = 8, .out = .f32, .in_place = true, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = &.{ .{ .rows = 8, .n = 101120, .k = 1 }, .{ .rows = 1, .n = 101120, .k = 1 } } }, + .rope => .{ .name = "cuda muse muse_rope_tables (fp64 then fp32)", .accum = .none, .depth = noSums, .out = .f32, .tiles = .{ .{ .size = 65536 }, .{}, .{} }, .served = &.{ .{ .rows = 471040, .n = 64, .k = 1 }, .{ .rows = 8192, .n = 128, .k = 1 } } }, + }; +} + +pub const Route = struct { + rig: rig_.Rig, + kind: Kind, + f: cuda.Function, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + d: ?dense.Dense = null, + x: []f64 = &.{}, // logits, head slices or soft-cap inputs + bias: []f64 = &.{}, + th: f64 = theta, + dev: [4]u64 = @splat(0), + msg: [200]u8 = undefined, + + pub fn deinit(self: *Route) void { + if (self.d) |d| d.deinit(); + self.arena.deinit(); + self.rig.deinit(); + } + + const vt_ref = blk: { + var v = g.hooks(Route); + v.check = null; + break :blk v; + }; + const vt_rule = g.hooks(Route); + + pub fn kernel(self: *Route) g.Kernel { + const ruled = self.kind == .topk or self.kind == .argmax; + return .{ .spec = spec(self.kind), .ctx = self, .vt = if (ruled) &vt_rule else &vt_ref }; + } + + pub fn prepare(self: *Route, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.n == 0 or shape.k == 0) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + if (self.d) |d| d.deinit(); + self.d = null; + self.shape = shape; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + const nf = fill == .nonfinite; + switch (self.kind) { + .router => { + const d = try dense.Dense.init(ga, shape, 1); + self.d = d; + d.fillX(fill, seed, 1); + const k = shape.k; + for (0..shape.n) |j| for (0..k) |i| { + d.w[j * k + i] = if (fill != .stress) mu.uni(rng, u16, -1, 1) else if (i < k / 2) mu.int(rng, 1, 6) else -d.w[j * k + i - k / 2]; + }; + if (fill == .stress and k % 2 == 1) for (0..shape.n) |j| { + d.w[j * k + k - 1] = 0; + }; + const xs = try a.alloc(f64, d.x.len); + for (xs, d.x) |*o, b| o.* = c.fromBf16(b); + self.dev[0] = try mu.put(&self.rig, ga, f32, xs); + self.dev[1] = try mu.put(&self.rig, ga, u16, d.w); + self.dev[2] = try self.rig.output(shape.rows * shape.n * 4); + }, + .topk => { + if (shape.n > 1024 or shape.k != top) return false; + self.x = try a.alloc(f64, shape.rows * shape.n); + self.bias = try a.alloc(f64, shape.n); + for (self.x) |*v| v.* = mu.int(rng, -64, 64) / 8; // eighths: some ties + for (self.bias) |*v| v.* = mu.int(rng, 0, 7) / 64; + if (nf) { + self.x[3] = std.math.nan(f64); // never picked + if (shape.rows > 1) self.x[shape.n] = std.math.nan(f64); // expert 0: the root keeps it + if (shape.rows > 2) self.x[2 * shape.n + 5] = std.math.inf(f64); + if (shape.rows > 3) self.x[3 * shape.n + 1] = -std.math.inf(f64); + } + self.dev[0] = try mu.put(&self.rig, ga, f32, self.x); + self.dev[1] = try mu.put(&self.rig, ga, f32, self.bias); + self.dev[2] = try self.rig.output(shape.rows * top * 4); + self.dev[3] = try self.rig.output(shape.rows * top * 4); + }, + .argmax => { + const w0 = shape.k; + if (shape.n > 2 * w0) return false; + const w1: usize = if (shape.n > w0) w0 else 0; // rank 1's slice, padded as rank 0's + self.x = try a.alloc(f64, shape.rows * shape.n); + for (self.x) |*v| v.* = mu.int(rng, -1024, 1024) / 16; // sixteenths: ties + if (nf) { + const n = shape.n; + self.x[n / 2] = std.math.nan(f64); + self.x[n - 1] = std.math.nan(f64); // the first NaN wins + if (shape.rows > 1) self.x[n + n / 3] = std.math.inf(f64); + if (shape.rows > 2) self.x[2 * n + 7] = -std.math.inf(f64); + } + // device layout: rank 0's [rows, w0], then rank 1's [rows, w1]; NaN past the vocabulary (never read) + const lay = try a.alloc(f64, shape.rows * (w0 + w1)); + @memset(lay, std.math.nan(f64)); + for (0..shape.rows) |r| for (0..shape.n) |col| { + const at = if (col < w0) r * w0 + col else shape.rows * w0 + r * w1 + col - w0; + lay[at] = self.x[r * shape.n + col]; + }; + self.dev[0] = try mu.put(&self.rig, ga, f32, lay); + self.dev[1] = try self.rig.output(shape.rows * 4); + }, + .softcap => { + self.x = try a.alloc(f64, shape.rows * shape.n); + for (self.x) |*v| v.* = mu.uni(rng, f32, -400, 400); + if (nf) { + self.x[1] = std.math.nan(f64); + self.x[2] = std.math.inf(f64); + self.x[3] = -std.math.inf(f64); + } + self.dev[0] = try mu.put(&self.rig, ga, f32, self.x); + self.dev[1] = try self.rig.output(self.x.len * 4); + }, + .rope => { + if (shape.n % 2 != 0) return false; + self.th = if (nf) std.math.nan(f64) else theta; // column 0 stays finite: theta^0 = 1 + const half = shape.rows * shape.n / 2; + self.dev[0] = try self.rig.output(2 * half * 4); + }, + } + return true; + } + + /// The family's launches (ops.moe, forward's head and tables). + pub fn run(self: *Route) !void { + const s = self.rig.s; + const sh = self.shape; + var a: cuda.Args = .{}; + var grid: [2]u32 = .{ @intCast(sh.rows), 1 }; + var block: u32 = 256; + switch (self.kind) { + .router => { + inline for (.{ self.dev[0], self.dev[1] }) |p| a.add(p); + a.add(@as(c_int, 1)); + a.add(self.dev[2]); + inline for (.{ sh.k, sh.n }) |v| a.add(@as(c_int, @intCast(v))); + grid = .{ @intCast((sh.n + 1) / 2), @intCast(sh.rows) }; + block = 64; + }, + .topk => { + inline for (.{ self.dev[0], self.dev[1] }) |p| a.add(p); + inline for (.{ sh.n, top }) |v| a.add(@as(c_int, @intCast(v))); + a.add(mult); + a.add(@as(f32, 1)); + inline for (.{ self.dev[2], self.dev[3] }) |p| a.add(p); + block = @intCast(std.math.ceilPowerOfTwo(usize, @max(sh.n, 32)) catch unreachable); + }, + .argmax => { + inline for (.{ self.dev[0], self.dev[1] }) |p| a.add(p); + const w1: usize = if (sh.n > sh.k) sh.k else 0; + inline for (.{ sh.k, w1 }) |v| a.add(@as(c_int, @intCast(v))); + a.add(@as(i64, @intCast(sh.rows * sh.k))); + a.add(@as(c_int, @intCast(sh.n))); + }, + .softcap => { + const n = sh.rows * sh.n; + try mu.copy(&self.rig, self.dev[1], self.dev[0], n * 4); + a.add(self.dev[1]); + a.add(@as(i64, @intCast(n))); + a.add(mult); + a.add(cap); + grid = .{ @intCast(@min((n + 255) / 256, 4096)), 1 }; + }, + .rope => { + const half = sh.rows * sh.n / 2; + a.add(self.dev[0]); + a.add(self.dev[0] + half * 4); + a.add(@as(c_int, @intCast(sh.rows))); + a.add(self.th); + a.add(@as(c_int, @intCast(sh.n))); + grid = .{ 256, 1 }; + }, + } + try cuda.launch.launch(self.f, .{ .grid = .{ .x = grid[0], .y = grid[1], .z = 1 }, .block = .{ .x = block } }, s, &a); + try s.synchronize(); + } + + pub fn count(self: *Route) usize { + const sh = self.shape; + return switch (self.kind) { + .router, .softcap, .rope => sh.rows * sh.n, + .topk => sh.rows * top * 8, + .argmax => sh.rows * 4, + }; + } + + pub fn reference(self: *Route, want: []f64, mag: []f64) !void { + switch (self.kind) { + .router => return self.d.?.reference(want, mag), + .softcap => for (want, mag, self.x) |*w, *m, x| { + const v = x * mult; + w.* = std.math.tanh(v / cap) * cap; + m.* = 0; + }, + .rope => { + const half = self.shape.n / 2; + const nh = self.shape.rows * half; + for (0..nh) |i| { + const ang = self.angle(i); + want[i] = @cos(ang); + want[nh + i] = @sin(ang); + mag[i] = 0; + mag[nh + i] = 0; + } + }, + .topk, .argmax => return error.StatedRule, // gates 1 and 3 run check; no sums for gate 4 + } + } + + fn angle(self: *const Route, i: usize) f64 { + const half = self.shape.n / 2; + const j: f64 = @floatFromInt(i % half); + const p: f64 = @floatFromInt(i / half); + return p * (1 / std.math.pow(f64, self.th, 2 * j / @as(f64, @floatFromInt(self.shape.n)))); + } + + /// The tables: fp64 pow / cos / sin within a few double ulps of the angle; the soft cap's x / cap and tanhf. + pub fn bounds(self: *Route, want: []const f64, mag: []const f64, allow: []f64) !void { + _ = mag; + if (self.kind != .rope) return; + const nh = want.len / 2; + for (allow, want, 0..) |*l, w, i| l.* = mu.allow(.f32, w, 0x1p-50 * (@abs(self.angle(i % nh)) + 1)); + } + + pub fn simulate(self: *Route, acc: c.Accum, order: g.Order, out: []f64) !void { + if (self.kind != .router) return error.NoSums; + return self.d.?.simulate(acc, order, out); + } + + /// Expert e's sigmoid and rank score under the stated NaN rule (expert 0 first; a NaN node hides its leaves). + fn score(self: *const Route, r: usize, e: usize) [2]f64 { + const row = self.x[r * self.shape.n ..][0..self.shape.n]; + const s = 1 / (1 + @exp(-(row[e] * mult))); + const v = s + self.bias[e]; + if (std.math.isNan(v)) return .{ s, if (e == 0) std.math.inf(f64) else -std.math.inf(f64) }; + for (row[1..], 1..) |x, j| if (std.math.isNan(x) and j != e) { + const span = std.math.ceilPowerOfTwo(usize, j + 1) catch unreachable; + if (e % span == j % span) return .{ s, -std.math.inf(f64) }; + }; + return .{ s, v }; + } + + pub fn check(self: *Route, _: g.Gate) !?[]const u8 { + return if (self.kind == .topk) self.checkTopk() else self.checkArgmax(); + } + + fn checkTopk(self: *Route) !?[]const u8 { + const a = self.rig.gpu.gpa; + const n = self.shape.n; + const ids = try a.dupe(u8, try self.rig.bytes(self.dev[2], self.shape.rows * top * 4)); + defer a.free(ids); + const wts = try self.rig.bytes(self.dev[3], self.shape.rows * top * 4); + for (0..self.shape.rows) |r| { + var taken = std.StaticBitSet(1024).empty; + var pick: [top]usize = undefined; + var prev: i64 = -1; + for (&pick, 0..) |*p, k| { + const id = std.mem.readInt(i32, ids[(r * top + k) * 4 ..][0..4], .little); + if (id < 0 or id >= n or id <= prev) return try std.fmt.bufPrint(&self.msg, "row {d} pick {d}: expert {d} out of range or out of order", .{ r, k, id }); + prev = id; + p.* = @intCast(id); + taken.set(p.*); + } + var lowest: f64 = std.math.inf(f64); + var sum: f64 = 0; + for (pick) |p| { + lowest = @min(lowest, self.score(r, p)[1]); + sum += self.score(r, p)[0]; + } + for (0..n) |e| if (!taken.isSet(e)) { + const v = self.score(r, e)[1]; + const tol = 0x1p-20 * (@abs(lowest) + 1); + if (v > lowest + tol) return try std.fmt.bufPrint(&self.msg, "row {d}: expert {d} scores {d:.6} over a pick's {d:.6}", .{ r, e, v, lowest }); + if (v == lowest) for (pick) |p| if (p > e and self.score(r, p)[1] == v) + return try std.fmt.bufPrint(&self.msg, "row {d}: expert {d} picked over tied expert {d}", .{ r, p, e }); + }; + for (pick, 0..) |p, k| { + const w: f64 = @as(f32, @bitCast(std.mem.readInt(u32, wts[(r * top + k) * 4 ..][0..4], .little))); + const want = self.score(r, p)[0] / (sum + 1e-15); + const ok = if (std.math.isFinite(want)) @abs(w - want) <= 0x1p-20 * @abs(want) + 1e-30 else c.classOf(w) == c.classOf(want); + if (!ok) return try std.fmt.bufPrint(&self.msg, "row {d} slot {d}: weight {d:.7} where float64 gives {d:.7}", .{ r, k, w, want }); + } + } + return null; + } + + fn checkArgmax(self: *Route) !?[]const u8 { + const got = try self.rig.bytes(self.dev[1], self.shape.rows * 4); + const n = self.shape.n; + for (0..self.shape.rows) |r| { + const row = self.x[r * n ..][0..n]; + var best: usize = 0; + for (row, 0..) |v, i| { + const b = row[best]; + if (std.math.isNan(b)) break; + if (std.math.isNan(v) or v > b) best = i; + } + const id = std.mem.readInt(i32, got[r * 4 ..][0..4], .little); + if (id != @as(i32, @intCast(best))) return try std.fmt.bufPrint(&self.msg, "row {d}: column {d} where the rule gives {d}", .{ r, id, best }); + } + return null; + } +}; diff --git a/zig/tests/cuda/contract_muse_select.zig b/zig/tests/cuda/contract_muse_select.zig new file mode 100644 index 00000000000..b1b92db2cd1 --- /dev/null +++ b/zig/tests/cuda/contract_muse_select.zig @@ -0,0 +1,472 @@ +//! Muse Spark's DFlash2 ops under the contract (dflash2.cu): dense rows, causal convs, SiLU-mul, top 16, the walk. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const mu = @import("contract_muse_util.zig"); + +const c = core.contract.spec; +const g = core.contract.gates; +const rows = core.contract.rows; +const dense = core.contract.dense; + +const B = 8; // block_size +const KT = 2; // conv_kernel_size +const GS = 16; // conv_group_size +const TOPK = 16; +const P = B - 1; // drafted rows a stream +const V = 512; // the fixture's vocabulary (codebook rows) +const none_id: i32 = 0x7fffffff; + +fn noSums(_: c.Shape) usize { + return 0; +} + +/// A lane's K / 32 products in order, then the warp by halves. +fn laneChain(s: c.Shape) usize { + return (s.k + 31) / 32 + 5; +} + +/// KT products chained, after w = base + dyn (and y = y0 + y1, then the residual's add). +fn prepDepth(_: c.Shape) usize { + return KT + 1; +} + +fn finishDepth(_: c.Shape) usize { + return KT + 3; +} + +pub const Kind = enum { dense_f32, dense_f16, conv_prep, conv_finish, silu, topk, walk }; + +const topk_rule = "a row's top 16 valid columns by value, ties to the lower global id, a NaN never a candidate; missing " ++ + "places -inf with id 0x7fffffff; values and ids exact"; +const walk_rule = "per stream, each row's 16 best of the ranks' merged lists (valid ids only, ties to the lower id), " ++ + "scored v + sum_k pcb[prev, k] g[k] scb[c, k]; the first maximum is within fp32's sum bound of float64's first maximum " ++ + "(a NaN score never displaces candidate 0); no valid candidate repeats the previous token"; + +pub fn spec(kind: Kind) c.Spec { + const dn = &[_]c.Shape{ .{ .rows = 56, .n = 2048, .k = 8192 }, .{ .rows = 7, .n = 256, .k = 8192 } }; + const conv = &[_]c.Shape{ .{ .rows = 4, .n = 8192, .k = KT }, .{ .rows = 1, .n = 8192, .k = KT } }; + return switch (kind) { + .dense_f32 => .{ .name = "cuda muse dfl_dense (bf16 weights, fp32 out)", .accum = .f32, .depth = laneChain, .out = .f32, .tiles = .{ .{ .size = 8 }, .{ .size = 8 }, .{ .size = 32 } }, .served = dn }, + .dense_f16 => .{ .name = "cuda muse dfl_dense (bf16 weights, fp16 out)", .accum = .f32, .depth = laneChain, .out = .f16, .tiles = .{ .{ .size = 8 }, .{ .size = 8 }, .{ .size = 32 } }, .served = dn }, + .conv_prep => .{ .name = "cuda muse dfl_conv_prep (grouped dynamic causal conv in, fp16)", .accum = .f32, .depth = prepDepth, .out = .f16, .tiles = .{ .{}, .{ .size = 256, .step = GS, .min = GS }, .{} }, .served = conv }, + .conv_finish => .{ .name = "cuda muse dfl_conv_finish (into the residual, in place)", .accum = .f32, .depth = finishDepth, .out = .f32, .in_place = true, .tiles = .{ .{}, .{ .size = 256, .step = GS, .min = GS }, .{} }, .served = conv }, + .silu => .{ .name = "cuda muse dfl_silu_mul (fp16 interm)", .accum = .none, .depth = noSums, .ops = 8, .out = .f16, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = &.{ .{ .rows = 56, .n = 14336, .k = 1 }, .{ .rows = 7, .n = 14336, .k = 1 } } }, + .topk => .{ .name = "cuda muse dfl_topk (a rank's top 16 of its head slice)", .accum = .none, .depth = noSums, .out = .raw, .nan = .{ .stated = topk_rule }, .tiles = .{ .{}, .{ .size = 256 }, .{} }, .served = &.{ .{ .rows = 28, .n = 101120, .k = 101120 }, .{ .rows = 7, .n = 101120, .k = 100928 } } }, + .walk => .{ .name = "cuda muse dfl_walk (the candidate selector, greedy)", .accum = .none, .depth = noSums, .out = .raw, .nan = .{ .stated = walk_rule }, .tiles = .{ .{}, .{}, .{ .size = 32, .step = 32, .min = 32 } }, .served = &.{ .{ .rows = 4, .n = 2, .k = 256 }, .{ .rows = 1, .n = 2, .k = 256 } } }, + }; +} + +pub const Sel = struct { + rig: rig_.Rig, + kind: Kind, + f: cuda.Function, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + d: ?dense.Dense = null, + in: [6][]f64 = @splat(&.{}), + ids: []i32 = &.{}, + anchors: []i64 = &.{}, + dev: [9]u64 = @splat(0), + msg: [200]u8 = undefined, + + pub fn deinit(self: *Sel) void { + if (self.d) |d| d.deinit(); + self.arena.deinit(); + self.rig.deinit(); + } + + const vt_ref = blk: { + var v = g.hooks(Sel); + v.check = null; + break :blk v; + }; + const vt_rule = g.hooks(Sel); + + pub fn kernel(self: *Sel) g.Kernel { + const ruled = self.kind == .topk or self.kind == .walk; + return .{ .spec = spec(self.kind), .ctx = self, .vt = if (ruled) &vt_rule else &vt_ref }; + } + + fn rnd(self: *Sel, rng: std.Random, comptime T: type, n: usize, lo: f64, hi: f64) ![]f64 { + const x = try self.arena.allocator().alloc(f64, n); + for (x) |*v| v.* = mu.uni(rng, T, lo, hi); + return x; + } + + fn convRows(self: *const Sel) usize { + return self.shape.rows * B; + } + + pub fn prepare(self: *Sel, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.n == 0 or shape.k == 0) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + if (self.d) |d| d.deinit(); + self.d = null; + self.shape = shape; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + const nf = fill == .nonfinite; + const st = fill == .stress; + const nan = std.math.nan(f64); + const inf = std.math.inf(f64); + switch (self.kind) { + .dense_f32, .dense_f16 => { + const d = try dense.Dense.init(ga, shape, 1); + self.d = d; + d.fillX(fill, seed, 1); + for (d.x) |*b| if (@abs(c.fromBf16(b.*)) < 0x1p-14) { // fp16 holds the rest exactly + b.* = 0; + }; + const k = shape.k; + for (0..shape.n) |j| for (0..k) |i| { + d.w[j * k + i] = if (!st) mu.uni(rng, u16, -1, 1) else if (i < k / 2) mu.int(rng, 1, 6) else -d.w[j * k + i - k / 2]; + }; + if (st and k % 2 == 1) for (0..shape.n) |j| { + d.w[j * k + k - 1] = 0; + }; + const xs = try a.alloc(f64, d.x.len); + for (xs, d.x) |*o, b| o.* = c.fromBf16(b); + self.dev[0] = try mu.put(&self.rig, ga, f16, xs); + self.dev[1] = try mu.put(&self.rig, ga, u16, d.w); + self.dev[2] = try self.rig.output(shape.rows * shape.n * (if (self.kind == .dense_f32) @as(usize, 4) else 2)); + }, + .conv_prep, .conv_finish => { + if (shape.k != KT or shape.n % GS != 0) return false; + const R = self.convRows(); + const D = shape.n; + const G = D / GS; + self.in[0] = try a.alloc(f64, 2 * KT * D); // base (prep), then base1 (finish) + self.in[1] = try a.alloc(f64, R * 2 * KT * G); // dyn + for (self.in[0], 0..) |*v, i| v.* = if (st) 512 + @as(f64, @floatFromInt(i / D % KT)) else mu.uni(rng, f32, -1, 1); + for (self.in[1], 0..) |*v, i| v.* = if (!st) mu.uni(rng, f16, -0.5, 0.5) else if (i / G % KT == 0) mu.int(rng, 0, 3) else self.in[1][i - G]; + const h0 = try a.alloc(f64, D); + for (h0) |*v| v.* = mu.int(rng, 33, 63); + // h (prep, fp16) or y0, y1 (finish, fp32) and res: gate 4's rows alternate sign within a block + self.in[2] = if (self.kind == .conv_prep) try self.rnd(rng, f16, R * D, -4, 4) else try self.rnd(rng, f32, R * D, -4, 4); + self.in[3] = try self.rnd(rng, f32, R * D, -4, 4); + self.in[4] = try self.rnd(rng, f32, R * D, -64, 64); + if (st) for (0..R) |r| for (0..D) |i| { + const y = if (r % B % 2 == 0) h0[i] else -h0[i]; + self.in[3][r * D + i] = mu.int(rng, -8, 8); + self.in[2][r * D + i] = if (self.kind == .conv_prep) y else y - self.in[3][r * D + i]; + self.in[4][r * D + i] = mu.int(rng, -64, 64); + }; + if (nf) { + self.in[2][3] = nan; // rows 0 and 1, column 3 + self.in[1][2 * 2 * KT * G + 1] = inf; // row 2's first tap, group 1 + self.in[0][(if (self.kind == .conv_prep) 0 else KT * D) + D + 7] = -inf; // the second tap, column 7 + } + self.dev[0] = try mu.put(&self.rig, ga, f32, self.in[0]); + self.dev[1] = try mu.put(&self.rig, ga, f16, self.in[1]); + if (self.kind == .conv_prep) { + self.dev[2] = try mu.put(&self.rig, ga, f16, self.in[2]); + self.dev[3] = try self.rig.output(R * D * 2); + } else { + for (2..5) |i| self.dev[i] = try mu.put(&self.rig, ga, f32, self.in[i]); + self.dev[5] = try self.rig.output(R * D * 4); + } + }, + .silu => { + const n = shape.rows * shape.n; + self.in[0] = try self.rnd(rng, f16, n, -8, 8); + self.in[1] = try self.rnd(rng, f16, n, -4, 4); + if (nf) { + self.in[0][1] = nan; + self.in[0][2] = inf; + self.in[0][3] = -inf; // -inf / (1 + inf): NaN, as float64 gives it + self.in[1][4] = inf; + } + self.dev[0] = try mu.put(&self.rig, ga, f16, self.in[0]); + self.dev[1] = try mu.put(&self.rig, ga, f16, self.in[1]); + self.dev[2] = try self.rig.output(n * 2); + }, + .topk => { + self.in[0] = try a.alloc(f64, shape.rows * shape.n); + for (self.in[0]) |*v| v.* = mu.int(rng, -2048, 2048) / 32; // ties + if (nf) { + self.in[0][0] = nan; + if (shape.rows > 1) self.in[0][shape.n + 3] = inf; + if (shape.rows > 2) for (self.in[0][2 * shape.n ..][0..shape.n]) |*v| { + v.* = if (rng.boolean()) nan else -inf; // fewer than 16 numbers: -inf ids, then the empty places + }; + } + self.dev[0] = try mu.put(&self.rig, ga, f32, self.in[0]); + self.dev[1] = try self.rig.output(shape.rows * 2 * TOPK * 4); + }, + .walk => return self.prepareWalk(fill, rng), + } + return true; + } + + /// recv [ranks][rows][32] (each rank's top 16 values, then ids as bits), gate [rows, R], codebooks [V, R]. + fn prepareWalk(self: *Sel, fill: g.Fill, rng: std.Random) !bool { + const sh = self.shape; + if (sh.k % 32 != 0 or sh.k > 1024 or sh.n == 0 or sh.n > 4) return false; + const a = self.arena.allocator(); + const ga = self.rig.gpu.gpa; + const n1 = sh.rows * P; + const R = sh.k; + self.in[0] = try a.alloc(f64, sh.n * n1 * TOPK); + self.ids = try a.alloc(i32, sh.n * n1 * TOPK); + const span = V / sh.n; + for (0..sh.n) |q| for (0..n1) |r| { + var top: f64 = mu.int(rng, 0, 64) / 4; + for (0..TOPK) |j| { + const at = (q * n1 + r) * TOPK + j; + self.in[0][at] = top; + top -= mu.int(rng, 0, 4) / 8; // descending, some ties + self.ids[at] = @intCast(q * span + (r * 37 + j * 11) % span); // each rank's own slice of ids + } + }; + self.in[1] = try self.rnd(rng, f16, n1 * R, -1, 1); + self.in[2] = try self.rnd(rng, u16, V * R, -1, 1); + self.in[3] = try self.rnd(rng, u16, V * R, -1, 1); + if (fill == .nonfinite) { + self.in[1][5] = std.math.nan(f64); // row 0: every score NaN, candidate 0 kept + if (n1 > 1) self.in[0][(sh.n - 1) * n1 * TOPK + TOPK + 3] = std.math.inf(f64); // row 1: one candidate +inf + if (n1 > 2) for (0..sh.n) |q| for (0..TOPK) |j| { + self.ids[(q * n1 + 2) * TOPK + j] = none_id; // row 2: no candidate + }; + } + self.anchors = try a.alloc(i64, sh.rows); + for (self.anchors) |*x| x.* = rng.uintLessThan(u32, V); + const recv = try a.alloc(f32, sh.n * n1 * 2 * TOPK); + for (0..sh.n * n1) |r| for (0..TOPK) |j| { + recv[r * 2 * TOPK + j] = @floatCast(self.in[0][r * TOPK + j]); + recv[r * 2 * TOPK + TOPK + j] = @bitCast(self.ids[r * TOPK + j]); + }; + self.dev[0] = try mu.ints(&self.rig, f32, recv); + self.dev[1] = try mu.put(&self.rig, ga, f16, self.in[1]); + self.dev[2] = try mu.put(&self.rig, ga, u16, self.in[2]); + self.dev[3] = try mu.put(&self.rig, ga, u16, self.in[3]); + self.dev[4] = try mu.ints(&self.rig, i64, self.anchors); + self.dev[5] = try self.rig.output(n1 * 4); + return true; + } + + /// dflash2.zig's launches. + pub fn run(self: *Sel) !void { + const s = self.rig.s; + const sh = self.shape; + const d = self.dev; + var a: cuda.Args = .{}; + var grid: [2]u32 = .{ @intCast(sh.rows), 1 }; + var block: u32 = 256; + switch (self.kind) { + .dense_f32, .dense_f16 => { + inline for (.{ d[0], d[1] }) |p| a.add(p); + a.add(@as(c_int, 1)); + a.add(d[2]); + a.add(@as(c_int, @intFromBool(self.kind == .dense_f32))); + inline for (.{ sh.rows, sh.k, sh.n }) |v| a.add(@as(c_int, @intCast(v))); + grid = .{ @intCast((sh.n + 7) / 8), @intCast((sh.rows + 7) / 8) }; + }, + .conv_prep => { + inline for (.{ d[2], d[1], d[0], d[3] }) |p| a.add(p); + inline for (.{ B, sh.n, KT, GS }) |v| a.add(@as(c_int, @intCast(v))); + grid[0] = @intCast(self.convRows()); + }, + .conv_finish => { + try mu.copy(&self.rig, d[5], d[4], self.convRows() * sh.n * 4); + inline for (.{ d[5], d[2], d[3], d[1], d[0] + KT * sh.n * 4 }) |p| a.add(p); + inline for (.{ B, sh.n, KT, GS }) |v| a.add(@as(c_int, @intCast(v))); + grid[0] = @intCast(self.convRows()); + }, + .silu => { + const n = sh.rows * sh.n; + inline for (.{ d[0], d[1], d[2] }) |p| a.add(p); + a.add(@as(i64, @intCast(n))); + grid[0] = @intCast(@min((n + 255) / 256, 4096)); + }, + .topk => { + a.add(d[0]); + const lo: usize = if (sh.k < sh.n) sh.n else 0; // rank 1's slice: its global ids from lo + inline for (.{ sh.n, @min(sh.k, sh.n), lo }) |v| a.add(@as(c_int, @intCast(v))); + a.add(d[1]); + }, + .walk => { + a.add(d[0]); + inline for (.{ sh.n, sh.rows * P }) |v| a.add(@as(c_int, @intCast(v))); + a.add(d[1]); + a.add(@as(c_int, @intCast(sh.k))); + inline for (.{ d[2], d[3] }) |p| a.add(p); + a.add(@as(c_int, 1)); + a.add(d[4]); + a.add(@as(c_int, P)); + a.add(d[5]); + block = 512; + }, + } + try cuda.launch.launch(self.f, .{ .grid = .{ .x = grid[0], .y = grid[1], .z = 1 }, .block = .{ .x = block } }, s, &a); + try s.synchronize(); + } + + pub fn count(self: *Sel) usize { + const sh = self.shape; + return switch (self.kind) { + .dense_f32, .dense_f16, .silu => sh.rows * sh.n, + .conv_prep, .conv_finish => self.convRows() * sh.n, + .topk => sh.rows * 2 * TOPK * 4, + .walk => sh.rows * P * 4, + }; + } + + pub fn reference(self: *Sel, want: []f64, mag: []f64) !void { + switch (self.kind) { + .dense_f32, .dense_f16 => return self.d.?.reference(want, mag), + .conv_prep, .conv_finish => return self.conv(.none, .sequential, want, mag), + .silu => for (want, mag, self.in[0], self.in[1]) |*w, *m, x, uu| { + w.* = x / (1 + @exp(-x)) * uu; + m.* = 0; + }, + .topk, .walk => return error.StatedRule, // gates 1 and 3 run check; no sums for gate 4 + } + } + + pub fn simulate(self: *Sel, acc: c.Accum, order: g.Order, out: []f64) !void { + return switch (self.kind) { + .dense_f32, .dense_f16 => self.d.?.simulate(acc, order, out), + .conv_prep, .conv_finish => self.conv(acc, order, out, null), + else => error.NoSums, + }; + } + + /// Each output's KT terms (and the residual, finish) summed in `acc`; their magnitude into mag. + fn conv(self: *Sel, acc: c.Accum, order: g.Order, out: []f64, mag: ?[]f64) !void { + const D = self.shape.n; + const G = D / GS; + const fin = self.kind == .conv_finish; + const base = self.in[0][if (fin) KT * D else 0..]; + var t: [KT + 1]f64 = undefined; + for (0..self.convRows()) |r| for (0..D) |col| { + const b = r % B; + var n: usize = 0; + for (0..@min(KT, b + 1)) |tt| { + const w = base[tt * D + col] + self.in[1][r * 2 * KT * G + (if (fin) KT * G else 0) + tt * G + col / GS]; + const at = (r - tt) * D + col; + const y = if (fin) self.in[2][at] + self.in[3][at] else self.in[2][at]; + t[n] = w * y; + n += 1; + } + const at = r * D + col; + var s = if (acc == .none) blk: { + var x: f64 = 0; + for (t[0..n]) |v| x += v; + break :blk x; + } else rows.sumIn(acc, order, t[0..n]); + var m: f64 = 0; + for (t[0..n]) |v| m += @abs(v); + if (fin) { + s += self.in[4][at]; + m += @abs(self.in[4][at]); + } + out[at] = s; + if (mag) |x| x[at] = m; + }; + } + + pub fn check(self: *Sel, _: g.Gate) !?[]const u8 { + return if (self.kind == .topk) self.checkTopk() else self.checkWalk(); + } + + fn beats(va: f64, ia: i64, vb: f64, ib: i64) bool { + return va > vb or (va == vb and ia < ib); + } + + fn checkTopk(self: *Sel) !?[]const u8 { + const sh = self.shape; + const got = try self.rig.bytes(self.dev[1], sh.rows * 2 * TOPK * 4); + const lo: i64 = if (sh.k < sh.n) @intCast(sh.n) else 0; + for (0..sh.rows) |r| { + var v: [TOPK]f64 = @splat(-std.math.inf(f64)); + var id: [TOPK]i64 = @splat(none_id); + for (self.in[0][r * sh.n ..][0..@min(sh.k, sh.n)], 0..) |x, col| { + const gid = lo + @as(i64, @intCast(col)); + if (std.math.isNan(x) or !beats(x, gid, v[TOPK - 1], id[TOPK - 1])) continue; + var k: usize = TOPK - 1; + while (k > 0 and beats(x, gid, v[k - 1], id[k - 1])) : (k -= 1) { + v[k] = v[k - 1]; + id[k] = id[k - 1]; + } + v[k] = x; + id[k] = gid; + } + for (0..TOPK) |k| { + const gv: f64 = @as(f32, @bitCast(std.mem.readInt(u32, got[(r * 2 * TOPK + k) * 4 ..][0..4], .little))); + const gi = std.mem.readInt(i32, got[(r * 2 * TOPK + TOPK + k) * 4 ..][0..4], .little); + if (gv != v[k] or gi != id[k]) return try std.fmt.bufPrint(&self.msg, "row {d} place {d}: ({d}, {d}) where the rule gives ({d}, {d})", .{ r, k, gv, gi, v[k], id[k] }); + } + } + return null; + } + + fn checkWalk(self: *Sel) !?[]const u8 { + const sh = self.shape; + const n1 = sh.rows * P; + const R = sh.k; + const got = try self.rig.bytes(self.dev[5], n1 * 4); + for (0..sh.rows) |s| { + var pred: i64 = self.anchors[s]; + for (0..P) |i| { + const row = s * P + i; + var cv: [TOPK]f64 = undefined; + var cid: [TOPK]i64 = @splat(-1); + var used = std.StaticBitSet(64).empty; + for (0..TOPK) |k| { + var best: ?usize = null; + for (0..sh.n * TOPK) |j| { + const at = ((j / TOPK) * n1 + row) * TOPK + j % TOPK; + const id = self.ids[at]; + if (used.isSet(j) or id < 0 or id == none_id) continue; + if (best == null) best = j else { + const bt = ((best.? / TOPK) * n1 + row) * TOPK + best.? % TOPK; + if (beats(self.in[0][at], id, self.in[0][bt], self.ids[bt])) best = j; + } + } + cv[k] = -std.math.inf(f64); + if (best) |j| { + const at = ((j / TOPK) * n1 + row) * TOPK + j % TOPK; + used.set(j); + cv[k] = self.in[0][at]; + cid[k] = self.ids[at]; + } + } + var sc: [TOPK]f64 = undefined; + var tol: [TOPK]f64 = undefined; + for (0..TOPK) |k| { + sc[k] = -std.math.inf(f64); + tol[k] = 0; + if (cid[k] < 0) continue; + var acc: f64 = 0; + var mag: f64 = 0; + for (0..R) |j| { + const t = self.in[2][@as(usize, @intCast(pred)) * R + j] * self.in[1][row * R + j] * self.in[3][@as(usize, @intCast(cid[k])) * R + j]; + acc += t; + mag += @abs(t); + } + sc[k] = cv[k] + acc; + tol[k] = mu.gamma(@floatFromInt(R / 32 + 8)) * mag + mu.u * @abs(cv[k]); + } + var best: usize = 0; + for (1..TOPK) |k| if (sc[k] > sc[best]) { + best = k; + }; + const out: i64 = std.mem.readInt(i32, got[row * 4 ..][0..4], .little); + const want = if (cid[best] >= 0) cid[best] else pred; + if (out != want) { + const k = for (0..TOPK) |x| { + if (cid[x] == out) break x; + } else return try std.fmt.bufPrint(&self.msg, "stream {d} row {d}: {d} is no candidate (rule: {d})", .{ s, i, out, want }); + if (!(sc[k] >= sc[best] - tol[k] - tol[best])) return try std.fmt.bufPrint(&self.msg, "stream {d} row {d}: {d} scores {d:.6} under the best {d:.6}", .{ s, i, out, sc[k], sc[best] }); + } + pred = out; + } + } + return null; + } +}; diff --git a/zig/tests/cuda/contract_muse_util.zig b/zig/tests/cuda/contract_muse_util.zig new file mode 100644 index 00000000000..ee8e367f511 --- /dev/null +++ b/zig/tests/cuda/contract_muse_util.zig @@ -0,0 +1,83 @@ +//! Shared pieces of Muse Spark's contract tests: host values in the kernels' types, uploads, derived allowances. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); + +const c = core.contract.spec; + +/// fp32's unit roundoff, and the relative error of rsqrtf, expf and tanhf (2 ulps). +pub const u = 0x1p-24; +pub const fast = 0x1p-22; + +pub fn gamma(d: f64) f64 { + return c.gamma(d, u); +} + +pub fn h16(v: f64) f64 { + return @as(f16, @floatCast(v)); +} + +pub fn f32r(v: f64) f64 { + return @as(f32, @floatCast(v)); +} + +pub fn bf16r(v: f64) f64 { + return c.fromBf16(c.toBf16(@floatCast(v))); +} + +/// The allowance of an output stored as `e` whose value before the store is within `err` of `want`. +pub fn allow(e: c.Elem, want: f64, err: f64) f64 { + const unit: f64, const floor: f64 = switch (e) { + .f32 => .{ 0x1p-24, 0x1p-149 }, + .f16 => .{ 0x1p-11, 0x1p-24 }, + .bf16 => .{ 0x1p-8, 0x1p-133 }, + .raw => .{ 0, 0 }, + }; + return err + unit * (@abs(want) + err) + floor; +} + +/// Uploads values as the kernel reads them (each must be exact in that type). +pub fn put(rig: *rig_.Rig, a: std.mem.Allocator, comptime T: type, vals: []const f64) !u64 { + const buf = try a.alloc(T, vals.len); + defer a.free(buf); + for (buf, vals) |*o, v| o.* = switch (T) { + u16 => c.toBf16(@floatCast(v)), + i32, i64 => @intFromFloat(v), + else => @floatCast(v), + }; + return rig.input(std.mem.sliceAsBytes(buf)); +} + +pub fn ints(rig: *rig_.Rig, comptime T: type, vals: []const T) !u64 { + return rig.input(std.mem.sliceAsBytes(vals)); +} + +/// Copies `len` bytes between device buffers on the rig's stream (a kernel's in-place state, set before a run). +pub fn copy(rig: *rig_.Rig, dst: u64, src: u64, len: usize) !void { + const b: cuda.DeviceBuffer = .{ .d = rig.gpu.d, .ptr = dst, .len = len }; + try b.copyFrom(0, src, len, rig.s.handle); +} + +/// Integers in [lo, hi] as f64 (gate 4's terms). +pub fn int(rng: std.Random, lo: i32, hi: i32) f64 { + return @floatFromInt(rng.intRangeAtMost(i32, lo, hi)); +} + +/// Uniform in [lo, hi) rounded to T's values. +pub fn uni(rng: std.Random, comptime T: type, lo: f64, hi: f64) f64 { + const v = lo + (hi - lo) * rng.float(f64); + return switch (T) { + f16 => h16(v), + u16 => bf16r(v), + else => f32r(v), + }; +} + +/// The outputs equal another launch's bytes (a replacement's gates 1 and 3); at gate 1 some must be non-finite. +pub fn sameBytes(msg: []u8, got: []const u8, want: []const u8, what: []const u8, e: c.Elem, at: core.contract.gates.Gate) !?[]const u8 { + if (std.mem.indexOfDiff(u8, got, want)) |i| return try std.fmt.bufPrint(msg, "byte {d} of {d} differs from {s}'s", .{ i, got.len, what }); + if (at != .nonfinite) return null; + for (0..got.len / c.size(e)) |i| if (c.classOf(c.read(e, got, i)) != .finite) return null; + return try std.fmt.bufPrint(msg, "no output is non-finite: the planted values prove nothing", .{}); +} diff --git a/zig/tests/cuda/dots_tests.zig b/zig/tests/cuda/dots_tests.zig new file mode 100644 index 00000000000..e5048d36e19 --- /dev/null +++ b/zig/tests/cuda/dots_tests.zig @@ -0,0 +1,520 @@ +//! dots.mocr on the GB10: the tower's stage taps, its encode twice equal and anchored, image prompts' chunk cuts. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const lanes = @import("lanes"); +const dots = @import("dots_mocr_cuda"); +const dense = @import("cuda_dense"); +const check = @import("check.zig"); +const Gpu = check.Gpu; + +const Tower = dots.tower.Tower; +const native = dots.native; +const Image = dense.recipe.Image; +const Prepared = core.picture.patches.Prepared; +const Args = []const [:0]const u8; +/// The window the engine serves here: the full image's prompt and its reply. +const context = 8192; + +/// The stages one encode taps: the patch with its bias and its norm, every block, the post-norm, the merger. +const taps = 2 + 42 + 2; + +/// dots-image's own page: the processor fixture's pixel pattern at a size of whole 28-pixel blocks, so no file is read. +const synthetic = .{ .width = 812, .height = 588, .seed = 2732 }; +/// The generated page's vision-merged sha256 on the GB10: a tower drift fails dots-image without the Python oracle. +const synthetic_merged_sha256 = "ac8c66b76552c15c22af3bc776d285350c4d9596863de2a3359c9a909b971067"; +/// The SM the pins were measured on (GB10); another device's rows are checked twice-equal, not against them. +const pin_sm = 121; + +/// dots-text's greedy reply ids a prompt of our own (fixtures/own-prompts.json), fewer when EOS ends it first. +const reply_ids = 64; +/// The sha256 of each own prompt's reply ids (u32 little-endian) on the GB10: a decoder drift fails dots-text. +const short_reply_sha256 = "4136394a1b94f5d96ae2fbaab8607c3ad793e174cce0578a93b103cf6e68f480"; +const page_reply_sha256 = "37b4105c553e4b6ce06c2afd7c2a175e15205d2f3afce68b1e3f9d8cf9650bef"; +const chunks_reply_sha256 = "ed7e831a46ad3d4d48c3b9cb52c14bba19b7a270c70a4d623f91320212507b4e"; + +const usage = + \\ dots-stages MODEL IMAGE OUT dots.mocr's tower: one encode, each stage's rows as OUT/.npy for the oracle + \\ dots-image MODEL [IMAGE] dots.mocr's tower: the generated page's vision-merged sha256 against its anchor, then + \\ IMAGE's; each encoded twice byte-equal, with each encode's time + \\ dots-text MODEL dots.mocr text prompts of our own, with and without --vision: <= 64 greedy ids, sha256 vs pins + \\ dots-invariants MODEL IMAGE [N] [IDS] dots.mocr image prompts: chunk cuts == uncut (pages, logits, N greedy ids) + \\ +; + +/// tf-cuda-test dots-*: main.zig's one line for them; dots-help prints their usage. +pub fn run(gpu: Gpu, cmd: []const u8, rest: Args) !void { + if (std.mem.eql(u8, cmd, "dots-help")) return std.debug.print("{s}", .{usage}); + if (!cuda.kernels.available) return skip(cmd, "this runner was built without CUDA kernels"); + if (std.mem.eql(u8, cmd, "dots-stages")) return stages(gpu, rest); + if (std.mem.eql(u8, cmd, "dots-image")) return twice(gpu, rest); + if (std.mem.eql(u8, cmd, "dots-text")) return replies(gpu, rest); + if (std.mem.eql(u8, cmd, "dots-invariants")) return invariants(gpu, rest); + std.debug.print("{s}", .{usage}); + return error.UnknownCommand; +} + +fn skip(cmd: []const u8, why: []const u8) void { + std.debug.print("SKIP {s}: {s}\n", .{ cmd, why }); +} + +fn arg(rest: Args, i: usize) ![]const u8 { + if (i >= rest.len) { + std.debug.print("{s}", .{usage}); + return error.MissingArgument; + } + return rest[i]; +} + +/// Whether `dir` holds a checkpoint's config.json (else the command skips). +fn present(io: std.Io, dir: []const u8) bool { + var buf: [std.fs.max_path_bytes]u8 = undefined; + const path = std.fmt.bufPrint(&buf, "{s}/config.json", .{dir}) catch return false; + std.Io.Dir.cwd().access(io, path, .{}) catch return false; + return true; +} + +fn readFile(gpu: Gpu, path: []const u8) ![]u8 { + return std.Io.Dir.cwd().readFileAlloc(gpu.io, path, gpu.gpa, .limited(64 << 20)); +} + +/// The image file at `path` through the tower's processor, at the largest image's budget. +fn prepareFile(gpu: Gpu, t: *Tower, path: []const u8) !Prepared { + const bytes = try readFile(gpu, path); + defer gpu.gpa.free(bytes); + return t.prepare(gpu.gpa, bytes, Tower.default_image_tokens); +} + +/// The generated page through the tower's processor: (7x + 13y + 50c + xy mod 31 + seed) mod 256, as the fixture's. +fn preparePage(gpu: Gpu, t: *Tower) !Prepared { + const rgb = try gpu.gpa.alloc(u8, synthetic.width * synthetic.height * 3); + defer gpu.gpa.free(rgb); + for (0..synthetic.height) |y| for (0..synthetic.width) |x| for (0..3) |c| { + rgb[(y * synthetic.width + x) * 3 + c] = @intCast((7 * x + 13 * y + 50 * c + (x * y) % 31 + synthetic.seed) % 256); + }; + const pixels: core.picture.Rgb = .{ .width = synthetic.width, .height = synthetic.height, .pixels = rgb }; + return t.processor.prepareRgb(gpu.gpa, pixels, synthetic.seed, Tower.default_image_tokens); +} + +/// The tower alone on its own stream, one prepared image (the generated page without a path) and its output rows. +const Opened = struct { + gpu: Gpu, + s: cuda.Stream, + t: *Tower, + pixels: []f32, + image: Image, + out: cuda.DeviceBuffer, + + fn init(gpu: Gpu, dir: []const u8, path: ?[]const u8) !Opened { + var s = try cuda.Stream.init(gpu.d, true); + errdefer s.deinit(); + const t = try Tower.open(gpu.gpa, gpu.io, gpu.ctx, s, dir, .{ .image_tokens = Tower.default_image_tokens, .max_images = 1 }); + errdefer t.deinit(); + const p = if (path) |file| try prepareFile(gpu, t, file) else try preparePage(gpu, t); + errdefer gpu.gpa.free(p.pixels); + const out = try cuda.DeviceBuffer.alloc(gpu.d, @as(usize, p.tokens) * t.width * 2); + return .{ .gpu = gpu, .s = s, .t = t, .pixels = p.pixels, .image = .{ .pixels = p.pixels, .gh = p.gh, .gw = p.gw, .at = 0, .tokens = p.tokens, .hash = p.hash }, .out = out }; + } + + fn deinit(o: *Opened) void { + o.t.deinit(); // drains the stream first + o.out.free(); + o.gpu.gpa.free(o.pixels); + o.s.deinit(); + } + + /// One encode into `out`, waited for: its milliseconds. + fn encode(o: *Opened, out: u64, tap: ?dense.recipe.Tap) !f64 { + const t0 = std.Io.Clock.awake.now(o.gpu.io); + try o.t.encode(o.s, &o.image, out, tap); + try o.s.synchronize(); + const t1 = std.Io.Clock.awake.now(o.gpu.io); + return @as(f64, @floatFromInt(t0.durationTo(t1).toNanoseconds())) / 1e6; + } + + fn rows(o: *const Opened, out: u64) ![]u8 { + const host = try o.gpu.gpa.alloc(u8, @as(usize, o.image.tokens) * o.t.width * 2); + errdefer o.gpu.gpa.free(host); + try cuda.memory.download(o.gpu.d, out, host); + return host; + } +}; + +/// A tap that writes each stage's rows as `/.npy`: 1) _ = try mergedHash(gpu, dir, rest[1]); + if (try otherSm(gpu)) |sm| return skipPin("dots-image", sm); + try check.expect(std.mem.eql(u8, &generated, synthetic_merged_sha256), "dots-image: the generated page's vision-merged sha256 {s}, its anchor {s}", .{ &generated, synthetic_merged_sha256 }); + check.pass("dots-image: the generated page's vision-merged sha256 equals its anchor", .{}); +} + +/// The device's SM when it is not the pins' (sm_121), else null. +fn otherSm(gpu: Gpu) !?u32 { + const sm: u32 = @intCast(try gpu.ctx.capability()); + return if (sm == pin_sm) null else sm; +} + +/// The pins are GB10 values: on a device of another SM, `cmd` names it and compares none. +fn skipPin(cmd: []const u8, sm: u32) void { + std.debug.print("SKIP {s}'s pins: they are GB10 (sm_{d}) values; this device is sm_{d}\n", .{ cmd, pin_sm, sm }); +} + +/// One image (the generated page without `path`) encoded twice, byte-equal: its vision-merged rows' sha256 in hex. +fn mergedHash(gpu: Gpu, dir: []const u8, path: ?[]const u8) ![64]u8 { + var o = try Opened.init(gpu, dir, path); + defer o.deinit(); + var second = try cuda.DeviceBuffer.alloc(gpu.d, o.out.len); + defer second.free(); + errdefer cuda.completion.drain(gpu.d, o.s, "dots-image: a failed encode's work did not drain before its rows were freed"); + const ms = [2]f64{ try o.encode(o.out.ptr, null), try o.encode(second.ptr, null) }; + const a = try o.rows(o.out.ptr); + defer gpu.gpa.free(a); + const b = try o.rows(second.ptr); + defer gpu.gpa.free(b); + try check.sameBytes("dots-image: the second encode's vision-merged", b, a); + var digest: [32]u8 = undefined; + std.crypto.hash.sha2.Sha256.hash(a, &digest, .{}); + const hex = std.fmt.bytesToHex(digest, .lower); + const what = path orelse "the generated page"; + std.debug.print("RESULT dots-image {s}: encode twice equal, {d} x {d} patches to {d} rows; vision-merged sha256 {s}; encode {d:.1} ms, {d:.1} ms\n", .{ what, o.image.gh, o.image.gw, o.image.tokens, &hex, ms[0], ms[1] }); + return hex; +} + +/// One run's results: its KV rows' hash, last-row logits, greedy ids, images encoded and where its chunks ended. +const Out = struct { kv: [32]u8, logits: []u8, ids: []u32, encodes: u64, ends: []u32 }; + +/// The engine with --vision on one slot, its lane host and its tower. +const Served = struct { + gpu: Gpu, + loaded: native.Loaded, + cfg: lanes.Config, + clock: lanes.fake.FixedClock = .{}, + engine: lanes.Engine, + eos: []const u32, + + /// Served with --vision (two images a request at the default budget), or text alone without it. + fn init(s: *Served, gpu: Gpu, dir: []const u8, pages: usize, eos: []const u32, vision: bool) !void { + s.gpu = gpu; + s.eos = eos; + const limits: ?Tower.Limits = if (vision) .{ .image_tokens = Tower.default_image_tokens, .max_images = 2 } else null; + s.loaded = try native.open(gpu.gpa, gpu.io, gpu.ctx, dir, null, .{ .context = context, .drafts = false, .lanes = 1, .vision = limits }); + errdefer s.loaded.deinit(s.loaded.ctx); + try native.attach(s.loaded.ctx, 0, pages); + s.cfg = try lanes.Config.init(gpu.gpa, s.loaded.facts, s.loaded.rows, s.loaded.rows - 1); + s.clock = .{}; + s.engine = lanes.Engine.init(gpu.gpa, &s.cfg, s.loaded.backend, s.clock.clock()); + } + + fn deinit(s: *Served) void { + s.engine.deinit(); + s.cfg.deinit(s.gpu.gpa); + s.loaded.deinit(s.loaded.ctx); + } + + fn tower(s: *const Served) *Tower { + return s.loaded.vision.?; + } + + /// The images the tower has encoded, none without --vision. + fn encodes(s: *const Served) u64 { + return if (s.loaded.vision) |t| t.encodes else 0; + } + + /// One stream cut at `cuts` beside the 1,024-row grid: its pages and logits after the prompt, then its reply. + fn once(s: *Served, prompt: []const u32, images: []const Image, cuts: []const u32, n: u32) !Out { + const gpa = s.gpu.gpa; + const before = s.encodes(); + var st = try lanes.Stream.init(gpa, .{ .id = "dots", .prompt = prompt, .max_new = n, .eos = s.eos, .drafts = false, .images = images, .reuse = .{ .marks = cuts } }); + defer st.deinit(gpa); + // the backend's prompt steps alone, so the lane is read before the first token can end the stream + var ends: std.ArrayList(u32) = .empty; + errdefer ends.deinit(gpa); + const b = s.loaded.backend; + while (true) { + const done = try b.vtable.prefill_step.?(b.ptr, &st, 0); + try ends.append(gpa, @intCast(st.fill_at.load(.monotonic))); + if (done) break; + } + const gb = s.loaded.target; + try gb.e.s.synchronize(); + const l = gb.lanes.get(&st) orelse return error.UnknownStream; + const logits = try gpa.alloc(u8, gb.m.g.vocab * 2); + errdefer gpa.free(logits); + try cuda.memory.download(s.gpu.d, l.last, logits); + const kv = try pagesHash(s.gpu, gb.m, l.lease.ids.items, prompt.len); + try s.engine.opened(&st); + while (s.engine.activeCount() > 0) try s.engine.step(); + const ids = try gpa.dupe(u32, st.emitted()); + errdefer gpa.free(ids); + return .{ .kv = kv, .logits = logits, .ids = ids, .encodes = s.encodes() - before, .ends = try ends.toOwnedSlice(gpa) }; + } +}; + +/// The sha256 of every layer's keys and values at positions [0, len), page by page in position order. +fn pagesHash(gpu: Gpu, m: anytype, ids: []const u32, len: usize) ![32]u8 { + const rows_a_page = dense.pages.page_rows; + const kvw = m.g.kvWidth(); + const page = try gpu.gpa.alloc(u8, m.pageBytes()); + defer gpu.gpa.free(page); + var h: std.crypto.hash.sha2.Sha256 = .init(.{}); + for (ids, 0..) |id, p| { + if (p * rows_a_page >= len) break; + const rows = @min(rows_a_page, len - p * rows_a_page); + try cuda.memory.download(gpu.d, m.arena + id * m.pageBytes(), page); + for (0..2 * m.g.layers) |part| h.update(page[part * rows_a_page * kvw * 2 ..][0 .. rows * kvw * 2]); + } + return h.finalResult(); +} + +/// A prompt of the template's markers: the user mark, each image's open, pads and close, then the ask. +const Prompt = struct { + ids: std.ArrayList(u32) = .empty, + images: std.ArrayList(Image) = .empty, + + fn deinit(p: *Prompt, gpa: std.mem.Allocator) void { + p.ids.deinit(gpa); + p.images.deinit(gpa); + } + + fn text(p: *Prompt, gpa: std.mem.Allocator, ids: []const u32) !void { + try p.ids.appendSlice(gpa, ids); + } + + fn image(p: *Prompt, gpa: std.mem.Allocator, prepared: Image) !void { + const m = dots.tower.marks; + try p.ids.append(gpa, m.open); + var im = prepared; + im.at = @intCast(p.ids.items.len); + try p.ids.appendNTimes(gpa, m.image, im.tokens); + try p.ids.append(gpa, m.close); + try p.images.append(gpa, im); + } +}; + +fn free(gpa: std.mem.Allocator, o: Out) void { + gpa.free(o.logits); + gpa.free(o.ids); + gpa.free(o.ends); +} + +/// Whether every cut ended a chunk of the cut run and none of the uncut run's: the schedule really changed. +fn taken(cuts: []const u32, got: []const u32, base: []const u32) bool { + for (cuts) |c| if (std.mem.indexOfScalar(u32, got, c) == null or std.mem.indexOfScalar(u32, base, c) != null) return false; + return true; +} + +/// `x`, moved one row on when the 1,024-row grid already ends a chunk there. +fn offGrid(x: u32) u32 { + return if (x % dense.backend.prompt_rows == 0) x + 1 else x; +} + +/// Each cut run against the case's uncut (normal-grid) run: pages, last-row logits, replies and one encode an image. +fn compare(s: *Served, name: []const u8, p: *const Prompt, cuts: []const []const u32, n: u32) !usize { + const gpa = s.gpu.gpa; + const base = try s.once(p.ids.items, p.images.items, &.{}, n); + defer free(gpa, base); + var bad: usize = 0; + const images = p.images.items.len; + if (base.encodes != images) bad += 1; + std.debug.print("RESULT dots {s}: {d} rows, {d} images, normal grid: {d} ids, {d} encodes\n", .{ name, p.ids.items.len, images, base.ids.len, base.encodes }); + for (cuts) |c| { + const o = try s.once(p.ids.items, p.images.items, c, n); + defer free(gpa, o); + const same = [_]bool{ taken(c, o.ends, base.ends), std.mem.eql(u8, &o.kv, &base.kv), std.mem.eql(u8, o.logits, base.logits), std.mem.eql(u32, o.ids, base.ids), o.encodes == images }; + for (same) |ok| bad += @intFromBool(!ok); + std.debug.print("RESULT dots {s}, cuts {any}: chunk ends {any} ({s}), pages {s}, last logits {s}, ids {s}, encodes {d}\n", .{ name, c, o.ends, if (same[0]) "taken" else "NOT TAKEN", word(same[1]), word(same[2]), word(same[3]), o.encodes }); + } + return bad; +} + +fn word(same: bool) []const u8 { + return if (same) "same" else "DIFFER"; +} + +/// The prompt in `path` (the oracle's input-input_ids.npy, int64 [1, L]) with the demo image at its one pad run. +fn refPrompt(gpu: Gpu, path: []const u8, demo: Image) !Prompt { + const bytes = try readFile(gpu, path); + defer gpu.gpa.free(bytes); + const arr = try core.npy.parse(bytes); + if (!std.mem.eql(u8, arr.descr, " 2) try std.fmt.parseInt(u32, rest[2], 10) else 64; + const c = try dots.config.Config.read(gpa, gpu.io, dir); + var tok = try core.tokenizer.loadTokenizer(gpu.io, gpa, dir); + defer tok.deinit(); + const user = try tok.encode(gpa, "<|user|>"); + defer gpa.free(user); + const ask = try tok.encode(gpa, "Extract the text of this image.<|endofuser|><|assistant|>"); + defer gpa.free(ask); + const between = try tok.encode(gpa, " and "); + defer gpa.free(between); + var s: Served = undefined; + try s.init(gpu, dir, dense.pages.perSlot(context), c.end_tokens[0..c.end_count], true); + defer s.deinit(); + const bytes = try readFile(gpu, try arg(rest, 1)); + defer gpa.free(bytes); + // three budgets: inside one 1,024-row chunk, across the grid line at 1,024, and the full (the demo's) + var prepared: [3]Image = undefined; + var made: usize = 0; + defer for (prepared[0..made]) |im| gpa.free(im.pixels); + for (&prepared, [_]u32{ 64, 1200, Tower.default_image_tokens }) |*im, budget| { + const p = try s.tower().prepare(gpa, bytes, budget); + im.* = .{ .pixels = p.pixels, .gh = p.gh, .gw = p.gw, .at = 0, .tokens = p.tokens, .hash = p.hash }; + made += 1; + } + var bad: usize = 0; + { // a small image uncut, then cut at its first row, inside it, at its last row, and at all three + var p: Prompt = .{}; + defer p.deinit(gpa); + try p.text(gpa, user); + try p.image(gpa, prepared[0]); + try p.text(gpa, ask); + const im = p.images.items[0]; + const first = im.at; + const mid = im.at + im.tokens / 2; + const last = im.at + im.tokens - 1; + try check.expect(p.ids.items.len <= dense.backend.prompt_rows, "dots-invariants: the small prompt of {d} rows fits one chunk", .{p.ids.items.len}); + bad += try compare(&s, "small image", &p, &.{ &.{first}, &.{mid}, &.{last}, &.{ first, mid, last } }, n); + } + { // the full image (the oracle's prompt when given) on the 1,024-row grid, then cut inside the image off the grid + var p: Prompt = if (rest.len > 3) try refPrompt(gpu, rest[3], prepared[2]) else .{}; + defer p.deinit(gpa); + if (rest.len <= 3) { + try p.text(gpa, user); + try p.image(gpa, prepared[2]); + try p.text(gpa, ask); + } + const im = p.images.items[0]; + bad += try compare(&s, "full image", &p, &.{&.{ offGrid(im.at + 333), offGrid(im.at + im.tokens - 7) }}, n); + } + { // two images in one prompt, the grid cutting the first, then cut inside each off the grid + var p: Prompt = .{}; + defer p.deinit(gpa); + try p.text(gpa, user); + try p.image(gpa, prepared[1]); + try p.text(gpa, between); + try p.image(gpa, prepared[0]); + try p.text(gpa, ask); + const a = p.images.items[0]; + const b = p.images.items[1]; + try check.expect(a.at < dense.backend.prompt_rows and a.at + a.tokens > dense.backend.prompt_rows, "dots-invariants: the grid line at {d} cuts the first image [{d}, {d})", .{ dense.backend.prompt_rows, a.at, a.at + a.tokens }); + bad += try compare(&s, "two images", &p, &.{&.{ offGrid(a.at + a.tokens / 3), offGrid(b.at + b.tokens / 2) }}, n); + } + try check.expect(bad == 0, "dots-invariants: {d} differences", .{bad}); + check.pass("dots-invariants: chunk cuts inside, at the first and the last image rows equal the uncut runs (pages, logits, {d} greedy ids), each image encoded once", .{n}); +} + +/// dots-text MODEL_DIR: each own prompt's greedy reply ids, served with and without --vision, against its pin. +fn replies(gpu: Gpu, rest: Args) !void { + const dir = try arg(rest, 0); + if (!present(gpu.io, dir)) return skip("dots-text", "no checkpoint config.json in MODEL_DIR"); + const gpa = gpu.gpa; + const c = try dots.config.Config.read(gpa, gpu.io, dir); + const own = try dots.ownPrompts(gpa); + defer own.deinit(); + const cases = [_]struct { []const u8, []const u32, []const u8 }{ + .{ "short", own.value.short, short_reply_sha256 }, + .{ "page", own.value.page, page_reply_sha256 }, + .{ "chunks", own.value.chunks, chunks_reply_sha256 }, + }; + const other = try otherSm(gpu); + var bad: usize = 0; + for ([_]bool{ true, false }) |vision| { + var s: Served = undefined; + try s.init(gpu, dir, dense.pages.perSlot(context), c.end_tokens[0..c.end_count], vision); + defer s.deinit(); + const served = if (vision) "--vision" else "text only"; + for (cases) |k| { + const o = try s.once(k[1], &.{}, &.{}, reply_ids); + defer free(gpa, o); + var h: std.crypto.hash.sha2.Sha256 = .init(.{}); + for (o.ids) |id| { + var le: [4]u8 = undefined; + std.mem.writeInt(u32, &le, id, .little); + h.update(&le); + } + const hex = std.fmt.bytesToHex(h.finalResult(), .lower); + const same = std.mem.eql(u8, &hex, k[2]); + bad += @intFromBool(!same); + std.debug.print("RESULT dots-text {s}, {s}: {d} prompt ids, {d} reply ids, sha256 {s}, pinned {s} ({s})\n", .{ k[0], served, k[1].len, o.ids.len, &hex, k[2], word(same) }); + } + } + if (other) |sm| return skipPin("dots-text", sm); + try check.expect(bad == 0, "dots-text: {d} of {d} replies differ from their pins", .{ bad, 2 * cases.len }); + check.pass("dots-text: {d} own prompts' greedy replies (at most {d} ids), with and without --vision, equal their pins", .{ cases.len, reply_ids }); +} diff --git a/zig/tests/cuda/glm_pdl_order.zig b/zig/tests/cuda/glm_pdl_order.zig new file mode 100644 index 00000000000..a8e76b98bae --- /dev/null +++ b/zig/tests/cuda/glm_pdl_order.zig @@ -0,0 +1,457 @@ +//! tf-cuda-test glm-pdl-order [MAIN_FATBINS]: GLM kernels launched dependent behind a slow writer read its output. +const std = @import("std"); +const cuda = @import("cuda"); +const check = @import("check.zig"); +const glm = @import("glm_cuda"); +const q = cuda.qmmf; + +const spins: i64 = 20_000_000; // about 8 ms at GB10's clock: a dependent grid starts long before the writer ends +const poison: u8 = 0xff; +const tries = 8; + +const Mode = enum { plain, dependent }; +const Bytes = []align(16) u8; + +const Ctx = struct { + gpu: check.Gpu, + s: cuda.Stream, + probe: cuda.Module, + main_dir: ?[]const u8, + mains: std.StringHashMap(cuda.Module), + + /// Main's build of `image` (MAIN_FATBINS/.fatbin), loaded once. + fn main(c: *Ctx, image: []const u8) !cuda.Module { + if (c.mains.get(image)) |m| return m; + const a = c.gpu.gpa; + const path = try std.fmt.allocPrint(a, "{s}/{s}.fatbin", .{ c.main_dir.?, image }); + defer a.free(path); + const bytes = try std.Io.Dir.cwd().readFileAlloc(c.gpu.io, path, a, .limited(512 << 20)); + defer a.free(bytes); + const al = try a.alignedAlloc(u8, .@"8", bytes.len); // cuModuleLoadData wants an aligned image + defer a.free(al); + @memcpy(al, bytes); + const m = try cuda.Module.load(c.gpu.d, al); + try c.mains.put(image, m); + return m; + } +}; + +/// A kernel's input (`in`, poisoned, then filled from `src` by the slow writer) and output bytes. +const Bufs = struct { + src: cuda.DeviceBuffer, + in: cuda.DeviceBuffer, + out: cuda.DeviceBuffer, + + fn init(c: *const Ctx, input: Bytes, out_bytes: usize) !Bufs { + std.debug.assert(input.len % 16 == 0); + var src = try cuda.DeviceBuffer.fromHost(c.gpu.d, input); + errdefer src.free(); + var in = try cuda.DeviceBuffer.alloc(c.gpu.d, input.len); + errdefer in.free(); + return .{ .src = src, .in = in, .out = try cuda.DeviceBuffer.alloc(c.gpu.d, out_bytes) }; + } + + fn deinit(b: *Bufs) void { + b.out.free(); + b.in.free(); + b.src.free(); + } +}; + +/// Launches the kernel under test from `m` (the head's image or main's), plainly or as the production launcher does. +const Launch = *const fn (c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void; + +fn slowCopy(c: *const Ctx, b: *const Bufs) !void { + var a: cuda.Args = .{}; + a.add(b.src.ptr); + a.add(b.in.ptr); + a.add(@as(i64, @intCast(b.in.len / 16))); + a.add(spins); + try cuda.launch.launch(try c.probe.function("tf_probe_pdl_slow_copy"), .{ .grid = .{ .x = 4 }, .block = .{ .x = 256 } }, c.s, &a); +} + +fn slowCopyOn(c: *const Ctx, s: cuda.Stream, src: u64, dst: u64, bytes: usize) !void { + var a: cuda.Args = .{}; + a.add(src); + a.add(dst); + a.add(@as(i64, @intCast(bytes / 16))); + a.add(spins); + try cuda.launch.launch(try c.probe.function("tf_probe_pdl_slow_copy"), .{ .grid = .{ .x = 4 }, .block = .{ .x = 256 } }, s, &a); +} + +/// The output after the slow writer then the kernel, from fresh poisoned input and zeroed output. +fn after(c: *Ctx, b: *const Bufs, launch: Launch, mode: Mode, m: cuda.Module, sync_first: bool) ![]u8 { + try b.in.fill8(poison, c.s.handle); // on the test stream: a null-stream fill is not ordered with a non-blocking one + try b.out.fill8(0, c.s.handle); + try c.s.synchronize(); + try slowCopy(c, b); + if (sync_first) try c.s.synchronize(); + try launch(c, b, mode, m); + try c.s.synchronize(); + return check.download(c.gpu, b.out); +} + +/// One kernel: dependent after the writer equals plain after it, and (with MAIN_FATBINS) main's bytes. +fn case(c: *Ctx, name: []const u8, image: []const u8, head: cuda.Module, b: *const Bufs, launch: Launch) !void { + const a = c.gpu.gpa; + const want = try after(c, b, launch, .plain, head, true); + defer a.free(want); + const got = try after(c, b, launch, .dependent, head, false); + defer a.free(got); + try check.sameBytes(name, got, want); + const vs_main = c.main_dir != null and !std.mem.eql(u8, image, "probe"); // main's probe image has no such kernel + if (vs_main) { + const was = try after(c, b, launch, .plain, try c.main(image), true); + defer a.free(was); + try check.sameBytes(name, want, was); + } + check.pass("{s}: dependent after a slow writer = plain{s}", .{ name, if (vs_main) " = main" else "" }); +} + +fn go(f: cuda.Function, cfg: cuda.launch.Config, mode: Mode, c: *const Ctx, a: *cuda.Args) !void { + if (mode == .dependent) return glm.pdl.launch(f, cfg, c.s, a); + return cuda.launch.launch(f, cfg, c.s, a); +} + +fn visToBf16(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + const n: i64 = @intCast(b.in.len / 4); + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(b.out.ptr); + a.add(n); + try go(try m.function("glm_vis_to_bf16"), .{ .grid = .{ .x = @intCast(@divExact(n, 256)) }, .block = .{ .x = 256 } }, mode, c, &a); +} + +const copy_rows = 4096; // 8,192 CTAs of 256: many waves behind the writer +const copy_row_bytes = 512; +fn copyRows(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(@as(i64, copy_row_bytes)); + a.add(b.out.ptr); + a.add(@as(i64, 2 * copy_row_bytes)); + a.add(@as(c_int, copy_rows)); + a.add(@as(c_int, copy_row_bytes)); + try go(try m.function("tf_glm_copy_rows"), .{ .grid = .{ .x = copy_rows * copy_row_bytes / 256 }, .block = .{ .x = 256 } }, mode, c, &a); +} + +const norm_rows = 4; +const norm_out = norm_rows * 4096 * 2; // the normed rows, then each row's 64 group sums (fp32) in the same buffer +var norm_w: u64 = 0; +fn rmsnorm(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(@as(i64, 4096)); + a.add(norm_w); + a.add(b.out.ptr); + a.add(@as(i64, 4096)); + a.add(b.out.ptr + norm_out); + a.add(@as(f32, 1e-6)); + a.add(@as(c_int, 1)); + try go(try m.function("tf_glm_rmsnorm_4096_f32w"), .{ .grid = .{ .x = norm_rows }, .block = .{ .x = 256 } }, mode, c, &a); +} + +const amax_e = 8; +fn amax(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(@as(i64, @intCast(b.in.len / 2 / amax_e))); + a.add(b.out.ptr); + try go(try m.function("tf_glm_nvfp4_amax"), .{ .grid = .{ .x = amax_e }, .block = .{ .x = 1024 } }, mode, c, &a); +} + +const swiglu_rows = 4; +const swiglu_f = 2048; +fn swiglu(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(b.out.ptr); + a.add(@as(c_int, swiglu_f)); + try go(try m.function("df_swiglu"), .{ .grid = .{ .x = swiglu_rows, .y = (swiglu_f + 1023) / 1024 }, .block = .{ .x = 256 } }, mode, c, &a); +} + +const reduce_total = 8192; +const reduce_sk = 4; +fn mmReduce(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var a: cuda.Args = .{}; + a.add(b.in.ptr); + a.add(b.out.ptr); + a.add(@as(i64, reduce_total)); + a.add(@as(c_int, reduce_sk)); + a.add(@as(c_int, 0)); + try go(try m.function("glm_mm_reduce"), .{ .grid = .{ .x = reduce_total / 256 }, .block = .{ .x = 256 } }, mode, c, &a); +} + +/// The qmmf decode rows: a lane whose functions come from `m` (the head's or main's qmmf image), `pdl` when dependent. +const Qmmf = struct { + var lane: q.Lane = undefined; + var w: q.Weight = undefined; + var part: u64 = 0; + var clusters = false; + + fn run(c: *Ctx, b: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var l = lane; + if (m.handle != lane.mod.handle) try remap(c, &l, m); + l.clusters = clusters; + l.pdl = mode == .dependent; + try l.matmulOut(c.s, b.in.ptr, w.k, 1, w, b.out.ptr, .bf16, part); + } + + /// The same lane over main's image: each function by its symbol. + fn remap(c: *const Ctx, l: *q.Lane, m: cuda.Module) !void { + const d = c.gpu.d; + for (&l.fns) |*set| for (set) |*f| { + f.* = try m.function(named(d, f.*)); + }; + for (&l.f32_fns) |*set| for (set) |*f| { + f.* = try m.function(named(d, f.*)); + }; + for (&l.reduce) |*f| f.* = try m.function(named(d, f.*)); + for (&l.half) |*a| for (a) |*o| for (o) |*f| { + f.* = try m.function(named(d, f.*)); + }; + } +}; + +fn bytesOf(comptime T: type, a: std.mem.Allocator, n: usize, seed: u64, gen: *const fn (std.Random) T) !Bytes { + const bytes = try a.alignedAlloc(u8, .@"16", n * @sizeOf(T)); + var prng = std.Random.DefaultPrng.init(seed); + for (std.mem.bytesAsSlice(T, bytes)) |*x| x.* = gen(prng.random()); + return bytes; +} + +/// A driver-given kernel name as the C string it is. +fn named(d: *const cuda.Driver, f: cuda.Function) [:0]const u8 { + const n = d.functionName(f.handle); + return n.ptr[0..n.len :0]; +} + +fn bf16(r: std.Random) u16 { + return (r.int(u16) & 0x807f) | (@as(u16, 118 + r.uintLessThan(u16, 16)) << 7); // finite, |x| from 2^-9 to 2^7 +} +fn f32v(r: std.Random) f32 { + return (r.float(f32) - 0.5) * 8; +} +fn word(r: std.Random) u32 { + return r.int(u32) & 0x7fffffff; +} +fn small(r: std.Random) f32 { + return (r.float(f32) - 0.5) / 4; +} + +/// The planted control: reading before the wait sees the poison at least once in `tries`, and then reads wrong. +fn control(c: *Ctx) !void { + const a = c.gpu.gpa; + const n = 1024; + const input = try bytesOf(u32, a, n, 7, word); + defer a.free(input); + var b = try Bufs.init(c, input, n * 4); + defer b.deinit(); + var seen = try cuda.DeviceBuffer.alloc(c.gpu.d, 16); + defer seen.free(); + const words = std.mem.bytesAsSlice(u32, input); + for (0..tries) |t| { + try b.in.fill8(poison, c.s.handle); + try b.out.fill8(0, c.s.handle); + try seen.fill8(0, c.s.handle); + try c.s.synchronize(); + try slowCopy(c, &b); + var args: cuda.Args = .{}; + args.add(b.in.ptr); + args.add(b.out.ptr); + args.add(seen.ptr); + args.add(@as(c_int, n)); + try cuda.launch.launch(try c.probe.function("tf_probe_pdl_early_read"), .{ .grid = .{ .x = n / 256 }, .block = .{ .x = 256 }, .pdl = true }, c.s, &args); + try c.s.synchronize(); + const s = try check.download(c.gpu, seen); + defer a.free(s); + if (std.mem.readInt(u32, s[0..4], .little) != 0xffffffff) continue; + const out = try check.download(c.gpu, b.out); + defer a.free(out); + try check.expect(std.mem.readInt(u32, out[0..4], .little) != words[0] *% 2 +% 1, "control: read the poison yet wrote the right value", .{}); + check.pass("control: a read before the wait saw the poison (try {d}) and wrote the wrong value, as planted", .{t + 1}); + return; + } + try check.expect(false, "control: overlap not exercised in {d} tries: the dependent grid never started before the writer ended", .{tries}); +} + +/// A chain through a plain launch, a device copy and an event wait ends where all-plain does. +fn chain(c: *Ctx) !void { + const a = c.gpu.gpa; + const n = 4096; + const input = try bytesOf(u32, a, n, 11, word); + defer a.free(input); + var b = try Bufs.init(c, input, n * 4); + defer b.deinit(); + var mid: [4]cuda.DeviceBuffer = undefined; + for (&mid) |*m| m.* = try cuda.DeviceBuffer.alloc(c.gpu.d, n * 4); + defer for (&mid) |*m| m.free(); + var other = try cuda.Stream.init(c.gpu.d, true); + defer other.deinit(); + var ready = try cuda.Event.init(c.gpu.d, false); + defer ready.deinit(); + var done = try cuda.Event.init(c.gpu.d, false); + defer done.deinit(); + const f = try c.probe.function("tf_probe_pdl_enter_read"); + const step = struct { + fn go_(s: cuda.Stream, fx: cuda.Function, src: u64, dst: u64, pdl: bool) !void { + var args: cuda.Args = .{}; + args.add(src); + args.add(dst); + args.add(@as(c_int, n)); + try cuda.launch.launch(fx, .{ .grid = .{ .x = n / 256 }, .block = .{ .x = 256 }, .pdl = pdl }, s, &args); + } + }.go_; + try b.in.fill8(poison, c.s.handle); + try c.s.synchronize(); + try slowCopy(c, &b); + try step(c.s, f, b.in.ptr, mid[0].ptr, true); + try step(c.s, f, mid[0].ptr, mid[1].ptr, false); + try ready.record(c.s); + try other.wait(ready); // a producer on another stream, after a spin of its own: the consumer must wait for it + try slowCopyOn(c, other, mid[1].ptr, mid[3].ptr, n * 4); + try step(other, f, mid[3].ptr, mid[2].ptr, false); + try done.record(other); + try c.s.wait(done); + try mid[3].uploadAsync(0, input, c.s.handle); // a host copy between the event wait and the dependent launch + try step(c.s, f, mid[2].ptr, b.out.ptr, true); + try c.s.synchronize(); + const out = try check.download(c.gpu, b.out); + defer a.free(out); + const words = std.mem.bytesAsSlice(u32, input); + for (words, std.mem.bytesAsSlice(u32, out), 0..) |x, y, i| { + const want = (((x *% 2 +% 1) *% 2 +% 1) *% 2 +% 1) *% 2 +% 1; + try check.expect(y == want, "chain: word {d} is {x}, want {x}", .{ i, y, want }); + } + check.pass("chain: dependent, plain, another stream's slow producer behind events, a host copy, dependent = the all-plain result", .{}); + // a dependent launch right after a host upload reads the uploaded bytes, not the poison under them + try mid[0].fill8(poison, c.s.handle); + try mid[1].fill8(0, c.s.handle); + try c.s.synchronize(); + try mid[0].uploadAsync(0, input, c.s.handle); + try step(c.s, f, mid[0].ptr, mid[1].ptr, true); + try c.s.synchronize(); + const up = try check.download(c.gpu, mid[1]); + defer a.free(up); + for (words, std.mem.bytesAsSlice(u32, up), 0..) |x, y, i| { + try check.expect(y == x *% 2 +% 1, "host upload: word {d} is {x}, want {x}", .{ i, y, x *% 2 +% 1 }); + } + check.pass("host upload then a dependent launch: the kernel read the uploaded bytes", .{}); +} + +pub fn run(gpu: check.Gpu, main_dir: ?[]const u8) !void { + const cap = try gpu.ctx.capability(); + if (cap < 90) { + check.pass("glm-pdl-order: sm_{d} has no dependent launches; skipped", .{cap}); + return; + } + try check.expect(glm.pdl.on(), "glm-pdl-order: TF_GLM_PDL=0 launches GLM's kernels plain; unset it to test dependent launches", .{}); + const a = gpu.gpa; + var c: Ctx = .{ .gpu = gpu, .s = try cuda.Stream.init(gpu.d, true), .probe = try cuda.Module.load(gpu.d, cuda.kernels.probe), .main_dir = main_dir, .mains = .init(a) }; + defer c.mains.deinit(); + defer c.s.deinit(); + defer c.probe.unload(); + try control(&c); + try chain(&c); + { + const input = try bytesOf(u32, a, 4096, 3, word); + defer a.free(input); + var b = try Bufs.init(&c, input, 4096 * 4); + defer b.deinit(); + try case(&c, "probe tf_probe_pdl_enter_read", "probe", c.probe, &b, struct { + fn r(cx: *Ctx, bx: *const Bufs, mode: Mode, m: cuda.Module) anyerror!void { + var args: cuda.Args = .{}; + args.add(bx.in.ptr); + args.add(bx.out.ptr); + args.add(@as(c_int, 4096)); + try cuda.launch.launch(try m.function("tf_probe_pdl_enter_read"), .{ .grid = .{ .x = 16 }, .block = .{ .x = 256 }, .pdl = mode == .dependent }, cx.s, &args); + } + }.r); + } + const images = [_][]const u8{ "glm_vision", "glm_ops", "glm_glue", "glm_quant", "glm_dflash", "glm_mm" }; + var mods: [images.len]cuda.Module = undefined; + inline for (images, 0..) |name, i| mods[i] = try cuda.Module.load(gpu.d, @field(cuda.kernels, name)); + defer for (&mods) |*m| m.unload(); + const host_w = try bytesOf(f32, a, 4096, 5, small); + defer a.free(host_w); + var w = try cuda.DeviceBuffer.fromHost(gpu.d, host_w); + defer w.free(); + norm_w = w.ptr; + const Case = struct { name: []const u8, image: usize, input: Bytes, out: usize, run: Launch }; + const cases = [_]Case{ + .{ .name = "glm_vision glm_vis_to_bf16", .image = 0, .input = try bytesOf(f32, a, 1 << 16, 21, f32v), .out = (1 << 16) * 2, .run = visToBf16 }, + .{ .name = "glm_ops tf_glm_copy_rows (multi-wave)", .image = 1, .input = try bytesOf(u32, a, copy_rows * copy_row_bytes / 4, 22, word), .out = copy_rows * copy_row_bytes * 2, .run = copyRows }, + .{ .name = "glm_glue tf_glm_rmsnorm_4096_f32w", .image = 2, .input = try bytesOf(u16, a, norm_rows * 4096, 23, bf16), .out = norm_out + norm_rows * 64 * 4, .run = rmsnorm }, + .{ .name = "glm_quant tf_glm_nvfp4_amax (a weight writer)", .image = 3, .input = try bytesOf(u16, a, amax_e * 8192, 24, bf16), .out = amax_e * 4, .run = amax }, + .{ .name = "glm_dflash df_swiglu", .image = 4, .input = try bytesOf(u16, a, swiglu_rows * 2 * swiglu_f, 25, bf16), .out = swiglu_rows * swiglu_f * 2, .run = swiglu }, + .{ .name = "glm_mm glm_mm_reduce", .image = 5, .input = try bytesOf(f32, a, reduce_sk * reduce_total, 26, f32v), .out = reduce_total * 2, .run = mmReduce }, + }; + defer for (cases) |k| a.free(k.input); + for (cases) |k| { + var b = try Bufs.init(&c, k.input, k.out); + defer b.deinit(); + try case(&c, k.name, images[k.image], mods[k.image], &b, k.run); + } + try qmmf(&c); + var it = c.mains.valueIterator(); + while (it.next()) |m| m.unload(); +} + +/// The weight-first qmmf decode rows behind the writer (BF16, FP4, MXFP8): K slices and their reduce, a cluster. +fn qmmf(c: *Ctx) !void { + const a = c.gpu.gpa; + Qmmf.lane = try q.Lane.load(c.gpu.d, (try c.gpu.ctx.capability()) / 10); + defer Qmmf.lane.unload(); + var part = try cuda.DeviceBuffer.alloc(c.gpu.d, 8 << 20); + defer part.free(); + Qmmf.part = part.ptr; + for ([_]struct { mode: q.Mode, n: usize, k: usize, sk: u32, clusters: bool, what: []const u8 }{ + .{ .mode = .bf16, .n = 2560, .k = 6144, .sk = 4, .clusters = false, .what = "qmmf BF16 decode row, 4 K slices and their reduce" }, + .{ .mode = .bf16, .n = 2560, .k = 6144, .sk = 4, .clusters = true, .what = "qmmf BF16 decode row, a cluster of 4 slices" }, + .{ .mode = .bf16, .n = 2560, .k = 64, .sk = 1, .clusters = false, .what = "qmmf BF16 decode row, one K group (fewer than the prologue's stages)" }, + .{ .mode = .fp4, .n = 2560, .k = 6144, .sk = 4, .clusters = false, .what = "qmmf FP4 decode row, 4 K slices and their reduce" }, + .{ .mode = .fp4, .n = 2560, .k = 6144, .sk = 4, .clusters = true, .what = "qmmf FP4 decode row, a cluster of 4 slices" }, + .{ .mode = .mxfp8, .n = 2560, .k = 6144, .sk = 4, .clusters = false, .what = "qmmf MXFP8 decode row, 4 K slices and their reduce" }, + .{ .mode = .mxfp8, .n = 2560, .k = 6144, .sk = 4, .clusters = true, .what = "qmmf MXFP8 decode row, a cluster of 4 slices" }, + }) |t| { + const npad = (t.n + 127) / 128 * 128; + var prng = std.Random.DefaultPrng.init(0x4218 + t.k + @backingInt(t.mode)); + const codes_host = try packed_(a, t.mode, t.n, t.k, npad, prng.random()); + defer a.free(codes_host); + var codes = try cuda.DeviceBuffer.fromHost(c.gpu.d, codes_host); + defer codes.free(); + // finite scales near 1: e4m3 0x30..0x3f (FP4, one a 16), e8m0 124..131 (MXFP8, one a 32) + const scales_host = try a.alloc(u8, if (t.mode == .fp4) npad * t.k / 16 else if (t.mode == .mxfp8) npad * t.k / 32 else 16); + defer a.free(scales_host); + for (scales_host) |*v| v.* = if (t.mode == .fp4) 0x30 + prng.random().uintLessThan(u8, 16) else 124 + prng.random().uintLessThan(u8, 8); + var scales = try cuda.DeviceBuffer.fromHost(c.gpu.d, scales_host); + defer scales.free(); + const sp = if (t.mode == .bf16) 0 else scales.ptr; + Qmmf.w = try q.pinned(.{ .mode = t.mode, .codes = codes.ptr, .scales = sp, .n = @intCast(t.n), .k = @intCast(t.k), .npad = @intCast(npad), .scale = 1 }, t.sk); + Qmmf.clusters = t.clusters; + const input = try bytesOf(u16, a, t.k, 31 + t.k, bf16); + defer a.free(input); + var b = try Bufs.init(c, input, t.n * 2); + defer b.deinit(); + try case(c, t.what, "qmmf", Qmmf.lane.mod, &b, Qmmf.run); + } +} + +/// A packed weight's bytes: BF16 tiled from random values, FP4 and MXFP8 random finite codes (any layout is a weight). +fn packed_(a: std.mem.Allocator, mode: q.Mode, n: usize, k: usize, npad: usize, r: std.Random) ![]u8 { + if (mode == .bf16) { + const host_w = try a.alloc(u16, n * k); + defer a.free(host_w); + for (host_w) |*v| v.* = bf16(r); + const tiled = try a.alloc(u16, npad * k); + defer a.free(tiled); + q.packBf16(tiled, host_w, n, k); + return a.dupe(u8, std.mem.sliceAsBytes(tiled)); + } + const out = try a.alloc(u8, if (mode == .fp4) npad * k / 2 else npad * k); + r.bytes(out); + if (mode == .mxfp8) for (out) |*v| if (v.* & 0x7f == 0x7f) { + v.* ^= 1; // e4m3's NaN codes + }; + return out; +} diff --git a/zig/tests/cuda/main.zig b/zig/tests/cuda/main.zig index db84ca38938..c231af0a047 100644 --- a/zig/tests/cuda/main.zig +++ b/zig/tests/cuda/main.zig @@ -32,7 +32,6 @@ const w4a8_tests = @import("w4a8_tests.zig"); const glm_exl3_tests = @import("glm_exl3_tests.zig"); const glm_kda_pad_check = @import("glm_kda_pad_check.zig"); const glm_vision_tests = @import("glm_vision_tests.zig"); -const glm_mm_bench = @import("glm_mm_bench.zig"); const glm_index_check = @import("glm_index_check.zig"); const carveout_tests = @import("carveout_tests.zig"); const nvfp4_tests = @import("nvfp4_tests.zig"); @@ -79,7 +78,6 @@ const window_pages512_tests = @import("window_pages512_tests.zig"); const window_bench = @import("window_bench.zig"); const moe_glue_tests = @import("moe_glue_tests.zig"); const dense_rows_tests = @import("dense_rows_tests.zig"); - const experts_rows_tests = @import("experts_rows_tests.zig"); const route_rows_tests = @import("route_rows_tests.zig"); const flashnext_model_rank_tests = @import("flashnext_model_rank_tests.zig"); @@ -103,7 +101,6 @@ const ggml_tests = @import("ggml_tests.zig"); const paged_tests = @import("paged_tests.zig"); const glm_loader_gate = @import("glm_loader_gate.zig"); const glm_fp8g_shares = @import("glm_fp8g_shares.zig"); - const gdn_back_tests = @import("gdn_back_tests.zig"); const q4_back_tests = @import("q4_back_tests.zig"); const moe_back_tests = @import("moe_back_tests.zig"); @@ -251,7 +248,8 @@ fn run(gpu: check.Gpu, cmd: []const u8, rest: []const [:0]const u8) !void { if (std.mem.eql(u8, cmd, "glm-exl3")) return glm_exl3_tests.run_(gpu); if (std.mem.eql(u8, cmd, "glm-kda-pad-split")) return glm_kda_pad_check.run(gpu); if (std.mem.eql(u8, cmd, "glm-mm-fixed")) return @import("glm_mm_fixed_tests.zig").run(gpu); - if (std.mem.eql(u8, cmd, "glm-mm-bench")) return glm_mm_bench.run(gpu); + if (std.mem.eql(u8, cmd, "glm-mm-bench")) return @import("glm_mm_bench.zig").run(gpu); + if (std.mem.eql(u8, cmd, "glm-pdl-order")) return @import("glm_pdl_order.zig").run(gpu, if (rest.len > 0) rest[0] else null); if (std.mem.eql(u8, cmd, "glm-index-check")) return glm_index_check.run(gpu); if (std.mem.eql(u8, cmd, "glm-kv-host-slots")) return glm_kv_host_slots.run(gpu); if (std.mem.eql(u8, cmd, "glm-vision")) return glm_vision_tests.run(gpu, try arg(rest, 0), try arg(rest, 1), try arg(rest, 2), try arg(rest, 3)); @@ -344,6 +342,7 @@ fn run(gpu: check.Gpu, cmd: []const u8, rest: []const [:0]const u8) !void { if (std.mem.eql(u8, cmd, "qwen-shared-prefix")) return @import("contract_qwen_shared_prefix.zig").run(gpu, rest); if (std.mem.eql(u8, cmd, "qwen-norm-shift")) return @import("qwen_norm_shift_tests.zig").run(gpu); if (std.mem.eql(u8, cmd, "clef")) return @import("clef_tests.zig").run(gpu, rest); + if (std.mem.startsWith(u8, cmd, "dots-")) return @import("dots_tests.zig").run(gpu, cmd, rest); if (std.mem.eql(u8, cmd, "qwen-pending")) return @import("contract_qwen_pending.zig").run(gpu); if (std.mem.eql(u8, cmd, "dspine-table")) return @import("dspine_table_tests.zig").runAll(gpu); if (std.mem.eql(u8, cmd, "minimax-contract")) return @import("contract_minimax.zig").run(gpu); diff --git a/zig/tests/cuda/main_usage.zig b/zig/tests/cuda/main_usage.zig index 95f777b63e1..274f8a560a0 100644 --- a/zig/tests/cuda/main_usage.zig +++ b/zig/tests/cuda/main_usage.zig @@ -144,6 +144,7 @@ pub const usage = \\ qwen-shared-prefix [time] attn_rows's classes across streams on shared pages == each stream alone, red controls; time: A/B \\ qwen-norm-shift qwen35.cu's _shift norms (BF16 checkpoints): 1 + w in FP32 within a BF16 ulp of float64, red controls \\ clef tiny DIR | head MODEL CASES OUT [--piece N] Clef's joint schema head: the tiny fixture, gate 3's logits + \\ dots-help dots.mocr's tower and image prompt checks (dots-*): their usage \\ qwen-pending qwen35's pending kept rows: the slot scans and tf_q35k_apply_pend == tf_q35k_apply, red controls \\ rope-yarn YaRN rope in tf_q35_rope, tf_q35_rope8 and tf_q36m_norm_rope against float64, to 1M \\ kernel-contract-limits DIR each registered launch against release SMs or sm_110 in DIR's fatbins diff --git a/zig/tests/dsv41_metal/fixture.zig b/zig/tests/dsv41_metal/fixture.zig index 30684318743..6c20e293394 100644 --- a/zig/tests/dsv41_metal/fixture.zig +++ b/zig/tests/dsv41_metal/fixture.zig @@ -237,7 +237,8 @@ pub const Rig = struct { r.c = c; try r.c.validate(); r.device = try mtl.Device.init(); - r.queue = try r.device.queue(); + // Metal 3 unless TF_METAL4=1: the timing harnesses sample Metal 3 encoders, and metal4_test compares the two + r.queue = try pkg.boot.openQueue(r.device, false); r.p = try pkg.pipelines.Pipelines.load(a, r.device, &r.c); var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/zig/tests/dsv41_metal/fixture_serve.zig b/zig/tests/dsv41_metal/fixture_serve.zig index 80f511ce4f1..c816deffe3d 100644 --- a/zig/tests/dsv41_metal/fixture_serve.zig +++ b/zig/tests/dsv41_metal/fixture_serve.zig @@ -44,7 +44,7 @@ const Held = struct { } }; -pub const Opts = struct { slots: u32 = 4, drafts: bool = true, cache_bytes: u64 = 0, chunk: u32 = 64, resident: bool = false }; +pub const Opts = struct { slots: u32 = 4, drafts: bool = true, cache_bytes: u64 = 0, chunk: u32 = 64, resident: bool = false, steps: bool = false, decode_share: ?f64 = null }; /// Set when a model opened with a residency owner closes: every buffer the target joined to it had left. pub var resident_left: ?bool = null; @@ -77,7 +77,7 @@ pub fn open(a: std.mem.Allocator, io: std.Io, seed: u64, o: Opts) !*pkg.serve.Me } const env: pkg.target.Env = .{ .device = r.device, .queue = r.queue, .c = &r.c, .p = &r.p, .tables = &r.tables, .s = &r.s, .model = h.f.model(), .lookup = h.f.lookup() }; const parts: pkg.serve.Parts = .{ .env = env, .top = &r.top.?, .dspark = &h.w, .owner = .{ .ctx = h, .close = Held.close }, .resident = if (h.res) |*x| x else null }; - return pkg.serve.Metal.open(a, parts, .{ .slots = o.slots, .limit = limit, .drafts = o.drafts, .cache_bytes = o.cache_bytes, .prompt = .{ .chunk = o.chunk } }); + return pkg.serve.Metal.open(a, parts, .{ .slots = o.slots, .limit = limit, .drafts = o.drafts, .cache_bytes = o.cache_bytes, .prompt = .{ .chunk = o.chunk }, .steps = o.steps, .decode_share = o.decode_share }); } /// Closes a model `open` made (the served engine closes its own through serve_lanes). diff --git a/zig/tests/dsv41_metal/layer_test.zig b/zig/tests/dsv41_metal/layer_test.zig index 9e3aa03a2a2..e2bec04a36e 100644 --- a/zig/tests/dsv41_metal/layer_test.zig +++ b/zig/tests/dsv41_metal/layer_test.zig @@ -15,6 +15,7 @@ test { _ = @import("ref.zig"); _ = @import("forward_test.zig"); _ = @import("zerocopy_test.zig"); + _ = @import("metal4_test.zig"); _ = @import("prompt_test.zig"); _ = @import("dspark_test.zig"); _ = @import("multi_test.zig"); diff --git a/zig/tests/dsv41_metal/metal4_test.zig b/zig/tests/dsv41_metal/metal4_test.zig new file mode 100644 index 00000000000..3feb07f84b6 --- /dev/null +++ b/zig/tests/dsv41_metal/metal4_test.zig @@ -0,0 +1,189 @@ +//! DeepSeek-V4.1 on a Metal 4 queue against a Metal 3 queue, bit for bit: decode rounds, prompt chunks, timestamps. +const std = @import("std"); +const mtl = @import("metal"); +const pkg = @import("dsv41_metal"); +const fixture = @import("fixture.zig"); +const ff = @import("fixture_fwd.zig"); +const pt = @import("prompt_test.zig"); + +const testing = std.testing; +const fwd = pkg.forward; +const limit = 1280; +const look = 3; + +const Out = struct { + logits: []f32, + taps: []u16, + + fn deinit(o: Out, a: std.mem.Allocator) void { + a.free(o.logits); + a.free(o.taps); + } +}; + +fn reset(q: mtl.Queue, to: *const pkg.kv.Slot, from: *const pkg.kv.Slot) !void { + const pool = mtl.objc.Pool.push(); + defer pool.pop(); + const cb = q.commandBuffer(); + to.copyFrom(cb, from); + cb.commit(); + cb.wait(); + if (cb.failure() != null) return error.CommandBufferFailed; +} + +/// `steps` decode rounds of `rows` rows from p0 through forward.run on `q`, the slot first copied from `pristine`. +fn rounds(a: std.mem.Allocator, f: *ff.Fwd, q: mtl.Queue, slot: *const pkg.kv.Slot, pristine: *const pkg.kv.Slot, hist: []const u32, p0: u32, rows: usize, steps: usize) !Out { + const r = f.r; + const c = &r.c; + try reset(q, slot, pristine); + const V: usize = c.vocab; + const TH = c.dspark_targets.len * c.hidden; + const out: Out = .{ .logits = try a.alloc(f32, rows * steps * V), .taps = try a.alloc(u16, rows * steps * TH) }; + for (0..steps) |k| { + const at = k * rows; + try fwd.prepare(&f.b, c, hist[look + at ..][0..rows], ff.lookbackAt(hist, look + at, look), f.lookup()); + const p: u32 = p0 + @as(u32, @intCast(at)); + try r.s.writeRows(c, p, @intCast(rows)); + const x = r.ctx(slot, p, @intCast(rows)); + const pool = mtl.objc.Pool.push(); + defer pool.pop(); + try fwd.run(&x, q, f.model(), &f.b); + @memcpy(out.logits[at * V ..][0 .. rows * V], f.b.logitsOf(c, rows)); + @memcpy(out.taps[at * TH ..][0 .. rows * TH], slot.taps.?.slice(u16, rows * TH)); + } + return out; +} + +/// The same rounds on both queues: logits, taps and slot bytes that differ. +fn compare(a: std.mem.Allocator, f: *ff.Fwd, m3: mtl.Queue, m4: mtl.Queue, pristine: *const pkg.kv.Slot, rows: usize, steps: usize, seed: u64) !usize { + const r = f.r; + var s3 = try pkg.kv.Slot.init(a, r.device, &r.c, limit); + defer s3.deinit(); + var s4 = try pkg.kv.Slot.init(a, r.device, &r.c, limit); + defer s4.deinit(); + const hist = try ff.ids(a, &r.c, look + rows * steps, seed); + defer a.free(hist); + const o3 = try rounds(a, f, m3, &s3, pristine, hist, 1101, rows, steps); + defer o3.deinit(a); + const o4 = try rounds(a, f, m4, &s4, pristine, hist, 1101, rows, steps); + defer o4.deinit(a); + const lb = pt.bitsDiff(o3.logits, o4.logits); + const tb = pt.halfDiff(o3.taps, o4.taps); + const sb = pt.stateDiff(&s3, &s4); + const word = if (lb + tb + sb == 0) "PASS" else "FAIL"; + std.debug.print("{s} dsv41 metal 4 == metal 3: {d} rounds of {d} rows: {d} logits, {d} tap values, {d} state bytes differ\n", .{ word, steps, rows, lb, tb, sb }); + return lb + tb + sb; +} + +test "dsv41 metal: decode rounds on a Metal 4 queue equal a Metal 3 queue's bit for bit, 1 to 16 rows" { + const a = testing.allocator; + const f = try ff.Fwd.init(a, testing.io, limit, 71); + defer f.deinit(); + if (!f.r.device.hasMetal4()) return error.SkipZigTest; + const m3 = try f.r.device.queue(); + defer m3.deinit(); + const m4 = try f.r.device.queue4(); + defer m4.deinit(); + try testing.expect(m4.isMetal4() and !m3.isMetal4()); + var pristine = try pkg.kv.Slot.init(a, f.r.device, &f.r.c, limit); + defer pristine.deinit(); + fixture.fillPast(&f.r.c, &pristine, 1101, 12); + var bad: usize = 0; + for ([_]usize{ 1, 2, 4, 6, 16 }) |rows| bad += try compare(a, f, m3, m4, &pristine, rows, 3, 300 + rows); + try testing.expectEqual(@as(usize, 0), bad); +} + +test "dsv41 metal: a prompt's chunks on a Metal 4 queue equal a Metal 3 queue's: logits, taps, slot and tail" { + const a = testing.allocator; + const f = try ff.Fwd.initWith(a, testing.io, fixture.promptConfig(), limit, 72); + defer f.deinit(); + if (!f.r.device.hasMetal4()) return error.SkipZigTest; + const c = &f.r.c; + const hist = try ff.ids(a, c, 900, 73); + defer a.free(hist); + var runs: [2]pt.Run = undefined; + const qs = [2]mtl.Queue{ try f.r.device.queue(), try f.r.device.queue4() }; + defer for (qs) |q| q.deinit(); + for (&runs, qs) |*run, q| { + run.* = try pt.Run.init(a, f, pt.head_opts, 0); + var e = pt.env(f); + e.queue = q; + try run.p.run(e, &run.slot, &run.tail, hist); + } + defer for (&runs) |*run| run.deinit(); + const d = pt.runDiff(c, &runs[0], &runs[1]); + const td = pt.tailDiff(&runs[0].tail, &runs[1].tail); + const word = if (d[0] + d[1] + d[2] + td == 0) "PASS" else "FAIL"; + std.debug.print("{s} dsv41 metal 4 prompt == metal 3: {d} logits, {d} taps, {d} state bytes, {d} tail bytes differ\n", .{ word, d[0], d[1], d[2], td }); + try testing.expectEqual(@as(usize, 0), d[0] + d[1] + d[2] + td); +} + +test "dsv41 metal: timestamped decode rounds on Metal 4 change no bit, and their stages are summed" { + const a = testing.allocator; + mtl.Pipeline.labels(true); // the timeline names stages by their pipelines' labels + defer mtl.Pipeline.labels(false); + const f = try ff.Fwd.init(a, testing.io, limit, 74); + defer f.deinit(); + if (!f.r.device.hasMetal4()) return error.SkipZigTest; + const m3 = try f.r.device.queue(); + defer m3.deinit(); + const st = mtl.metal4.State.open(f.r.device.id, 2) orelse return error.SkipZigTest; + const m4: mtl.Queue = .{ .id = st.queue, .m4 = st }; + defer m4.deinit(); + var pristine = try pkg.kv.Slot.init(a, f.r.device, &f.r.c, limit); + defer pristine.deinit(); + fixture.fillPast(&f.r.c, &pristine, 1101, 13); + // 8 warm rounds, then 2 stamped + try testing.expectEqual(@as(usize, 0), try compare(a, f, m3, m4, &pristine, 1, 11, 400)); + const t = st.timeline orelse return error.NoTimeline; + const r = t.rounds.items[0]; + std.debug.print("dsv41 metal 4 timeline: {s}: {d} stamped rounds, {d} encoders, {d} kernels, {d:.3} ms in stages a round\n", .{ r.name, r.done, r.encoders, r.kernels.count(), r.inside * 1e3 / @as(f64, @floatFromInt(r.done)) }); + try testing.expectEqual(@as(u32, 2), r.done); + try testing.expect(r.encoders >= 1 and r.kernels.count() > 4 and r.inside > 0 and r.fits); +} + +test "metal 4: a queue closed while a feedback is still owed keeps its memory; one with every feedback frees it" { + const a = testing.allocator; + const f = try ff.Fwd.init(a, testing.io, limit, 75); + defer f.deinit(); + if (!f.r.device.hasMetal4()) return error.SkipZigTest; + // every commit reported: freed + const done = mtl.metal4.State.open(f.r.device.id, 0) orelse return error.SkipZigTest; + const q1: mtl.Queue = .{ .id = done.queue, .m4 = done }; + const cb = q1.commandBuffer(); + cb.blit().end(); + cb.commit(); + cb.wait(); + try testing.expect(cb.failure() == null); + try testing.expect(!done.closeWithin(1000)); + // a commit whose feedback has not arrived (a late handler): the State stays, so the handler writes live memory + const late = mtl.metal4.State.open(f.r.device.id, 0) orelse return error.SkipZigTest; + late.slots[0].commits += 1; + try testing.expect(late.closeWithin(100)); + _ = late.slots[0].seen.fetchAdd(1, .release); // the late feedback lands on storage that is still there + std.debug.print("PASS metal 4 close: freed with every feedback in, kept with one owed\n", .{}); +} + +test "dsv41 metal: the round profiler reads and drops its pending round before the queue closes" { + const a = testing.allocator; + const f = try ff.Fwd.init(a, testing.io, limit, 76); + defer f.deinit(); + if (!f.r.device.hasMetal4()) return error.SkipZigTest; + const m4 = try f.r.device.queue4(); + var slot = try pkg.kv.Slot.init(a, f.r.device, &f.r.c, limit); + defer slot.deinit(); + fixture.fillPast(&f.r.c, &slot, 1101, 14); + pkg.round_prof.force(true); + defer pkg.round_prof.force(false); + const hist = try ff.ids(a, &f.r.c, look + 1, 77); + defer a.free(hist); + try fwd.prepare(&f.b, &f.r.c, hist[look..][0..1], ff.lookbackAt(hist, look, look), f.lookup()); + try f.r.s.writeRows(&f.r.c, 1101, 1); + const x = f.r.ctx(&slot, 1101, 1); + try fwd.run(&x, m4, f.model(), &f.b); + try testing.expect(pkg.round_prof.holding()); // Metal 4 reports GPU times later: the round waits to be read + pkg.round_prof.forget(); + try testing.expect(!pkg.round_prof.holding()); + m4.deinit(); + std.debug.print("PASS dsv41 metal round profiler: nothing pending once its queue closes\n", .{}); +} diff --git a/zig/tests/dsv41_metal/serve_test.zig b/zig/tests/dsv41_metal/serve_test.zig index 2f39ad8b534..d0d9ab76fd4 100644 --- a/zig/tests/dsv41_metal/serve_test.zig +++ b/zig/tests/dsv41_metal/serve_test.zig @@ -10,28 +10,38 @@ const Served = host.serve_lanes.Served; const testing = std.testing; const gpa = testing.allocator; const io = testing.io; -const seed = 71; +pub const seed = 71; test { _ = @import("boot_test.zig"); _ = @import("tree_test.zig"); + _ = @import("steps_test.zig"); + _ = @import("steps_serve_test.zig"); } +/// Replies that have shown their first tokens so far (Box.first). +var firsts: std.atomic.Value(u64) = .init(0); + /// A reply's tokens and finish, written on LaneHost's thread and read on the test's. -const Box = struct { +pub const Box = struct { mutex: std.Io.Mutex = .init, out: std.ArrayList(u32) = .empty, done: bool = false, reason: ?api.Reason = null, drafted: u64 = 0, cached: u32 = 0, + /// when the reply's first tokens came, in the order of every box's (0: none yet) + first: u64 = 0, - fn event(ctx: *anyopaque, _: api.Id, e: *const api.Event) void { + pub fn event(ctx: *anyopaque, _: api.Id, e: *const api.Event) void { const b: *Box = @ptrCast(@alignCast(ctx)); b.mutex.lockUncancelable(io); defer b.mutex.unlock(io); switch (e.*) { - .tokens => |ts| b.out.appendSlice(gpa, ts) catch {}, + .tokens => |ts| { + if (b.first == 0) b.first = firsts.fetchAdd(1, .monotonic) + 1; + b.out.appendSlice(gpa, ts) catch {}; + }, .finished => |fin| { b.done = true; b.reason = fin.reason; @@ -42,7 +52,7 @@ const Box = struct { } } - fn wait(b: *Box) !void { + pub fn wait(b: *Box) !void { for (0..600_000) |_| { b.mutex.lockUncancelable(io); const done = b.done; @@ -53,20 +63,20 @@ const Box = struct { return error.Timeout; } - fn deinit(b: *Box) void { + pub fn deinit(b: *Box) void { b.out.deinit(gpa); } }; /// One request to send: its prompt, length, drafts and sampling. -const Ask = struct { prompt: []const u32, max: u32 = 24, drafts: bool = true, sampling: ?api.Sampling = null }; +pub const Ask = struct { prompt: []const u32, max: u32 = 24, drafts: bool = true, sampling: ?api.Sampling = null }; var next_id: api.Id = 1; /// The prompt rows each reply of the last `serve` call took from kept state (its `prefilled` event), in ask order. -var cached_rows: [8]u32 = undefined; +pub var cached_rows: [8]u32 = undefined; /// The asks sent together (or each after the last finished); each reply returned gpa-owned, the drafted rows summed. -fn serve(e: api.Engine, asks: []const Ask, together: bool, out: [][]u32, drafted: *u64) !void { +pub fn serve(e: api.Engine, asks: []const Ask, together: bool, out: [][]u32, drafted: *u64) !void { const boxes = try gpa.alloc(Box, asks.len); defer gpa.free(boxes); @memset(boxes, .{}); @@ -89,23 +99,23 @@ fn serve(e: api.Engine, asks: []const Ask, together: bool, out: [][]u32, drafted } } -fn freeAll(xs: [][]u32) void { +pub fn freeAll(xs: [][]u32) void { for (xs) |x| gpa.free(x); } /// The reference: the target's serial decode of each ask on a model of its own (no lanes, no cache, no drafts). -fn reference(asks: []const Ask, out: [][]u32) !void { +pub fn reference(asks: []const Ask, out: [][]u32) !void { const m = try fs.open(gpa, io, seed, .{ .slots = 1, .drafts = false }); defer fs.close(m); for (asks, out) |k, *o| o.* = try m.t.serial(0, k.prompt, k.max, k.sampling); } -fn ids(n: usize, s: u64) ![]u32 { +pub fn ids(n: usize, s: u64) ![]u32 { return ff.ids(gpa, &fs.config(), n, s); } /// Ids with no user, assistant or think tag among them, so the tests place those themselves. -fn untagged(n: usize, s: u64) ![]u32 { +pub fn untagged(n: usize, s: u64) ![]u32 { const c = fs.config(); const xs = try ids(n, s); for (xs) |*x| if (x.* == c.user or x.* == c.assistant or x.* == c.think_open) { @@ -114,12 +124,12 @@ fn untagged(n: usize, s: u64) ![]u32 { return xs; } -fn say(ok: bool, comptime fmt: []const u8, args: anytype) void { +pub fn say(ok: bool, comptime fmt: []const u8, args: anytype) void { std.debug.print("{s} dsv41 metal serve: ", .{if (ok) "PASS" else "FAIL"}); std.debug.print(fmt ++ "\n", args); } -fn same(want: []const []u32, got: []const []u32) usize { +pub fn same(want: []const []u32, got: []const []u32) usize { var bad: usize = 0; for (want, got) |w, g| bad += @intFromBool(!std.mem.eql(u32, w, g)); return bad; @@ -202,12 +212,17 @@ test "dsv41 metal serve: (c) prompt-cache hits (the same prompt, a later turn) = } test "dsv41 metal serve: (c2) a thinking turn keeps its state before ; the next turn resumes there == fresh" { + for ([_]bool{ false, true }) |steps| try thinkingTurn(steps); +} + +/// (c2) with whole prompts, or in steps (`steps`): the same kept state and replies. +fn thinkingTurn(steps: bool) !void { const c = fs.config(); const body = try untagged(300, 7); defer gpa.free(body); const p = try std.mem.concat(gpa, u32, &.{ body, &.{ c.assistant, c.think_open } }); defer gpa.free(p); - const m = try fs.open(gpa, io, seed, .{ .cache_bytes = 1 << 30 }); + const m = try fs.open(gpa, io, seed, .{ .cache_bytes = 1 << 30, .steps = steps }); const s = try Served.open(gpa, io, m.model(), ".", null); defer Served.close(s); const e = s.engine(); @@ -230,13 +245,18 @@ test "dsv41 metal serve: (c2) a thinking turn keeps its state before ; th try reference(&asks, &want); defer freeAll(&want); const bad = same(&want, &.{ first[0], got[0] }); - say(bad == 0 and resumed == p.len - 1, "(c2) a thinking follow-up resumed {d} rows (its turn before : {d}); split prefill and follow-up vs fresh: {d} of 2 replies differ", .{ resumed, p.len - 1, bad }); + say(bad == 0 and resumed == p.len - 1, "(c2) {s}: a thinking follow-up resumed {d} rows (its turn before : {d}); split prefill and follow-up vs fresh: {d} of 2 replies differ", .{ if (steps) "in steps" else "whole prompts", resumed, p.len - 1, bad }); try testing.expectEqual(@as(usize, 0), bad); try testing.expect(m.t.stats.hits > hits0); try testing.expectEqual(@as(u32, @intCast(p.len - 1)), resumed); } test "dsv41 metal serve: (c3) a fresh conversation resumes after the last one's system part == fresh" { + for ([_]bool{ false, true }) |steps| try systemPart(steps); +} + +/// (c3) with whole prompts, or in steps (`steps`): the same kept state and replies. +fn systemPart(steps: bool) !void { const c = fs.config(); const system = try untagged(300, 9); defer gpa.free(system); @@ -250,7 +270,7 @@ test "dsv41 metal serve: (c3) a fresh conversation resumes after the last one's k.* = .{ .prompt = p.*, .max = 24 }; } defer for (prompts) |p| gpa.free(p); - const m = try fs.open(gpa, io, seed, .{ .cache_bytes = 1 << 30 }); + const m = try fs.open(gpa, io, seed, .{ .cache_bytes = 1 << 30, .steps = steps }); const s = try Served.open(gpa, io, m.model(), ".", null); defer Served.close(s); var drafted: u64 = 0; @@ -262,7 +282,7 @@ test "dsv41 metal serve: (c3) a fresh conversation resumes after the last one's try reference(&asks, &want); defer freeAll(&want); const bad = same(&want, &got); - say(bad == 0 and resumed[1] == system.len, "(c3) a new conversation resumed {d} rows (the system part: {d}); vs fresh: {d} of 2 replies differ", .{ resumed[1], system.len, bad }); + say(bad == 0 and resumed[1] == system.len, "(c3) {s}: a new conversation resumed {d} rows (the system part: {d}); vs fresh: {d} of 2 replies differ", .{ if (steps) "in steps" else "whole prompts", resumed[1], system.len, bad }); try testing.expectEqual(@as(usize, 0), bad); try testing.expectEqual([2]u32{ 0, @intCast(system.len) }, resumed); } diff --git a/zig/tests/dsv41_metal/steps_serve_test.zig b/zig/tests/dsv41_metal/steps_serve_test.zig new file mode 100644 index 00000000000..6c0cccb7462 --- /dev/null +++ b/zig/tests/dsv41_metal/steps_serve_test.zig @@ -0,0 +1,211 @@ +//! The served engine with prompts in steps (begin / piece / finish) through LaneHost: replies equal serial decode. +const std = @import("std"); +const host = @import("dsv41"); +const fs = @import("fixture_serve.zig"); +const st = @import("serve_test.zig"); + +const api = host.api; +const Served = host.serve_lanes.Served; +const testing = std.testing; +const gpa = testing.allocator; +const io = testing.io; +const seed = st.seed; +const Box = st.Box; +const Ask = st.Ask; +const serve = st.serve; +const freeAll = st.freeAll; +const reference = st.reference; +const ids = st.ids; +const untagged = st.untagged; +const say = st.say; +const same = st.same; + +/// Waits until `field` of the target's stats reaches `n` (read from LaneHost's thread's writes). +fn awaitStat(field: *const u64, n: u64) !void { + for (0..60_000) |_| { + if (@atomicLoad(u64, field, .monotonic) >= n) return; + std.Io.sleep(io, .fromMilliseconds(1), .awake) catch {}; + } + return error.Timeout; +} + +test "dsv41 metal serve in steps: (a) concurrent == solo == serial, drafted == draft:false, pieces between rounds" { + const p0 = try ids(150, 1); + defer gpa.free(p0); + const p1 = try ids(620, 2); + defer gpa.free(p1); + const asks = [_]Ask{ .{ .prompt = p0 }, .{ .prompt = p1 } }; + var want: [2][]u32 = undefined; + try reference(&asks, &want); + defer freeAll(&want); + const m = try fs.open(gpa, io, seed, .{ .steps = true }); + const s = try Served.open(gpa, io, m.model(), ".", null); + defer Served.close(s); + const e = s.engine(); + var drafted: u64 = 0; + var solo: [2][]u32 = undefined; + try serve(e, &asks, false, &solo, &drafted); + defer freeAll(&solo); + var both: [2][]u32 = undefined; + try serve(e, &asks, true, &both, &drafted); + defer freeAll(&both); + const plain_asks = [_]Ask{ .{ .prompt = p0, .drafts = false }, .{ .prompt = p1, .drafts = false } }; + var plain_drafted: u64 = 0; + var plain: [2][]u32 = undefined; + try serve(e, &plain_asks, true, &plain, &plain_drafted); + defer freeAll(&plain); + const bad = same(&want, &solo) + same(&want, &both) + same(&want, &plain); + say(bad == 0 and m.t.stats.pieces > 0 and drafted > 0, "(a) in steps: {d} of 6 replies differ from serial; {d} pieces, {d} drafted rows", .{ bad, m.t.stats.pieces, drafted }); + try testing.expectEqual(@as(usize, 0), bad); + try testing.expect(m.t.stats.pieces > 0 and drafted > 0 and plain_drafted == 0); +} + +test "dsv41 metal serve in steps: (b) a short request during a long prompt: first in steps, after it as whole prompts" { + const long = try ids(1100, 30); + defer gpa.free(long); + const short = try ids(100, 31); + defer gpa.free(short); + const asks = [_]Ask{ .{ .prompt = long, .max = 4 }, .{ .prompt = short, .max = 4 } }; + var want: [2][]u32 = undefined; + try reference(&asks, &want); + defer freeAll(&want); + var bad: usize = 0; + for ([_]bool{ false, true }) |steps| { + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .chunk = 16, .steps = steps }); + const s = try Served.open(gpa, io, m.model(), ".", null); + defer Served.close(s); + const e = s.engine(); + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.deinit(); + const reqs = [2]api.Request{ .{ .prompt = long, .max_tokens = 4 }, .{ .prompt = short, .max_tokens = 4 } }; + try e.submit(600, &reqs[0], .{ .ctx = &boxes[0], .event = Box.event }); + // the short request arrives while the long prompt runs: two of its pieces in, or (whole) once it began + if (steps) try awaitStat(&m.t.stats.pieces, 2) else try awaitStat(&m.t.stats.prompts, 1); + try e.submit(601, &reqs[1], .{ .ctx = &boxes[1], .event = Box.event }); + for (&boxes) |*b| try b.wait(); + const short_first = boxes[1].first < boxes[0].first; + const equal = std.mem.eql(u32, want[0], boxes[0].out.items) and std.mem.eql(u32, want[1], boxes[1].out.items); + const ok = equal and short_first == steps; + say(ok, "(b) {s}: the short reply's first token came {s} the long one's ({d} pieces); replies {s} serial", .{ if (steps) "in steps" else "whole prompts", if (short_first) "before" else "after", m.t.stats.pieces, if (equal) "equal" else "differ from" }); + bad += @intFromBool(!ok); + } + try testing.expectEqual(@as(usize, 0), bad); +} + +test "dsv41 metal serve in steps: (c) a request cancelled mid-prompt keeps nothing and the next requests == serial" { + // no user or think tag, so no state short of the prompt is kept (Target.keepPoints) + const long = try untagged(1100, 32); + defer gpa.free(long); + const p0 = try ids(120, 33); + defer gpa.free(p0); + const asks = [_]Ask{ .{ .prompt = p0, .max = 40 }, .{ .prompt = long } }; + var want: [2][]u32 = undefined; + try reference(&asks, &want); + defer freeAll(&want); + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .chunk = 16, .cache_bytes = 1 << 30, .steps = true }); + const s = try Served.open(gpa, io, m.model(), ".", null); + defer Served.close(s); + const e = s.engine(); + var bg: Box = .{}; + defer bg.deinit(); + const r0: api.Request = .{ .prompt = p0, .max_tokens = 40 }; + try e.submit(700, &r0, .{ .ctx = &bg, .event = Box.event }); + // the long prompt once the decoding reply is out, cancelled three of its pieces in + for (0..60_000) |_| { + bg.mutex.lockUncancelable(io); + const out = bg.first != 0; + bg.mutex.unlock(io); + if (out) break; + std.Io.sleep(io, .fromMilliseconds(1), .awake) catch {}; + } else return error.Timeout; + var gone: Box = .{}; + defer gone.deinit(); + const rl: api.Request = .{ .prompt = long, .max_tokens = 64 }; + const p_before = @atomicLoad(u64, &m.t.stats.pieces, .monotonic); + try e.submit(701, &rl, .{ .ctx = &gone, .event = Box.event }); + try awaitStat(&m.t.stats.pieces, p_before + 3); + e.cancel(701); + try gone.wait(); + try bg.wait(); + var prefix_kept = false; + for (m.t.cache.entries.items) |x| prefix_kept = prefix_kept or std.mem.startsWith(u32, long, x.ids); + var drafted: u64 = 0; + var again: [1][]u32 = undefined; + try serve(e, asks[1..], false, &again, &drafted); + defer freeAll(&again); + const ok = gone.reason.? == .cancelled and m.t.stats.abandoned == 1 and std.mem.eql(u32, want[0], bg.out.items) and std.mem.eql(u32, want[1], again[0]); + if (!ok) std.debug.print(" reason {t}, abandoned {d}, decoding reply {}, again {}\n", .{ gone.reason.?, m.t.stats.abandoned, std.mem.eql(u32, want[0], bg.out.items), std.mem.eql(u32, want[1], again[0]) }); + say(ok and !prefix_kept and st.cached_rows[0] == 0, "(c) cancelled after {d}+ pieces: {d} abandoned, a prefix of it kept: {}, the decoding reply and the prompt again (cached {d}) {s} serial", .{ 3, m.t.stats.abandoned, prefix_kept, st.cached_rows[0], if (ok) "equal" else "differ from" }); + try testing.expect(ok and !prefix_kept and st.cached_rows[0] == 0); +} + +test "dsv41 metal serve in steps: (d) a decode share gives a decoding reply rounds between a prompt's pieces; replies == serial" { + const long = try ids(1100, 34); + defer gpa.free(long); + const p0 = try ids(120, 35); + defer gpa.free(p0); + const asks = [_]Ask{ .{ .prompt = p0, .max = 300, .drafts = false }, .{ .prompt = long, .max = 8 } }; + var want: [2][]u32 = undefined; + try reference(&asks, &want); + defer freeAll(&want); + var bad: usize = 0; + // a share of 0 is one round a step (no debt); 0.75 owes replies three times each step's time (and caps its rows) + for ([_]f64{ 0, 0.75 }) |share| { + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .chunk = 256, .steps = true, .decode_share = share }); + const s = try Served.open(gpa, io, m.model(), ".", null); + defer Served.close(s); + const e = s.engine(); + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.deinit(); + const reqs = [2]api.Request{ .{ .prompt = p0, .max_tokens = 300, .drafts = false }, .{ .prompt = long, .max_tokens = 8 } }; + try e.submit(800, &reqs[0], .{ .ctx = &boxes[0], .event = Box.event }); + try awaitStat(&m.t.stats.windows, 1); + try e.submit(801, &reqs[1], .{ .ctx = &boxes[1], .event = Box.event }); + for (&boxes) |*b| try b.wait(); + const between = m.t.stats.most_between; + const equal = std.mem.eql(u32, want[0], boxes[0].out.items) and std.mem.eql(u32, want[1], boxes[1].out.items); + const ok = equal and m.t.stats.pieces >= 2 and if (share > 0) between >= 3 else between <= 1; + say(ok, "(d) decode share {d:.2}: at most {d} rounds between two of the prompt's {d} pieces; replies {s} serial", .{ share, between, m.t.stats.pieces, if (equal) "equal" else "differ from" }); + bad += @intFromBool(!ok); + } + try testing.expectEqual(@as(usize, 0), bad); +} + +extern "c" fn setenv(name: [*:0]const u8, value: [*:0]const u8, overwrite: c_int) c_int; +extern "c" fn unsetenv(name: [*:0]const u8) c_int; + +test "dsv41 metal serve in steps: (e) fcfs steps capped at 128 and 100 rows: replies == serial, each step on the chunk staged for it" { + const long = try ids(1100, 36); + defer gpa.free(long); + const p0 = try ids(120, 37); + defer gpa.free(p0); + const asks = [_]Ask{ .{ .prompt = p0, .max = 300, .drafts = false }, .{ .prompt = long, .max = 8 } }; + var want: [2][]u32 = undefined; + try reference(&asks, &want); + defer freeAll(&want); + _ = setenv("TENSORFOLD_PREFILL_POLICY", "fcfs", 1); + defer _ = unsetenv("TENSORFOLD_PREFILL_POLICY"); + defer _ = unsetenv("TENSORFOLD_PREFILL_TOKENS"); + var bad: usize = 0; + // a 256-row chunk: steps of half a chunk and of rows that divide none, while a reply decodes + for ([_][:0]const u8{ "128", "100" }) |tokens| { + _ = setenv("TENSORFOLD_PREFILL_TOKENS", tokens, 1); + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .chunk = 256, .steps = try host.serve_lanes.stepsFromEnv() }); + const s = try Served.open(gpa, io, m.model(), ".", null); + defer Served.close(s); + const e = s.engine(); + var boxes: [2]Box = @splat(.{}); + defer for (&boxes) |*b| b.deinit(); + const reqs = [2]api.Request{ .{ .prompt = p0, .max_tokens = 300, .drafts = false }, .{ .prompt = long, .max_tokens = 8 } }; + try e.submit(900, &reqs[0], .{ .ctx = &boxes[0], .event = Box.event }); + try awaitStat(&m.t.stats.windows, 1); + try e.submit(901, &reqs[1], .{ .ctx = &boxes[1], .event = Box.event }); + for (&boxes) |*b| try b.wait(); + const equal = std.mem.eql(u32, want[0], boxes[0].out.items) and std.mem.eql(u32, want[1], boxes[1].out.items); + const hits = m.t.pr.stage_hits; + const ok = equal and m.t.stats.pieces >= 3 and hits + 1 >= m.t.stats.pieces; + say(ok, "(e) fcfs, {s} rows a step: {d} pieces, {d} calls on a staged chunk; replies {s} serial", .{ tokens, m.t.stats.pieces, hits, if (equal) "equal" else "differ from" }); + bad += @intFromBool(!ok); + } + try testing.expectEqual(@as(usize, 0), bad); +} diff --git a/zig/tests/dsv41_metal/steps_test.zig b/zig/tests/dsv41_metal/steps_test.zig new file mode 100644 index 00000000000..bd020fc96fe --- /dev/null +++ b/zig/tests/dsv41_metal/steps_test.zig @@ -0,0 +1,244 @@ +//! The Metal target's prompt in pieces (begin / piece / finish) against its whole prompt: state, choice and tokens. +const std = @import("std"); +const mtl = @import("metal"); +const pkg = @import("dsv41_metal"); +const host = @import("dsv41"); +const fs = @import("fixture_serve.zig"); +const ff = @import("fixture_fwd.zig"); + +const testing = std.testing; +const gpa = testing.allocator; +const io = testing.io; +const seed = 73; +const n_prompt = 900; +const n_decode = 8; + +fn say(ok: bool, comptime fmt: []const u8, args: anytype) void { + std.debug.print("{s} dsv41 metal steps: ", .{if (ok) "PASS" else "FAIL"}); + std.debug.print(fmt ++ "\n", args); +} + +/// Every byte a slot's prompt state holds: each layer's window ring, pool, index keys and carry, the taps, the tail. +fn stateBytes(slot: *const pkg.target.Slot) ![]u8 { + return bytesOf(slot, true); +} + +/// The slot's bytes, its prompt tail's too when `tail` (a resumed prompt's tail holds only the rows it ran). +fn bytesOf(slot: *const pkg.target.Slot, tail: bool) ![]u8 { + var out: std.ArrayList(u8) = .empty; + errdefer out.deinit(gpa); + for (slot.kv.regions) |r| for ([_]?mtl.Buffer{ r.window, r.pool, r.keys, r.carry }) |ob| if (ob) |b| { + try out.appendSlice(gpa, b.contents()[0..b.length()]); + }; + try out.appendSlice(gpa, slot.kv.taps.?.contents()[0..slot.kv.taps.?.length()]); + if (tail) for ([_]mtl.Buffer{ slot.tail.x, slot.tail.pre }) |b| try out.appendSlice(gpa, b.contents()[0..b.length()]); + return out.toOwnedSlice(gpa); +} + +fn diff(x: []const u8, y: []const u8) usize { + if (x.len != y.len) return @max(x.len, y.len); + var n: usize = 0; + for (x, y) |s, t| n += @intFromBool(s != t); + return n; +} + +/// One plain row on a live slot after `tok` at `at`: the next greedy choice. +fn step(tg: host.iface.Target, slot: u32, at: u64, tok: u32) !u32 { + var ch: [1]u32 = undefined; + var cs = [_][]u32{&ch}; + try tg.window(&.{.{ .slot = slot, .start = at, .tokens = &.{tok}, .parents = null, .draws = &.{at + 1}, .sampling = null }}, &cs); + return ch[0]; +} + +/// The prompt's first choice and `n_decode` greedy tokens after it on a live slot. +fn decode(tg: host.iface.Target, slot: u32, len: usize, first: u32, out: []u32) !void { + var tok = first; + for (out, 0..) |*o, i| { + o.* = tok; + tok = try step(tg, slot, len + i, tok); + } +} + +/// The whole-prompt reference: state bytes right after the prompt, and its tokens. +const Ref = struct { + state: []u8, + kv: []u8, + toks: [n_decode]u32, + + fn free(r: Ref) void { + gpa.free(r.state); + gpa.free(r.kv); + } +}; + +fn reference(prompt: []const u32) !Ref { + const m = try fs.open(gpa, io, seed, .{ .slots = 1, .drafts = false }); + defer fs.close(m); + const tg = m.t.target(); + const first = try tg.prefill(0, prompt, null, prompt.len); + var r: Ref = .{ .state = try stateBytes(&m.t.slots[0]), .kv = undefined, .toks = undefined }; + errdefer gpa.free(r.state); + r.kv = try bytesOf(&m.t.slots[0], false); + errdefer gpa.free(r.kv); + try decode(tg, 0, prompt.len, first, &r.toks); + tg.release(0); + return r; +} + +test "dsv41 metal steps: pieces of 1, 7, 64, 100 and 300 rows == the whole prompt; a decode stream between them" { + const p = try ff.ids(gpa, &fs.config(), n_prompt, 74); + defer gpa.free(p); + const q = try ff.ids(gpa, &fs.config(), 200, 75); + defer gpa.free(q); + const want = try reference(p); + defer want.free(); + const solo = try reference(q); + defer solo.free(); + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .drafts = false }); + defer fs.close(m); + const tg = m.t.target(); + var bad: usize = 0; + for ([_]u64{ 1, 7, 64, 100, 300 }) |rows| { + // slot 0 decodes one row between every two pieces of slot 1's prompt + var tok = try tg.prefill(0, q, null, q.len); + var made: std.ArrayList(u32) = .empty; + defer made.deinit(gpa); + const b = try tg.begin(1, p); + try testing.expectEqual(@as(u64, 0), b.at); + var at: u64 = 0; + const before = m.t.stats.pieces; + const hits0 = m.t.pr.stage_hits; + while (p.len - at > rows) : (at += rows) { + try tg.piece(1, p, at, at + rows, false); + if (made.items.len < n_decode) { + try made.append(gpa, tok); + tok = try step(tg, 0, q.len + made.items.len - 1, tok); + } + } + const first = try tg.finish(1, p, null, p.len); + const st = try stateBytes(&m.t.slots[1]); + defer gpa.free(st); + var toks: [n_decode]u32 = undefined; + try decode(tg, 1, p.len, first, &toks); + while (made.items.len < n_decode) { + try made.append(gpa, tok); + tok = try step(tg, 0, q.len + made.items.len - 1, tok); + } + const sd = diff(st, want.state); + const td = @intFromBool(!std.mem.eql(u32, &toks, &want.toks)); + const dd = @intFromBool(!std.mem.eql(u32, made.items, &solo.toks)); + // every call after the first (each later piece and the finish) starts on the chunk the one before prepared + const pieces = m.t.stats.pieces - before; + const hits = m.t.pr.stage_hits - hits0; + const hd = @intFromBool(hits != pieces); + say(sd + td + dd + hd == 0, "(a) {d}-row pieces ({d} of them, {d} started on a prepared chunk) vs whole: {d} state bytes, tokens {s}; the decode between them {s} alone", .{ rows, pieces, hits, sd, if (td == 0) "equal" else "differ", if (dd == 0) "equals its run" else "differs from its run" }); + bad += sd + td + dd + hd; + tg.release(0); + tg.release(1); + } + try testing.expectEqual(@as(usize, 0), bad); +} + +test "dsv41 metal steps: a refused or released mid-prompt prefill frees the slot; the next prompt there == whole" { + const p = try ff.ids(gpa, &fs.config(), n_prompt, 76); + defer gpa.free(p); + const want = try reference(p); + defer want.free(); + const m = try fs.open(gpa, io, seed, .{ .slots = 1, .drafts = false, .cache_bytes = 1 << 30 }); + defer fs.close(m); + const tg = m.t.target(); + // a piece that skips rows fails and abandons the prompt; another begun prompt is released between pieces + _ = try tg.begin(0, p); + try tg.piece(0, p, 0, 300, false); + const refused = tg.piece(0, p, 301, 400, false); + try testing.expectError(error.NotAChain, refused); + try testing.expectError(error.NotBegun, tg.piece(0, p, 300, 400, false)); + _ = try tg.begin(0, p); + try tg.piece(0, p, 0, 500, false); + tg.release(0); + const kept = m.t.cache.entries.items.len; + const abandoned = m.t.stats.abandoned; + // the slot takes a whole prompt again: no kept state of the unfinished ones, the result the reference's + const hits = m.t.stats.hits; + const first = try tg.prefill(0, p, null, p.len); + const st = try stateBytes(&m.t.slots[0]); + defer gpa.free(st); + var toks: [n_decode]u32 = undefined; + try decode(tg, 0, p.len, first, &toks); + tg.release(0); + const sd = diff(st, want.state); + const ok = sd == 0 and std.mem.eql(u32, &toks, &want.toks) and kept == 0 and abandoned == 2 and m.t.stats.hits == hits; + say(ok, "(b) {d} abandoned, {d} entries kept of them, the next prompt: {d} state bytes differ, tokens {s}", .{ abandoned, kept, sd, if (std.mem.eql(u32, &toks, &want.toks)) "equal" else "differ" }); + try testing.expect(ok); +} + +test "dsv41 metal steps: a kept prompt resumed in pieces (a later turn, the whole prompt again) == fresh" { + const p = try ff.ids(gpa, &fs.config(), 500, 77); + defer gpa.free(p); + const more = try ff.ids(gpa, &fs.config(), 300, 78); + defer gpa.free(more); + const turn = try std.mem.concat(gpa, u32, &.{ p, more }); + defer gpa.free(turn); + const want_turn = try reference(turn); + defer want_turn.free(); + const want_p = try reference(p); + defer want_p.free(); + const m = try fs.open(gpa, io, seed, .{ .slots = 1, .drafts = false, .cache_bytes = 1 << 30 }); + defer fs.close(m); + const tg = m.t.target(); + var bad: usize = 0; + // the first prompt in pieces, kept at its finish; then the turn (a partial hit) and the prompt (a whole hit) + for ([_][]const u32{ p, turn, p }, [_]*const Ref{ &want_p, &want_turn, &want_p }, [_]u64{ 0, 500, 500 }) |ids, want, hit| { + const b = try tg.begin(0, ids); + var at = b.at; + while (ids.len - at > 64) : (at += 64) try tg.piece(0, ids, at, at + 64, false); + const first = try tg.finish(0, ids, null, ids.len); + const st = try bytesOf(&m.t.slots[0], false); + defer gpa.free(st); + var toks: [n_decode]u32 = undefined; + try decode(tg, 0, ids.len, first, &toks); + tg.release(0); + // a resumed tail holds only its own rows; a whole hit restores no launch taps: compare KV and taps, or none + const sd = if (b.at == ids.len) 0 else diff(st, want.kv); + const ok = b.at == hit and sd == 0 and std.mem.eql(u32, &toks, &want.toks); + say(ok, "(c) {d} tokens, {d} resumed: {d} state bytes differ, tokens {s}", .{ ids.len, b.at, sd, if (std.mem.eql(u32, &toks, &want.toks)) "equal" else "differ" }); + bad += @intFromBool(!ok); + } + try testing.expectEqual(@as(usize, 0), bad); +} + +test "dsv41 metal steps: two prompts' pieces taking turns at the same positions == each prompt whole" { + const p0 = try ff.ids(gpa, &fs.config(), 600, 79); + defer gpa.free(p0); + const p1 = try ff.ids(gpa, &fs.config(), 600, 80); + defer gpa.free(p1); + const w0 = try reference(p0); + defer w0.free(); + const w1 = try reference(p1); + defer w1.free(); + const m = try fs.open(gpa, io, seed, .{ .slots = 2, .drafts = false }); + defer fs.close(m); + const tg = m.t.target(); + var bad: usize = 0; + // 64-row pieces (the chunk): each piece's next chunk is prepared ahead, then the other slot's piece runs + for ([_]u64{ 64, 100 }) |rows| { + const ps = [2][]const u32{ p0, p1 }; + for (ps, 0..) |p, i| _ = try tg.begin(@intCast(i), p); + var at: u64 = 0; + while (p0.len - at > rows) : (at += rows) for (ps, 0..) |p, i| try tg.piece(@intCast(i), p, at, at + rows, false); + var firsts: [2]u32 = undefined; + for (ps, &firsts, 0..) |p, *f, i| f.* = try tg.finish(@intCast(i), p, null, p.len); + for (ps, firsts, [2]*const Ref{ &w0, &w1 }, 0..) |p, f, w, i| { + const st = try stateBytes(&m.t.slots[i]); + defer gpa.free(st); + var toks: [n_decode]u32 = undefined; + try decode(tg, @intCast(i), p.len, f, &toks); + const sd = diff(st, w.state); + const same = std.mem.eql(u32, &toks, &w.toks); + say(sd == 0 and same, "(d) {d}-row pieces taking turns, slot {d}: {d} state bytes differ, tokens {s}", .{ rows, i, sd, if (same) "equal" else "differ" }); + bad += sd + @intFromBool(!same); + tg.release(@intCast(i)); + } + } + try testing.expectEqual(@as(usize, 0), bad); +} diff --git a/zig/tests/fixtures/gradient-serving.tsv b/zig/tests/fixtures/gradient-serving.tsv index e8894409cc3..2fa4cd4c142 100644 --- a/zig/tests/fixtures/gradient-serving.tsv +++ b/zig/tests/fixtures/gradient-serving.tsv @@ -18,18 +18,18 @@ zig/kernels/cuda/flashnext_mtp.cu 5d213b1b4a1d0588eea3acb4633a0c8bc4d9bdf6f27485 zig/kernels/cuda/fp8_experts.cu 156aa7337b41c67d200d8b58a24422cc96cfa032c9fd0711080f09ddc733baee raw zig/kernels/cuda/gdn.cu e5ef9dcce75c478e59e476d2fa8747baee2317bd283b0756f125ea050dad9228 raw zig/kernels/cuda/glm_glue.cu 74e69a7c20827d498c190334fffaa896f2a4f05e107fdf9d2d34b09b55a1c75c raw #2722 (one added line, the include of glm_index_decode.cuh: the decode select's scan and merge) -zig/kernels/cuda/glm_glue_attn.cuh abecbecf809292c0f82294fa688e47e574fa43c8ff3b1497966f9d3dd52b9881 raw main 42735f94f0 (#2335: MLA bodies to common/mla.cuh; glm_glue SASS identical on five SMs) -zig/kernels/cuda/glm_glue_bmm.cuh 7fbaaa4517e309b17ebb41f84f94f9a939baa27a2fb5c9a6b7f5b857b5a21391 raw -zig/kernels/cuda/glm_glue_hc.cuh c3aa26475c6ce05d2508c300c8e88d429adea4c0c173e3909734bb0ece06da2a raw -zig/kernels/cuda/glm_glue_index.cuh 73fbdf6dea2cfc13275169ac2e7ea4d670611145c1e738529a05b23d63f39abf raw -zig/kernels/cuda/glm_glue_latent.cuh 4d4c7872b6383d5a4e2194b2ea0e477948ba3ff482c3aeb364838f3df0aa6ab5 raw -zig/kernels/cuda/glm_glue_moe.cuh 163d542c99f6ef0432956f6341df324c85568127b623e301ad29279bbb49128c raw -zig/kernels/cuda/glm_glue_norm.cuh 7efd71df53fbf664d2f6d13b8aa7a9f0483f50f3d26574360d7ad8f4361cd453 raw +zig/kernels/cuda/glm_glue_attn.cuh a8c16ed0c54130689d19386de84217aac232c007effafdb6c7fc149ac7188051 raw main 42735f94f0 (#2335: MLA bodies to common/mla.cuh; glm_glue SASS identical on five SMs); dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_bmm.cuh 6077ea47fc9f462f072a973d44ef4cab711526a3f374cfeb91f1cd65f5fad8f9 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_hc.cuh 0fc7a68598eb22884edf28d39d051399e85e2e3e13fd45953c8d3faf5defd3b8 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_index.cuh ed61d03673005220aeebc43a1da5e5701566fcd5e89fee5d21d3830b20cf73ec raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_latent.cuh 67964ea6596deae54f52a8a365850c3a19dab75160cb9582d7bbeaff5d896f5a raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_moe.cuh 474148b5bf8f6d4d83a4a205ae90d0d347f2a40f1f8093fe1b2508282d0d86b7 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_glue_norm.cuh a3664d9833c17ff4718b7342c529ddd7fa958cbc51a8ffac9b7fab508afbcf92 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) zig/kernels/cuda/glm_glue_router.cuh 99911df38e6ad2826491b3fa5efd47aea5e54eebb7cd83eed586ba0dd9305658 raw -zig/kernels/cuda/glm_glue_rows.cuh 0e70ddc8f3d3d91bd09a3643599bd3dc4cf98b9959ea03f8105ee84755440b2f raw -zig/kernels/cuda/glm_kda.cu 73e8ed722c69447232e4a5f0edf2c5245fee82f5b9c0c550ec516a035e550b57 raw #2142: the KDA chain and saved-row replay moved to common/kda.cuh; SASS identical on sm_80/86/89/120/121 (5,465 functions) -zig/kernels/cuda/glm_ops.cu 3c96e09f3e650a516d2685125f5603f4fd8877f54f2a16430a44fd717c1a6667 raw -zig/kernels/cuda/glm_quant.cu e27379a4192be52f390ad28f678157d592989af45b69d31f830671b2c54ca028 raw +zig/kernels/cuda/glm_glue_rows.cuh 8d22166c33ce75fb2dfe5383694a8503044613420d7a06e90e6d1a0b88c197b2 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_kda.cu aef9f980f8a928f2b6c439c7e1eda499fba12c32a7605e39062bef83952a83d2 raw #2142: the KDA chain and saved-row replay moved to common/kda.cuh; SASS identical on sm_80/86/89/120/121 (5,465 functions); dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) +zig/kernels/cuda/glm_ops.cu bf90d5eeb62c145d8a140db90e057fa53d3c1f6b77f739d14122a0e04a216b51 raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh); dependent-launch inputs without __restrict__ (no non-coherent load above the wait) +zig/kernels/cuda/glm_quant.cu e04ee0760ddd215244117bbf113f625ce2e9da3eef04345eb0741e1cd2c876ea raw dependent launches: each kernel opens with glm_pdl::enter() (glm_pdl.cuh) zig/kernels/cuda/glm_triton.cuh 8eee12f24bbf283a08a29f9396e3db5588b48fce85abe74de7f85adc12fa94f4 raw zig/kernels/cuda/common/glue_math.cuh b7234684fc786b3700473358632bf10f0b2d2240e5957eefddb13254dae5d746 raw zig/kernels/cuda/lane_gemv.cu dba5aae94115571ed48933d80f646fff31b2a7da226569867c74a1dc061d2ca2 raw @@ -48,15 +48,15 @@ zig/kernels/cuda/nvfp4_experts.cu cb54357e2c06252cc594cd1223401170dadefd995b0c67 zig/kernels/cuda/nvfp4q.cuh 5fe4fa58568f2293bb72ccfa58b362ba2783b21a781e56946a5a2c328303d111 raw zig/kernels/cuda/prefill_attention.cu 905fff2c9018d778557a60ed2c81c24ce220adf5b092c8c32f8a1782963f9f28 raw main 82f3dde92 (pattn_kernel<64, 8, 4, 8> over paged caches), 94a9a48d6 (helpers to prefill_attention.cuh, SASS unchanged), 191061381 (#2609: two new pattn_kernel instances at two query heads a block, head dims 128 and 64; existing instances unchanged) zig/kernels/cuda/prefill_attention_rows.cuh 21975248a7ec9efd199a28324bba837e7b78f066a63b426ab26587cba38fda5e raw main 94a9a48d6 (helpers shared with the contract controls, SASS unchanged) -zig/kernels/cuda/probe.cu c5a6ca4513311d25282866de2185a056ec9746443a13094db80de62f7474255a raw +zig/kernels/cuda/probe.cu 94a3118894b3066e0f0f6fc1cfc3c03828d291077cb26c437b62fcc9b177a210 raw glm-pdl-order's slow writer, planted early reader and glm_pdl::enter() reader zig/kernels/cuda/prompt16.cu 2da3c4ea23de0fa9b2536db0fa66f07bb2d5b45db36c2f9cb321e039ebeac7c2 raw #3252: the lean gate/up SwiGLU pair launch for a dense MLP prompt zig/kernels/cuda/qmm.cu a55a9d00d9097c5f5bd88c8c538a0481fe13b37badd2e3faf4cdde9c86c9f93d raw zig/kernels/cuda/common/qmm_frag.cuh 418dce9d64df0b8751c8ca982ae3f93c5fc54e4aecb9a8df3f0780129dcb675a raw zig/kernels/cuda/common/router_tiles.cuh aab559bf104e3f47344deaa9ae10622b6962b8a77b398f572ba974055dfafd3c raw zig/kernels/cuda/common/router_mma.cuh 3aca244a38f2e4b4f28bf74f333f384b1060b764c25b004cef4e6c636e7cc1dd raw zig/kernels/cuda/qmm_group.cu 8780fd710be3ce2f04e53fa1e69eb062809d3bec6391d9bd49983d0588e374d0 raw -zig/kernels/cuda/qmm_prefill.cu 45ab2be277c7c17e6cdc6041db45611f2554c6e88f09a295e88751b1c51be1f5 raw -zig/kernels/cuda/qmmf.cu 13a3cb0b6dec56afeb1f248f0cfe39e2d4d458f2b08272c26adb92fe3efba8fc raw main ec76abd45 (128-row BF16 prompt tile, bytes unchanged), c3acc3466 (K32 staging, bytes unchanged), e32de56c6 (#2721: tf_qmmf_native_fp4_check and the e2m1 pair decode behind -Dnative-fp-decode; default builds byte-identical) +zig/kernels/cuda/qmm_prefill.cu e3724114b87cae6f6f761b2f86357f05b1693d84a0233e4d58ce46349fa853f6 raw #2825 hoists copy addresses before the K loop; copy order and math match prefill_kernel +zig/kernels/cuda/qmmf.cu c602528095b4e193ecb6961f518e71f7c6798cd23190d55f731ed7852f4c6c7c raw main ec76abd45 (128-row BF16 prompt tile, bytes unchanged), c3acc3466 (K32 staging, bytes unchanged), e32de56c6 (#2721: tf_qmmf_native_fp4_check and the e2m1 pair decode behind -Dnative-fp-decode; default builds byte-identical); dependent decode launches: weights load before griddepcontrol.wait (TF_QMMF_WFIRST), Lane.pdl zig/kernels/cuda/qwen_vision.cu eeab10300aae424fd957856e4ddba77a3543e9a86bc61701dd09687d7e3b5ea5 raw zig/kernels/cuda/rank_sum.cu 3781c3a4441cfef903c1d0712240ad4d7ab4aaf2d3fb18b323597bcec3587909 raw zig/kernels/cuda/route_rows.cu a2bf267f360cb57257aaef9765d4dca93f68523338b0881d710bbfcb01917dad raw @@ -93,17 +93,17 @@ zig/src/cuda/experts.zig 8bfc2f15a742cceba87dd7eb8e80f3f1b4e3f7eb323b557eb1bb4bf zig/src/cuda/fp8.zig a9caf312cb451dc95572b493e69ae211dd1e8b5be5b2c48cae3febd5d9327143 raw series patches 65-pr-1024.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate zig/src/cuda/graph.zig 17639aaef0298c934b3f5ad3511925169c096ae57ede8ebee655faa838844f7b raw zig/src/cuda/grouped.zig 5fa1f39394b701eab59383bc7ed214ea3e17652a1229236df49f5281e6e764b5 raw commits e1be0806d; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate -zig/src/cuda/kernels.zig ead90d65f23d9b6255ee53d95d41bebce0710d86547e579ce9d588ea12fdd548 raw main 42735f94f0 (#2335: the mla image registered), f35900e60c (#2709: the dots_mocr image registered), #1630 (the experts_bf16 image registered), #2914 (covers: the release SM check), #1631 (the nemo_audio image registered), #1767 (the idol image registered) +zig/src/cuda/kernels.zig 61868f4cfeeb1394b1f21c95032a7e7aee1ecfc65213f50b9e037591bf7bf0c2 raw main 42735f94f0 (#2335: the mla image registered), f35900e60c (#2709: the dots_mocr image registered), #1630 (the experts_bf16 image registered), #2914 (covers: the release SM check), #1631 (the nemo_audio image registered), #1767 (the idol image registered); #1295: the six Muse Spark images registered zig/src/cuda/launch.zig 9ec64848834d82ddcea85a6123e975c95a5ae2bf85c2a71772244794b0bcd705 raw series patches 14-runtime-foundation.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate -zig/src/cuda/memory.zig 7d2a91bfca8a08ae59df16ddf30d22226aba773cc814dd106930840ab344fc52 raw commits 5dcf77d7c, f630f1a90, e9bf05ffd, 881cccaa4, a34cb6ded; series patches 14-runtime-foundation.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate +zig/src/cuda/memory.zig c140f1700e0f257a3ac09b1bfaa4a0d704d1922ccbffc3d453d75be0fef4b617 raw commits 5dcf77d7c, f630f1a90, e9bf05ffd, 881cccaa4, a34cb6ded; series patches 14-runtime-foundation.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate, this change (DeviceBuffer.allocVia allocates through a given hook; alloc is allocVia with the installed one, unchanged) zig/src/cuda/modelopt.zig 648c9ba58197af0ce905f8792383502fc44a52c45d1413fe9e21d28d04c22253 raw zig/src/cuda/module.zig 1f0a141cf7149a87ad456e96cb1830f0c137ad98af70071721918989b0720b92 raw zig/src/cuda/mxfp8.zig 2bbe9ea41b462f633b68e7a32c06814a28e34dee284383788c0a8f06e8df2af4 raw -zig/src/cuda/nccl.zig 30abc4b904e675916e9bb8c4701ca3f1e5615472da4a5e09d2476865d81afe65 raw commits 53abe4556, ba1a9a2bb, 05350da4c, 40dccba55, 6bdb12918, b923e554c, 7c9d845c0, 98a5dc657, 143ed758f, 6636e6964; series patches 14-runtime-foundation.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate +zig/src/cuda/nccl.zig 005a4dd9ed6929b6022c4daff8d8d82c0ee43ea3e468221fd4a8de9ae6dde640 raw commits 53abe4556, ba1a9a2bb, 05350da4c, 40dccba55, 6bdb12918, b923e554c, 7c9d845c0, 98a5dc657, 143ed758f, 6636e6964; series patches 14-runtime-foundation.patch; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate; #3106 (Library.open reads TF_NCCL_LIB through pathFrom, shared with the TP session's settings; unset, empty and blank keep libnccl.so.2) zig/src/cuda/norms.zig c6ac613ff91b31257b5bce55311d8cf38a785862bfad9eb0c7bf0b2ba7b0df95 raw zig/src/cuda/nvfp4.zig 0556e93c12e4eb21db45d0d9d9ee7d4c1c4ab6a32a359b67edfc0b4b7fb90928 raw #3252: launcher for the lean SwiGLU pair zig/src/cuda/qlinear.zig 680c653d110b53e52918bb13f7c54c12ffac4097959319281dc7509c085c062f raw commits da01294e0, 7f6f940eb, 4cec0eba1, c360607f0, ba1a9a2bb, b631fe069, 0a2a1c681, aca5a88e2, c12503be2, 7b17d0eb7, d7e44b555, 59be20e24, d40bc9e8b, f1f7f9abd, 3915bceaf, e8eabc82c; series patches 14-runtime-foundation.patch, 25-mimo-02.patch; MiMo-only aliases omitted from this candidate; HELD: must be re-qualified by the LW device gates on the 1.1.1 candidate -zig/src/cuda/qmmf.zig 760f033510402806cb06e70eec45cfe068bd5cd029315a05c9c8c493c7f12b30 raw main ec76abd45, c3acc3466, fbf8d960d (BF16 prompt tile, Flash Next only), 6a1feb26e (TF_QMMF_HALF_BELOW refused by name) +zig/src/cuda/qmmf.zig 577b24e8dc1a00e975c75075bf9636af55d2614780d05fcb6ed488cc68d37778 raw main ec76abd45, c3acc3466, fbf8d960d (BF16 prompt tile, Flash Next only), 6a1feb26e (TF_QMMF_HALF_BELOW refused by name); dependent decode launches: weights load before griddepcontrol.wait (TF_QMMF_WFIRST), Lane.pdl zig/src/cuda/rank_scatter.zig 303fd707713af732dd1d31c6a940dd4eeed44e9b26fe202919da5925654fc212 raw zig/src/cuda/root.zig 5dbca351bbf6a42cd83d7b615d4e4624809444d7d2e714b1d71d8eec53c6e606 raw main 42735f94f0 (#2335: cuda.mla exported) zig/src/cuda/route_rows.zig e23257dea1f244ebba4399d7bc0730953f75eebbd7789819d5785e88a8907206 raw @@ -115,8 +115,8 @@ zig/src/cuda/tp_watch.zig 19ed1d12bc56f804b5d207d04226e9f6131a517aaf7aec4c4b2d0b zig/src/cuda/triton.zig 256323865c6a4676b8b75aae9e32d2d9732cf2623efedb9462cf6f95302c3e83 raw zig/src/cuda/vit.zig 72c4301251f50d0f25907f0d8ad03a943281b234c506a455e413627a3ffe09c0 raw zig/src/families/flashnext/cuda_attn.zig 99dfe79f919a8599490f1cdba0bec20d6e73ccbeafe26d5848419a465fdfa0d0 raw -zig/src/families/flashnext/cuda_batch.zig 7fa858c564356e9cc80ee50a86602a5d1c1c3d1ef9ef6d0d69b2ac7a8a4b4e5e raw main 42ff6c510f (disk states keyed by the resolved prompt passes; serving unchanged) -zig/src/families/flashnext/cuda_batch_state.zig ae9d16a76aa56cd3448b3414140cbabd2f918bfb69a094b02be82544f371603c raw y and moe_f32 take one spare row for a --tp 2 prompt pass's padded rank block; replies unchanged +zig/src/families/flashnext/cuda_batch.zig eaf08f697f93041f93d2388b345e90a788398a5cf7bfa7641c63a816c6ac5946 raw main 42ff6c510f (disk states keyed by the resolved prompt passes; serving unchanged); #XXXX: the scratch test's ceiling restated at the 3,072-row default +zig/src/families/flashnext/cuda_batch_state.zig 7e940f58ec4ecba11a657983375e3cfec7492989c6246f037759b8051ce70129 raw y and moe_f32 take one spare row for a --tp 2 prompt pass's padded rank block; replies unchanged; #XXXX: the default prompt chunk is 3,072 rows zig/src/families/flashnext/cuda_collective.zig bf475ffb46b3440fcad280f46e34de25cd22b79ed96a0b587d0869e7451d3519 raw adds sumBlock, the in-place FP32 reduce-scatter with sum's peer check, deadline and abort; no served change on its own zig/src/families/flashnext/cuda_compare_main.zig ade014dfec88f0b386076cdc093ea20710d7bf36c33ff566ca2caf472064695b raw main dfd9ac5ef4 (#2585: the TF_FLASHNEXT_* startup check), c274b45cc1 (the check through the flashnext module) zig/src/families/flashnext/cuda_config.zig 19366ee591270c719fa6f710af0efd4d5a55cfc3e30c923f5ed08771b5c14001 raw @@ -129,9 +129,9 @@ zig/src/families/flashnext/cuda_hc.zig 01f897ac65d6edd2cd6ac76d97cb4d96619c25ffa zig/src/families/flashnext/cuda_head.zig fc6410e8b17d559a12d81fd4bee9ab4e65f6f8b0999796c68baba58efb8fe818 raw zig/src/families/flashnext/cuda_images.zig 5bd8a6c06cb69440522f4392794d9ef52b3760195b97d96f2316b1acac271bd4 raw zig/src/families/flashnext/cuda_images_test.zig df984d54d9de1bb732544785cddf82a124de2a7019041ed1f7483b2a4a2d7c99 raw -zig/src/families/flashnext/cuda_lanes.zig 8578e64c69611c219709f48a4ba646bfd01fa02d793d788ea7e577ae03d07808 raw main 4f6017ced (marks inside the pass), fbca90714 (shared solo-chunk rule, #2391), 80e0fd72c (#2753: non-finite draft rows refused by name; finite rows unchanged), dfd9ac5ef4 (#2585: TF_FLASHNEXT_* read through platform/environment.zig, malformed text refused at startup; valid values keep their meaning), #1953: the ladder's values through snap_intermediate, #3308 (loader host test updates the named startup-refusal expectations; no runtime edit to this pinned file); #3135 (kept_disk renamed kept_view for the shared kept image; no served change) +zig/src/families/flashnext/cuda_lanes.zig b72cee919a557e16f001d2c6a7b77602889f6d41a225e0af4736368aff01aee6 raw main 4f6017ced (marks inside the pass), fbca90714 (shared solo-chunk rule, #2391), 80e0fd72c (#2753: non-finite draft rows refused by name; finite rows unchanged), dfd9ac5ef4 (#2585: TF_FLASHNEXT_* read through platform/environment.zig, malformed text refused at startup; valid values keep their meaning), #1953: the ladder's values through snap_intermediate, #3308 (loader host test updates the named startup-refusal expectations; no runtime edit to this pinned file); #3135 (kept_disk renamed kept_view for the shared kept image; no served change), this change (the page pool opens with the load's device and io, for its arena mapped as pages are used; a new paged stream's first prompt step waits while the arena's thread maps its pieces; paging off: unchanged) zig/src/families/flashnext/cuda_lanes_admission_test.zig 4b8052db793ba81f0e73e1b9bd77b1780bbc4fd550d90976d017da47e76faaa2 raw -zig/src/families/flashnext/cuda_lanes_load.zig 26596c5f9bb0fb01b96cb96b50d51a70cf8ef1ef4f2af91e33e6f4a0c74a6f10 raw main dfd9ac5ef4 (#2585: TF_FLASHNEXT_* read through platform/environment.zig, malformed text refused at startup; valid values keep their meaning), #3467: after load a shard drops its page cache except the n-gram ranges, and the sweep reaches nested shards; tensors and replies are unchanged +zig/src/families/flashnext/cuda_lanes_load.zig abcfaf795d8c895ef04a01c5fd58c97ff43249a5c6cb3da460f8a23a5d5f9bf3 raw main dfd9ac5ef4 (#2585: TF_FLASHNEXT_* read through platform/environment.zig, malformed text refused at startup; valid values keep their meaning), #3467: after load a shard drops its page cache except the n-gram ranges, and the sweep reaches nested shards; tensors and replies are unchanged, this change (the load's device and io handed to the page pool's arena; paging off: unchanged) zig/src/families/flashnext/cuda_lanes_restore_test.zig f9947521a6d9c7d7380ca1b784a93a43b364c6fa5861cad15efd3538d2b8ceff raw zig/src/families/flashnext/cuda_launch.zig f8bebb5ed074e6c8ab8cef667cb01fa2bb1a2b2d6a4d3874a92291390278d9f7 raw exports cuda_moe_exchange.zig for its device test; no served change; #2837 (Flash Next TP=2 graph replay) zig/src/families/flashnext/cuda_media.zig 394601e8a807f5516f501efcaefa6fb3308f392ee322db7296b11c90814f8eea raw diff --git a/zig/tests/glm_pdl_scan.zig b/zig/tests/glm_pdl_scan.zig new file mode 100644 index 00000000000..f66f37de273 --- /dev/null +++ b/zig/tests/glm_pdl_scan.zig @@ -0,0 +1,182 @@ +//! Every GLM kernel opens with glm_pdl::enter() (weight writers: enter_weights), so any GLM launch may be dependent. +const std = @import("std"); +const manifest = @embedFile("files.txt"); +const files = blk: { + @setEvalBranchQuota(1000000); + var out: []const []const u8 = &.{}; + var it = std.mem.tokenizeScalar(u8, manifest, '\n'); + while (it.next()) |f| out = out ++ &[_][]const u8{f}; + break :blk out; +}; + +/// glm_mm's matmul bodies call mm_kernel, which loads weights, then waits (reviewed weight-first placement). +const weight_first = "mm_kernel<"; +/// Kernels that write weights: they wait but let no dependent in early (qmmf and glm_mm read weights first). +const writers = [_][]const u8{ "glm_mm_tile4", "glm_mm_tile6", "glm_mm_tile8", "glm_mm_tile16", "tf_glm_nvfp4_amax", "tf_glm_nvfp4_quantize", "tf_glm_quantize4" }; + +const open_c = "/" ++ "*"; // a C block comment's ends, spelled apart +const close_c = "*" ++ "/"; + +const Problem = struct { name: []const u8, why: []const u8 }; + +fn ident(c: u8) bool { + return std.ascii.isAlphanumeric(c) or c == '_' or c == '#'; +} + +/// The index past a comment or a string or character literal starting at `k`, or null when none starts there. +fn skip(s: []const u8, k: usize) ?usize { + const rest = s[k..]; + if (std.mem.startsWith(u8, rest, "//")) return std.mem.indexOfScalarPos(u8, s, k, '\n') orelse s.len; + if (std.mem.startsWith(u8, rest, open_c)) return if (std.mem.indexOfPos(u8, s, k + 2, close_c)) |e| e + 2 else s.len; + if (rest.len > 0 and (rest[0] == '"' or rest[0] == '\'')) { + var e = k + 1; + while (e < s.len and s[e] != rest[0]) e += if (s[e] == '\\') 2 else 1; + return @min(e + 1, s.len); + } + return null; +} + +/// The index of the bracket closing the one at `i` (comments and literals skipped), or null when unbalanced. +fn close(s: []const u8, i: usize, open: u8, shut: u8) ?usize { + var depth: usize = 0; + var k = i; + while (k < s.len) { + if (skip(s, k)) |next| { + k = next; + continue; + } + if (s[k] == open) depth += 1 else if (s[k] == shut) { + depth -= 1; + if (depth == 0) return k; + } + k += 1; + } + return null; +} + +/// A body's text with macro line breaks, line comments and leading space dropped. +fn opening(a: std.mem.Allocator, body: []const u8) ![]const u8 { + var out: std.ArrayList(u8) = .empty; + var k: usize = 0; + while (k < body.len) { + if (body[k] == '\\' and k + 1 < body.len and body[k + 1] == '\n') { + k += 2; + } else if (body[k] == '/' and k + 1 < body.len and body[k + 1] == '/') { + while (k < body.len and body[k] != '\n') k += 1; + } else { + try out.append(a, body[k]); + k += 1; + } + } + return std.mem.trimStart(u8, out.items, " \t\r\n"); +} + +fn isWriter(name: []const u8) bool { + for (writers) |w| if (std.mem.eql(u8, w, name)) return true; + return false; +} + +/// The kernels in `src` whose bodies break the rule; `kernels` counts every definition seen. +pub fn scan(a: std.mem.Allocator, src: []const u8, problems: *std.ArrayList(Problem), kernels: *usize) !void { + var at: usize = 0; + while (std.mem.indexOfPos(u8, src, at, "__global__")) |g| { + at = g + "__global__".len; + const line = src[(if (std.mem.lastIndexOfScalar(u8, src[0..g], '\n')) |n| n + 1 else 0)..g]; + if (std.mem.indexOf(u8, line, "//") != null) continue; + var i = at; + var name: []const u8 = ""; + while (i < src.len and src[i] != '(') { + if (ident(src[i])) { + const start = i; + while (i < src.len and ident(src[i])) i += 1; + const tok = src[start..i]; + if (std.mem.eql(u8, tok, "__launch_bounds__")) { + const p = std.mem.indexOfScalarPos(u8, src, i, '(') orelse return error.Unparsed; + i = (close(src, p, '(', ')') orelse return error.Unparsed) + 1; + } else name = tok; + } else if (src[i] == '<') { + i = (close(src, i, '<', '>') orelse return error.Unparsed) + 1; + } else i += 1; + } + const params_end = close(src, i, '(', ')') orelse return error.Unparsed; + var k = params_end + 1; + while (k < src.len and src[k] != '{' and src[k] != ';') k = skip(src, k) orelse k + 1; + if (k >= src.len or src[k] == ';') continue; // a declaration or an explicit instantiation + const end = close(src, k, '{', '}') orelse return error.Unparsed; + kernels.* += 1; + const head = try opening(a, src[k + 1 .. end]); + const writer = isWriter(name); + if (std.mem.startsWith(u8, head, weight_first)) continue; + if (writer and std.mem.startsWith(u8, head, "glm_pdl::enter_weights();")) continue; + if (!writer and std.mem.startsWith(u8, head, "glm_pdl::enter();")) continue; + try problems.append(a, .{ .name = name, .why = if (writer) "a weight writer must open with glm_pdl::enter_weights();" else "must open with glm_pdl::enter();" }); + } +} + +/// A weight-first prologue between `from` and `to`: its weight loads before grid_wait(), its input loads only after. +fn prologue(src: []const u8, from: []const u8, to: []const u8, weights: []const u8, inputs: []const u8) bool { + const a = std.mem.indexOf(u8, src, from) orelse return false; + const b = std.mem.indexOfPos(u8, src, a, to) orelse return false; + const seg = src[a..b]; + const w = std.mem.indexOf(u8, seg, "grid_wait();") orelse return false; + const before = seg[0..w]; + return std.mem.indexOf(u8, before, weights) != null and std.mem.indexOf(u8, before, inputs) == null and + std.mem.indexOf(u8, seg[w..], inputs) != null; +} + +/// The weight copies between `from` and the lambda's end name no input row (`x`, `ldx`): they may run before the wait. +fn weightsOnly(src: []const u8, from: []const u8) bool { + const a = std.mem.indexOf(u8, src, from) orelse return false; + const b = std.mem.indexOfPos(u8, src, a, "\n };") orelse return false; + var it = std.mem.tokenizeAny(u8, src[a..b], " \t\n()[]{}<>,;:+-*/&|!=?."); + while (it.next()) |t| if (std.mem.eql(u8, t, "x") or std.mem.eql(u8, t, "ldx")) return false; + return true; +} + +fn problemsIn(src: []const u8) !usize { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + var problems: std.ArrayList(Problem) = .empty; + var n: usize = 0; + try scan(arena.allocator(), src, &problems, &n); + return problems.items.len; +} + +test "GLM kernels: every body opens with the dependency wait" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + var problems: std.ArrayList(Problem) = .empty; + var kernels: usize = 0; + inline for (files) |file| { + const before = problems.items.len; + try scan(arena.allocator(), @embedFile(file), &problems, &kernels); + for (problems.items[before..]) |p| std.debug.print("{s}: {s} {s}\n", .{ file, p.name, p.why }); + } + try std.testing.expect(kernels >= 100); + try std.testing.expectEqual(@as(usize, 0), problems.items.len); +} + +test "weight-first prologues: weights before the wait, the kernel before's outputs only after it" { + try std.testing.expect(prologue(@embedFile("glm_mm.cu"), "grid_launch();", "for (int it", "loadW(", "loadX(")); + try std.testing.expect(prologue(@embedFile("qmmf_body.cuh"), "#ifdef TF_QMMF_WFIRST", "#else", "load(s, g0 + s, 2)", "load(s, g0 + s, 1)")); + try std.testing.expect(!prologue("grid_launch(); loadX(0); grid_wait(); loadW(0); for (int it", "grid_launch();", "for (int it", "loadW(", "loadX(")); + try std.testing.expect(!prologue("grid_launch(); loadW(0); loadX(0); grid_wait(); loadX(1); for (int it", "grid_launch();", "for (int it", "loadW(", "loadX(")); + try std.testing.expect(weightsOnly(@embedFile("glm_mm.cu"), "auto loadW = [&]")); + try std.testing.expect(weightsOnly(@embedFile("qmmf_body.cuh"), "if (!(what & 2)) return;")); + try std.testing.expect(!weightsOnly("auto loadW = [&](int st) { cp16(pw, x + st * 8);\n };", "auto loadW = [&]")); + try std.testing.expect(!weightsOnly("if (!(what & 2)) return; cp16(pw, w + row * ldx);\n };", "if (!(what & 2)) return;")); +} + +test "GLM kernels: late, conditional and missing waits fail; a macro body and a writer pass" { + try std.testing.expectEqual(@as(usize, 1), try problemsIn("extern \"C\" __global__ void tf_glm_a(int* x) {\n int v = x[0];\n glm_pdl::enter();\n x[1] = v;\n}\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("extern \"C\" __global__ void tf_glm_b(int* x, int c) {\n if (c) glm_pdl::enter();\n x[0] = 1;\n}\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("extern \"C\" __global__ void __launch_bounds__(128) tf_glm_c(int* x) { x[0] = 1; }\n")); + try std.testing.expectEqual(@as(usize, 0), try problemsIn("#define K(NAME) \\\n extern \"C\" __global__ void NAME(int* x) { glm_pdl::enter(); \\\n x[0] = 1; \\\n }\n")); + try std.testing.expectEqual(@as(usize, 0), try problemsIn("extern \"C\" __global__ void glm_mm_tile4(int* x) {\n // the tiles\n glm_pdl::enter_weights();\n x[0] = 1;\n}\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("extern \"C\" __global__ void glm_mm_tile6(int* x) {\n glm_pdl::enter();\n x[0] = 1;\n}\n")); + try std.testing.expectEqual(@as(usize, 0), try problemsIn("template __global__ void k<1>(int*);\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("__global__ void tf_glm_d(int* x) " ++ open_c ++ " shape; " ++ close_c ++ " { x[0] = 1; }\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("__global__ void tf_glm_e(int* x) // shape; rows\n{\n x[0] = 1;\n}\n")); + try std.testing.expectEqual(@as(usize, 1), try problemsIn("__global__ void tf_glm_f(int* x " ++ open_c ++ " output); " ++ close_c ++ ") { x[0] = 1; }\n")); + try std.testing.expectEqual(@as(usize, 0), try problemsIn("__global__ void tf_glm_g(int* x) {\n glm_pdl::enter();\n asm volatile(\"{ .reg .u32 r; }\" ::: \"memory\");\n}\n")); +} diff --git a/zig/tests/hip/contract_exl3.zig b/zig/tests/hip/contract_exl3.zig new file mode 100644 index 00000000000..9a181bdcf3b --- /dev/null +++ b/zig/tests/hip/contract_exl3.zig @@ -0,0 +1,437 @@ +//! EXL3's decode-row kernels under the contract on HIP: rot_in and the linear at each width, against float64. +const std = @import("std"); +const hip = @import("hip"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); + +const contract = core.contract; +const c = contract.spec; +const g = contract.gates; +const fmt = core.exl3_format; +const exl3 = hip.launches.exl3; + +/// What a registration launches; a control runs its kind's kernel with one planted fault and must go red at gate 3. +pub const Reg = struct { rot: bool = false, halves: u32 = 8, bf16_out: bool = false, control: bool = false }; + +/// rot_in, the linear at every width with fp32 out (the head's) and at 4 bits with bf16 out, then a control of each. +pub const registrations = blk: { + var list: [exl3.widths.len + 4]Reg = undefined; + list[0] = .{ .rot = true }; + for (exl3.widths, 1..) |h, i| list[i] = .{ .halves = h }; + list[exl3.widths.len + 1] = .{ .bf16_out = true }; + list[exl3.widths.len + 2] = .{ .rot = true, .control = true }; + list[exl3.widths.len + 3] = .{ .control = true }; + break :blk list; +}; + +/// Whole 128-wide blocks from one block up: K and N of the linear. +const blocks: c.Tile = .{ .size = 128, .step = 128, .min = 128 }; + +fn sh(rows: usize, n: usize, k: usize) c.Shape { + return .{ .rows = rows, .n = n, .k = k }; +} + +// deepseek_v41's indexer wk (16, 64, 1 rows), gate 4's (Engram's K, one block), Engram's wkv, the 8-wave edge, below it +const linear_shapes = [_]c.Shape{ + sh(16, 128, 512), sh(64, 128, 512), sh(1, 128, 512), sh(1, 128, 6144), + sh(4, 25600, 6144), sh(4, 8192, 1024), sh(16, 8192, 1024), sh(4, 8064, 1024), +}; +// the head, 5120 to 129,280 at one row, registered at 8 bits: N sets only the grid +const head_shapes = linear_shapes ++ [_]c.Shape{sh(1, 129280, 5120)}; +// rot_in: n is a row's width (each output sums 128 terms); the same calls' inputs +const rot_shapes = [_]c.Shape{ sh(64, 512, 128), sh(16, 6144, 128), sh(2, 5120, 128) }; + +/// A K sum in any order, a wave's chain and the waves', then the output rotation's seven butterflies. +fn depth(s: c.Shape) usize { + return s.k + 64; +} + +/// The product x * suh, then seven butterflies. +fn rotDepth(_: c.Shape) usize { + return 8; +} + +const rot_why = "128-term rotations of bf16 inputs: fp32 is not exact on them, so gate 4 proves fp16's miss alone"; +const bf16_why = "bf16 outputs hide a bf16 sum's miss on these inputs; the fp32-output registrations prove fp32 sums"; + +fn name(r: Reg) []const u8 { + if (r.control and r.rot) return "control: tf_exl3_rot_in reads the next block's suh"; + if (r.control) return "control: tf_exl3_linear reads its input rows one row late"; + if (r.rot) return "hip exl3 tf_exl3_rot_in (bf16 rows to fp16)"; + inline for (exl3.widths) |h| if (h == r.halves) { + const fmt_ = "hip exl3 tf_exl3_linear_k{d}_w4 / _w8 ({d}-bit, 1-64 rows, {s} out)"; + if (r.bf16_out) return std.fmt.comptimePrint(fmt_, .{ h, h / 2, "bf16" }); + return std.fmt.comptimePrint(fmt_, .{ h, h / 2, "fp32" }); + }; + unreachable; +} + +pub fn spec(r: Reg) c.Spec { + if (r.rot) return .{ + .name = name(r), + .accum = .f32, + .depth = rotDepth, + .ops = 2, + .out = .f16, + .tiles = .{ .{}, .{ .size = 512, .step = 128, .min = 128 }, .{} }, + .served = &rot_shapes, + .sums = .{ .f16 = 4, .bf16 = 0, .exact = false, .why = rot_why }, + }; + return .{ + .name = name(r), + .accum = .f32, + .depth = depth, + .ops = 3, + .out = if (r.bf16_out) .bf16 else .f32, + .tiles = .{ .{ .size = 16 }, blocks, blocks }, + .served = if (r.halves == 16 and !r.bf16_out and !r.control) &head_shapes else &linear_shapes, + .sums = if (r.bf16_out) .{ .bf16 = 0, .why = bf16_why } else .{}, + }; +} + +pub const Case = struct { + rig: rig_.Rig, + l: *const hip.Launcher, + reg: Reg, + shape: c.Shape = undefined, + /// rot_in: x (bf16) and suh; the linear: xh (fp16), svh and the trellis in the checkpoint's layout + x: []u16 = &.{}, + scale: []u16 = &.{}, + trellis: []i16 = &.{}, + dx: u64 = 0, + dscale: u64 = 0, + dt: u64 = 0, + out: u64 = 0, + + pub fn init(a: std.mem.Allocator, rt: *const hip.Runtime, s: hip.Stream, l: *const hip.Launcher, reg: Reg) Case { + return .{ .rig = .{ .a = a, .r = rt, .s = s }, .l = l, .reg = reg }; + } + + pub fn deinit(self: *Case) void { + self.free(); + self.rig.deinit(); + } + + fn free(self: *Case) void { + self.rig.a.free(self.x); + self.rig.a.free(self.scale); + self.rig.a.free(self.trellis); + self.x = &.{}; + self.scale = &.{}; + self.trellis = &.{}; + } + + pub fn kernel(self: *Case) g.Kernel { + return .{ .spec = spec(self.reg), .ctx = self, .vt = &vt, .control = if (self.reg.control) .shapes else null }; + } + + const vt = g.hooks(Case); + + fn random16(rng: std.Random, out: []u16) void { + for (out) |*v| v.* = @bitCast(@as(f16, @floatCast(rng.float(f32) * 2 - 1))); + } + + /// Random inputs; non-finite: row 1's NaN, row 2's +Inf and -Inf; stress: see each kind's branch. + pub fn prepare(self: *Case, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + const k = if (self.reg.rot) shape.n else shape.k; + if (!exl3.fits(shape.rows, k, if (self.reg.rot) 128 else shape.n)) return false; + self.free(); + self.rig.reset(); + self.shape = shape; + const a = self.rig.a; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + // a control reads one block (suh) or one row (xh) past the call's own, so those inputs carry one more + const extra_rows: usize = @intFromBool(self.reg.control and !self.reg.rot); + self.x = try a.alloc(u16, (shape.rows + extra_rows) * k); + const scales = if (self.reg.rot) k else shape.n; + self.scale = try a.alloc(u16, scales + if (self.reg.control) @as(usize, 128) else 0); + random16(rng, self.scale); + if (self.reg.rot) { + for (self.x) |*v| v.* = c.toBf16(rng.float(f32) * 2 - 1); + // stress: inputs to 64, as CUDA's rot_group (fp32 is not exact on 128-term rotations of them) + if (fill == .stress) for (self.x) |*v| { + v.* = c.toBf16(c.fromBf16(v.*) * 64); + }; + } else { + const w = fmt.Width{ .halves = @intCast(self.reg.halves) }; + self.trellis = try a.alloc(i16, (k / 16) * (shape.n / 16) * w.tileWords()); + random16(rng, self.x); + rng.bytes(std.mem.sliceAsBytes(self.trellis)); + // stress: all-ones states (one weight, -0.651), svh 1, xh 4096: K equal terms past fp16's range + if (fill == .stress) { + @memset(self.trellis, @bitCast(@as(u16, 0xffff))); + @memset(self.scale, 0x3c00); + @memset(self.x, @bitCast(@as(f16, 4096))); + } + self.dt = try self.rig.input(std.mem.sliceAsBytes(self.trellis)); + } + const nan: u16 = if (self.reg.rot) 0x7fc0 else 0x7e00; + const inf: u16 = if (self.reg.rot) 0x7f80 else 0x7c00; + if (fill == .nonfinite and shape.rows > 2) { + self.x[k + 3] = nan; + self.x[2 * k + 5] = inf; + self.x[2 * k + 9] = inf | 0x8000; + } + self.dx = try self.rig.input(std.mem.sliceAsBytes(self.x)); + self.dscale = try self.rig.input(std.mem.sliceAsBytes(self.scale)); + self.out = try self.rig.output(self.count() * (if (self.reg.rot or self.reg.bf16_out) @as(usize, 2) else 4)); + return true; + } + + pub fn count(self: *Case) usize { + return self.shape.rows * self.shape.n; + } + + pub fn run(self: *Case) !void { + const s = self.rig.s.handle; + const rows = self.shape.rows; + const fault: u64 = if (self.reg.control) 1 else 0; + if (self.reg.rot) { + try exl3.rotIn(self.l, self.dx, 2, self.dscale + fault * 128 * 2, self.out, rows, self.shape.n, s); + } else { + const k = self.shape.k; + const w = fmt.Width{ .halves = @intCast(self.reg.halves) }; + const tw: u64 = w.tileWords() / 2; + const t: exl3.Trellis = .{ + .words = self.dt, + .halves = self.reg.halves, + .stride_k = (self.shape.n / 16) * tw, + .stride_nb = 8 * tw, + }; + const kind: c_int = if (self.reg.bf16_out) 2 else 0; + try exl3.linear(self.l, self.dx + fault * k * 2, t, self.dscale, self.out, kind, rows, k, self.shape.n, s); + } + try self.rig.s.synchronize(); + } + + /// Float64 outputs and their terms' magnitude; with `acc`, each output's sums in that accumulator and order. + fn outputs(self: *Case, want: []f64, mag: ?[]f64, acc: ?c.Accum, order: g.Order) !void { + const a = self.rig.a; + const rows = self.shape.rows; + const n = self.shape.n; + if (self.reg.rot) { + // xh[j] = sum over q of H[q][j] / sqrt(128) * x[q] suh[q], block by block + const h = try a.alloc(f64, 128 * 128); + defer a.free(h); + @memset(h, 0); + for (0..128) |q| h[q * 128 + q] = 1; + fmt.rotate(h, 128, 128, 1); + var t: [128]f64 = undefined; + for (0..rows) |r| for (0..n / 128) |b| for (0..128) |j| { + var abs: f64 = 0; + for (&t, 0..) |*e, q| { + const i = b * 128 + q; + e.* = h[q * 128 + j] * c.fromBf16(self.x[r * n + i]) * half(self.scale[i]); + abs += @abs(e.*); + } + want[r * n + b * 128 + j] = if (acc) |ac| contract.rows.sumIn(ac, order, &t) else sum(&t); + if (mag) |m| m[r * n + b * 128 + j] = abs; + }; + return; + } + const k = self.shape.k; + const wq = try a.alloc(f16, k * n); + defer a.free(wq); + Unpack.all(self.reg.halves, self.trellis, k, n, wq); + const s1 = try a.alloc(f64, rows * n); + defer a.free(s1); + if (acc) |ac| { + const t = try a.alloc(f64, threads.maximum * k); + defer a.free(t); + const sims: Sims.Args = .{ .x = self.x, .wq = wq, .rows = rows, .k = k, .n = n, .acc = ac, .order = order }; + Sims.all(sims, t, want[0 .. rows * n]); + } else Sums.all(self.x, wq, rows, k, n, want[0 .. rows * n], s1); + rotate(want[0 .. rows * n], rows, n); + for (0..rows) |r| for (0..n) |j| { + const sc = half(self.scale[j]); + want[r * n + j] *= sc; + if (mag) |m| { + var s: f64 = 0; + for (j / 128 * 128..j / 128 * 128 + 128) |q| s += s1[r * n + q]; + m[r * n + j] = @abs(sc) * s / @sqrt(128.0); + } + }; + } + + /// Each row's 128-wide blocks through the unscaled butterflies, then the scale: exact where K sums are integers. + fn rotate(x: []f64, rows: usize, n: usize) void { + for (0..rows * n / 128) |b| { + const v = x[b * 128 ..][0..128]; + var d: usize = 1; + while (d < 128) : (d *= 2) { + var base: usize = 0; + while (base < 128) : (base += 2 * d) for (0..d) |j| { + const lo = v[base + j]; + const hi = v[base + j + d]; + v[base + j] = lo + hi; + v[base + j + d] = lo - hi; + }; + } + for (v) |*e| e.* /= @sqrt(128.0); + } + } + + fn sum(t: []const f64) f64 { + var s: f64 = 0; + for (t) |v| s += v; + return s; + } + + pub fn reference(self: *Case, want: []f64, mag: []f64) !void { + return self.outputs(want, mag, null, .sequential); + } + + pub fn simulate(self: *Case, acc: c.Accum, order: g.Order, out: []f64) !void { + return self.outputs(out, null, acc, order); + } +}; + +const threads = contract.reference_threads; + +/// W decoded as exl3_format's unpack does, by slices of K tiles on threads. +const Unpack = struct { + halves: u32, + trellis: []const i16, + n: usize, + tk0: usize, + tk1: usize, + wq: []f16, + + pub fn run(j: *Unpack) void { + const w = fmt.Width{ .halves = @intCast(j.halves) }; + const row = w.tileWords() * (j.n / 16); + const words = j.trellis[j.tk0 * row .. j.tk1 * row]; + fmt.unpack(w, .mul1, words, j.tk1 - j.tk0, j.n / 16, j.wq[j.tk0 * 16 * j.n .. j.tk1 * 16 * j.n]); + } + + fn all(halves: u32, trellis: []const i16, k: usize, n: usize, wq: []f16) void { + const count = threads.count(threads.maximum, k / 16); + var jobs: [threads.maximum]Unpack = undefined; + for (jobs[0..count], 0..) |*j, i| j.* = .{ + .halves = halves, + .trellis = trellis, + .n = n, + .tk0 = i * (k / 16) / count, + .tk1 = (i + 1) * (k / 16) / count, + .wq = wq, + }; + threads.run(Unpack, jobs[0..count], .normal); + } +}; + +/// Each output's K sum in float64, in K order, and its terms' magnitude: a range of columns on each thread. +const Sums = struct { + x: []const u16, + wq: []const f16, + rows: usize, + k: usize, + n: usize, + j0: usize, + j1: usize, + want: []f64, + s1: []f64, + + pub fn run(job: *Sums) void { + for (0..job.rows) |r| { + const y = job.want[r * job.n ..][job.j0..job.j1]; + const m = job.s1[r * job.n ..][job.j0..job.j1]; + @memset(y, 0); + @memset(m, 0); + for (0..job.k) |q| { + const xv = half(job.x[r * job.k + q]); + for (y, m, job.wq[q * job.n ..][job.j0..job.j1]) |*e, *s, wv| { + const p = xv * @as(f64, wv); + e.* += p; + s.* += @abs(p); + } + } + } + } + + fn all(x: []const u16, wq: []const f16, rows: usize, k: usize, n: usize, want: []f64, s1: []f64) void { + const count = threads.count(threads.maximum, n / 128); + var jobs: [threads.maximum]Sums = undefined; + for (jobs[0..count], 0..) |*j, i| j.* = .{ + .x = x, + .wq = wq, + .rows = rows, + .k = k, + .n = n, + .j0 = i * (n / 128) / count * 128, + .j1 = (i + 1) * (n / 128) / count * 128, + .want = want, + .s1 = s1, + }; + threads.run(Sums, jobs[0..count], .normal); + } +}; + +/// Gate 4's simulations: each output's K terms summed in an accumulator and order, a range of columns on each thread. +const Sims = struct { + x: []const u16, + wq: []const f16, + rows: usize, + k: usize, + n: usize, + j0: usize, + j1: usize, + acc: c.Accum, + order: g.Order, + t: []f64, + out: []f64, + + pub fn run(job: *Sims) void { + for (0..job.rows) |r| for (job.j0..job.j1) |j| { + for (job.t, 0..) |*e, q| e.* = half(job.x[r * job.k + q]) * @as(f64, job.wq[q * job.n + j]); + job.out[r * job.n + j] = contract.rows.sumIn(job.acc, job.order, job.t); + }; + } + + const Args = struct { + x: []const u16, + wq: []const f16, + rows: usize, + k: usize, + n: usize, + acc: c.Accum, + order: g.Order, + }; + + fn all(a: Args, t: []f64, out: []f64) void { + const count = threads.count(threads.maximum, a.n / 128); + var jobs: [threads.maximum]Sims = undefined; + for (jobs[0..count], 0..) |*j, i| j.* = .{ + .x = a.x, + .wq = a.wq, + .rows = a.rows, + .k = a.k, + .n = a.n, + .j0 = i * (a.n / 128) / count * 128, + .j1 = (i + 1) * (a.n / 128) / count * 128, + .acc = a.acc, + .order = a.order, + .t = t[i * a.k ..][0..a.k], + .out = out, + }; + threads.run(Sims, jobs[0..count], .normal); + } +}; + +fn half(b: u16) f64 { + return @as(f16, @bitCast(b)); +} + +// every served wave count is registered, and the stress sums (K terms of 4096 x -0.6513671875) are integers under 2^24 +comptime { + var four = false; + var eight = false; + var most: usize = 0; + for (linear_shapes) |s| { + if (exl3.waves(s.k, s.n) == 8) eight = true else four = true; + most = @max(most, s.k); + } + if (!four or !eight) @compileError("the linear registrations miss a wave count"); + if (most * 2668 >= 1 << 24 or fmt.codebookValue(.mul1, 0xffff) != -0.6513671875) + @compileError("the linear's stress sums are not exact in fp32"); +} diff --git a/zig/tests/hip/contract_main.zig b/zig/tests/hip/contract_main.zig index 0e476a52483..5455bd716c5 100644 --- a/zig/tests/hip/contract_main.zig +++ b/zig/tests/hip/contract_main.zig @@ -21,6 +21,7 @@ const relu2_k = @import("contract_relu2.zig"); const kv_k = @import("contract_kv_write.zig"); const tap_k = @import("contract_tap.zig"); const draft_k = @import("contract_draft.zig"); +const exl3_k = @import("contract_exl3.zig"); const argmax_k = @import("contract_argmax.zig"); const pair_k = @import("contract_relu2_pair.zig"); const heads_rows_k = @import("contract_heads_rows.zig"); @@ -259,6 +260,10 @@ fn run(a: std.mem.Allocator, io: std.Io) !usize { for (&drafts, draft_modes) |*m, w| m.* = .init(a, &r, s, &l, w); defer for (&drafts) |*m| m.deinit(); for (&drafts) |*m| try kernels.append(a, m.kernel()); + var exl3s: [exl3_k.registrations.len]exl3_k.Case = undefined; + for (&exl3s, exl3_k.registrations) |*m, reg| m.* = .init(a, &r, s, &l, reg); + defer for (&exl3s) |*m| m.deinit(); + for (&exl3s) |*m| try kernels.append(a, m.kernel()); var argmax = argmax_k.Argmax.init(a, &r, s, &l); defer argmax.deinit(); try kernels.append(a, argmax.kernel()); diff --git a/zig/tests/qwen27/attention_fused.zig b/zig/tests/qwen27/attention_fused.zig index 63a394a7a30..f32cff4bed4 100644 --- a/zig/tests/qwen27/attention_fused.zig +++ b/zig/tests/qwen27/attention_fused.zig @@ -385,13 +385,11 @@ pub fn main(init: std.process.Init) !void { defer pool.pop(); const device = try mtl.Device.init(); defer device.deinit(); - if (!device.tensorUnits()) { - std.debug.print("attention_fused: no tensor units on {s}, nothing to check\n", .{std.mem.span(device.name())}); - return; - } const queue = try device.queue(); const args = try init.minimal.args.toSlice(a); - const text = try a.dupe(u8, source.glue ++ source.attention_mpp ++ source.attention_io ++ source.attention_prompt); + // before M5 the prefix and tail kernels read their results in the simdgroup-matrix layout (simd_attention.zig) + if (!device.tensorUnits()) try q.simd_attention.check(device, queue); + const text = try q.simd_attention.library(a, device.tensorUnits(), true); const library = try mtl.Library.fromSource(device, text, mtl.CompileOptions.mlx()); defer library.deinit(); var op = try attn.Attention.init(device, library); @@ -411,7 +409,7 @@ pub fn main(init: std.process.Init) !void { defer scratch.deinit(); var binding = try attn.Binding.init(device, limits); defer binding.deinit(); - // Chips without tensor units plan with shared_prefix off: no prefix kernel, every key through the tail kernel. + // shared_prefix off (before M5: TF_QWEN27_SHARED_PREFIX=0): no prefix kernel, every key through the tail kernel. const plain_limits = attn.Limits{ .rows = round_rows, .streams = 8, .keys = capacity, .shared_prefix = false }; var plain_scratch = try attn.Scratch.init(device, plain_limits); defer plain_scratch.deinit(); diff --git a/zig/tests/qwen27/forward_diff_runner.zig b/zig/tests/qwen27/forward_diff_runner.zig index 84644a8d7aa..2256d9688cb 100644 --- a/zig/tests/qwen27/forward_diff_runner.zig +++ b/zig/tests/qwen27/forward_diff_runner.zig @@ -83,7 +83,7 @@ pub fn verify(comptime S: type, r: *q.decode_round.Runner, round: *const Round, const params = try r.gdn.budget.shape.params(round.ids.len, r.slots, .{ .conv = .bf16, .a_log = .bf16, .dt = .bf16, .norm = .bf16 }); var recurrent = try round.recurrent(params, &.{&.{}}); defer recurrent.deinit(); - var attention = try q.attention.Plan.init(r.allocator, &.{.{ .parents = round.windows[0].parents, .start = round.windows[0].start, .capacity = r.capacity }}, .{ .shared_prefix = r.model.device.tensorUnits() }); + var attention = try q.attention.Plan.init(r.allocator, &.{.{ .parents = round.windows[0].parents, .start = round.windows[0].start, .capacity = r.capacity }}, .{ .shared_prefix = r.geometry.shared_prefix }); defer attention.deinit(); try r.model.frame.setRows(round.ids, round.feed_positions); try r.scratch.upload(attention); diff --git a/zig/tests/server/golden/keys/full-model-id.json b/zig/tests/server/golden/keys/full-model-id.json new file mode 100644 index 00000000000..51b40507539 --- /dev/null +++ b/zig/tests/server/golden/keys/full-model-id.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-alias\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/keys/model-id-none.json b/zig/tests/server/golden/keys/model-id-none.json new file mode 100644 index 00000000000..aa79e9396e1 --- /dev/null +++ b/zig/tests/server/golden/keys/model-id-none.json @@ -0,0 +1,28 @@ +{ + "closed": "closed", + "replies": [ + { + "status": "HTTP/1.1 401 Unauthorized", + "headers": [ + [ + "WWW-Authenticate", + "Bearer" + ], + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "128" + ], + [ + "Connection", + "close" + ] + ], + "body": "{\"error\": {\"message\": \"A valid API key is required\", \"type\": \"invalid_request_error\", \"param\": null, \"code\": \"invalid_api_key\"}}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/alias.json b/zig/tests/server/golden/models/alias.json new file mode 100644 index 00000000000..51b40507539 --- /dev/null +++ b/zig/tests/server/golden/models/alias.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-alias\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/bare.json b/zig/tests/server/golden/models/bare.json new file mode 100644 index 00000000000..5615f3cfa95 --- /dev/null +++ b/zig/tests/server/golden/models/bare.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/served.json b/zig/tests/server/golden/models/served.json new file mode 100644 index 00000000000..5615f3cfa95 --- /dev/null +++ b/zig/tests/server/golden/models/served.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/slash-escaped-lower.json b/zig/tests/server/golden/models/slash-escaped-lower.json new file mode 100644 index 00000000000..947187ea862 --- /dev/null +++ b/zig/tests/server/golden/models/slash-escaped-lower.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "830" + ] + ], + "body": "{\"id\": \"example-org/fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/slash-escaped.json b/zig/tests/server/golden/models/slash-escaped.json new file mode 100644 index 00000000000..947187ea862 --- /dev/null +++ b/zig/tests/server/golden/models/slash-escaped.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "830" + ] + ], + "body": "{\"id\": \"example-org/fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/slash-raw.json b/zig/tests/server/golden/models/slash-raw.json new file mode 100644 index 00000000000..947187ea862 --- /dev/null +++ b/zig/tests/server/golden/models/slash-raw.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "830" + ] + ], + "body": "{\"id\": \"example-org/fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/suffix-lists.json b/zig/tests/server/golden/models/suffix-lists.json new file mode 100644 index 00000000000..598373b6b0c --- /dev/null +++ b/zig/tests/server/golden/models/suffix-lists.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "2500" + ] + ], + "body": "{\"object\": \"list\", \"data\": [{\"id\": \"fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}, {\"id\": \"fake-alias\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}, {\"id\": \"example-org/fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/unknown-escaped.json b/zig/tests/server/golden/models/unknown-escaped.json new file mode 100644 index 00000000000..228ed02a946 --- /dev/null +++ b/zig/tests/server/golden/models/unknown-escaped.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 404 Not Found", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "150" + ] + ], + "body": "{\"error\": {\"message\": \"model 'example-org/missing' is not served here\", \"type\": \"invalid_request_error\", \"param\": \"model\", \"code\": \"model_not_found\"}}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/models/unknown.json b/zig/tests/server/golden/models/unknown.json new file mode 100644 index 00000000000..60bd4707545 --- /dev/null +++ b/zig/tests/server/golden/models/unknown.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 404 Not Found", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "138" + ] + ], + "body": "{\"error\": {\"message\": \"model 'missing' is not served here\", \"type\": \"invalid_request_error\", \"param\": \"model\", \"code\": \"model_not_found\"}}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/scopes/app-model-id.json b/zig/tests/server/golden/scopes/app-model-id.json new file mode 100644 index 00000000000..51b40507539 --- /dev/null +++ b/zig/tests/server/golden/scopes/app-model-id.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-alias\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/scopes/app-model-suffix.json b/zig/tests/server/golden/scopes/app-model-suffix.json new file mode 100644 index 00000000000..2ed39091352 --- /dev/null +++ b/zig/tests/server/golden/scopes/app-model-suffix.json @@ -0,0 +1,24 @@ +{ + "closed": "closed", + "replies": [ + { + "status": "HTTP/1.1 403 Forbidden", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "142" + ], + [ + "Connection", + "close" + ] + ], + "body": "{\"error\": {\"message\": \"This API key does not permit this operation\", \"type\": \"permission_error\", \"param\": null, \"code\": \"insufficient_scope\"}}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/scopes/read-model-id.json b/zig/tests/server/golden/scopes/read-model-id.json new file mode 100644 index 00000000000..5615f3cfa95 --- /dev/null +++ b/zig/tests/server/golden/scopes/read-model-id.json @@ -0,0 +1,20 @@ +{ + "closed": "open", + "replies": [ + { + "status": "HTTP/1.1 200 OK", + "headers": [ + [ + "Content-Type", + "application/json" + ], + [ + "Content-Length", + "818" + ] + ], + "body": "{\"id\": \"fake-model\", \"object\": \"model\", \"created\": , \"owned_by\": \"tensorfold\", \"capabilities\": {\"text_generation\": true, \"context_fitted\": false, \"call_gates\": true, \"loop_guard\": false, \"thinking_budget\": true, \"reasoning\": true, \"answer_limit\": false, \"structures\": false, \"logprobs\": false, \"penalties\": false, \"prompt_logprobs\": false, \"prompt_cache\": false, \"warm_turns\": false, \"plain_only\": false, \"decides\": false, \"pictures\": false, \"greedy_only\": false, \"slide_conversations\": false, \"vision\": false, \"speech\": false, \"embeddings\": false, \"readouts\": false, \"rerank\": false, \"thinking_switch\": true, \"thinking_applicable\": true}, \"context_length\": 1024, \"max_model_len\": 1024, \"reasoning\": {\"default_enabled\": true, \"supported_efforts\": [\"xhigh\", \"medium\", \"low\", \"none\"]}, \"input_types\": [\"text\"]}", + "interim": "" + } + ] +} diff --git a/zig/tests/server/golden/security-cases.json b/zig/tests/server/golden/security-cases.json index 3f6cf794fe5..cbe51132e64 100644 --- a/zig/tests/server/golden/security-cases.json +++ b/zig/tests/server/golden/security-cases.json @@ -1 +1 @@ -{"steps": [{"kind": "serve", "args": ["--api-key", "sk-cli"], "env": {}, "cases": [{"group": "keys", "name": "systemone-none", "raws": [{"b64": "UE9TVCAvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}, {"group": "keys", "name": "systemone-with-key", "raws": [{"b64": "UE9TVCAvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stY2xpDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAxMTANCg0KeyJzdGF0ZSI6IG51bGwsICJxdWVzdGlvbnMiOiB7InEiOiB7InR5cGUiOiAiY2hvaWNlIiwgImluc3RydWN0aW9ucyI6ICJpIiwgImNyaXRlcmlhIjogeyJBIjogImEiLCAiQiI6ICJiIn19fX0="}], "opts": {}}, {"group": "keys", "name": "v1-systemone-none", "raws": [{"b64": "UE9TVCAvdjEvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}, {"group": "keys", "name": "v1-systemone-with-key", "raws": [{"b64": "UE9TVCAvdjEvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stY2xpDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAxMTANCg0KeyJzdGF0ZSI6IG51bGwsICJxdWVzdGlvbnMiOiB7InEiOiB7InR5cGUiOiAiY2hvaWNlIiwgImluc3RydWN0aW9ucyI6ICJpIiwgImNyaXRlcmlhIjogeyJBIjogImEiLCAiQiI6ICJiIn19fX0="}], "opts": {}}, {"group": "keys", "name": "x-systemone-none", "raws": [{"b64": "UE9TVCAveC9zeXN0ZW1vbmUgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluDQpDb250ZW50LUxlbmd0aDogMTEwDQoNCnsic3RhdGUiOiBudWxsLCAicXVlc3Rpb25zIjogeyJxIjogeyJ0eXBlIjogImNob2ljZSIsICJpbnN0cnVjdGlvbnMiOiAiaSIsICJjcml0ZXJpYSI6IHsiQSI6ICJhIiwgIkIiOiAiYiJ9fX19"}], "opts": {}}, {"group": "keys", "name": "x-systemone-with-key", "raws": [{"b64": "UE9TVCAveC9zeXN0ZW1vbmUgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1jbGkNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": [], "env": {}, "cases": [{"group": "origin", "name": "rebind-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHJlYmluZC5pbnZhbGlkDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "cross-origin", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpPcmlnaW46IGh0dHBzOi8vZXZpbC5pbnZhbGlkDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAyDQoNCnt9"}], "opts": {}}, {"group": "origin", "name": "cross-origin-learn", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL2V2aWwuaW52YWxpZA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluDQpDb250ZW50LUxlbmd0aDogMg0KDQp7fQ=="}], "opts": {}}, {"group": "origin", "name": "same-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdDo4MDAwDQpPcmlnaW46IGh0dHA6Ly9sb2NhbGhvc3Q6ODAwMA0KDQo="}], "opts": {}}, {"group": "origin", "name": "no-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IDEyNy4wLjAuMTo5MDAwDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "null-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBudWxsDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "missing-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCg0K"}], "opts": {}}, {"group": "origin", "name": "ipv6-loopback", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IFs6OjFdOjgwDQpPcmlnaW46IGh0dHA6Ly9bOjoxXQ0KDQo="}], "opts": {}}, {"group": "origin", "name": "scheme-mismatch", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL2xvY2FsaG9zdA0KDQo="}], "opts": {}}, {"group": "origin", "name": "duplicate-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KaE9zVDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "origin", "name": "duplicate-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vbG9jYWxob3N0DQpvUmlHaU46IGh0dHA6Ly9sb2NhbGhvc3QNCg0K"}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--allowed-host", "trusted-one.invalid", "--allowed-host=trusted-two.invalid", "--allowed-origin", "https://ui-one.invalid", "--allowed-origin=http://ui-two.invalid:8000"], "env": {}, "cases": [{"group": "origin", "name": "allowed-host-first", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHRydXN0ZWQtb25lLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "allowed-host-second", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHRydXN0ZWQtdHdvLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "allowed-origin-first", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL3VpLW9uZS5pbnZhbGlkOjQ0Mw0KDQo="}], "opts": {}}, {"group": "origin", "name": "allowed-origin-second", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vdWktdHdvLmludmFsaWQ6ODAwMA0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--host", "0.0.0.0"], "env": {}, "cases": [{"group": "origin", "name": "nonloopback-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "nonloopback-cross-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQpPcmlnaW46IGh0dHA6Ly9ldmlsLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "nonloopback-same-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQpPcmlnaW46IGh0dHA6Ly9wdWJsaWMuaW52YWxpZA0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key", "sk-cli"], "env": {}, "cases": [{"group": "origin", "name": "key-does-not-bypass-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHJlYmluZC5pbnZhbGlkDQp4LWFwaS1rZXk6IHNrLWNsaQ0KDQo="}], "opts": {}}, {"group": "origin", "name": "key-does-not-bypass-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vZXZpbC5pbnZhbGlkDQp4LWFwaS1rZXk6IHNrLWNsaQ0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key", "sk-cli", "--api-key-file", "@KEYFILE@"], "env": {"TENSORFOLD_API_KEY": "sk-env"}, "key_file": "# keys\nclient: sk-file\nsk-bare\n", "cases": [{"group": "keys", "name": "full-get-response", "raws": [{"b64": "R0VUIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1jbGkNCg0K"}], "opts": {}}, {"group": "keys", "name": "full-delete-response", "raws": [{"b64": "REVMRVRFIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-response-stored", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1iYXJlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA1Mw0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4iLCAibWF4X291dHB1dF90b2tlbnMiOiAyfQ=="}], "opts": {}}, {"group": "keys", "name": "full-response-parent", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZW52DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA1NQ0KDQp7ImlucHV0IjogIkhpIiwgInByZXZpb3VzX3Jlc3BvbnNlX2lkIjogInJlc3BfbWlzc2luZyJ9"}], "opts": {}}, {"group": "keys", "name": "full-alias-completions", "raws": [{"b64": "UE9TVCAvYWx0L2NvbXBsZXRpb25zIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}], "opts": {}}, {"group": "keys", "name": "full-slide-learn", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLWNsaQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMg0KDQp7fQ=="}], "opts": {}}, {"group": "keys", "name": "full-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWVudg0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-recall", "raws": [{"b64": "R0VUIC92MS9yZWNhbGwgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1maWxlDQoNCg=="}], "opts": {}}, {"group": "keys", "name": "full-imprint-load", "raws": [{"b64": "UE9TVCAvdjEvaW1wcmludC9sb2FkIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1iYXJlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyDQoNCnt9"}], "opts": {}}, {"group": "keys", "name": "full-stats", "raws": [{"b64": "R0VUIC9zdGF0cyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stY2xpDQoNCg=="}], "opts": {}}, {"group": "keys", "name": "full-head", "raws": [{"b64": "SEVBRCAvdjEvbW9kZWxzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-put", "raws": [{"b64": "UFVUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1lbnYNCg0K"}], "opts": {}}, {"group": "keys", "name": "full-future", "raws": [{"b64": "R0VUIC9mdXR1cmUvcHJpdmF0ZSBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stYmFyZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-then-none", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1maWxlDQoNCg=="}, {"b64": "REVMRVRFIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCg0K"}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key-file", "@KEYFILE@"], "env": {}, "key_file": "app[inference]: sk-app\nmonitor[read]: sk-read\nops: sk-ops\n", "cases": [{"group": "scopes", "name": "read-chat", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stcmVhZA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogODYNCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}], "opts": {}}, {"group": "scopes", "name": "read-messages", "raws": [{"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLXJlYWQNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDgwDQoNCnsibWF4X3Rva2VucyI6IDIsICJtZXNzYWdlcyI6IFt7InJvbGUiOiAidXNlciIsICJjb250ZW50IjogIkhpIEBzY3JpcHQ9cGxhaW4ifV19"}], "opts": {}}, {"group": "scopes", "name": "read-models", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLXJlYWQNCg0K"}], "opts": {}}, {"group": "scopes", "name": "app-metrics", "raws": [{"b64": "R0VUIC9tZXRyaWNzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQoNCg=="}], "opts": {}}, {"group": "scopes", "name": "app-chat", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWFwcA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogODYNCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}], "opts": {}}, {"group": "scopes", "name": "app-alias", "raws": [{"b64": "UE9TVCAvYWx0L2NvbXBsZXRpb25zIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyOQ0KDQp7InByb21wdCI6ICJ4IEBzY3JpcHQ9cGxhaW4ifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-recall", "raws": [{"b64": "R0VUIC92MS9yZWNhbGwgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1hcHANCg0K"}], "opts": {}}, {"group": "scopes", "name": "app-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWFwcA0KDQo="}], "opts": {}}, {"group": "scopes", "name": "app-learn-expect", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1hcHANCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDEzDQpFeHBlY3Q6IDEwMC1jb250aW51ZQ0KDQp7InRleHQiOiAieCJ9"}], "opts": {}}, {"group": "scopes", "name": "app-response-stored", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyOQ0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4ifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-response-parent", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA2NQ0KDQp7ImlucHV0IjogIkhpIiwgInN0b3JlIjogZmFsc2UsICJwcmV2aW91c19yZXNwb25zZV9pZCI6ICJyZXNwX3gifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-response-stateless", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA2OQ0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4iLCAic3RvcmUiOiBmYWxzZSwgIm1heF9vdXRwdXRfdG9rZW5zIjogMn0="}], "opts": {}}, {"group": "scopes", "name": "ops-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLW9wcw0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": [], "env": {}, "cases": [{"group": "admission", "name": "off-burst", "raws": [{"b64": "UE9TVCAvdjEvY29tcGxldGlvbnMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4Ng0KDQp7Im1vZGVsIjogImZha2UtbW9kZWwiLCAibWVzc2FnZXMiOiBbeyJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJIaSBAc2NyaXB0PXBsYWluIn1dfQ=="}, {"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMTAzDQoNCnsibW9kZWwiOiAiZmFrZS1tb2RlbCIsICJtYXhfdG9rZW5zIjogNCwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}, {"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDUzDQoNCnsiaW5wdXQiOiAiSGkgQHNjcmlwdD1wbGFpbiIsICJtYXhfb3V0cHV0X3Rva2VucyI6IDJ9"}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAxMDINCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XSwgInN0cmVhbSI6IHRydWV9"}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--max-inflight", "0", "--max-inflight-per-key", "0", "--requests-per-second", "0", "--request-burst", "7"], "env": {}, "cases": [{"group": "admission", "name": "zero-burst", "raws": [{"b64": "UE9TVCAvdjEvY29tcGxldGlvbnMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4Ng0KDQp7Im1vZGVsIjogImZha2UtbW9kZWwiLCAibWVzc2FnZXMiOiBbeyJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJIaSBAc2NyaXB0PXBsYWluIn1dfQ=="}, {"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMTAzDQoNCnsibW9kZWwiOiAiZmFrZS1tb2RlbCIsICJtYXhfdG9rZW5zIjogNCwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}, {"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDUzDQoNCnsiaW5wdXQiOiAiSGkgQHNjcmlwdD1wbGFpbiIsICJtYXhfb3V0cHV0X3Rva2VucyI6IDJ9"}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAxMDINCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XSwgInN0cmVhbSI6IHRydWV9"}], "opts": {}}], "then": [{"kind": "terminate"}]}]} +{"steps": [{"kind": "serve", "args": ["--api-key", "sk-cli"], "env": {}, "cases": [{"group": "keys", "name": "systemone-none", "raws": [{"b64": "UE9TVCAvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}, {"group": "keys", "name": "systemone-with-key", "raws": [{"b64": "UE9TVCAvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stY2xpDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAxMTANCg0KeyJzdGF0ZSI6IG51bGwsICJxdWVzdGlvbnMiOiB7InEiOiB7InR5cGUiOiAiY2hvaWNlIiwgImluc3RydWN0aW9ucyI6ICJpIiwgImNyaXRlcmlhIjogeyJBIjogImEiLCAiQiI6ICJiIn19fX0="}], "opts": {}}, {"group": "keys", "name": "v1-systemone-none", "raws": [{"b64": "UE9TVCAvdjEvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}, {"group": "keys", "name": "v1-systemone-with-key", "raws": [{"b64": "UE9TVCAvdjEvc3lzdGVtb25lIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stY2xpDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAxMTANCg0KeyJzdGF0ZSI6IG51bGwsICJxdWVzdGlvbnMiOiB7InEiOiB7InR5cGUiOiAiY2hvaWNlIiwgImluc3RydWN0aW9ucyI6ICJpIiwgImNyaXRlcmlhIjogeyJBIjogImEiLCAiQiI6ICJiIn19fX0="}], "opts": {}}, {"group": "keys", "name": "x-systemone-none", "raws": [{"b64": "UE9TVCAveC9zeXN0ZW1vbmUgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluDQpDb250ZW50LUxlbmd0aDogMTEwDQoNCnsic3RhdGUiOiBudWxsLCAicXVlc3Rpb25zIjogeyJxIjogeyJ0eXBlIjogImNob2ljZSIsICJpbnN0cnVjdGlvbnMiOiAiaSIsICJjcml0ZXJpYSI6IHsiQSI6ICJhIiwgIkIiOiAiYiJ9fX19"}], "opts": {}}, {"group": "keys", "name": "x-systemone-with-key", "raws": [{"b64": "UE9TVCAveC9zeXN0ZW1vbmUgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1jbGkNCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbg0KQ29udGVudC1MZW5ndGg6IDExMA0KDQp7InN0YXRlIjogbnVsbCwgInF1ZXN0aW9ucyI6IHsicSI6IHsidHlwZSI6ICJjaG9pY2UiLCAiaW5zdHJ1Y3Rpb25zIjogImkiLCAiY3JpdGVyaWEiOiB7IkEiOiAiYSIsICJCIjogImIifX19fQ=="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": [], "env": {}, "cases": [{"group": "origin", "name": "rebind-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHJlYmluZC5pbnZhbGlkDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "cross-origin", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpPcmlnaW46IGh0dHBzOi8vZXZpbC5pbnZhbGlkDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtTGVuZ3RoOiAyDQoNCnt9"}], "opts": {}}, {"group": "origin", "name": "cross-origin-learn", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL2V2aWwuaW52YWxpZA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluDQpDb250ZW50LUxlbmd0aDogMg0KDQp7fQ=="}], "opts": {}}, {"group": "origin", "name": "same-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdDo4MDAwDQpPcmlnaW46IGh0dHA6Ly9sb2NhbGhvc3Q6ODAwMA0KDQo="}], "opts": {}}, {"group": "origin", "name": "no-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IDEyNy4wLjAuMTo5MDAwDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "null-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBudWxsDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "missing-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCg0K"}], "opts": {}}, {"group": "origin", "name": "ipv6-loopback", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IFs6OjFdOjgwDQpPcmlnaW46IGh0dHA6Ly9bOjoxXQ0KDQo="}], "opts": {}}, {"group": "origin", "name": "scheme-mismatch", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL2xvY2FsaG9zdA0KDQo="}], "opts": {}}, {"group": "origin", "name": "duplicate-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KaE9zVDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "origin", "name": "duplicate-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vbG9jYWxob3N0DQpvUmlHaU46IGh0dHA6Ly9sb2NhbGhvc3QNCg0K"}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--allowed-host", "trusted-one.invalid", "--allowed-host=trusted-two.invalid", "--allowed-origin", "https://ui-one.invalid", "--allowed-origin=http://ui-two.invalid:8000"], "env": {}, "cases": [{"group": "origin", "name": "allowed-host-first", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHRydXN0ZWQtb25lLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "allowed-host-second", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHRydXN0ZWQtdHdvLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "allowed-origin-first", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwczovL3VpLW9uZS5pbnZhbGlkOjQ0Mw0KDQo="}], "opts": {}}, {"group": "origin", "name": "allowed-origin-second", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vdWktdHdvLmludmFsaWQ6ODAwMA0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--host", "0.0.0.0"], "env": {}, "cases": [{"group": "origin", "name": "nonloopback-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQoNCg=="}], "opts": {}}, {"group": "origin", "name": "nonloopback-cross-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQpPcmlnaW46IGh0dHA6Ly9ldmlsLmludmFsaWQNCg0K"}], "opts": {}}, {"group": "origin", "name": "nonloopback-same-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHB1YmxpYy5pbnZhbGlkDQpPcmlnaW46IGh0dHA6Ly9wdWJsaWMuaW52YWxpZA0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key", "sk-cli"], "env": {}, "cases": [{"group": "origin", "name": "key-does-not-bypass-host", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IHJlYmluZC5pbnZhbGlkDQp4LWFwaS1rZXk6IHNrLWNsaQ0KDQo="}], "opts": {}}, {"group": "origin", "name": "key-does-not-bypass-origin", "raws": [{"b64": "R0VUIC9oZWFsdGggSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KT3JpZ2luOiBodHRwOi8vZXZpbC5pbnZhbGlkDQp4LWFwaS1rZXk6IHNrLWNsaQ0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key", "sk-cli", "--api-key-file", "@KEYFILE@"], "env": {"TENSORFOLD_API_KEY": "sk-env"}, "key_file": "# keys\nclient: sk-file\nsk-bare\n", "cases": [{"group": "keys", "name": "full-get-response", "raws": [{"b64": "R0VUIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1jbGkNCg0K"}], "opts": {}}, {"group": "keys", "name": "full-delete-response", "raws": [{"b64": "REVMRVRFIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-response-stored", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1iYXJlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA1Mw0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4iLCAibWF4X291dHB1dF90b2tlbnMiOiAyfQ=="}], "opts": {}}, {"group": "keys", "name": "full-response-parent", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZW52DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA1NQ0KDQp7ImlucHV0IjogIkhpIiwgInByZXZpb3VzX3Jlc3BvbnNlX2lkIjogInJlc3BfbWlzc2luZyJ9"}], "opts": {}}, {"group": "keys", "name": "full-alias-completions", "raws": [{"b64": "UE9TVCAvYWx0L2NvbXBsZXRpb25zIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}], "opts": {}}, {"group": "keys", "name": "full-slide-learn", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLWNsaQ0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMg0KDQp7fQ=="}], "opts": {}}, {"group": "keys", "name": "full-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWVudg0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-recall", "raws": [{"b64": "R0VUIC92MS9yZWNhbGwgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1maWxlDQoNCg=="}], "opts": {}}, {"group": "keys", "name": "full-imprint-load", "raws": [{"b64": "UE9TVCAvdjEvaW1wcmludC9sb2FkIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkF1dGhvcml6YXRpb246IEJlYXJlciBzay1iYXJlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyDQoNCnt9"}], "opts": {}}, {"group": "keys", "name": "full-stats", "raws": [{"b64": "R0VUIC9zdGF0cyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stY2xpDQoNCg=="}], "opts": {}}, {"group": "keys", "name": "full-head", "raws": [{"b64": "SEVBRCAvdjEvbW9kZWxzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stZmlsZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-put", "raws": [{"b64": "UFVUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1lbnYNCg0K"}], "opts": {}}, {"group": "keys", "name": "full-future", "raws": [{"b64": "R0VUIC9mdXR1cmUvcHJpdmF0ZSBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stYmFyZQ0KDQo="}], "opts": {}}, {"group": "keys", "name": "full-then-none", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1maWxlDQoNCg=="}, {"b64": "REVMRVRFIC92MS9yZXNwb25zZXMvcmVzcF9taXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCg0K"}], "opts": {}}, {"group": "keys", "name": "full-model-id", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1hbGlhcyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stY2xpDQoNCg=="}], "opts": {}}, {"group": "keys", "name": "model-id-none", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1tb2RlbCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key-file", "@KEYFILE@"], "env": {}, "key_file": "app[inference]: sk-app\nmonitor[read]: sk-read\nops: sk-ops\n", "cases": [{"group": "scopes", "name": "read-chat", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stcmVhZA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogODYNCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}], "opts": {}}, {"group": "scopes", "name": "read-messages", "raws": [{"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLXJlYWQNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDgwDQoNCnsibWF4X3Rva2VucyI6IDIsICJtZXNzYWdlcyI6IFt7InJvbGUiOiAidXNlciIsICJjb250ZW50IjogIkhpIEBzY3JpcHQ9cGxhaW4ifV19"}], "opts": {}}, {"group": "scopes", "name": "read-models", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQXV0aG9yaXphdGlvbjogQmVhcmVyIHNrLXJlYWQNCg0K"}], "opts": {}}, {"group": "scopes", "name": "read-model-id", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1tb2RlbCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpBdXRob3JpemF0aW9uOiBCZWFyZXIgc2stcmVhZA0KDQo="}], "opts": {}}, {"group": "scopes", "name": "app-model-id", "raws": [{"b64": "R0VUIC9tb2RlbHMvZmFrZS1hbGlhcyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWFwcA0KDQo="}], "opts": {}}, {"group": "scopes", "name": "app-model-suffix", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1tb2RlbC9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1hcHANCg0K"}], "opts": {}}, {"group": "scopes", "name": "app-metrics", "raws": [{"b64": "R0VUIC9tZXRyaWNzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQoNCg=="}], "opts": {}}, {"group": "scopes", "name": "app-chat", "raws": [{"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWFwcA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogODYNCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}], "opts": {}}, {"group": "scopes", "name": "app-alias", "raws": [{"b64": "UE9TVCAvYWx0L2NvbXBsZXRpb25zIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyOQ0KDQp7InByb21wdCI6ICJ4IEBzY3JpcHQ9cGxhaW4ifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-recall", "raws": [{"b64": "R0VUIC92MS9yZWNhbGwgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1hcHANCg0K"}], "opts": {}}, {"group": "scopes", "name": "app-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLWFwcA0KDQo="}], "opts": {}}, {"group": "scopes", "name": "app-learn-expect", "raws": [{"b64": "UE9TVCAvdjEvc2xpZGUvbGVhcm4gSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KeC1hcGkta2V5OiBzay1hcHANCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDEzDQpFeHBlY3Q6IDEwMC1jb250aW51ZQ0KDQp7InRleHQiOiAieCJ9"}], "opts": {}}, {"group": "scopes", "name": "app-response-stored", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAyOQ0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4ifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-response-parent", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA2NQ0KDQp7ImlucHV0IjogIkhpIiwgInN0b3JlIjogZmFsc2UsICJwcmV2aW91c19yZXNwb25zZV9pZCI6ICJyZXNwX3gifQ=="}], "opts": {}}, {"group": "scopes", "name": "app-response-stateless", "raws": [{"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCngtYXBpLWtleTogc2stYXBwDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA2OQ0KDQp7ImlucHV0IjogIkhpIEBzY3JpcHQ9cGxhaW4iLCAic3RvcmUiOiBmYWxzZSwgIm1heF9vdXRwdXRfdG9rZW5zIjogMn0="}], "opts": {}}, {"group": "scopes", "name": "ops-slide-graph", "raws": [{"b64": "REVMRVRFIC92MS9zbGlkZS9ncmFwaCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQp4LWFwaS1rZXk6IHNrLW9wcw0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--alias", "example-org/fake-model"], "env": {}, "cases": [{"group": "models", "name": "served", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1tb2RlbCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "models", "name": "alias", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1hbGlhcyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "models", "name": "bare", "raws": [{"b64": "R0VUIC9tb2RlbHMvZmFrZS1tb2RlbCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "models", "name": "slash-raw", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZXhhbXBsZS1vcmcvZmFrZS1tb2RlbCBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "models", "name": "slash-escaped", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZXhhbXBsZS1vcmclMkZmYWtlLW1vZGVsIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCg0K"}], "opts": {}}, {"group": "models", "name": "slash-escaped-lower", "raws": [{"b64": "R0VUIC9tb2RlbHMvZXhhbXBsZS1vcmclMmZmYWtlLW1vZGVsLz94PTEgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KDQo="}], "opts": {}}, {"group": "models", "name": "unknown", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvbWlzc2luZyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQoNCg=="}], "opts": {}}, {"group": "models", "name": "unknown-escaped", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZXhhbXBsZS1vcmclMkZtaXNzaW5nIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCg0K"}], "opts": {}}, {"group": "models", "name": "suffix-lists", "raws": [{"b64": "R0VUIC92MS9tb2RlbHMvZmFrZS1tb2RlbC9tb2RlbHMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KDQo="}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": [], "env": {}, "cases": [{"group": "admission", "name": "off-burst", "raws": [{"b64": "UE9TVCAvdjEvY29tcGxldGlvbnMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4Ng0KDQp7Im1vZGVsIjogImZha2UtbW9kZWwiLCAibWVzc2FnZXMiOiBbeyJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJIaSBAc2NyaXB0PXBsYWluIn1dfQ=="}, {"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMTAzDQoNCnsibW9kZWwiOiAiZmFrZS1tb2RlbCIsICJtYXhfdG9rZW5zIjogNCwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}, {"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDUzDQoNCnsiaW5wdXQiOiAiSGkgQHNjcmlwdD1wbGFpbiIsICJtYXhfb3V0cHV0X3Rva2VucyI6IDJ9"}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAxMDINCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XSwgInN0cmVhbSI6IHRydWV9"}], "opts": {}}], "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--max-inflight", "0", "--max-inflight-per-key", "0", "--requests-per-second", "0", "--request-burst", "7"], "env": {}, "cases": [{"group": "admission", "name": "zero-burst", "raws": [{"b64": "UE9TVCAvdjEvY29tcGxldGlvbnMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogNDYNCg0KeyJwcm9tcHQiOiAieCBAc2NyaXB0PXBsYWluIiwgIm1heF90b2tlbnMiOiAyfQ=="}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiA4Ng0KDQp7Im1vZGVsIjogImZha2UtbW9kZWwiLCAibWVzc2FnZXMiOiBbeyJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJIaSBAc2NyaXB0PXBsYWluIn1dfQ=="}, {"b64": "UE9TVCAvdjEvbWVzc2FnZXMgSFRUUC8xLjENCkhvc3Q6IGxvY2FsaG9zdA0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uDQpDb250ZW50LUxlbmd0aDogMTAzDQoNCnsibW9kZWwiOiAiZmFrZS1tb2RlbCIsICJtYXhfdG9rZW5zIjogNCwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XX0="}, {"b64": "UE9TVCAvdjEvcmVzcG9uc2VzIEhUVFAvMS4xDQpIb3N0OiBsb2NhbGhvc3QNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbg0KQ29udGVudC1MZW5ndGg6IDUzDQoNCnsiaW5wdXQiOiAiSGkgQHNjcmlwdD1wbGFpbiIsICJtYXhfb3V0cHV0X3Rva2VucyI6IDJ9"}, {"b64": "UE9TVCAvdjEvY2hhdC9jb21wbGV0aW9ucyBIVFRQLzEuMQ0KSG9zdDogbG9jYWxob3N0DQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCkNvbnRlbnQtTGVuZ3RoOiAxMDINCg0KeyJtb2RlbCI6ICJmYWtlLW1vZGVsIiwgIm1lc3NhZ2VzIjogW3sicm9sZSI6ICJ1c2VyIiwgImNvbnRlbnQiOiAiSGkgQHNjcmlwdD1wbGFpbiJ9XSwgInN0cmVhbSI6IHRydWV9"}], "opts": {}}], "then": [{"kind": "terminate"}]}]} diff --git a/zig/tests/server/security_cases.py b/zig/tests/server/security_cases.py index e4c2dd93477..708662dcc61 100644 --- a/zig/tests/server/security_cases.py +++ b/zig/tests/server/security_cases.py @@ -52,6 +52,8 @@ def full_key_cases(): ("full-put", [raw("PUT", "/v1/models", headers=env)]), ("full-future", [raw("GET", "/future/private", headers=bare)]), ("full-then-none", [raw("GET", "/v1/models", headers=file), raw("DELETE", "/v1/responses/resp_missing")]), + ("full-model-id", [raw("GET", "/v1/models/fake-alias", headers=cli)]), + ("model-id-none", [raw("GET", "/v1/models/fake-model")]), ] return [{"group": "keys", "name": name, "raws": [{"b64": base64.b64encode(r).decode()} for r in raws], "opts": {}} for name, raws in items] @@ -66,6 +68,9 @@ def scope_cases(): ("read-chat", [raw("POST", "/v1/chat/completions", chat, read)]), ("read-messages", [raw("POST", "/v1/messages", {"max_tokens": 2, "messages": chat["messages"]}, read)]), ("read-models", [raw("GET", "/v1/models", headers=read)]), + ("read-model-id", [raw("GET", "/v1/models/fake-model", headers=read)]), + ("app-model-id", [raw("GET", "/models/fake-alias", headers=app)]), + ("app-model-suffix", [raw("GET", "/v1/models/fake-model/models", headers=app)]), ("app-metrics", [raw("GET", "/metrics", headers=app)]), ("app-chat", [raw("POST", "/v1/chat/completions", chat, app)]), ("app-alias", [raw("POST", "/alt/completions", {"prompt": "x @script=plain"}, app)]), @@ -81,6 +86,23 @@ def scope_cases(): for name, raws in items] +def model_cases(): + """One model's entry by its served name or an alias, raw or percent-escaped; any other id is a 404.""" + items = [ + ("served", "/v1/models/fake-model"), + ("alias", "/v1/models/fake-alias"), + ("bare", "/models/fake-model"), + ("slash-raw", "/v1/models/example-org/fake-model"), + ("slash-escaped", "/v1/models/example-org%2Ffake-model"), + ("slash-escaped-lower", "/models/example-org%2ffake-model/?x=1"), + ("unknown", "/v1/models/missing"), + ("unknown-escaped", "/v1/models/example-org%2Fmissing"), + ("suffix-lists", "/v1/models/fake-model/models"), + ] + return [{"group": "models", "name": name, "raws": [{"b64": base64.b64encode(raw("GET", path)).decode()}], "opts": {}} + for name, path in items] + + def admission_cases(stem): """Model requests on one connection, the stream last: admission off answers as before its flags existed.""" say = [{"role": "user", "content": "Hi @script=plain"}] @@ -130,6 +152,7 @@ def steps(): "key_file": "# keys\nclient: sk-file\nsk-bare\n", "cases": full_key_cases(), "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--api-key-file", "@KEYFILE@"], "env": {}, "key_file": "app[inference]: sk-app\nmonitor[read]: sk-read\nops: sk-ops\n", "cases": scope_cases(), "then": [{"kind": "terminate"}]}, + {"kind": "serve", "args": ["--alias", "example-org/fake-model"], "env": {}, "cases": model_cases(), "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": [], "env": {}, "cases": admission_cases("off"), "then": [{"kind": "terminate"}]}, {"kind": "serve", "args": ["--max-inflight", "0", "--max-inflight-per-key", "0", "--requests-per-second", "0", "--request-burst", "7"], "env": {}, "cases": admission_cases("zero"), "then": [{"kind": "terminate"}]}, diff --git a/zig/tests/xpu/contract_live.zig b/zig/tests/xpu/contract_live.zig index 4d648bc00a3..4a836308d82 100644 --- a/zig/tests/xpu/contract_live.zig +++ b/zig/tests/xpu/contract_live.zig @@ -12,6 +12,7 @@ fn isControl(r: records.Record) bool { fn imageOf(name: []const u8) ?rig_.Image { if (std.mem.eql(u8, name, "glue")) return .glue; + if (std.mem.eql(u8, name, "tp")) return .tp; if (std.mem.eql(u8, name, "contract_controls")) return .controls; return null; } @@ -24,7 +25,18 @@ fn argsOf(symbol: []const u8) u32 { .{ "gated_norm", 12 }, .{ "swiglu", 7 }, .{ "argmax", 3 }, + .{ "topk_part", 6 }, + .{ "topk_merge", 6 }, .{ "embed", 6 }, + .{ "tp2_allreduce_f16", 4 }, + .{ "tp4_allreduce_f16", 6 }, + .{ "tp2_rs_f16", 5 }, + .{ "tp4_rs_f16", 7 }, + .{ "tp2_allreduce_bf16", 4 }, + .{ "tp4_allreduce_bf16", 6 }, + .{ "tp2_allreduce_f32", 4 }, + .{ "tp4_allreduce_f32", 6 }, + .{ "tp4_rs_f32", 7 }, }; for (table) |e| if (std.mem.eql(u8, e[0], symbol)) return e[1]; return 1; // gate 5's controls take one output pointer diff --git a/zig/tests/xpu/contract_rig.zig b/zig/tests/xpu/contract_rig.zig index 922fd756539..939daef61b2 100644 --- a/zig/tests/xpu/contract_rig.zig +++ b/zig/tests/xpu/contract_rig.zig @@ -8,23 +8,25 @@ const images = @import("xpu_contract_images"); pub const guard = 256; const pattern = 0xa5; -/// The image a kernel lives in: the Qwen3.8-27B glue, gate 5's controls, or gates 1 to 4's. -pub const Image = enum { glue, controls, gate }; +/// The image a kernel lives in: the Qwen3.8-27B glue, TP collectives, gate 5's controls, or gates 1 to 4's. +pub const Image = enum { glue, tp, controls, gate }; fn blob(i: Image) []const u8 { return switch (i) { .glue => &images.glue, + .tp => &images.tp, .controls => &images.controls, .gate => &images.gate_controls, }; } -/// One card, its context and stream, and the three images loaded native for it. +/// One card, its context and stream, and the contract images loaded native for it. pub const Dev = struct { drv: xpu.Driver, ctx: xpu.Context, s: xpu.Stream, glue: xpu.Module, + tp: xpu.Module, controls: ?xpu.Module, // the driver refuses the whole image when one control asks for more SLM than it has controls_err: ?anyerror = null, gate: xpu.Module, @@ -35,6 +37,7 @@ pub const Dev = struct { self.ctx = try xpu.Context.init(&self.drv, ordinal); self.s = try xpu.Stream.init(&self.ctx); self.glue = try xpu.Module.loadNative(&self.ctx, blob(.glue)); + self.tp = try xpu.Module.loadNative(&self.ctx, blob(.tp)); self.controls = xpu.Module.loadNative(&self.ctx, blob(.controls)) catch |e| blk: { self.controls_err = e; break :blk null; @@ -45,6 +48,7 @@ pub const Dev = struct { pub fn deinit(self: *Dev) void { self.gate.unload(); if (self.controls) |*m| m.unload(); + self.tp.unload(); self.glue.unload(); self.s.deinit(); self.ctx.deinit(); @@ -54,6 +58,7 @@ pub const Dev = struct { pub fn module(self: *Dev, i: Image) !*xpu.Module { return switch (i) { .glue => &self.glue, + .tp => &self.tp, .controls => if (self.controls) |*m| m else error.ControlsNotBuilt, .gate => &self.gate, }; diff --git a/zig/tests/xpu/contract_run.zig b/zig/tests/xpu/contract_run.zig index 28c5d96e8ef..c2e219d4b56 100644 --- a/zig/tests/xpu/contract_run.zig +++ b/zig/tests/xpu/contract_run.zig @@ -7,7 +7,9 @@ const live5 = @import("contract_live.zig"); const norm_k = @import("contract_norm.zig"); const swiglu_k = @import("contract_swiglu.zig"); const argmax_k = @import("contract_argmax.zig"); +const topk_k = @import("contract_topk.zig"); const embed_k = @import("contract_embed.zig"); +const tp_k = @import("contract_tp.zig"); const controls_k = @import("contract_controls.zig"); const g = core.gates; @@ -48,9 +50,17 @@ pub fn main(init: std.process.Init) !u8 { var argmax = try argmax_k.Argmax.init(a, &dev); defer argmax.deinit(); try kernels.append(a, argmax.kernel()); + var topk: [std.enums.values(topk_k.Which).len]topk_k.Topk = undefined; + for (&topk, std.enums.values(topk_k.Which)) |*x, w| x.* = try topk_k.Topk.init(a, &dev, w); + defer for (&topk) |*x| x.deinit(); + for (&topk) |*x| try kernels.append(a, x.kernel()); var embed = try embed_k.Embed.init(a, &dev); defer embed.deinit(); try kernels.append(a, embed.kernel()); + var tps: [std.enums.values(tp_k.Which).len]tp_k.Tp = undefined; + for (&tps, std.enums.values(tp_k.Which)) |*x, w| x.* = try tp_k.Tp.init(a, &dev, w); + defer for (&tps) |*x| x.deinit(); + for (&tps) |*x| try kernels.append(a, x.kernel()); var controls: [std.enums.values(controls_k.Which).len]controls_k.Control = undefined; for (&controls, std.enums.values(controls_k.Which)) |*x, w| x.* = try controls_k.Control.init(a, &dev, w); defer for (&controls) |*x| x.deinit(); diff --git a/zig/tests/xpu/contract_topk.zig b/zig/tests/xpu/contract_topk.zig new file mode 100644 index 00000000000..d3005bec721 --- /dev/null +++ b/zig/tests/xpu/contract_topk.zig @@ -0,0 +1,185 @@ +//! The Qwen3.8-27B glue's top-k under the contract on XPU: the candidates a sampled row draws from, by its stated rule. +const std = @import("std"); +const xpu = @import("xpu"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const kit = @import("contract_kit.zig"); + +const c = core.spec; +const g = core.gates; +const ref = core.xpu_ref; + +const PARTS = 256; // topk_part's most groups a row, one per 1024 ids +const SEG = 1024; // ids a group takes +const KMAX = 64; // candidates a row keeps at most +const WORDS = 132; // a row's output: KMAX values (fp32 bits), KMAX ids, the flag, padding +const VOCAB = 248320; // Qwen3.8-27B's logits a row +const MAX_ROWS = 16; // decode and verification rows + +/// The real merge, and the two planted ones of `contract_gate_controls.cl`. +pub const Which = enum { real, ties, cand_flag }; + +fn none(_: c.Shape) usize { + return 0; +} + +const rule = "a row holding a NaN or an infinity anywhere raises the flag, whatever the candidates hold; else the flag " ++ + "is clear and the K candidates are the K largest values, the lower id first at a tie, signed zeros equal"; + +const served = [_]c.Shape{ + .{ .rows = 1, .n = VOCAB, .k = 20 }, + .{ .rows = 16, .n = VOCAB, .k = 64 }, + .{ .rows = 4, .n = 100003, .k = 7 }, + .{ .rows = 2, .n = PARTS * SEG, .k = 33 }, +}; + +pub fn spec(w: Which) c.Spec { + return .{ + .name = switch (w) { + .real => "xpu top-k (the candidates)", + .ties => "control: top-k merge breaking ties the wrong way", + .cand_flag => "control: top-k flag read off the candidates only", + }, + .accum = .none, + .depth = none, + .out = .raw, + .nan = .{ .stated = rule }, + .tiles = .{ .{ .size = 16, .min = 1 }, .{ .size = SEG, .min = KMAX }, .{ .size = KMAX, .min = 1 } }, + .served = &served, + }; +} + +/// shape.rows rows of shape.n logits of fp16, shape.k candidates each: the merged words of every row. +pub const Topk = struct { + rig: rig_.Rig, + part: xpu.Kernel, + merge: xpu.Kernel, + which: Which, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + x: []f64 = &.{}, + inb: []u8 = &.{}, + xin: ?*anyopaque = null, + pv: ?*anyopaque = null, + pi: ?*anyopaque = null, + pf: ?*anyopaque = null, + out: ?*anyopaque = null, + msg: [200]u8 = undefined, + + pub fn init(a: std.mem.Allocator, dev: *rig_.Dev, which: Which) !Topk { + return .{ + .rig = .{ .a = a, .dev = dev }, + .part = try dev.kernel(.glue, "topk_part", .{ 256, 1, 1 }), + .merge = switch (which) { + .real => try dev.kernel(.glue, "topk_merge", .{ 256, 1, 1 }), + .ties => try dev.kernel(.gate, "tf_ctl_topk_merge_ties", .{ 256, 1, 1 }), + .cand_flag => try dev.kernel(.gate, "tf_ctl_topk_merge_cand_flag", .{ 256, 1, 1 }), + }, + .which = which, + .arena = .init(a), + }; + } + + pub fn deinit(self: *Topk) void { + self.merge.deinit(); + self.part.deinit(); + self.arena.deinit(); + self.rig.deinit(); + } + + pub fn kernel(self: *Topk) g.Kernel { + return .{ .spec = spec(self.which), .ctx = self, .vt = &vt, .control = switch (self.which) { + .real => null, + .ties => .shapes, + .cand_flag => .nonfinite, + } }; + } + + const vt = g.hooks(Topk); + + pub fn prepare(self: *Topk, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + if (shape.rows == 0 or shape.rows > MAX_ROWS or shape.k == 0 or shape.k > KMAX) return false; + if (shape.n < shape.k or shape.n > PARTS * SEG) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + self.shape = shape; + const a = self.arena.allocator(); + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + self.x = try a.alloc(f64, shape.rows * shape.n); + for (0..shape.rows) |r| { + const row = self.x[r * shape.n ..][0..shape.n]; + for (row, 0..) |*v, i| { + const level = @as(f64, @floatFromInt(rng.uintLessThan(u32, 256))) / 8 - 16; + const tiny = @as(f64, @floatFromInt(1 + rng.uintLessThan(u32, 1023))) * 0x1p-24; // an fp16 subnormal + if (r % 8 == 5) { // fp16 subnormals of both signs on top of a -1 floor + v.* = if (rng.uintLessThan(u32, 4) == 0) (if (i % 2 == 1) -tiny else tiny) else -1.0; + continue; + } + v.* = switch (r % 4) { + 2 => 1.5, // one value everywhere: only the tie order picks the candidates + 3 => if (level == -16) (if (i % 2 == 1) -0.0 else 0.0) else -@abs(level), // signed zeros + else => kit.round(.f16, level), + }; + } + } + if (fill == .nonfinite) { + const at = [_][2]usize{ .{ 0, shape.n / 3 }, .{ 0, shape.n - 1 }, .{ 1, shape.n / 2 }, .{ 2, 0 }, .{ 3, 7 } }; + const put = [_]f64{ std.math.nan(f64), std.math.nan(f64), std.math.inf(f64), -std.math.inf(f64), std.math.inf(f64) }; + for (at, put) |p, v| if (p[0] < shape.rows and p[1] < shape.n) { + self.x[p[0] * shape.n + p[1]] = v; + }; + } + self.inb = try kit.bytes(a, self.x, .f16); + self.xin = try self.rig.input(self.inb); + self.pv = try self.rig.scratch(shape.rows * PARTS * KMAX * 4); + self.pi = try self.rig.scratch(shape.rows * PARTS * KMAX * 4); + self.pf = try self.rig.scratch(shape.rows * PARTS * 4); + self.out = try self.rig.output(shape.rows * WORDS * 4); + return true; + } + + pub fn run(self: *Topk) !void { + const s = self.shape; + const parts: u32 = @intCast((s.n + SEG - 1) / SEG); + const v: u32 = @intCast(s.n); + const k: u32 = @intCast(s.k); + try self.rig.launch(self.part, .{ parts, @intCast(s.rows), 1 }, .{ self.xin, v, k, self.pv, self.pi, self.pf }); + try self.rig.launch(self.merge, .{ @intCast(s.rows), 1, 1 }, .{ self.pv, self.pi, self.pf, k, parts, self.out }); + } + + pub fn count(self: *Topk) usize { + return self.shape.rows * WORDS * 4; + } + + pub fn reference(_: *Topk, want: []f64, mag: []f64) !void { + @memset(want, 0); + @memset(mag, 0); + } + + /// Each row's flag and candidates against the stated rule over the row's values as fp16 holds them. + pub fn check(self: *Topk, _: g.Gate) !?[]const u8 { + const s = self.shape; + const got = try self.rig.bytes(self.out, s.rows * WORDS * 4); + var vals: [KMAX]f64 = undefined; + var ids: [KMAX]u32 = undefined; + for (0..s.rows) |r| { + const w = got[r * WORDS * 4 ..][0 .. WORDS * 4]; + const flag = std.mem.readInt(u32, w[4 * 2 * KMAX ..][0..4], .little); + const row = self.x[r * s.n ..][0..s.n]; + const bad = ref.hasNonfinite(row); + if ((flag != 0) != bad) return try std.fmt.bufPrint(&self.msg, "row {d} flag {d} where the row {s} a value that is not finite", .{ r, flag, if (bad) "holds" else "holds no" }); + if (bad) continue; + ref.topkPick(row, s.k, &vals, &ids); + for (0..s.k) |i| { + const v: f32 = @bitCast(std.mem.readInt(u32, w[4 * i ..][0..4], .little)); + const id = std.mem.readInt(u32, w[4 * (KMAX + i) ..][0..4], .little); + const want: f32 = @floatCast(vals[i]); + if (id != ids[i] or @as(u32, @bitCast(v)) != @as(u32, @bitCast(want))) { + return try std.fmt.bufPrint(&self.msg, "row {d} candidate {d} is {d} at id {d}, the rule gives {d} at id {d}", .{ r, i, v, id, want, ids[i] }); + } + } + } + return null; + } +}; diff --git a/zig/tests/xpu/contract_tp.zig b/zig/tests/xpu/contract_tp.zig new file mode 100644 index 00000000000..cbf9f44f18d --- /dev/null +++ b/zig/tests/xpu/contract_tp.zig @@ -0,0 +1,215 @@ +//! Level Zero TP={2,4} collective kernels in tp.cl under the XPU kernel contract (gates 1 to 4). +const std = @import("std"); +const xpu = @import("xpu"); +const core = @import("core"); +const rig_ = @import("contract_rig.zig"); +const kit = @import("contract_kit.zig"); + +const c = core.spec; +const g = core.gates; +const rows = core.rows; + +/// All nine P2P collective kernels in zig/kernels/xpu/tp.cl. +pub const Which = enum { ar2_f16, ar4_f16, rs2_f16, rs4_f16, ar2_bf16, ar4_bf16, ar2_f32, ar4_f32, rs4_f32 }; + +const why_k2_f16 = "two fp16 inputs sum once directly to fp16 without an intermediate narrowing loss"; +const why_k2_bf16 = "two bf16 inputs sum once directly to bf16, while fp16 sums overflow at 65536"; + +fn symbol(w: Which) []const u8 { + return switch (w) { + .ar2_f16 => "tp2_allreduce_f16", + .ar4_f16 => "tp4_allreduce_f16", + .rs2_f16 => "tp2_rs_f16", + .rs4_f16 => "tp4_rs_f16", + .ar2_bf16 => "tp2_allreduce_bf16", + .ar4_bf16 => "tp4_allreduce_bf16", + .ar2_f32 => "tp2_allreduce_f32", + .ar4_f32 => "tp4_allreduce_f32", + .rs4_f32 => "tp4_rs_f32", + }; +} + +fn ranksOf(w: Which) usize { + return switch (w) { + .ar2_f16, .rs2_f16, .ar2_bf16, .ar2_f32 => 2, + else => 4, + }; +} + +fn kindOf(w: Which) kit.Kind { + return switch (w) { + .ar2_f16, .ar4_f16, .rs2_f16, .rs4_f16 => .f16, + .ar2_bf16, .ar4_bf16 => .bf16, + .ar2_f32, .ar4_f32, .rs4_f32 => .f32, + }; +} + +fn isRs(w: Which) bool { + return w == .rs2_f16 or w == .rs4_f16 or w == .rs4_f32; +} + +fn depth2(_: c.Shape) usize { + return 1; +} + +fn depth4(_: c.Shape) usize { + return 3; +} + +const served2 = [_]c.Shape{ + .{ .rows = 1, .n = 4, .k = 2 }, + .{ .rows = 1, .n = 1024, .k = 2 }, + .{ .rows = 1, .n = 4096, .k = 2 }, +}; + +const served4 = [_]c.Shape{ + .{ .rows = 1, .n = 4, .k = 4 }, + .{ .rows = 1, .n = 1024, .k = 4 }, + .{ .rows = 1, .n = 4096, .k = 4 }, +}; + +pub fn spec(w: Which) c.Spec { + const tp = ranksOf(w); + const kind = kindOf(w); + const sums: c.Sums = switch (w) { + .ar2_f16, .rs2_f16 => .{ .f16 = 0, .bf16 = 0, .why = why_k2_f16 }, + .ar2_bf16 => .{ .bf16 = 0, .why = why_k2_bf16 }, + else => .{}, + }; + return .{ + .name = symbol(w), + .accum = .f32, + .depth = if (tp == 2) depth2 else depth4, + .out = kit.elem(kind), + .tiles = .{ .{}, .{ .size = 1024, .step = 4, .min = 4 }, .{} }, + .served = if (tp == 2) &served2 else &served4, + .sums = sums, + }; +} + +/// Device buffers and host reference inputs for one tp.cl collective kernel. +pub const Tp = struct { + rig: rig_.Rig, + k: xpu.Kernel, + which: Which, + arena: std.heap.ArenaAllocator, + shape: c.Shape = undefined, + inputs: [4][]f64 = .{ &.{}, &.{}, &.{}, &.{} }, + devs: [4]?*anyopaque = .{ null, null, null, null }, + out: ?*anyopaque = null, + slice_off: usize = 0, + + pub fn init(a: std.mem.Allocator, dev: *rig_.Dev, which: Which) !Tp { + return .{ .rig = .{ .a = a, .dev = dev }, .k = try dev.kernelFor(.tp, symbol(which), a), .which = which, .arena = .init(a) }; + } + + pub fn deinit(self: *Tp) void { + self.k.deinit(); + self.arena.deinit(); + self.rig.deinit(); + } + + pub fn kernel(self: *Tp) g.Kernel { + return .{ .spec = spec(self.which), .ctx = self, .vt = &vt }; + } + + const vt = g.hooks(Tp); + + fn stressVals(w: Which) [4]f64 { + return switch (w) { + .ar2_f16, .rs2_f16 => .{ 4096, 16, 0, 0 }, + .ar2_bf16 => .{ 65536, 512, 0, 0 }, + .ar2_f32 => .{ 1048576, 4096, 0, 0 }, + .ar4_f16, .rs4_f16 => .{ 40000, 40000, -40000, -39936 }, + .ar4_bf16 => .{ 131072, 256, -131072, 0 }, + .ar4_f32, .rs4_f32 => .{ 1048576, 4096, -1048576, 0 }, + }; + } + + pub fn prepare(self: *Tp, shape: c.Shape, fill: g.Fill, seed: u64) !bool { + const tp = ranksOf(self.which); + if (shape.rows == 0 or shape.n == 0 or shape.n % 4 != 0 or shape.k != tp) return false; + self.rig.reset(); + _ = self.arena.reset(.retain_capacity); + self.shape = shape; + const a = self.arena.allocator(); + const kind = kindOf(self.which); + const total = shape.rows * shape.n; + const full_n = if (isRs(self.which)) tp * total else total; + self.slice_off = if (isRs(self.which)) total else 0; + var prng = std.Random.DefaultPrng.init(seed); + const rng = prng.random(); + for (0..tp) |r| { + self.inputs[r] = try a.alloc(f64, full_n); + if (fill == .stress) { + const sv = stressVals(self.which)[r]; + for (self.inputs[r]) |*v| v.* = kit.round(kind, sv); + } else { + for (self.inputs[r]) |*v| v.* = kit.round(kind, -4 + rng.float(f64) * 8); + } + } + if (fill == .nonfinite) { + const off = self.slice_off; + self.inputs[0][off] = std.math.nan(f64); + if (shape.rows > 1) self.inputs[1 % tp][off + shape.n] = std.math.inf(f64); + if (shape.rows > 2) self.inputs[0][off + 2 * shape.n] = -std.math.inf(f64); + if (shape.rows > 3) { + self.inputs[1 % tp][off + 3 * shape.n] = std.math.inf(f64); + self.inputs[0][off + 3 * shape.n] = -std.math.inf(f64); + } + } + for (0..tp) |r| { + const b = try kit.bytes(a, self.inputs[r], kind); + self.devs[r] = try self.rig.input(b); + } + self.out = try self.rig.output(total * kit.size(kind)); + return true; + } + + pub fn run(self: *Tp) !void { + const n4: i32 = @intCast((self.shape.rows * self.shape.n) / 4); + const off4: i32 = @intCast(self.slice_off / 4); + const groups: [3]u32 = .{ @intCast((@as(usize, @intCast(n4)) + 255) / 256), 1, 1 }; + const tp = ranksOf(self.which); + if (isRs(self.which)) { + if (tp == 2) { + try self.rig.launch(self.k, groups, .{ self.devs[0], self.devs[1], self.out, off4, n4 }); + } else { + try self.rig.launch(self.k, groups, .{ self.devs[0], self.devs[1], self.devs[2], self.devs[3], self.out, off4, n4 }); + } + } else if (tp == 2) { + try self.rig.launch(self.k, groups, .{ self.devs[0], self.devs[1], self.out, n4 }); + } else { + try self.rig.launch(self.k, groups, .{ self.devs[0], self.devs[1], self.devs[2], self.devs[3], self.out, n4 }); + } + } + + pub fn count(self: *Tp) usize { + return self.shape.rows * self.shape.n; + } + + pub fn reference(self: *Tp, want: []f64, mag: []f64) !void { + const tp = ranksOf(self.which); + const kind = kindOf(self.which); + for (0..self.count()) |i| { + var s: f64 = 0; + var abs: f64 = 0; + for (0..tp) |r| { + const v = self.inputs[r][self.slice_off + i]; + s += v; + abs += @abs(v); + } + want[i] = kit.round(kind, s); + mag[i] = abs; + } + } + + pub fn simulate(self: *Tp, acc: c.Accum, order: g.Order, out: []f64) !void { + const tp = ranksOf(self.which); + var terms: [4]f64 = undefined; + for (0..self.count()) |i| { + for (0..tp) |r| terms[r] = self.inputs[r][self.slice_off + i]; + out[i] = rows.sumIn(acc, order, terms[0..tp]); + } + } +};