From 91311c8aeabc20dc8af891c7204a7ea8d4c2b90a Mon Sep 17 00:00:00 2001 From: andrewwhitecdw Date: Wed, 12 Aug 2026 15:03:12 -0500 Subject: [PATCH 1/2] fix: add missing NVTE_BHSD to qkv format to_string Squashed to single commit for review. Original PR: https://github.com/andrewwhitecdw/TransformerEngine/pull/16 --- tests/test_qkv_format_to_string.cpp | 15 +++++++++++++++ .../common/fused_attn/fused_attn.cpp | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 tests/test_qkv_format_to_string.cpp diff --git a/tests/test_qkv_format_to_string.cpp b/tests/test_qkv_format_to_string.cpp new file mode 100644 index 0000000000..1021fbdb3b --- /dev/null +++ b/tests/test_qkv_format_to_string.cpp @@ -0,0 +1,15 @@ +/************************************************************************* + * Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * + * See LICENSE for license information. + ************************************************************************/ + +#include +#include + +#include "transformer_engine/fused_attn.h" + +TEST(QKVFormatToString, BHSD) { + EXPECT_EQ(transformer_engine::to_string(NVTE_QKV_Format::NVTE_BHSD), "NVTE_BHSD"); +} + diff --git a/transformer_engine/common/fused_attn/fused_attn.cpp b/transformer_engine/common/fused_attn/fused_attn.cpp index 1ac7a36383..307b3c5ec6 100644 --- a/transformer_engine/common/fused_attn/fused_attn.cpp +++ b/transformer_engine/common/fused_attn/fused_attn.cpp @@ -79,6 +79,8 @@ std::string to_string(NVTE_QKV_Format format) { return "NVTE_SBHD"; case NVTE_BSHD: return "NVTE_BSHD"; + case NVTE_BHSD: + return "NVTE_BHSD"; case NVTE_THD: return "NVTE_THD"; case NVTE_BSHD_2SBHD: From 370bcf9f46809600f9f48a8bd3427c417a72e1d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 00:10:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_qkv_format_to_string.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_qkv_format_to_string.cpp b/tests/test_qkv_format_to_string.cpp index 1021fbdb3b..bc6656f091 100644 --- a/tests/test_qkv_format_to_string.cpp +++ b/tests/test_qkv_format_to_string.cpp @@ -12,4 +12,3 @@ TEST(QKVFormatToString, BHSD) { EXPECT_EQ(transformer_engine::to_string(NVTE_QKV_Format::NVTE_BHSD), "NVTE_BHSD"); } -