pytorch/torch/fx/passes
Laith Sakka 39df901b2a introduce definitely_contiguous and use it for reshape and tensor meta data computation. (#153432)
when a tensor has unbacked symbols it can be general enough to represent both contiguous and non contiguous tensors.
in that case we cant really evaluate is_contiguous. In many places in the code base, we check for is_contiguous to take a fast path. but the general path usually works for both contiguous and not contiguous in that case we probably want
to use definitely _contiguous API.

This is appleid for reshape in this PR and also to  tensor meta data computation, the meta data now will have an attribute that says that its contiguous when its always contiguous. We would store that only if definitely _contiguous is true  now.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153432
Approved by: https://github.com/bobrenjc93
2025-05-28 03:41:26 +00:00
..
backends
dialect PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
infra [Sigmoid] Remove magic method in CapabilityBasedPartitioner (#149400) 2025-03-19 16:02:43 +00:00
tests
utils PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
__init__.py
_tensorify_python_scalars.py add graph_code_verbose_log artifact for fx passes (#153775) 2025-05-21 18:31:59 +00:00
annotate_getitem_nodes.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
fake_tensor_prop.py [invoke_subgraph] Run missing graph passes recursively (#152675) 2025-05-06 02:55:34 +00:00
graph_drawer.py Update to using mypy 1.15 (#154054) 2025-05-24 04:30:57 +00:00
graph_manipulation.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
graph_transform_observer.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
net_min_base.py [Minimizer] Gracefully exit when there is no discrepancy in block mode (#154076) 2025-05-23 06:42:07 +00:00
operator_support.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
param_fetch.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
pass_manager.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
README.md Fix xrefs (#151888) 2025-04-25 21:27:27 +00:00
reinplace.py Revert "Improve torch.ops typing (#153558)" 2025-05-19 23:32:36 +00:00
runtime_assert.py add graph_code_verbose_log artifact for fx passes (#153775) 2025-05-21 18:31:59 +00:00
shape_prop.py introduce definitely_contiguous and use it for reshape and tensor meta data computation. (#153432) 2025-05-28 03:41:26 +00:00
split_module.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00
split_utils.py [Minimizer] allow overriding of ShapeProp logic by subclasses of _MinimizerBase (#148784) 2025-03-10 22:22:16 +00:00
splitter_base.py Update to using mypy 1.15 (#154054) 2025-05-24 04:30:57 +00:00
tools_common.py PEP585 update - torch/fx (#145166) 2025-01-20 18:11:54 +00:00

FX Pass Infrastructure

This folder contains the pass infrastructure and passes for transforming fx.Graph.

Code Structure

  • infra - Common infrastructure, such as PassManager, PassBase
  • utils - Utility classes and functions
    • common.py - common utility functions
    • fuser_utils.py - utility functions for fusing list of nodes into a single node
  • dialect - dialect specific passes
  • backends - Backend specific passes
  • conversion - Conversion passes between dialects