Repository navigation
Releases
Releases · mgorshkov/tinycoder-inference
Issue-16 gates, AVX-512 Q2_K fix, RTX 5090 rows
GPU: fail loudly on missing kernels (issue [#16](https://github.com/mgorshkov/tinycoder-inference/issues/16)); native sm_89/sm_120, occupancy, card tables
1.0.8 GPU: fail loudly on missing kernels (issue #16); native sm_89/sm_120,…
aarch64 build without np; fix scalar Q2_K dot, GPU small-rows launch/staging
1.0.7 aarch64 build without np; fix scalar Q2_K dot, GPU small-rows launch/…
Inkling-2-mini model support
1.0.6 Inkling-2-mini model support
Ampere (sm_86) support
3090 recheck: reported numbers, checkpoint links, defect plans - BENCHMARKS-3090.md: §1.1 records the rented-stand session as *reported* (13 rows with VRAM, pp512/tg128, server decode, and the log signature each row hit), with the box, commit, flags and the 24-thread deviation; §2 now says a reported row is not a published one. The sender's report is not republished. - Both benchmark files and the README link each row to the exact checkpoint, and only where the linked file matches ours byte for byte (the two 7B i-quants to ThomasBaruzier, 1.5B q2_k to unsloth, 1.5B iq3_xxs to ggml-org). - docs/superpowers/plans: the engine defects (1-3) from the report, with the evidence each task needs. The server defects (4-6) live with the server, in tinycoder-openai.
Per-token decode timing in tinycoder_bench
TINYCODER_TOKEN_TIMES=1 records every decode step and prints one [tg-times] summary per rep -- mean, p50, p95, max and first-5 vs last-5 -- plus the full series, labelled "cold" for the warmup pass and "rep N" for the measured ones. The point is to answer "are warm runs faster?" from a single run instead of inferring it from two aggregate rates: slow first tokens with a steady tail is a one-time cost inside the timed region (lazy kernel build, allocator growth, first touch); a uniformly slow series is clocks or bandwidth. The flag is off by default and costs no timing calls when unset, so published numbers are unchanged. Checked on the CPU path (Qwen2.5-0.5B-Instruct-Q2_K, 8 tokens): the per-token series sums to 4908.79 ms against the harness's own 4909.0 ms decode window, the 0.2 ms gap being argmax and loop overhead outside the timed region. With the flag unset the bench prints nothing new; --help documents the variable. Also reorders the Gpu* kernel includes in GPUComputeInternal.hpp -- include order only, no code change; the forward objects were rebuilt against the reordered header before this commit.
Per-model CPU thread pools and RAM optimization
CPU pools: each Model owns its ThreadPool; forward() binds it for the calling thread, workers resolve current() to their own owner, and the process-wide instance() remains the fallback for callers that never bind. RAM: the host-side LM-head embedding table is now built only in the form the dispatch actually selects -- Q8_K when the source type has a Q8_K dot kernel, FP16 otherwise (PQ2_0, BF16) -- and the Q8_K table is built row by row from the quantized source instead of dequantizing the whole matrix into F32 first. For a 248320 x 5120 vocab the old code kept F32 (5.1 GB) + FP16 (2.5 GB) + Q8_K (1.3 GB) resident for the life of the process although at most one is ever read; F32/FP16 are now opt-in via TINYCODER_EMB_TABLE=f32|f16|all. The row-streamed Q8_K build is asserted byte-identical to the whole-matrix build by unit_tests/EmbeddingTableTest.cpp. Halved the core build's warning count to zero on the way (unused kqsx, L, gemmPrefill, profSlot, int8S8Supported, nWords, mask, sw, sh0, startBit, c and a stale kt0; the Q3_K GEMV launch bound was 64*NW x 8 = 2048 > 1024 threads/SM, so ptxas dropped the occupancy hint -- it now names the block size the launches use, 32*NW; kResidualNormQ81 no longer marks its in-place x/y as restrict). Verified on this tree, RTX 2080 Ti, default env: peak RSS (VmRSS, 8-token prompt) before after Ternary-Bonsai-2-27B pq2_0 16.8 GiB 11.7 GiB (anon 9.7 -> 4.9) Qwen3.8-27B EXL3 1.60bpw 25.8 GiB 18.3 GiB (anon 18.2 -> 10.9) Ornith-1.5-35B q4_k_m 26.6 GiB 23.1 GiB (anon 20.8 = CPU experts) suite 119 tests, 102 passed, 0 failed, 17 skipped exl3_gpu_parity 29 [FAIL] baseline, identity probes maxAbsDiff=0.000000 logits probe id=198 logit=19.3076, top-5 198/1133/271/460/317 pp512/tg128 725.7/23.43, 723.6/23.39, 721.7/23.35 (published 727.5/23.60) core build 0 warnings
Context windows sized by VRAM/RAM (int8 K/V store)
maxSeqLen was a constant 2048 that no flag could move, and the K/V cache was f32 with no way to spend less per token, so the engine could not use a long window on any card. The window is now requested (Model::setContextLength, --ctx N on the bench and the probes) and granted by a planner from measured free VRAM/RAM: weights + the session's fixed 1,408 MiB + the K/V bytes/token of the model's geometry, picking the first rung that fits from (f32 + int8 decode mirror), (f32), (int8 store) and, on the host, the same ladder bounded by RAM. A request that does not fit is reduced to the fit and the limiting resource is named; below 1024 tokens the load is refused. The int8 path is a real K/V store (prefill and decode, arch-1 qwen35 full-attention and the MoE prefix), not a decode-only mirror, which is what lets a long window fit an 11 GB card. Default stays 2048, so every published throughput row still describes the shipped default (re-measured at the default: 9B 2554.9/83.44, Bonsai 878.7/ 51.28, 27B 727.4/23.52 -- inside the published spread). Measured grants and the gates on this tree (RTX 2080 Ti, 11 GB), each confirmed by a load that requested the window: Ornith-1.5-9B q4_k_m 41,984 f32+mirror | 52,480 f32 | 196,352 int8 Ternary-Bonsai pq2_0 16,640 f32 | -- | 64,256 int8 Qwen3.8-27B EXL3 2,560 f32+mirror | -- | 12,288 int8 A 44,892-token prompt prefills at 533 tok/s and answers a needle at 64k; a 64k window costs 2-6% of decode and nothing measurable at pp512. int8 at the same 2048 window moves the Bonsai logit by 0.0129 (same top-1, same top-3). Gates: parity 29 [FAIL] (unchanged), suite 114 tests / 97 passed / 0 failed, 27B logits id=198 19.308033 with top-5 198,1133,271,460,317, context gate exit 0 (six rows), text gate 8/9. Known, and in BENCHMARKS.md with the caveats: the 35B-A3B's text gate was already failing at d79d73f (byte-identical logits), arch-2 has no int8 store so it keeps f32 and its 2048 window, and 256k/1M need more memory than this card has (11.3-44.6 GiB) plus RoPE scaling this engine does not implement. Build and CLI defaults, because "the default build does not work" was the reported failure: a plain `cmake -B build` now enables the CUDA offload when nvcc is present (it used to be CPU-only, so `tinycoder_bench --gpu` answered "unknown option: --gpu"), `--gpu` and `--cpu` are parsed in every build (a CPU-only binary now says it needs a CUDA build and exits 2), and ENABLE_AVX512 defaults from the build host's CPU flags -- unconditionally ON produced a binary that SIGILL'd at startup on this Broadwell-class Xeon, which is also why the CPU-only build tree dies on every model. Verified: clean configure, no flags, ENABLE_CUDA=ON + ENABLE_AVX512=OFF, 9B at 83.79 tg / 1068.3 pp. Also fixes: generate() returned an empty logits array on an over-long prompt and the caller memcpy'd from it (crash at the shipped window), the host K/V for a partial offload was unbudgeted, and a host-slot mismatch aliased the last slot instead of reporting.
Bonsai models optimization
1.0.1 Bonsai models optimization
Fix performance issues
1.0.0 Fix performance issues