Skip to content

crit 0.2.0

Choose a tag to compare

@yafitzdev yafitzdev released this 21 Oct 12:46
· 6 commits to main since this release

Overview

crit 0.2.0 adds the Models module for recorded weight transforms, a recon step that freezes
each model's sampling, chat template and stop tokens into its candidates, measured run
benchmarks, and Core engine libraries that need no adapter code. Eval checks exactness on
the loaded engine, replays pinned text at long context and stops disturbed rounds. The
Python distribution crit (now including crit_models) and the native Core SDK
(critCore) share version 0.2.0. Runs recorded with 0.1.0 still verify.

Added

  • Models (guide): crit models produces transformed weights and
    records how they were made. The first workflow is post-training quantization:
    plan resolves a recipe against checkpoint headers, ptq quantizes projections to
    FP8 per-channel or NVFP4 by round-to-nearest or GPTQ (layer-streamed calibration
    through the official transformers code) and exports a compressed-tensors checkpoint,
    eval runs the output in an engine through Eval against the source model's data and
    reference, and verify re-hashes it. The models_transform record keeps the
    resolved recipe, calibration data and token-window hashes, seed, source and output
    file hashes, error measures and transform cost; models_evaluation binds an Eval
    result to it.
  • crit run --id RUN recon gathers the model's sampling defaults, stop tokens, chat
    templates and key config.json fields with file hashes into work/recon.json and
    scaffolds work/recon.md; later candidates freeze its frozen block as
    configuration.recon. A run whose model is a folder needs recon before its first
    candidate; single-file models are unchanged.
  • crit serve --load-timeout. The default bound on loading the starting candidate is now
    600 s plus the model's size at 50 MB/s, instead of a fixed 600 s.
  • Run records explain ineligibility. crit run benchmark and seal warn when a benchmark
    or candidate cannot qualify, and select names every blocker. The reasons are derived
    when asked; telemetry keeps the 0.1.0 projection, so earlier runs still verify.
  • crit run measure benchmarks a candidate's resident cases itself, through the package's
    Eval adapter in a reserved child process. The first measurement of a case pins its greedy
    text, when two runs repeat it, and every later candidate replays it, so decode speeds compare across candidates;
    load time and host and device memory are sampled during the run.
  • Core engine libraries: crit/native_engine.h exports a Core engine from a shared
    library with a C ABI (CRIT_EXPORT_ENGINE(factory)), and crit_core.native loads it
    and supplies the stock eval-v1 and chat-resident-v1 adapters, so an engine needs no
    adapter code of its own. ReplayContinuation carries Eval's replay text to the session.
  • Eval checks exactness on the loaded engine when the adapter declares plain and offers
    generate_plain(), instead of opening a second engine with speculative false. For an
    engine that streams 64 GB of experts from host memory, that removes one of three loads per
    round (about 3 minutes of 19). PlainDecoding ("plain": true in the generate options)
    carries the request to native engines, and the stock adapter offers it when the engine
    declares plain.
  • Eval stops a round when a speed case's decode speeds spread by more than
    disturbed_spread (25%) between repetitions: the device was disturbed. The partial result is
    marked aborted, run exits with code 3, and --keep-disturbed finishes the round anyway.
    A disturbed Flash-Next round previously ran its full 25 minutes, failed the lower-context gate
    on noise and had to be repeated.
  • fp8-kv-attention adds prefill_fp8: prompt attention with Q·Kᵀ and P·V on E4M3 tensor
    cores for head dimensions 64, 128 and 256, about twice prefill's throughput at long
    contexts with E4M3 rounding of queries and probabilities. Opt-in; prefill is unchanged.

Changed

  • A benchmark record that cites no checks binds the case's latest check per gate for the
    same package, instead of staying exploratory.
  • Safetensors indexes may list shards in subfolders (tensors/model-00001-of-00004.safetensors)
    as portable relative paths, in Core's C++ and Python readers and in the import audit;
    Eval's model identity counts them.
  • Core's static libraries build position-independent, so engines can link them into a
    shared library without rebuilding Core.
  • Under WSL, --write-launchers writes a serve.cmd that starts serve.sh in the same
    distribution.
  • A killed process tree has 60 s instead of 5 s to exit before cleanup counts as failed.
    Engines that pin tens of GB of host memory take longer than 5 s.
  • Eval's long-context points replay the longest speed case's pinned continuation when the
    data has one and the adapter replays, so context_decode no longer moves with each
    engine's own text; it compares only between results decoded on the same text.
  • Eval's prefill and TTFT floors count attention at the faster of the BF16 and FP8 rates.
    An engine with FP8 attention beat the BF16 floor.
  • crit eval kernels charges each kernel only the time after every earlier kernel ended,
    so a kernel launched early under programmatic dependent launch is not charged its wait;
    span_ms keeps raw durations.

Documentation

  • Eval adapter: an adapter may keep host-side weights in the process across the engines one
    crit eval run opens one after another; device state is built fresh for each engine.
  • RUN_RECORDS and AGENTS: publish a case's checks before the benchmark that cites them.
  • BUILDING_ENGINES: the example request no longer overrides settings.toml headroom.
  • CUDA backend: free memory under WDDM. device-expert-cache: measured next-layer
    prefetch results.
  • README: case studies for the Qwen3.8-27B NVFP4 and Qwen3.8-Flash-Next FP4-Local engines
    on one RTX 5090.