Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to prefetch in cudf.pandas and change default to managed pool #16296

Merged
merged 23 commits into from
Jul 25, 2024
Merged
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
35f1723
Add ability to prefetch
galipremsagar Jul 17, 2024
2424867
Merge branch 'branch-24.08' into prefetch_mr
galipremsagar Jul 17, 2024
7047b77
Prefetch the managed pool, too.
bdice Jul 23, 2024
8e70f7d
Merge remote-tracking branch 'upstream/branch-24.08' into prefetch_mr
galipremsagar Jul 23, 2024
42762d6
enable by default and add prefetch
galipremsagar Jul 23, 2024
2cd93d0
simplify
galipremsagar Jul 23, 2024
664da44
Apply suggestions from code review
galipremsagar Jul 23, 2024
02bb3dd
update
galipremsagar Jul 23, 2024
82b5c9e
Address reviews
galipremsagar Jul 23, 2024
cd4d156
Merge branch 'branch-24.08' into prefetch_mr
galipremsagar Jul 23, 2024
a6ebd3d
Update python/cudf/cudf/pandas/__init__.py
galipremsagar Jul 23, 2024
caaa2f1
Apply suggestions from code review
galipremsagar Jul 23, 2024
c7b6d56
move enable prefecting order to after module is run
galipremsagar Jul 23, 2024
eb6acb3
Merge branch 'prefetch_mr' of https://github.com/galipremsagar/cudf i…
galipremsagar Jul 23, 2024
3050661
return rmm_mode
galipremsagar Jul 23, 2024
c2e97e4
update
galipremsagar Jul 23, 2024
276d8cf
Merge branch 'branch-24.08' into prefetch_mr
galipremsagar Jul 24, 2024
34d35ba
Merge remote-tracking branch 'upstream/branch-24.08' into prefetch_mr
galipremsagar Jul 24, 2024
4457575
Merge branch 'branch-24.08' into prefetch_mr
galipremsagar Jul 24, 2024
cad780c
reduce parallelism
galipremsagar Jul 24, 2024
0170ffa
Merge branch 'prefetch_mr' of https://github.com/galipremsagar/cudf i…
galipremsagar Jul 24, 2024
89f50e9
Merge branch 'branch-24.08' into prefetch_mr
galipremsagar Jul 24, 2024
2de3886
Update python/cudf/cudf/pandas/scripts/run-pandas-tests.sh
galipremsagar Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions python/cudf/cudf/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def install():
global LOADED
LOADED = loader is not None

if (rmm_mode := os.getenv("CUDF_PANDAS_RMM_MODE", None)) is not None:
if (
rmm_mode := os.getenv("CUDF_PANDAS_RMM_MODE", "managed_pool")
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
) is not None:
if rmm_mode == "disable":
return
# Check if a non-default memory resource is set
current_mr = rmm.mr.get_current_device_resource()
if not isinstance(current_mr, rmm.mr.CudaMemoryResource):
Expand All @@ -50,16 +54,27 @@ def install():
mr = rmm.mr.CudaAsyncMemoryResource(initial_pool_size=free_memory)
rmm.mr.set_current_device_resource(mr)
elif rmm_mode == "managed":
mr = rmm.mr.ManagedMemoryResource()
mr = rmm.mr.PrefetchResourceAdaptor(rmm.mr.ManagedMemoryResource())
mhaseeb123 marked this conversation as resolved.
Show resolved Hide resolved
rmm.mr.set_current_device_resource(mr)
elif rmm_mode == "managed_pool":
mr = rmm.mr.PoolMemoryResource(
rmm.mr.ManagedMemoryResource(),
initial_pool_size=free_memory,
mr = rmm.mr.PrefetchResourceAdaptor(
rmm.mr.PoolMemoryResource(
rmm.mr.ManagedMemoryResource(),
initial_pool_size=free_memory,
)
)
rmm.mr.set_current_device_resource(mr)
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
else:
raise ValueError(f"Unsupported rmm mode: {rmm_mode}")
from cudf._lib import pylibcudf
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s defer the import and put it one line lower, inside the ”if prefetching is enabled” block.


for item in {
"column_view::get_data",
"mutable_column_view::get_data",
"gather",
"hash_join",
}:
pylibcudf.experimental.enable_prefetching(item)
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved


def pytest_load_initial_conftests(early_config, parser, args):
Expand Down
Loading