-
Notifications
You must be signed in to change notification settings - Fork 28k
dynamo.optimizations.training.aot_autograd does not trace correct overload #90923
Copy link
Copy link
Open
Labels
featureA request for a proper, new feature.A request for a proper, new feature.has workaroundmodule: aotdispatchumbrella label for AOTAutograd issuesumbrella label for AOTAutograd issuesmodule: pt2-dispatcherPT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op,PT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op,monthsoncall: exportoncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
featureA request for a proper, new feature.A request for a proper, new feature.has workaroundmodule: aotdispatchumbrella label for AOTAutograd issuesumbrella label for AOTAutograd issuesmodule: pt2-dispatcherPT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op,PT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op,monthsoncall: exportoncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Type
Fields
Give feedbackNo fields configured for issues without a type.
🐛 Describe the bug
In the following Python program,
x + 2gets traced astorch.ops.aten.add.Tensorinstead oftorch.ops.aten.add.Scalarwhich would be more technically correct (and is the op that torch.jit.script gives). I noticed this because in Torch-MLIR we verify that the operands match the schema exactly. Is it possible to have aot_autograd trace the more technically correct overload? Or can you provide guidance about how to correctly emulate the promotion semantics in appropriate generality?Also, to add onto that,
torch.ops.aten.add.Tensoris missing an argument. I need special-case code in my importer to handle this (by querying the schema for the default value). One possibility could be that PyTorch provides a utility that normalizes the graph of aten ops to "typecheck" correctly against the schemas of the constituent ops including reifying all default values.Output:
Versions
PyTorch version: 2.0.0.dev20221213+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: Debian GNU/Linux rodete (x86_64)
GCC version: (Debian 12.2.0-3) 12.2.0
Clang version: 14.0.6-2
CMake version: version 3.25.0
Libc version: glibc-2.35
Python version: 3.10.8 (main, Nov 3 2022, 15:17:13) [GCC 12.2.0] (64-bit runtime)
Python platform: Linux-5.19.11-1rodete1-amd64-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] numpy==1.24.0rc2
[pip3] torch==2.0.0.dev20221213+cpu
[pip3] torchvision==0.15.0.dev20221213+cpu
[conda] Could not collect
cc @chauhang @penguinwu @avikchaudhuri @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 @bdhirsh @bobrenjc93 @aorenste @ezyang @anijain2305 @gmagogsfm @zou3519 @msaroufim @wconstab @soumith @ngimel