Skip to content
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

[torchlib] torch.ops.aten.embedding_bag.padding_idx may see padding_idx=None #2145

Open
justinchuby opened this issue Mar 28, 2025 · 5 comments
Labels
contribution welcome We welcome code contributions for this module: torchlib Related to the torch/aten function lib in development

Comments

@justinchuby
Copy link
Collaborator

ERR_export: Failed to convert the exported program to an ONNX model. [96mThis is step 3/3[0m of exporting the model to ONNX. Next steps:- If there is a missing ONNX function implement it and register it to the registry.- If there is an internal error during ONNX conversion debug the error and summit a PR to PyTorch.- Create an error report with torch.onnx.export(... report=True) and save the ExportedProgram as a pt2 file. Create an issue in the PyTorch GitHub repository against the [96m*onnx*[0m component. Attach the error report and the pt2 model.## Exception summary<class 'AssertionError'>: padding_idx must not be None. This is likely a dispatcher error<class 'torch.onnx._internal.exporter._errors.GraphConstructionError'>: Error when calling function 'TracedOnnxFunction(<function aten_embedding_bag_padding_idx at 0x7f890955be20>)' with args '[SymbolicTensor('p_model_emb_l_0_weight' type=Tensor(FLOAT16) shape=[100000064] producer=None index=None) SymbolicTensor('args_2_0' type=Tensor(INT64) shape=[100] producer=None index=None) SymbolicTensor('select' type=Tensor(INT64) shape=[1] producer=node_Gather_5 index=0) False 0 True None False None]' and kwargs '{}'<class 'torch.onnx._internal.exporter._errors.ConversionError'>: Error when translating node %embedding_bag : [num_users=1] = call_function[target=torch.ops.aten.embedding_bag.padding_idx](args = (%p_model_emb_l_0_weight %args_2_0 %select False 0 True None False None) kwargs = {}). See the stack trace for more information.(Refer to the full stack trace above for more information.)

@justinchuby justinchuby added module: torchlib Related to the torch/aten function lib in development contribution welcome We welcome code contributions for this labels Mar 28, 2025
@justinchuby
Copy link
Collaborator Author

@titaiwangms
Copy link
Contributor

I recall we had this conversation before: https://github.com/pytorch/pytorch/blob/35ff5084e6a5bbf7c897840943ee3ac846ffaaf1/aten/src/ATen/native/native_functions.yaml#L2161

Vaguely, it seems that rounding_mode is an optional attribute. It could be provided with str or None, or not even provided.

@titaiwangms
Copy link
Contributor

@titaiwangms
Copy link
Contributor

Oops, I was talking about ate.div

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome We welcome code contributions for this module: torchlib Related to the torch/aten function lib in development
Projects
None yet
Development

No branches or pull requests

2 participants