Skip to content

Commit a958614

Browse files
authored
Bug fix for conv1d (microsoft#26421)
### Description <!-- Describe your changes. --> We don't want to adjusted the dispatch size when we try to run `Conv1d`. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
1 parent 34b7558 commit a958614

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

onnxruntime/core/providers/webgpu/tensor/transpose.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ Status Transpose::DoTranspose(onnxruntime::webgpu::ComputeContext& context,
168168
//
169169
// TODO: Revert this change once the driver issue is fixed.
170170
if (context.AdapterInfo().vendor == std::string_view{"intel"}) {
171-
ORT_ENFORCE(rank == static_cast<size_t>(4), "Input tensor must have rank 4.");
172-
dispatch_x = ceil_div(input_shape[0] * input_shape[1], 2);
173-
dispatch_y = ceil_div(input_shape[2], 4);
174-
dispatch_z = ceil_div(input_shape[3], 8);
171+
// Only adjusted the dispatch size when rank is 4 yet.
172+
if (rank == static_cast<size_t>(4)) {
173+
dispatch_x = ceil_div(input_shape[0] * input_shape[1], 2);
174+
dispatch_y = ceil_div(input_shape[2], 4);
175+
dispatch_z = ceil_div(input_shape[3], 8);
176+
}
175177
}
176178
program.SetDispatchGroupSize(dispatch_x, dispatch_y, dispatch_z);
177179
}

0 commit comments

Comments
 (0)