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

[Relay] Add a PyTorch to Relay Parser #4497

Merged
merged 136 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
98517fc
Add a PyTorch to Relay parser
alexwong Nov 19, 2019
6ac2c0b
Add alexnet, googlenet, mnasnet, shufflenet wip
alexwong Dec 3, 2019
3165151
Fix lint
alexwong Dec 3, 2019
78829d2
Remove fix for shufflenet
alexwong Dec 4, 2019
db776eb
Lower check
alexwong Dec 4, 2019
e65f4c4
Pull changes from neo-ai/tvm changes
alexwong Jan 6, 2020
6d4d03a
Remove commented out section
alexwong Jan 6, 2020
943f30b
Use infer_shape everywhere
alexwong Jan 6, 2020
389885b
Change back to using trace instead of path in from_pytorch
alexwong Jan 6, 2020
9f5593e
Parse state_dict to add param names
alexwong Jan 6, 2020
b76dfda
Umbrella single_op under test_forwards
alexwong Jan 6, 2020
a4dca01
Remove print and cleanup call
alexwong Jan 6, 2020
4ebf41f
Check if update to test broke CI
alexwong Jan 7, 2020
32a33b6
Retrigger CI
alexwong Jan 7, 2020
5cafc10
Add back in updated tests
alexwong Jan 7, 2020
377452f
Try splitting up tests
alexwong Jan 7, 2020
6bc4a90
First pass at flexible typing, implemented for ones
alexwong Jan 7, 2020
c285dee
Add int32 for all ops
alexwong Jan 8, 2020
b090293
Remove print statements
alexwong Jan 8, 2020
6c62bb7
Fix lint
alexwong Jan 8, 2020
a52296e
Broad except
alexwong Jan 8, 2020
58bb484
Add other tensor types
alexwong Jan 8, 2020
f8d9945
Temporarily use old tests
alexwong Jan 8, 2020
ce6acf5
Retrigger CI
alexwong Jan 8, 2020
d58f934
Lower type names
alexwong Jan 8, 2020
1722fbc
Use numpy to convert in dense op
alexwong Jan 8, 2020
6947be0
Fix lint
alexwong Jan 8, 2020
8fe6e8e
Remove print
alexwong Jan 8, 2020
db7e3e1
Need to cleanup but verify int32 works for add
alexwong Jan 8, 2020
606b583
Rough tests for different types, a lot of types are not supported on CPU
alexwong Jan 10, 2020
5059b1a
Probably doesn't build, need to save work as I have to switch branche…
alexwong Jan 10, 2020
c388f5f
Parse param type
alexwong Jan 10, 2020
ff99f2f
Remove print stmt in parser
alexwong Jan 11, 2020
96e0a21
Clean up some code
alexwong Jan 11, 2020
1217258
Working on flaot32 for bn
alexwong Jan 13, 2020
f54a7fc
Add resnet18 double type
alexwong Jan 14, 2020
1a320fc
Fix lint
alexwong Jan 15, 2020
66ac2e4
Temporarily move PT tests first
alexwong Jan 15, 2020
d7fd6c2
Temporarily add back refactored tests to fix mem issue
alexwong Jan 15, 2020
d23b318
Add more type test and temp remove some tests
alexwong Jan 15, 2020
3566732
Comment out tests, hopefully CI prints a trace
alexwong Jan 16, 2020
265f445
Get stack trace
alexwong Jan 16, 2020
2e47748
Remove operator dict key, rename op_name to node_id, remove dead code
alexwong Jan 23, 2020
bdb0a3d
Make relay map a list
alexwong Jan 23, 2020
6a746db
Remove some hacky string stuff
alexwong Jan 23, 2020
b45fa0a
Move to PyTorch 1.4
alexwong Jan 28, 2020
aded622
Remove input_type as param
alexwong Jan 28, 2020
b88bbee
Remove _get_fill_value, fix full ops
alexwong Jan 28, 2020
b367743
Remove unused code and combine ops for identity and none
alexwong Jan 28, 2020
0679fc4
Remove fn_param
alexwong Jan 28, 2020
cb90c94
Clean up main loop
alexwong Jan 28, 2020
c212544
Remove useless if/else for outputs
alexwong Jan 28, 2020
9ae0404
Remove ir_names, only used once
alexwong Jan 28, 2020
4b34f92
Remove some string hacking
alexwong Jan 28, 2020
1ab173e
Remove string parsing to get output name
alexwong Jan 28, 2020
93202d4
Fix bug with output sizes of nodes
alexwong Jan 29, 2020
e024cfd
Use attributeNames in parse ops
alexwong Jan 29, 2020
f65134f
Remove continue and add_op in parse_op
alexwong Jan 29, 2020
fc84563
Do this everywhere, use assert instead of explciitly type casting
alexwong Jan 29, 2020
fdd702e
Remove unnecessary swap
alexwong Jan 29, 2020
5656f0d
Slight refactor for elemwise input parse
alexwong Jan 29, 2020
c728a2d
Use a copy of graph everywhere
alexwong Jan 29, 2020
08b2a64
Rename nid_to_node_name
alexwong Jan 29, 2020
56d800b
Refactor parse import prereqs
alexwong Jan 29, 2020
dcfb2d1
Clean up input node kind check
alexwong Jan 29, 2020
effc6d0
Clean up conditionals
alexwong Jan 29, 2020
1c41d98
Clean up add_op
alexwong Jan 29, 2020
4b2987b
Cleanup type for ones and zeros op
alexwong Jan 29, 2020
af52517
Fix lint
alexwong Jan 29, 2020
875e3c2
Add torch install to CI
alexwong Jan 29, 2020
28e4597
Actually use torch
alexwong Jan 30, 2020
ef932dc
Try moving import torch to only where it's needed
alexwong Jan 30, 2020
ef570f3
Import torch for CI
alexwong Jan 30, 2020
6fc76f2
Use take op for select
alexwong Jan 30, 2020
ceac08c
Temporarily add ignore for jit inline pass for CI
alexwong Jan 30, 2020
0052b35
Use CompleteTensorType, might be a PT 1.2 only thing
alexwong Jan 30, 2020
7eb8572
Use different types in elemwise op
alexwong Jan 30, 2020
1941a34
Use float16 ones
alexwong Jan 30, 2020
fb84977
Fix float16 test
alexwong Jan 30, 2020
f1a5285
Remove the temp docker changes
alexwong Jan 30, 2020
06dedd6
Remove temp test
alexwong Jan 30, 2020
e6aaadf
Temporarily comment out original tests
alexwong Jan 30, 2020
0a1d7e7
Remove file
alexwong Jan 31, 2020
27d426c
Empty cache after each test
alexwong Jan 31, 2020
5c5719f
Add some prints and lower input sizes
alexwong Jan 31, 2020
4cf2209
Try using no grad
alexwong Jan 31, 2020
6bd838f
Trying to globally set grad off
alexwong Feb 1, 2020
0ff0c47
Use no grad for torchvision
alexwong Feb 1, 2020
f1da3e0
Remove xfail tests
alexwong Feb 1, 2020
ed30b4b
Remove VGG and AlexNet due to some issues
alexwong Feb 3, 2020
44195f3
Combine pooling tests
alexwong Feb 3, 2020
fa0a005
Remove extra test file
alexwong Feb 3, 2020
353ee46
Remove single op, remove larger pooling tests
alexwong Feb 3, 2020
94d09f4
Remove maxpool3
alexwong Feb 4, 2020
d21ba32
Remove debug prints
alexwong Feb 4, 2020
f90adfc
Remove inference call and add no_grad in measure latency
alexwong Feb 5, 2020
ba81485
Use standard string start char
alexwong Feb 5, 2020
dd70947
Remove redundant infer_shape in slice
alexwong Feb 5, 2020
1a5049a
Convert most to checks to just expr
alexwong Feb 5, 2020
8cf1fcd
Remove extra paren
alexwong Feb 5, 2020
eb51d73
More refactor of isinstance
alexwong Feb 5, 2020
96354d2
Add helper for creating typed constants
alexwong Feb 5, 2020
c5028a2
Assert instead of return when no matching type
alexwong Feb 5, 2020
458ae5c
Remove network variants
alexwong Feb 5, 2020
a6a4980
Add no_grad when forward, remove deatch, fix lint
alexwong Feb 5, 2020
1243261
Change isinstance to expr in transpose
alexwong Feb 5, 2020
d765b35
Use opnotimplemented, refactor
alexwong Feb 6, 2020
cd5c2d1
Fix full ops, remove duplicate tests
alexwong Feb 6, 2020
1207f29
Never use shape field unless we know the type
alexwong Feb 6, 2020
58c18dd
Remove comma, retrigger CI
alexwong Feb 6, 2020
fd7e315
Add paren, retrigger CI
alexwong Feb 6, 2020
3aaf86e
Use inline if-else for flags
alexwong Feb 6, 2020
1829ca3
Throw exception instead of assert
alexwong Feb 6, 2020
440c568
Remove version check for CI
alexwong Feb 6, 2020
933cf61
Check version when doing inline pass
alexwong Feb 6, 2020
792feb1
Fix lint
alexwong Feb 6, 2020
7416a35
Lower more input sizes
alexwong Feb 7, 2020
6b77626
Add new line, conv2d only accepts weight as expr
alexwong Feb 7, 2020
7dec79f
Use tvm.runtime.ndarray
alexwong Feb 10, 2020
2a2362a
Remove change to torch version install
alexwong Feb 10, 2020
84c6102
Try no grad for mobilenet
alexwong Feb 10, 2020
09962b8
Fix lint
alexwong Feb 10, 2020
44c6346
Fix lint again
alexwong Feb 10, 2020
d697178
Revert to last passing
alexwong Feb 11, 2020
9f3831c
Delete test files
alexwong Feb 11, 2020
2d5ef37
Ignore lint
alexwong Feb 11, 2020
60d58ec
Revert back
alexwong Feb 11, 2020
bdc808a
Comment out mobilenet
alexwong Feb 11, 2020
85ad441
Clean up compare compiled and baseline outputs
alexwong Feb 12, 2020
2cbbf77
Use IRModule
alexwong Feb 12, 2020
d799213
Add todos
alexwong Feb 12, 2020
2cd5039
Refactor use_bias
alexwong Feb 17, 2020
60e676b
Add todo for fix conv op channels
alexwong Feb 17, 2020
fef36e8
Change input to data type
alexwong Feb 18, 2020
9dc2674
Remove todo
alexwong Feb 18, 2020
089d55f
Handle channel multiplier > 1
alexwong Feb 24, 2020
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
2 changes: 2 additions & 0 deletions docs/api/python/relay/frontend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ tvm.relay.frontend
.. autofunction:: tvm.relay.frontend.from_caffe2

.. autofunction:: tvm.relay.frontend.from_tensorflow

.. autofunction:: tvm.relay.frontend.from_pytorch
1 change: 1 addition & 0 deletions python/tvm/relay/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
from .caffe2 import from_caffe2
from .tensorflow import from_tensorflow
from .darknet import from_darknet
from .pytorch import from_pytorch
Loading