-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fused elementwises kernels and ops #51427
Changes from all commits
bd117a0
eb1081b
2525681
3c8b7d3
462f006
b72bd52
90f9217
190e797
4f72943
1ad3f16
f93b1a7
e4be4cc
0dc0b06
079fb83
e52e35d
3651b8e
f4909e8
b587ed0
734f4fe
4322409
6d21d73
b0116a2
1705253
f0d836c
a3c7d2d
0f36edf
e1d5eb7
f119f6f
833c2f1
db0831f
93b0b48
2c20932
4e600b4
24decf5
8d60160
b977541
62ae00e
a9dadce
d93d827
8920095
47a4745
7d2fa1a
20c3c33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,9 @@ void CPUQuantizePlacementPass::ApplyImpl(ir::Graph* graph) const { | |
"fused_conv2d", | ||
"fused_conv3d", | ||
"fused_matmul", | ||
"fused_elementwise_add", | ||
"fused_elementwise_mul", | ||
"fused_elementwise_sub", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove if-block cpu_quantize_placement_pass.cc:90 |
||
"elementwise_add", | ||
"elementwise_mul", | ||
"elementwise_sub", | ||
|
@@ -87,12 +90,7 @@ void CPUQuantizePlacementPass::ApplyImpl(ir::Graph* graph) const { | |
return; | ||
} | ||
|
||
// Remove this condition when all fused_elementwise ops are merged | ||
if (!(op->Op()->Type() == "elementwise_add" || | ||
op->Op()->Type() == "elementwise_sub" || | ||
op->Op()->Type() == "elementwise_mul")) { | ||
ConvertToFusedOp(op->Op()); | ||
} | ||
ConvertToFusedOp(op->Op()); | ||
op->Op()->SetAttr("mkldnn_data_type", std::string("int8")); | ||
}; | ||
gpd(graph, handler); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
type: "fused_elementwise_add" | ||
def { | ||
inputs { | ||
name: "X" | ||
} | ||
inputs { | ||
name: "Y" | ||
} | ||
outputs { | ||
name: "Out" | ||
} | ||
attrs { | ||
name: "axis" | ||
type: INT | ||
} | ||
} | ||
extra { | ||
attrs { | ||
name: "fuse_activation" | ||
type: STRING | ||
} | ||
attrs { | ||
name: "fuse_alpha" | ||
type: FLOAT | ||
} | ||
attrs { | ||
name: "fuse_beta" | ||
type: FLOAT | ||
} | ||
attrs { | ||
name: "fused_output_scale" | ||
type: FLOAT | ||
} | ||
attrs { | ||
name: "fused_unsqueeze2_axes" | ||
type: INTS | ||
} | ||
attrs { | ||
name: "scale_x" | ||
type: FLOAT | ||
} | ||
attrs { | ||
name: "scale_y" | ||
type: FLOAT | ||
} | ||
attrs { | ||
name: "scale_out" | ||
type: FLOAT | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is also float There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All comments to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
Scale_out
be deleted?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't a consistent naming scheme and many operators have "Scale" and many others have "scale", so it can be deleted once all operators have the same capitalization scheme, but it is outside of this PR scope