From bf54e16546da3d608a6bc6f5c52d4d00b8eb3d97 Mon Sep 17 00:00:00 2001 From: Bryan Bowyer Date: Fri, 19 Sep 2025 11:53:15 -0700 Subject: [PATCH] Add backward compatibility for TensorDescriptor This commits adds a guard around tensor_descriptor import in warp spec for backward compatibility Signed-off-by: Bryan Bowyer --- tritonbench/operators/gemm/warp_spec_persistent_matmul.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tritonbench/operators/gemm/warp_spec_persistent_matmul.py b/tritonbench/operators/gemm/warp_spec_persistent_matmul.py index b97682c34..d04e3a29a 100644 --- a/tritonbench/operators/gemm/warp_spec_persistent_matmul.py +++ b/tritonbench/operators/gemm/warp_spec_persistent_matmul.py @@ -9,7 +9,13 @@ import torch import triton import triton.language as tl -from triton.tools.tensor_descriptor import TensorDescriptor + +# Conditional import for TensorDescriptor - only available in newer Triton versions +try: + from triton.tools.tensor_descriptor import TensorDescriptor +except ModuleNotFoundError: + TensorDescriptor = None + # TODO: Add proton support