Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/test_qkv_format_to_string.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*************************************************************************
* Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* See LICENSE for license information.
************************************************************************/

#include <gtest/gtest.h>
#include <string>

#include "transformer_engine/fused_attn.h"

TEST(QKVFormatToString, BHSD) {
EXPECT_EQ(transformer_engine::to_string(NVTE_QKV_Format::NVTE_BHSD), "NVTE_BHSD");
}
Comment on lines +12 to +14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Regression test is not built

This file is outside the tests/cpp CMake project, whose test targets use explicit source lists, so CI never compiles or executes this assertion and the new mapping receives no regression coverage.

Knowledge Base Used: Tests and QA

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test can be removed - the addition of BHSD in the enum is a pretty obvious change and it won't make any tests fail. Also, the test probably can't compile (and it should be in the tests/cpp folder as well if we wanted to add this CPP test). Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — the change itself is straightforward and self-evident. Removing the test file is the right call, especially since it wouldn't compile as-is and belongs in tests/cpp if it were to be kept. Thanks for the clarification!

2 changes: 2 additions & 0 deletions transformer_engine/common/fused_attn/fused_attn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down