Skip to content

Commit c8328b7

Browse files
authored
matmul: change onednn commit & revert wa (#3556)
1 parent de48098 commit c8328b7

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

csrc/gpu/oneDNN/Matmul.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,10 @@ namespace oneDNN {
2323
static inline void matmul(
2424
Tensor& result,
2525
const Tensor& mat1,
26-
const Tensor& mat2_,
26+
const Tensor& mat2,
2727
const Tensor& b_raw,
2828
bool m2_trans,
2929
Attr attr) {
30-
// FIXME: There is a onednn bug causes broadcast post fusion to be
31-
// accuracy error when t2 is column major
32-
Tensor mat2;
33-
DeviceId curDevID;
34-
dpcppGetDevice(&curDevID);
35-
bool mat2_wa_flag =
36-
(!Settings::I().has_2d_block_array(curDevID)) && (mat2_.dim() == 2);
37-
if (mat2_wa_flag && m2_trans == false && mat2_.size(0) < 16) {
38-
mat2 = mat2_.transpose(0, 1).contiguous();
39-
m2_trans = true;
40-
} else if (mat2_wa_flag && m2_trans == true && mat2_.size(1) < 16) {
41-
mat2 = mat2_.contiguous();
42-
} else {
43-
mat2 = mat2_;
44-
}
45-
4630
size_t dims = result.dim();
4731
TORCH_CHECK(
4832
dims == 2 || dims == 3,

third_party/oneDNN

0 commit comments

Comments
 (0)