Commit fb82d10
Automerge: [MLIR][Tosa] Fix argmax NaN propagate lowering (#133074)
In the propagate mode, NaN compare equal to each other so in case of
several NaNs the index of the first one needs to be returned. This
commit changes the index update condition to check that the current
index is not that of a NaN.
The commit also simplifies argmax NaN ignore lowering to only use OGT.
This prevent any update in case of NaN. The only case where the index of
a NaN is returned is when all values are NaN and this is covered by the
fact that the initial index value is 0 so no update will result in 0
being returned.File tree
2 files changed
+22
-31
lines changed- mlir
- lib/Conversion/TosaToLinalg
- test/Conversion/TosaToLinalg
2 files changed
+22
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2285 | 2285 | | |
2286 | 2286 | | |
2287 | 2287 | | |
2288 | | - | |
2289 | | - | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
2290 | 2304 | | |
2291 | 2305 | | |
2292 | 2306 | | |
| |||
2299 | 2313 | | |
2300 | 2314 | | |
2301 | 2315 | | |
2302 | | - | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | 2316 | | |
2325 | 2317 | | |
2326 | 2318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1525 | 1525 | | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | | - | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1529 | 1531 | | |
1530 | 1532 | | |
1531 | 1533 | | |
| |||
2230 | 2232 | | |
2231 | 2233 | | |
2232 | 2234 | | |
2233 | | - | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
2234 | 2238 | | |
2235 | 2239 | | |
2236 | 2240 | | |
2237 | | - | |
2238 | | - | |
2239 | 2241 | | |
2240 | 2242 | | |
2241 | 2243 | | |
| |||
2267 | 2269 | | |
2268 | 2270 | | |
2269 | 2271 | | |
2270 | | - | |
2271 | | - | |
2272 | | - | |
2273 | 2272 | | |
2274 | 2273 | | |
2275 | 2274 | | |
| |||
0 commit comments