[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
This commit is contained in:
Michael Voznesensky
2022-10-25 21:15:40 +00:00
committed by PyTorch MergeBot
parent d0e12d1cc8
commit bc19494814
15 changed files with 427 additions and 23 deletions

View File

@ -6,6 +6,7 @@ import inspect
import itertools
import operator
from typing import Any
from unittest.mock import patch
import torch