Commit 13a7c05
[ET-VK] Fix output offset calculation and add symint support to ComputeGraph
Fix output argument indexing in VulkanBackend::execute() and extend
ComputeGraph to transparently handle symint values.
The output loop previously computed the args index as `i + num_inputs`,
which breaks when non-tensor arguments (e.g. symints) sit between the
tensor inputs and outputs in the args array. Fix by computing the offset
from the end: `args.size() - num_outputs`.
ComputeGraph changes add symint support so that operators can read symint
values uniformly:
- `extract_scalar<T>()` now handles SymInt values, allowing operators to
call extract_scalar on arguments that may be either plain ints or
symints without special-casing.
- `read_symint()` falls back to reading plain Int values, so values
stored as Int (rather than SymInt objects) can be read uniformly.
Pull Request resolved: pytorch#18050
ghstack-source-id: 353546683
@exported-using-ghexport
Differential Revision: [D95970167](https://our.internmc.facebook.com/intern/diff/D95970167/)1 parent 981bc60 commit 13a7c05
3 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| 674 | + | |
674 | 675 | | |
675 | 676 | | |
676 | 677 | | |
| |||
770 | 771 | | |
771 | 772 | | |
772 | 773 | | |
773 | | - | |
774 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
778 | 780 | | |
779 | | - | |
780 | | - | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
728 | 731 | | |
729 | 732 | | |
730 | 733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
576 | 579 | | |
577 | 580 | | |
578 | 581 | | |
| |||
0 commit comments