Files
leleka/crates/cuda-driver/Cargo.toml
T
Pavlo RatushnyiandClaude Sonnet 5.5 4232adaf44 cuda-driver: opt-in LELEKA_DRAFT_VOCAB selects an upstream draft subset (en, cyrillic, fr or a file)
The MTP draft head projects over the rows listed in rt/draft_vocab.bin (106,299 ids). Upstream ships
draft_vocab_en.bin (40,525 ids, 65,774 head rows fewer: ~110 MiB of VRAM and a shorter draft GEMV, at the
price that CJK/Cyrillic tokens can never be proposed). LELEKA_DRAFT_VOCAB=en|cyrillic|fr|<path> picks one;
unset (or 0/off/default) keeps rt/draft_vocab.bin and reads, logs and changes nothing.

* a selected file must have the sha256 of a recorded upstream subset (a name: that name's digest);
  another digest, a symlink, a wrong size or a too-large file is refused (the arm fails to load)
* a file that does not exist falls back to rt/draft_vocab.bin with one `FALLBACK` log line
* the startup VRAM reserve follows the selected file's size, so the freed VRAM reaches the expert slots
* one `leleka-serve draft-vocab: ... subset=en ids=40525 sha256=... file=...` line per bind when set
* sha2 becomes a dependency of leleka-cuda-driver (already in the workspace)

Unit tests (CPU only): setting parsing, table consistency, default reads/logs nothing, missing file
falls back, wrong digest refused for a name and a path, accepted digest reads the selected ids and the
reserve probe sees its size, malformed/oversized/symlink refused, subset index <-> full id round trip
and ids outside a subset. A real-file test runs when LELEKA_TEST_DRAFT_VOCAB_DIR names a directory
with the upstream draft_vocab*.bin (digests, counts, en ascending and inside the default list).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:28:10 +01:00

43 lines
1.5 KiB
TOML

[package]
name = "leleka-cuda-driver"
version = "0.1.0"
description = "Opt-in bounded CUDA Driver context and byte-buffer foundation"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
[dependencies]
leleka-model-format = { path = "../model-format" }
leleka-context = { path = "../context" }
leleka-experimental-ref = { path = "../experimental-ref" }
# sha256 of the opt-in draft-vocabulary subset file (LELEKA_DRAFT_VOCAB); same version as model-format
sha2 = "0.11"
[features]
default = []
cuda-driver = []
# Model-free GPU probes of the Original expert tier (slot fill from caller bytes); never a production path.
expert-tier-probe = []
# Embed the sm_86 companions of the sealed sm_120 PTX (crates/cuda-driver/ptx-sm86, docs/sm86-assets.md) and swap them
# in at module-load time on 8.6 <= cc < 12.0 devices. Off by default: the default build is the sm_120 one.
sm86 = []
[target.'cfg(all(target_os = "linux", target_pointer_width = "64"))'.dependencies]
libc = "=0.2.190"
# Windows: the dlopen family and friends come from a shim; lib.rs aliases it to `libc` so the call sites stay identical.
[target.'cfg(windows)'.dependencies]
leleka-libc-shim = { path = "../libc-shim" }
[dev-dependencies]
serde_json = "1"
# The workspace unsafe forbid remains unchanged. Only private ffi.rs may allow
# unsafe code; all other modules deny it, and unsafe operations require blocks.
[lints.rust]
unsafe_code = "deny"
unsafe_op_in_unsafe_fn = "deny"
[lints.clippy]
all = "warn"