-
Notifications
You must be signed in to change notification settings - Fork 668
Add boolean support for op_unbind_copy #13956
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13956
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit 69bfa50 with merge base 0eed262 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
@mergennachin has imported this pull request. If you are a Meta employee, you can view this in D81705165. |
ScalarType out_type = out[0].scalar_type(); | ||
|
||
ET_SWITCH_REALHBF16_TYPES( | ||
// Use ET_SWITCH_REALHBBF16_TYPES instead of ET_SWITCH_REALHBF16_TYPES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Delete this comment.
Summary: Fixes #13552 🐛 Problem The unbind_copy kernel crashed with fatal error when processing boolean tensors: [op_unbind_copy.cpp:79] assert failed (false): Unhandled dtype Bool for unbind_copy.int_out zsh: abort ✅ Solution Extended type support to include boolean tensors by switching from ET_SWITCH_REALHBF16_TYPES to ET_SWITCH_REALHBBF16_TYPES macro. 📝 Changes kernels/portable/cpu/op_unbind_copy.cpp: // Before: Crashed on boolean tensors ET_SWITCH_REALHBF16_TYPES(...) // After: Supports boolean tensors ET_SWITCH_REALHBBF16_TYPES(...) // Includes Bool type kernels/test/op_unbind_copy_test.cpp: - Added BooleanTensorUnbindDim2 test case with input torch.bool (1, 7, 4) unbinding on dimension 2 - Validates correct output shape and data integrity 🛡️ Benefits - No more crashes: Boolean tensors are now properly handled - Broader compatibility: Supports additional data type for unbind operations - Regression protection: Test ensures boolean support is maintained ✅ Testing Verified boolean tensor unbinding works correctly on both portable and optimized kernels with comprehensive test coverage. Reviewed By: manuelcandales Differential Revision: D81705165 Pulled By: mergennachin
8ce6836
to
69bfa50
Compare
This pull request was exported from Phabricator. Differential Revision: D81705165 |
Fixes #13552
🐛 Problem
The unbind_copy kernel crashed with fatal error when processing boolean tensors:
[op_unbind_copy.cpp:79] assert failed (false): Unhandled dtype Bool for unbind_copy.int_out
zsh: abort
✅ Solution
Extended type support to include boolean tensors by switching from ET_SWITCH_REALHBF16_TYPES to ET_SWITCH_REALHBBF16_TYPES macro.
📝 Changes
kernels/portable/cpu/op_unbind_copy.cpp:
// Before: Crashed on boolean tensors
ET_SWITCH_REALHBF16_TYPES(...)
// After: Supports boolean tensors
ET_SWITCH_REALHBBF16_TYPES(...) // Includes Bool type
kernels/test/op_unbind_copy_test.cpp:
🛡️ Benefits
✅ Testing
Verified boolean tensor unbinding works correctly on both portable and optimized kernels with comprehensive test coverage.