pytorch/torch/csrc/jit/python
Elias Ellison 97b2dff600 Add Initial Support For Fake Tensor Constant Tracking (#84387)
Adds support for constant tensor tracking within FakeTensors. Copy-pasta'ing from `proxy_tensor.py` why this is useful:
```
# In some circumstances, we will be tracing in a situation where a tensor
# is *statically* known to be a constant (currently, this only happens if
# you run torch.tensor; deterministic factory functions like torch.arange
# don't get this treatment).  When the tensor in question is small, it's
# helpful to due constant propagation in case we call item() (in which
# case we can return the constant value that is known, rather than give
# an error.)
```

This PR only attempts to add support for the tracing scenarios where we run each operation linearly - aot autograd, torchdynamo. It does not yet handle how constant tensors should be handled as part of the persistent fx graph. Additionally, it does not yet attempt to de-duplicate or interact with ProxyMode's only constant tensor handling.

Edit: plan is to rely on functionalization for fx graph
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84387
Approved by: https://github.com/ezyang
2022-09-02 02:43:04 +00:00
..
init.cpp Add Initial Support For Fake Tensor Constant Tracking (#84387) 2022-09-02 02:43:04 +00:00
init.h
module_python.h Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
pybind_utils.cpp Back out "Revert D38984222: Don't introduce new overload for SymInt (#83628)" (#84173) 2022-08-29 18:01:07 +00:00
pybind_utils.h Back out "Revert D38984222: Don't introduce new overload for SymInt (#83628)" (#84173) 2022-08-29 18:01:07 +00:00
pybind.h
python_arg_flatten.cpp [ONNX] Support optional type (#68793) (#73284) 2022-05-04 20:24:30 +00:00
python_arg_flatten.h
python_custom_class.cpp
python_custom_class.h
python_dict.cpp Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_dict.h
python_interpreter.cpp Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_ir.cpp [JIT] Retry - Support scripting torch.is_autocast_enabled() (#82394) 2022-08-10 18:26:17 +00:00
python_ir.h
python_ivalue.h Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_list.cpp Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_list.h
python_sugared_value.cpp Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_sugared_value.h [ROCm] Enable/fix unit tests test_stream_args and test_event_args (#82346) 2022-08-01 22:55:15 +00:00
python_tracer.cpp Fix C API to be compatible with latest 3.11 beta (#81242) 2022-07-27 08:37:10 +00:00
python_tracer.h
python_tree_views.cpp
python_tree_views.h
script_init.cpp [Pytorch][Ondevice quantization] Add device side API to convert model (#83807) 2022-08-29 17:57:38 +00:00
script_init.h
update_graph_executor_opt.cpp
update_graph_executor_opt.h