mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
The goal of this PR is to avoid stack overflow when we create extremely long chains of thunks, and then evaluate them (e.g., as occurs if you sum(long list of symint)). The basic idea behind this PR is to only thunkify proxies if they're being created in places where they may or may not be used--crucially, symint operations that occur in user code we are tracing are eagerly placed into the graph, even if they may eventually be dead. I annotated the PR with explanation of changes. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/132421 Approved by: https://github.com/Skylion007, https://github.com/zou3519 ghstack dependencies: #132674, #132675
71 lines
1.5 KiB
ReStructuredText
71 lines
1.5 KiB
ReStructuredText
.. currentmodule:: torch.fx.experimental
|
|
|
|
torch.fx.experimental
|
|
=====================
|
|
|
|
.. warning::
|
|
These APIs are experimental and subject to change without notice.
|
|
|
|
torch.fx.experimental.symbolic_shapes
|
|
-------------------------------------
|
|
.. currentmodule:: torch.fx.experimental.symbolic_shapes
|
|
.. automodule:: torch.fx.experimental.symbolic_shapes
|
|
|
|
.. autosummary::
|
|
:toctree: generated
|
|
:nosignatures:
|
|
|
|
ShapeEnv
|
|
DimDynamic
|
|
StrictMinMaxConstraint
|
|
RelaxedUnspecConstraint
|
|
EqualityConstraint
|
|
SymbolicContext
|
|
StatelessSymbolicContext
|
|
StatefulSymbolicContext
|
|
SubclassSymbolicContext
|
|
DimConstraints
|
|
ShapeEnvSettings
|
|
ConvertIntKey
|
|
CallMethodKey
|
|
PropagateUnbackedSymInts
|
|
DivideByKey
|
|
InnerTensorKey
|
|
|
|
hint_int
|
|
is_concrete_int
|
|
is_concrete_bool
|
|
has_free_symbols
|
|
definitely_true
|
|
definitely_false
|
|
guard_size_oblivious
|
|
parallel_or
|
|
parallel_and
|
|
sym_eq
|
|
constrain_range
|
|
constrain_unify
|
|
canonicalize_bool_expr
|
|
statically_known_true
|
|
lru_cache
|
|
check_consistent
|
|
compute_unbacked_bindings
|
|
rebind_unbacked
|
|
resolve_unbacked_bindings
|
|
is_accessor_node
|
|
|
|
torch.fx.experimental.proxy_tensor
|
|
-------------------------------------
|
|
|
|
.. currentmodule:: torch.fx.experimental.proxy_tensor
|
|
.. automodule:: torch.fx.experimental.proxy_tensor
|
|
|
|
.. autosummary::
|
|
:toctree: generated
|
|
:nosignatures:
|
|
|
|
make_fx
|
|
handle_sym_dispatch
|
|
get_proxy_mode
|
|
maybe_enable_thunkify
|
|
maybe_disable_thunkify
|