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

Add a few decompositions for aten ops seen in huggingface models. #102

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/shark_turbine/dynamo/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
torch.ops.aten.addmm,
# decompositions that aid us in handling nn.BatchNorm2d
torch.ops.aten._native_batch_norm_legit_functional,
torch.ops.aten._native_batch_norm_legit_no_training,
torch.ops.aten._native_batch_norm_legit,
torch.ops.aten._native_batch_norm_legit.no_stats,
torch.ops.aten.squeeze.dims,
# decompositions for miscellaneous ops that are not handled in torch-mlir but have available decompositions
Expand All @@ -43,6 +45,7 @@
torch.ops.aten.nll_loss_backward,
torch.ops.aten._to_copy,
torch.ops.aten._log_softmax_backward_data,
torch.ops.aten.lift_fresh_copy.default,
Copy link
Contributor

@brucekimrokcmu brucekimrokcmu Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Ean,
I don't remember lift_fresh_copy decomposition registered from torch/_decomp.
(There's a lowering of it in inductor)
There's lift_fresh decomposition here: https://github.com/pytorch/pytorch/blob/main/torch/_decomp/decompositions.py#L1890

Currently, lift_fresh_copy is handled at here: https://github.com/nod-ai/SHARK-Turbine/blob/main/python/shark_turbine/dynamo/importer.py#L597-L602
by swapping the op to aten.clone.

]


Expand Down