Commit cd66135
committed
fix(pass): preserve singleton broadcast dims in SplitVectorKernel
Redesign the split decision algorithm in SplitVectorKernel to be
op-semantics-aware instead of unconditionally halving all tile dims:
- Add IsSingletonDim check: tiles with split-axis extent == 1 (e.g.
broadcast [1, 128] under UP_DOWN) are now preserved as-is without
halving shape, adjusting offsets, or tracking in tile_vars
- Add IsReduceOnSplitAxis detection: reduce ops (tile.sum/max/min,
tile.row_sum/max/min) that reduce on the split axis are rejected
with a clear error, since partial reduction is semantically incorrect
- Add regression tests for both UP_DOWN and LEFT_RIGHT singleton
broadcast scenarios, plus a reduce-on-split-axis rejection test
Fixes #976
Closes #975
Made-with: Cursor1 parent 460d257 commit cd66135
2 files changed
Lines changed: 131 additions & 2 deletions
File tree
- src/ir/transforms
- tests/ut/ir/transforms
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
126 | 151 | | |
127 | 152 | | |
128 | 153 | | |
| |||
297 | 322 | | |
298 | 323 | | |
299 | 324 | | |
300 | | - | |
| 325 | + | |
| 326 | + | |
301 | 327 | | |
302 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
303 | 336 | | |
304 | 337 | | |
305 | 338 | | |
| |||
341 | 374 | | |
342 | 375 | | |
343 | 376 | | |
344 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
345 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
346 | 387 | | |
347 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
348 | 392 | | |
349 | 393 | | |
350 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
415 | 468 | | |
416 | 469 | | |
417 | 470 | | |
| |||
515 | 568 | | |
516 | 569 | | |
517 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
0 commit comments