Skip to content

Partitioner to not delegate mixed dtype operators #9023

Closed
keyprocedure/executorch
#1
@mcr229

Description

@mcr229

Problem

Currently there is no check that the XnnpackPartitioner does not partition mixed dtype ops for example a multiply that takes in a bf16 and fp32 input (these are not supported by xnnpack).

Context

In the XnnpackPartitioner we have configs for operators that describe how operators should be partitioned, and what constraints they must pass. The below link should show constraints that must be passed by all operators

We should add a check in this constraint to fail partitions that take in mixed dtypes as inputs. The refactoring done in this issue might be a good way to help enforce this more easily for binary inputs. #9024

Verification/Testing

Add a test with a pytorch module for operations that take in different dtypes (fp32, bf16, fp16, int8). Check that these are not partitioned:

Inverse of this:

.check_not(["executorch_exir_dialects_edge__ops_aten_cat_default"])
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})

in that we want to check that there are no call_delegate nodes and the original node is still in the graph

Test for the following representative ops:

  • cat
  • mul
  • add
  • div
  • sub

Resources

https://discord.gg/a9r5KZDNfZ

cc @digantdesai @cbilgin

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmodule: xnnpackIssues related to xnnpack delegation and the code under backends/xnnpack/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    Status

    Done

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions