CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
[KCACHE-1] Content-keyed encoded-kernel cache with sealed prewarm and safe lifetimes
Closed · #158 · open 2026-10-28 11:15 UTC · closed 2026-10-28 17:23 UTC (reason completed)
Imported from GitHub aien-dev/CUDApp#158, by drakestapleton
drakestapleton wrote on 2026-10-28 11:15 UTC
Goal
Unify kernel artifact identity, preparation and residency policy across the existing caches. Current FP8 GEMV cache has 16 slots with pinned kernels and sealed-serving refusal; src/omega_gpu_tcgemm_api.c and src/omega_gpu_fp8gemm_api.c have 8 slots each. Reuse this code and GPU session lifetime behavior; do not add a second allocator or serving runtime.
CUDApp main b759afc3f5e46f152ffb06b39882ffa28cacaf96 and omega-mv main 6999fa9e6dae4847c155ef4eacaece74f491d3ca inspected 2026-10-28. Reinspect heads, active branches and complete source/receipts before editing.
Delivery slices
Freeze a canonical, versioned, padding-independent realization cache key: semantic task/contract; M/N/K or bounded shape family/tail/strides; all types, quant/scale/zero-point physical layout IDs; tile/warps/stages/pipeline family; numerical/synchronization mode; sm_121 target and demonstrated feature set; IR/encoder/spec/seed source identity and code/launch ABI. Shape-only or memcmp-on-uninitialized-struct keys are insufficient.
Separate distinct lifetimes: reusable compiled host artifact; validated code blob; device-uploaded kernel and launch metadata; sealed/pinned recording references. Content-addressed host artifact reuse must be revalidated for target/session; device handles and addresses are never portable.
Extend current prewarm/reservation for known Q36 decode, grouped expert, prefill and test shapes. During sealed graph recording a cache miss must deterministically refuse or follow an expressly admitted preexisting compatible path; no unbudgeted compile, GPU allocation or evict of in-flight code.
Bounded memory and concurrency: max resident bytes/slots, deterministic victim rules, immutable pinned references, session generation/invalidation on device reset/recovery/driver/encoder/target/profile changes, clean retirement after command lists complete.
Collect cache warmup/compile/verify/upload/record/launch times, hit/miss/eviction rates, code memory and request latency. Reuse #17 reporting and #57 selection; no benchmark changes under the guise of a cache win.
Acceptance / negative gates
Pinned warm decode workloads show zero code regeneration and zero unsafe eviction during recorded use; cold setup costs visible.
Key invalidates for changed scale layout, pipeline, tile, encoder, instruction spec, contract, driver/session generation and target; negative controls catch false hit and stale code address.
Concurrent registration, sealed miss, budget exhaustion and interrupted completion refuse/recover without use-after-free or hidden allocation.
Paired warmed/cold full-model and micro-bench result; if preparation savings are not on the measured hot path, report NO-GAIN rather than claiming TPS.
Delivery rules. New first-party production code/tests are native seeded .om; C sources can serve as migration/differential oracles until qualified cutover under #79. Preserve immutable receipts, one writer per shared file, no second GPU session/driver/IR/compiler. No silent CUDA/PTX/cuBLAS dependency. Keep the live 35B, driver and hardware scheduling unchanged; chip tests require an authorized GB10 window. Label HOST_TESTED/SIMULATED/CHIP_EXERCISED/WHOLE_MODEL_QUALIFIED separately; NOT_RUN/BLOCKED cannot become PASS. Record exact source/seed/compiler/target/binary/model hashes, commands/exits, positive and mutation results, baseline/variant raw timings.
Workstream links (2026-10-28)
Cache identity consumes #156 quant schema and #157 component realization and is selected by existing #57. The grouped MoE work list #159 may preload its bounded specializations, but no user data/weights are included in a code-cache key unless they alter generated code. Device memory, weights and code handles have different lifetimes.
did:key:z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd wrote on 2026-11-18 17:17 UTC
Native retained-template correction: signed source 3cc6140267a77dcd00f7bab33963725682f61847 (draft PR161), templates.om SHA08b8f9aad44cf64bc74653ceb314c78109bbaf59cd3d0ff2132fbc29d32f27c3. Actual bridge preparation exposed that original 79d173 program-mode fixture did not establish production bare-function compatibility: pinned e5b32567 fnstore rejects top-level text globals (EOF error9). Removed all four globals using existing filed packed-word constants, no allocation or ABI/schema change. Exact quant+realize+digest+templates production function image now compiles locally and via mounted pinned2c824805 Omega MCP,40832bytes SHA11b5bee6e72867e5a14cd221b5d9afb5053b3cfad9540bc4edd0b83c430e4724. Text-global negative control rejects9. Same-source native38 assertions, byte-identical independent exporter fixture, eight caught guard mutants and sandbox normal0 exercised. New immutable om/cache/templates-function-evidence.json; earlier receipts unchanged. NativeIntegrate owns real bridge regeneration/FP8-GEMM retained-snapshot caller smoke; not replaced by these module tests. Hardware upload timing/device/full-model acceptance NOT_RUN, no GPU/service/merge/deploy. Keep #158 open and PR draft/unlabelled. Exact integration requirements: /home/drakestapleton/handoffs/kernel-cache-native-templates-handoff-20261028.md.
did:key:z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd wrote on 2026-11-18 17:26 UTC