Skip to content

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

Closed

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

Activity

  1. added
    module: xnnpack
    on Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: xnnpack

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions