Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partitioner to not delegate mixed dtype operators #9023

Closed
mcr229 opened this issue Mar 6, 2025 · 0 comments · Fixed by keyprocedure/executorch#1 or #9612
Closed

Partitioner to not delegate mixed dtype operators #9023

mcr229 opened this issue Mar 6, 2025 · 0 comments · Fixed by keyprocedure/executorch#1 or #9612
Labels
good first issue Good for newcomers module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Milestone

Comments

@mcr229
Copy link
Contributor

mcr229 commented Mar 6, 2025

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

@mcr229 mcr229 moved this to Backlog in ExecuTorch - CPU Mar 6, 2025
@mcr229 mcr229 added this to the 0.6.0 milestone Mar 6, 2025
@mcr229 mcr229 added the module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ label Mar 6, 2025
@iseeyuan iseeyuan added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Mar 7, 2025
@mcr229 mcr229 added the good first issue Good for newcomers label Mar 20, 2025
@mcr229 mcr229 closed this as completed in ec1cd04 Mar 27, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in ExecuTorch - CPU Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
2 participants