cudf-polars-cu13 25.10.0__py3-none-any.whl → 26.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cudf_polars/GIT_COMMIT +1 -1
- cudf_polars/VERSION +1 -1
- cudf_polars/callback.py +60 -15
- cudf_polars/containers/column.py +137 -77
- cudf_polars/containers/dataframe.py +123 -34
- cudf_polars/containers/datatype.py +134 -13
- cudf_polars/dsl/expr.py +0 -2
- cudf_polars/dsl/expressions/aggregation.py +80 -28
- cudf_polars/dsl/expressions/binaryop.py +34 -14
- cudf_polars/dsl/expressions/boolean.py +110 -37
- cudf_polars/dsl/expressions/datetime.py +59 -30
- cudf_polars/dsl/expressions/literal.py +11 -5
- cudf_polars/dsl/expressions/rolling.py +460 -119
- cudf_polars/dsl/expressions/selection.py +9 -8
- cudf_polars/dsl/expressions/slicing.py +1 -1
- cudf_polars/dsl/expressions/string.py +256 -114
- cudf_polars/dsl/expressions/struct.py +19 -7
- cudf_polars/dsl/expressions/ternary.py +33 -3
- cudf_polars/dsl/expressions/unary.py +126 -64
- cudf_polars/dsl/ir.py +1053 -350
- cudf_polars/dsl/to_ast.py +30 -13
- cudf_polars/dsl/tracing.py +194 -0
- cudf_polars/dsl/translate.py +307 -107
- cudf_polars/dsl/utils/aggregations.py +43 -30
- cudf_polars/dsl/utils/reshape.py +14 -2
- cudf_polars/dsl/utils/rolling.py +12 -8
- cudf_polars/dsl/utils/windows.py +35 -20
- cudf_polars/experimental/base.py +55 -2
- cudf_polars/experimental/benchmarks/pdsds.py +12 -126
- cudf_polars/experimental/benchmarks/pdsh.py +792 -2
- cudf_polars/experimental/benchmarks/utils.py +596 -39
- cudf_polars/experimental/dask_registers.py +47 -20
- cudf_polars/experimental/dispatch.py +9 -3
- cudf_polars/experimental/distinct.py +2 -0
- cudf_polars/experimental/explain.py +15 -2
- cudf_polars/experimental/expressions.py +30 -15
- cudf_polars/experimental/groupby.py +25 -4
- cudf_polars/experimental/io.py +156 -124
- cudf_polars/experimental/join.py +53 -23
- cudf_polars/experimental/parallel.py +68 -19
- cudf_polars/experimental/rapidsmpf/__init__.py +8 -0
- cudf_polars/experimental/rapidsmpf/collectives/__init__.py +9 -0
- cudf_polars/experimental/rapidsmpf/collectives/allgather.py +90 -0
- cudf_polars/experimental/rapidsmpf/collectives/common.py +96 -0
- cudf_polars/experimental/rapidsmpf/collectives/shuffle.py +253 -0
- cudf_polars/experimental/rapidsmpf/core.py +488 -0
- cudf_polars/experimental/rapidsmpf/dask.py +172 -0
- cudf_polars/experimental/rapidsmpf/dispatch.py +153 -0
- cudf_polars/experimental/rapidsmpf/io.py +696 -0
- cudf_polars/experimental/rapidsmpf/join.py +322 -0
- cudf_polars/experimental/rapidsmpf/lower.py +74 -0
- cudf_polars/experimental/rapidsmpf/nodes.py +735 -0
- cudf_polars/experimental/rapidsmpf/repartition.py +216 -0
- cudf_polars/experimental/rapidsmpf/union.py +115 -0
- cudf_polars/experimental/rapidsmpf/utils.py +374 -0
- cudf_polars/experimental/repartition.py +9 -2
- cudf_polars/experimental/select.py +177 -14
- cudf_polars/experimental/shuffle.py +46 -12
- cudf_polars/experimental/sort.py +100 -26
- cudf_polars/experimental/spilling.py +1 -1
- cudf_polars/experimental/statistics.py +24 -5
- cudf_polars/experimental/utils.py +25 -7
- cudf_polars/testing/asserts.py +13 -8
- cudf_polars/testing/io.py +2 -1
- cudf_polars/testing/plugin.py +93 -17
- cudf_polars/typing/__init__.py +86 -32
- cudf_polars/utils/config.py +473 -58
- cudf_polars/utils/cuda_stream.py +70 -0
- cudf_polars/utils/versions.py +5 -4
- cudf_polars_cu13-26.2.0.dist-info/METADATA +181 -0
- cudf_polars_cu13-26.2.0.dist-info/RECORD +108 -0
- {cudf_polars_cu13-25.10.0.dist-info → cudf_polars_cu13-26.2.0.dist-info}/WHEEL +1 -1
- cudf_polars_cu13-25.10.0.dist-info/METADATA +0 -136
- cudf_polars_cu13-25.10.0.dist-info/RECORD +0 -92
- {cudf_polars_cu13-25.10.0.dist-info → cudf_polars_cu13-26.2.0.dist-info}/licenses/LICENSE +0 -0
- {cudf_polars_cu13-25.10.0.dist-info → cudf_polars_cu13-26.2.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"""Dispatching for the RapidsMPF streaming runtime."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from functools import singledispatch
|
|
8
|
+
from typing import TYPE_CHECKING, Any, NamedTuple, TypeAlias, TypedDict
|
|
9
|
+
|
|
10
|
+
from cudf_polars.typing import GenericTransformer
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from collections.abc import MutableMapping
|
|
14
|
+
|
|
15
|
+
from rapidsmpf.streaming.core.context import Context
|
|
16
|
+
|
|
17
|
+
from cudf_polars.dsl.ir import IR, IRExecutionContext
|
|
18
|
+
from cudf_polars.experimental.base import (
|
|
19
|
+
PartitionInfo,
|
|
20
|
+
StatsCollector,
|
|
21
|
+
)
|
|
22
|
+
from cudf_polars.experimental.rapidsmpf.utils import ChannelManager
|
|
23
|
+
from cudf_polars.utils.config import ConfigOptions
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class LowerState(TypedDict):
|
|
27
|
+
"""
|
|
28
|
+
State used for lowering an IR node.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
config_options
|
|
33
|
+
GPUEngine configuration options.
|
|
34
|
+
stats
|
|
35
|
+
Statistics collector.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
config_options: ConfigOptions
|
|
39
|
+
stats: StatsCollector
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
LowerIRTransformer: TypeAlias = GenericTransformer[
|
|
43
|
+
"IR", "tuple[IR, MutableMapping[IR, PartitionInfo]]", LowerState
|
|
44
|
+
]
|
|
45
|
+
"""Protocol for Lowering IR nodes."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class FanoutInfo(NamedTuple):
|
|
49
|
+
"""A named tuple representing fanout information."""
|
|
50
|
+
|
|
51
|
+
num_consumers: int
|
|
52
|
+
"""The number of consumers."""
|
|
53
|
+
unbounded: bool
|
|
54
|
+
"""Whether the node needs unbounded fanout."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class GenState(TypedDict):
|
|
58
|
+
"""
|
|
59
|
+
State used for generating a streaming sub-network.
|
|
60
|
+
|
|
61
|
+
Parameters
|
|
62
|
+
----------
|
|
63
|
+
context
|
|
64
|
+
The rapidsmpf context.
|
|
65
|
+
config_options
|
|
66
|
+
GPUEngine configuration options.
|
|
67
|
+
partition_info
|
|
68
|
+
Partition information.
|
|
69
|
+
fanout_nodes
|
|
70
|
+
Dictionary mapping IR nodes to fanout information.
|
|
71
|
+
ir_context
|
|
72
|
+
The execution context for the IR node.
|
|
73
|
+
max_io_threads
|
|
74
|
+
The maximum number of IO threads to use for
|
|
75
|
+
a single IO node.
|
|
76
|
+
stats
|
|
77
|
+
Statistics collector.
|
|
78
|
+
collective_id_map
|
|
79
|
+
The mapping of IR nodes to collective IDs.
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
context: Context
|
|
83
|
+
config_options: ConfigOptions
|
|
84
|
+
partition_info: MutableMapping[IR, PartitionInfo]
|
|
85
|
+
fanout_nodes: dict[IR, FanoutInfo]
|
|
86
|
+
ir_context: IRExecutionContext
|
|
87
|
+
max_io_threads: int
|
|
88
|
+
stats: StatsCollector
|
|
89
|
+
collective_id_map: dict[IR, int]
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
SubNetGenerator: TypeAlias = GenericTransformer[
|
|
93
|
+
"IR", "tuple[dict[IR, list[Any]], dict[IR, ChannelManager]]", GenState
|
|
94
|
+
]
|
|
95
|
+
"""Protocol for Generating a streaming sub-network."""
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@singledispatch
|
|
99
|
+
def lower_ir_node(
|
|
100
|
+
ir: IR, rec: LowerIRTransformer
|
|
101
|
+
) -> tuple[IR, MutableMapping[IR, PartitionInfo]]:
|
|
102
|
+
"""
|
|
103
|
+
Rewrite an IR node and extract partitioning information.
|
|
104
|
+
|
|
105
|
+
Parameters
|
|
106
|
+
----------
|
|
107
|
+
ir
|
|
108
|
+
IR node to rewrite.
|
|
109
|
+
rec
|
|
110
|
+
Recursive LowerIRTransformer callable.
|
|
111
|
+
|
|
112
|
+
Returns
|
|
113
|
+
-------
|
|
114
|
+
new_ir, partition_info
|
|
115
|
+
The rewritten node, and a mapping from unique nodes in
|
|
116
|
+
the full IR graph to associated partitioning information.
|
|
117
|
+
|
|
118
|
+
Notes
|
|
119
|
+
-----
|
|
120
|
+
This function is distinct from the `lower_ir_node` function
|
|
121
|
+
in the `parallel` module, because the lowering logic for the
|
|
122
|
+
streaming runtime is different for some IR sub-classes.
|
|
123
|
+
|
|
124
|
+
See Also
|
|
125
|
+
--------
|
|
126
|
+
lower_ir_graph
|
|
127
|
+
"""
|
|
128
|
+
raise AssertionError(f"Unhandled type {type(ir)}") # pragma: no cover
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@singledispatch
|
|
132
|
+
def generate_ir_sub_network(
|
|
133
|
+
ir: IR, rec: SubNetGenerator
|
|
134
|
+
) -> tuple[dict[IR, list[Any]], dict[IR, ChannelManager]]:
|
|
135
|
+
"""
|
|
136
|
+
Generate a sub-network for the RapidsMPF streaming runtime.
|
|
137
|
+
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
ir
|
|
141
|
+
IR node to generate tasks for.
|
|
142
|
+
rec
|
|
143
|
+
Recursive SubNetGenerator callable.
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
nodes
|
|
148
|
+
Dictionary mapping each IR node to its list of streaming-network node(s).
|
|
149
|
+
channels
|
|
150
|
+
Dictionary mapping between each IR node and its
|
|
151
|
+
corresponding output ChannelManager object.
|
|
152
|
+
"""
|
|
153
|
+
raise AssertionError(f"Unhandled type {type(ir)}") # pragma: no cover
|