Skip to content

Commit

Permalink
Disable nanobind leak checker in cuda/versions module.
Browse files Browse the repository at this point in the history
The leak checker appears to be sensitive to the destruction order during Python shutdown.

PiperOrigin-RevId: 568962933
  • Loading branch information
hawkinsp authored and jax authors committed Sep 27, 2023
1 parent 07fa9dc commit 5384561
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jaxlib/cuda/versions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ limitations under the License.
namespace jax::cuda {
namespace {

namespace nb = nanobind;

int CudaRuntimeGetVersion() {
int version;
JAX_THROW_IF_ERROR(JAX_AS_STATUS(cudaRuntimeGetVersion(&version)));
Expand Down Expand Up @@ -51,6 +53,10 @@ int CusolverGetVersion() {
}

NB_MODULE(_versions, m) {
// Nanobind's leak checking sometimes returns false positives for this file.
// The problem appears related to forming a closure of a nanobind function.
nb::set_leak_warnings(false);

// Build versions, i.e., what version of the headers was JAX compiled against?
m.def("cuda_runtime_build_version", []() { return CUDART_VERSION; });
m.def("cudnn_build_version", []() { return CUDNN_VERSION; });
Expand Down

0 comments on commit 5384561

Please sign in to comment.