Skip to content

Commit

Permalink
Merge pull request #56 from opencompl/sasha/alexnet
Browse files Browse the repository at this point in the history
generate alexnet linalg
  • Loading branch information
compor authored Nov 3, 2023
2 parents 153d8bd + 3266da9 commit 1e309b7
Show file tree
Hide file tree
Showing 6 changed files with 1,132 additions and 0 deletions.
535 changes: 535 additions & 0 deletions alexnet/flow.mlir

Large diffs are not rendered by default.

335 changes: 335 additions & 0 deletions alexnet/input.mlir

Large diffs are not rendered by default.

243 changes: 243 additions & 0 deletions alexnet/iree.mlir

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions alexnet/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shark-turbine
torchvision
5 changes: 5 additions & 0 deletions alexnet/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Script that generated the mlir files in this folder

python test.py > iree.mlir
iree-compile --iree-input-type=torch --compile-to=input iree.mlir > input.mlir
iree-compile --iree-input-type=torch --compile-to=flow --iree-util-zero-fill-elided-attrs iree.mlir > flow.mlir
12 changes: 12 additions & 0 deletions alexnet/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import torch
import torch.nn as nn

import shark_turbine.aot as aot
from iree.compiler import compile_str

from torchvision.models import AlexNet

model = AlexNet()
example_x = torch.empty(64, 3, 224, 224)
exported = aot.export(model, example_x)
exported.print_readable()

0 comments on commit 1e309b7

Please sign in to comment.