-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable libnvjitlink by default in OSS
The hermetic CUDA change gained us nvjitlink support, so we can now enable if by default. But since there is a memory leak in CUDA SDK 12.4 and below we only enable it by default for later versions. Users will still be able to force-enable it through the flag. I'm also adding the missing tsl::Flag to DebugOptionsFlag. Without that the debug option couldn't be changed on the command line. PiperOrigin-RevId: 696405923
- Loading branch information
1 parent
dde3c51
commit 27b4c50
Showing
10 changed files
with
195 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* Copyright 2024 The OpenXLA Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
#include "xla/stream_executor/cuda/nvjitlink_known_issues.h" | ||
|
||
#include "xla/stream_executor/cuda/nvjitlink.h" | ||
|
||
namespace stream_executor { | ||
|
||
bool LoadedNvJitLinkHasKnownIssues() { | ||
// There is a memory leak in libnvjitlink from version 12.0 to 12.4. | ||
// The memory leak was fixed in CUDA Toolkit 12.4 Update 1, but we can't | ||
// distinguish between NvJitLink coming from CUDA Toolkit 12.4 and 12.4 | ||
// Update 1. Therefore we only return true for 12.5 and higher to be on the | ||
// safe side. | ||
constexpr NvJitLinkVersion kMinVersionWithoutKnownIssues{12, 5}; | ||
|
||
// Note that this needs to be a runtime version test because we load | ||
// LibNvJitLink as a dynamic library and the version might vary and not be the | ||
// same that we saw at compile time. | ||
return GetNvJitLinkVersion().value_or(NvJitLinkVersion{0, 0}) >= | ||
kMinVersionWithoutKnownIssues; | ||
} | ||
|
||
} // namespace stream_executor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright 2024 The OpenXLA Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
#ifndef XLA_STREAM_EXECUTOR_CUDA_NVJITLINK_KNOWN_ISSUES_H_ | ||
#define XLA_STREAM_EXECUTOR_CUDA_NVJITLINK_KNOWN_ISSUES_H_ | ||
|
||
namespace stream_executor { | ||
|
||
// Returns true if the loaded NvJitLink library is known to have bugs and | ||
// shouldn't be used unconditionally. Returns false otherwise - also returns | ||
// false if NvJitLink is not available. | ||
bool LoadedNvJitLinkHasKnownIssues(); | ||
|
||
} // namespace stream_executor | ||
|
||
#endif // XLA_STREAM_EXECUTOR_CUDA_NVJITLINK_KNOWN_ISSUES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* Copyright 2024 The OpenXLA Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
#include "xla/stream_executor/cuda/nvjitlink_known_issues.h" | ||
|
||
#include <gtest/gtest.h> | ||
#include "xla/stream_executor/cuda/nvjitlink_support.h" | ||
#include "tsl/platform/test.h" | ||
|
||
namespace { | ||
|
||
TEST(NvJitLinkKnownIssuesTest, ReturnsFalseWhenNvJitLinkIsNotAvailable) { | ||
if (stream_executor::IsLibNvJitLinkSupported()) { | ||
GTEST_SKIP(); | ||
} | ||
// This is the only invariance we can test without writing a pointless change | ||
// detector test. | ||
EXPECT_FALSE(stream_executor::LoadedNvJitLinkHasKnownIssues()); | ||
} | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters