-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Relay] Add a PyTorch to Relay Parser #4497
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
98517fc
Add a PyTorch to Relay parser
alexwong 6ac2c0b
Add alexnet, googlenet, mnasnet, shufflenet wip
alexwong 3165151
Fix lint
alexwong 78829d2
Remove fix for shufflenet
alexwong db776eb
Lower check
alexwong e65f4c4
Pull changes from neo-ai/tvm changes
alexwong 6d4d03a
Remove commented out section
alexwong 943f30b
Use infer_shape everywhere
alexwong 389885b
Change back to using trace instead of path in from_pytorch
alexwong 9f5593e
Parse state_dict to add param names
alexwong b76dfda
Umbrella single_op under test_forwards
alexwong a4dca01
Remove print and cleanup call
alexwong 4ebf41f
Check if update to test broke CI
alexwong 32a33b6
Retrigger CI
alexwong 5cafc10
Add back in updated tests
alexwong 377452f
Try splitting up tests
alexwong 6bc4a90
First pass at flexible typing, implemented for ones
alexwong c285dee
Add int32 for all ops
alexwong b090293
Remove print statements
alexwong 6c62bb7
Fix lint
alexwong a52296e
Broad except
alexwong 58bb484
Add other tensor types
alexwong f8d9945
Temporarily use old tests
alexwong ce6acf5
Retrigger CI
alexwong d58f934
Lower type names
alexwong 1722fbc
Use numpy to convert in dense op
alexwong 6947be0
Fix lint
alexwong 8fe6e8e
Remove print
alexwong db7e3e1
Need to cleanup but verify int32 works for add
alexwong 606b583
Rough tests for different types, a lot of types are not supported on CPU
alexwong 5059b1a
Probably doesn't build, need to save work as I have to switch branche…
alexwong c388f5f
Parse param type
alexwong ff99f2f
Remove print stmt in parser
alexwong 96e0a21
Clean up some code
alexwong 1217258
Working on flaot32 for bn
alexwong f54a7fc
Add resnet18 double type
alexwong 1a320fc
Fix lint
alexwong 66ac2e4
Temporarily move PT tests first
alexwong d7fd6c2
Temporarily add back refactored tests to fix mem issue
alexwong d23b318
Add more type test and temp remove some tests
alexwong 3566732
Comment out tests, hopefully CI prints a trace
alexwong 265f445
Get stack trace
alexwong 2e47748
Remove operator dict key, rename op_name to node_id, remove dead code
alexwong bdb0a3d
Make relay map a list
alexwong 6a746db
Remove some hacky string stuff
alexwong b45fa0a
Move to PyTorch 1.4
alexwong aded622
Remove input_type as param
alexwong b88bbee
Remove _get_fill_value, fix full ops
alexwong b367743
Remove unused code and combine ops for identity and none
alexwong 0679fc4
Remove fn_param
alexwong cb90c94
Clean up main loop
alexwong c212544
Remove useless if/else for outputs
alexwong 9ae0404
Remove ir_names, only used once
alexwong 4b34f92
Remove some string hacking
alexwong 1ab173e
Remove string parsing to get output name
alexwong 93202d4
Fix bug with output sizes of nodes
alexwong e024cfd
Use attributeNames in parse ops
alexwong f65134f
Remove continue and add_op in parse_op
alexwong fc84563
Do this everywhere, use assert instead of explciitly type casting
alexwong fdd702e
Remove unnecessary swap
alexwong 5656f0d
Slight refactor for elemwise input parse
alexwong c728a2d
Use a copy of graph everywhere
alexwong 08b2a64
Rename nid_to_node_name
alexwong 56d800b
Refactor parse import prereqs
alexwong dcfb2d1
Clean up input node kind check
alexwong effc6d0
Clean up conditionals
alexwong 1c41d98
Clean up add_op
alexwong 4b2987b
Cleanup type for ones and zeros op
alexwong af52517
Fix lint
alexwong 875e3c2
Add torch install to CI
alexwong 28e4597
Actually use torch
alexwong ef932dc
Try moving import torch to only where it's needed
alexwong ef570f3
Import torch for CI
alexwong 6fc76f2
Use take op for select
alexwong ceac08c
Temporarily add ignore for jit inline pass for CI
alexwong 0052b35
Use CompleteTensorType, might be a PT 1.2 only thing
alexwong 7eb8572
Use different types in elemwise op
alexwong 1941a34
Use float16 ones
alexwong fb84977
Fix float16 test
alexwong f1a5285
Remove the temp docker changes
alexwong 06dedd6
Remove temp test
alexwong e6aaadf
Temporarily comment out original tests
alexwong 0a1d7e7
Remove file
alexwong 27d426c
Empty cache after each test
alexwong 5c5719f
Add some prints and lower input sizes
alexwong 4cf2209
Try using no grad
alexwong 6bd838f
Trying to globally set grad off
alexwong 0ff0c47
Use no grad for torchvision
alexwong f1da3e0
Remove xfail tests
alexwong ed30b4b
Remove VGG and AlexNet due to some issues
alexwong 44195f3
Combine pooling tests
alexwong fa0a005
Remove extra test file
alexwong 353ee46
Remove single op, remove larger pooling tests
alexwong 94d09f4
Remove maxpool3
alexwong d21ba32
Remove debug prints
alexwong f90adfc
Remove inference call and add no_grad in measure latency
alexwong ba81485
Use standard string start char
alexwong dd70947
Remove redundant infer_shape in slice
alexwong 1a5049a
Convert most to checks to just expr
alexwong 8cf1fcd
Remove extra paren
alexwong eb51d73
More refactor of isinstance
alexwong 96354d2
Add helper for creating typed constants
alexwong c5028a2
Assert instead of return when no matching type
alexwong 458ae5c
Remove network variants
alexwong a6a4980
Add no_grad when forward, remove deatch, fix lint
alexwong 1243261
Change isinstance to expr in transpose
alexwong d765b35
Use opnotimplemented, refactor
alexwong cd5c2d1
Fix full ops, remove duplicate tests
alexwong 1207f29
Never use shape field unless we know the type
alexwong 58c18dd
Remove comma, retrigger CI
alexwong fd7e315
Add paren, retrigger CI
alexwong 3aaf86e
Use inline if-else for flags
alexwong 1829ca3
Throw exception instead of assert
alexwong 440c568
Remove version check for CI
alexwong 933cf61
Check version when doing inline pass
alexwong 792feb1
Fix lint
alexwong 7416a35
Lower more input sizes
alexwong 6b77626
Add new line, conv2d only accepts weight as expr
alexwong 7dec79f
Use tvm.runtime.ndarray
alexwong 2a2362a
Remove change to torch version install
alexwong 84c6102
Try no grad for mobilenet
alexwong 09962b8
Fix lint
alexwong 44c6346
Fix lint again
alexwong d697178
Revert to last passing
alexwong 9f3831c
Delete test files
alexwong 2d5ef37
Ignore lint
alexwong 60d58ec
Revert back
alexwong bdc808a
Comment out mobilenet
alexwong 85ad441
Clean up compare compiled and baseline outputs
alexwong 2cbbf77
Use IRModule
alexwong d799213
Add todos
alexwong 2cd5039
Refactor use_bias
alexwong 60e676b
Add todo for fix conv op channels
alexwong fef36e8
Change input to data type
alexwong 9dc2674
Remove todo
alexwong 089d55f
Handle channel multiplier > 1
alexwong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove print stmt in parser
- Loading branch information
commit ff99f2f47d55a5058768ba731ce86a4ed07877f3
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.