Commit 2d095b8
authored
Delete opt_mul_scalar_out (pytorch#12145)
The handwritten optimized code is similar to what we should be getting
from the optimized portable op, as follows.
handwritten optimized code:
- if the input type matches the output type, then perform a vectorized
loop
- otherwise, generate specific mixed-dtype kernels, which aren't
vectorized.
optimized portable op:
- if the input type matches the output type, then perform a vectorized
loop. (dtype_specialized_elementwise_fn_impl in elementwise_util.h)
- otherwise, generate one specific kernel per compute type. those
kernels use non-inlined function calls to do loads and stores,
trading off performance for a significant size reduction.
(apply_elementwise_fn_generic_impl in elementwise_util.h)
Both cases in the portable op variant also use parallel_for.
I attempted to do a performance test, but I found that
`torch.mul(some_tensor, 2.0)` is exported as a call to mul.Tensor,
*not*
mul.Scalar.
pytorch@41e7ffa
added the ability to pass our tests if we do emit mul.Scalar for this,
but the follow-up diff to make that happen seems not to have
landed. So, I think another reason to delete this is that (if I
understand correctly) it's not used, therefore we don't have specific
knowledge that we need it to exist and we can't just use the optimized
portable op.1 parent 14085eb commit 2d095b8
2 files changed
+0
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 213 | | |
271 | 214 | | |
272 | 215 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 85 | | |
91 | 86 | | |
92 | 87 | | |
| |||
0 commit comments