Add aten_maximum_real#2371
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2371 +/- ##
==========================================
- Coverage 70.14% 70.14% -0.01%
==========================================
Files 197 197
Lines 24983 24986 +3
Branches 2667 2667
==========================================
+ Hits 17525 17526 +1
- Misses 6531 6533 +2
Partials 927 927 ☔ View full report in Codecov by Sentry. |
|
The types should be promoted already when the op is being translated and should be handled by . Was there a case when this isn't true? ONNX max requires all inputs to be the same type https://onnx.ai/onnx/operators/onnx__Max.html but this change allows the two inputs to take different types, which would allow an invalid model |
justinchuby
left a comment
There was a problem hiding this comment.
Explained above and for further discussions
|
There is a regression for the model XGLMForCausalLM. I tried this change based on the error message I got (missing signature for aten::max.other). But type promotion fails as you mentioned. Error: Type parameter (T) of Optype (Max) bound to different types (tensor(float16) and tensor(float) in node (n0). |
|
Looks like max.other is an alias of maximum (https://github.com/pytorch/pytorch/blob/b44306d3681d5b248e6b439d293ea0d5a8903a61/aten/src/ATen/native/native_functions.yaml#L10064-L10069). I think we can do one of two things:
|
I will take a look and update it here. |
|
#2377 should fix what this PR tried to fix. |
Issue revealed by #2371, which aten.max.other is lack of matching overload. It's caused by missing type promotion. The reason is that aten::max.other (binary max) is an alias of aten::maimum.default. Thus, iwhen type promotion pass dispatches torch.max through `__torch__dispatch__`, it does not find aten::max.other (However, I am not sure how `make_fx` dispatches torch.max to aten::max.other). The existence of aten::max.other looks like a legacy code: pytorch/pytorch#42579.
No description provided.