Add MLX integer support for aten.bitwise_and#18979
Add MLX integer support for aten.bitwise_and#18979yadferhad wants to merge 6 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18979
Note: Links to docs will display an error until the docs builds have been completed.
|
|
Hi @yadferhad! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@pytorchbot label "release notes: apple" |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Hi @yadferhad! Thanks for the PR! Overall it looks great, just two follow-up requests:
Also note that we currently have a PR merge freeze until our CI is healthy again, but hopefully we can get this merged next week |
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
Summary
Fixes #18925
aten.bitwise_andcurrently goes through the bool-onlyLogicalAndNodepath in the MLX delegate, which means integer tensors do not lower correctly. This switchesaten.bitwise_andto a dedicatedBitwiseAndNodewhile keepingaten.logical_andon the existing logical path.This change:
BitwiseAndNodeto the MLX schemaexec_bitwise_and()to the MLX interpreter runtimeaten.bitwise_and.Tensorandaten.bitwise_and.Scalaras table-driven MLX binary opsaten.logical_andon the existing bool-only logical pathbitwise_andTest plan
python3 -m py_compile backends/mlx/ops.py backends/mlx/test/test_ops.pypython3 backends/mlx/serialization/generate.pyPYTHONPATH=src python3 -m executorch.backends.mlx.test.run_all_tests --list | rg 'bitwise_and'bitwise_and_boolbitwise_and_intbitwise_and_scalarcc @metascroy