Skip to content

Add MLX op handler for aten.bitwise_xor#18931

Open
nanookclaw wants to merge 1 commit intopytorch:mainfrom
nanookclaw:mlx-bitwise-xor
Open

Add MLX op handler for aten.bitwise_xor#18931
nanookclaw wants to merge 1 commit intopytorch:mainfrom
nanookclaw:mlx-bitwise-xor

Conversation

@nanookclaw
Copy link
Copy Markdown

Summary

  • Add BitwiseXorNode to the MLX delegate schema, C++ runtime, Python op handler, and tests
  • Enables element-wise bitwise XOR for boolean and integer tensors via mlx::core::bitwise_xor

Closes #18927

Test plan

  • python -m executorch.backends.mlx.test.run_all_tests -k bitwise_xor passes both bool and int variants
  • Existing MLX op tests remain passing

🤖 Generated with Claude Code

Add BitwiseXorNode to the MLX delegate, enabling element-wise bitwise
XOR for boolean and integer tensors via mlx::core::bitwise_xor.

Closes pytorch#18927

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 16, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18931

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Apr 16, 2026

Hi @nanookclaw!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@metascroy
Copy link
Copy Markdown
Contributor

@nanookclaw Looks like a great start!

A couple notes:

  • Do not check in auto-generated files (e.g., MLXLoader.cpp, MLXLoader.h, etc)
  • Can you confirm both the scalar and tensor versions are being tested in your tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Good First Issue: Add MLX Op Handler for aten.bitwise_xor

3 participants