Commit Graph

1913 Commits

Author SHA1 Message Date
Edward Z. Yang
b158aaf6b4 Make linter an optimization pass.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2017-09-05 17:48:55 -04:00
Adam Paszke
2dc3ef73ae Lint 2017-09-05 17:48:55 -04:00
Adam Paszke
3e0f1608fe Capture Variables that are not inputs as constants 2017-09-05 17:48:55 -04:00
Adam Paszke
233a66dcbe Remove SimpleMap from JIT IR 2017-09-05 17:48:55 -04:00
Zach DeVito
50e51eaa7f Fusion of simple map operations using nvrtc.
Approach is based on the approach of THC's pointwiseApply{1,2,3} family of kernels,
but doesn't have any dependencies on that code.

Adjacent contiguous dimensions of input tensors are compressed to reduce the complexity of indexing math.
For the completely contiguous case, the indexing logic simplifies to just the linear index.

In simple tests, this code matched or beat the equivalent from THC.
2017-09-05 17:48:55 -04:00
Adam Paszke
a4086508c6 Enable tests 2017-09-05 17:48:55 -04:00
Adam Paszke
f270973937 Add JIT IR -> Autograd IR converter 2017-09-05 17:48:55 -04:00
Adam Paszke
e186d16e6b Apply JIT optimizations form Python 2017-09-05 17:48:55 -04:00
Adam Paszke
72659bcdef Minor code cleanup 2017-09-05 17:48:55 -04:00
Edward Z. Yang
57d65a99bb Add LSTM fusion test.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2017-09-05 17:48:55 -04:00
Edward Z. Yang
e238f3cada Very simple accept/golden test framework for JIT trees.
- To test whether or not a multiline string matches some expected
  value, you can use assertExpected.  This tests that the string
  matches the content stored at a file based on the name of the
  test (and an optional subname parameter you can pass if you
  what to assertExpected multiple times.)

- Suppose you make a change that modifies the output in a big way.
  Instead of manually going through and updating each test, you instead
  run python test/test_jit.py --accept.  This updates all of the expected
  outputs.  You can now review them one-by-one and make sure your
  changes make sense.

We can add more features later (e.g., munging the output to make it
more stable, more sanity checking) but this is just to get us started
testing.  One thing to watch out for is that accept tests on intermediate
representation can be a bit wobbly: it is *extremely* important that
people be able to read the IR.  It may be worth introducing niceties
to the printer in order to ensure this is the case.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2017-09-05 17:48:55 -04:00
Adam Paszke
55c9e0258e Make the linter happy 2017-09-05 17:48:55 -04:00
Edward Z. Yang
2ced918063 Add a very simple visual (non-automated) test.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2017-09-05 17:48:55 -04:00