Skip to content

DistilGPT2 to TOSA #494

Closed
Closed
@AmosLewis

Description

The script to run:
https://gist.github.com/AmosLewis/465795bfa1a4004fb96c742666515027

THE FINAL TOSA FILE:
distilgpt2_tosa_20230123_elide.mlir

distilgpt2_tosa_20230123.mlir

Other bugs to fix:

RefineTypes1 crash [MERGED] llvm/torch-mlir#1599
RefineTypes2 unk [MERGED]

aten.amax : Has a decompose for it, but doesnot work for distilgpt2. DecomposeAtenAmaxOp
torch.aten.select.int : Has a decompose for it, but doesnot work for distilgpt2. DecomposeAtenSelectIntOp

The 2 decomposed bugs are fixed by Ramiro: [MERGED] llvm/torch-mlir#1750 + [MERGED] llvm/torch-mlir#1742
select.int negative index support llvm/torch-mlir#1787

Ops to Fix:

aten.view [Merged] llvm/torch-mlir#1768
torch.aten.slice.Tensor/select.int [Merged] llvm/torch-mlir#1787
torch.prim.NumToTensor.Scalar f64 [TOSA NOT SUPPORT F64] llvm/torch-mlir#1802

Ops to add:

torch.ops.prims.convert_element_type MERGED llvm/torch-mlir#1619 Added a decompose
aten.as_stride: Fixed by deleting decomposition of the torch.ops.aten.slice.Tensor in python make_fx code. The as_strided is generated by slice decompostion

Deprecated Chi patch llvm/torch-mlir#1742,
Deprecated Alec patch:tosa WIP , linalg wip

torch.aten.index.Tensor/torch.prim.ListConstruct [MERGED] llvm/torch-mlir#1771, need to add convert for ListConstruct with non-const value.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions