Improve dtype error messages by showing user-friendly names#172415
Improve dtype error messages by showing user-friendly names#172415JonSnow1807 wants to merge 1 commit intopytorch:mainfrom
Conversation
Add toDtypeString() function that returns Python-style dtype names and update dispatch error messages to show both internal and user-friendly names. Before: "op" not implemented for 'Half' After: "op" not implemented for 'Half' (torch.float16) Fixes pytorch#96292
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/172415
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 95886c2 with merge base 5cb1604 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: python_frontend" |
|
I also wonder if it's possible to include here the device/dispatch key for which the dispatch is happening |
|
Good question! I looked into this. The AT_DISPATCH_* macros only receive the Adding device info would require changing the macro signature and updating The current convention is to include device in the NAME parameter (e.g., Would you be okay keeping this PR focused on the dtype improvement? Device |
|
I don't think this addresses the core ask of the issue. |
Summary
toDtypeString()function that returns Python-style dtype namesBefore:
"addmm_impl_cpu_" not implemented for 'Half'After:
"addmm_impl_cpu_" not implemented for 'Half' (torch.float16)Fixes #96292