-
Notifications
You must be signed in to change notification settings - Fork 928
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
Modify make_host_vector
and make_device_uvector
factories to optionally use pinned memory and kernel copy
#16206
Merged
rapids-bot
merged 129 commits into
rapidsai:branch-24.08
from
vuule:fea-make_host_vector-great-again-try2
Jul 24, 2024
Merged
Changes from 126 commits
Commits
Show all changes
129 commits
Select commit
Hold shift + click to select a range
eb39019
remove pinned_host_vector
vuule 24b1245
switch to host_device resource ref
vuule 6c896f6
rebrand host memory resource
vuule 0048c59
style
vuule 1964523
java update because breaking
vuule f871ca0
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule ac0ce9c
java fix
vuule b610ba3
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule ab36162
move test out of io util
vuule 69a1bce
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 83f665a
missed rename
vuule 659cabc
Merge branch 'branch-24.08' into fea-pinned-vector-factory
vuule c1ae478
update benchmark changes
vuule b1a1582
Merge branch 'fea-pinned-vector-factory' of https://github.com/vuule/…
vuule 707dfc7
Merge branch 'branch-24.08' into fea-pinned-vector-factory
vuule 1c09d0c
rename rmm_host_vector
vuule c343c31
remove do_xyz
vuule 25ddc4f
Merge branch 'fea-pinned-vector-factory' of https://github.com/vuule/…
vuule 3fc988b
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 50f4d3e
comment
vuule 8dfbd07
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule e429840
Merge branch 'fea-pinned-vector-factory' into fea-smart-copy
vuule e5af490
works
vuule 9082ccc
include style
vuule 054a98a
Merge branch 'branch-24.08' into fea-pinned-vector-factory
vuule 17b1ee0
reviews
vuule e3c344b
Merge branch 'fea-pinned-vector-factory' of https://github.com/vuule/…
vuule ea6408f
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 2dbb68f
available_device_memory
vuule cb9cc22
reviews
vuule cf67a14
expand anon namespace
vuule 24c1549
host_uvector
vuule 9c97833
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 075deca
style
vuule 164fce2
docs; prefixes
vuule b566bab
type aliases in host_uvector
vuule 21edb53
refactor host_ticket
vuule 3814797
style
vuule 168609d
Merge branch 'fea-pinned-vector-factory' into fea-smart-copy
vuule 3ef149d
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule c933157
style
vuule 6784e07
more style
vuule a49789c
Merge branch 'branch-24.08' into fea-smart-copy
vuule ba06fbd
Merge branch 'fea-pinned-vector-factory' of https://github.com/vuule/…
vuule f7999aa
Revert "type aliases in host_uvector"
vuule c9a82d0
Revert "docs; prefixes"
vuule 930efef
Revert "style"
vuule 0466949
Revert "host_uvector"
vuule f312219
make do without host_uvector
vuule 7cfee0a
missed change
vuule fe4d668
style
vuule 52f4a96
Merge branch 'fea-pinned-vector-factory' into fea-smart-copy
vuule 4c2b7cf
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule e2c8613
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 5a71f77
rename
vuule 9068642
refactor
vuule 2ec4670
missing newlines
vuule a886eb4
rename files
vuule 0dae691
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule dd1fba8
Merge branch 'branch-24.08' into fea-smart-copy
vuule 59ed0dd
Merge branch 'branch-24.08' into fea-smart-copy
vuule c6ef5f1
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule dcaeaba
test commit, please ignore
vuule e75808c
Merge branch 'fea-smart-copy' of https://github.com/vuule/cudf into f…
vuule d50f145
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 0a2742f
fix typo
vuule 68a03f1
typeless API
vuule b63b393
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 336c7e0
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 1741037
sorthidth
vuule fff667b
simplify
vuule da2c009
Merge branch 'fea-smart-copy' of https://github.com/vuule/cudf into f…
vuule 84683d2
another day, another threshold
vuule 1bbd574
add missing break
vuule 692f775
Merge branch 'branch-24.08' into fea-smart-copy
vuule 101288f
rename files to host
vuule ce58c46
lines
vuule d897984
Merge branch 'branch-24.08' into fea-smart-copy
vuule 3739c47
get_host_memory_resource
vuule 49d65b8
use if/else
vuule 84a1797
Merge branch 'fea-smart-copy' of https://github.com/vuule/cudf into f…
vuule 0b2aa13
Merge branch 'branch-24.08' into fea-smart-copy
vuule 5fd5d65
Merge branch 'fea-smart-copy' of https://github.com/vuule/cudf into f…
vuule db45aa7
rename back :D
vuule 5a072cf
working make_host_vector
vuule 6fcfec4
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule dd93448
auto
vuule 095413e
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 02e7bfb
derive host_vector
vuule ef4e1de
use host_vector pt2
vuule 1dbafa5
include changes
vuule 58900dd
orc
vuule 395898a
copying
vuule be916f9
few more
vuule 2225e3b
partial IO
vuule 0446d34
parquet
vuule 6a7ff73
rest of it
vuule 38cdd56
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule a0a6caa
style
vuule 523ee4c
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 7789e39
improve docs
vuule ddf625c
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule d55fb39
add missing overload
vuule 309ae34
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule d8f0e58
typo fixes; clean up
vuule 60cc991
Merge branch 'branch-24.08' into fea-make_host_vector-great-again-try2
vuule 7a7db99
Merge branch 'branch-24.08' into fea-make_host_vector-great-again-try2
vuule ffd54f9
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule b94d26c
fix return type
vuule 0dfaee4
remove noexcept on deallocates
vuule eaea60d
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 66da001
tests
vuule bbf5f29
avoid copy_n
vuule 7f3e7f5
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 036ac99
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
6e39c35
add is_device_accessible to span
vuule c262c30
pass host_span
vuule 6cd16b5
address review
vuule 9f51424
Merge branch 'branch-24.08' into fea-make_host_vector-great-again-try2
vuule 044836a
reviews
vuule 69e3895
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 32c7b72
review suggestion
vuule 53fdbe4
Merge branch 'fea-make_host_vector-great-again-try2' of https://githu…
vuule cecb289
fix docs
vuule 5d15a4d
revert to fix get_host_allocator
vuule f85759b
Merge branch 'branch-24.08' into fea-make_host_vector-great-again-try2
vuule de0bacc
Merge branch 'branch-24.08' of https://github.com/rapidsai/cudf into …
vuule 0df153e
Merge branch 'fea-make_host_vector-great-again-try2' of https://githu…
vuule 09b0ae2
Merge branch 'branch-24.08' into fea-make_host_vector-great-again-try2
vuule File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cudf/detail/utilities/host_vector.hpp> | ||
#include <cudf/utilities/export.hpp> | ||
#include <cudf/utilities/pinned_memory.hpp> | ||
|
||
#include <rmm/resource_ref.hpp> | ||
|
||
#include <cstddef> | ||
|
||
namespace cudf::detail { | ||
/** | ||
* @brief Get the memory resource to be used for pageable memory allocations. | ||
* | ||
* @return Reference to the pageable memory resource | ||
*/ | ||
CUDF_EXPORT rmm::host_async_resource_ref get_pageable_memory_resource(); | ||
|
||
/** | ||
* @brief Get the allocator to be used for the host memory allocation. | ||
* | ||
* @param size The number of elements of type T to allocate | ||
* @param stream The stream to use for the allocation | ||
* @return The allocator to be used for the host memory allocation | ||
*/ | ||
template <typename T> | ||
rmm_host_allocator<T> get_host_allocator(std::size_t size, rmm::cuda_stream_view stream) | ||
{ | ||
if (size * sizeof(T) <= get_allocate_host_as_pinned_threshold()) { | ||
return {get_pinned_memory_resource(), stream}; | ||
} | ||
return {get_pageable_memory_resource(), stream}; | ||
} | ||
|
||
} // namespace cudf::detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a constructor with default allocator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have one. The idea is to encourage the use of the factory functions because they transparently and consistently apply the pinned memory/kernel optimizations. I don't really want any code outside of the factory functions to call the constructors directly.