Share int64 → int32 cast insertion pass across backends (TOSA, XNNPACK, etc.)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
🚀 The feature, motivation and pitch
Description
In PR #12242, we used a pass InsertCastForOpsWithInt64InputPass to insert an int32 cast node to convert inputs from int64 to int32 for nodes withaten.slice_copy.Tensor in TOSA backend. This enables certain operators to be delegated to the TOSA backend, which requires int32 inputs.
Based on @digantdesai suggestions, this pass can be reused across multiple backends (TOSA, XNNPACK, etc.) that have the similar case.
Proposal
Refactor and move this pass to exir/passes so that it can be shared across multiple backends.
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
cc @digantdesai @mcr229 @cbilgin
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review PR #12242 and locate InsertCastForOpsWithInt64InputPass in the TOSA backend. Trace how the pass handles aten.slice_copy.Tensor, then assess moving it into exir/passes for reuse by TOSA, XNNPACK, and similar backends. Done means the shared pass is available from exir/passes and the existing TOSA use continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100