pytorch/torch/utils
albanD 058fb1790f Fix compilation and "import torch" issues for cpython 3.14 (#158184)
Beginning of process for 3.14 bringup.

State of things from this PR:
- Nothing too scary looking from the Dynamo CPython side, nothing we heavily rely on seems to be missing @williamwen42
- The existing check that makes torch.compile() nicely fail is working as expected. So all these empty functions shouldn't cause any weirdness.
- The `__module__` update changes look suspicious, we should investigate what is the reason and impact of that, in particular for our public API checking @jbschlosser
- Leaving the weakref.py thread safety change as a follow up to keep this a bit simpler. I vendored the whole struct in the meantime FYI @ezyang

EDIT: The `__module__` change is even more cursed than I though due to changes to Union and Optional type where the `__module__` field cannot be changed anymore. See https://github.com/python/cpython/issues/132139 for details.
For now, I'm just skipping the `__module__` setting for 3.14 which will trip the public API checks. Will revisit once I have a final answer on the cpython issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/158184
Approved by: https://github.com/msaroufim
2025-07-15 05:06:55 +00:00
..
_strobelight [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_sympy [attempt 2] Compute contiguity symbolically to avoid dde, and introduce c++ sym_is_contiguous (#157472) 2025-07-02 23:12:29 +00:00
backcompat pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
benchmark [BE] Accelerator agnostic timer.py (#157131) 2025-07-03 22:23:04 +00:00
bottleneck
data Revert "Deprecate DataLoader pin_memory_device param (#146821)" 2025-07-09 10:29:31 +00:00
hipify Add cudaMallocAsync/cudaFreeAsync to cuda_to_hip_mappings (#158056) 2025-07-11 11:48:19 +00:00
jit
model_dump [Pyrefly][Refactor] Replace dict() calls with literal dict syntax for improved readability (#157735) 2025-07-08 18:10:33 +00:00
serialization
tensorboard [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
viz [MemoryViz] Add file selector button (#157647) 2025-07-07 22:03:51 +00:00
__init__.py
_appending_byte_serializer.py
_backport_slots.py
_config_module.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_config_typing.pyi inductor codecache: include private inductor configs in cache key (#153672) 2025-06-11 01:33:24 +00:00
_content_store.py
_contextlib.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_cpp_embed_headers.py [Build] Allow metal shaders to include ATen headers (#156256) 2025-06-18 01:03:25 +00:00
_cpp_extension_versioner.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_cxx_pytree.py
_device.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
_dtype_abbrs.py
_exposed_in.py
_filelock.py
_foreach_utils.py [torch] Add MTIA to the list of devices supporting foreach/fused kernels (#157583) 2025-07-04 01:15:24 +00:00
_freeze.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_functools.py
_get_clean_triton.py [BE]Enhance _get_clean_triton.py to auto-generate launch_params if missing (#154666) 2025-05-31 19:27:56 +00:00
_helion.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
_import_utils.py
_mode_utils.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_ordered_set.py Typo fixes for "overridden" in comments and function names (#155944) 2025-06-14 03:37:38 +00:00
_python_dispatch.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_pytree.py Preserve Enum types during torch.export serialization and deserialization (#154821) 2025-06-08 17:30:31 +00:00
_stats.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_thunk.py
_traceback.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
_triton.py [inductor] Update triton_key import to support latest Triton (#157242) 2025-06-30 17:51:43 +00:00
_typing_utils.py
_zip.py pyfmt lint more torch/utils files (#155812) 2025-06-12 23:51:42 +00:00
backend_registration.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
bundled_inputs.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
checkpoint.py [BE][16/16] fix typos in torch/ (torch/utils/) (#156606) 2025-07-02 22:55:29 +00:00
collect_env.py Add Intel GPU info collection to the collect env script (#157351) 2025-07-09 03:01:41 +00:00
cpp_backtrace.py
cpp_extension.py Suppress warning when using native arch for jit loading cuda extensions. (#156923) 2025-07-09 02:51:20 +00:00
deterministic.py
dlpack.py Upgrade to DLPack 1.0. (#145000) 2025-06-30 16:58:06 +00:00
file_baton.py
flop_counter.py Inductor logging + analysis of torch.profile (#149697) 2025-07-07 22:13:34 +00:00
hooks.py Add warning for module full backward hook when no input requires gradient (#155339) 2025-06-10 04:42:06 +00:00
mkldnn.py
mobile_optimizer.py
model_zoo.py
module_tracker.py
show_pickle.py
throughput_benchmark.py
weak.py Fix compilation and "import torch" issues for cpython 3.14 (#158184) 2025-07-15 05:06:55 +00:00