pytorch / pytorch/executorch

Refactor binary op partitioner configs under binary op config class

Open
#9,024 9 comments 1 reaction 1 assignee View on GitHub

@csc010228 is already working on this.

Since Mar 25, 2025.

good first issue module: xnnpack triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

Problem

A lot of duplicated code is done for our partitioner configs which take in two inputs (mul, add, sub, etc.) I believe we can refactor these configs:
https://github.com/pytorch/executorch/blob/1a9a59b94491f03620dce622fee922c1d2bc1fa7/backends/xnnpack/partition/config/generic_node_configs.py#L100-L107

so that they all inherit from a parent BinaryConfig class. We can then enforce common constraints for these binary configs. This is similar to what we do with the GEMM Config:

https://github.com/pytorch/executorch/blob/1a9a59b94491f03620dce622fee922c1d2bc1fa7/backends/xnnpack/partition/config/gemm_configs.py#L48

Verification

Make sure all existing CI is passing. python -m unittest executorch.backends.xnnpack.test

Resources

https://discord.gg/a9r5KZDNfZ

cc @digantdesai @cbilgin

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.