Commit Graph

60 Commits

Author SHA1 Message Date
Samantha Andow
824eeb96e9 [functorch] remove s_where, use where.self (pytorch/functorch#581) 2022-07-21 13:41:25 -07:00
Edward Z. Yang
57e78c6654 [functorch] Don't unnecessarily wrap the elem in PythonTensor (pytorch/functorch#554)
* Don't unnecessarily wrap the elem in PythonTensor

Instead of saying that a PythonTensor has a regular (e.g., CPU) tensor
and an FX proxy, a PythonTensor *is a* regular CPU tensor, that also
carries an FX proxy (that updates as we go along).

This should fix https://github.com/pytorch/functorch/issues/465 and
it also fixed some expected failures in the test suite.

This kills the meta variant logic entirely; maybe some other time we'll
try to bring it back.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2022-07-21 13:41:24 -07:00
Edward Z. Yang
6648a05b25 [functorch] Skip networkx if not installed
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2022-07-21 13:41:24 -07:00
Sam Andow
12724711b7 [functorch] skip decomps, fix ci 2022-07-21 13:41:22 -07:00
Horace He
d3406d9cd0 [functorch] Fix some CI fails for AOTAutograd and such 2022-07-21 13:41:21 -07:00
Horace He
7ba1e4303b [functorch] Fixed minor bug with partitioner and other minor changes 2022-07-21 13:41:21 -07:00
Richard Zou
81f3bd4d58 [functorch] Fix CI (pytorch/functorch#461) 2022-07-21 13:41:21 -07:00
Horace He
4b72e62178 [functorch] Added Grad context to AOTAutograd (pytorch/functorch#441)
* refactored AOTAutograd code a bit

* Added grad context stack

* remove pdb

* fixed flake
2022-07-21 13:41:20 -07:00
Sam Andow
23ed94181a [functorch] fix unexpected successes 2022-07-21 13:41:19 -07:00
Horace He
fc272929a6 [functorch] Added support for outputs that don't require gradients + fixed some other tests 2022-07-21 13:41:19 -07:00
Horace He
de4b1e2fc1 [functorch] fix CI test for an op I don't have locally yet :) 2022-07-21 13:41:18 -07:00
Horace He
747c2fa2b2 [functorch] fix flake issues 2022-07-21 13:41:18 -07:00
Horace He
02ae449c7b [functorch] refactored decompositions a bit 2022-07-21 13:41:18 -07:00
Sam Andow
761c382550 [functorch] fix ci by disabling certain tests 2022-07-21 13:41:18 -07:00
Richard Zou
67b8a097e7 [functorch] Fix flake8 2022-07-21 13:41:18 -07:00
Horace He
16f34150bd [functorch] port nnc_jit to use AOTAutograd 2022-07-21 13:41:18 -07:00
Horace He
89d30b2987 [functorch] Added better handling for output device inference (i.e. only use when metatracing) 2022-07-21 13:41:17 -07:00
Richard Zou
ae7db8eca8 [functorch] More docs for jacfwd, hessian, jvp (pytorch/functorch#362)
Also moved them out of the experimental namespace but added warning on
coverage.
2022-07-21 13:41:17 -07:00
vfdev
c94446a04d [functorch] Fixed python code formatting and added flake8 setup (pytorch/functorch#346)
* Fixed python code formatting and added flake8 setup

* Fixes config.yaml

* Added missing setup.cfg

* Removed flake8 job from circle ci and setup GHA

* More flake8 fixes

* Fixed test_conv2d

* Fixed failing flake8
2022-07-21 13:41:17 -07:00
Horace He
00dfb3b2a2 [functorch] Added support for output pytrees in AOTAutograd (pytorch/functorch#332)
* Added autominifier

* added support for output pytree

* Added some test
2022-07-21 13:41:16 -07:00
Richard Zou
c952118aeb [functorch] Fix flaky tests 2022-07-21 13:41:15 -07:00
Richard Zou
1f7822f650 [functorch] Update lagging op db (pytorch/functorch#318) 2022-07-21 13:41:14 -07:00
Horace He
73443c14a5 [functorch] added some more decompositions 2022-07-21 13:41:13 -07:00
Horace He
fe9aac72d1 [functorch] Added decomposition testing + display infra (pytorch/functorch#281)
* Added decomposition testing + display infra

* add a couple more decompositions

* changed some stuff

* made some changes

* Added decomposition testing + display infra

* add a couple more decompositions

* fix some decompositions

* changed some stuff

* updated generation

* fix test failures

* removed extraneous files

* fixed test failures

* fixed tests

* updated

* fixed tests again
2022-07-21 13:41:12 -07:00
vfdev
1f9c78cce7 [functorch] Removed some xfail for nn functional pad circular (pytorch/functorch#285) 2022-07-21 13:41:12 -07:00
Horace He
8769c9a233 [functorch] changed naming from aot autograd to eager compilation 2022-07-21 13:41:11 -07:00
Richard Zou
752d0ed847 [functorch] Skip testing empty_like instead of xfail (pytorch/functorch#259)
This test is flaky.
2022-07-21 13:41:11 -07:00
Richard Zou
41699bb9f5 [functorch] Update functorch lagging op db (pytorch/functorch#261) 2022-07-21 13:41:11 -07:00
Horace He
dc52f44b38 [functorch] added decomposition option for pythonkey tracing with a couple decompositions 2022-07-21 13:41:09 -07:00
Richard Zou
855649c25d [functorch] Namespace cleanup (pytorch/functorch#229)
Two main things happened:
- I removed {wrap_key, PythonTensor, pythonkey_trace} from being public
APIs
- I moved all compilation related things to the functorch.compile
namespace. This includes nnc_jit which is now in
functorch.compile.nnc_jit

Concerns:
- nnc_jit was in the functorch namespace for a long time. Should we
leave it there? Are there stakeholders to notify?
2022-07-21 13:41:09 -07:00
Horace He
26ead7753f [functorch] Update op db and fix failing tests 2022-07-21 13:41:09 -07:00
Richard Zou
258b7850be [functorch] Excise vjpfull and deprecated make_functional APIs 2022-07-21 13:41:09 -07:00
Animesh Jain
cbf900b369 [functorch] [Partitioning] Recompute forward in the backward pass (pytorch/functorch#213)
Summary: Recomputation fwd in the bwd pass can improve the performance
of pointwise operators, where it helps us in reduce memory bandwidth
pressure at the expense of more computation. This PR adds a new
partitioning function to enable this type of recomputation.
2022-07-21 13:41:08 -07:00
Horace He
4f7269f9ef [functorch] fix CI 2022-07-21 13:41:08 -07:00
Richard Zou
7f7e9dc9e7 [functorch] Excise onlyOnCPUAndCUDA 2022-07-21 13:41:08 -07:00
Richard Zou
39f05e050c [functorch] Fix CI (pytorch/functorch#198)
* Fix CI

* xfails for nnc_jit tests
2022-07-21 13:41:08 -07:00
Horace He
f92a5f8746 [functorch] cleaned up some eager compilation stuff 2022-07-21 13:41:07 -07:00
Bert Maher
033e7109a4 [functorch] Support buffers in compiled_module (pytorch/functorch#147)
* Support buffers in compiled_module

* Don't compute gradients for inputs that don't require grad

* Add a unit test for batchnorm

* Fix eager compilation tests that change requires_grad

* Create new args for tests without recompilation

* Enable some eager fusion opinfo tests that now work (because we stopped asking for unimplemented derivatives)
2022-07-21 13:41:06 -07:00
Horace He
af5c0c1e4f [functorch] fix multi-output tests 2022-07-21 13:41:05 -07:00
Bert Maher
53c9fdd24b [functorch] Introduce compiled_module for eager compilation of modules (pytorch/functorch#133)
* Introduce compiled_module for eager compilation of modules

* Make parameters work

Co-authored-by: Horace He <horacehe2007@yahoo.com>
2022-07-21 13:41:05 -07:00
Richard Zou
3c0d7f08c6 [functorch] Move to PyTorch core's parametrize testing mechanism 2022-07-21 13:41:05 -07:00
Horace He
59643a5903 [functorch] fix master 2022-07-21 13:41:04 -07:00
Bert Maher
2d2d0cae7b [functorch] Support functions with multiple outputs in compiled_function (pytorch/functorch#127)
Summary: The existing code assumed a single output; this generalizes to tuple
outputs

Test Plan: Compile a simple test program with multiple outputs and check that
outputs/grads are the same as eager.
```
def foo(a, b):
  return a + b, a * b
```
2022-07-21 13:41:04 -07:00
Horace He
edf79c4be7 [functorch] updated opinfo db 2022-07-21 13:41:04 -07:00
Horace He
050bf89769 [functorch] Added Index.Tensor batching rule (pytorch/functorch#123)
* handled some cases of index.Tensor

* fixed merge errors

* Added batching rules for index, both cases are batched

* fix some issues

* handled some cases of index.Tensor

* fixed merge errors

* Added batching rules for index, both cases are batched

* fix some issues

* fix tests

* handled some cases of index.Tensor

* fixed merge errors

* fixed tests
2022-07-21 13:41:04 -07:00
Horace He
9168d834f9 [functorch] Added handling of parameters so that requires_grad is propagated correctly 2022-07-21 13:41:03 -07:00
Horace He
c0afd464d1 [functorch] Cleaned up the tests 2022-07-21 13:41:03 -07:00
Horace He
0562725c32 [functorch] fix some tests 2022-07-21 13:41:03 -07:00
Horace He
cb22fefebe [functorch] moved function to eager_compilation 2022-07-21 13:41:03 -07:00
Horace He
09b23abf45 [functorch] Added start of compile_funciton opinfo tests 2022-07-21 13:41:03 -07:00