Add MLX op handler for aten.bitwise_xor#18983
Conversation
Add BitwiseXorNode to the MLX delegate schema and implement the handler for aten.bitwise_xor, enabling element-wise bitwise XOR operations on boolean and integer tensors via MLX's native bitwise_xor function. Changes: - Add BitwiseXorNode table to schema.fbs - Register BitwiseXorNode in the OpNode union - Add exec_bitwise_xor runtime function in MLXInterpreter.h - Add BITWISE_XOR case handler in the interpreter switch - Add aten.bitwise_xor handler to _BINARY_OPS in ops.py - Add bitwise_xor_bool and bitwise_xor_int tests Fixes: pytorch#18927
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18983
Note: Links to docs will display an error until the docs builds have been completed. ❌ 20 New Failures, 1 Cancelled Job, 1 Unrelated FailureAs of commit 1619c69 with merge base 9ca0ff1 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@claude review |
|
Claude finished @nil-is-all's task in 3m 27s —— View job Code Review: Add MLX op handler for aten.bitwise_xor
Critical Issue: Generated files should not be committed6 of the 10 changed files are auto-generated and have never been tracked in this repository before. They were created by running
These files are outputs of Please remove these 6 files from the PR and ensure only the 4 hand-written changes remain. Fix this → Bug: Missing import of
|
|
Hi @Jah-yee! Thanks for the PR. Similar comments on bitwise_xor PR (make sure you remove the auto-generated files). |
|
Good day @metascroy, Thank you for the review and for pointing out the issue with auto-generated files. I have removed the following auto-generated files from the PR:
These files are generated by python backends/mlx/serialization/generate.py and should not be committed directly. The remaining files in this PR (schema.fbs, ops.py, MLXInterpreter.h, test_ops.py) are the source files that require manual changes. Note: I am not the author of this PR (@RoomWithOutRoof is), but I am addressing the review comments as requested. Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly. Warmly, Jah-yee |
I still see the generated files in the PR? |
metascroy
left a comment
There was a problem hiding this comment.
Remove generated files from PR.
Maybe also add them to gitignore?
Good day
This PR adds support for
aten.bitwise_xorin the MLX delegate backend, addressing issue #18927.Summary
Add
BitwiseXorNodeto the MLX delegate serialization schema and implement the corresponding handler to enable element-wise bitwise XOR operations on boolean and integer tensors via MLX's nativebitwise_xorfunction.Changes
BitwiseXorNodetable witha,b, andoutfields, and registered it in theOpNodeunionexec_bitwise_xorruntime function and corresponding case handler (BITWISE_XOR)aten.bitwise_xorto the_BINARY_OPStable-driven handler registrybitwise_xor_boolandbitwise_xor_inttests using the existing_BINARY_OP_TESTSinfrastructureTesting
Tests can be run with:
References
array bitwise_xor(const array \&a, const array \&b, StreamOrDevice s = {})bitwise_xor(Tensor self, Tensor other) -> Tensorint8,int16,int32,int64,uint8,boolThank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly.
Warmly,
RoomWithOutRoof
cc @metascroy