P

PyTorch

P
PyTorch AI

trunk/efc1bd38e81b7957f3f06c62ebc2271f5ba37dcb: [Test] Bring `@modules` out-of-tree backend support (#189387)

Background op_overrides / op_allowlist / set_test_configs() (#176264, #181703, #181554) let out-of-tree (PrivateUse1) backends reuse OpInfo-based test suites through pure configuration. This PR brings @modules to parity with @ops. Changes Add module_overrides / module_allowlist to DeviceTypeTestBase and apply them in the modules parametrizer; Add a generic ModuleInfo.dtypesIf dict so any backend c…

P
PyTorch AI

trunk/90385d3bd0c39f4f24aed41560539082e59eede2: [MPS] Avoid CPU fallback for small `eigh` inputs (#203272)

Fixes #202777 Removing the small-input CPU fallback seems to improve performance on average, according to the following script (co-authored by Claude): Click to expand import argparse import itertools import torch import torch.utils.benchmark as benchmark SHAPES = [] for n in range(1, 112, 2): for b in range(1, 112, 10): if b * n * n < 12288: SHAPES.append((b, n, n)) DTYPES = { "float32": torch.fl…

P
PyTorch AI

trunk/2450619a4c8a11b6f652154d12173794ebe181d5: Fix exp_u20 flushing subnormal results to zero (#197785)

Summary: The AVX2/AVX512 exp_u20 fast path builds 2^n by writing exponent bits, which cannot produce a subnormal, and it clamped at ln(FLT_MIN). So it returned 0 for every input whose exp is subnormal, and also for [-87.34, -86.99), where exp is still a normal float. It also turned NaN into exp(88.72). Fix the fast path instead of falling back to the scalar exp(): Split ln(2) (Cody-Waite) so the r…

P
PyTorch AI

viable/strict/1793821825: Export the generated Meta kernels of unstructured inplace ops (#201651)

Linked issue or supporting maintainer Fixes #167818 BC-breaking? No Summary (human written only) See #167818. Agent details (if applicable) Drafted by Claude (AI) for @egeboy35. RegisterMeta defines at::meta:: wrappers for unstructured inplace ops that have no Meta kernel of their own (gen_unstructured generates one). With per-operator headers, operator_headers() includes <op>_meta_dispatch.h only…

P
PyTorch AI

viable/strict/1793820049: [AOTI] Add CUDA graph capture to the C shim (#202227)

Summary (human written only) Expose Aten cudagraph and mempool interfaces in the C shim, to prepare for upcoming AOTI cudagraph support. Agent details This PR was authored with an AI assistant (Claude Code). Everything in this section is AI-generated. Adds C shim functions that wrap at::cuda::MemPool and at::cuda::CUDAGraph (create and delete a pool and a graph, capture_begin, capture_end, replay)…

P
PyTorch AI

viable/strict/1793818235: [MPS] Migrate weight_norm to Metal (#202745)

Pretty straight forward, migrates weight norm forward to meteal. Aggregated stats: n min geomean max 17 0.87x 1.85x 4.67x Model shape perfs: model layer weight shape dim main us PR us speedup HiFi-GAN conv_pre (512, 80, 7) 0 53.3 12.0 4.43x HiFi-GAN resblock k=3 (256, 256, 3) 0 35.2 13.7 2.57x HiFi-GAN resblock k=11 (256, 256, 11) 0 46.4 33.0 1.41x HiFi-GAN upsample ConvTranspose1d (512, 256, 16)…

P
PyTorch AI

viable/strict/1793816519: [dynamo] Support Class.mro() on user-defined classes (#196863)

Calling SomeClass.mro() currently graph breaks in Dynamo with gb0156, while accessing SomeClass.__mro__ is already supported. This adds a fast path for classes using the default type.mro implementation. When type(cls) is type and no class in the MRO defines mro, the call returns a new list built from __mro__, with a DICT_NOT_CONTAINS("mro") guard for each MRO entry. CPython recomputes __mro__ usin…

P
PyTorch AI

viable/strict/1793814931: [pr-review] Show the review the labels on the pull request (#203298)

The automated review runs offline and is shown only the diff, the checkout and /tmp/pr-comments.json (title, description, author, comments). It never sees the PR's labels, so a finding that asks for a label cannot tell whether it is already there. On #203059 it asked three times for ciflow/docker and ciflow/binaries (reviews at 20:38 and 00:02) although ciflow/docker had been added by pytorch-bot…

P
PyTorch AI

viable/strict/1793812922: [dynamo] Support bytearray.find and bytearray.rfind (#199685)

Part of #192126 Adds Dynamo support for bytearray.find and bytearray.rfind, the first two methods of the search-method family tracked in the issue. startswith / endswith will follow in a separate PR. Implementation Both methods live on ByteArrayVariable in torch/_dynamo/variables/lists.py and share one _bytearray_search helper, which the existing bytearray_count now uses as well: positional-only,…

P
PyTorch AI

viable/strict/1793805683: [dynamo] Make torch.compiler tracing flags per-thread (#202198)

Fixes #202042 Summary Formerly, the torch.compiler tracing flags were module globals, so any thread read True while any one thread compiled, and interleaved torch.compile and non-strict torch.export sessions in different threads could leave the flags stuck True. This PR moves the flags into per-thread TLS as named keys (torch.compiler.is_compiling / torch.compiler.is_exporting / torch.compiler.is_…

P
PyTorch AI

viable/strict/1793800260: [Inductor] Realize expensive producers of wide broadcasts (#202772)

A broadcast producer is currently realized only if its op count exceeds realize_opcount_threshold, so a moderately expensive per-row value broadcast over a wide consumer is inlined and recomputed for every element. This PR also applies the read-count heuristic (realize_reads_threshold) once the broadcast is at least realize_broadcast_reuse_threshold (default 64) wide. On the gpt-oss MoE down proje…

P
PyTorch AI

trunk/1933a0a9ee51f2b03ad3cababd727b442d23630e: [Inductor] Realize expensive producers of wide broadcasts (#202772)

A broadcast producer is currently realized only if its op count exceeds realize_opcount_threshold, so a moderately expensive per-row value broadcast over a wide consumer is inlined and recomputed for every element. This PR also applies the read-count heuristic (realize_reads_threshold) once the broadcast is at least realize_broadcast_reuse_threshold (default 64) wide. On the gpt-oss MoE down proje…

P
PyTorch AI

viable/strict/1793798432: Enable bicubic grid_sampler_3d for XPU (#198623)

The PR intel/torch-xpu-ops#5511 was merged, so grid sampler 3D with bicubic interpolation can be fully enabled on XPU. remove check_grid_sampler_3d version that asserts bicubic is not implemented update docstring in the torch.nn.functional.grid_sample function update skips and comments in test_nn.py Pull Request resolved: #198623 Approved by: https://github.com/guangyey, https://github.com/jansel

P
PyTorch AI

viable/strict/1793793053: [CUDA] Reuse blocks across conditional primary streams (#192098)

The native caching allocator keeps separate free-block lists for different CUDA streams. Each conditional body capture records its own per-capture CUDA DAG on a fresh primary capture stream. Without special handling, parent and conditional body captures cannot reuse each other’s dead blocks. The previous commit records their relationship in the conditional capture tree. A conditional body starts a…

P
PyTorch AI v3.14

trunk/ec97fbfd424a5831795ff4734c5709da00abc55d: [xpu] Upgrade XPU OneDNN version to v3.14 (#202196)

This PR is to upgrade XPU oneDNN from v3.13.3 to v3.14. This upgrade mainly aims to bring below features for Intel Graphics Performance improvement Improved performance on Intel GPU D-Series (formerly Crescent Island). Improved performance on future integrated GPUs based on Xe3p-LPG architecture (codename Nova Lake P). Improved performance of Scaled Dot Product Attention (SDPA) training forward an…

P
PyTorch AI

viable/strict/1793789405: [CUDA] Reject unsafe frees across conditional captures (#176657)

CUDA graph capture records GPU work and dependencies. The nodes recorded into one cudaGraph_t form a per-capture CUDA DAG. A conditional body capture records a separate DAG. One root capture and all of its conditional body captures form a conditional capture tree. The native caching allocator previously knew only how many captures were active. Add one CaptureState per CUDA capture ID. Each state r…