Skip to content

Conversation

mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Sep 16, 2025

Description

Now that cudf-polars uses managed memory by default, the prior comment here should no longer be applicable and we should be able to run these tests with more than 1 process for a hopeful improvement in runtime.

Probably depends on #20042 so each xdist process doesn't set the initial_pool_size of the memory resource to 80% of the available device memory.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke self-assigned this Sep 16, 2025
@mroeschke mroeschke requested a review from a team as a code owner September 16, 2025 16:46
@mroeschke mroeschke added the improvement Improvement / enhancement to an existing function label Sep 16, 2025
@mroeschke mroeschke added the non-breaking Non-breaking change label Sep 16, 2025
@mroeschke mroeschke requested a review from a team as a code owner September 16, 2025 21:50
@mroeschke mroeschke requested review from wence- and vyasr September 16, 2025 21:50
@github-actions github-actions bot added Python Affects Python cuDF API. cudf-polars Issues specific to cudf-polars labels Sep 16, 2025
@GPUtester GPUtester moved this to In Progress in cuDF Python Sep 16, 2025
@mroeschke mroeschke marked this pull request as draft September 19, 2025 17:14
Copy link

copy-pr-bot bot commented Sep 19, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mroeschke
Copy link
Contributor Author

/ok to test 59d144d

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 24, 2025

As mentioned in #19895 (comment), we'll want to update

def test_cudf_polars_enable_disable_managed_memory(monkeypatch, enable_managed_memory):
to clear cudf-polars memory pool cache by calling

default_memory_resource.cache_clear()

somewhere near the end of that test. Otherwise, there will be a memory pool with 50% of GPU memory sitting around doing nothing. That should perhaps be a fixture so that we know it runs, even if the test fails somewhere after creating that memory resource.

There might still be some risk in two tests running that at the same time, so that should perhaps rerun on failures a few times.

I can push those changes here if you'd like.

@vyasr vyasr changed the base branch from branch-25.10 to branch-25.12 September 24, 2025 17:45
@mroeschke
Copy link
Contributor Author

/ok to test 29b3b41

@TomAugspurger
Copy link
Contributor

That one passed. @mroeschke do you remember how consistently you saw the test suite OOM previously?

@mroeschke
Copy link
Contributor Author

do you remember how consistently you saw the test suite OOM previously?

Each run was OOMing even with just in memory executor (before limiting the initial pool size to 1GB). I'm going to rerun these test in an "ideal" setup (8 processes, no limiting of initial pool size) to see if test_cudf_polars_enable_disable_managed_memory was the only blocker to running these test in multiple processes.

@mroeschke
Copy link
Contributor Author

/ok to test 4c51a08

@mroeschke mroeschke marked this pull request as ready for review September 25, 2025 23:48
import pytest


@pytest.fixture(autouse=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this fixture in the experimental directory since currently these are the only tests (with the CI script) that purposefully test with the distributed executor. Is that OK @TomAugspurger given your thoughts on reorganizing the cudf_polars test suite in the future?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that sounds good to me.

import pytest


@pytest.fixture(autouse=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that sounds good to me.

@mroeschke
Copy link
Contributor Author

Just documenting some runtime observations for a follow up running the cudf polars wheel tests with multiple processes

  • With 6 processes, the runtime of the 4 cudf polars test variants were essentially equivalent except for the distributed variant where the runtime increased by 1-3 minutes
  • With 8 processes, the runtime of the for the in memory, streaming, stream + small block size decreased by 40 sec - 1.5 minutes while the streaming + distributed variant increased by ~40 seconds (overall net decrease)

So in the follow up, I'll probably use 8 processes for these unit test with conda (and wheels) and maybe disable running the distributed variant with multiple processes

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit c82f0fc into rapidsai:branch-25.12 Sep 26, 2025
135 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in cuDF Python Sep 26, 2025
@mroeschke mroeschke deleted the ci/cudf_polars/xdist_conda branch September 26, 2025 18:51
TomAugspurger pushed a commit to TomAugspurger/pygdf that referenced this pull request Sep 26, 2025
…9980)

Now that cudf-polars uses managed memory by default, the prior comment here should no longer be applicable and we should be able to run these tests with more than 1 process for a hopeful improvement in runtime.

Probably depends on rapidsai#20042 so each xdist process doesn't set the `initial_pool_size` of the memory resource to 80% of the available device memory.

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)
  - Tom Augspurger (https://github.com/TomAugspurger)

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Bradley Dice (https://github.com/bdice)
  - Tom Augspurger (https://github.com/TomAugspurger)

URL: rapidsai#19980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf-polars Issues specific to cudf-polars improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants