cudf-polars-cu12 24.8.0a281__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.
@@ -0,0 +1,106 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Typing utilities for cudf_polars."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from collections.abc import Mapping
9
+ from typing import TYPE_CHECKING, Literal, Protocol, Union
10
+
11
+ from polars.polars import _expr_nodes as pl_expr, _ir_nodes as pl_ir
12
+
13
+ import cudf._lib.pylibcudf as plc
14
+
15
+ if TYPE_CHECKING:
16
+ from typing import Callable
17
+
18
+ from typing_extensions import TypeAlias
19
+
20
+ import polars as pl
21
+
22
+ IR: TypeAlias = Union[
23
+ pl_ir.PythonScan,
24
+ pl_ir.Scan,
25
+ pl_ir.Cache,
26
+ pl_ir.DataFrameScan,
27
+ pl_ir.Select,
28
+ pl_ir.GroupBy,
29
+ pl_ir.Join,
30
+ pl_ir.HStack,
31
+ pl_ir.Distinct,
32
+ pl_ir.Sort,
33
+ pl_ir.Slice,
34
+ pl_ir.Filter,
35
+ pl_ir.SimpleProjection,
36
+ pl_ir.MapFunction,
37
+ pl_ir.Union,
38
+ pl_ir.HConcat,
39
+ pl_ir.ExtContext,
40
+ ]
41
+
42
+ Expr: TypeAlias = Union[
43
+ pl_expr.Function,
44
+ pl_expr.Window,
45
+ pl_expr.Literal,
46
+ pl_expr.Sort,
47
+ pl_expr.SortBy,
48
+ pl_expr.Gather,
49
+ pl_expr.Filter,
50
+ pl_expr.Cast,
51
+ pl_expr.Column,
52
+ pl_expr.Agg,
53
+ pl_expr.BinaryExpr,
54
+ pl_expr.Len,
55
+ pl_expr.PyExprIR,
56
+ ]
57
+
58
+ Schema: TypeAlias = Mapping[str, plc.DataType]
59
+
60
+
61
+ class NodeTraverser(Protocol):
62
+ """Abstract protocol for polars NodeTraverser."""
63
+
64
+ def get_node(self) -> int:
65
+ """Return current plan node id."""
66
+ ...
67
+
68
+ def set_node(self, n: int) -> None:
69
+ """Set the current plan node to n."""
70
+ ...
71
+
72
+ def view_current_node(self) -> IR:
73
+ """Convert current plan node to python rep."""
74
+ ...
75
+
76
+ def get_schema(self) -> Mapping[str, pl.DataType]:
77
+ """Get the schema of the current plan node."""
78
+ ...
79
+
80
+ def get_dtype(self, n: int) -> pl.DataType:
81
+ """Get the datatype of the given expression id."""
82
+ ...
83
+
84
+ def view_expression(self, n: int) -> Expr:
85
+ """Convert the given expression to python rep."""
86
+ ...
87
+
88
+ def set_udf(
89
+ self,
90
+ callback: Callable[[list[str] | None, str | None, int | None], pl.DataFrame],
91
+ ) -> None:
92
+ """Set the callback replacing the current node in the plan."""
93
+ ...
94
+
95
+
96
+ OptimizationArgs: TypeAlias = Literal[
97
+ "type_coercion",
98
+ "predicate_pushdown",
99
+ "projection_pushdown",
100
+ "simplify_expression",
101
+ "slice_pushdown",
102
+ "comm_subplan_elim",
103
+ "comm_subexpr_elim",
104
+ "cluster_with_columns",
105
+ "no_optimization",
106
+ ]
@@ -0,0 +1,8 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Utilities."""
5
+
6
+ from __future__ import annotations
7
+
8
+ __all__: list[str] = []
@@ -0,0 +1,159 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Datatype utilities."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from functools import cache
9
+
10
+ import pyarrow as pa
11
+ from typing_extensions import assert_never
12
+
13
+ import polars as pl
14
+
15
+ import cudf._lib.pylibcudf as plc
16
+
17
+ __all__ = ["from_polars", "downcast_arrow_lists", "have_compatible_resolution"]
18
+
19
+
20
+ def have_compatible_resolution(lid: plc.TypeId, rid: plc.TypeId):
21
+ """
22
+ Do two datetime typeids have matching resolution for a binop.
23
+
24
+ Parameters
25
+ ----------
26
+ lid
27
+ Left type id
28
+ rid
29
+ Right type id
30
+
31
+ Returns
32
+ -------
33
+ True if resolutions are compatible, False otherwise.
34
+
35
+ Notes
36
+ -----
37
+ Polars has different casting rules for combining
38
+ datetimes/durations than libcudf, and while we don't encode the
39
+ casting rules fully, just reject things we can't handle.
40
+
41
+ Precondition for correctness: both lid and rid are timelike.
42
+ """
43
+ if lid == rid:
44
+ return True
45
+ # Timestamps are smaller than durations in the libcudf enum.
46
+ lid, rid = sorted([lid, rid])
47
+ if lid == plc.TypeId.TIMESTAMP_MILLISECONDS:
48
+ return rid == plc.TypeId.DURATION_MILLISECONDS
49
+ elif lid == plc.TypeId.TIMESTAMP_MICROSECONDS:
50
+ return rid == plc.TypeId.DURATION_MICROSECONDS
51
+ elif lid == plc.TypeId.TIMESTAMP_NANOSECONDS:
52
+ return rid == plc.TypeId.DURATION_NANOSECONDS
53
+ return False
54
+
55
+
56
+ def downcast_arrow_lists(typ: pa.DataType) -> pa.DataType:
57
+ """
58
+ Sanitize an arrow datatype from polars.
59
+
60
+ Parameters
61
+ ----------
62
+ typ
63
+ Arrow type to sanitize
64
+
65
+ Returns
66
+ -------
67
+ Sanitized arrow type
68
+
69
+ Notes
70
+ -----
71
+ As well as arrow ``ListType``s, polars can produce
72
+ ``LargeListType``s and ``FixedSizeListType``s, these are not
73
+ currently handled by libcudf, so we attempt to cast them all into
74
+ normal ``ListType``s on the arrow side before consuming the arrow
75
+ data.
76
+ """
77
+ if isinstance(typ, pa.LargeListType):
78
+ return pa.list_(downcast_arrow_lists(typ.value_type))
79
+ # We don't have to worry about diving into struct types for now
80
+ # since those are always NotImplemented before we get here.
81
+ assert not isinstance(typ, pa.StructType)
82
+ return typ
83
+
84
+
85
+ @cache
86
+ def from_polars(dtype: pl.DataType) -> plc.DataType:
87
+ """
88
+ Convert a polars datatype to a pylibcudf one.
89
+
90
+ Parameters
91
+ ----------
92
+ dtype
93
+ Polars dtype to convert
94
+
95
+ Returns
96
+ -------
97
+ Matching pylibcudf DataType object.
98
+
99
+ Raises
100
+ ------
101
+ NotImplementedError
102
+ For unsupported conversions.
103
+ """
104
+ if isinstance(dtype, pl.Boolean):
105
+ return plc.DataType(plc.TypeId.BOOL8)
106
+ elif isinstance(dtype, pl.Int8):
107
+ return plc.DataType(plc.TypeId.INT8)
108
+ elif isinstance(dtype, pl.Int16):
109
+ return plc.DataType(plc.TypeId.INT16)
110
+ elif isinstance(dtype, pl.Int32):
111
+ return plc.DataType(plc.TypeId.INT32)
112
+ elif isinstance(dtype, pl.Int64):
113
+ return plc.DataType(plc.TypeId.INT64)
114
+ if isinstance(dtype, pl.UInt8):
115
+ return plc.DataType(plc.TypeId.UINT8)
116
+ elif isinstance(dtype, pl.UInt16):
117
+ return plc.DataType(plc.TypeId.UINT16)
118
+ elif isinstance(dtype, pl.UInt32):
119
+ return plc.DataType(plc.TypeId.UINT32)
120
+ elif isinstance(dtype, pl.UInt64):
121
+ return plc.DataType(plc.TypeId.UINT64)
122
+ elif isinstance(dtype, pl.Float32):
123
+ return plc.DataType(plc.TypeId.FLOAT32)
124
+ elif isinstance(dtype, pl.Float64):
125
+ return plc.DataType(plc.TypeId.FLOAT64)
126
+ elif isinstance(dtype, pl.Date):
127
+ return plc.DataType(plc.TypeId.TIMESTAMP_DAYS)
128
+ elif isinstance(dtype, pl.Time):
129
+ raise NotImplementedError("Time of day dtype not implemented")
130
+ elif isinstance(dtype, pl.Datetime):
131
+ if dtype.time_zone is not None:
132
+ raise NotImplementedError("Time zone support")
133
+ if dtype.time_unit == "ms":
134
+ return plc.DataType(plc.TypeId.TIMESTAMP_MILLISECONDS)
135
+ elif dtype.time_unit == "us":
136
+ return plc.DataType(plc.TypeId.TIMESTAMP_MICROSECONDS)
137
+ elif dtype.time_unit == "ns":
138
+ return plc.DataType(plc.TypeId.TIMESTAMP_NANOSECONDS)
139
+ assert dtype.time_unit is not None # pragma: no cover
140
+ assert_never(dtype.time_unit)
141
+ elif isinstance(dtype, pl.Duration):
142
+ if dtype.time_unit == "ms":
143
+ return plc.DataType(plc.TypeId.DURATION_MILLISECONDS)
144
+ elif dtype.time_unit == "us":
145
+ return plc.DataType(plc.TypeId.DURATION_MICROSECONDS)
146
+ elif dtype.time_unit == "ns":
147
+ return plc.DataType(plc.TypeId.DURATION_NANOSECONDS)
148
+ assert dtype.time_unit is not None # pragma: no cover
149
+ assert_never(dtype.time_unit)
150
+ elif isinstance(dtype, pl.String):
151
+ return plc.DataType(plc.TypeId.STRING)
152
+ elif isinstance(dtype, pl.Null):
153
+ # TODO: Hopefully
154
+ return plc.DataType(plc.TypeId.EMPTY)
155
+ elif isinstance(dtype, pl.List):
156
+ # TODO: This doesn't consider the value type.
157
+ return plc.DataType(plc.TypeId.LIST)
158
+ else:
159
+ raise NotImplementedError(f"{dtype=} conversion not supported")
@@ -0,0 +1,53 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Sorting utilities."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import TYPE_CHECKING
9
+
10
+ import cudf._lib.pylibcudf as plc
11
+
12
+ if TYPE_CHECKING:
13
+ from collections.abc import Sequence
14
+
15
+
16
+ def sort_order(
17
+ descending: Sequence[bool], *, nulls_last: Sequence[bool], num_keys: int
18
+ ) -> tuple[list[plc.types.Order], list[plc.types.NullOrder]]:
19
+ """
20
+ Produce sort order arguments.
21
+
22
+ Parameters
23
+ ----------
24
+ descending
25
+ List indicating order for each column
26
+ nulls_last
27
+ Should nulls sort last or first?
28
+ num_keys
29
+ Number of sort keys
30
+
31
+ Returns
32
+ -------
33
+ tuple of column_order and null_precedence
34
+ suitable for passing to sort routines
35
+ """
36
+ # Mimicking polars broadcast handling of descending
37
+ if num_keys > (n := len(descending)) and n == 1:
38
+ descending = [descending[0]] * num_keys
39
+ if num_keys > (n := len(nulls_last)) and n == 1:
40
+ nulls_last = [nulls_last[0]] * num_keys
41
+ column_order = [
42
+ plc.types.Order.DESCENDING if d else plc.types.Order.ASCENDING
43
+ for d in descending
44
+ ]
45
+ null_precedence = []
46
+ if len(descending) != len(nulls_last) or len(descending) != num_keys:
47
+ raise ValueError("Mismatching length of arguments in sort_order")
48
+ for asc, null_last in zip(column_order, nulls_last):
49
+ if (asc == plc.types.Order.ASCENDING) ^ (not null_last):
50
+ null_precedence.append(plc.types.NullOrder.AFTER)
51
+ elif (asc == plc.types.Order.ASCENDING) ^ null_last:
52
+ null_precedence.append(plc.types.NullOrder.BEFORE)
53
+ return column_order, null_precedence
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2018 NVIDIA Corporation
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.1
2
+ Name: cudf-polars-cu12
3
+ Version: 24.8.0a281
4
+ Summary: Executor for polars using cudf
5
+ Author: NVIDIA Corporation
6
+ License: Apache 2.0
7
+ Project-URL: Homepage, https://github.com/rapidsai/cudf
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Topic :: Database
10
+ Classifier: Topic :: Scientific/Engineering
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: cudf-cu12 ==24.8.*,>=0.0.0a0
20
+ Requires-Dist: polars >=1.0
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest-cov ; extra == 'test'
23
+ Requires-Dist: pytest-xdist ; extra == 'test'
24
+ Requires-Dist: pytest <8 ; extra == 'test'
25
+
26
+ # <div align="left"><img src="img/rapids_logo.png" width="90px"/>&nbsp;cuDF - GPU DataFrames</div>
27
+
28
+ ## 📢 cuDF can now be used as a no-code-change accelerator for pandas! To learn more, see [here](https://rapids.ai/cudf-pandas/)!
29
+
30
+ cuDF (pronounced "KOO-dee-eff") is a GPU DataFrame library
31
+ for loading, joining, aggregating, filtering, and otherwise
32
+ manipulating data. cuDF leverages
33
+ [libcudf](https://docs.rapids.ai/api/libcudf/stable/), a
34
+ blazing-fast C++/CUDA dataframe library and the [Apache
35
+ Arrow](https://arrow.apache.org/) columnar format to provide a
36
+ GPU-accelerated pandas API.
37
+
38
+ You can import `cudf` directly and use it like `pandas`:
39
+
40
+ ```python
41
+ import cudf
42
+
43
+ tips_df = cudf.read_csv("https://github.com/plotly/datasets/raw/master/tips.csv")
44
+ tips_df["tip_percentage"] = tips_df["tip"] / tips_df["total_bill"] * 100
45
+
46
+ # display average tip by dining party size
47
+ print(tips_df.groupby("size").tip_percentage.mean())
48
+ ```
49
+
50
+ Or, you can use cuDF as a no-code-change accelerator for pandas, using
51
+ [`cudf.pandas`](https://docs.rapids.ai/api/cudf/stable/cudf_pandas).
52
+ `cudf.pandas` supports 100% of the pandas API, utilizing cuDF for
53
+ supported operations and falling back to pandas when needed:
54
+
55
+ ```python
56
+ %load_ext cudf.pandas # pandas operations now use the GPU!
57
+
58
+ import pandas as pd
59
+
60
+ tips_df = pd.read_csv("https://github.com/plotly/datasets/raw/master/tips.csv")
61
+ tips_df["tip_percentage"] = tips_df["tip"] / tips_df["total_bill"] * 100
62
+
63
+ # display average tip by dining party size
64
+ print(tips_df.groupby("size").tip_percentage.mean())
65
+ ```
66
+
67
+ ## Resources
68
+
69
+ - [Try cudf.pandas now](https://nvda.ws/rapids-cudf): Explore `cudf.pandas` on a free GPU enabled instance on Google Colab!
70
+ - [Install](https://docs.rapids.ai/install): Instructions for installing cuDF and other [RAPIDS](https://rapids.ai) libraries.
71
+ - [cudf (Python) documentation](https://docs.rapids.ai/api/cudf/stable/)
72
+ - [libcudf (C++/CUDA) documentation](https://docs.rapids.ai/api/libcudf/stable/)
73
+ - [RAPIDS Community](https://rapids.ai/learn-more/#get-involved): Get help, contribute, and collaborate.
74
+
75
+ See the [RAPIDS install page](https://docs.rapids.ai/install) for
76
+ the most up-to-date information and commands for installing cuDF
77
+ and other RAPIDS packages.
78
+
79
+ ## Installation
80
+
81
+ ### CUDA/GPU requirements
82
+
83
+ * CUDA 11.2+
84
+ * NVIDIA driver 450.80.02+
85
+ * Volta architecture or better (Compute Capability >=7.0)
86
+
87
+ ### Pip
88
+
89
+ cuDF can be installed via `pip` from the NVIDIA Python Package Index.
90
+ Be sure to select the appropriate cuDF package depending
91
+ on the major version of CUDA available in your environment:
92
+
93
+ For CUDA 11.x:
94
+
95
+ ```bash
96
+ pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11
97
+ ```
98
+
99
+ For CUDA 12.x:
100
+
101
+ ```bash
102
+ pip install --extra-index-url=https://pypi.nvidia.com cudf-cu12
103
+ ```
104
+
105
+ ### Conda
106
+
107
+ cuDF can be installed with conda (via [miniconda](https://docs.conda.io/projects/miniconda/en/latest/) or the full [Anaconda distribution](https://www.anaconda.com/download) from the `rapidsai` channel:
108
+
109
+ ```bash
110
+ conda install -c rapidsai -c conda-forge -c nvidia \
111
+ cudf=24.08 python=3.11 cuda-version=12.2
112
+ ```
113
+
114
+ We also provide [nightly Conda packages](https://anaconda.org/rapidsai-nightly) built from the HEAD
115
+ of our latest development branch.
116
+
117
+ Note: cuDF is supported only on Linux, and with Python versions 3.9 and later.
118
+
119
+ See the [RAPIDS installation guide](https://docs.rapids.ai/install) for more OS and version info.
120
+
121
+ ## Build/Install from Source
122
+ See build [instructions](CONTRIBUTING.md#setting-up-your-build-environment).
123
+
124
+ ## Contributing
125
+
126
+ Please see our [guide for contributing to cuDF](CONTRIBUTING.md).
@@ -0,0 +1,23 @@
1
+ cudf_polars/VERSION,sha256=zdNimzD5pcTTN-h7hODdVxBxJgWGO5KXG3QUIp_zLto,12
2
+ cudf_polars/__init__.py,sha256=14P5GBFe0d0SUWndM4KDUIz_vDzMW6siDxF-64fvp2M,585
3
+ cudf_polars/_version.py,sha256=kj5Ir4dxZRR-k2k8mWUDJHiGpE8_ZcTNzt_kMZxcFRA,528
4
+ cudf_polars/callback.py,sha256=B70oBBtgsYYz6Dkayv99blM1TPINackUB6wldngCdh8,1747
5
+ cudf_polars/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ cudf_polars/containers/__init__.py,sha256=X2hD5pO5gyIlWjaVyxkPsI2u6iK3PLmXv_U0IpDs4yk,367
7
+ cudf_polars/containers/column.py,sha256=nEaJVHnl0va1oT-mI60KoMVkI7puIt4x79EPvbjshxA,4958
8
+ cudf_polars/containers/dataframe.py,sha256=_oMtFn4dC2z4OcvSKkHIfQnGydWRCsTvE2_IGVRM7-Y,7061
9
+ cudf_polars/dsl/__init__.py,sha256=bYwYnqmqINMgwnkJ22EnXMlHviLolPaMgQ8QqoZL3YE,244
10
+ cudf_polars/dsl/expr.py,sha256=z3DEimzeez56ZQmXfwDUHJYVWfUnw2Tay4Om9ebFPJw,50396
11
+ cudf_polars/dsl/ir.py,sha256=aJm_WyVv2rY2Uq19mzn-ozdUfLQSDcisE-qjxFty1Dk,36733
12
+ cudf_polars/dsl/translate.py,sha256=LyyLZg_sDuyri34AMVYl6f9APy8DBK9OT1j848zptxs,15906
13
+ cudf_polars/testing/__init__.py,sha256=0MnlTjkTEqkSpL5GdMhQf4uXOaQwNrzgEJCZKa5FnL4,219
14
+ cudf_polars/testing/asserts.py,sha256=pf4MiaHh7_CZTvjgaDJn1NwD_R4264ro-VQqVvdZSpc,3225
15
+ cudf_polars/typing/__init__.py,sha256=ARaPFQogjflwViiVLP6zgH8xxl__d1Me7ev1CDzQyN0,2431
16
+ cudf_polars/utils/__init__.py,sha256=urdV5MUIneU8Dn6pt1db5GkDG0oY4NsFD0Uhl3j98l8,195
17
+ cudf_polars/utils/dtypes.py,sha256=6JDAQlIridMsRzGUSvMVQTZQZg6V0kGUHq1Yj4nqa50,5198
18
+ cudf_polars/utils/sorting.py,sha256=M0T8m78orAaYicE8VVuZzcVKcwGmipLGNXpkM75iH0A,1722
19
+ cudf_polars_cu12-24.8.0a281.dist-info/LICENSE,sha256=4YCpjWCbYMkMQFW47JXsorZLOaP957HwmP6oHW2_ngM,11348
20
+ cudf_polars_cu12-24.8.0a281.dist-info/METADATA,sha256=raBf9bm8Rr1qcmHh6LRA9K4AXGjFzeHv19edB0Z2lC4,4480
21
+ cudf_polars_cu12-24.8.0a281.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
22
+ cudf_polars_cu12-24.8.0a281.dist-info/top_level.txt,sha256=w2bOa7MpuyapYgZh480Znh4UzX7rSWlFcYR1Yo6QIPs,12
23
+ cudf_polars_cu12-24.8.0a281.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (70.3.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+