Skip to content

Commit 117f11a

Browse files
eqypytorchmergebot
authored andcommitted
[FlexAttention][TF32] Handle uninitialized torch.backends.cuda.matmul.fp32_precision (pytorch#161102)
For pytorch#161022 The warning says the old API will be deprecated in 2.9+ anyway, leaving it up to the author of pytorch#125888 to decide on initialization behavior then Pull Request resolved: pytorch#161102 Approved by: https://github.com/ngimel, https://github.com/drisspg, https://github.com/BoyuanFeng
1 parent a154c20 commit 117f11a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/_inductor/kernel/flex/flex_attention.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def flex_attention_grid(batch_size, q_heads, num_queries, d_model, meta, *, cdiv
5454
def get_float32_precision():
5555
if (
5656
torch.backends.cuda.matmul.fp32_precision == "ieee"
57+
if torch.backends.cuda.matmul.fp32_precision != "none"
58+
else torch.get_float32_matmul_precision() == "highest"
5759
or torch.version.hip
5860
or torch.mtia.is_available()
5961
):

0 commit comments

Comments
 (0)