Commit d91fe45
authored
[Transform][Bugfix] Handle non-composite lambda functions in FuseOps (#16598)
Prior to this commit, calling `FuseOpsByPattern` with
`annotate_codegen=True` would cause an error when encountering a
lambda function. This was caused by the `CompositeFunctionAnnotator`
asserting that all `relax::Function` encountered must have the
`kComposite` attribute. While this is true for all lambda functions
produced by `FuseOpsByPattern`, the user may have defined other lambda
functions as well.
This commit updates `CompositeFunctionAnnotator` to ignore lambda
functions that do not have a `kComposite` attribute.1 parent e5bfb02 commit d91fe45
File tree
2 files changed
+60
-2
lines changed- src/relax/transform
- tests/python/relax
2 files changed
+60
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | | - | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1242 | 1247 | | |
1243 | 1248 | | |
1244 | | - | |
1245 | 1249 | | |
1246 | 1250 | | |
1247 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
533 | 587 | | |
534 | 588 | | |
535 | 589 | | |
| |||
0 commit comments