Destroy RTCX cache before teardown - #22843
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR fixes the ChangesJIT Cache Teardown Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/ok to test 750f97e |
|
/ok to test 9bd96e2 |
| namespace { | ||
|
|
||
| void run_jit_compute_column() | ||
| { | ||
| auto c_0 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{3, 20, 1, 50}; | ||
| auto c_1 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{10, 7, 20, 0}; | ||
| auto table = cudf::table_view{{c_0, c_1}}; | ||
| auto col_ref_0 = cudf::ast::column_reference(0); | ||
| auto col_ref_1 = cudf::ast::column_reference(1); | ||
| auto expression = cudf::ast::operation(cudf::ast::ast_operator::ADD, col_ref_0, col_ref_1); | ||
|
|
||
| auto result = cudf::compute_column_jit(table, expression); | ||
| EXPECT_EQ(result->size(), cudf::size_type{4}); | ||
| } | ||
|
|
||
| } // namespace |
There was a problem hiding this comment.
| namespace { | |
| void run_jit_compute_column() | |
| { | |
| auto c_0 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{3, 20, 1, 50}; | |
| auto c_1 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{10, 7, 20, 0}; | |
| auto table = cudf::table_view{{c_0, c_1}}; | |
| auto col_ref_0 = cudf::ast::column_reference(0); | |
| auto col_ref_1 = cudf::ast::column_reference(1); | |
| auto expression = cudf::ast::operation(cudf::ast::ast_operator::ADD, col_ref_0, col_ref_1); | |
| auto result = cudf::compute_column_jit(table, expression); | |
| EXPECT_EQ(result->size(), cudf::size_type{4}); | |
| } | |
| } // namespace |
| TEST_F(ContextTest, TeardownAfterJitCacheUse) | ||
| { | ||
| cudf::initialize(cudf::init_flags::INIT_JIT_CACHE); | ||
| ASSERT_NO_THROW(run_jit_compute_column()); | ||
| EXPECT_NO_THROW(cudf::teardown()); | ||
|
|
||
| cudf::initialize(cudf::init_flags::INIT_JIT_CACHE); | ||
| ASSERT_NO_THROW(run_jit_compute_column()); | ||
| EXPECT_NO_THROW(cudf::teardown()); | ||
| } | ||
|
|
There was a problem hiding this comment.
TEST_F(ContextTest, TeardownAfterJitCacheUse)
{
auto compute_column= []{
auto c_0 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{3, 20, 1, 50};
auto c_1 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{10, 7, 20, 0};
auto table = cudf::table_view{{c_0, c_1}};
auto col_ref_0 = cudf::ast::column_reference(0);
auto col_ref_1 = cudf::ast::column_reference(1);
auto expression = cudf::ast::operation(cudf::ast::ast_operator::ADD, col_ref_0, col_ref_1);
auto result = cudf::compute_column_jit(table, expression);
EXPECT_EQ(result->size(), cudf::size_type{4});
};
cudf::initialize(cudf::init_flags::INIT_JIT_CACHE);
ASSERT_NO_THROW(compute_column());
EXPECT_NO_THROW(cudf::teardown());
cudf::initialize(cudf::init_flags::INIT_JIT_CACHE);
ASSERT_NO_THROW(compute_column());
EXPECT_NO_THROW(cudf::teardown());
}
|
@fallintoplace can you address the open requests? Then this PR should be good to go. |
|
/ok to test 62246a0 |
|
/merge |
|
/ok to test a96996d |
| BreakStringLiterals: true | ||
| ColumnLimit: 100 | ||
| CommentPragmas: '^ IWYU pragma:' | ||
| CommentPragmas: '(IWYU pragma:|SPDX-)' |
There was a problem hiding this comment.
Similar to #22118 (comment) but for clang-format. We'll address this in more detail next week.
Summary
rtcx::teardown().compute_column, tears down, reinitializes, and repeats.Details
rtcx::cache_tcan retain cachedrtcx::libraryobjects whose destructor unloads the CUDA library through RTCX driver handles. The context destructor previously calledrtcx::teardown()in the destructor body, before memberunique_ptrs were destroyed, so cached libraries could be released after RTCX reset those handles.This makes the teardown order explicit: JIT-owned state is destroyed first, then RTCX global state is reset.
Validation
pre-commit run --files cpp/src/runtime/context.cpp cpp/tests/utilities_tests/context_tests.cppgit diff --checkLocal
UTILITIES_TESTwas not run because this checkout does not have a configuredcpp/build/CMake build tree.