Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/models/qwen3/green-ctx-sm-partition.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ Power climbs with QPS: at QPS 8 the board still has headroom (draw oscillates ~5

## Pitfalls

- **The Xid 31/43 hit during bring-up was a cross-stream buffer use-after-free; the supported success and checked-`Result` paths are fixed — not an open driver risk.** Prefill temporaries are allocated on `ctx.stream` but consumed by override-stream kernels; the fix is a producer fence (`green_ctx::fence_producers_before_override`, ordering each `ctx.stream` alloc/H2D ahead of its override consumer) plus RAII stream drains that hold each stream until its kernels finish before any buffer frees or KV page is released — `PrefillTempBin` (prefill) and `DecodeStreamGuard` (decode), each fail-closed (a sync failure aborts). An arbitrary panic that unwinds past a not-yet-parked prefill buffer is out of scope.
- **The Xid 31/43 hit during bring-up was a cross-stream buffer use-after-free; the supported success and checked-`Result` paths are fixed — not an open driver risk.** Prefill temporaries are allocated on `ctx.stream` but consumed by override-stream kernels; the fix is a producer fence (`green_ctx::fence_producers_before_override`, ordering each `ctx.stream` alloc/H2D ahead of its override consumer) plus fail-closed RAII ownership. `LaunchedStreamGuard` drains launched prefill/decode streams before any pre-handoff return can recycle KV, `DeferredDrop` parks GPU-backed prefill temporaries until prefill-stream quiescence is proven, and `AsyncPrefillEvent` owns the launched prefill across the worker-to-executor handoff. An arbitrary panic that unwinds past an unarmed launch guard is out of scope.
- **The "`cuGreenCtxStreamCreate` itself faults on driver 590 + >16 GB resident" theory did not reproduce.** This 5090 (driver 590.48.01, ~27 GB resident — 19.3 GB of it KV) ran green-ctx clean across both 2026-06-19 sweeps and the 2026-06-20 three-mode smoke (split path fired, 0 Xid).

- **`gemm_lt` is still disabled under the stream override** (`5af4fd5`, to avoid the cuBLASLt workspace Xid-31 path). So split-path decode keeps its CUDA graph but loses the per-shape Lt tuning — a remaining decode-side lever, not yet re-measured under the partition.
- **A single request never exercises the split path** — smoke-test with concurrent load or you are only testing the full-SM graph.
- **Record async completion with the retained Green Context handle.** A Green Context stream does not reliably identify its owner through `cuStreamGetGreenCtx` when the derived context was never made current. The split command therefore carries `gctx_prefill` from `OverlapStreams` and records its blocking, timing-disabled event with `cuGreenCtxRecordEvent`; the shared-primary-context path still uses `cuEventRecord`. This keeps idle scheduler waits blocking and prevents an invalid or unrecorded event from bypassing prefill completion.
- **GPU launch ownership starts before a fallible forward returns.** `SplitConcurrent` arms stream-quiescence guards before both prefill and decode launches because either call may submit kernels before reporting an error. GPU-backed prefill temporaries move to a thread-local deferred-drop queue on both success and error, including errors raised inside the forward; only a successful prefill-stream synchronization drains that queue. The prefill guard remains armed through decode synchronization, decode-result construction, and completion-event setup; it disarms only after `LocalQwen3Lane::inflight_prefill` owns the launched work. The completion event then remains an armed RAII owner across worker aggregation and executor-side decode application, so any pre-handoff return synchronizes before the scheduler can recycle KV pages. A synchronization failure is fail-stop. Once query/synchronize has already proven completion, event-destroy failure is logged but intentionally non-fatal: it may leak a driver resource, but cannot race KV or temporary-buffer reuse.
- **`pkill` from an ssh one-liner matches its own command line** — use `pkill -f "[t]arget/release/openinfer"`, and kill/launch in separate ssh invocations.
- Build on the 5090 with `CUDA_HOME=/usr/local/cuda-13.1` (stale `/usr/local/cuda` → cuBLAS 12.9 N=1025 cliff; see `serving-perf-5090.md`). Verify `ldd target/release/openinfer | grep cublas` shows `.so.13`.

Expand Down
Loading
Loading