Repository navigation
[Bugfix] Key CUDA graph dedup signatures on kernel function identity - #37657
Merged
Merged
Conversation
cctry
force-pushed
the
cuda-graph-dedup-kernel-identity
branch
from
September 2, 2026 21:03
0ff4af1 to
8acd2be
Compare
Kernel names are not identities: JIT compilers can emit different kernels with identical names from different modules, and cudaGraphExecUpdate keeps the exec's original values for launch attributes it cannot diff (e.g. preferred cluster dimension), reporting success instead of cudaGraphExecUpdateErrorAttributesChanged. On GB300 a stale preferred cluster (4,1,1) deadlocks the updated kernel in an mbarrier wait. Include the kernel/function handles in the dedup signature so only same-function launches share an exec.
cctry
force-pushed
the
cuda-graph-dedup-kernel-identity
branch
from
September 2, 2026 21:16
8acd2be to
8e708cb
Compare
cctry
marked this pull request as ready for review
September 2, 2026 21:20
cctry
requested review from
Fridge003,
Ying1123,
hnyls2002,
ispobock and
merrymercy
as code owners
September 2, 2026 21:20
StevenChenSE
pushed a commit
to StevenChenSE/sglang
that referenced
this pull request
Sep 6, 2026
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 26, 2026
…-prefill-graph(-split/-tiny/-max-prefix), --p-deep-split-from Picks der 27B-Linie in Reihenfolge (alle Schalter Default aus, P-Env/argv ohne Flag byte-gleich): upstream-Ports bac77bc (sgl-project#37657) eb6d7d6 (sgl-project#34184) dc9fbf9 (sgl-project#32219 Teil) als Voraussetzung des Prefill-Graphen; 5fd4e77 5d8612b 02e218f d24a17d 6b24aa6 3e093fe (P-Host-Overlap, #PGAP, P-NOSYNC); d32ddcb fb7ea2b 37ea1db 3e6ce57 (P-Prefill-Graph); 735db6a (+ 4e03821 als reine Verschiebung durch die Auflösung erledigt) f49f2fd 51e39d4 dc128e3 18639ea. Konfliktauflösungen: - scheduler_pp_mixin: NF H49 PP-HOST-PERIOD und 27B P-HOST-OVERLAP komponiert (die im Inventar genannte Doppel-Instrumentierung): H49 note_launch/note_no_batch/note_sync bleiben, der d2h-Wait steht zusätzlich im #PGAP-Span, deferred publish + Lead-Bound nach dem Launch wie 27B. Beide Instrumente getrennt schaltbar (H49-Env / --p-host-overlap). - unified_radix_cache: Chunk-Publish unter H2-sync_trace UND #PGAP-Span. - launcher common_flags: p_chunked_prefill_tokens() = Graph-Bucket oder P_CHUNKED_PREFILL_TOKENS (NF-Env, Default = Konstante; 27B byte-gleich). - argv_p: NF p_micro_batch_flags + 27B p_prefill_graph_flags() vor extra/H25-Strip. - solve_p_cut: prefill_graph_pool_mib neben NF sgl-project#114 activation_reserve. - --d-replayssm-spec der 27B-Hunks nicht doppelt registriert (NF-Form bleibt). Tests (test27b.sh): 20 portierte Testdateien 204 passed, 2 skipped; test_weg2_vision_prefill_graph_seam_0924 nicht gelaufen (Boot aktiv, incg-Schlange), nachzufahren. dup_defs_gate: 0 neu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
cudaGraphExecUpdatekeeps the exec's originally instantiated values for launch attributes thatcuGraphKernelNodeGetAttributecannot read back (e.g.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION) and reports success instead ofcudaGraphExecUpdateErrorAttributesChanged. We root-caused a deterministic hang on GB300 to this: updating an exec from a cuBLASLt kernel captured with preferred cluster (4,1,1) to a variant without fallback-cluster support launches it under 4-CTA clusters and deadlocks in an mbarrier wait.The dedup registry keys exec groups on kernel name + geometry + queryable attributes, but names are not identities: JIT compilers (triton,
torch.compile) can emit different kernels with identical names from different modules, so an exec-update could still cross functions whose capture-only attributes differ.Modifications
Add the kernel/function handles to
kernel_node_payloadso only launches of the same loaded function share a graph exec. One-line diff; dedup coverage is unchanged for real workloads since repeated captures of the same kernel reuse the same handles.Checklist
Verified on GB300: same-kernel captures still produce equal signatures (dedup preserved); two modules loaded from identical PTX (same name/geometry, different functions) now produce different signatures.
CI States
Latest PR Test (Base): ❌ Run #33684248365
Latest PR Test (Extra): ❌ Run #33684248154
Latest PR Test (AMD ROCm 7.2): ❌ Run #33684248469