P

PyTorch

P
PyTorch AI

trunk/200b41a7408de59bc55e10c808f26b652b9275a0: [inductor] Handle full randperm in index_add pattern (#196873)

Fixes #196631 Summary TorchInductor already optimizes index_add when the index is a sliced permutation: index = torch.randperm(x.shape[0], device=x.device)[: y.shape[0]] result = torch.index_add(x, dim=0, source=y, index=index) Because the indices are unique and in bounds, the accumulating update can be rewritten using unsafe indexing and a non-accumulating index_put. The full-permutation case: in…

P
PyTorch AI

trunk/94705d5841150618c9de1468727580412bc592f8: [MPS] Fix linalg.lstsq on empty inputs (#199694)

On MPS, torch.linalg.lstsq raised IndexError: max(): Expected reduction dim 0 to have non-zero size whenever min(m, n) == 0. Root cause: the MPS kernel solves the system through an SVD and computes the rank cutoff from the largest singular value, S.max(-1). An empty matrix has no singular values, and max over an empty dimension has no identity value, so it raises (the same as on CPU). Fix: when mi…

P
PyTorch AI v3.10

trunk/8161f9858a7c86698d59776ff0c75930f3423d1f: Move CI docker images off Python 3.10 (#199535)

Python 3.10 reaches EOL this month and was dropped from the nightly binary build matrix in #198233, but 13 of the 31 images in .ci/docker/build.sh were still pinned to it. Most did not say so: only two carry the version in their tag, so images like pytorch-linux-jammy-cuda13.2-cudnn9-py3-gcc11 -- 28 workflow references -- were quietly 3.10. Bumps the eleven whose tags do not encode a version, so n…

P
PyTorch AI

trunk/73d892fece8a67bf1c52a2051cc32552a479a9a1: [py3.14] Inline test.support helpers in test_ordered_set (#199670)

Summary: test_ordered_set.py imports CPython's test.support for two helpers, check_free_after_iterating and gc_collect. Not every Python distribution ships the test package, and where it is missing the whole module fails to import, so no test in it runs: ImportError: cannot import name 'support' from 'test' (unknown location) Copy check_free_after_iterating into the test file and call gc.collect()…

P
PyTorch AI

trunk/3a75bea0e01692dce1f8e00d9be0813130ca9c6d: Fix some rendering bugs in MemoryViz.js (#193989)

Safari rendering broke at some point with the trace plot overlapping. Fixed with some new divs. AI slop says: Safari resolves height: 100% on the timeline SVG grid items against the entire grid container instead of their assigned rows. This makes the main timeline and minimap overflow their tracks and overlap the stack trace panel. The stretched SVG also distorts the y-axis labels. Place each time…

P
PyTorch AI

trunk/e417f6dfacaf7f00dce343adc0d48d8fcc8fb2e2: [dynamo] Model sourceless DynamicClassAttribute (#199260)

Summary Fix the remaining base types.DynamicClassAttribute failure from the CPython 3.13 port. DynamicClassAttribute is a pure-Python descriptor. When one is created inside a compiled class body and later read raw through C.__dict__["attr"], Dynamo sends that ephemeral descriptor through SourcelessBuilder. The builder had no case for the exact DynamicClassAttribute type, so it graph-broke with "Un…

P
PyTorch AI

viable/strict/1791064141: [inductor] Import _generalized_scatter in fx_utils (#196946)

Fixes #185684 Root cause any_user_may_alias in _is_fake_tensor_same references torch._inductor.fx_passes.reinplace._generalized_scatter by full attribute path, but fx_utils.py never imports that submodule. Its only fx_passes import is from torch._inductor.fx_passes.control_dependencies import control_deps. That import binds torch._inductor.fx_passes, but fx_passes/__init__.py is empty, so reinplac…

P
PyTorch AI

viable/strict/1791023242: [inductor] Add direct scheduler unit tests (#195336)

Fixes #150476 Adds focused unit test coverage for previously under-tested functionality in torch/_inductor/scheduler.py. The added tests cover: FusionResult immediate and deferred fusion decisions. PendingFusion state and fusion-node bookkeeping. NodeUser identity, equality, hashing, and conservative merging behavior. Nested reduction candidate selection and fusion legality checks. Classification…

P
PyTorch AI

trunk/933e37182bed4de09844e675341fa72e18fb522f: [inductor] Add direct scheduler unit tests (#195336)

Fixes #150476 Adds focused unit test coverage for previously under-tested functionality in torch/_inductor/scheduler.py. The added tests cover: FusionResult immediate and deferred fusion decisions. PendingFusion state and fusion-node bookkeeping. NodeUser identity, equality, hashing, and conservative merging behavior. Nested reduction candidate selection and fusion legality checks. Classification…