---
id: pr-pytorch-128539
repo: pytorch/pytorch
pr: 128539
title: Revert "[cuDNN][SDPA] Remove `TORCH_CUDNN_SDPA_ENABLED=1`, enable cuDNN SDPA by default on H100 and 2nd on other archs >= sm80 (#125343)"
author: atalman
date: '2024-06-19'
url: https://github.com/pytorch/pytorch/pull/128539
source_category: upstream-code
architectures:
- sm100
tags: []
techniques: []
hardware_features: []
kernel_types: []
languages: []
captured_at: '2026-05-16'
status: merged
merge_sha: 459e2aa454a9938d2e2c75ea4f74cb7c8d5b57bf
inclusion_reason: defer
changed_paths:
- aten/src/ATen/Context.h
- aten/src/ATen/native/cudnn/MHA.cpp
- aten/src/ATen/native/native_functions.yaml
- aten/src/ATen/native/transformers/attention.cpp
- aten/src/ATen/native/transformers/cuda/attention.cu
- aten/src/ATen/native/transformers/cuda/attention_backward.cu
- aten/src/ATen/native/transformers/cuda/sdp_utils.cpp
- aten/src/ATen/native/transformers/sdp_utils_cpp.h
- docs/source/backends.rst
- test/test_flop_counter.py
- test/test_transformers.py
- tools/autograd/derivatives.yaml
- torch/_C/__init__.pyi.in
- torch/backends/cuda/__init__.py
- torch/csrc/Module.cpp
- torch/testing/_internal/common_cuda.py
- torch/utils/flop_counter.py
artifact_dir: evidence/pull-bundles/pytorch/gh-128539
head_ref_oid: 8f267de80a6e95c45139a8e20b9f2d7b8f535cad
---
# Revert "[cuDNN][SDPA] Remove `TORCH_CUDNN_SDPA_ENABLED=1`, enable cuDNN SDPA by default on H100 and 2nd on other archs >= sm80 (#125343)"

- Repository: `pytorch/pytorch`
- PR: [128539](https://github.com/pytorch/pytorch/pull/128539)
- Decision: `defer`
- Reason: defer

## Changed Paths

- `aten/src/ATen/Context.h`
- `aten/src/ATen/native/cudnn/MHA.cpp`
- `aten/src/ATen/native/native_functions.yaml`
- `aten/src/ATen/native/transformers/attention.cpp`
- `aten/src/ATen/native/transformers/cuda/attention.cu`
- `aten/src/ATen/native/transformers/cuda/attention_backward.cu`
- `aten/src/ATen/native/transformers/cuda/sdp_utils.cpp`
- `aten/src/ATen/native/transformers/sdp_utils_cpp.h`
- `docs/source/backends.rst`
- `test/test_flop_counter.py`
- `test/test_transformers.py`
- `tools/autograd/derivatives.yaml`
- `torch/_C/__init__.pyi.in`
- `torch/backends/cuda/__init__.py`
- `torch/csrc/Module.cpp`
- `torch/testing/_internal/common_cuda.py`
- `torch/utils/flop_counter.py`

## Evidence Bundle

`evidence/pull-bundles/pytorch/gh-128539`
