From ae231c015014133aff96159bf844602f1e7725f4 Mon Sep 17 00:00:00 2001 From: Simon Eves Date: Wed, 20 May 2026 10:34:38 -0700 Subject: [PATCH] Alternative refactor, remove MR plumbing and pass get_output_mr() or get_temp_mr() explicitly at all leaf sites --- velox/experimental/cudf/exec/CudfGroupby.cpp | 6 +- velox/experimental/cudf/exec/CudfReduce.cpp | 12 ++-- .../cudf/exec/DecimalAggregationCommon.cpp | 6 +- .../cudf/exec/DecimalAggregationKernels.cpp | 49 +++++++++------ .../cudf/exec/DecimalAggregationKernels.h | 9 +-- .../cudf/tests/DecimalAggregationTest.cpp | 61 ++++++------------- 6 files changed, 62 insertions(+), 81 deletions(-) diff --git a/velox/experimental/cudf/exec/CudfGroupby.cpp b/velox/experimental/cudf/exec/CudfGroupby.cpp index 333419b98ad..5cd5e5ddf8d 100644 --- a/velox/experimental/cudf/exec/CudfGroupby.cpp +++ b/velox/experimental/cudf/exec/CudfGroupby.cpp @@ -110,8 +110,8 @@ void addDecimalSumCountRequestsAfterDecode( uint32_t& countIdx, std::unique_ptr& decodedSum, std::unique_ptr& decodedCount) { - auto sumAndCount = cudf_velox::deserializeDecimalSumState( - encodedColumn, scale, stream, cudf_velox::get_output_mr()); + auto sumAndCount = + cudf_velox::deserializeDecimalSumState(encodedColumn, scale, stream); decodedSum.swap(sumAndCount.sum); decodedCount.swap(sumAndCount.count); @@ -190,7 +190,7 @@ void addDecimalFinalSumOnlyRequest( auto& request = requests.emplace_back(); sumIdx = requests.size() - 1; auto sumAndCount = cudf_velox::deserializeDecimalSumState( - tbl.column(inputIndex), scale, stream, cudf_velox::get_output_mr()); + tbl.column(inputIndex), scale, stream); decodedSum.swap(sumAndCount.sum); request.values = decodedSum->view(); request.aggregations.push_back( diff --git a/velox/experimental/cudf/exec/CudfReduce.cpp b/velox/experimental/cudf/exec/CudfReduce.cpp index c2a7a884115..9d4825ecd5d 100644 --- a/velox/experimental/cudf/exec/CudfReduce.cpp +++ b/velox/experimental/cudf/exec/CudfReduce.cpp @@ -279,8 +279,8 @@ std::unique_ptr intermediateDecimalMergeSerializedString( int32_t scale, rmm::cuda_stream_view stream) { auto const sumAgg = cudf::make_sum_aggregation(); - auto sumAndCount = cudf_velox::deserializeDecimalSumState( - inputCol, scale, stream, get_output_mr()); + auto sumAndCount = + cudf_velox::deserializeDecimalSumState(inputCol, scale, stream); auto sumScalar = cudf::reduce( sumAndCount.sum->view(), *sumAgg, @@ -307,8 +307,8 @@ std::unique_ptr finalDecimalAvgFromSerializedString( TypePtr const& resultType, rmm::cuda_stream_view stream) { auto const sumAgg = cudf::make_sum_aggregation(); - auto sumAndCount = cudf_velox::deserializeDecimalSumState( - inputCol, scale, stream, get_output_mr()); + auto sumAndCount = + cudf_velox::deserializeDecimalSumState(inputCol, scale, stream); auto sumScalar = cudf::reduce( sumAndCount.sum->view(), *sumAgg, @@ -387,8 +387,8 @@ std::unique_ptr reduceFinalDecimalSumFromSerializedColumn( rmm::cuda_stream_view stream) { validateIntermediateColumnType(inputCol); auto scale = getDecimalPrecisionScale(*outputType).second; - auto sumAndCount = cudf_velox::deserializeDecimalSumState( - inputCol, scale, stream, get_output_mr()); + auto sumAndCount = + cudf_velox::deserializeDecimalSumState(inputCol, scale, stream); return singleOrRawDecimalSumWithCast( sumAndCount.sum->view(), outputType, stream); } diff --git a/velox/experimental/cudf/exec/DecimalAggregationCommon.cpp b/velox/experimental/cudf/exec/DecimalAggregationCommon.cpp index adc1e6b4aea..019c17f4cff 100644 --- a/velox/experimental/cudf/exec/DecimalAggregationCommon.cpp +++ b/velox/experimental/cudf/exec/DecimalAggregationCommon.cpp @@ -50,8 +50,7 @@ std::unique_ptr serializeDecimalPartialOrIntermediateState( std::unique_ptr count, rmm::cuda_stream_view stream) { count = castCountColumnToInt64(std::move(count), stream); - return serializeDecimalSumState( - sum->view(), count->view(), stream, get_output_mr()); + return serializeDecimalSumState(sum->view(), count->view(), stream); } std::unique_ptr finalizeDecimalAverage( @@ -60,8 +59,7 @@ std::unique_ptr finalizeDecimalAverage( const TypePtr& resultType, rmm::cuda_stream_view stream) { count = castCountColumnToInt64(std::move(count), stream); - auto avgCol = computeDecimalAverage( - sum->view(), count->view(), stream, get_output_mr()); + auto avgCol = computeDecimalAverage(sum->view(), count->view(), stream); auto const cudfOutType = veloxToCudfDataType(resultType); if (avgCol->type() != cudfOutType) { avgCol = cudf::cast(avgCol->view(), cudfOutType, stream, get_output_mr()); diff --git a/velox/experimental/cudf/exec/DecimalAggregationKernels.cpp b/velox/experimental/cudf/exec/DecimalAggregationKernels.cpp index f1f131125af..fada76da009 100644 --- a/velox/experimental/cudf/exec/DecimalAggregationKernels.cpp +++ b/velox/experimental/cudf/exec/DecimalAggregationKernels.cpp @@ -16,6 +16,7 @@ #include "velox/experimental/cudf/exec/DecimalAggregationKernels.h" #include "velox/experimental/cudf/exec/DecimalAggregationKernelsGpu.h" +#include "velox/experimental/cudf/exec/GpuResources.h" #include "velox/common/base/Exceptions.h" @@ -31,8 +32,7 @@ namespace facebook::velox::cudf_velox { DecimalSumStateColumns deserializeDecimalSumState( const cudf::column_view& stateCol, int32_t scale, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) { + rmm::cuda_stream_view stream) { VELOX_CHECK( stateCol.type().id() == cudf::type_id::STRING, "Decimal sum state requires STRING/VARBINARY column (type is {})", @@ -44,12 +44,14 @@ DecimalSumStateColumns deserializeDecimalSumState( cudf::data_type{cudf::type_id::DECIMAL128, -scale}, 0, cudf::mask_state::UNALLOCATED, - stream); + stream, + get_output_mr()); empty.count = cudf::make_fixed_width_column( cudf::data_type{cudf::type_id::INT64}, 0, cudf::mask_state::UNALLOCATED, - stream); + stream, + get_output_mr()); return empty; } @@ -61,12 +63,14 @@ DecimalSumStateColumns deserializeDecimalSumState( cudf::data_type{cudf::type_id::DECIMAL128, -scale}, numRows, cudf::mask_state::ALL_NULL, - stream); + stream, + get_output_mr()); allNull.count = cudf::make_fixed_width_column( cudf::data_type{cudf::type_id::INT64}, numRows, cudf::mask_state::ALL_NULL, - stream); + stream, + get_output_mr()); return allNull; } @@ -81,12 +85,14 @@ DecimalSumStateColumns deserializeDecimalSumState( cudf::data_type{cudf::type_id::DECIMAL128, -scale}, numRows, cudf::mask_state::UNALLOCATED, - stream); + stream, + get_output_mr()); auto countCol = cudf::make_fixed_width_column( cudf::data_type{cudf::type_id::INT64}, numRows, cudf::mask_state::UNALLOCATED, - stream); + stream, + get_output_mr()); auto sumView = sumCol->mutable_view(); auto countView = countCol->mutable_view(); @@ -110,10 +116,10 @@ DecimalSumStateColumns deserializeDecimalSumState( } if (stateCol.nullable()) { - auto nullMask = cudf::copy_bitmask(stateCol, stream, mr); + auto nullMask = cudf::copy_bitmask(stateCol, stream, get_output_mr()); auto nullCount = stateCol.null_count(); sumCol->set_null_mask(std::move(nullMask), nullCount); - auto countMask = cudf::copy_bitmask(stateCol, stream, mr); + auto countMask = cudf::copy_bitmask(stateCol, stream, get_output_mr()); countCol->set_null_mask(std::move(countMask), nullCount); } @@ -126,8 +132,7 @@ DecimalSumStateColumns deserializeDecimalSumState( std::unique_ptr serializeDecimalSumState( const cudf::column_view& sumCol, const cudf::column_view& countCol, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) { + rmm::cuda_stream_view stream) { VELOX_CHECK( countCol.type().id() == cudf::type_id::INT64, "Decimal sum state requires INT64 count column (type is {})", @@ -165,11 +170,14 @@ std::unique_ptr serializeDecimalSumState( cudf::data_type{offsetsType}, numRows + 1, cudf::mask_state::UNALLOCATED, - stream); + stream, + get_output_mr()); auto offsetsView = offsetsCol->mutable_view(); rmm::device_buffer charsBuf( - static_cast(numRows) * detail::kDecimalSumStateSize, stream); + static_cast(numRows) * detail::kDecimalSumStateSize, + stream, + get_output_mr()); detail::fillOffsetsForDecimalSumState( useLargeOffsets, @@ -204,7 +212,7 @@ std::unique_ptr serializeDecimalSumState( } auto [nullMask, nullCount] = - detail::buildStateValidityMask(sumCol, countCol, stream, mr); + detail::buildStateValidityMask(sumCol, countCol, stream, get_output_mr()); return cudf::make_strings_column( static_cast(numRows), std::move(offsetsCol), @@ -216,8 +224,7 @@ std::unique_ptr serializeDecimalSumState( std::unique_ptr computeDecimalAverage( const cudf::column_view& sumCol, const cudf::column_view& countCol, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr) { + rmm::cuda_stream_view stream) { VELOX_CHECK( countCol.type().id() == cudf::type_id::INT64, "Decimal average requires INT64 count column (type is {})", @@ -236,7 +243,11 @@ std::unique_ptr computeDecimalAverage( auto numRows = sumCol.size(); auto out = cudf::make_fixed_width_column( - sumCol.type(), numRows, cudf::mask_state::UNALLOCATED, stream); + sumCol.type(), + numRows, + cudf::mask_state::UNALLOCATED, + stream, + get_output_mr()); if (numRows > 0) { auto const rowCount = static_cast(numRows); @@ -252,7 +263,7 @@ std::unique_ptr computeDecimalAverage( } auto [nullMask, nullCount] = - detail::buildStateValidityMask(sumCol, countCol, stream, mr); + detail::buildStateValidityMask(sumCol, countCol, stream, get_output_mr()); if (nullCount > 0) { out->set_null_mask(std::move(nullMask), nullCount); } diff --git a/velox/experimental/cudf/exec/DecimalAggregationKernels.h b/velox/experimental/cudf/exec/DecimalAggregationKernels.h index 3a0c6eeddba..2a31c6fc8ee 100644 --- a/velox/experimental/cudf/exec/DecimalAggregationKernels.h +++ b/velox/experimental/cudf/exec/DecimalAggregationKernels.h @@ -38,8 +38,7 @@ struct DecimalSumStateColumns { DecimalSumStateColumns deserializeDecimalSumState( const cudf::column_view& stateCol, int32_t scale, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr); + rmm::cuda_stream_view stream); // Encodes partial decimal SUM state (DECIMAL64 or DECIMAL128 sums plus // INT64 counts) into a single STRING column (later converted to Velox @@ -50,8 +49,7 @@ DecimalSumStateColumns deserializeDecimalSumState( std::unique_ptr serializeDecimalSumState( const cudf::column_view& sumCol, const cudf::column_view& countCol, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr); + rmm::cuda_stream_view stream); // Finalizes AVG from intermediate SUM state: divides each sum by its count // on device with decimal-specific rounding (see averageRoundDecimalSum), @@ -61,7 +59,6 @@ std::unique_ptr serializeDecimalSumState( std::unique_ptr computeDecimalAverage( const cudf::column_view& sumCol, const cudf::column_view& countCol, - rmm::cuda_stream_view stream, - rmm::device_async_resource_ref mr); + rmm::cuda_stream_view stream); } // namespace facebook::velox::cudf_velox diff --git a/velox/experimental/cudf/tests/DecimalAggregationTest.cpp b/velox/experimental/cudf/tests/DecimalAggregationTest.cpp index 09d9b267c3a..4688434107c 100644 --- a/velox/experimental/cudf/tests/DecimalAggregationTest.cpp +++ b/velox/experimental/cudf/tests/DecimalAggregationTest.cpp @@ -955,7 +955,6 @@ TEST_F(CudfDecimalTest, decimalSumGlobalIntermediateVarbinaryAllNulls) { TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal64) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector sums = {100, -200, 300}; std::vector counts = {1, 2, 0}; std::vector sumValid = {true, false, true}; @@ -964,9 +963,8 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal64) { auto sumCol = makeDecimalColumn(sums, 2, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 2, stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 2, stream); auto stateMask = copyNullMask(stateCol->view(), stream); auto sumMask = copyNullMask(sumAndCount.sum->view(), stream); EXPECT_EQ(stateMask, sumMask); @@ -983,7 +981,6 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal64) { TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal128) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector<__int128_t> sums = { static_cast<__int128_t>(123450), static_cast<__int128_t>(-25000), @@ -996,9 +993,8 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal128) { auto sumCol = makeDecimalColumn<__int128_t>(sums, 3, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 3, stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 3, stream); auto stateMask = copyNullMask(stateCol->view(), stream); auto sumMask = copyNullMask(sumAndCount.sum->view(), stream); EXPECT_EQ(stateMask, sumMask); @@ -1015,7 +1011,6 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateDecimal128) { TEST_F(CudfDecimalTest, decimalDeserializeSumStateAllNull) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); constexpr cudf::size_type numRows = 4; auto offsetsCol = cudf::make_fixed_width_column( @@ -1042,8 +1037,7 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateAllNull) { nullCount, std::move(nullMask)); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 2, stream, mr); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 2, stream); auto outSumView = sumAndCount.sum->view(); auto outCountView = sumAndCount.count->view(); @@ -1062,7 +1056,6 @@ TEST_F(CudfDecimalTest, decimalDeserializeSumStateAllNull) { TEST_F(CudfDecimalTest, decimalSerializeSumStateUsesInt64OffsetsWhenEnabled) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); ScopedEnvVar enableLargeStrings("LIBCUDF_LARGE_STRINGS_ENABLED", "1"); ScopedEnvVar threshold("LIBCUDF_LARGE_STRINGS_THRESHOLD", "1"); @@ -1072,7 +1065,7 @@ TEST_F(CudfDecimalTest, decimalSerializeSumStateUsesInt64OffsetsWhenEnabled) { auto sumCol = makeDecimalColumn(sums, 2, nullptr, stream); auto countCol = makeInt64Column(counts, nullptr, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); cudf::strings_column_view strings(stateCol->view()); EXPECT_EQ(strings.offsets().type().id(), cudf::type_id::INT64); @@ -1080,7 +1073,6 @@ TEST_F(CudfDecimalTest, decimalSerializeSumStateUsesInt64OffsetsWhenEnabled) { TEST_F(CudfDecimalTest, decimalSumStateRoundTripUsesInt64Offsets) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); ScopedEnvVar enableLargeStrings("LIBCUDF_LARGE_STRINGS_ENABLED", "1"); ScopedEnvVar threshold("LIBCUDF_LARGE_STRINGS_THRESHOLD", "1"); @@ -1092,13 +1084,12 @@ TEST_F(CudfDecimalTest, decimalSumStateRoundTripUsesInt64Offsets) { auto sumCol = makeDecimalColumn(sums, 2, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); cudf::strings_column_view strings(stateCol->view()); EXPECT_EQ(strings.offsets().type().id(), cudf::type_id::INT64); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 2, stream, mr); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 2, stream); auto outSumView = sumAndCount.sum->view(); auto outCountView = sumAndCount.count->view(); auto outSum = copyColumnData<__int128_t>(outSumView, stream); @@ -1123,7 +1114,6 @@ TEST_F(CudfDecimalTest, decimalSumStateRoundTripUsesInt64Offsets) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector sums = {100, 105, 250, -125}; std::vector counts = {4, 2, 0, 2}; std::vector sumValid = {true, true, true, true}; @@ -1131,8 +1121,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64) { auto sumCol = makeDecimalColumn(sums, 2, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); auto avgMask = copyNullMask(avgCol->view(), stream); auto outAvg = copyColumnData(avgCol->view(), stream); @@ -1156,7 +1145,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector<__int128_t> sums = { static_cast<__int128_t>(123450), static_cast<__int128_t>(-25000), @@ -1168,8 +1156,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128) { auto sumCol = makeDecimalColumn<__int128_t>(sums, 3, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); auto avgMask = copyNullMask(avgCol->view(), stream); auto outAvg = copyColumnData<__int128_t>(avgCol->view(), stream); @@ -1193,7 +1180,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64AllValid) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector sums = {100, 200, -150}; std::vector counts = {4, 5, 3}; std::vector sumValid = {true, true, true}; @@ -1201,8 +1187,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64AllValid) { auto sumCol = makeDecimalColumn(sums, 2, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); EXPECT_EQ(avgCol->view().null_count(), 0); auto avgMask = copyNullMask(avgCol->view(), stream); @@ -1226,7 +1211,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64AllValid) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128AllValid) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector<__int128_t> sums = { static_cast<__int128_t>(90000), static_cast<__int128_t>(-5000), @@ -1238,8 +1222,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128AllValid) { auto sumCol = makeDecimalColumn<__int128_t>(sums, 3, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); EXPECT_EQ(avgCol->view().null_count(), 0); auto avgMask = copyNullMask(avgCol->view(), stream); @@ -1263,7 +1246,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128AllValid) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64NonNullableInputs) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector sums = {80, -40, 1000}; std::vector counts = {2, 4, 10}; @@ -1272,8 +1254,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64NonNullableInputs) { ASSERT_FALSE(sumCol->nullable()); ASSERT_FALSE(countCol->nullable()); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); EXPECT_EQ(avgCol->view().null_count(), 0); auto avgMask = copyNullMask(avgCol->view(), stream); @@ -1297,7 +1278,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal64NonNullableInputs) { TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128NonNullableInputs) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector<__int128_t> sums = { static_cast<__int128_t>(600), static_cast<__int128_t>(-99), @@ -1309,8 +1289,7 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128NonNullableInputs) { ASSERT_FALSE(sumCol->nullable()); ASSERT_FALSE(countCol->nullable()); - auto avgCol = - computeDecimalAverage(sumCol->view(), countCol->view(), stream, mr); + auto avgCol = computeDecimalAverage(sumCol->view(), countCol->view(), stream); EXPECT_EQ(avgCol->view().null_count(), 0); auto avgMask = copyNullMask(avgCol->view(), stream); @@ -1334,7 +1313,6 @@ TEST_F(CudfDecimalTest, decimalComputeAverageDecimal128NonNullableInputs) { TEST_F(CudfDecimalTest, decimalSumStateRoundTripDecimal64) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector sums = {100, -200, 300, 400}; std::vector counts = {1, 0, 2, 3}; std::vector sumValid = {true, true, false, true}; @@ -1343,11 +1321,10 @@ TEST_F(CudfDecimalTest, decimalSumStateRoundTripDecimal64) { auto sumCol = makeDecimalColumn(sums, 2, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); auto stateMask = copyNullMask(stateCol->view(), stream); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 2, stream, mr); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 2, stream); auto outSumView = sumAndCount.sum->view(); auto outCountView = sumAndCount.count->view(); auto outSum = copyColumnData<__int128_t>(outSumView, stream); @@ -1370,7 +1347,6 @@ TEST_F(CudfDecimalTest, decimalSumStateRoundTripDecimal64) { TEST_F(CudfDecimalTest, decimalSumStateRoundTripDecimal128) { auto stream = cudf::get_default_stream(); - auto mr = cudf::get_current_device_resource_ref(); std::vector<__int128_t> sums = { static_cast<__int128_t>(123450), static_cast<__int128_t>(-25000), @@ -1383,11 +1359,10 @@ TEST_F(CudfDecimalTest, decimalSumStateRoundTripDecimal128) { auto sumCol = makeDecimalColumn<__int128_t>(sums, 3, &sumValid, stream); auto countCol = makeInt64Column(counts, &countValid, stream); auto stateCol = - serializeDecimalSumState(sumCol->view(), countCol->view(), stream, mr); + serializeDecimalSumState(sumCol->view(), countCol->view(), stream); auto stateMask = copyNullMask(stateCol->view(), stream); - auto sumAndCount = - deserializeDecimalSumState(stateCol->view(), 3, stream, mr); + auto sumAndCount = deserializeDecimalSumState(stateCol->view(), 3, stream); auto outSumView = sumAndCount.sum->view(); auto outCountView = sumAndCount.count->view(); auto outSum = copyColumnData<__int128_t>(outSumView, stream);