Repository navigation
Conversation
This was referenced Nov 23, 2026
Contributor
Author
|
For anyone wanting to test the full Inkling 2 dual-GPU stack together ( |
cobra91
force-pushed
the
perf/inkling2-cuda-graph-ep2
branch
from
November 26, 2026 14:00
b938229 to
c234774
Compare
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.
Problem and result
In
cuda-ep2mode on non-P2P dual-GPU configurations (e.g. Windows WDDM / PCIe setups without NVLink), CUDA Graph capture was hardcoded to disabled (runner_->use_cuda_graph = false). Consequently, every token execution incurred eager kernel launches across both GPUs (~240 individual kernel launches per token driven by the host CPU), limiting decode performance to 61.8 - 62.8 tok/s even with asymmetric zero-P2P tail-skip.With this PR:
h_ep_x,h_ep_idx,h_ep_w,h_ep_y) are allocated as pinned mapped memory (cudaHostAllocPortable | cudaHostAllocMapped) with direct device pointer resolution on both GPUs (cudaHostGetDevicePointer).ev_moe_ready,ev_peer_done).cudaStreamCaptureModeGlobalinforward_seq,forward_tree_verify, andforward_batched, seamlessly capturing both the local GPU 0 looped core visits (36 visits) and the mapped peer dispatches on GPU 1 (12 visits) into a single unified CUDA Graph.cuda-lsat 45.0 tok/s). Prefill reaches 106.9 - 116.9 ppts (+53% to +66% over upstream 70.1 ppts).Related discussion
Builds directly upon PR #6811 (zero-P2P tail-skip). Replaces eager dispatch with hardware graph execution.
Approach
engine/src/inkling2/cuda/ink_runner.cuh:d_ep_x[2],d_ep_w[2],d_ep_y[2],d_ep_idx[2].init_dual_gpu, allocate mapped portable host memory and resolve device pointers for primary and peer GPUs.run_visit, usecudaMemcpyDeviceToDeviceacross mapped buffers for peer dispatches instead of host-bounce copies.cudaStreamCaptureModeGlobalduring stream capture whenep2_activeis true.use_cuda_graph = false;in EP2 initialization.engine/src/inkling2/cuda/ink_cuda_backend.cu:runner_->use_cuda_graphincuda-ep2mode whenvf_graph_ok && !model_.ls_active.Validation
Passed:
cmake --build build --target strata-inkling).sm_120) + GeForce RTX 4060 Ti 16 GB (Adasm_89), non-P2P PCIe, Windows 11.strata-inkling.exe --bench --native Inkling-2-Mini-UD-Q4_K_XL.gguf --draft off --gpus 2 --prompt-len 64 --gen 128cuda-ls): 70.1 ppts, 45.0 tok/s.cuda-ep2eager): 107.4 ppts, 61.8 - 62.8 tok/s.cuda-ep2with CUDA Graph): 106.9 - 116.9 ppts, 76.6 - 76.7 tok/s (+24% vs PR [Engine] inkling2: zero-P2P tail-skip for asymmetric dual-GPU and sm_75 TC fallback #6811, +70% vs v0.2.20).Failed:
Not run:
cudaMemcpyPeerAsync).ink_runner.cuhandink_cuda_backend.cuonly).Limits
cuda-ls) remains on eager multi-stage pipeline handoffs.