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.
Files changed (76) hide show
  1. cudf_polars/GIT_COMMIT +1 -1
  2. cudf_polars/VERSION +1 -1
  3. cudf_polars/callback.py +60 -15
  4. cudf_polars/containers/column.py +137 -77
  5. cudf_polars/containers/dataframe.py +123 -34
  6. cudf_polars/containers/datatype.py +134 -13
  7. cudf_polars/dsl/expr.py +0 -2
  8. cudf_polars/dsl/expressions/aggregation.py +80 -28
  9. cudf_polars/dsl/expressions/binaryop.py +34 -14
  10. cudf_polars/dsl/expressions/boolean.py +110 -37
  11. cudf_polars/dsl/expressions/datetime.py +59 -30
  12. cudf_polars/dsl/expressions/literal.py +11 -5
  13. cudf_polars/dsl/expressions/rolling.py +460 -119
  14. cudf_polars/dsl/expressions/selection.py +9 -8
  15. cudf_polars/dsl/expressions/slicing.py +1 -1
  16. cudf_polars/dsl/expressions/string.py +256 -114
  17. cudf_polars/dsl/expressions/struct.py +19 -7
  18. cudf_polars/dsl/expressions/ternary.py +33 -3
  19. cudf_polars/dsl/expressions/unary.py +126 -64
  20. cudf_polars/dsl/ir.py +1053 -350
  21. cudf_polars/dsl/to_ast.py +30 -13
  22. cudf_polars/dsl/tracing.py +194 -0
  23. cudf_polars/dsl/translate.py +307 -107
  24. cudf_polars/dsl/utils/aggregations.py +43 -30
  25. cudf_polars/dsl/utils/reshape.py +14 -2
  26. cudf_polars/dsl/utils/rolling.py +12 -8
  27. cudf_polars/dsl/utils/windows.py +35 -20
  28. cudf_polars/experimental/base.py +55 -2
  29. cudf_polars/experimental/benchmarks/pdsds.py +12 -126
  30. cudf_polars/experimental/benchmarks/pdsh.py +792 -2
  31. cudf_polars/experimental/benchmarks/utils.py +596 -39
  32. cudf_polars/experimental/dask_registers.py +47 -20
  33. cudf_polars/experimental/dispatch.py +9 -3
  34. cudf_polars/experimental/distinct.py +2 -0
  35. cudf_polars/experimental/explain.py +15 -2
  36. cudf_polars/experimental/expressions.py +30 -15
  37. cudf_polars/experimental/groupby.py +25 -4
  38. cudf_polars/experimental/io.py +156 -124
  39. cudf_polars/experimental/join.py +53 -23
  40. cudf_polars/experimental/parallel.py +68 -19
  41. cudf_polars/experimental/rapidsmpf/__init__.py +8 -0
  42. cudf_polars/experimental/rapidsmpf/collectives/__init__.py +9 -0
  43. cudf_polars/experimental/rapidsmpf/collectives/allgather.py +90 -0
  44. cudf_polars/experimental/rapidsmpf/collectives/common.py +96 -0
  45. cudf_polars/experimental/rapidsmpf/collectives/shuffle.py +253 -0
  46. cudf_polars/experimental/rapidsmpf/core.py +488 -0
  47. cudf_polars/experimental/rapidsmpf/dask.py +172 -0
  48. cudf_polars/experimental/rapidsmpf/dispatch.py +153 -0
  49. cudf_polars/experimental/rapidsmpf/io.py +696 -0
  50. cudf_polars/experimental/rapidsmpf/join.py +322 -0
  51. cudf_polars/experimental/rapidsmpf/lower.py +74 -0
  52. cudf_polars/experimental/rapidsmpf/nodes.py +735 -0
  53. cudf_polars/experimental/rapidsmpf/repartition.py +216 -0
  54. cudf_polars/experimental/rapidsmpf/union.py +115 -0
  55. cudf_polars/experimental/rapidsmpf/utils.py +374 -0
  56. cudf_polars/experimental/repartition.py +9 -2
  57. cudf_polars/experimental/select.py +177 -14
  58. cudf_polars/experimental/shuffle.py +46 -12
  59. cudf_polars/experimental/sort.py +100 -26
  60. cudf_polars/experimental/spilling.py +1 -1
  61. cudf_polars/experimental/statistics.py +24 -5
  62. cudf_polars/experimental/utils.py +25 -7
  63. cudf_polars/testing/asserts.py +13 -8
  64. cudf_polars/testing/io.py +2 -1
  65. cudf_polars/testing/plugin.py +93 -17
  66. cudf_polars/typing/__init__.py +86 -32
  67. cudf_polars/utils/config.py +473 -58
  68. cudf_polars/utils/cuda_stream.py +70 -0
  69. cudf_polars/utils/versions.py +5 -4
  70. cudf_polars_cu13-26.2.0.dist-info/METADATA +181 -0
  71. cudf_polars_cu13-26.2.0.dist-info/RECORD +108 -0
  72. {cudf_polars_cu13-25.10.0.dist-info → cudf_polars_cu13-26.2.0.dist-info}/WHEEL +1 -1
  73. cudf_polars_cu13-25.10.0.dist-info/METADATA +0 -136
  74. cudf_polars_cu13-25.10.0.dist-info/RECORD +0 -92
  75. {cudf_polars_cu13-25.10.0.dist-info → cudf_polars_cu13-26.2.0.dist-info}/licenses/LICENSE +0 -0
  76. {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