Skip to content

diagnostic - will close immediately - #1

Closed
egeboy35 wants to merge 912 commits into
mainfrom
fix-linalg-cross-unbacked
Closed

egeboy35 wants to merge 912 commits into
mainfrom
fix-linalg-cross-unbacked

Conversation

@egeboy35

@egeboy35 egeboy35 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Diagnostic only. Testing whether PR creation works within my own fork.

AnthonyBarbier and others added 30 commits August 28, 2026 13:53
…#189692)

Fix Inductor codegen for user-defined Triton kernels that pass non-builtin Python objects as `tl.constexpr` values.

When such constants are serialized with constructor-style `repr` output, for example `UserDefinedTritonKernelConfig(offset=2)`, generated kernel source and launcher code need the corresponding class in scope.

This change imports the constant class into generated kernel source and makes it available in the generated launcher exec scope.

Pull Request resolved: pytorch#189692
Approved by: https://github.com/jansel
Fixes pytorch#195074

`scatter_add_`, `index_add_` and `index_put_(accumulate=True)` write to the wrong elements when the destination is a `torch.bool` view whose buffer is bound at a byte offset that is not a multiple of 4. The write lands at the start of the enclosing 4-byte word instead of at the view, so it corrupts memory in front of the view and leaves the intended elements false, with no error and no warning.

Indices set by `buf[off:].scatter_add_(0, tensor([0, 2]), ones(2, dtype=bool))` on a 16-element bool tensor. `index_add_` and `index_put_` behave identically.

| storage_offset | CPU | MPS before | MPS after |
| --- | --- | --- | --- |
| 0 | 0, 2 | 0, 2 | 0, 2 |
| 1 | 1, 3 | 0, 2 | 1, 3 |
| 2 | 2, 4 | 0, 2 | 2, 4 |
| 3 | 3, 5 | 0, 2 | 3, 5 |

## Root cause

A tensor buffer is bound at `storage_offset() * element_size()` bytes and `element_size()` is 1 for bool, so a bool view whose storage offset is not a multiple of 4 hands the kernel a `metal::atomic<uint>` base that is not 4-byte aligned. `AtomicType<bool>::atomic_add` then computes `data + (offset >> 2)` against that base and lands on the wrong word.

c97fd51 (pytorch#176009) added this same realignment to `atomic_add_helper` and `atomic_binary_op_helper` for the other sub-32-bit dtypes. `AtomicType<bool>::atomic_add` keeps its own copy of the compare-exchange loop and was missed. `AtomicType<bool>::atomic_binary_op` right below it already delegates to the fixed helper, and `uint8` is correct for the same reason.

## Fix

Delete the hand-rolled loop and delegate to `atomic_add_helper<bool>`, which already does the realignment, the packed-word selection and the compare-exchange. After the early return `value` is always `true`, so the helper's `+=` stores the same `1` the old `= true` did.

## Test

`TestAdvancedIndexing.test_accumulate_misaligned_storage_offset` runs the three ops over `torch.bool` and `torch.uint8` at all four storage-offset residues and compares the whole base tensor against CPU, so a write landing outside the view is caught. It goes in `test_mps.py` rather than next to the pytorch#176009 test in `test_indexing.py` because `scatter_add_` has no `Bool` in its CUDA dispatch (`ScatterGatherKernel.cu`, `AT_DISPATCH_ALL_TYPES_AND2(Half, BFloat16)`), so a device-generic version would need a CUDA skip.

```
python test/test_mps.py -v -k test_accumulate_misaligned_storage_offset
```

Fails 9 of 24 subtests without the fix (`bool` at offsets 1, 2 and 3 for each of the three ops), all 24 pass with it. No regressions in `test_mps.py TestAdvancedIndexing` (89 pass), `test_indexing.py -k MPS` (146 pass, 13 skipped), or `test_mps.py` filtered on `scatter` / `index_add` / `index_put` (159 / 22 / 43 pass).

Pull Request resolved: pytorch#195081
Approved by: https://github.com/malfet

Co-authored-by: Nikita Shulga <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
…h#188114)

The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware:

1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them.

2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201.

Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly.

Fixes pytorch#188113

Pull Request resolved: pytorch#188114
Approved by: https://github.com/eellison, https://github.com/alugorey, https://github.com/jeffdaily

Co-authored-by: doplxyz <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Jeff Daily <[email protected]>
… (pytorch#195024)

Adds a wheel-level regression check for pytorchgh-194490.

## What it covers that the existing test doesn't

pytorchgh-194490 was a 2.13 Inductor regression — a gather/scatter pair around a loop reduction produced Triton whose epilogue read a temporary defined only inside the reduction body:

```
tmp41 = tl.where(tmp38, tmp40, tmp19)
                               ^
NameError: tmp19 is not defined
```

It was found by a user training Dion3 through vllm-project/speculators, not by CI.

The fix (pytorchgh-194786) added `test_loop_epilogue_indirect_load_scope` to `test/inductor/test_indexing.py`, and **that remains the authoritative test** — it asserts codegen structure via FileCheck, which this cannot. But it compiles with `dynamic=True`, whereas the reported failure only appeared on the **second** compile, once a differing shape triggered *automatic* dynamic shapes. Those are different paths.

So this check does two trials with different row counts and no `dynamic=` flag: the first compiles statically, the second generalizes. That's the route users actually hit.

## Fidelity to the reproducer

The `torch.where` over a tensor predicate is kept deliberately — the failure surfaced *inside* a `tl.where`, so simplifying it to a plain lerp risks not regenerating the same codegen. I had simplified it initially and put it back for that reason.

Shapes shrink from the reproducer's `(6, 4096, 4096)` to `2 x k x 4096`, but the **4096-wide reduction dim is preserved on purpose** so the reduction stays non-persistent and the loop path is actually emitted. Smaller and it becomes a persistent reduction and stops covering the bug.

## Blast radius

Runs under the existing torch-compile gate (already skipped on Python 3.15+ and non-Linux/macOS), and returns early without CUDA — so CPU and Windows wheels are unaffected. Roughly two `torch.compile` invocations on ~128K-element tensors.

Tolerances are loose (`rtol/atol 1e-4`). The assertion that matters is that codegen succeeds at all; a 4096-wide reduction over bf16 inputs differs between eager and Inductor by reduction order alone, and a wheel check must not fail on that.

## Caveats, stated plainly

**I could not run this** — no GPU on the machine I authored it on. Syntax and wiring are verified; the codegen behaviour is not. It needs one real run on a CUDA wheel before it's trusted. If it turns out the reduction goes persistent at these shapes, the test passes while covering nothing, and the reduction dim needs raising.

**Coverage is heuristic-dependent.** If Inductor's persistent-reduction threshold changes, this silently stops exercising the bug rather than failing. That's noted in the docstring with a pointer to the inductor test, which has no such dependency.

**On placement:** my own view is that compiler-codegen regressions belong in `test/inductor/`, not in the release smoke test — the smoke test validates that the binary works, and this adds a GPU-only, Triton-dependent, config-sensitive path to every wheel check. Adding it here anyway at @atalman's direction, since the escape happened on a release binary and the release gate is where he wants the net. Recording the tradeoff so the next person editing this file knows why it's here.

---

Filed with the help of Claude Code.
Pull Request resolved: pytorch#195024
Approved by: https://github.com/eellison, https://github.com/karthickai
…ch#194986)

This PR, in short, does:
- expose and publicize functional APIs (they already existed)
- document this more uniformly
- add big examples in optim.md for using them (and also step hooks), notably a bf16 adamw example.

Pull Request resolved: pytorch#194986
Approved by: https://github.com/albanD
## Summary

Fixes pytorch#84886.

There was a race in the post-local SGD checkpoint reload test. Rank 0 created the temporary checkpoint and all ranks synchronized after it was written. However, there was no synchronization after loading. Rank 0 could complete the test first, leave the temporary-file context, and delete the checkpoint before another rank opened it, causing FileNotFoundError.

Serialize the checkpoint into an in-memory buffer on rank 0 and broadcast the bytes through the process group. Each rank then loads from its own BytesIO buffer.

This removes the rank-0-owned file and its lifetime race instead of adding another barrier around temporary-file cleanup. It also removes the unnecessary shared-filesystem dependency while preserving coverage of serialization, device remapping, optimizer state restoration, and the missing-step fallback.

The same changes applied to test_ddp_hook_pickling_powerSGD and unskipped the test.

## Reproduction
On `main`, add a 3s delay on non-zero ranks between the post-save `dist.barrier()` and `torch.load` in `_test_post_localSGD_optimizer_step_reload`:
```python
            dist.barrier()
            if self.rank != 0:
                time.sleep(3)
            map_location = {"cuda:0": f"cuda:{self.rank:d}"}
            checkpoint = torch.load(chkpt_file, map_location=map_location)
```
And then execute the test:
```
BACKEND=nccl WORLD_SIZE=2 TEMP_DIR=/tmp/dist python test/distributed/test_distributed_spawn.py -v \
  TestDistBackendWithSpawn.test_post_localSGD_optimizer_step_reload
```
Without the changes, the test returns:
```
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmptsfocehr'
```
Pull Request resolved: pytorch#194614
Approved by: https://github.com/jeffdaily
I see from `build/bolt_profiles/libc10_cuda.yaml` that the block comparator is the hottest function in libc10_cuda.so. Using a function ptr based comparator hinders inlining. Replacing it with a struct based comparator should help.
Pull Request resolved: pytorch#195129
Approved by: https://github.com/Skylion007
)

### Summary
Currently, when custom operators (or JIT-dispatched operators) are invoked from Python, C++ warnings emitted via `TORCH_WARN` or `TORCH_WARN_ONCE` are not intercepted by Python. Instead, they fall back to raw C++ stderr. As a result, Python users cannot catch them using `warnings.catch_warnings()` or suppress them using `warnings.filterwarnings()`.

### Fix
Instantiate `torch::PyWarningHandler` in `invokeOperatorFromPython`. This ensures that when custom operators (or JIT-dispatched operators) are invoked from Python, C++ warnings (emitted via `TORCH_WARN` / `TORCH_WARN_ONCE`) are correctly intercepted and routed to Python's `warnings` module as `UserWarning`s, rather than falling back to C++ stderr.

### Test Added
Added a new unit test `test_custom_op_warning_propagation` in `test/test_custom_ops.py` that dynamically compiles a custom C++ operator emitting a `TORCH_WARN` and asserts it is caught in Python.

BC-breaking note: we make torch.ops.* call go through the same exception and warning translation as the rest of the library. This means that some exception translation that used to be handle by pybind is now handled natively. User-defined pybind exception translation is thus lost here. Restoring it can be done in a follow up as part of a broader exception handler improvement.
Pull Request resolved: pytorch#193451
Approved by: https://github.com/albanD
## Human Note

Opus is wayyyyyyyy to chatty let try and slow his role

## Agent note

This change was prepared with an AI assistant. Configure the interactive Claude Code workflow to use
Claude's `Concise` output style while preserving its existing thinking, timeout, retry, and watchdog
settings. The structured triage and autorevert workloads are unchanged.

## Test Plan

```bash
git diff --check
actionlint .github/workflows/claude-code.yml
```

Full lint setup could not complete because the local environment lacks the `packaging` module:

```bash
.venv/bin/spin lint -a
```
Pull Request resolved: pytorch#195169
Approved by: https://github.com/izaitsevfb
…pytorch#191494)

Since v2.13.0 a standalone `cmake --install` scatters Python package
directories (_dynamo/, _export/, _inductor/, csrc/, testing/, utils/) across
CMAKE_INSTALL_PREFIX alongside bin/, include/, lib/ and share/, and writes
into the source checkout besides. Reported as pytorch#191102. The prefix-root
scattering comes from pytorch#177643, which added cmake/PackageData.cmake and its
unconditional include; the source-checkout writes from pytorch#177642, which did the
same for cmake/FileMirroring.cmake.

scikit-build-core models a wheel as several trees -- platlib, purelib, data,
headers, scripts, metadata -- and exports each to CMake as SKBUILD_<TREE>_DIR.
`wheel.install-dir` selects which tree, plus optional subpath, becomes
CMAKE_INSTALL_PREFIX; it defaults to empty, which makes the prefix the platlib
root itself. We set it to "torch" because the C++ tree has to sit at torch/lib
for the $ORIGIN/lib install rpath and torch/__init__.py's __file__ lookups to
resolve, and that pushes the prefix one level below platlib.

Most of our Python-side install rules were nonetheless written relative to the
prefix, using it as a proxy for the platlib tree. That only holds while
scikit-build-core is driving and install-dir is exactly "torch". A standalone
cmake install has a conventional prefix and no platlib at all, so the same
rules deposit torch/ package data at the prefix root. cmake/FileMirroring.cmake
did address the tree properly via SKBUILD_PLATLIB_DIR, but fell back to
PROJECT_SOURCE_DIR when it was undefined, which is how a standalone install
came to write into the checkout.

This is not an edge case: docs/libtorch.rst documents building libtorch with
`cmake --build . --target install` into a CMAKE_INSTALL_PREFIX of your choice,
which is the flow the report used. The layout that install should produce is
nowhere documented, which is a gap worth closing separately.

The rules now address SKBUILD_PLATLIB_DIR directly -- cmake/PackageData.cmake,
cmake/FileMirroring.cmake, and the _C, _nccl_ep, version.py and _rocm_init.py
rules in torch/CMakeLists.txt -- guarded on SKBUILD, the sentinel
scikit-build-core sets for exactly this question. A build scikit-build-core does
not drive (libtorch, tools/build_libtorch.py, downstream cmake --install)
installs the C++
distribution alone, which restores the pre-2.13 contract: setup.py owned all
the Python packaging back when a standalone install was C++ only.

Two alternatives are worth naming. The reporter suggested a named install
COMPONENT held out of the default install; that is orthogonal, and already in
flight as pytorch#184873 for wheel scoping, but it would not fix this on its own,
because CMake runs every install() rule on a component-less `cmake --install`
whatever its tag. Dropping `wheel.install-dir` instead would make the prefix
the platlib root and coincide the two, but it needs a torch/ prefix on ~90 C++
destinations, ~40 of them raw literals not routed through TORCH_INSTALL_LIB_DIR
and friends, and it inverts the conditional: standalone C++ installs would then
need torch/ suppressed everywhere.

The prefix-must-be-<platlib>/torch coupling is now enforced rather than
assumed. install-dir is what makes the two agree, so changing it silently
produces an install that only fails at import; a mismatch is now a
configure-time FATAL_ERROR naming both paths and pointing at pyproject.toml.

Note that tools/build_libtorch.py loses the torchgen/packaged mirroring, as it
builds with BUILD_PYTHON=OFF and no longer produces a Python payload. The only
consumer of those files is torchgen/gen_backend_stubs.py at runtime in an
installed torchgen, which is not in the libtorch path.

Three things surfaced while reviewing the above and are folded in. pytorch#191625 added
an install rule for the gitignored torch/_rocm_init.py while this was open, in
the same prefix-relative form; it was the last remaining DESTINATION "." in the
tree and is now guarded and addressed like its neighbours. The _C rule's ARCHIVE
clause is dropped: _C is a MODULE library, so no Windows import library is
produced and none ships -- the 2026-08-18 cp312 win_amd64 nightlies carry 13 to
16 .lib files across the cpu, cu126 and xpu variants, every one a genuine C++
import library and no _C.lib among them. It was also the one prefix-relative
destination left in a rule whose other two were absolute.

A lint rule is added so this class of regression is rejected when it is written
rather than after a release. pytorch#191625 is the evidence that it recurs: it landed
three weeks after this fix and nothing caught it, because no CI job installs
standalone and inspects the result -- tools/build_libtorch.py is the only
standalone-install path exercised in CI and it configures with BUILD_PYTHON=OFF,
so it never evaluates these rules. CMAKE_INSTALL_PREFIX_ROOT forbids a
destination of "." across the build system; CMAKE_PLATLIB_DESTINATION
additionally requires every destination in the two package-data files to name
the wheel tree, which catches the prefix-relative variant. Both reuse the
existing grep_linter adapter and are registered in VERY_FAST_LINTERS in
.spin/cmds.py, which spin requires of every linter. This is a text check, not a
behavioural one: a destination that reaches the prefix root through a variable,
or a new rule that uses the wheel tree but omits its SKBUILD guard, still gets
through.

Test Plan:

All on Linux/CPU unless noted, against the reporter's exact configure from the
issue:

```
cmake -S . -B build-standalone -GNinja \
  -DCMAKE_INSTALL_PREFIX=/tmp/prefix \
  -DATEN_NO_TEST=ON -DBUILD_BINARY=ON -DBUILD_CUSTOM_PROTOBUF=OFF \
  -DBUILD_PYTHON=ON -DBUILD_TEST=OFF -DUSE_OPENMP=ON \
  -DCMAKE_INSTALL_LIBDIR=lib -DUSE_DISTRIBUTED=OFF -DUSE_CUDA=OFF

grep -rhoE '\$\{CMAKE_INSTALL_PREFIX\}/[A-Za-z_./]*' \
  --include=cmake_install.cmake build-standalone/ \
  | sed 's|${CMAKE_INSTALL_PREFIX}/||' | cut -d/ -f1 | sort -u
grep -rh --include=cmake_install.cmake 'CMAKE_INSTALL_PREFIX}/\."' build-standalone/
grep -rh --include=cmake_install.cmake "DESTINATION \"$PWD" build-standalone/
grep -rhE --include=cmake_install.cmake 'DESTINATION "(/torch|/torchgen)' build-standalone/
```

Before: `. bin csrc _dynamo _export _inductor include lib share testing utils`,
plus seven rules with destinations inside the source checkout. After:
`bin include lib share`, and the other three greps empty. The last one checks
that an unset SKBUILD_PLATLIB_DIR has not turned a destination into an absolute
path at the filesystem root. The greps must recurse over every
cmake_install.cmake, not just the top-level one, since several of the offending
rules live in subdirectory scopes.

Same configure with -DUSE_CUDA=ON -DUSE_DISTRIBUTED=ON -DUSE_NCCL=ON
-DUSE_NCCL_EP=ON -DUSE_SYSTEM_NCCL=ON: the _nccl_ep target is still built (it
appears in build.ninja, producing torch/_nccl_ep.cpython-310-x86_64-linux-gnu.so)
but contributes no install rule, and the prefix root stays clean.

The guard, exercised the way it can actually regress -- by changing install-dir
in pyproject.toml to something other than "torch" and building a wheel -- fails
configure with the FATAL_ERROR, reporting platlib, the expected prefix and the
actual one.

Wheel contents, via scikit-build-core:

```
pip install -e . -v --no-build-isolation   # twice, consecutively
python -c "import torch, torchgen.packaged, functorch; print(torch.__version__)"
```

Both builds succeed, each configure picking up its own staging directory. The
installed file list under site-packages is identical to a pre-change build of
the same base: 9679 files, none gained or lost, including the mirrored copies
that exist only in the install tree (valgrind.h/callgrind.h, torchgen/packaged
with native_functions.yaml, tags.yaml, 42 templates and 16 autograd files) and
the generated version.py, _C, 43 .pyi stubs and 20 jinja templates. import and
a matmul both work.

The new lint rules, checked in both directions -- clean on this tree, and
flagging the real regressions on the pre-fix tree:

```
spin lint -- --take CMAKE_INSTALL_PREFIX_ROOT,CMAKE_PLATLIB_DESTINATION
```

CMAKE_INSTALL_PREFIX_ROOT flags 6 lines on the pre-fix tree -- torch/CMakeLists.txt
474, 475, 517, 548 and 555, plus cmake/PackageData.cmake:21 -- where 555 is the
pytorch#191625 _rocm_init.py rule, so the check demonstrably rejects the regression that
actually happened. CMAKE_PLATLIB_DESTINATION flags 12.

Lint:

```
lintrunner -a --take CMAKE,NEWLINE,SPACES,TABS,CODESPELL,COPYRIGHT,EXEC \
  CMakeLists.txt cmake/FileMirroring.cmake cmake/PackageData.cmake \
  cmake/Summary.cmake torch/CMakeLists.txt .lintrunner.toml .spin/cmds.py
```

Not covered: Windows and macOS were not exercised locally; ciflow/binaries is
what covers them.

This change was authored with the assistance of an AI coding assistant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Fixes pytorch#191102

Pull Request resolved: pytorch#191494
Approved by: https://github.com/atalman
## Summary

Benchmark all candidates in a runtime multi-kernel comparison under one registered GPU benchmark lock. This prevents concurrent compile workers from interleaving candidate measurements on the same GPU. Existing per-candidate benchmark locking remains nested through the reentrant lock contract.

Candidate ordering, forced and cached choices, and benchmark failure behavior are unchanged.

## Test plan

- `python -m pytest -q test/inductor/test_multi_kernel.py -k "benchmark_sub_kernels_holds_gpu_lock_across_candidates or benchmark_sub_kernels_releases_gpu_lock_on_failure"`
- Existing multi-kernel softmax variants on B200

The focused lock tests verify one lock scope covers all candidates and that exceptions release the lock.

Pull Request resolved: pytorch#192876
Approved by: https://github.com/zou3519
…pytorch#195029)

DequeVariable clamps to maxlen with items[-maxlen:], but when maxlen is 0 that
slice is items[-0:], i.e. items[0:], which returns the whole list instead of an
empty one. So under torch.compile a deque(maxlen=0) modeled its contents wrong:
collections.deque([1, 2, 3], maxlen=0) traced as length 3, and appending or
extending a maxlen=0 deque kept the new items, while CPython keeps it empty in
every case. __init__ (construction) and _clamp_maxlen's right side (append and
extend) both used the bare slice; appendleft/extendleft use items[:maxlen],
which is already correct for 0. Both sites now special-case maxlen == 0 to
items[:0].

Test Plan:

```
python test/dynamo/test_misc.py MiscTests.test_deque_maxlen_zero
PYTORCH_TEST_WITH_DYNAMO=1 python test/cpython/v3_13/test_deque.py
```

test_deque_maxlen_zero is new and fails without the fix; the cpython deque suite
stays green.

This change was authored with the assistance of Claude (Anthropic).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

Pull Request resolved: pytorch#195029
Approved by: https://github.com/guilhermeleobas

Co-authored-by: Claude Opus 4.8 <[email protected]>
…ke (pytorch#195116)

This ensures that `USE_CMAKE_INSTRUMENTATION` is visible in nnpack.cmake so we can disable instrumentation for that library.

This is needed because NNPACK has a custom command that starts with PYTHONPATH=... This custom command fails when wrapped with ctest --instrument

Related-to: pytorch#189078
Pull Request resolved: pytorch#195116
Approved by: https://github.com/eqy
…#193834)

### Summary
Integrates the `torch.distributed._watchdog` timeout machinery into symmetric  memory's blocking and stream-based operations so that hangs in multi-process rendezvous or one-sided NCCL ops are detected and surfaced instead of blocking silently.

### Test Plan

```
python test/distributed/test_symmetric_memory.py -k SymmMemWatchdogUnitTest
torchrun --nproc_per_node=2 test/distributed/test_nccl.py -k NCCLSymmMemWatchdogTest
```

Authored with AI assistance
Pull Request resolved: pytorch#193834
Approved by: https://github.com/d4l3k
…rch#194838)

Greenlight records one row per review run in `misc.greenlight_pr_state`, naming the
head SHA that run evaluated. `greenlight_ledger.py` reads the latest row per PR through
the HUD `/api/greenlight/pr_state` route that fronts that table: it batches at the
route's 50-PR limit, retries with backoff, normalizes the route's timestamps to aware
UTC, and classifies the statuses into terminal and in-flight sets. Row selection stays
server-side so writer and reader agree on which row is authoritative.

`greenlight_identity.py` holds the one login-normalization rule every comparison in the
guard goes through. GraphQL renders a GitHub App's login bare while REST appends
`[bot]`, so a comparison that skips normalization silently fails to match — which means
either the guard switches itself off or it refuses a merge it should allow.

These two modules are the leaves of the guard's import graph: identity imports nothing,
and the ledger only needs `github_utils`. Landing them first keeps each piece of the
land-time guard reviewable on its own and each change under the 2000 LOC infra limit.

Signed-off-by: Jean Schmidt <[email protected]>
Pull Request resolved: pytorch#194838
Approved by: https://github.com/huydhn
…orch#194839)

`greenlight_preflight.py` detects PRs greenlight will never produce a verdict for, so a
merge can refuse immediately instead of waiting out the full budget for an answer that
is not coming. It mirrors the upstream filters that drop a PR before it is ever
fingerprinted — `review._recency_filter` (excluded labels and the review window, each
with an escape for a PR whose recorded status is non-terminal) and both arms of
`review_gate.human_review_skip_reason` (changes requested by a non-bot, and an approval
from the merge-authorized set). Each mirrored constant is commented with its upstream
source in pytorch/test-infra under `greenlight/src/greenlight/`, because drift in either
direction either costs a merge an hour of waiting or refuses a PR greenlight would in
fact have reviewed.

`greenlight_messages.py` is the single place that renders guard outcomes as text. Three
surfaces share one set of outcomes: the refusal that ends a merge, the line the retry
loop logs while it waits, and the comment posted to the PR the first time a merge waits.

Split out from the guard so the mirrored upstream filters can be reviewed against
greenlight's own source on their own, and to keep each change under the 2000 LOC infra
limit. Both modules sit above the ledger and identity leaves and below the guard itself:
preflight reads the ledger's status sets and identity's normalization, messages reads
the ledger's route URL and preflight's excluded-labels phrase. The references each makes
back to `greenlight_guard` are annotations only, under `TYPE_CHECKING`, so nothing here
imports the guard at runtime.

Signed-off-by: Jean Schmidt <[email protected]>
Pull Request resolved: pytorch#194839
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#194838
…194840)

`greenlight_guard.py` is the decision itself. It compares the head SHA greenlight
recorded in its ledger against the head actually being landed and returns ALLOW, WAIT or
DENY, along with the wait budget (`GreenlightWaitWindow`) a merge carries across
re-entries. Everything it needs about a PR arrives as plain data or as a callable on
`PRUnderMerge` — the callables stay callables because each one costs a GitHub request
that only the minority of PRs greenlight alone authorizes ever needs. It must not import
`trymerge`: `trymerge` imports it, and the cycle would break both.

Two failure directions are split deliberately. Anything that is only unknown — no ledger
row, a verdict for an older commit, a review still running, an unreadable HUD, a reviewer
GitHub would not classify — waits, and is refused only once the budget is spent. Anything
settled against the head being landed — NO_LAND/CANCELLED/FAILED, an unrecognized status,
a review that has outlived greenlight's own timeout — refuses at once. Refusing on first
uncertainty would turn a HUD blip into a dead merge; waiting on a settled negative would
burn an hour and land nothing.

The tests cover the decision table, stack handling, the laziness of the per-PR GitHub
lookups, the ledger's transport failure modes against a mocked `gh_fetch_url` (every
documented route error code, malformed payloads, batch capping, backoff, recovery on
retry), and the preflight mirror. No test touches the network. They land together with
the guard because `test_greenlight_guard.py` owns the shared PR fixtures that the ledger
and preflight tests build on.

Split out from the `trymerge.py` wiring so the verdict logic can be reviewed against
greenlight's behaviour independently of the merge path, and to keep each change under the
2000 LOC infra limit. Nothing calls into this yet.

Signed-off-by: Jean Schmidt <[email protected]>
Pull Request resolved: pytorch#194840
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#194838, pytorch#194839
…ytorch#194841)

**Impact:** mergebot only — PRs whose sole merge authorization is the `pytorchgreenlight`
approval
**Risk:** medium

Depends on pytorch/test-infra#8630 to be merged before merging this one

## What
Wires the greenlight land-time guard into `merge_into`: when the only approval that
satisfies a merge rule is greenlight's, trymerge reads greenlight's verdict ledger and
refuses to land unless greenlight recorded `LAND` for the head commit that is actually
being merged. The verdict logic already lives in the `greenlight_*.py` modules next to
trymerge; this change only feeds the PR facts in and turns the verdict into the exception
the merge loop already understands.

Three smaller changes in `trymerge.py` that are worth reading on their own:

- `find_matching_merge_rule` gains an `approved_by_override` kwarg, so the guard can ask
  "would any rule still match if greenlight had not approved?" without duplicating rule
  evaluation. Default behaviour is unchanged.
- The inline approver expansion is extracted to `rule_approvers`, and a malformed team
  ref (`org/team/extra`) now raises instead of expanding to nobody. Previously
  `gh_get_team_members` warned, returned `[]`, and the rule then matched *any* approver.
- Two REST accessors (`get_updated_at`, `get_bot_reviewers`) added on `GitHubPR`. They
  are REST rather than fields on `GH_GET_PR_INFO_QUERY` because that query text is the
  cache key for the recorded GraphQL fixtures — extending it invalidates all of them.

## Why
`merge_rules.yaml`'s "Greenlight Review Bot" rule lets a single `pytorchgreenlight`
approval authorize a merge of any path, and pytorch/pytorch has no GitHub-native
required reviews, so that approval is never dismissed when the author pushes more
commits. Today an author can get greenlight's approval on a benign commit, push
anything on top, and `@pytorchbot merge` lands unreviewed content. This closes that
window by comparing the head SHA greenlight actually evaluated against the head being
landed.

# Notes
Behaviour reviewers should sanity-check:

- **Scope.** The guard is skipped entirely when greenlight did not approve, and when any
  other merge rule still matches after dropping greenlight's approval. A drive-by
  approval from a random GitHub user does *not* switch it off.
- **Waiting.** "greenlight hasn't answered yet" raises `MandatoryChecksMissingError`, so
  the existing 5-minute retry loop handles it. The 60-minute budget is owned by `merge()`
  and shared across re-entries, and opens at the first wait (not at command time, since
  `merge_into` is only reached once CI is green). One comment is posted to the PR the
  first time it waits.
- **Force merge.** `-f` gets no wait window and therefore never waits; it refuses instead
  if greenlight is the only authority and hasn't verified the head.
- **ghstack.** Checked against each open PR's GitHub head, which is what greenlight
  records, not the `/orig` revision git cherry-picks.
- **Failure modes.** A HUD outage is a wait, not a refusal, until the budget runs out;
  an unreadable `merge_rules.yaml` or an unclassifiable reviewer leaves the guard on
  rather than inventing an authorization.

Depends on the `/api/greenlight/pr_state` route in pytorch/test-infra; `HUD_API_TOKEN`
is already plumbed into `trymerge.yml`.

This is the last change of the guard and the only one that alters existing behaviour;
the modules it calls landed ahead of it so that the merge-path wiring could be reviewed
on its own and each change stay under the 2000 LOC infra limit. One test here asserts
`merge_rules.yaml` still grants `pytorchgreenlight` merge authority, so a rename there
cannot silently disable the guard.

Signed-off-by: Jean Schmidt <[email protected]>
Pull Request resolved: pytorch#194841
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#194838, pytorch#194839, pytorch#194840
…h#195176)

In `CUDACachingAllocator` the `Block` comparator is a hot function. pytorch#195129 optimizes it so that the compiler can inline it. This PR brings the same change to XPUCachingAllocator.
Pull Request resolved: pytorch#195176
Approved by: https://github.com/Skylion007
…ay (pytorch#192375)

On Apple silicon, using the MPS backend, torch.compile emits a “Not enough SMs” warning. That warning is confusing: MPS is running on an Apple GPU, and neither Triton nor CUTLASS templates are candidates.

AI-generated summary, reviewed by me:

use_triton_template and use_cutlass_template evaluated the GPU-size heuristic before checking whether autotuning and the relevant template backend were enabled. Consequently, default-mode MPS compilation could report “Not enough SMs” even though neither Triton nor CUTLASS templates were candidates.

Reorder the eligibility checks so unsupported template paths short-circuit before is_big_gpu. The existing small-GPU heuristic still applies whenever a template is genuinely under consideration.

Testing:

- With Inductor caches disabled, stock PyTorch 2.10 emitted the warning.
- Applying the reordered Triton predicate suppressed the warning and compilation succeeded.

AI assistance disclosure: Claude prepared the implementation under human direction. Codex reviewed it against current main, verified the reproduction, and rebased the branch.

Pull Request resolved: pytorch#192375
Approved by: https://github.com/kurtamohler, https://github.com/jansel

Co-authored-by: kurtamohler <[email protected]>
detail::from_ had three overloads selected by an is_constructible tag. The unreachable one (intrusive_ptr<T> + false_type) is more specialized than the catch-all, so it shadows the diagnostic the catch-all exists to produce: calling from with an intrusive_ptr to a non-custom class reports an ambiguous-constructor error instead of the intended static_assert message.

Folding the three into one if constexpr in from() drops the tag and the detail namespace, and lets the static_assert fire where it was meant to.
Pull Request resolved: pytorch#195105
Approved by: https://github.com/Skylion007
Expose the receive-buffer layout through the token-switch API so callers can
select it (the NCCL EP algorithm stays high_throughput).

Expert-major orders the dispatched tokens so that all tokens routed to the same
local expert are contiguous, which is the layout a grouped GEMM over experts
consumes directly -- no regrouping pass between dispatch and the expert matmul.

- Add a `NcclEpLayout` enum (`Unset` / `ExpertMajor` / `RankMajor` / `Flat`) in
  the header, values mirroring `ncclEpLayout_t` (ep_enums.h); kept standalone so
  the header stays free of `<nccl_ep.h>` (the `.cu` maps it via `to_nccl_layout`).
- `nccl_ep_create_handle` takes a `NcclEpLayout` arg instead of hardcoding
  `NCCL_EP_LAYOUT_FLAT`; the layout is stashed on the handle.
- `nccl_ep_dispatch`'s `out_topk_idx` is now optional, since expert-major
  layouts leave it unpopulated; `out_topk_weights` also becomes optional for API
  symmetry (it stays populated -- 1-D for expert-major, 2-D for flat).
- Python: `create_routing` gains a required keyword-only `layout` arg, with the
  output-buffer shapes chosen per layout.
- pybind binds `NcclEpLayout` as a `Layout` enum object.

Test Plan:
On a node with 2+ GPUs and a `USE_NCCL_EP=1` build:

```
python -m pytest test/distributed/test_token_switch.py -k expert_major -v
```

- ✅ `test_dispatch_expert_major`
- ✅ `test_dispatch_combine_roundtrip_expert_major`

(8xH100)
Pull Request resolved: pytorch#187784
Approved by: https://github.com/kapilsh
…rch#195153)

`nll_loss_backward` and `nll_loss2d_backward` on MPS used an MPSGraph one-hot graph.
The graph cache is keyd on shape, which meant that variable length workloads would ocmpile one graph per shape and the driver memory would grow a lot due to caching of the one hot tensor in the intermediate calculation which wasn't being released. This PR replaces it with a single Metal scatter kernel.
Some numbers:

Variable-length causal-LM training run, 140 steps, 107 distinct sequence lengths:

| Driver memory | Before | After |
|---|---:|---:|
| Peak | 20,967 MB | 7,969 MB |

Speed

| Case | Before | After | Speedup |
|---|---:|---:|---:|
| BF16 `[740, 32000]` | 0.974 ms | 0.226 ms | 4.31x |
| BF16 `[2048, 32000]` | 2.640 ms | 0.519 ms | 5.09x |
| BF16 `[3812, 32000]` | 5.010 ms | 0.988 ms | 5.07x |
| FP32 `[2048, 32000]` | 3.183 ms | 1.052 ms | 3.03x |
| BF16 `[2, 64, 17, 19]`, transposed target, 2d | 0.068 ms | 0.040 ms | 1.69x |

Pull Request resolved: pytorch#195153
Approved by: https://github.com/malfet
…ve mm configs (pytorch#192286)

ROCmConfigHeuristic._filter_configs overwrites num_stages on every config with
self.default_num_stages -- this is intentional, and both the origami selection
path and its LDS pre-filter are written to match that post-filter state. But
exhaustive_configs also enumerated `for num_stages in [1, default_num_stages]`,
so half of the generated configs were byte-identical to the other half once
filtering ran, and num_stages=1 was never actually tried. The duplicates were
silently discarded later by the dedup key in _finalize_mm_configs, so this only
wasted work and made the search space look like it covered an axis it did not.

Halves the exhaustive candidate count before dedup with no change in the set of
configs actually benchmarked.

Authored with the assistance from an AI coding agent.

Pull Request resolved: pytorch#192286
Approved by: https://github.com/jgong5, https://github.com/jeffdaily
ghstack dependencies: pytorch#192285
I saw from `build/bolt_profiles/libc10_cuda.yaml` that `initCUDAStreamsOnce` is a hot function. This function does a one-time process-wide initialization and a per-thread initialization. With the help of GPT 5.6 I was able to identify that the function enters the initialization paths very rarely but pays the cost of the static flag lookup in each invocation.

I have reordered this function to avoid the static flag lookup in the common case.

GPT 5.6 analyzed the binaries before and after the change and noted 3 fewer instructions (global flag lookup) and 1 fewer branch in the generated assembly. This was also confirmed using perf on a micro- benchmark that calls this function in a tight loop.

Assisted-by: gpt-5.6-sol medium
Pull Request resolved: pytorch#195190
Approved by: https://github.com/eqy
JIRA ID: AIPYTORCH-1075

## Problem
The setup-rocm **Runner ROCm version** step dumps `dpkg -l | grep rocm`. On runners that use TheRock wheels next to leftover deb packages, that list does not match the stack that actually runs tests.

## Changes
Replace that dump in `.github/actions/setup-rocm/action.yml` with:
- `amd-smi version` for the active ROCm / AMDSMI / amdgpu versions
- the first rocminfo `Runtime Version` line, prefixed with `rocminfo:` so the source is obvious in CI logs

The separate `dpkg` amdgpu health-check step is unchanged.

## Validation
Trunk [31517829339](https://github.com/pytorch/pytorch/actions/runs/31517829339) was 14/14 MI350 green on the original commit (`b28317c`). Sample **Runner ROCm version** output from [linux-jammy-rocm-py3.10-mi350 / test (default, 1/8)](https://github.com/pytorch/pytorch/actions/runs/31517829339/job/93872886715):

```
AMDSMI Tool: 25.4.2+aca1101 | AMDSMI Library version: 25.4.0 | ROCm version: 6.4.1 | amdgpu version: 6.16.13 | amd_hsmp version: N/A
Runtime Version:         1.15
```

That sample is from before the `rocminfo:` prefix. Current head `e42663eb90e` has not had Lint/pull/trunk approved; there is no `ciflow/trunk/192824` tag on this SHA.

Pull Request resolved: pytorch#192824
Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily
pytorch#191767)

## Summary
- Add an offline check that each `test/cpython/v3_13` adapted test and its `.diff` stay in sync: reverse-apply the diff, match `sha256(pristine)` from `upstream_manifest.json` (tag/path taken from each file header), and assert `apply(pristine, diff) == adapted`.
- Add `tools/regenerate_cpython_diffs.py` to fetch upstream sources, regenerate stale diffs, and refresh the manifest.
- Regenerate drifted `.diff` files, add the missing source URL on `test_unittest/test_assertions.py`, and fix three headers that pointed at the wrong upstream file (`test_binop`, `test_heapq`, `test_patma`).

Fixes pytorch#189607

## Test plan
- [x] `python tools/regenerate_cpython_diffs.py --check`
- [ ] `python test/dynamo/test_cpython_diff_sync.py CPythonDiffSyncTests`
- [ ] Confirm CI runs the new dynamo sync test

Pull Request resolved: pytorch#191767
Approved by: https://github.com/guilhermeleobas, https://github.com/williamwen42

Co-authored-by: Guilherme Leobas <[email protected]>
huydhn and others added 28 commits September 2, 2026 06:34
)

Forward fix for D117882908 (pytorch#194977), which broke every
arvr/ovrsource build that depends on `xplat/caffe2:ATen_lib_ovrsource`:

```
xplat/caffe2/aten/src/ATen/core/ivalue.h:516:18: error: missing 'typename' prior to
  dependent type name 'enable_if_ivalue_compatible<Args...>::type'
xplat/caffe2/aten/src/ATen/core/ivalue_inl.h:1959:16: error: missing 'typename' prior to
  dependent type name 'IValue::enable_if_ivalue_compatible<Args...>::type'
3 errors generated.
```

That diff factored the tuple-constructor SFINAE into a new alias member:

```
template <typename... Ts>
using enable_if_ivalue_compatible = std::enable_if<...>;   // enable_if, not enable_if_t
```

and uses it as `typename = enable_if_ivalue_compatible<Args...>::type`. Since
the alias expands to `std::enable_if<...>`, `::type` is a dependent name and
needs the `typename` disambiguator.

C++20's P0634R3 ("Down with typename!") makes `typename` optional in exactly
this position -- the default argument of a type template parameter -- which is
why this compiled everywhere the change was tested. This is not a language
version difference: both fbcode and arvr build caffe2 at `-std=gnu++20`. It is
a compiler version difference. fbcode uses clang-21, while `ATen_lib_ovrsource`
under `arvr/mode/platform010/*` pins clang-15 (see the
`x86_64-clang-dev-platform010` platform in
`arvr/tools/build_defs/config/platform/linux/generated.bzl`), and clang did not
implement P0634R3 until 16.

Add the `typename` disambiguator at the three use sites. It is well formed in
every standard from C++11 on, so it is also accepted by the newer compilers
that already build the current form.

The SFINAE predicate itself is left alone. Rewriting
`!disjunction_v<is_lvalue_reference<Args>..., negation<is_constructible<IValue, Args>>...>`
as `conjunction<negation<is_lvalue_reference<Ts>>..., is_constructible<IValue, Ts>...>`
is a correct De Morgan transform and preserves the short-circuit ordering that
keeps `is_constructible<IValue, T>` from being instantiated on reference types.

`xplat/caffe2` is updated to keep it in sync with `fbcode/caffe2`.

This should also go upstream to pytorch#194977, since OSS CI will hit
the same error on any clang-15 build.

Differential Revision: [D118389865](https://our.internmc.facebook.com/intern/diff/D118389865/)
Pull Request resolved: pytorch#195671
Approved by: https://github.com/pytorchgreenlight, https://github.com/Skylion007
…pytorch#194703)

Summary:

`CppWrapperCpu.codegen_invoke_subgraph` was a bare `raise NotImplementedError`, so any
`torch.compiler.nested_compile_region` under AOTInductor died at codegen:

```
torch._inductor.exc.InductorError: NotImplementedError:
    codegen invoke_subgraph is not implemented for cpp wrapper
  cpp_wrapper_cpu.py:2813
```

Two parts.

**1. Implement `CppWrapperCpu.codegen_invoke_subgraph`.** The class already has a complete
subgraph-inlining implementation, `codegen_subgraph`, used by cond/switch/while_loop;
invoke_subgraph was the only HOP left raising. Declare one owning `RAIIAtenTensorHandle`
per output -- the same shape as `codegen_switch`, because in ABI-compatible mode
`ir.MultiOutput` is not codegened -- and delegate. A non-tensor region output raises
explicitly rather than emitting C++ that will not compile.

The region body is emitted inside its own C++ block. The region has its own `Scheduler`,
which re-emits per-device state -- notably `<stream_t> stream0;` from
`write_get_raw_stream` -- and in the parent's scope that is a redefinition
(`error: redefinition of 'stream0'`). The outputs are declared *outside* the block so
`codegen_subgraph_suffix` can still assign into them, and `_preserve_device_guard_state`
keeps the region's device-guard bookkeeping from leaking out.

**2. Fix a cross-graph index bug in wrapper-IR memory planning** that (1) exposes.
`AllocateLine`/`FreeIfNotReusedLine` record
`scheduler_node_index = V.graph.scheduler.nodes.index(...)`, but an inlined subgraph emits
its lines into the *parent's* line list while `V.graph` is the *subgraph*. Pairing a parent
free with a region allocation then compares indices into two different node lists:

```
ValueError: Start index must be less than or equal to end index
  segmented_tree.py:234, via should_reuse_buffer -> peak_between
```

Record the scheduler alongside the index and refuse reuse across schedulers. This is a
latent pre-existing bug for cond/while_loop too -- inlining is what makes it reachable --
but it is only reproducible once (1) lands.

Per-region Inductor config under the cpp wrapper is the next diff in the stack.

Note: `caffe2/...` and `xplat/caffe2/...` are separate synced copies; both are edited.

Test Plan:
`test_lite_regional_compile_invoke_subgraph` was skipped under `config.cpp_wrapper` with
the very message this diff deletes; the skip is removed.

New `test_invoke_subgraph_nested_region` in test_aot_inductor.py -- a full AOTI round trip
through `check_model`: compile, package, dlopen, run and compare against eager. That is
what a generated-C++ assertion cannot cover.

```
buck2 test @//mode/opt fbcode//caffe2/test/inductor:test_aot_inductor \
  -- --regex "invoke_subgraph"
=> Pass 4. Fail 0. Skip 1.

buck2 test @//mode/opt-amd-gpu fbcode//caffe2/test/inductor:test_inductor \
  -- --regex "regional|lite_"
=> Pass 8. Fail 0. Skip 3.
```

**cpp wrapper coverage for the other subgraph HOPs.** `test_control_flow.py` had none: every
case ran only under the default python wrapper, even though cond/while_loop/scan/map/switch
all reach `CppWrapperCpu.codegen_subgraph` and part (2) above touches every inlined
subgraph. This diff adds a `_CppWrapperMixin` that re-runs a suite with
`config.cpp_wrapper=True`, and turns it on for the four suites that pass:
`CondTestsCppWrapper`, `AssociativeScanTestsCppWrapper`, `MapTestsCppWrapper`,
`SwitchTestsCppWrapper`.

```
buck2 test @//mode/opt fbcode//caffe2/test/inductor:control_flow -- --regex "CppWrapper"
=> Pass 122. Fail 0. Skip 6.

buck2 test @//mode/opt fbcode//caffe2/test/inductor:control_flow
=> Pass 799. Fail 0. Skip 104.
```
(799 = the suite's previous 677 plus these 122; no existing case changed.)

Not everything could be turned on, and the reasons are pre-existing rather than caused by
this diff. Measured under `TORCHINDUCTOR_CPP_WRAPPER=1` on the parent commit and again on
this one -- identical both times, Pass 341 / Fail 337:
  - `ScanTests` (264 cases) and `WhileLoopTests` (69) still fail. Pinning that many names
    would rot on the next parametrization, so those two suites are left off with the
    reasons recorded in the file.
  - `CondTests` needed only four exclusions, listed in `_CPP_WRAPPER_XFAIL`
    (`test_cond_unbacked_symint_inner*`).
Two distinct causes, each worth its own diff:
  - `error: redefinition of 'true_graph_0_bufN'` -- a branch subgraph declares its buffers
    in the parent's C++ scope, so two branches reusing a name collide. Same class of bug as
    the region `stream0` collision fixed above, but for buffers rather than per-device
    state.
  - `NotImplementedError: NYI cpp wrapper for while_loop_stack_output`.

Authored with an AI assistant.

Reviewed By: desertfire

Differential Revision: D115659603

Pull Request resolved: pytorch#194703
Approved by: https://github.com/desertfire
This is needed so that downstream targets inherits the c++20 requirement.

This change propagates the required standard only to CXX translation units; downstream consumers compiling CUDA sources must explicitly set CMAKE_CUDA_STANDARD (for example, to 20), because the Torch target does not propagate a CUDA standard.

Without it, downstream C++ code fails with for example:

```
pytorch/torch/include/ATen/core/TensorBase.h:1041:5: note: ‘requires’ only available with ‘-std=c++20’ or ‘-fconcepts’ pytorch/torch/include/ATen/core/TensorBase.h:1044:5: error: ‘requires’ does not name a type
1044 |     requires std::is_same_v<T, int64_t>
     |     ^~~~~~~~
```
Pull Request resolved: pytorch#190784
Approved by: https://github.com/Skylion007
…lerator backends (pytorch#190528)

## Summary

Makes `ShardedTensorTestBase.init_pg` bind the per-rank device based on the
accelerator actually present, instead of matching a hard-coded backend list.

## Motivation

`init_pg` had two hard-coded lists that leave out-of-tree backends behind:

```python
if backend not in ["nccl", "gloo", "mpi", "hccl", "xccl"]:
    raise RuntimeError(f"Backend {backend} not supported!")
...
# set device for nccl pg for collectives
if backend == "nccl" or backend == "xccl":
    torch.accelerator.set_device_index(self.rank)
```

The second one is the functional problem: every rank ends up on device 0 for any
backend outside that pair, so collectives fail with an unhelpful error. The
first rejects backends by name even when the distributed framework has them
registered and available.

## Changes

- The admission check asks the framework: `dist.is_backend_available(backend)`.
  That covers the built-in backends via their `is_*_available()` functions and
  third-party ones through `Backend.register_backend`, so a device that
  registers its own backend is accepted the same way the built-ins are — and it
  additionally catches "requested but not compiled into this build", which the
  name-only list did not.
- The device binding resolves the accelerator at runtime instead of matching a
  backend pair:

```python
if torch.accelerator.is_available() and backend != dist.Backend.GLOO:
    torch.accelerator.set_device_index(self.rank)
```

- `with_comms` keeps its original three-part admission check: an accelerator has
  to be present, the requested backend has to be that accelerator's default
  backend, and the device count has to cover `world_size`. Only the outer
  hard-coded `nccl`/`xccl`/`hccl` list is replaced by a Gloo exclusion, so an
  out-of-tree backend reaches the same check the built-in ones do. Every in-tree
  caller of this base class passes `gloo`, the default `nccl`, or
  `get_default_backend_for_device(device_type)`, so their skip/run outcome is
  unchanged — including `nccl` requested on a non-CUDA accelerator host, which
  still skips.

  Because the wrapper already establishes that relationship before
  `init_comms` runs, `init_pg` does not repeat the default-backend comparison.

`gloo` is excluded deliberately: `Backend.default_device_backend_map` maps both
`cpu` and `mps` to `gloo`, so without that guard an MPS run would take the
binding path even though there is no per-rank accelerator index to set.

No special case is made for any individual device. HPU registers its backend
through the same third-party mechanism as any other out-of-tree device, so the
generic path covers it; singling it out would reintroduce exactly the kind of
hard-coding this change removes.

## Test Plan

`ruff check` and `ruff format --check` pass.

Verified on an out-of-tree accelerator backend (PrivateUse1, Ascend NPU, 4
devices) through the two suites that use this base class:
`test_checkpoint.py` runs `Ran 8 tests ... OK` and
`test_file_system_checkpoint.py` runs `Ran 9 tests ... OK`. Before this change
every rank bound to device 0 and those suites failed during process group setup.

CPU (gloo) runs are unaffected: `current_accelerator()` returns `None` on a
CPU-only host, and where an accelerator is present but the process group is
gloo, the `Backend.GLOO` guard short-circuits before the default-backend lookup
and keeps the binding from firing.

## Related

Part of pytorch#185590.

Pull Request resolved: pytorch#190528
Approved by: https://github.com/d4l3k, https://github.com/pjyFight, https://github.com/fffrog
…ne joiner (pytorch#194854)

Human note:
inline graph annotations in python trace exporter
Use it like `prof.export_chrome_trace(path, cuda_graph_annotations=get_kernel_annotations())`

Inline graph annotations in python trace exporter. Annotations
recorded by mark_kernels are injected during the single streaming write pass that
already happens, so exporting an annotated trace is one pass rather than write,
read back, splice, rewrite -- which would pay the dominant gzip cost twice. With
that in place torch.cuda._annotate_cuda_graph_trace, the offline script that did
the splice from a pickle side-file, is deleted along with its tests.

    prof.export_chrome_trace(path, cuda_graph_annotations=get_kernel_annotations())

Passing annotation arg implies
use_python_export, since that is the export path able to inject; the C++ path is
untouched otherwise, and the cupti_monitor backend ignores them (it injects
through its own resolver).

A graphed work event whose graph node id has an annotation gets the annotation's
fields in its args and moves to the lane the annotation names; graphed work
without one moves to default_stream, since CUPTI reports a replay on whatever
hardware streams the graph executor picked -- often hundreds. The hardware stream
is kept as original_stream, and a top-level cudaGraphInlineAnnotated flag lets a
consumer tell an already annotated trace from one that still needs the join.

Also brings over three parity fixes: the deviceProperties,
the CUDA version keys from logGpuVersions (runtime version from torch), and
CPU instant events, which were being written as complete events and rendering as
bars.

Test Plan:

```
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/profiler/test_profiler.py TestPythonChromeTraceExport TestChromeTraceInlineAnnotations TestMetadataJsonFormat
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/test_cuda_graph_utils.py
```

15 and 112 tests pass. TestChromeTraceInlineAnnotations drives the new branches
through stub activities (annotated lane, default lane, non-graphed work left alone,
orphaned gpu_user_annotation slices dropped, no-annotations no-op); the parity test
compares the envelope against kineto's own save(); and an end-to-end test captures
an annotated graph, replays it under the profiler and checks the annotation reached
the kernel events. The end-to-end test lives in the profiler suite rather than
test_cuda_graph_utils because that module holds a CUPTI subscription from import
time, which starves kineto of GPU records.

Authored with assistance from Claude Code.
Pull Request resolved: pytorch#194854
Approved by: https://github.com/drisspg
ghstack dependencies: pytorch#194852, pytorch#194853
…ic GC (pytorch#195397)

Human note:

fix refcycles in make_graphed_callables so that gc doesn't unexpectedly kick in during graph capture

Destroying a CUDAGraph runs cudaGraphDestroy / cudaGraphExecDestroy / releasePool
(aten/src/ATen/cuda/CUDAGraph.cpp:399-408), none of which are permitted while a stream is
capturing. Doing it mid-capture warns "operation not permitted when stream is capturing
(function reset)" and invalidates that capture, after which the next allocation trips
TORCH_INTERNAL_ASSERT(info.status != cudaStreamCaptureStatusInvalidated) in
CUDACachingAllocator. So *when* a CUDAGraph is freed matters, and make_graphed_callables
was handing that decision to the cyclic collector, which picks an arbitrary allocation
point -- including one inside an unrelated capture.

Two reference cycles put the graphs in the collector's hands. The autograd Function
subclass closed over fwd_graph/bwd_graph, and a class plus its methods' closure cells is
a cycle, so anything those methods captured could only be reclaimed by the GC. On the
nn.Module path the closure installed as func.forward also closed over func -- and over
func.forward, a bound method holding it -- so the module, and through it the graphs, was
cyclic as well. Fixing only one of the two leaves the graphs stranded via the other.

The graphs are now passed to Graphed.apply per call and stashed on ctx, so the class
holds none of them while ctx keeps bwd_graph alive for exactly as long as a backward can
still run. new_fwd holds the module weakly and rebinds its original forward per call.
One case still retains: a module whose forward was already an instance attribute rather
than a bound method has nothing to unbind, so that path keeps holding the module; it is
commented where it happens.

Worth calling out as a behaviour change: calling a graphed module's forward after the
module itself has been freed now raises instead of working by accident. Holding
module.forward while the module is alive is unaffected.

This also removes a workaround. TestMarkKernels in test_cuda_graph_utils.py had a
tearDown that did not chain to super().tearDown(), and restoring the chain made a later
capture in that class fail with exactly the assert above -- the base tearDown shifted
allocation timing enough for a collection to land inside a capture. With the cycles gone
the fixture folds into the ordinary setUp + addCleanup.

Test Plan:

```
python test/test_cuda.py -k make_graphed
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/test_cuda_graph_utils.py
```

8 and 115 tests pass (make_graphed has 3 pre-existing expected failures).
test_graph_make_graphed_callables_freed_by_refcount is the regression test: it drops a
graphed callable with the cyclic GC disabled and asserts no CUDAGraph survives, for both
the nn.Module and plain-callable paths, and fails on the parent commit. The original
end-to-end symptom reproduces via agent_space/repro_gc_capture_invalidate.py, which
stops reproducing with this change.

Authored with assistance from Claude Code.
Pull Request resolved: pytorch#195397
Approved by: https://github.com/ezyang, https://github.com/eqy
ghstack dependencies: pytorch#194852, pytorch#194853, pytorch#194854
…_annotations workflow (pytorch#195398)

Three findings from integrating the annotation store into a large trainer.

A capture that completes a mark_kernels scope and then fails in capture_end leaked its
annotations for the life of the process. resolve_pending_annotations has to run before
capture_end, because the rekey inside instantiate() is what consumes what it writes, so
its entries land keyed by the capture graph's id and only instantiate() rewrites them to
an exec id. When capture_end raises there is no exec graph and no rewrite, and
remove_kernel_annotations (the graph-destroy path) matches on exec ids, so nothing could
reach them again. __exit__ now purges that capture's entries when capture_end raises.
The purge is scoped to capture_end alone rather than the whole try block -- once it
returns the capture is usable and its annotations are worth keeping -- and is guarded on
the graph not having been remapped already, since keep_graph=False instantiates inside
capture_end.

An earlier writeup of this suggested moving the resolve into capture_end, after the
capture-id stamp. That no longer applies, and the reason is what makes the simpler fix
work: the stamp now happens at capture_begin, so graph._capture_graph_id is already set
when capture_end fails and we know exactly which entries are ours to drop.

clear_kernel_annotations is deprecated rather than deleted. It has no caller in torch
outside tests, and its docstring recommended clearing "once recorded annotations have
been consumed (e.g. after saving them alongside a profiler trace)" -- the
pickle-alongside-trace flow that inline trace export retires. For a long-running trainer
that advice is actively harmful: graphs are captured once and replayed for the whole run,
so a global wipe discards annotations for graphs that are still live and still being
joined against, and growth is already bounded by the remap on instantiate plus
remove_kernel_annotations on destroy. The docstring separately claimed clearing "revokes
recording from every scope opened before the clear", which is not true -- only backward
brackets are versioned by the generation counter, so a forward scope open across a clear
registers on exit as usual. Both claims are corrected, the second now has a test, and
tests call a new private _reset_kernel_annotations for isolation so the suite does not
trip the warning; the one test that is about the public entry point asserts it.

Cleaning up those call sites also removed the redundant ones: nine tests opened with a
reset that their class fixture already does, and two registry-only classes reset in
tearDown alone, which is why each of their tests began with one -- those now use setUp
plus addCleanup. The resets kept are the ones that do work: between iterations of a
loop, or mid-test where the reset is the thing under test.

Finally, register_capture_end_hook documents that capture-end hooks are best-effort:
skipped entirely when cudaStreamEndCapture raises, and truncated when an earlier hook
raises. A consumer using one for teardown needs its own fallback on the error path.

Test Plan:

```
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/test_cuda_graph_utils.py
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/profiler/test_profiler.py TestPythonChromeTraceExport TestChromeTraceInlineAnnotations
LD_LIBRARY_PATH=/usr/local/cuda-13.2/compat python test/profiler/test_cupti_node_timer.py
```

115, 16 and 8 tests pass. test_failed_capture_end_discards_annotations is the regression
test for the leak: reverting just the __exit__ change makes it fail. test_public_bindings
has one failure in this environment that predates the change and is unrelated
(torch.distributed.debug._debug_handlers needs the `tabulate` package).

Authored with assistance from Claude Code.
Pull Request resolved: pytorch#195398
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#194852, pytorch#194853, pytorch#194854, pytorch#195397
…) (pytorch#195544)

Summary:

The next Meta's internal triton release (version 3.8) ships a CPU backend that is available on every host. Counting it in bare `has_triton()` would silently change existing GPU and accelerator gates on CPU-only machines.

Keep `has_triton()` accelerator-only by default, and let backend-neutral or explicitly CPU-Triton paths opt in with `include_cpu=True`. Existing package, device-detection, capability, and backend-availability checks remain in force.

Test Plan:
`buck test fbcode//caffe2/test/inductor:utils -- TestHasTriton` — 12 passed

`buck test fbcode//unified_mapping/utils/tests:test_inductor_remote_cache` — 5 passed

`buck test fbcode//sigmoid/inference/test:test_passes -- test_triton_hop_cpu` — 2 passed

Reviewed By: jeanschmidt

Differential Revision: D118188207

Pull Request resolved: pytorch#195544
Approved by: https://github.com/jeanschmidt
…ductions (pytorch#195564)

`test_combo_kernel_split_large_reductions` fails on Intel BMG with `Expected 5 but got 4` while passing on PVC.

## Root cause

The test was added in pytorch#186668 together with the `very_large_reduction` partitioning rule it guards: the two very large reductions (sum over `[0,2,3]` of `[512,64,55,55]`) must not be co-fused into one combo kernel. It asserts that invariant indirectly, via an absolute total kernel count (`generated_kernel_count == 5`), and one of those 5 kernels comes from an unrelated, SM-count-dependent heuristic.

Both reductions have `numel=64`, `rnumel=1548800`. `InductorChoices.reduction_split_factor` (`torch/_inductor/choices.py:580`) returns 1 once `numel_hint >= 2 * multi_processor_count`. BMG reports `multi_processor_count=20`, so `64 >= 40` holds and neither reduction is split. A 64-SM part makes the same call return 12: each reduction becomes a partial + final pair, the two small finals co-fuse, and the total reaches 5. The asserted 5 is unreachable on a 20-SM GPU.

The total also cannot distinguish correct from regressed codegen there:

|                 | correct codegen | co-fused (the regression) |
|-----------------|-----------------|---------------------------|
| BMG (20 SM)     | **4**           | 3                         |
| PVC-sim (64 SM) | **5**           | 4                         |

So 4 — which the old comment labelled "the regression" — is BMG's *correct* value. The guarded behaviour itself is intact on BMG: instrumenting `_default_custom_combo_kernel_horizontal_partition` shows the two reductions landing in separate partitions `[['op2'], ['op3']]`, exactly as the comment requires.

## Fix

Assert the invariant directly instead of a proxy for it: count the generated kernels that contain a very large reduction, using the same `xnumel * rnumel > LARGE_NUMELS` gate the partitioner itself applies, and require exactly 2.

`xnumel * rnumel` is conserved when a reduction is split — both the unsplit kernel (`64 * 1548800`) and the partial (`768 * 129067`) carry the graph's ~99.1M element total — so the count does not depend on `multi_processor_count`. Co-fusion emits both sub-kernels inside a single `async_compile.triton` block, dropping the count to 1 on every configuration, so the regression is still caught. `fresh_cache()` is added because the assertion reads generated code, the same pattern the neighbouring `run_and_get_code` tests in this file use.

The test is defined once and inherited by `ComboKernelTestsPerSubkernelBlocks`, so one edit covers both failing node ids.

## Test plan

On an Intel BMG GPU (Arc Pro B60, `multi_processor_count=20`), both node ids:

```bash
pytest -sv test/inductor/test_combo_kernels.py -k "test_combo_kernel_split_large_reductions"
```

| Configuration | Result |
|---|---|
| Fixed test | **2 passed** (was: 2 failed, `Expected 5 but got 4`) |
| Regression reintroduced (co-fusion re-enabled) | **2 failed**, `Expected 2 but got 1` |
| PVC-sim (`multi_processor_count=64`), correct codegen | **2 passed** |
| PVC-sim, regression reintroduced | **2 failed** |

The full 2x2 matrix of {BMG, PVC-sim} x {correct, regressed} agrees, so the new assertion is device independent and keeps its regression power. Co-fusion was reintroduced by raising only the partitioner's `LARGE_NUMELS`, after the test module had already bound the real `51_200_000` for its own gate.

`lintrunner -a test/inductor/test_combo_kernels.py` reports no issues.

Fixes intel/torch-xpu-ops#5079

<sub>This change was authored with the assistance of an AI coding agent (Claude).</sub>

Pull Request resolved: pytorch#195564
Approved by: https://github.com/etaf, https://github.com/karthickai
…ch#195663)

Forward fix for D117882973 (pytorch#189692), which broke
`fbcode//caffe2/test/inductor:codegen_triton` at listing time.

That diff added a new helper module `triton_constexpr_configs.py` next to
`test_codegen_triton.py` and imported it with two OSS-only fallbacks:

```
try:
    from triton_constexpr_configs import ...          # test/inductor on sys.path
except ImportError:
    from test.inductor.triton_constexpr_configs import ...   # pytorch repo root on sys.path
```

The file itself is packaged fine internally -- `:inductor_test_lib` uses
`srcs = glob(["*.py"])`, so no BUCK change is needed -- but inside the PAR it
resolves under the fbcode base module as
`caffe2.test.inductor.triton_constexpr_configs`. Neither branch matches, so
both raised `ModuleNotFoundError` and the whole module failed to import,
taking down all 22 tests in the suite, not just the new ones:

```
ModuleNotFoundError: No module named 'triton_constexpr_configs'
During handling of the above exception, another exception occurred:
ModuleNotFoundError: No module named 'test.inductor'
```

Switch to the relative-first pattern already used elsewhere in this directory
(`test_codecache.py`, `test_ck_backend.py`). The relative import resolves
against whatever package the test module actually lives in, so it covers all
three run modes: the fbcode PAR (`caffe2.test.inductor`), OSS pytest from the
repo root (`test.inductor`), and `python test/inductor/test_codegen_triton.py`
(no package, falls through to the bare import).

This also matters beyond the import statement itself. The new
`get_importable_constexpr_types` emits `from {type.__module__} import ...`
into the generated Triton kernel source, so the helper module has to be
reachable under its real package name for
`test_user_defined_triton_kernel_non_builtin_constexpr` to compile and run.

`xplat/caffe2` is updated to keep it in sync with `fbcode/caffe2`.

Differential Revision: [D118378564](https://our.internmc.facebook.com/intern/diff/D118378564/)

Pull Request resolved: pytorch#195663
Approved by: https://github.com/pytorchgreenlight
)

## Summary
Migrate `AutogradFunctionContextVariable` off a `call_method` if-chain onto declarative `tp_methods`, as in pytorch#195165.

`save_for_backward`, `mark_dirty`, and `mark_non_differentiable` are now `Method` handlers.

Part of pytorch#195165 (does not close the umbrella).

## Test plan
- [x] `git diff --check`
- [x] `python -m py_compile torch/_dynamo/variables/misc.py`

> AI-assisted implementation.

Pull Request resolved: pytorch#195179
Approved by: https://github.com/guilhermeleobas
That is just a binary op using all the existing binary iterator machinery plus `c10::metal::pow` functor, yields 2x speedups on small tensors, on part on large ones

`pow_Scalar_Tensor` still must be a separate dispatch, as unified machinery converts Double to float tensors

Allows one to remove some xfails where MPSGraph handling of ineger powers diverges and remove complex xfails (although with a small tolerance adjustement, because Metal and host triage functions slightly differ)

Also remove some non-relevant functions from UNSUPPORTED_COMPLEX_OPS
list
Pull Request resolved: pytorch#195585
Approved by: https://github.com/Skylion007, https://github.com/Isalia20
ghstack dependencies: pytorch#195592
Following this PR pytorch#195153 I tried to pin down other ops which might make memory usage high as the nll_loss backward did.
To make findings meaningful, I tried doing inference of various LLM/image/video generation models and found that for `Wan-AI/Wan2.2-TI2V-5B-Diffusers` memory usage explodes because of the pad function that is used during VAE decode phase of the model.

PR migrates MPS Graph constant pad to metal kernels. Perf:

| Metric | MPSGraph | Fused Metal | Change |
|---|---:|---:|---:|
| MPS current-memory peak | 4.422 GiB | 4.095 GiB | -0.327 GiB |
| MPS allocator-reserved peak | 8.070 GiB | 8.070 GiB | unchanged |
| Driver memory outside allocator | 262.065 GiB | 0.038 GiB | -262.027 GiB (-99.986%) |
| Total driver-memory peak | 270.135 GiB | 8.108 GiB | -262.027 GiB (-97.0%) |

The reason for such huge memory is because of Wan model calling `F.pad` before every 3D convolution where one spatial tile makes 300+ calls to this function, the complete 28-tile decode makes 8,764 calls.

The way kernels work is simple, there are dense and strided kernels:

- **Dense** (`constant_pad_nd_dense`): input and output contiguous, at most 3 padded dims. The output is treated as `[outer, D, H, W]` (`outer` = all leading dims flattened) and dispatched as the matching 3D grid `(W / ILP_PER_THREAD, H, outer * D)`, each thread writing 4 elements along `W`. One of the reason of this is kernel speed, with this, we avoid the stride calculations which makes the kernel faster.
- **Strided** (`constant_pad_nd`): everything else. Dims are sorted by output stride, `tid.x` walks the innermost dim, `tid.y` is decomposed over the remaining dims and per-dim input/output strides are applied directly. Offsets use uint32 when every element offset of both tensors fits or uint64 otherwise.

<details>
<summary> Latency changes </summary>

| Case | Input shape | Padding | Dtype | Layout | Before | After | Speedup |
|---|---|---|---|---|---:|---:|---:|
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float32` | `contiguous` | 0.0178 ms | 0.0118 ms | 1.52x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float32` | `transposed` | 0.0192 ms | 0.0121 ms | 1.58x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float32` | `sliced` | 0.0189 ms | 0.0090 ms | 2.10x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float16` | `contiguous` | 0.0159 ms | 0.0077 ms | 2.07x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float16` | `transposed` | 0.0187 ms | 0.0116 ms | 1.61x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `float16` | `sliced` | 0.0186 ms | 0.0080 ms | 2.33x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bfloat16` | `contiguous` | 0.0152 ms | 0.0081 ms | 1.88x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bfloat16` | `transposed` | 0.0187 ms | 0.0120 ms | 1.56x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bfloat16` | `sliced` | 0.0185 ms | 0.0084 ms | 2.20x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `int32` | `contiguous` | 0.0152 ms | 0.0079 ms | 1.94x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `int32` | `transposed` | 0.0189 ms | 0.0120 ms | 1.58x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `int32` | `sliced` | 0.0187 ms | 0.0088 ms | 2.12x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bool` | `contiguous` | 0.0164 ms | 0.0072 ms | 2.29x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bool` | `transposed` | 0.0188 ms | 0.0098 ms | 1.92x |
| `vector_2d` | `(32, 4096)` | `(8, 8)` | `bool` | `sliced` | 0.0189 ms | 0.0083 ms | 2.27x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float32` | `contiguous` | 0.0190 ms | 0.0143 ms | 1.33x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float32` | `transposed` | 0.0531 ms | 0.0190 ms | 2.80x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float32` | `sliced` | 0.0317 ms | 0.0176 ms | 1.80x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float16` | `contiguous` | 0.0176 ms | 0.0123 ms | 1.42x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float16` | `transposed` | 0.0369 ms | 0.0167 ms | 2.22x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `float16` | `sliced` | 0.0256 ms | 0.0159 ms | 1.61x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bfloat16` | `contiguous` | 0.0166 ms | 0.0124 ms | 1.33x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bfloat16` | `transposed` | 0.0369 ms | 0.0168 ms | 2.20x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bfloat16` | `sliced` | 0.0256 ms | 0.0159 ms | 1.61x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `int32` | `contiguous` | 0.0168 ms | 0.0143 ms | 1.17x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `int32` | `transposed` | 0.0411 ms | 0.0191 ms | 2.16x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `int32` | `sliced` | 0.0302 ms | 0.0177 ms | 1.71x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bool` | `contiguous` | 0.0185 ms | 0.0108 ms | 1.72x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bool` | `transposed` | 0.0350 ms | 0.0150 ms | 2.33x |
| `image_4d` | `(1, 64, 128, 128)` | `(1, 1, 1, 1)` | `bool` | `sliced` | 0.0234 ms | 0.0145 ms | 1.61x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float32` | `contiguous` | 0.0186 ms | 0.0127 ms | 1.46x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float32` | `transposed` | 0.0217 ms | 0.0130 ms | 1.67x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float32` | `sliced` | 0.0213 ms | 0.0129 ms | 1.66x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float16` | `contiguous` | 0.0191 ms | 0.0115 ms | 1.66x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float16` | `transposed` | 0.0215 ms | 0.0120 ms | 1.79x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `float16` | `sliced` | 0.0212 ms | 0.0120 ms | 1.77x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bfloat16` | `contiguous` | 0.0183 ms | 0.0116 ms | 1.57x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bfloat16` | `transposed` | 0.0214 ms | 0.0119 ms | 1.80x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bfloat16` | `sliced` | 0.0213 ms | 0.0118 ms | 1.80x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `int32` | `contiguous` | 0.0182 ms | 0.0130 ms | 1.40x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `int32` | `transposed` | 0.0217 ms | 0.0132 ms | 1.65x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `int32` | `sliced` | 0.0212 ms | 0.0128 ms | 1.66x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bool` | `contiguous` | 0.0187 ms | 0.0109 ms | 1.71x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bool` | `transposed` | 0.0214 ms | 0.0115 ms | 1.86x |
| `mixed_crop_4d` | `(2, 32, 64, 96)` | `(-2, 3, 1, -1)` | `bool` | `sliced` | 0.0209 ms | 0.0115 ms | 1.81x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `contiguous` | 0.0286 ms | 0.0074 ms | 3.86x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `transposed` | 0.0310 ms | 0.0107 ms | 2.90x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `sliced` | 0.0311 ms | 0.0101 ms | 3.09x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `contiguous` | 0.0284 ms | 0.0074 ms | 3.82x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `transposed` | 0.0313 ms | 0.0104 ms | 3.00x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `sliced` | 0.0310 ms | 0.0099 ms | 3.14x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `contiguous` | 0.0287 ms | 0.0075 ms | 3.85x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `transposed` | 0.0312 ms | 0.0105 ms | 2.98x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `sliced` | 0.0308 ms | 0.0095 ms | 3.26x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `contiguous` | 0.0288 ms | 0.0073 ms | 3.95x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `transposed` | 0.0309 ms | 0.0103 ms | 3.01x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `sliced` | 0.0312 ms | 0.0099 ms | 3.15x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `contiguous` | 0.0285 ms | 0.0073 ms | 3.92x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `transposed` | 0.0307 ms | 0.0101 ms | 3.04x |
| `wan_small_5d` | `(1, 48, 1, 16, 16)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `sliced` | 0.0309 ms | 0.0096 ms | 3.21x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `contiguous` | 0.1519 ms | 0.0430 ms | 3.54x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `transposed` | 0.2057 ms | 0.0644 ms | 3.20x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float32` | `sliced` | 0.1902 ms | 0.0693 ms | 2.74x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `contiguous` | 0.1059 ms | 0.0396 ms | 2.68x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `transposed` | 0.1534 ms | 0.0607 ms | 2.53x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `float16` | `sliced` | 0.1308 ms | 0.0609 ms | 2.15x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `contiguous` | 0.1057 ms | 0.0393 ms | 2.69x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `transposed` | 0.1533 ms | 0.0607 ms | 2.52x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bfloat16` | `sliced` | 0.1303 ms | 0.0609 ms | 2.14x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `contiguous` | 0.1522 ms | 0.0430 ms | 3.54x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `transposed` | 0.2045 ms | 0.0670 ms | 3.05x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `int32` | `sliced` | 0.1906 ms | 0.0684 ms | 2.79x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `contiguous` | 0.0973 ms | 0.0303 ms | 3.21x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `transposed` | 0.1432 ms | 0.0541 ms | 2.64x |
| `wan_mid_5d` | `(1, 512, 1, 64, 64)` | `(1, 1, 1, 1, 2, 0)` | `bool` | `sliced` | 0.1194 ms | 0.0545 ms | 2.19x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float32` | `contiguous` | 0.0461 ms | 0.0526 ms | 0.88x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float32` | `transposed` | 0.2299 ms | 0.0767 ms | 3.00x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float32` | `sliced` | 0.1857 ms | 0.0960 ms | 1.94x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float16` | `contiguous` | 0.0386 ms | 0.0279 ms | 1.38x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float16` | `transposed` | 0.2154 ms | 0.0699 ms | 3.08x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `float16` | `sliced` | 0.1240 ms | 0.0721 ms | 1.72x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bfloat16` | `contiguous` | 0.0384 ms | 0.0285 ms | 1.35x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bfloat16` | `transposed` | 0.2150 ms | 0.0710 ms | 3.03x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bfloat16` | `sliced` | 0.1256 ms | 0.0733 ms | 1.71x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `int32` | `contiguous` | 0.0514 ms | 0.0520 ms | 0.99x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `int32` | `transposed` | 0.2317 ms | 0.0753 ms | 3.08x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `int32` | `sliced` | 0.1884 ms | 0.1065 ms | 1.77x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bool` | `contiguous` | 0.0359 ms | 0.0174 ms | 2.07x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bool` | `transposed` | 0.2035 ms | 0.0635 ms | 3.21x |
| `zero_pad_5d` | `(1, 512, 4, 64, 64)` | `(0, 0, 0, 0, 0, 0)` | `bool` | `sliced` | 0.1162 ms | 0.0637 ms | 1.82x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float32` | `contiguous` | 0.6938 ms | 0.2953 ms | 2.35x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float32` | `transposed` | 1.2018 ms | 0.3505 ms | 3.43x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float32` | `sliced` | 1.1201 ms | 0.4372 ms | 2.56x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float16` | `contiguous` | 0.4209 ms | 0.1144 ms | 3.68x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float16` | `transposed` | 0.9549 ms | 0.1926 ms | 4.96x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `float16` | `sliced` | 0.7193 ms | 0.2155 ms | 3.34x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bfloat16` | `contiguous` | 0.4179 ms | 0.1097 ms | 3.81x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bfloat16` | `transposed` | 0.9514 ms | 0.1937 ms | 4.91x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bfloat16` | `sliced` | 0.7133 ms | 0.2131 ms | 3.35x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `int32` | `contiguous` | 0.6962 ms | 0.2960 ms | 2.35x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `int32` | `transposed` | 1.2045 ms | 0.3451 ms | 3.49x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `int32` | `sliced` | 1.1212 ms | 0.4381 ms | 2.56x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bool` | `contiguous` | 0.3444 ms | 0.0948 ms | 3.63x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bool` | `transposed` | 0.8468 ms | 0.1806 ms | 4.69x |
| `wan_large_5d` | `(1, 256, 6, 128, 128)` | `(1, 1, 1, 1, 0, 0)` | `bool` | `sliced` | 0.5935 ms | 0.1726 ms | 3.44x |

</details>
Pull Request resolved: pytorch#195368
Approved by: https://github.com/malfet
…3432)

Previously `mallocWithAddress` recorded its provenance on the synthetic
prefix-block malloc/free pair by temporarily overwriting the calling
thread's `user_metadata` (appending `"\nmallocWithAddress"` and restoring
on scope exit). This conflated two distinct things: the user-set metadata
and an allocator-internal tag. It also corrupted structured metadata --
if the user set JSON via `_set_memory_metadata`, the appended text made
the recorded string no longer parse as JSON.

This adds a dedicated `internal_metadata_` field on `TraceEntry`. The
allocator sets an `internal_metadata_tag` (guarded by the allocator mutex,
which is held across the tagged region) and stamps it onto trace entries
in `record_trace`, leaving `user_metadata_` verbatim. The field is only
emitted in the snapshot (both pybind and pickled paths) when non-empty,
and the visualizer renders it under a separate "Internal Metadata" label.

`_set_memory_metadata` now also accepts a dict, serialized to compact JSON,
so callers can record structured metadata; `_get_memory_metadata` returns
the JSON string form, which round-trips back through `_set_memory_metadata`.

Test Plan:

```
python test/test_cuda.py -k test_memory_metadata_dict
python test/test_cuda.py -k test_resize_storage_with_addr_metadata_tag
```

Authored-with: Claude (Opus 4.8)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pull Request resolved: pytorch#193432
Approved by: https://github.com/pytorchgreenlight, https://github.com/ngimel
… to match CPython (pytorch#194348)

## Summary

In CPython, `_deque_reverse_iterator` is not a subclass of `_deque_iterator`:

```
>>> from collections import deque
>>> issubclass(type(reversed(deque())), type(iter(deque())))
False
```

`dir()` on both is the same (`__iter__`, `__next__`, `__length_hint__`). Dynamo still had `DequeReverseIteratorVariable(DequeIteratorVariable)`, so every `isinstance(x, DequeIteratorVariable)` check also matched reverse deque iterators.

This follows the same shape as pytorch#193261 (deque forward) and pytorch#193717 (tuple): reparent onto the existing `BaseListIteratorVariable` so the two deque iterator VTs are siblings. No new base class.

The deque mutation snapshot (`source_deque` / `saved_state`) cannot be inherited from `DequeIteratorVariable` after the split, or reverse iterators would still type-check as deque iterators. It is copied onto `DequeReverseIteratorVariable` so `reversed(d)` still raises `RuntimeError: deque mutated during iteration`.

### Files touched

| File | What changed |
| --- | --- |
| `torch/_dynamo/variables/lists.py` | `DequeReverseIteratorVariable` now subclasses `BaseListIteratorVariable`. Mutation snapshot copied so reverse iterators stay siblings. |
| `torch/_dynamo/symbolic_convert.py` | `GET_YIELD_FROM_ITER` lists `DequeReverseIteratorVariable` explicitly (same pattern as list/tuple/deque after pytorch#193717). |
| `torch/_dynamo/utils.py` | `_unpack_fast_types` adds `DequeReverseIteratorVariable` so reverse deque unpack keeps the fast path. |
| `torch/_dynamo/variables/__init__.py` | Import `DequeReverseIteratorVariable` (not exported in `__all__`, same as `DequeIteratorVariable`). |
| `test/dynamo/test_iterators.py` | Hierarchy, `yield from reversed(deque)`, and `type(reversed(deque))` regression tests. |

Not touched: `side_effects.py`. Deque iterators are built sourceless with `ValueMutationNew` and never hit the list/tuple iterator replay handler (pytorch#193261). Reverse is the same.

Part of pytorch#192874

## Test plan

```
python test/dynamo/test_iterators.py TestIterators.test_deque_reverse_iterator_not_a_deque_iterator
python test/dynamo/test_iterators.py TestIterators.test_yield_from_deque_reverse_iterator
python test/dynamo/test_iterators.py TestIterators.test_deque_reverse_iterator_python_type
python test/dynamo/test_iterators.py
python test/dynamo/test_sequence_ops.py -k deque_reverse
```

Pull Request resolved: pytorch#194348
Approved by: https://github.com/guilhermeleobas, https://github.com/hameerabbasi
## Summary
Migrate `AutogradFunctionVariable` off a `call_method` if-chain onto declarative `tp_methods`, as in pytorch#195165.

`apply` and `backward` are now `Method` handlers; static/class method handling is unchanged.

Part of pytorch#195165 (does not close the umbrella).

## Test plan
- [x] `git diff --check`
- [x] `python -m py_compile torch/_dynamo/variables/misc.py`

> AI-assisted implementation.

Pull Request resolved: pytorch#195180
Approved by: https://github.com/guilhermeleobas
…orch#195281)

## Summary:

Threaded PG performs the data movement for all ranks on rank 0's thread, hence on rank 0's current stream. The current stream is thread-local, so a collective issued from a side stream is unordered w.r.t. rank 0's copies: rank 0 can read a rank's input before its copy-in has run, and a rank can read its output before rank 0 has written it. FSDP2 hits this on every collective because

FSDPCommContext.lazy_init gives each rank private all-gather and reduce-scatter streams. The host-side ordering in Collective.join was already correct, which is why the race went unnoticed for so long: it resolves favourably on NVIDIA CI and loses on ROCm, where it surfaces as check_sharded_parity gradient mismatches and diverging losses in the FSDP2 and replicate tests (ROCM-28104).

A real backend is stream-ordered w.r.t. the stream that issued the collective, and Collective.join now provides the same guarantee using events: every non-root rank records an event on the stream it issued from, rank 0 waits on those events before copying and records one afterwards, and the other ranks wait on that. The path is a no-op for CPU tensors. test_collectives_issued_from_side_stream covers the same ordering without involving FSDP.

## Reproduction:

The affected tests pass by luck on a fast enough GPU, so delay the producing side. In test_param_registration_after_forward, right before model(inp):

    if self.rank != 0:
        device_sleep(device_type.type, int(50 * get_cycles_per_ms(device_type.type)))

FSDP2's side streams wait on the rank's compute stream, so the sleep holds back the collective's inputs while rank 0 runs ahead. Without this change the test fails with 9/36 elements mismatched; with it, it passes. test_to_float64_after_init reproduces the same way with the sleep at the top of the training loop.
Pull Request resolved: pytorch#195281
Approved by: https://github.com/jeffdaily

Co-authored-by: Jeff Daily <[email protected]>
JIRA ID: AIPYTORCH-1074

## Problem
ROCm SDK version and HIP runtime version are diverging. Test gates, `collect_env`, `verify_dynamo`, and extension cache keys still treated `torch.version.hip` as the SDK version, so patch thresholds and toolchain identity are wrong once SDK and HIP majors split.

## Changes
Rebased onto main including Meta's pytorch#194985 reland (`_derive_rocm_version`, `ROCM_VERSION` as major.minor, `getattr` for missing `torch.version.rocm`). Dropped the overlapping hunks. This PR keeps the SDK vs HIP split that the reland does not cover.

- `getRocmVersion()` returns the full `_get_torch_rocm_version()` tuple (`tuple[int, ...]`). `ROCM_VERSION` stays major.minor; the `TEST_WITH_ROCM` guard in `_get_torch_rocm_version` is unchanged.
- Skip helpers (`test_cuda`, `test_linalg`, `test_sparse`) and inductor FP8 gating (`mm_grouped`) use the SDK parser. `mm_grouped` uses `getattr(torch.version, "rocm", None) or torch.version.hip`.
- `collect_env` replaced `ROCM used to build PyTorch:` with separate `ROCm SDK used to build PyTorch:` and `HIP used to build PyTorch:` lines. Older wheels without `torch.version.rocm` print `N/A`. The old `ROCM used to build PyTorch:` string is gone on purpose: external bug-report tooling that greps for it will not match after this ships in nightlies. `rocm_compiled_version` is appended at the end of `SystemEnv` so positional construction of the original fields still lines up.
- `verify_dynamo` compares SDK to SDK from `rocm-core/rocm_version.h` at major.minor (so 7.14.0 vs 7.14.1 does not warn), and falls back to HIP-to-HIP when the header or `torch.version.rocm` is missing.
- `cpp_extension` default cache key includes both SDK and HIP identities, strips dots and `-<gitsha>`, and uses `getattr` when `rocm` is absent.
- Tests: `TestFrameworkUtils` covers SDK vs HIP selection; `TestVerifyDynamoRocm` covers `_parse_version`, header parsing, SDK patch-ignore, minor mismatch, and HIP fallback.

## Validation
`python3 -m py_compile` on the edited files passed. `ruff check --select F821,F401,F811,S101` and `ruff format --check` passed on `test/test_utils.py`. Isolated `verify_dynamo` unit tests previously passed against a stubbed `torch`. Full lintrunner and device tests were not run locally (this worktree has no built torch).

Pull Request resolved: pytorch#193602
Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily

Co-authored-by: Jeff Daily <[email protected]>
Summary: See stacked diffs.

Test Plan: See stacked diffs.

Differential Revision: D118315256

Pull Request resolved: pytorch#195611
Approved by: https://github.com/egienvalue
…h#188114)

The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware:

1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them.

2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201.

Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly.

Fixes pytorch#188113

Pull Request resolved: pytorch#188114
Approved by: https://github.com/jeffdaily

Co-authored-by: doplxyz <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Jeff Daily <[email protected]>
Last MPSGraph backward ops in this stub family (sigmoid_backward was already
native). logit_backward carries its eps scalar via the binary-alpha path;
tanh_backward gains complex support for free.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pull Request resolved: pytorch#195601
Approved by: https://github.com/Skylion007
…ytorch#193908)

## Summary

Allow registered `DeviceInterface` implementations to contribute stable
device and runtime metadata to the Inductor CodeCache system key.

This lets out-of-tree backends participate in cache invalidation without
replacing `CacheBase.get_system()` or hardcoding backend-specific runtime
information in Inductor.

## Changes

- Add `DeviceInterface.get_cache_system_info()`, returning optional stable,
  JSON-serializable metadata for the code cache key.
- Define the hook contract so `None` opts out while an empty dict still
  participates in the cache key.
- Extend `CacheBase.get_system()` to collect metadata from registered and
  available device interfaces.
- Skip indexed device aliases such as `cuda:0` when collecting metadata so
  each backend contributes only once.
- Validate contributed metadata before adding it to the cache key:
  non-dict or non-JSON-serializable metadata is warned about and skipped
  instead of breaking unrelated compilation.
- Keep interface availability checks, metadata collection, and metadata
  validation isolated so a broken third-party backend cannot break CPU-only
  compilation.
- Preserve Triton version information in the system cache key even when CUDA
  device probing is unavailable.
- Continue collecting out-of-tree backend metadata when CUDA is unavailable.

## Motivation

`CacheBase.get_system()` currently derives cache-invalidating system
information primarily from CUDA/HIP device properties and runtime versions.

Out-of-tree backends that need their own device or runtime version to
invalidate generated or autotuned code therefore have no backend-owned
extension point for contributing that information.

Providing this through `DeviceInterface` keeps backend-specific system
metadata behind the existing device abstraction and avoids requiring
out-of-tree backends to replace `CacheBase.get_system()` or duplicate its
cache hashing logic.

The default `DeviceInterface.get_cache_system_info()` implementation returns
`None`, so backends opt in explicitly.

Because `CacheBase.get_system()` is cached, the interface must be registered
before the hook is first sampled.

## Test Plan

Added or updated coverage for:

- The default `DeviceInterface.get_cache_system_info()` returning `None`.
- Preserving existing CUDA system cache input when no interface contributes
  additional metadata.
- Including registered interface metadata in the system cache key.
- Changing interface metadata changing the resulting system hash.
- Ignoring indexed device aliases such as `fake:0`.
- Skipping unavailable device interfaces.
- Continuing compilation when a device interface raises while contributing
  cache metadata.
- Treating an empty metadata dict as participating in the cache key rather
  than as an opt-out.
- Rejecting non-JSON-serializable metadata without propagating the failure.
- Rejecting JSON-serializable non-dict metadata that violates the hook
  contract.
- Collecting interface metadata when CUDA is unavailable.
- Preserving Triton version information in the cache key when CUDA is
  unavailable.

## Follow-up work

This PR intentionally does not migrate the existing CUDA/HIP-specific fields
in `CacheBase.get_system()` into `CudaInterface.get_cache_system_info()`.

That migration would change the existing serialized cache payload shape and
invalidate existing on-disk caches, so it should be handled separately rather
than combined with introducing this extension point.

`XpuInterface.get_cache_system_info()` is a natural first in-tree adopter of
the new hook because XPU currently does not contribute equivalent device or
runtime metadata to this system cache key. Unlike moving the existing
CUDA/HIP fields, adding XPU metadata would introduce new cache-key information
rather than relocate existing fields.

## Notes

- Preserving Triton version information when CUDA probing is unavailable
  changes the previous non-CUDA cache payload and therefore causes a one-time
  cache invalidation for those environments.
- Related RFC: pytorch#189137.

Pull Request resolved: pytorch#193908
Approved by: https://github.com/aorenste, https://github.com/FuDdd
…5167)

## Summary
Migrate `ContextVarVariable` off a `call_method` if-chain onto declarative `tp_methods`, as in pytorch#195165.

`get` / `set` / `reset` are now `Method` handlers. Arity comes from CPython `ml_flags` (`METH_FASTCALL` for `get`, `METH_O` for `set`/`reset`). The extra-positional check on `get` is kept because FASTCALL does not cap at one argument. `set` / `reset` still graph-break.

Part of pytorch#195165 (does not close the umbrella).

## Test plan
- [x] `python test/dynamo/test_contextvars.py` (24 passed)

Pull Request resolved: pytorch#195167
Approved by: https://github.com/guilhermeleobas
…ytorch#193282)

## Summary

This PR enables ProcessGroupNCCL2 windows on ROCm, which compile-time guards previously disabled, and enforces the existing allocation contract: window memory must come from `torch.cuda.MemPool(backend.mem_allocator)` (
`ncclMemAlloc`). The NCCL/RCCL 2.29 version check is unchanged.

## Problem

After the ROCm guards were removed, 10 of 11 window tests passed. `Nccl2WindowTest.test_register_errors` failed because RCCL accepted a tensor that should have been rejected, so the expected RuntimeError never fired.

NVIDIA NCCL requires compatible symmetric memory for this window path and has no fallback for ordinary cudaMalloc buffers. RCCL does: a host-side RMA fallback can register ordinary HIP allocations. A private-pool id is not a substitute for the right allocator, because `torch.cuda.MemPool()` also has a valid id. The unit test is what surfaced this, but the same hole exists for every ROCm window registration, including `register_mem_pool(pool, symm=True)`.

Leaving the fallback open is not a harmless extra. NCCL2 put and window lookup only check that a segment already has a window handle. If RCCL accepts ordinary HIP memory, those buffers become valid window sources. ROCm would then succeed on memory that the default path cannot use for this API, and the documented MemPool(backend.mem_allocator) contract would not actually be enforced.

## Solution

On ROCm, the backend records the address and size of each live 'ncclMemAlloc' allocation and drops the record after
`ncclMemFree` succeeds. Before a symmetric window upgrade, it checks that the storage segment falls in a recorded range: default-allocator memory and unrelated private pools are rejected; `MemPool(backend.mem_allocator)` is accepted.

The check is ROCm-only. The shared allocator hook, ordinary collective registration, and NVIDIA behavior are unchanged.

## Design choices

**Windows are enabled on ROCm, but still gated on NCCL/RCCL 2.29.** supportsWindow() no longer has && !defined(USE_ROCM). The old guard was a feature kill switch, not a version check. RCCL 2.29+ can create windows; older RCCL should still fail with a version error.

**The host-RMA fallback is not a supported NCCL2 window.** The public contract is the NCCL allocator, and it should mean the same thing on CUDA and ROCm.

**Provenance is enforced in ensureSegmentWindow**, which both `tensor_register` and
`register_mem_pool(..., symm=True)` call. Guarding only `tensor_register` leaves the `mempool` path open.

**Wrong allocator throws; missing transport does not.** Allocator violations return `ncclInvalidArgument` and become a Python RuntimeError. Missing symmetric transport stays `ncclInvalidUsage`: warn and keep plain `ncclCommRegister` registration, matching the stock NCCL backend. Those failures are different. A wrong allocator is a caller error and must not succeed. A missing transport is an environment limit. Mapping the allocator case onto `ncclInvalidUsage` would warn and leave the buffers registered as plain user buffers.

**`register_mem_pool(symm=True)` is rejected before any state is mutated.** On ROCm the pool snapshot is taken once and every segment is checked with `isNcclAllocatorSegment` before `registeredMemPools_.insert` or
`registerAddressLocked. ensureSegmentWindow` keeps the same check as a second barrier for `tensor_register`. Checking only inside the upgrade loop recorded the pool first, so a throw left leftover state in a shared test worker.

**The extra tracking is #if defined(USE_ROCM).** NVIDIA NCCL already refuses ordinary allocations on this path; the extra check exists because RCCL is more permissive.

**Segment lookup is one helper**, `findContainingRegistrationLocked`, used by both `lookupSegmentWindow` and `ensureSegmentWindow`.

**The unsupported-window error no longer says windows are unavailable on ROCm.** It is now ProcessGroupNCCL windows require NCCL 2.29 or later. That is true after this PR; the old ROCm clause is not. Anything matching the old string will need an update.

## User-visible behavior on ROCm

| Call | Wrong allocator (default or unrelated `MemPool`) | No symmetric transport | RCCL < 2.29 |
| --- | --- | --- | --- |
| `register_mem_pool(pool, symm=True)` | Throws; the pool is not recorded | Warns; keeps plain registration | Windows stay disabled by the version check |
| `tensor_register` / `_new_window` | Throws (`mempool` / `MemPool` in the message) | Register can fail as unsupported | `supports_window` is false |

`register_mem_pool(symm=True)` on `torch.cuda.MemPool()` is a behavior change: RCCL host-RMA could previously succeed. This treats that as a bug, not as API. Docs already require `MemPool(backend.mem_allocator)` (`docs/source/symmetric_memory.md`).

## Tests

`Nccl2WindowTest.test_register_errors` rejects default-allocator tensors and unrelated private pools. Those cases run before `_probe_window_support` because they do not need a live symmetric transport. Double-registration still does, so it stays after the probe.

`ProcessGroupNCCL2MemPoolTest.test_register_mem_pool_symmetric_rejects_unrelated_allocator` expects a throw mentioning `mem_allocator` or `ncclMemAlloc`, then asserts that `deregister_mem_pool` fails with `not previously registered`. The second assert is the leftover-state regression.

## CI coverage

The limiter on current ROCm CI is GIN / symmetric transport, not RCCL 2.29. Trunk 7.14 and preview 10 both get past `supports_window`; `_probe_window_support` then tries a real `ncclCommWindowRegister`. On 7.14 CI that fails with `NCCL Last Error: GIN not supported`, so pytest reports the window file as skipped. The skip text also mentions mempool / `invalid usage`; that is PyTorch's mapping, not the RCCL reason.

On HEAD `36cdb3f`:

- **ciflow/rocm-preview** (this PR pins the preview image to ROCm 10.0.0rc4 / HIP Runtime 7.15.26333): live windows run. [distributed 2/3](https://github.com/pytorch/pytorch/actions/runs/32796615998/job/97673134522) is `Nccl2WindowTest` **11 passed**. [distributed 1/3](https://github.com/pytorch/pytorch/actions/runs/32796615998/job/97673134508) ran `ProcessGroupNCCL2MemPoolTest`, including `test_register_mem_pool_symmetric` and `test_register_mem_pool_symmetric_rejects_unrelated_allocator` (**PASSED**).
- **ciflow/trunk** jammy ROCm 7.14 MI350 (HIP Runtime 7.14.60850): mem-pool / provenance tests run ([distributed 1/3](https://github.com/pytorch/pytorch/actions/runs/32796614990/job/97659566299), `test_c10d_nccl2` successful). The window suite is selected but internally skipped: [distributed 2/3](https://github.com/pytorch/pytorch/actions/runs/32796614990/job/97659566372) is **11 skipped** with `GIN not supported`. Rank-local rejects in `test_register_errors` still execute before the probe; pytest then skips the test because double-registration needs a live GIN window.
- **ciflow/periodic-rocm-mi300** noble 7.14 is the same GIN skip for windows ([distributed 2/5](https://github.com/pytorch/pytorch/actions/runs/32796613834/job/97659332472), **11 skipped**). The shard reporting `test_c10d_window ... was successful` means the file completed with skips, not that put/signal ran.

Live window coverage in CI is the preview lane. Trunk / periodic 7.14 are not environments where RCCL initializes a usable GIN plugin.

## Validation

Manual run on MI355X with HIP 7.15 and RCCL 2.30.4: full NCCL2 window suite passed; mempool suite including the leftover-state reject test passed; reduction regression passed; targeted lint passed.

CI on `36cdb3f` repeats that split: preview executes the window suite; 7.14 trunk / MI300 periodic execute mem-pool provenance and skip live windows on GIN.

Authored with the assistance of an AI coding assistant.

Pull Request resolved: pytorch#193282
Approved by: https://github.com/jeffdaily

Co-authored-by: Cursor <[email protected]>
Adds a `SparseCsrXPU` dispatch entry for `aten::_spsolve` in `native_functions.yaml`, mapping it to `_sparse_csr_linear_solve_xpu`, which is implemented in third_party/torch-xpu-ops. This enables `torch.sparse.spsolve` on XPU, alongside the existing SparseCsrCUDA backend.

#### Related XPU PR

The kernel implementation live in intel/torch-xpu-ops#4286.
Its tests are present in intel/torch-xpu-ops#5076.

#### Changes & Testing

See linked XPU PRs for more information
Pull Request resolved: pytorch#189372
Approved by: https://github.com/BBBela, https://github.com/CuiYifeng, https://github.com/guangyey, https://github.com/Skylion007
The check was a single torch._check with an `and`:

    torch._check(
        self.size(dim) == 3 and other.size(dim) == 3, ...
    )

Python's `and` has to decide the truthiness of its left operand, so it
calls bool() on the first SymBool. On an unbacked size that is a guard,
and tracing fails with

    Could not guard on data-dependent expression Eq(u0, 3)

instead of the constraint being recorded. sym_and combines the two
without the bool cast, which is what the rest of the file already uses
for compound conditions (see _padding_check_valid_input and the
pooling checks).

Only the left operand matters here: `a and b` returns `b` untouched when
`a` is a plain bool, which is why the many `x.dim() == n and <symbolic>`
checks in this file are fine as written.

Test Plan:

New regression in test/inductor/test_unbacked_symints.py builds a tensor
whose *last* dim is unbacked (the op_db samples only exercise concrete
ones, which is why CI did not already cover this):

```
python -m pytest test/inductor/test_unbacked_symints.py -k linalg_cross
```

before: `Could not guard on data-dependent expression Eq(u0, 3)`
after: `1 passed`

The check still rejects a bad length in eager:

```
python -c "import torch; a = torch.ones(4, 5); torch.linalg.cross(a, a)"
```

```
RuntimeError: linalg.cross: inputs dimension -1 must have length 3. Got 5 and 5
```

Surrounding suites:

```
python -m pytest test/inductor/test_unbacked_symints.py
python -m pytest test/test_ops.py -k linalg_cross
python -m pytest test/test_meta.py -k cross
```

```
50 passed, 11 skipped
66 passed, 15 skipped, 2 xfailed
130 passed, 154 skipped, 8 xfailed
```

This change was authored with the assistance of an AI coding assistant.
@egeboy35 egeboy35 closed this Sep 2, 2026
egeboy35 added a commit that referenced this pull request Sep 25, 2026
…rm (pytorch#195574)

`aten::rms_norm` declares `Tensor? weight=None`, but `rms_norm_composite` gates the weight multiply on `weight_opt.has_value()` alone. A C++ caller forwarding a possibly-undefined Tensor where an optional is expected produces an engaged optional holding an undefined tensor, and that reaches `upcasted_result.mul(<undefined>)`:

```
Expected a proper Tensor but got None (or an undefined Tensor in C++) for argument #1 'other'
```

`at::layer_norm` accepts the same call, because `math_native_layer_norm` also checks `.defined()`. That asymmetry is the bug.

The MPS branch of `rms_norm_symint` had the same gate and would have handed an undefined weight to `_fused_rms_norm_mps`, so it is fixed here rather than left as a twin of the one being removed. I have no MPS hardware; that half is reasoned from the source and left to CI.

### Test

The failure is only reachable from C++ — Python cannot construct an engaged optional holding an undefined tensor — so the regression test is a gtest in `undefined_tensor_test.cpp`, which `aten/tools/run_tests.sh` already runs. It went there rather than `math_kernel_test.cpp`, which is built but appears in no runner list and so would not have gated this PR.

This machine's Device Guard policy refuses to launch freshly linked gtest binaries, so the assertions were exercised through a `cpp_extension` against a locally built `torch_cpu`. Same harness before and after:

```
before:  engaged-but-undefined  : THREW -> Expected a proper Tensor but got None ...
after:   engaged-but-undefined  : ok, numel=6
```

and the test's own assertion, plus a check that a real weight is still applied:

```
equal(undef, nullopt)  : true
max abs diff           : 0
weight still applied   : true
```

### Related

pytorch#193936 adds `torch::nn::RMSNorm` and currently works around this by converting an undefined weight to `std::nullopt` before calling `at::rms_norm`. If this lands first, that conversion and its comment can be dropped there.

Developed with AI assistance (Claude); I reproduced the failure, wrote the fix and ran the checks above.

Pull Request resolved: pytorch#195574
Approved by: https://github.com/drisspg

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.