Skip to content

Commit 268b02c

Browse files
authored
[GPU] check the feature padding at onednn reorder (#31783)
### Description of the issue(symptom, root-cause, how it was resolved) - onednn reorder can not handle the feature axis padding. 'is_supported_pad()' function does not check the feature axis padding. - fallback to ocl if the reorder has the feature axis padding. #### The code and line that caused this issue (if it is not changed directly) - src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp - src/plugins/intel_gpu/src/graph/impls/onednn/utils.cpp #### Reproduction step and snapshot (if applicable. Do not attach for customer model) - reproducer is attached in the ticket <img width="912" height="446" alt="image" src="https://github.com/user-attachments/assets/db41a6f7-8738-4012-b5d7-6259cb922a0e" /> #### Problematic graph <img width="1308" height="885" alt="image" src="https://github.com/user-attachments/assets/b4ee632b-8375-4185-b7d1-b31bfe95b786" /> #### Checklist - [ ] Is it a proper fix? (not a workaround) - [ ] Did you include test case for this fix, if necessary? - [ ] Did you review existing test that can be extended to cover this scenario? Which test did you review? ### Tickets: - 172242
1 parent 0076e71 commit 268b02c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct ReorderImplementationManager : public ImplementationManager {
6565
return false;
6666

6767
// onednn doesn't support paddings
68-
if (!is_supported_pad(input_layout) || !is_supported_pad(output_layout))
68+
if (!is_supported_pad_for_reorder(input_layout) || !is_supported_pad_for_reorder(output_layout))
6969
return false;
7070

7171
// Native impl works faster for this type of reorder
@@ -90,6 +90,20 @@ struct ReorderImplementationManager : public ImplementationManager {
9090

9191
return true;
9292
}
93+
94+
static bool is_supported_pad_for_reorder(const layout& layout) {
95+
// check to support the batch/spatial pad for onednn.
96+
if (!is_supported_pad(layout))
97+
return false;
98+
99+
// Check feature pad
100+
const auto& pad = layout.data_padding;
101+
bool no_feature_padding = true;
102+
no_feature_padding &= (pad._lower_size[1] == 0);
103+
no_feature_padding &= (pad._upper_size[1] == 0);
104+
105+
return no_feature_padding;
106+
}
93107
};
94108

95109
} // namespace onednn

0 commit comments

Comments
 (0)