From c12d70c477c265a6d1485699fd70df1675bc537c Mon Sep 17 00:00:00 2001 From: Jiajia Qin Date: Fri, 20 Dec 2024 18:06:25 +0800 Subject: [PATCH] [webgpu] Add kernel type to profile info --- onnxruntime/core/providers/webgpu/webgpu_context.cc | 1 + onnxruntime/core/providers/webgpu/webgpu_context.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.cc b/onnxruntime/core/providers/webgpu/webgpu_context.cc index fae329835067f..9ec3b3b23ab75 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.cc +++ b/onnxruntime/core/providers/webgpu/webgpu_context.cc @@ -239,6 +239,7 @@ Status WebGpuContext::Run(ComputeContext& context, const ProgramBase& program) { if (is_profiling_) { PendingKernelInfo pending_kernel_info(context.KernelContext().GetNodeName(), + context.KernelContext().GetOpType(), program.Name(), key, inputs, diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.h b/onnxruntime/core/providers/webgpu/webgpu_context.h index d1f43cdc4ddff..4724118a29b0a 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.h +++ b/onnxruntime/core/providers/webgpu/webgpu_context.h @@ -147,11 +147,12 @@ class WebGpuContext final { struct PendingKernelInfo { PendingKernelInfo(std::string_view kernel_name, + std::string_view kernel_type, std::string_view program_name, std::string_view cache_key, const std::vector& inputs, const std::vector& outputs) - : name{absl::StrJoin({kernel_name, program_name}, "_")}, cache_key{cache_key}, inputs{inputs}, outputs{outputs} {} + : name{absl::StrJoin({kernel_name, kernel_type, program_name}, "&")}, cache_key{cache_key}, inputs{inputs}, outputs{outputs} {} PendingKernelInfo(PendingKernelInfo&&) = default; PendingKernelInfo& operator=(PendingKernelInfo&&) = default;