Skip to content
Merged
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
10 changes: 6 additions & 4 deletions onnxruntime/core/providers/webgpu/tensor/transpose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ Status Transpose::DoTranspose(onnxruntime::webgpu::ComputeContext& context,
//
// TODO: Revert this change once the driver issue is fixed.
if (context.AdapterInfo().vendor == std::string_view{"intel"}) {
ORT_ENFORCE(rank == static_cast<size_t>(4), "Input tensor must have rank 4.");
dispatch_x = ceil_div(input_shape[0] * input_shape[1], 2);
dispatch_y = ceil_div(input_shape[2], 4);
dispatch_z = ceil_div(input_shape[3], 8);
// Only adjusted the dispatch size when rank is 4 yet.
if (rank == static_cast<size_t>(4)) {
dispatch_x = ceil_div(input_shape[0] * input_shape[1], 2);
dispatch_y = ceil_div(input_shape[2], 4);
dispatch_z = ceil_div(input_shape[3], 8);
}
}
program.SetDispatchGroupSize(dispatch_x, dispatch_y, dispatch_z);
}
Expand Down
Loading