Skip to content

Commit

Permalink
Merge branch 'branch-23.12' into stream-nvtext-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Oct 30, 2023
2 parents f9a0f03 + abc0d41 commit 6346843
Show file tree
Hide file tree
Showing 40 changed files with 811 additions and 264 deletions.
2 changes: 1 addition & 1 deletion ci/test_python_other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pytest \
--cov=dask_cudf \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/dask-cudf-coverage.xml" \
--cov-report=term \
tests
.
popd

rapids-logger "pytest custreamz"
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- c-compiler
- cachetools
- cmake>=3.26.4
- cramjam
- cubinlinker
- cuda-nvtx=11.8
- cuda-python>=11.7.1,<12.0a0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- c-compiler
- cachetools
- cmake>=3.26.4
- cramjam
- cuda-cudart-dev
- cuda-gdb
- cuda-nvcc
Expand Down
1 change: 1 addition & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ ConfigureNVBench(HASHING_NVBENCH hashing/hash.cpp)
# ##################################################################################################
# * merge benchmark -------------------------------------------------------------------------------
ConfigureBench(MERGE_BENCH merge/merge.cpp)
ConfigureNVBench(MERGE_NVBENCH merge/merge_structs.cpp merge/merge_lists.cpp)

# ##################################################################################################
# * null_mask benchmark ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include <benchmarks/common/generate_input.hpp>
#include "generate_input.hpp"

#include <cudf_test/column_wrapper.hpp>

Expand Down
54 changes: 54 additions & 0 deletions cpp/benchmarks/merge/merge_lists.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* 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 <benchmarks/common/generate_nested_types.hpp>

#include <cudf/detail/merge.hpp>
#include <cudf/detail/sorting.hpp>

#include <nvbench/nvbench.cuh>

void nvbench_merge_list(nvbench::state& state)
{
rmm::cuda_stream_view stream;

auto const input1 = create_lists_data(state);
auto const sorted_input1 =
cudf::detail::sort(*input1, {}, {}, stream, rmm::mr::get_current_device_resource());

auto const input2 = create_lists_data(state);
auto const sorted_input2 =
cudf::detail::sort(*input2, {}, {}, stream, rmm::mr::get_current_device_resource());

stream.synchronize();

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
rmm::cuda_stream_view stream_view{launch.get_stream()};

cudf::detail::merge({*sorted_input1, *sorted_input2},
{0},
{cudf::order::ASCENDING},
{},
stream_view,
rmm::mr::get_current_device_resource());
});
}

NVBENCH_BENCH(nvbench_merge_list)
.set_name("merge_lists")
.add_int64_power_of_two_axis("size_bytes", {10, 18, 24, 28})
.add_int64_axis("depth", {1, 4})
.add_float64_axis("null_frequency", {0, 0.2});
54 changes: 54 additions & 0 deletions cpp/benchmarks/merge/merge_structs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* 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 <benchmarks/common/generate_nested_types.hpp>

#include <cudf/detail/merge.hpp>
#include <cudf/detail/sorting.hpp>

#include <nvbench/nvbench.cuh>

void nvbench_merge_struct(nvbench::state& state)
{
rmm::cuda_stream_view stream;

auto const input1 = create_structs_data(state);
auto const sorted_input1 =
cudf::detail::sort(*input1, {}, {}, stream, rmm::mr::get_current_device_resource());

auto const input2 = create_structs_data(state);
auto const sorted_input2 =
cudf::detail::sort(*input2, {}, {}, stream, rmm::mr::get_current_device_resource());

stream.synchronize();

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
rmm::cuda_stream_view stream_view{launch.get_stream()};

cudf::detail::merge({*sorted_input1, *sorted_input2},
{0},
{cudf::order::ASCENDING},
{},
stream_view,
rmm::mr::get_current_device_resource());
});
}

NVBENCH_BENCH(nvbench_merge_struct)
.set_name("merge_struct")
.add_int64_power_of_two_axis("NumRows", {10, 18, 26})
.add_int64_axis("Depth", {0, 1, 8})
.add_int64_axis("Nulls", {0, 1});
3 changes: 2 additions & 1 deletion cpp/benchmarks/sort/rank_lists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

#include "nested_types_common.hpp"
#include "rank_types_common.hpp"

#include <benchmarks/common/generate_nested_types.hpp>

#include <cudf/sorting.hpp>

#include <cudf_test/column_utilities.hpp>
Expand Down
2 changes: 1 addition & 1 deletion cpp/benchmarks/sort/rank_structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "nested_types_common.hpp"
#include "rank_types_common.hpp"
#include <benchmarks/common/generate_nested_types.hpp>

#include <cudf/sorting.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/benchmarks/sort/sort_lists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "nested_types_common.hpp"
#include <benchmarks/common/generate_nested_types.hpp>

#include <cudf/detail/sorting.hpp>

Expand Down
2 changes: 1 addition & 1 deletion cpp/benchmarks/sort/sort_structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "nested_types_common.hpp"
#include <benchmarks/common/generate_nested_types.hpp>

#include <cudf/detail/sorting.hpp>

Expand Down
13 changes: 13 additions & 0 deletions cpp/include/cudf/detail/interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,18 @@ std::unique_ptr<table> from_arrow(arrow::Table const& input_table,
std::unique_ptr<cudf::scalar> from_arrow(arrow::Scalar const& input,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);

/**
* @brief Return a maximum precision for a given type.
*
* @tparam T the type to get the maximum precision for
*/
template <typename T>
constexpr std::size_t max_precision()
{
auto constexpr num_bits = sizeof(T) * 8;
return std::floor(num_bits * std::log(2) / std::log(10));
}

} // namespace detail
} // namespace cudf
166 changes: 0 additions & 166 deletions cpp/include/cudf/detail/merge.cuh

This file was deleted.

Loading

0 comments on commit 6346843

Please sign in to comment.