Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support more JIT IR nodes to PyTorchModelLoader (#3181)
Summary: * Add support for loading `Constant`, `add`, `sub`, `conv2d`, and `relu` PyTorch JIT IR Nodes * Setup operator tests using PyTest and setuptools * Added proper cl flags handling to setup.py Documentation: * doyxgen comments * Add a short getting started guide in pytorch.md Pull Request resolved: #3181 Test Plan: `python setup.py test` <img width="1438" alt="Screen Shot 2019-06-26 at 2 04 15 PM" src="https://user-images.githubusercontent.com/1740091/60217187-ff3bdf00-9820-11e9-8485-60f628823cde.png"> Differential Revision: D16042625 Pulled By: jackm321 fbshipit-source-id: e6cc14a3f2d60da8dafb5dbc44df4ee6e4e2ce59
- Loading branch information
1 parent
296c6b0
commit 408cd8d
Showing
19 changed files
with
633 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Loading PyTorch models in Glow | ||
**Warning:** PyTorch integration is still under development and does not yet have as much support as Caffe2 model loading. | ||
|
||
## About | ||
Import PyTorch models to Glow via the [PyTorch JIT IR](https://pytorch.org/docs/master/jit.html). | ||
|
||
See `glow/torch_glow/examples` for illustrative examples. | ||
|
||
|
||
## Setup | ||
* Follow directions in Building.md to make sure Glow can be built | ||
* install [PyTorch](https://pytorch.org/) nightly | ||
* install torchvision: `pip install torchvision` | ||
* cd to `glow/torch_glow` | ||
|
||
## Usage | ||
### Run tests | ||
* `python setup.py test` | ||
* use the `--cmake_prefix_path` flag to specify an llvm install location just like when building glow | ||
* to disable capturing test outputs, add `addopts = -s` to `[tool:pytest]` in setup.cfg | ||
### Temporarily install while developing on Glow | ||
* `python setup.py develop` | ||
* verify with installation worked with `import torch_glow` in Python | ||
### Install | ||
* `python setup.py install` | ||
* verify with installation worked with `import torch_glow` in Python |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ test=pytest | |
|
||
[tool:pytest] | ||
testpaths = tests | ||
addopts = --verbose |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.