Skip to content

Share int64 β†’ int32 cast insertion pass across backends (TOSA, XNNPACK, etc.)Β #12957

@YufengShi-dudu

Description

@YufengShi-dudu

πŸš€ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: xnnpackIssues related to xnnpack delegation and the code under backends/xnnpack/

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions