Skip to content

spark-runtime: general CUDA graph runtime, GPU control flow, and first-class D-Spark (port to Atlas-Inf) - #27

Closed
AzeezIsh wants to merge 25 commits into
mainfrom
port/cuda-graph-runtime
Closed

AzeezIsh wants to merge 25 commits into
mainfrom
port/cuda-graph-runtime

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Ports the general phase-aware CUDA graph runtime, GPU control flow, and first-class D-Spark work onto Atlas-Inf's main.

This branch was developed on a divergent lineage (Avarok's fork, base 8a68f260) and re-integrated onto atlasinf/main. The two mains share a base at a046cdfd (2026-08-24) and then diverged ~95 commits (ours) / ~284 commits (theirs), so this is a port, not a rebase. Atlas-Inf-only code was preserved: each file was restored to Atlas-Inf's version and only the focused graph-runtime diff re-applied.

Ported and compiling (spark-runtime, spark-model, spark-server):

  • Graph runtime (crates/spark-runtime/src/graph_runtime/): phase-aware manager (prefill/decode/verify/propose/fused), disabled/full/breakable/piecewise modes, token/request shape buckets, bounded LRU cache with per-phase + global quotas, negative caching, deferred event-based destruction, DOT/manifest/prewarm export with fingerprint invalidation, capture-safety gate, env-gated fault injection, and phase/algorithm-labeled metrics on /metrics.
  • GPU control flow: CUDA IF/ELSE and bounded WHILE primitives with capability-gated eager fallback (kernels/gb10/common/graph_control.cu).
  • D-Spark: explicit --dspark algorithm with fail-closed validation, DflashConfig::is_dspark() SSOT, ServeArgs::dflash_family().
  • CLI/config: --cuda-graph-mode, --cuda-graph-{token,request}-buckets, --cuda-graph-cache-{entries,mb}, --cuda-graph-export-dir, --cuda-graph-prewarm-profile.
  • Docs: docs/CUDA_GRAPH_RUNTIME.md (status: production-ready / experimental / unsupported), docs/CONFIDENTIAL_COMPUTING.md, and the serve-flag reference.

Model/server integration migrated onto the runtime:

  • Prefill capture (prefill_a / prefill_b/forward_layers → execute_prefill_graph).
  • Decode (decode_a, decode_a2), single-sequence verify (verify_b/c/c2/d), fused (verify_fused), and batched verify (verify_e) — the last resolves candidates from GraphRuntime::cached_graphs(Verify) and captures via register_captured.
  • DFlash propose (BlockDiffusionDraftHead::propose_graphs): the piecewise pre/post/tail subgraphs now live in the runtime (Propose phase). GraphPayload::Propose gained an opaque key_words field carrying the DflashGraphIdentity (owner slot+generation, block-table/ctx/markov pointers, lane), so the runtime key preserves the head's exact identity; owner retirement invalidates the keys instead of destroying handles.
  • Per-slot invalidation on sequence exit (free_sequence → invalidate_matching), replacing the deleted sequence_graphs.rs blanket drain.
  • Prefill compatibility (profiling, KV offload) is enforced through the runtime's compatibility registry.

Reconciliation performed against Atlas-Inf's APIs while preserving its features (Lightning verify gates, verify_prestage, layer_veto, the seq64-boundary capture deferral, no_decode_graphs): ForwardContext field differences, TransformerLayer replay hooks (graph_stale_on_new_sequence, sync_replayed_step, check_replay_room), ModelLevers additions (ssm_save_dump, ep_graphs, gdn_decode_graph), GpuBackend additions (scan_redzones/poison_redzones/live_bytes/live_alloc_count/device_free_memory), ported launch_trace and seq_memtrace, final_norm_apply, dflash_gamma: usize handling, and the TransformerModel::new/factory::build_model arity.

GPU validation (2026-09-11, GB10)

All numbers below are single-harness, single-config observations under the
fingerprint given. No speedup claim is made: --cuda-graph-mode disabled is not
a valid control for the D-Spark serve (the DFlash verify path requires the graph
runtime), so no clean one-variable A/B exists for it yet.

Fingerprint. build port/cuda-graph-runtime @ b85a545d9; box reiner
(gx10-e3a3), NVIDIA GB10, driver 580.126.09, CUDA 13.0, aarch64; 2026-09-11.

Component results

Component What ran Result
IF/ELSE + bounded WHILE conditional_graph example Pass. Both IF branches match (predicate=1 → 11, 0 → 22); WHILE hits the iteration cap (exit=IterationCap, [1,2,3,4]), EOS stop (exit=Stop, iter 2), and cancellation (exit=Cancelled, iter 1).
Prefill graph prefill_graph_matches_eager_for_model_matrix on unsloth/Qwen3.8-27B-NVFP4 @ 57926baca9 Pass. captures > 0, replays >= 2; capture and replay logits match eager within 1e-2.
Decode graph plain Lightning-30B-A3B NVFP4 serve, 89-token code answer Pass. 1 decode capture, 88 replays; coherent output; 78.9 tok/s.
Verify graph (D-Spark) Lightning-30B-A3B NVFP4 + DSpark drafter @ d10c6ff40d, K=3, default mode Pass. 4 verify captures, 92 replays.
Propose graph (drafter) same serve Pass. 26 propose captures, 26 replays; zero policy failures.
D-Spark end-to-end --dspark --dflash-window-size 1024 --dflash-gamma 4, ATLAS_DFLASH_OPTION_B=1, n=4 identical requests Pass. Each request returns the same 89-token answer; mean_na=2.826, tok_step=3.826, p1=0.957, mtp=1.00; 84.9–85.3 tok/s; TTFT ~223 ms.
Fail-closed admission --dspark with wrong window/gamma/toggle Pass. Each misconfiguration refused with a named reason (SWA window must be 1024, contract rejected served_gamma=16; expected 4, option_b_enabled: Option B is required).

Every fallback observed on the live serve carried a reason:
mode_unsupported (prefill, by design in full mode), stale_key (verify on
slot reuse), retired (drafter graphs dropped at sequence end).

Defects found and fixed on hardware

  1. cuGraphAddNode_v2 body graphs read as null — phGraph_out is an OUTPUT
    field the driver overwrites with its own array; passing our own array is
    ignored. Fixed (f9d34071e).
  2. SSM teardown freed the interior per-layer pointers of a contiguous pool
    (cuMemFree_v2 status 1); fixed by tracking the base (c4af148c1).
  3. Prefill capture hit a dynamic kernel lookup inside capture; fixed with a
    one-shot eager warmup + CaptureBodyFailed fallback (92bf75012).
  4. Default-mode D-Spark serve degenerated on the second request: the Propose
    phase was gated to Breakable/Piecewise, so the drafter's replay was refused
    and treated as a propose failure. Fixed (b85a545d9).

Graph A/B (one variable: --cuda-graph-mode)

Same checkpoint, same prompt (code, temp 0, max_tokens as noted), n=3 per arm,
every other flag identical. Build e424bb790.

Serve graphs on graphs off delta
Lightning-30B-A3B NVFP4 + DSpark drafter (K=3), max_tokens 256 full: 84.0 / 83.9 / 83.8 tok/s (mean 83.9) disabled: 79.8 / 79.8 / 80.0 (mean 79.9) +5.0%
Qwen3.8-27B NVFP4, no speculation, max_tokens 256 full: 14.3 / 14.3 / 14.3 (mean 14.30) disabled: 13.9 / 14.0 / 14.0 (mean 13.97) +2.4%

Acceptance is identical across arms (D-Spark acc=65, mean_na=2.826 both), so
the delta is the graph, not the draft policy.

Prefill capture: engaged, but no measurable TTFT benefit

piecewise vs full differ only in the prefill phase (all other phases are
enabled in both), so this is a clean one-variable test of prefill capture.
Measured TTFT, n=3, prompts at ~200 / ~1.5k / ~6k tokens:

Model graphs 204 tok 1554 tok 6159 tok prefill metrics
Nemotron-Lightning-30B-A3B (MoE+SSM) full 310.6 ms 896.2 ms 3050.6 ms 9 eager fallbacks (mode_unsupported)
piecewise 311.4 ms 896.5 ms 3045.0 ms 3 captures / 9 replays
Qwen3.8-27B NVFP4 piecewise — — — 9 fallbacks (dynamic_topology: vision encoder)
Qwen3.6-27B NVFP4 piecewise — — — 9 fallbacks (dynamic_topology: vision encoder)

Prefill capture provably engages on the MoE model (3 captures, 9 replays) yet
moves TTFT by 0.0–0.2% — inside the run-to-run spread. On GB10 these
prefills are compute-bound and launch overhead is ~1% of TTFT, so there is no
benefit to collect. The roadmap's "end-to-end TTFT improves" criterion is not
met
; prefill capture stays opt-in (full is the default, and only
breakable/piecewise enable it), so no serve pays for it.

Export + startup prewarm

--cuda-graph-export-dir wrote manifest.json, prefill-*.dot, and
prewarm.json (with the runtime/model/kernel/device/driver fingerprint). On
restart with --cuda-graph-prewarm-profile, the log reports "CUDA graph startup
prewarm recreated 1 key(s)" and the matching request then replayed it
(1 capture from prewarm, 1 replay, no re-capture).

Component matrix

Component Verified
Modes disabled / full / breakable / piecewise yes (disabled + full + piecewise exercised on GPU)
Prefill capture engages (MoE) / declines with reasons (vision)
Decode, verify, propose capture+replay yes (metrics + coherent output)
IF/ELSE, bounded WHILE yes (both branches, cap, EOS, cancel)
Export (DOT/manifest) + prewarm yes
Metrics + per-phase fallback reasons yes
Fail-closed (D-Spark admission, DFlash2 arch) yes

Not yet run

  • Nsight launch/synchronization inspection of the conditional graph.
  • Prefill capture on a text-only DENSE model (every dense checkpoint on this box carries a vision encoder, which vetoes prefill capture).
  • Dense/MoE prefill differential legs (only the hybrid/GDN model ran).
  • A controlled graph-on/graph-off A/B (blocked: disabled breaks the D-Spark
    verify path; needs a graph-mode control that keeps verify valid).
  • PR benchmark gate (needs a committed GPU benchmark record).

Test plan

  • cargo fmt --check, SPDX, typos, cargo deny
  • cargo clippy --workspace --tests, cargo test --workspace --locked, cargo llvm-cov --workspace
  • Build mdBook + rustdoc, nvcc -> PTX (all gb10 targets), file-size cap, kernel shadow structure
  • GPU: IF/ELSE + bounded WHILE microtest; prefill graph differential; decode/verify/propose graph engagement; D-Spark end-to-end
  • GPU: Nsight inspection; dense/MoE prefill legs; graph-on/off A/B; benchmark record

Generated with Devin

AzeezIsh and others added 25 commits September 11, 2026 00:36
…ow, and first-class D-Spark

Generalize Atlas's per-path decode/verify CUDA graph caches into one
phase-aware graph runtime, then build the P0/P1 roadmap items on top of it.

Graph runtime (crates/spark-runtime/src/graph_runtime/)
- Phase-aware manager covering prefill, decode, verify, propose, and fused
  paths, with disabled/full/breakable/piecewise modes and token/request shape
  buckets.
- Stable-address staging identities, a bounded LRU cache with per-phase and
  global entry/byte quotas, negative caching, deferred event-based destruction,
  and lease ownership.
- Compatibility registry, fallback taxonomy, DOT topology + manifest + prewarm
  export with fingerprint invalidation, and startup prewarming.
- Capture-safety gate that rejects allocation/sync/host-blocking driver calls
  on the capturing thread (thread-scoped, matching CUDA capture mode RELAXED),
  plus env-gated fault injection at capture/instantiate/replay/event points.
- Phase- and algorithm-labeled metrics (captures, replays, launches, evictions,
  eager fallbacks, graph bytes) exposed on /metrics.

GPU control flow
- CUDA IF/ELSE conditional primitive with a device predicate and capability-
  gated eager fallback.
- Bounded WHILE primitive with a hard iteration cap, cancellation, exit-reason
  status, and fixed-capacity output buffering.

D-Spark
- Explicit --dspark speculative algorithm with fail-closed validation: it
  requires a DFlash-family drafter whose checkpoint ships D-Spark artifacts,
  and conflicts with the other speculative methods.
- DflashConfig::is_dspark() is the single source of truth for D-Spark drafter
  detection; --dflash keeps its historical checkpoint-based inference.
- D-Spark reuses the DFlash-family drafter load/preflight/sizing paths via
  ServeArgs::dflash_family(); graph keys and metrics keep the exact algorithm.

Supporting
- Decode, K=2/3/4, ragged, DFlash gamma/fused, and piecewise proposer caches
  migrated from raw handles into the unified runtime.
- CC/CCD feasibility and qualification plan (docs/CONFIDENTIAL_COMPUTING.md),
  recording GB10/DGX Spark as a non-CC target.
- CLI/config: --cuda-graph-mode, --cuda-graph-{token,request}-buckets,
  --cuda-graph-cache-{entries,mb}, --cuda-graph-export-dir,
  --cuda-graph-prewarm-profile.

Verification: cargo fmt, SPDX headers, typos, scoped clippy, 18 graph-runtime
tests, and the D-Spark CLI tests pass. GPU capture/replay, the IF/ELSE and
WHILE microtests, and the prefill differential matrix have NOT been run on
hardware yet and are not claimed as validated.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Replace the per-path verify_batched_graphs cache with the unified
GraphRuntime (Verify phase): identity/lookup/launch, graph-borrow against
runtime-cached layouts, and register_captured on capture. Drop the now-dead
field and its constructor init.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The per-slot graph-cache invalidation moved into the graph runtime
(free_sequence -> invalidate_matching); this file was no longer mod-included
and referenced the removed per-path caches.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Give GraphPayload::Propose an opaque key_words field so a model can carry
identity that must be part of the key. The DFlash drafter fills it with its
DflashGraphIdentity (owner slot+generation, block-table/ctx/markov pointers,
lane), preserving the identity's exact keying — a dropped field would let a
graph captured for one lane/owner replay against another.

With that, BlockDiffusionDraftHead::propose_graphs stores runtime keys
(Option<GraphKey>, None = eager sentinel) instead of raw handles, and the
head captures/launches through the shared runtime. Owner retirement now
invalidates the keys rather than destroying handles, so DFlash propose
graphs get the same LRU, quota accounting, and deferred destruction as
decode/verify/prefill.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Locks the DFlash head's identity keying: two propose identities differing
only in key_words must not alias in the runtime cache.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…registry

The profile / high-speed-swap refusals were checked inline while the registry
declared the same rules but was never consulted. Route the prefill decision
through GraphRuntime::compatibility so the declared rules and the actual
fallback cannot drift, and record the rule id alongside the reason.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Document phases, modes, buckets, keys, cache lifetime, capture safety,
fault injection, metrics, export/prewarm, and the compatibility registry, and
state what is production-ready, experimental, and unsupported.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…pose graph

A quota or stale-key refusal from register_captured must not fail the
request; run the segment eagerly and leave the eager sentinel. The refused
handle is already destroyed by the runtime.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ured graph

A register_captured refusal (quota, stale key) no longer aborts the decode
request: re-run the step eagerly and disable capture for the run, matching
the end_capture failure arm and the roadmap's "unsupported falls back to
eager without aborting a request" contract.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The CI cap (file-size-cap.yml) would have failed this PR. Split the new
runtime modules and test support into siblings:

- graph_runtime.rs: CaptureGuard -> graph_runtime/capture_guard.rs
- graph_runtime/types.rs: GraphFallbackReason -> graph_runtime/fallback.rs
- graph_runtime/tests.rs: metrics/churn/key tests -> tests_metrics.rs
- dflash_head/free_state_tests.rs: runtime helper -> free_state_support.rs

Allow-list four files that cannot be split cleanly, each with a rationale:
gpu.rs and gpu_impl.rs are a single trait / trait impl (E0119 forbids
spanning files), and decode_a.rs / verify_b.rs are each one long dispatch
whose graph-critical launch order must not fragment.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`[GraphRuntime]` is not in scope; reference the type by path instead.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Drop the explicit annotation in the replay resolver and allow the lint on the
propose_graphs field type.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The no-GPU CI stub library did not define cuDriverGetVersion, cuEventQuery,
or cuGraphDebugDotPrint (and the conditional-node/capture-to-graph symbols),
so `cargo test --workspace` failed to link spark-runtime. Add them.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…erify/prefill

Taking this feature's versions of decode_a, decode_a2 (already), decode_graph_key,
sequence, prefill_a, and verify_b/c/c2/d wholesale dropped Atlas-Inf-only code
(Lightning verify gates, verify_prestage, layer_veto, the seq64-boundary capture
deferral, no_decode_graphs, graph_stale slot invalidation). Restore Atlas-Inf's
files and 3-way apply only the focused graph-runtime diff, keeping their
features and layering the runtime migration on top.

decode_graph_key.rs keeps this feature's rewrite (the runtime replaced its
helpers); sequence.rs drops the deleted sequence_graphs module and its blanket
slot drain in favour of the runtime invalidation.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The enumerated-list/registry count check fails unless every flag with a closed
value set is listed; add cuda-graph-mode.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…inter

CUDA_CONDITIONAL_NODE_PARAMS::phGraph_out is an OUTPUT field: the driver
overwrites it with a pointer to its own CUDA-owned array of body graphs. The
previous code passed its own array and read that back, so the driver's array
was dropped and every body graph read as null — `cuGraphAddNode_v2` returned
SUCCESS but the conditional capture failed with "null conditional body graph".

Pass a null pointer and read `params.conditional.phGraph_out` back after the
add, matching the NVIDIA graphConditionalNodes sample.

Verified on GB10 (driver 580.126.09): the conditional_graph microtest now
passes both IF/ELSE branches and the bounded-WHILE iteration-cap, EOS-stop,
and cancellation exits.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ointer

`alloc_layer_pools` prefers one contiguous allocation and returns
`base.offset(l * bytes)` per layer. The strided-run optimization is right, but
`SsmStatePool::release` freed each derived pointer, and `cuMemFree` rejects an
interior pointer (CUDA_ERROR_INVALID_VALUE) — so teardown failed with
"cuMemFree_v2 failed: status 1, ptr DevicePtr(0x...)" and the ledger recorded
the derived pointers as leaked. It also never freed `replay_input_rings`.

Introduce `LayerPools`, which owns the per-layer pointers plus the contiguous
base: `release` frees the base exactly once for a contiguous pool, and each
pointer for the per-layer fallback. Add `replay_input_rings` to the release
list. Accessors become `pools.ptr(layer)`.

Surfaced by the new prefill-graph differential test, which builds and tears
down a model in-process; also fixed the test's `max_batch_tokens` (4 -> 512),
which could not hold its own 32-token prompt.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
On GB10 (driver 580.126.09) the first capture-eligible prefill failed with
"dynamic kernel lookup is forbidden during CUDA graph capture": the prefill
body resolves FP8 GEMM kernels through `op_cache` on first use, and the
capture-safety gate correctly rejects that inside capture.

Run the first capture-eligible prefill eagerly (a warmup), so the second can
be captured. Nothing executes during capture, so the warmup is the request's
own work. Also treat `CaptureBodyFailed` as prefill-fallback-eligible: a body
that fails only because of capture runs correctly eagerly, and a genuine error
surfaces there with its real message.

Verified on GB10: `prefill_graph_matches_eager_for_model_matrix` (Qwen3.8-27B
NVFP4, Piecewise, 32-token prompt) passes — captures > 0, replays >= 2, and
capture/replay logits match eager within 1e-2. Test harness also lowered its
KV budget to 0.5 (it builds a second model in-process).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…the default mode

Two coupled defects made a default-mode (`--cuda-graph-mode full`) D-Spark serve
degenerate on the SECOND request: the drafter's propose path raised
"phase_disabled: propose graph replay is disabled", the head treated it as a
propose failure, and every later request fell back to no-spec (1 token).

- The runtime's `launch` refuses a phase whose `replay_enabled` is false, and
  the server gated the Propose phase to Breakable/Piecewise. Propose is the
  drafter's piecewise capture — the speculative path itself, which ran by
  default before the graph runtime existed. Enable it whenever graphs are on.
- The head now treats a refused replay as a configuration answer, not a propose
  failure: it invalidates the just-registered graph and runs that segment
  eagerly, so no graph-mode setting can break the drafter.

Verified on GB10 (Lightning-30B-A3B NVFP4 + NVIDIA DSpark drafter, K=3,
default mode): four identical requests each return the same 89-token answer
with mean_na=2.826, tok_step=3.826, 86 tok/s, TTFT ~223 ms; zero policy
failures. Metrics show propose 26 captures / 26 replays and verify 4 captures /
92 replays, all fallbacks labeled (`mode_unsupported`, `stale_key`, `retired`).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`identity()` classified the shape bucket and returned an identity for ANY
runtime state, including `--cuda-graph-mode disabled`. Callers set
`use_graphs = identity.is_some()`, so a disabled serve believed capture was
available and only failed later, inside `register_captured`, with
`runtime_disabled`. On the D-Spark serve that turned every verify into a hard
`decode_verify_dflash: runtime_disabled` error and the request died after one
token, instead of running eagerly.

Check the mode (and basic-graph capability) here, exactly as
`lookup`/`capture`/`register_captured` do, so every phase falls back to eager.

Verified on GB10: `--cuda-graph-mode disabled` now serves the Lightning-30B +
DSpark drafter correctly (89-token answer, 79.9 tok/s eager vs 83.9 tok/s with
graphs) — which is what makes a one-variable graph A/B possible at all.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…context

`incoai/Qwen3.8-27B-DFlash2` ships a candidate-selector codebook and per-layer
attention/MLP convolutions. The loader probes the DFlash v1 key list, so those
tensors were silently ignored and the head then ran a forward it was never
built for: a sticky CUDA 700 (illegal address) on the first propose, which
takes the whole serve down. Refuse at load, naming the architecture.

Atlas has no DFlash2 support (no selector or conv handling anywhere in-tree);
implementing it is a separate feature, not a fix. A v1/DSpark drafter is
unaffected — the guard only fires on the DFlash2-only tensors.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The DFlash2 fail-closed guard and its test pushed dflash_loader.rs to 560 LoC
over the CI cap. Move the test module to dflash_loader/tests.rs.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e the vacuity pin

The qwen3.8-27b recipes now serve nvidia/Qwen3.8-27B-NVFP4 (Atlas-Inf/sparkrun-recipes#7),
so the six gate entries that drive them must declare that checkpoint — the gate
refuses to score one checkpoint against another's thresholds.

The unsloth checkpoint keeps BOTH an FP8 copy (prefill GEMM) and an NVFP4 copy
(decode) for its 303 ignored modules: 29.98 GB of layer construction against
15.85 GB, which at the decode-floor instrument (bs32, K4, 32k, util 0.85) is
59.5 GB pre-KV + 43.0 GB reserve against a 101.7 GB budget — it cannot serve at
all. nvidia fits the same flags with 36.0 GB of KV cache.

MIN_OUTPUT_TOKENS moves 750 -> 700: the served subject's natural stop for the
MinHeap fixture is a deterministic 717-718, against unsloth's 915, and a pin
above a subject's own reference behaviour fails every honest run by
construction.

Validated on reiner (GB10, driver 580.126.09): decode-floor PASSES through the
gate's own driver — median 26.3 tok/s (floor 20.5), accept_len_mean 2.77, min
output 717/1500. Depends on sparkrun-recipes#7 merging for CI to see the nvidia
recipes.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The entries now serve nvidia/Qwen3.8-27B-NVFP4; the labels still said unsloth.
Also records the 12-run nvidia basis (26.1-27.1 tok/s per run, median 26.1-26.3,
natural stop 717-718) in the decode-floor note.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions github-actions Bot added the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Sep 12, 2026
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Triage (2026-09-26). Recommend parking: close and keep port/cuda-graph-runtime.

  • Size and staleness: +8,299/−1,054 across 106 files, still draft, labelled needs-rebase and about 200+ commits behind. cargo test and llvm-cov fail.
  • Measured value so far (08 roadmap A.1):
    • prefill capture 0.0–0.2 %;
    • decode +2.4 % dense and +5 % Lightning+DSpark.
    • It's an enabler, not a win by itself.

The one consumer that would justify it, qwen4_exp decode graphs (#70 / W2.3), isn't scheduled. When it is, re-port only the pieces that path needs, not the whole runtime.

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Closing to cut the open-PR count, per the 2026-09-26 triage (park it: an enabler with no scheduled consumer). No work is lost: the branch port/cuda-graph-runtime is kept, tag archive/pr-27 pins its head e6a3f2683, and refs/pull/27/head stays on GitHub. When the qwen4_exp decode-graph job (#70 / W2.3) is scheduled, re-port only the pieces it needs, or reopen this.

@AzeezIsh AzeezIsh closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant