Commit e4cde86
Fix quantized max_pool2d output observer for tuple-returning ops (pytorch#19259)
Summary:
prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.
Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.
Reviewed By: mcremon-meta
Differential Revision: D1034361721 parent a7e44bf commit e4cde86
2 files changed
Lines changed: 34 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
496 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
497 | 507 | | |
498 | 508 | | |
499 | 509 | | |
| |||
505 | 515 | | |
506 | 516 | | |
507 | 517 | | |
508 | | - | |
| 518 | + | |
509 | 519 | | |
510 | 520 | | |
511 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
486 | | - | |
487 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
488 | 497 | | |
489 | | - | |
490 | 498 | | |
491 | | - | |
492 | 499 | | |
493 | 500 | | |
494 | 501 | | |
| |||
503 | 510 | | |
504 | 511 | | |
505 | 512 | | |
506 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
509 | 520 | | |
510 | 521 | | |
511 | 522 | | |
512 | 523 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
517 | 528 | | |
518 | | - | |
| 529 | + | |
| 530 | + | |
519 | 531 | | |
520 | 532 | | |
521 | 533 | | |
| |||
0 commit comments