Skip to content

[release 2.12] [triton 3.7] Triton pin Update - #174896

Closed
atalman wants to merge 2 commits into
pytorch:mainfrom
atalman:triton_feb_2026_update
Closed

atalman wants to merge 2 commits into
pytorch:mainfrom
atalman:triton_feb_2026_update

Conversation

@atalman

@atalman atalman commented Feb 12, 2026 •

Copy link
Copy Markdown
Collaborator

@atalman atalman added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 12, 2026
@atalman atalman added keep-going Don't stop on first failure, keep running tests until the end ciflow/inductor-perf-test-nightly Trigger nightly inductor perf tests ciflow/inductor-perf-compare ciflow/slow ciflow/rocm ci-no-test-timeout Don't set timeouts for test running, caution: cannot be set in main ci-no-td Do not run TD on this PR ciflow/inductor-micro-benchmark ciflow/inductor-rocm Trigger "inductor" config CI on ROCm ciflow/inductor-periodic labels Feb 12, 2026
@pytorch-bot

pytorch-bot Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/174896

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 11 New Failures, 4 Cancelled Jobs, 26 Unrelated Failures

As of commit 718147b with merge base 1474651 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@atalman atalman added ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/pull ciflow/h100 ciflow/rocm-mi355 Trigger "default" config CI on ROCm MI355 runners ciflow/b200 labels Feb 12, 2026
@pytorch-bot

pytorch-bot Bot commented Feb 12, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/inductor-perf-test-nightly.
Currently recognized labels are

  • ciflow/b200
  • ciflow/b200-distributed
  • ciflow/b200-symm-mem
  • ciflow/binaries
  • ciflow/binaries_libtorch
  • ciflow/binaries_wheel
  • ciflow/dynamo
  • ciflow/h100
  • ciflow/h100-cutlass-backend
  • ciflow/h100-distributed
  • ciflow/h100-symm-mem
  • ciflow/inductor
  • ciflow/inductor-cu126
  • ciflow/inductor-micro-benchmark
  • ciflow/inductor-micro-benchmark-cpu-x86
  • ciflow/inductor-pallas
  • ciflow/inductor-perf-compare
  • ciflow/inductor-perf-test-nightly-rocm-mi300
  • ciflow/inductor-perf-test-nightly-rocm-mi355
  • ciflow/inductor-perf-test-nightly-x86-zen
  • ciflow/inductor-perf-test-nightly-xpu
  • ciflow/inductor-periodic
  • ciflow/inductor-rocm-mi200
  • ciflow/inductor-rocm-mi300
  • ciflow/inductor-rocm-mi355
  • ciflow/linux-aarch64
  • ciflow/mps
  • ciflow/nightly
  • ciflow/op-benchmark
  • ciflow/periodic
  • ciflow/periodic-rocm-mi200
  • ciflow/periodic-rocm-mi300
  • ciflow/periodic-rocm-mi355
  • ciflow/pull
  • ciflow/quantization-periodic
  • ciflow/riscv64
  • ciflow/rocm-mi200
  • ciflow/rocm-mi300
  • ciflow/rocm-mi355
  • ciflow/rocm-navi31
  • ciflow/s390
  • ciflow/slow
  • ciflow/slow-rocm-mi200
  • ciflow/torchbench
  • ciflow/triton_binaries
  • ciflow/trunk
  • ciflow/unstable
  • ciflow/vllm
  • ciflow/win-arm64
  • ciflow/xpu

Please add the new label to .github/pytorch-probot.yml

@pytorch-bot

pytorch-bot Bot commented Feb 12, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/rocm.
Currently recognized labels are

  • ciflow/b200
  • ciflow/b200-distributed
  • ciflow/b200-symm-mem
  • ciflow/binaries
  • ciflow/binaries_libtorch
  • ciflow/binaries_wheel
  • ciflow/dynamo
  • ciflow/h100
  • ciflow/h100-cutlass-backend
  • ciflow/h100-distributed
  • ciflow/h100-symm-mem
  • ciflow/inductor
  • ciflow/inductor-cu126
  • ciflow/inductor-micro-benchmark
  • ciflow/inductor-micro-benchmark-cpu-x86
  • ciflow/inductor-pallas
  • ciflow/inductor-perf-compare
  • ciflow/inductor-perf-test-nightly-rocm-mi300
  • ciflow/inductor-perf-test-nightly-rocm-mi355
  • ciflow/inductor-perf-test-nightly-x86-zen
  • ciflow/inductor-perf-test-nightly-xpu
  • ciflow/inductor-periodic
  • ciflow/inductor-rocm-mi200
  • ciflow/inductor-rocm-mi300
  • ciflow/inductor-rocm-mi355
  • ciflow/linux-aarch64
  • ciflow/mps
  • ciflow/nightly
  • ciflow/op-benchmark
  • ciflow/periodic
  • ciflow/periodic-rocm-mi200
  • ciflow/periodic-rocm-mi300
  • ciflow/periodic-rocm-mi355
  • ciflow/pull
  • ciflow/quantization-periodic
  • ciflow/riscv64
  • ciflow/rocm-mi200
  • ciflow/rocm-mi300
  • ciflow/rocm-mi355
  • ciflow/rocm-navi31
  • ciflow/s390
  • ciflow/slow
  • ciflow/slow-rocm-mi200
  • ciflow/torchbench
  • ciflow/triton_binaries
  • ciflow/trunk
  • ciflow/unstable
  • ciflow/vllm
  • ciflow/win-arm64
  • ciflow/xpu

Please add the new label to .github/pytorch-probot.yml

@atalman
atalman force-pushed the triton_feb_2026_update branch from 5c6371b to 821c3cf Compare March 13, 2026 18:39
@atalman

atalman commented Mar 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Detailed Root Cause Analysis for Each Failure

  1. Lint failures in torch/_inductor/kernel/mm.py

Trivial fix. Lines 81, 83, and 89 have comments exceeding B950 line length:

Line 81: "# We define each template kernel in a separate file which is the name of the input to
load_kernel_template" (104 chars)
Line 83: "# If you are adding a new template, please follow that pattern and add a new file..." (133
chars)
Line 89: "# FIXME: To get around rocm failures like https://github.com/..." (119 chars)

Fix: Wrap comments to multiple lines. Line 89 has a URL that can't be broken, so either use # noqa: B950
or put the URL on its own line.


  1. AOTI failures (3 tests in test_aot_inductor.py)

This is the core bug. The problem is in wrapper.py:2656-2665.

The triton_kernel_wrap.py change (the correct one for Triton 3.7):

  • constants now only includes is_constexpr params and None args
  • Regular scalars (including those equal to 1) are NOT in constants

But wrapper.py still does the OLD behavior (lines 2656-2665):
if equals_1:
if triton_version_uses_attrs_dict():
add_to_signature(idx, ConstexprArg(name=arg.name)) # WRONG: should keep real type
else:
add_to_signature(idx, arg)
constants[arg.name] = 1 # WRONG for Triton 3.7: shouldn't be in constants

And triton_utils.py:69-72 has a matching bug:
elif _arg_equals_1(arg) and triton_version_uses_attrs_dict():
return "constexpr" # WRONG: should return the actual type (e.g., "i32")

Plus AttrsDescriptorWrapper for V4_DICT (line 88-93 of hints.py) ignores equal_to_1 entirely and only
returns divisible_by_16. This is correct for Triton 3.7 — equal_to_1 specialization is handled via the
attrs dict, not via constants.

The fix for wrapper.py:
if equals_1:
if triton_version_uses_attrs_dict():
add_to_signature(idx, arg) # keep real type (SizeArg), NOT ConstexprArg
# Don't add to constants - Triton 3.7 handles equal_to_1 via attrs/specialization
else:
add_to_signature(idx, arg)
constants[arg.name] = 1

The fix for triton_utils.py:69-72: Remove the _arg_equals_1 check that returns "constexpr" — let it fall
through to return the normal integer type.


  1. test_autotune_unbacked (test_triton_kernels.py)

This test uses the op_zeros autotuned kernel with scalar args interleaved with tensor args. The FileCheck
patterns (PrecomputedGrid, (31 + _launcher_s0) // 32, etc.) are about grid computation, which is
independent of the constants/signature changes.

The likely failure is a compilation error during TTIR generation or mutation analysis, caused by the same
constants mismatch. The wrapper builds incorrect constants (putting equal_to_1 scalars in), then when
the kernel is compiled with Triton 3.7, it fails because Triton treats those constants entries as
constexpr but they shouldn't be. Fixing the wrapper.py issue (#2 above) should fix this as well.


  1. test_triton_template_generated_code_cache_strategy (test_max_autotune.py)

This test uses the mm template with a mocked input_dependent_preserved_state. It expects an InductorError
when cached code produces wrong output. The test hardcodes expected cache keys that include specific
values like num_stages, num_warps, and kwargs dict contents.

Root cause: With Triton 3.7, the V4_DICT AttrsDescriptor changes the config/attrs format. The way
constexpr args flow through template expansion may differ, changing the cache key structure. This is
downstream of the constants/equal_to_1 changes — once the wrapper codegen is fixed, the cache key format
should stabilize and the expected inline strings may need updating.


  1. test_custom_triton_autotune_dynamic (test_fxir_backend.py)

The FXIR backend's add_constants_to_call_args (wrapper_fxir.py:1028) reads triton_meta["constants"] and
zips signature with call_args.

Root cause: In Triton 3.7 (V4_DICT), constexpr args are skipped from call_args at the IR level but still
present in signature. The zip at line 1040 misaligns when call_args has fewer entries than signature.
Additionally, the constants dict being incorrectly populated (with equal_to_1 args) compounds the issue.

Fix: After fixing the wrapper.py constants issue, verify that add_constants_to_call_args correctly
handles the case where constexpr args are already stripped from call_args.

Summary of Required Fixes

  ┌──────────┬───────────────────────────────────────────────────┬──────────────────────────────────────┐
  │ Priority │                       File                        │                Change                │
  ├──────────┼───────────────────────────────────────────────────┼──────────────────────────────────────┤
  │          │                                                   │ Stop making equal_to_1 args          │
  │ P0       │ torch/_inductor/codegen/wrapper.py:2656-2665      │ ConstexprArg and stop adding them to │
  │          │                                                   │  constants when                      │
  │          │                                                   │ triton_version_uses_attrs_dict()     │
  ├──────────┼───────────────────────────────────────────────────┼──────────────────────────────────────┤
  │          │                                                   │ Remove the _arg_equals_1 →           │
  │ P0       │ torch/_inductor/codegen/triton_utils.py:69-72     │ "constexpr" signature override for   │
  │          │                                                   │ new Triton                           │
  ├──────────┼───────────────────────────────────────────────────┼──────────────────────────────────────┤
  │ P1       │ torch/_inductor/codegen/wrapper_fxir.py:1028-1060 │ Verify add_constants_to_call_args    │
  │          │                                                   │ zip alignment after P0 fix           │
  ├──────────┼───────────────────────────────────────────────────┼──────────────────────────────────────┤
  │ P2       │ torch/_inductor/kernel/mm.py:81,83,89             │ Fix B950 lint (wrap comments)        │
  ├──────────┼───────────────────────────────────────────────────┼──────────────────────────────────────┤
  │ P2       │ test/inductor/test_max_autotune.py                │ May need expected inline string      │
  │          │                                                   │ updates after P0 fix                 │
  └──────────┴───────────────────────────────────────────────────┴──────────────────────────────────────┘

For:
dynamo-unittest / dynamo-test (3.12) / test (dynamo_core, 1, 1, linux.c7i.2xlarge) (gh)
'Test'
inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 2, 2, linux.g5.4xlarge.nvidia.gpu) (gh)
test/inductor/test_triton_kernels.py::CustomOpTests::test_autotune_unbacked
inductor / unit-test / inductor-test / test (inductor, 1, 2, linux.g5.4xlarge.nvidia.gpu) (gh)
test/inductor/test_aot_inductor.py::AOTInductorTestABICompatibleGpu::test_triton_kernel_with_none_inputs_and_equal_to_1_arg_cuda
Limited CI on H100 / linux-jammy-cuda12.8-py3.10-gcc11-sm90 / test (smoke, 1, 1, linux.aws.h100) (gh)
test/inductor/test_max_autotune.py::TestMaxAutotuneAsyncPipelined::test_triton_template_generated_code_cache_strategy
Lint / lintrunner-noclang-all / linux-job (gh)
trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 3, 5, lf.linux.g6.4xlarge.experimental.nvidia.gpu) (gh)
test/inductor/test_fxir_backend.py::AOTFxirTestCase::test_custom_triton_autotune_dynamic
trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 4, 5, lf.linux.g6.4xlarge.experimental.nvidia.gpu) (gh)
test/inductor/test_aot_inductor.py::AOTInductorTestABICompatibleGpu::test_triton_kernel_grid_type_3_num_dims_2_dynamic_True_autotune_True_cuda
trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 5, 5, lf.linux.g6.4xlarge.experimental.nvidia.gpu) (gh)
test/inductor/test_aot_inductor.py::AOTInductorTestABICompatibleGpu::test_triton_kernel_grid_type_1_num_dims_2_dynamic_False_autotune_True_cuda

@pytorch-bot pytorch-bot Bot added the ciflow/dtensor Run DTensor specific tests label Mar 17, 2026
@atalman
atalman force-pushed the triton_feb_2026_update branch from 3cdc566 to 7d6d9c6 Compare March 19, 2026 00:20

@njriasan njriasan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atalman See my comments. The only real concern is that I think some of the tests have the wrong bug fix, but otherwise this looks good.

@unittest.skipIf(TEST_WITH_ASAN, "Skipped under ASAN")
@skipIfTorchDynamo("Test uses dynamo already")
@skipIfCrossRef
@skipIfRocm(msg="Fails with Triton 3.7 on MI200")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is MI200? Consumer GPU?

) from e
raise

@requires_gpu

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, this requires a GPU to find a backend? If so it might be good to add a comment since we don't actually run this kernel (and really just need a target arch).

raise

@requires_gpu
def test_constexpr_handling(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you add a comment of expectations for this test? I assume we are checking that constexprs are resolved as constants? Since None is not a constexpr are we depending on argument elimination (e.g. maybe_param will always be replaced with None), because if so that seems reasonable, but should probably be in a docstring or test name.

offs = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
mask = offs < n_elements
x = tl.load(src_ptr + offs * stride, mask=mask)
scale = tl.where(maybe_param != 0, 0.5, 1.0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we expect maybe_param != 0 to evaluate to False because they are different types (its unclear the cast rules to me). Maybe we should express the boolean as maybe_param (assuming None is False) so that its a "valid" condition to reason about.

We should also check that scale evaluates to 1.0 then. Maybe we could just actually run the kernel one all 1 and verify that we get all 1s instead of all 0.5s?

Comment thread test/inductor/test_triton_kernels.py Resolved
return False

def is_tensor_like_arg(arg: Any) -> bool:
if isinstance(arg, Tensor) or is_stable_tensor_descriptor_arg(arg):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this function was dead code?

# To account for this, we inject some fake arg names as placeholders for
# the stride and size parameters.
def get_tensor_names(name: str, arg: Any) -> list[str]:
if isinstance(arg, Tensor):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we never need isinstance(arg, Tensor) anymore?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems right to me, but I just wanted to confirm.

write_stack.extend(op.args[idx] for idx in WRITE_OPS.get(op.name, []))
read_stack.extend(op.args[idx] for idx in READ_OPS.get(op.name, []))

# For these ops, only the first argument (base pointer) refers to actual

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naive question: This is because we are trying to ask "when does the pointer change?" I want to understand why for example tt.make_tensor_descriptor pertaining to a block of memory doesn't need the shape information tracked.

# includes scalars, so writes may reference non-tensor args like SymInts.
return [
dep.name
for dep in tensor_accesses.read_writes.writes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker here, but it seems like we need to centralize this to one location. Maybe this is already that function, but this seems very likely to introduce more bugs in the future (and makes it hard to support multiple Triton versions). We may ideally want to allow for different variations at once.

Comment thread torch/_inductor/ir.py
tma_descriptor_metadata,
)

# Filter to only tensor args: with Triton 3.7+, ordered_arg_names

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya this should be moved to a single helper function, ideally based on Triton version. This can be a followup.

@atalman
atalman force-pushed the triton_feb_2026_update branch from 3ed5815 to c043583 Compare March 24, 2026 19:23

@njriasan njriasan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great thanks!

Comment thread test/inductor/test_max_autotune.py Resolved
Comment thread test/inductor/test_triton_kernels.py Resolved
@atalman

atalman commented Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

@jataylo looks like rocm failure is caused by removing amd/backend/include/TDMCommon.h file:

+ rm -rf third_party/amd/backend/include/hip third_party/amd/backend/include/hipblas-common third_party/amd/backend/include/hsa third_party/amd/backend/include/roctracer third_party/amd/backend/include/TDMCommon.h

Looks like failure comes from here:

rm -rf $TRITON_ROCM_DIR/include/*

update

test

triton_changes

pin_update

feb_triton_update

update_triton_latest

[ROCm] temporary skips required for triton 3.7 bump

Skip inductor on Navi and more 3.7 triton skips

fix

test_fp8_cast_and_t

Revert "fix"

This reverts commit a62cfe3.

Revert "Skip inductor on Navi and more 3.7 triton skips"

This reverts commit dba6883.

Revert "[ROCm] temporary skips required for triton 3.7 bump"

This reverts commit 4ce8faf.

temporary_branch_out_rocm_pin

remove_extra_file

pins

docker

Revert "temporary_branch_out_rocm_pin"

This reverts commit ee2aea9.

Skipped all the tests that fail on ROCm with latest triton

Skipped one more failing test for ROCm

More skips for ROCm

Added skips for MI200 failures

Added MI300 skips

Added MI355 skips

Added skips for navi arch

Skipped all non-exclusive and flaky failures for ROCm

bump

pinned

revert

fix

fixes

fix

fixes

pin

fixes

Revert "fixes"

This reverts commit 3cdc566.

pin

fixes

fix

fixes

triton_kernel_wrap

apply_triton_fixes

fixes

fixes
@atalman
atalman force-pushed the triton_feb_2026_update branch from 1aaa431 to 6c3b425 Compare March 25, 2026 14:21
@atalman atalman added the ci: disable-autorevert Add this label to issues in order to temporarily disable autorevert label Mar 25, 2026
@atalman

atalman commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchmergebot merge -f "lint and rest of the failures are not related"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@meta-codesync

meta-codesync Bot commented Mar 25, 2026

Copy link
Copy Markdown

@warrendeng has imported this pull request. If you are a Meta employee, you can view this in D98216985.

@desertfire

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorevert: disable Disable autorevert for a specific PR ci: disable-autorevert Add this label to issues in order to temporarily disable autorevert ci-no-td Do not run TD on this PR ci-no-test-timeout Don't set timeouts for test running, caution: cannot be set in main ci-refresh-hf-cache ciflow/b200 ciflow/dtensor Run DTensor specific tests ciflow/dynamo Trigger jobs ran periodically on main for dynamo tests ciflow/h100 ciflow/inductor ciflow/inductor-micro-benchmark ciflow/inductor-perf-compare ciflow/inductor-perf-test-nightly Trigger nightly inductor perf tests ciflow/inductor-periodic ciflow/inductor-rocm Trigger "inductor" config CI on ROCm ciflow/inductor-rocm-mi200 Trigger "inductor" config CI on ROCm MI200 ciflow/inductor-rocm-mi300 Trigger "inductor" config CI on ROCm MI300/MI325 ciflow/inductor-rocm-mi355 Trigger "inductor" config CI on ROCm MI355 ciflow/pull ciflow/rocm-mi200 Trigger "default" config CI on ROCm MI200 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/rocm-mi355 Trigger "default" config CI on ROCm MI355 runners ciflow/rocm-navi31 Trigger "default" config CI on ROCm Navi31 ciflow/slow ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end Merged module: dynamo module: inductor release notes: releng release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants