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

Skip async mr tests when cuda runtime/driver < 11.2 #986

Merged
merged 8 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else

gpuci_logger "Running googletests"
# run gtests from librmm_tests package
for gt in "$CONDA_PREFIX/bin/gtests/librmm/*" ; do
for gt in "$CONDA_PREFIX/bin/gtests/librmm/"* ; do
${gt} --gtest_output=xml:${TESTRESULTS_DIR}/
exitcode=$?
if (( ${exitcode} != 0 )); then
Expand Down
23 changes: 19 additions & 4 deletions tests/mr/device/cuda_async_mr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,22 @@ namespace {

using cuda_async_mr = rmm::mr::cuda_async_memory_resource;

TEST(AsyncMRTest, ThrowIfNotSupported)
class AsyncMRTest : public ::testing::Test {
protected:
void SetUp() override
{
int runtime_version{};
RMM_CUDA_TRY(cudaRuntimeGetVersion(&runtime_version));
int driver_version{};
RMM_CUDA_TRY(cudaDriverGetVersion(&driver_version));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
int driver_version{};
RMM_CUDA_TRY(cudaDriverGetVersion(&driver_version));
int driver_supports_pool;
RMM_CUDA_TRY(cudaDeviceGetAttribute(&driver_supports_pool, cudaDevAttrMemoryPoolsSupported);

Copy link
Contributor

Choose a reason for hiding this comment

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

This is also needed here:

inline auto make_arena()
{
return rmm::mr::make_owning_wrapper<rmm::mr::arena_memory_resource>(make_cuda());
}

We should wrap this logic in a function like is_cuda_pool_available.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe static bool cuda_async_memory_resource::is_supported(). Then use this in the cuda_async_mr ctor as well as here in the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get a symbol not found error if I use cudaDevAttrMemoryPoolsSupported with cuda 11.0.

Copy link
Member

Choose a reason for hiding this comment

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

Well you still have to guard it just like in the ctor using the flag we already have. The problem we are solving isn't compiling with cuda 11.0. It's compiling with 11.2+ and running on <11.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

constexpr int min_async_version = 11020;
if (runtime_version < min_async_version || driver_version < min_async_version) {
GTEST_SKIP() << "Skipping tests since cudaMallocAsync not supported by runtime/driver";
}
}
};

TEST_F(AsyncMRTest, ThrowIfNotSupported)
{
auto construct_mr = []() { cuda_async_mr mr; };
#ifndef RMM_CUDA_MALLOC_ASYNC_SUPPORT
Expand All @@ -35,7 +50,7 @@ TEST(AsyncMRTest, ThrowIfNotSupported)
}

#if defined(RMM_CUDA_MALLOC_ASYNC_SUPPORT)
TEST(AsyncMRTest, ExplicitInitialPoolSize)
TEST_F(AsyncMRTest, ExplicitInitialPoolSize)
{
const auto pool_init_size{100};
cuda_async_mr mr{pool_init_size};
Expand All @@ -44,7 +59,7 @@ TEST(AsyncMRTest, ExplicitInitialPoolSize)
RMM_CUDA_TRY(cudaDeviceSynchronize());
}

TEST(AsyncMRTest, ExplicitReleaseThreshold)
TEST_F(AsyncMRTest, ExplicitReleaseThreshold)
{
const auto pool_init_size{100};
const auto pool_release_threshold{1000};
Expand All @@ -54,7 +69,7 @@ TEST(AsyncMRTest, ExplicitReleaseThreshold)
RMM_CUDA_TRY(cudaDeviceSynchronize());
}

TEST(AsyncMRTest, DifferentPoolsUnequal)
TEST_F(AsyncMRTest, DifferentPoolsUnequal)
{
const auto pool_init_size{100};
const auto pool_release_threshold{1000};
Expand Down