Skip to content

Commit 2493aeb

Browse files
[AMP] Register some new ops (#9849)
* add new mixed precision ops * remove space * Update python/tvm/relay/transform/mixed_precision.py Co-authored-by: Cody Yu <[email protected]> Co-authored-by: Cody Yu <[email protected]>
1 parent 51803ed commit 2493aeb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/tvm/relay/transform/mixed_precision.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"scatter",
6666
"full",
6767
"dyn.full",
68+
"nn.depth_to_space",
6869
# Comparison
6970
"less",
7071
"greater",
@@ -88,13 +89,19 @@
8889
"min",
8990
"maximum",
9091
"minimum",
92+
"argmax",
93+
"argmin",
9194
"nn.relu",
9295
"nn.leaky_relu",
9396
"nn.prelu",
9497
"nn.dropout",
9598
# Complicated activations which saturate in a narrow range
9699
"sigmoid",
97100
"tanh",
101+
"fast_tanh", # Some coefficients outside of representable range, but probably ok
102+
"fast_exp",
103+
"fast_erf",
104+
"clip", # Usually safe, may result in oddity if clip greater than fp16 range
98105
# Pooling operations
99106
"nn.max_pool1d",
100107
"nn.max_pool2d",
@@ -108,6 +115,7 @@
108115
"nn.adaptive_max_pool1d",
109116
"nn.adaptive_max_pool2d",
110117
"nn.adaptive_max_pool3d",
118+
"image.resize2d",
111119
]
112120
DEFAULT_NEVER_LIST = [
113121
# In general if |f(x)| >> |x| for expected inputs then put the op here.
@@ -134,7 +142,6 @@
134142
"nn.layer_norm",
135143
]
136144

137-
138145
# Returns a decorator which registers for every given op, the function under FTVMMixedPrecisionConversionType
139146
def register_func_to_op_list(list_ops: List):
140147
def decorator(func):

0 commit comments

Comments
 (0)