---
id: pr-pytorch-178009
repo: pytorch/pytorch
pr: 178009
title: '[MPS] fix compiling of SDPA producing nan results'
author: pytorchbot
date: '2026-03-21'
url: https://github.com/pytorch/pytorch/pull/178009
source_category: upstream-code
architectures:
- sm100
tags:
- gemm
techniques: []
hardware_features: []
kernel_types:
- gemm
languages:
- python
captured_at: '2026-04-17'
status: merged
merge_sha: db741c72097871e384b22ee6fff1d6083adf23cc
inclusion_reason: kernel file changes
changed_paths:
- c10/metal/utils.h
- test/inductor/test_mps_basic.py
- test/test_mps.py
- torch/_inductor/codegen/mps.py
head_ref_oid: 9a80dd80f3074356722d1353a916d8dafd809133
artifact_dir: evidence/pull-bundles/pytorch/gh-178009
---
# [MPS] fix compiling of SDPA producing nan results

- Repository: `pytorch/pytorch`
- PR: [178009](https://github.com/pytorch/pytorch/pull/178009)
- Decision: `kernel file changes`
- Reason: kernel file changes

## Changed Paths

- `c10/metal/utils.h`
- `test/inductor/test_mps_basic.py`
- `test/test_mps.py`
- `torch/_inductor/codegen/mps.py`

## Evidence Bundle

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