Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ptx_compilation_test failure on H100 #17245

Merged
merged 1 commit into from
Sep 17, 2024
Merged
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
21 changes: 17 additions & 4 deletions xla/service/gpu/ptx_compilation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ class NVPTXCompilationTests
debug_options->set_xla_llvm_force_inline_before_split(false);
}

DebugOptions GetDebugOptionsForTest() override {
auto debug_options = HloTestBase::GetDebugOptionsForTest();
debug_options.set_xla_gpu_autotune_level(0);
return debug_options;
}

void SetUp() override {
HloTestBase::SetUp();
std::string_view name = std::get<0>(GetParam());
Expand Down Expand Up @@ -283,10 +289,17 @@ TEST_P(NVPTXCompilationTests, CompareBinaryOutput) {
absl::StatusOr<std::unique_ptr<Executable>> executable =
compile(compilation_method, linking_method);

constexpr PtxLinkingMethod kReferenceLinkingMethod =
PtxLinkingMethod::kNvJitLink;
// Binaries produced in a separate linking step differ from binaries produced
// with combined compilation/linking. Therefore we only enable linking in the
// reference build when the build under test also uses a separate linking
// step.
const PtxLinkingMethod reference_linking_method =
(linking_method == PtxLinkingMethod::kNone)
? PtxLinkingMethod::kNone
: PtxLinkingMethod::kNvJitLink;

absl::StatusOr<std::unique_ptr<Executable>> reference =
compile(PtxCompilationMethod::kPtxas, kReferenceLinkingMethod);
compile(PtxCompilationMethod::kPtxas, reference_linking_method);

EXPECT_THAT(executable, tsl::testing::IsOkAndHolds(::testing::NotNull()));
EXPECT_THAT(reference, tsl::testing::IsOkAndHolds(::testing::NotNull()));
Expand Down Expand Up @@ -349,7 +362,7 @@ TEST_P(NVPTXCompilationTests, CompareBinaryOutput) {
TF_ASSERT_OK_AND_ASSIGN(auto reference_text_sections,
get_text_sections(reference_binary));

if (linking_method == kReferenceLinkingMethod) {
if (linking_method == reference_linking_method) {
EXPECT_THAT(executable_text_sections,
::testing::Eq(reference_text_sections));
return;
Expand Down
Loading