Skip to content

fix(ep-bench): strip C++ template args in kineto kernel-name match - #856

Merged
Binyang Li (Binyang2014) merged 1 commit into
feature/epfrom
qinghuazhou/patch_ep_bench_kineto_layout
Jul 27, 2026
Merged

fix(ep-bench): strip C++ template args in kineto kernel-name match#856
Binyang Li (Binyang2014) merged 1 commit into
feature/epfrom
qinghuazhou/patch_ep_bench_kineto_layout

Conversation

@seagater

Copy link
Copy Markdown
Contributor

The kineto per-kernel attribution in _kineto_kernel_us matched the "dispatch"/"combine" substring against the full demangled kernel name. The rank-major combineKernel is templated on DispatchLayout (combineKernel<.., DispatchLayout::RANK_MAJOR>), so its name contains the substring "dispatch" and was wrongly summed into the dispatch bucket. This only surfaced under --cuda-graph, where the combine kernel also appears in the dispatch profiling pass, doubling the reported dispatch kernel time (e.g. 16->32 us at 1 node). Match on the function name with template arguments stripped (text before the first "<") so DispatchLayout / CombineMode template params no longer collide.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

The kineto per-kernel attribution in _kineto_kernel_us matched the
"dispatch"/"combine" substring against the full demangled kernel name.
The rank-major combineKernel is templated on DispatchLayout
(combineKernel<.., DispatchLayout::RANK_MAJOR>), so its name contains
the substring "dispatch" and was wrongly summed into the dispatch
bucket. This only surfaced under --cuda-graph, where the combine kernel
also appears in the dispatch profiling pass, doubling the reported
dispatch kernel time (e.g. 16->32 us at 1 node). Match on the function
name with template arguments stripped (text before the first "<") so
DispatchLayout / CombineMode template params no longer collide.
@Binyang2014
Binyang Li (Binyang2014) merged commit 5f4128c into feature/ep Jul 27, 2026
6 checks passed
@Binyang2014
Binyang Li (Binyang2014) deleted the qinghuazhou/patch_ep_bench_kineto_layout branch July 27, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes EP kineto benchmarking’s per-kernel attribution by ensuring the dispatch/combine bucket matching is performed against the function name only, not the full demangled kernel name that may include C++ template arguments. This prevents templated combine kernels (e.g., templated on DispatchLayout::RANK_MAJOR) from being incorrectly counted as “dispatch” due to template-argument substrings, which was inflating dispatch time under --cuda-graph.

Changes:

  • Strip C++ template arguments from e.key by taking the substring before the first "<" when matching kernel names.
  • Add inline documentation explaining the mis-bucketing scenario and why the stripping is safe for these kernels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants