- 
                Notifications
    You must be signed in to change notification settings 
- Fork 706
Use wrappers from xnnpack.h for unary and binary ops (#11584) #11666
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
Use wrappers from xnnpack.h for unary and binary ops (#11584) #11666
Conversation
| 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11666
 Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f39f3ee with merge base 7b39a0c ( This comment was automatically generated by Dr. CI and updates every 15 minutes. | 
| @pytorchbot label "release notes: none" | 
| lint runner failure seems unrelated. Local lint run is successful:  | 
92a98f4    to
    464da84      
    Compare
  
    | Seems like a transient issue with lint runner for now. Thanks for taking this up. In XNNCompiler we have large switch statements that look like this: 
 since the define_binary/unary all look like pretty much the same implementation, would it be possible to refactor some of these _DEFINE into _DEFINE_UNARY, _DEFINE_BINARY So that we don't need custom defineSubNode, defineAddNode. I know for a couple unary configs there is some variation with alpha so there is custom logic there, but this would defintely help a lot for readability. | 
9fdc08d    to
    c49d5fc      
    Compare
  
    c49d5fc    to
    f39f3ee      
    Compare
  
    | @mcr229 please let me know if you suggest any more tests. | 
Summary
This PR uses
xnn_define_binaryandxnn_define_unaryto define XNNPack ops, instead of separately calling the individual definitions.Further changes:
xnn_define_binaryandxnn_define_unaryinside.Fixes #11584
Test plan