Skip to content

Commit 9d6a4ca

Browse files
committed
Merge branch 'main' into lingyany/glushkov-nfa
2 parents 7ae1f3c + cb6d5f5 commit 9d6a4ca

54 files changed

Lines changed: 2381 additions & 509 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ dependencies:
1717
- cmake>=4.0
1818
- cramjam
1919
- croaring==4.4.2
20+
- cuda-bindings>=12.9.2,<13.0
2021
- cuda-cudart-dev
2122
- cuda-cupti-dev
2223
- cuda-nvcc
2324
- cuda-nvrtc-dev
2425
- cuda-nvtx-dev
25-
- cuda-python>=12.9.2,<13.0
2626
- cuda-sanitizer-api
2727
- cuda-version=12.9
2828
- cupy>=14.0.1,!=14.1.0

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ dependencies:
1717
- cmake>=4.0
1818
- cramjam
1919
- croaring==4.4.2
20+
- cuda-bindings>=12.9.2,<13.0
2021
- cuda-cudart-dev
2122
- cuda-cupti-dev
2223
- cuda-nvcc
2324
- cuda-nvrtc-dev
2425
- cuda-nvtx-dev
25-
- cuda-python>=12.9.2,<13.0
2626
- cuda-sanitizer-api
2727
- cuda-version=12.9
2828
- cupy>=14.0.1,!=14.1.0

conda/environments/all_cuda-133_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ dependencies:
1717
- cmake>=4.0
1818
- cramjam
1919
- croaring==4.4.2
20+
- cuda-bindings>=13.0.1,<14.0
2021
- cuda-cudart-dev
2122
- cuda-cupti-dev
2223
- cuda-nvcc
2324
- cuda-nvrtc-dev
2425
- cuda-nvtx-dev
25-
- cuda-python>=13.0.1,<14.0
2626
- cuda-sanitizer-api
2727
- cuda-version=13.3
2828
- cupy>=14.0.1,!=14.1.0

conda/environments/all_cuda-133_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ dependencies:
1717
- cmake>=4.0
1818
- cramjam
1919
- croaring==4.4.2
20+
- cuda-bindings>=13.0.1,<14.0
2021
- cuda-cudart-dev
2122
- cuda-cupti-dev
2223
- cuda-nvcc
2324
- cuda-nvrtc-dev
2425
- cuda-nvtx-dev
25-
- cuda-python>=13.0.1,<14.0
2626
- cuda-sanitizer-api
2727
- cuda-version=13.3
2828
- cupy>=14.0.1,!=14.1.0

conda/recipes/cudf-polars/recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ requirements:
4242
- packaging
4343
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
4444
- if: cuda_major == "12"
45-
then: cuda-python >=12.9.2,<13.0
46-
else: cuda-python >=13.0.1,<14.0
45+
then: cuda-bindings >=12.9.2,<13.0
46+
else: cuda-bindings >=13.0.1,<14.0
4747
run_constraints:
4848
- ray-default >=2.55.1
4949
ignore_run_exports:

conda/recipes/cudf/recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ requirements:
102102
- ${{ pin_compatible("rmm", upper_bound="x.x") }}
103103
- fsspec >=0.6.0
104104
- if: cuda_major == "12"
105-
then: cuda-python >=12.9.2,<13.0
106-
else: cuda-python >=13.0.1,<14.0
105+
then: cuda-bindings >=12.9.2,<13.0
106+
else: cuda-bindings >=13.0.1,<14.0
107107
- if: linux and x86_64
108108
then:
109109
- libcufile

conda/recipes/pylibcudf/recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ requirements:
9090
- libcudf =${{ version }}
9191
- ${{ pin_compatible("rmm", upper_bound="x.x") }}
9292
- if: cuda_major == "12"
93-
then: cuda-python >=12.9.2,<13.0
94-
else: cuda-python >=13.0.1,<14.0
93+
then: cuda-bindings >=12.9.2,<13.0
94+
else: cuda-bindings >=13.0.1,<14.0
9595
- nvtx >=0.2.1
9696
run_constraints:
9797
- numpy >=2.0,<3.0

cpp/benchmarks/reshape/interleave.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
#include <benchmarks/common/generate_input.hpp>
77
#include <benchmarks/common/memory_stats.hpp>
88

99
#include <cudf/reshape.hpp>
10-
#include <cudf/strings/strings_column_view.hpp>
1110
#include <cudf/utilities/default_stream.hpp>
1211

1312
#include <nvbench/nvbench.cuh>
@@ -33,10 +32,9 @@ static void bench_interleave(nvbench::state& state)
3332
auto const stream = cudf::get_default_stream();
3433

3534
state.set_cuda_stream(nvbench::make_cuda_stream_view(stream.value()));
36-
auto chars_size = cudf::strings_column_view(source_view.column(0)).chars_size(stream) +
37-
cudf::strings_column_view(source_view.column(1)).chars_size(stream);
38-
state.add_global_memory_reads<nvbench::int8_t>(chars_size); // all bytes are read
39-
state.add_global_memory_writes<nvbench::int8_t>(chars_size); // all bytes are written
35+
auto input_bytes = source_table->alloc_size();
36+
state.add_global_memory_reads<nvbench::int8_t>(input_bytes); // all bytes are read
37+
state.add_global_memory_writes<nvbench::int8_t>(input_bytes); // all bytes are written
4038

4139
auto const mem_stats_logger = cudf::memory_stats_logger();
4240
state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {

cpp/libcudf_streaming/include/cudf_streaming/channel_metadata.hpp

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3-
* reserved. SPDX-License-Identifier: Apache-2.0
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
#pragma once
@@ -60,7 +60,7 @@ struct order_key {
6060
};
6161

6262
/**
63-
* @brief Order-based partitioning scheme for sorted/range-partitioned data.
63+
* @brief A valid ordering description for sorted/range-partitioned data.
6464
*
6565
* Data is partitioned by value ranges based on predetermined boundaries.
6666
* For N partitions, there are N-1 boundary rows:
@@ -78,17 +78,17 @@ struct order_key {
7878
* half-open key range (partition keys do not straddle chunk interiors). When false,
7979
* a chunk may contain keys spanning multiple partitions.
8080
*/
81-
struct order_scheme {
81+
struct ordering {
8282
std::vector<order_key> keys; ///< Sort keys (column, order, null_order per entry).
8383
std::shared_ptr<table_chunk> boundaries; ///< N-1 boundary rows for N partitions.
8484
/// See struct-level note on `strict_boundaries` semantics.
8585
bool strict_boundaries{false};
8686

87-
/// @brief Default constructor. Produces an invalid (empty) scheme.
88-
order_scheme() = default;
87+
/// @brief Default constructor. Produces an invalid (empty) ordering.
88+
ordering() = default;
8989

9090
/**
91-
* @brief Construct a validated order_scheme.
91+
* @brief Construct a validated ordering.
9292
*
9393
* @param keys Non-empty sort keys; size must equal `boundaries->shape().second`.
9494
* @param boundaries Non-null, device-resident boundary table (N-1 rows for N
@@ -97,36 +97,67 @@ struct order_scheme {
9797
* @throws std::invalid_argument if `keys` is empty, `boundaries` is null or not
9898
* device-resident, or `keys.size() != boundaries->shape().second`.
9999
*/
100-
order_scheme(std::vector<order_key> keys,
101-
std::shared_ptr<table_chunk> boundaries,
102-
bool strict_boundaries = false);
100+
ordering(std::vector<order_key> keys,
101+
std::shared_ptr<table_chunk> boundaries,
102+
bool strict_boundaries = false);
103103

104104
/**
105-
* @brief Return a new order_scheme with updated key column indices, sharing
106-
* boundaries.
107-
*
108-
* The new key count must match the existing boundary column count.
105+
* @brief Return a new ordering with updated key column indices, sharing
106+
* boundary rows.
109107
*
110108
* @param new_keys Replacement sort keys; size must equal
111109
* `boundaries->shape().second`.
112-
* @return A new order_scheme with `new_keys` and the same `boundaries` and
113-
* `strict_boundaries`.
114-
* @throws std::invalid_argument if `new_keys` is empty or size mismatches boundaries.
110+
* @return A new ordering with `new_keys` and the same boundaries and
111+
* strictness.
112+
* @throws std::invalid_argument if `new_keys` is empty or size mismatches
113+
* boundaries.
115114
*/
116-
[[nodiscard]] order_scheme with_keys(std::vector<order_key> new_keys) const;
115+
[[nodiscard]] ordering with_keys(std::vector<order_key> new_keys) const;
117116

118117
/**
119-
* @brief Check whether boundary values are aligned with another scheme.
118+
* @brief Check whether boundary values are aligned with another ordering.
120119
*
121-
* @param other The order_scheme to compare against.
120+
* @param other The ordering to compare against.
122121
* @param br Buffer resource used for temporary allocations during comparison.
123-
* @return True when both schemes have matching boundary values and strict_boundaries
124-
* attributes, and the schemes are otherwise compatible (same order and null_order).
122+
* @return True when both orderings have matching boundary values and
123+
* strict_boundaries attributes, and are otherwise compatible (same order and
124+
* null_order).
125125
*/
126-
[[nodiscard]] bool boundaries_aligned_with(order_scheme const& other,
126+
[[nodiscard]] bool boundaries_aligned_with(ordering const& other,
127127
rapidsmpf::BufferResource& br) const;
128128
};
129129

130+
/**
131+
* @brief Order-based partitioning scheme for sorted/range-partitioned data.
132+
*
133+
* An order_scheme advertises that the same stream is sorted/range-partitioned
134+
* with respect to any individual ordering it contains. Consumers are
135+
* responsible for selecting the ordering that is relevant to a particular
136+
* operation.
137+
*/
138+
struct order_scheme {
139+
std::vector<ordering> orderings; ///< Ordering descriptions valid for the stream.
140+
141+
/// @brief Default constructor. Produces an invalid (empty) scheme.
142+
order_scheme() = default;
143+
144+
/**
145+
* @brief Construct a validated single-ordering order_scheme.
146+
*
147+
* See `ordering` for parameter semantics.
148+
*/
149+
order_scheme(std::vector<order_key> keys,
150+
std::shared_ptr<table_chunk> boundaries,
151+
bool strict_boundaries = false);
152+
153+
/**
154+
* @brief Construct a validated multi-ordering order_scheme.
155+
*
156+
* @param orderings Non-empty sequence of orderings valid for the stream.
157+
*/
158+
explicit order_scheme(std::vector<ordering> orderings);
159+
};
160+
130161
/**
131162
* @brief Partitioning specification for a single hierarchical level.
132163
*
@@ -180,7 +211,7 @@ struct partitioning_spec {
180211

181212
/**
182213
* @brief Create a spec for order/range partitioning.
183-
* @param o The order scheme to use. `o.keys` must be non-empty; otherwise
214+
* @param o The order scheme to use. `o.orderings` must be non-empty; otherwise
184215
* throws `std::invalid_argument`.
185216
* @return A partitioning_spec with type ORDER.
186217
*/

cpp/libcudf_streaming/src/channel_metadata.cpp

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3-
* reserved. SPDX-License-Identifier: Apache-2.0
3+
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
#include <cudf/aggregation.hpp>
@@ -21,36 +21,39 @@
2121
#include <utility>
2222

2323
namespace cudf_streaming {
24+
namespace {
2425

25-
order_scheme::order_scheme(std::vector<order_key> keys,
26-
std::shared_ptr<table_chunk> boundaries,
27-
bool strict_boundaries)
28-
: keys{std::move(keys)}, boundaries{std::move(boundaries)}, strict_boundaries{strict_boundaries}
26+
void validate_ordering(ordering const& ordering)
2927
{
3028
RAPIDSMPF_EXPECTS(
31-
!this->keys.empty(), "OrderScheme: keys must not be empty", std::invalid_argument);
29+
!ordering.keys.empty(), "ordering: keys must not be empty", std::invalid_argument);
3230
RAPIDSMPF_EXPECTS(
33-
this->boundaries != nullptr, "OrderScheme: boundaries must not be null", std::invalid_argument);
34-
RAPIDSMPF_EXPECTS(this->boundaries->is_available(),
35-
"OrderScheme: boundaries must be device-resident",
36-
std::invalid_argument);
37-
RAPIDSMPF_EXPECTS(this->keys.size() == static_cast<std::size_t>(this->boundaries->shape().second),
38-
"OrderScheme: number of keys must match number of boundary columns",
31+
ordering.boundaries != nullptr, "ordering: boundaries must not be null", std::invalid_argument);
32+
RAPIDSMPF_EXPECTS(ordering.boundaries->is_available(),
33+
"ordering: boundaries must be device-resident",
3934
std::invalid_argument);
35+
RAPIDSMPF_EXPECTS(
36+
ordering.keys.size() == static_cast<std::size_t>(ordering.boundaries->shape().second),
37+
"ordering: number of keys must match number of boundary columns",
38+
std::invalid_argument);
4039
}
4140

42-
partitioning_spec partitioning_spec::from_order(order_scheme o)
41+
} // namespace
42+
43+
ordering::ordering(std::vector<order_key> keys,
44+
std::shared_ptr<table_chunk> boundaries,
45+
bool strict_boundaries)
46+
: keys{std::move(keys)}, boundaries{std::move(boundaries)}, strict_boundaries{strict_boundaries}
4347
{
44-
return {.type = type::ORDER, .hash = std::nullopt, .order = std::move(o)};
48+
validate_ordering(*this);
4549
}
4650

47-
order_scheme order_scheme::with_keys(std::vector<order_key> new_keys) const
51+
ordering ordering::with_keys(std::vector<order_key> new_keys) const
4852
{
49-
return order_scheme(std::move(new_keys), boundaries, strict_boundaries);
53+
return ordering{std::move(new_keys), boundaries, strict_boundaries};
5054
}
5155

52-
bool order_scheme::boundaries_aligned_with(order_scheme const& other,
53-
rapidsmpf::BufferResource& br) const
56+
bool ordering::boundaries_aligned_with(ordering const& other, rapidsmpf::BufferResource& br) const
5457
{
5558
if (strict_boundaries != other.strict_boundaries ||
5659
boundaries->shape() != other.boundaries->shape()) {
@@ -85,6 +88,30 @@ bool order_scheme::boundaries_aligned_with(order_scheme const& other,
8588
return true;
8689
}
8790

91+
order_scheme::order_scheme(std::vector<order_key> keys,
92+
std::shared_ptr<table_chunk> boundaries,
93+
bool strict_boundaries)
94+
: order_scheme(
95+
std::vector<ordering>{ordering{std::move(keys), std::move(boundaries), strict_boundaries}})
96+
{
97+
}
98+
99+
order_scheme::order_scheme(std::vector<ordering> orderings) : orderings{std::move(orderings)}
100+
{
101+
RAPIDSMPF_EXPECTS(
102+
!this->orderings.empty(), "order_scheme: orderings must not be empty", std::invalid_argument);
103+
for (auto const& ordering : this->orderings) {
104+
RAPIDSMPF_EXPECTS(!ordering.keys.empty(),
105+
"order_scheme: ordering entries must not be empty",
106+
std::invalid_argument);
107+
}
108+
}
109+
110+
partitioning_spec partitioning_spec::from_order(order_scheme o)
111+
{
112+
return {.type = type::ORDER, .hash = std::nullopt, .order = std::move(o)};
113+
}
114+
88115
rapidsmpf::streaming::Message to_message(std::uint64_t sequence_number,
89116
std::unique_ptr<channel_metadata> m)
90117
{

0 commit comments

Comments
 (0)