From f7f7e333067927959c56800cc2c65c0766c6f1d4 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 23 Dec 2024 06:06:53 -0800 Subject: [PATCH 1/2] Use PyNVML 12 (#17627) Bump `pynvml` from `11` to `12`. This version of `pynvml` also now depends on `nvidia-ml-py` for core functionality. Depends on PR: https://github.com/rapidsai/dask-cuda/pull/1419 Authors: - https://github.com/jakirkham Approvers: - Peter Andreas Entschev (https://github.com/pentschev) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cudf/pull/17627 --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-125_arch-x86_64.yaml | 2 +- conda/recipes/dask-cudf/meta.yaml | 2 +- dependencies.yaml | 2 +- python/dask_cudf/pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 33fc2f651c6..a4b3f4fe174 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -71,7 +71,7 @@ dependencies: - ptxcompiler - pyarrow>=14.0.0,<19.0.0a0 - pydata-sphinx-theme!=0.14.2 -- pynvml>=11.4.1,<12.0.0a0 +- pynvml>=12.0.0,<13.0.0a0 - pytest-benchmark - pytest-cases>=3.8.2 - pytest-cov diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index c290a83a37f..7173c955116 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -69,7 +69,7 @@ dependencies: - pyarrow>=14.0.0,<19.0.0a0 - pydata-sphinx-theme!=0.14.2 - pynvjitlink>=0.0.0a0 -- pynvml>=11.4.1,<12.0.0a0 +- pynvml>=12.0.0,<13.0.0a0 - pytest-benchmark - pytest-cases>=3.8.2 - pytest-cov diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index 74ecded8ead..a476d5d53df 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -43,7 +43,7 @@ requirements: run: - python - cudf ={{ version }} - - pynvml >=11.4.1,<12.0.0a0 + - pynvml >=12.0.0,<13.0.0a0 - rapids-dask-dependency ={{ minor_version }} - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} diff --git a/dependencies.yaml b/dependencies.yaml index 7a83efc6e3d..b0f217a6770 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -757,7 +757,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - pynvml>=11.4.1,<12.0.0a0 + - pynvml>=12.0.0,<13.0.0a0 - rapids-dask-dependency==25.2.*,>=0.0.0a0 run_custreamz: common: diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index 8d481408870..a8cb696d7f6 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "fsspec>=0.6.0", "numpy>=1.23,<3.0a0", "pandas>=2.0,<2.2.4dev0", - "pynvml>=11.4.1,<12.0.0a0", + "pynvml>=12.0.0,<13.0.0a0", "rapids-dask-dependency==25.2.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ From 45b40c5a07ca6c726f22b82b5be89133f274665d Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Mon, 23 Dec 2024 18:06:36 +0000 Subject: [PATCH 2/2] Fix: DataFrameGroupBy.get_group was raising with length>1 tuples (#17653) https://github.com/rapidsai/cudf/pull/17216 added similar logic to what's in pandas https://github.com/pandas-dev/pandas/blob/602ae10f3d0d599ebbdd151e8a09f0baf20b4637/pandas/core/groupby/groupby.py#L787-L794, but missed one crucial ingredient: checking that the length of the keys is `1` before raising Authors: - Marco Edward Gorelli (https://github.com/MarcoGorelli) - Bradley Dice (https://github.com/bdice) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/17653 --- python/cudf/cudf/core/groupby/groupby.py | 2 +- python/cudf/cudf/tests/test_groupby.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/core/groupby/groupby.py b/python/cudf/cudf/core/groupby/groupby.py index be3cc410174..a6af8e5dff4 100644 --- a/python/cudf/cudf/core/groupby/groupby.py +++ b/python/cudf/cudf/core/groupby/groupby.py @@ -641,7 +641,7 @@ def get_group(self, name, obj=None): "instead of ``gb.get_group(name, obj=df)``.", FutureWarning, ) - if is_list_like(self._by): + if is_list_like(self._by) and len(self._by) == 1: if isinstance(name, tuple) and len(name) == 1: name = name[0] else: diff --git a/python/cudf/cudf/tests/test_groupby.py b/python/cudf/cudf/tests/test_groupby.py index db4f3cd3c9f..23950f044f8 100644 --- a/python/cudf/cudf/tests/test_groupby.py +++ b/python/cudf/cudf/tests/test_groupby.py @@ -4076,6 +4076,13 @@ def test_get_group_list_like(): df.groupby(["a"]).get_group([1]) +def test_get_group_list_like_len_2(): + df = cudf.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6], "c": [3, 2, 1]}) + result = df.groupby(["a", "b"]).get_group((1, 4)) + expected = df.to_pandas().groupby(["a", "b"]).get_group((1, 4)) + assert_eq(result, expected) + + def test_size_as_index_false(): df = pd.DataFrame({"a": [1, 2, 1], "b": [1, 2, 3]}, columns=["a", "b"]) expected = df.groupby("a", as_index=False).size()