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

Experimental support for configurable prefetching #16020

Merged
merged 32 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6468f84
First pass at adding prefetching
vyasr Jun 11, 2024
2e1bbda
Implementing configurable prefetching and device_uvector
vyasr Jun 13, 2024
a9ad0eb
Clean up naming and namespaces
vyasr Jun 13, 2024
c36ec6a
Inline device_uvector definitions
vyasr Jun 13, 2024
37ac3ac
Expose pylibcudf API
vyasr Jun 13, 2024
7c86b4e
Remove debug prints
vyasr Jun 13, 2024
c1e7309
Remove now unnecessary forward decl
vyasr Jun 13, 2024
05ef7ec
Remove print
vyasr Jun 25, 2024
104fdcf
Support disabling prefetching
vyasr Jun 26, 2024
55d5868
Add a device_buffer overload as well
vyasr Jun 28, 2024
04eb898
Increase verbosity on prefetch failure
vyasr Jun 29, 2024
21b4f08
Fix namespace issue and add a const pointer overload for data
vyasr Jun 29, 2024
df0f555
Namespace and add move assignment operator
vyasr Jun 29, 2024
237990b
Also add bytes to the print
vyasr Jul 2, 2024
90aa4f7
Fix all column view accessors
vyasr Jul 2, 2024
6dc12e8
Write to device_uvector in gather
vyasr Jul 2, 2024
e59d8df
Also modify indexalator and offsetalater (probably redundant, try rev…
vyasr Jul 2, 2024
f59cd4e
Remove unnecessary indexalator/offsetalator changes
vyasr Jul 2, 2024
9a4deb7
Simplify and centralize the column_view changes
vyasr Jul 3, 2024
97b172e
Remove device_buffer
vyasr Jul 15, 2024
070608b
Revert device_uvector
vyasr Jul 15, 2024
17c76ef
Revert cuco allocator
vyasr Jul 15, 2024
33e8eb9
Add gather-specific prefetches
vyasr Jul 16, 2024
802d346
Rename key to manual_prefetch
vyasr Jul 16, 2024
08450f4
Split out the noexcept prefetching and make APIs stream-ordered
vyasr Jul 18, 2024
362b965
Also add prefetch for hash join
vyasr Jul 18, 2024
dc5a807
Fix typo
vyasr Jul 18, 2024
cd050e4
Centralize column_view prefetching
vyasr Jul 19, 2024
9a54668
Make sure to pop the error when not using managed memory
vyasr Jul 19, 2024
5efa7b8
Document pylibcudf APIs
vyasr Jul 19, 2024
a6787ab
Address PR review
vyasr Jul 19, 2024
a2956b7
Add missing pxd
vyasr Jul 19, 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
Prev Previous commit
Next Next commit
Support disabling prefetching
  • Loading branch information
vyasr committed Jul 18, 2024
commit 104fdcf7ee48aa357d48233ea9c498284800cd54
7 changes: 7 additions & 0 deletions cpp/include/cudf/utilities/prefetch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ void prefetch(std::string_view key, void const* ptr, std::size_t size);
*/
void enable_prefetching(std::string_view key);
vyasr marked this conversation as resolved.
Show resolved Hide resolved

/**
* @brief Disable prefetching for a particular structure or algorithm.
*
* @param key The key to disable prefetching for.
*/
void disable_prefetching(std::string_view key);

/**
* @brief Enable or disable debug mode.
*
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/utilities/prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@ void prefetch(std::string_view key, void const* ptr, std::size_t size)

void enable_prefetching(std::string_view key) { detail::PrefetchConfig::instance().set(key, true); }

void disable_prefetching(std::string_view key)
{
detail::PrefetchConfig::instance().set(key, false);
}

void prefetch_debugging(bool enable) { detail::PrefetchConfig::instance().debug = enable; }
} // namespace cudf::experimental::prefetch
6 changes: 4 additions & 2 deletions python/cudf/cudf/_lib/pylibcudf/experimental.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ from cudf._lib.pylibcudf.libcudf cimport experimental as cpp_experimental


cpdef enable_prefetching(str key):
vyasr marked this conversation as resolved.
Show resolved Hide resolved
# helper to convert a gather map to a Column
cdef string c_key = key.encode("utf-8")
cpp_experimental.enable_prefetching(c_key)

cpdef disable_prefetching(str key):
cdef string c_key = key.encode("utf-8")
cpp_experimental.disable_prefetching(c_key)

cpdef prefetch_debugging(bool enable):
# helper to convert a gather map to a Column
cpp_experimental.prefetch_debugging(enable)
1 change: 1 addition & 0 deletions python/cudf/cudf/_lib/pylibcudf/libcudf/experimental.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ cdef extern from "cudf/utilities/prefetch.hpp" \
# but there's no real rush so if we go that route we might as well
# contribute them upstream to Cython itself.
void enable_prefetching(string key)
void disable_prefetching(string key)
void prefetch_debugging(bool enable)