Michael Voznesensky
808bdbab89
Fix try/except flow where DataDependentOutputException is getting wrapped in a RuntimeError ( #89314 )
...
Repro fixed
```
def fn(a):
return a.repeat_interleave(14, dim=0).repeat_interleave(14, dim=1)
x = torch.ones(14, 14).to(dtype=torch.int64)
opt_fn = torch._dynamo.optimize("eager")(fn)
opt_fn(x)
```
Fixes [#1886 ](https://github.com/pytorch/torchdynamo/issues/1886 )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89314
Approved by: https://github.com/anijain2305 , https://github.com/eellison
2022-11-19 07:16:29 +00:00
Animesh Jain
cad5772c2c
[dashboard][huggingface] skip accuracy checks for really large models… ( #89273 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89273
Approved by: https://github.com/desertfire
2022-11-19 00:22:45 +00:00
Yanbo Liang
b72f5b9ae3
[Dynamo] Support typing.Mapping & Support function as argument ( #88963 )
...
These missing features come from https://github.com/pytorch/benchmark/pull/1302 , where we'd like to enable E2E hf_bert dynamo train/eval. The dependent [HuggingFace accelerate library](https://huggingface.co/docs/accelerate/index ) requires these improvements.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88963
Approved by: https://github.com/jansel
2022-11-17 06:57:42 +00:00
Michael Voznesensky
06ce1338bc
[dynamo] Port all pytorch/dynamo and test/dynamo pieces over from symbolic-shapes branch ( #88768 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88768
Approved by: https://github.com/jansel , https://github.com/ezyang
2022-11-13 04:50:21 +00:00
Bin Bao
91b71cdbe4
[dynamo] Add torch.device to is_safe_constant ( #88766 )
...
Test Plan:
```
PYTORCH_TEST_WITH_DYNAMO=1 python test/test_torch.py -k test_advancedindex_mixed_cpu_devices_cuda
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88766
Approved by: https://github.com/jansel
2022-11-11 15:06:17 +00:00
Elias Ellison
2ce2fc133d
Disable Current Modes when printing Tensor ( #88344 )
...
Fix for https://github.com/pytorch/pytorch/issues/88087
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88344
Approved by: https://github.com/ezyang , https://github.com/samdow
2022-11-04 00:45:35 +00:00
Elias Ellison
9835413009
Fake Tensor For (Conv) Propagation ( #87641 )
...
Resubmitting https://github.com/pytorch/pytorch/pull/87302 so it can be ghstack'd with the pr below.
Incorrect strides in any meta impl would lead to runtime assertion errors for fallback kernels, so start by just enabling it for conv.
Replaces https://github.com/pytorch/pytorch/pull/87588 .
cc @jansel @lezcano @fdrocha @mlazos @soumith @voznesenskym @yanboliang @penguinwu @anijain2305
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87641
Approved by: https://github.com/jansel
2022-10-29 04:14:01 +00:00
Michael Lazos
44d7ba7efb
Fix debug dir bugs and minifier output directories ( #87682 )
...
Fixes https://github.com/pytorch/torchdynamo/issues/1758 , https://github.com/pytorch/torchdynamo/issues/1752
- minifier_launcher.py now dumps checkpoints to \<cwd\>/checkpoints when run
- a single debug directory is created per script invocation, asserts failing with no directory will no longer occur
- torchinductor debug tracing will correctly dump to the debug directory now since no prior setup is needed, (the directory was incorrectly only initialized during dynamo tracing)
cc @jansel @lezcano @fdrocha @soumith @voznesenskym @yanboliang @penguinwu @anijain2305
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87682
Approved by: https://github.com/ezyang
2022-10-25 21:55:28 +00:00
Michael Voznesensky
bc19494814
[Dynamo] Symbolic shape guards ( #87570 )
...
**Introduces symbolic shape guards into dynamo.**
In this PR, we take the existing fake tensor infra and plumbing in dynamo and we start passing a shape_env around. This shape_env does not get plumbed down to middle layers / backend yet - it only collects expressions from frontend invocations at the moment. We then translate these expressions into guards at the point where we take other guards installed throughout dynamo - and add them to check_fn.
Part 1 of https://docs.google.com/document/d/1QJ-M4zfMkD-fjHIqW089RptjLl9EgozZGCceUbvmgfY/edit#
cc @jansel @lezcano @fdrocha @mlazos @soumith @yanboliang @penguinwu @anijain2305
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87570
Approved by: https://github.com/ezyang
2022-10-25 21:15:40 +00:00
Michael Lazos
8461460d55
Unified debug directory for dynamo/inductor tools ( #87438 )
...
Fixes https://github.com/pytorch/torchdynamo/issues/1705
Fixes https://github.com/pytorch/torchdynamo/issues/1383
Adds a debug directory by default called `torchdynamo_debug` in the current working directory.
In the debug directory for each run of dynamo (an enter and exit of optimize) folder run_\<timestamp\> is created which contains any minifier/inductor/torchdynamo artifacts under respective folders.
Updated the minifier, record replay, and inductor tracing to use this directory
cc @jansel @lezcano @fdrocha @soumith @voznesenskym @yanboliang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87438
Approved by: https://github.com/soumith
2022-10-22 03:43:11 +00:00
Jason Ansel
c7c09722ad
Move TorchDynamo into PyTorch core ( #86461 )
...
Context:
https://github.com/pytorch/torchdynamo/issues/1588
This PR moves [TorchDynamo](https://github.com/pytorch/torchdynamo ) and TorchInductor into PyTorch core.
- `torchdynamo` becomes `torch._dynamo`
- `torchinductor` becomes `torch._inductor`
This PR was generated by running `copy_to_core.sh` in https://github.com/pytorch/torchdynamo/pull/1538
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86461
Approved by: https://github.com/voznesenskym
2022-10-13 23:18:06 +00:00