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

Replace raw streams with rmm::cuda_stream_view (part 3) #6744

Merged
merged 120 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
ff53e23
Fix cast warning.
harrism Oct 29, 2020
8c44ade
Initial stream changes
harrism Nov 2, 2020
7802d52
Revert commented out stuff.
harrism Nov 2, 2020
f0ca10c
Convert AST to cuda_stream_view
harrism Nov 2, 2020
22a14dd
Convert column_device_view to rmm::cuda_stream_view
harrism Nov 2, 2020
2fab2ad
Convert column to rmm::cuda_stream_view
harrism Nov 2, 2020
984c7ca
Changelog for #6646
harrism Nov 3, 2020
953d133
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 3, 2020
0ebf99e
Convert column factories to cuda_stream_view
harrism Nov 3, 2020
31716db
convert detail/aggregation headers and source to cuda_stream_view
harrism Nov 3, 2020
ba2fc0f
Use cuda_stream_view in groupby sort_helper
harrism Nov 3, 2020
d8827e9
Convert binops to cuda_stream_view
harrism Nov 3, 2020
6c88b59
Fix includes and copyright dates
harrism Nov 4, 2020
a31c432
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 5, 2020
325ca52
Update round to use detail::copy_bitmask
harrism Nov 5, 2020
eafb55c
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 5, 2020
ad24fb7
Use stream.synchronize()
harrism Nov 5, 2020
3b6b0aa
Convert concatenate to cuda_stream_view
harrism Nov 5, 2020
a2edf78
Convert table and copy_if to cuda_stream_view
harrism Nov 6, 2020
94b1627
Changelog for #6648
harrism Nov 6, 2020
c497fcc
Convert copy_range to cuda_stream_view
harrism Nov 6, 2020
03aec6a
Convert fill to cuda_stream_view
harrism Nov 6, 2020
802fa76
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 6, 2020
c7faec9
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 6, 2020
927378b
Convert gather to cuda_stream_view
harrism Nov 6, 2020
243d2a1
rename type_conversion .cu->.cpp
harrism Nov 6, 2020
554a370
Rename structs_column_view .cu->.cpp
harrism Nov 6, 2020
a76e9ec
Convert hash groupby to cuda_stream_view
harrism Nov 6, 2020
817c715
Convert hashing to cuda_stream_view
harrism Nov 8, 2020
e663d97
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 8, 2020
2da7bb1
Add conda_include_dirs to benchmarks cmakelists
harrism Nov 9, 2020
58a5420
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 9, 2020
be38bda
Convert interop to rmm::cuda_stream_view
harrism Nov 9, 2020
a546bcc
Add missing dlpack and to_arrow synchronization.
harrism Nov 9, 2020
7d863dc
Convert reductions, quantiles to cuda_stream_view
harrism Nov 9, 2020
84a200e
Convert repeat to cuda_stream_view
harrism Nov 9, 2020
876d9ef
Add quantiles.hpp to meta.yaml
harrism Nov 9, 2020
6a7d15c
Convert replace to cuda_stream_view
harrism Nov 9, 2020
1340241
Convert reshape/tile to cuda_stream_view
harrism Nov 9, 2020
7a0c0f2
Convert round to cuda_stream_view
harrism Nov 9, 2020
61446f8
Convert scatter to cuda_steam_view
harrism Nov 9, 2020
091aa27
Convert search to cuda_stream_view
harrism Nov 9, 2020
9087cf5
Convert sequence to cuda_stream_view
harrism Nov 9, 2020
576dae1
Convert sorting and stream compaction to cuda_stream_view
harrism Nov 9, 2020
6ab4384
convert transform to cuda_stream_view
harrism Nov 9, 2020
d08b2d0
Convert transpose to cuda_stream_view
harrism Nov 9, 2020
1715b80
Convert unary ops to cuda_stream_view
harrism Nov 9, 2020
6250687
Fix JNI build after cuda_stream_view changes
harrism Nov 10, 2020
8b3bfb2
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 10, 2020
3fe4db4
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 10, 2020
4c93c62
Add missing CONDA_INCLUDE_DIRS from benchmarks cmake
harrism Nov 11, 2020
87548f5
Add CUDF_CPP_BUILD_DIR to enable rapids-compose build.
harrism Nov 11, 2020
f286a15
Changelog
harrism Nov 11, 2020
f660aa1
Merge branch 'fix-java-build-for-compose' into fea-cuda_stream_view
harrism Nov 11, 2020
c9a530e
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 11, 2020
f8ec499
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 11, 2020
d349e49
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 11, 2020
5e0614e
Convert rest of dictionary functionality to cuda_stream_view
harrism Nov 11, 2020
5506652
Convert cuio to cuda_stream_view
harrism Nov 11, 2020
9fb9300
Convert remainder of lists functionality to cuda_stream_view
harrism Nov 11, 2020
b9edf1c
Convert scalar factories to cuda_stream_view
harrism Nov 12, 2020
3f1f8d7
Convert strings_scalar_factories to cuda_stream_view
harrism Nov 12, 2020
88cdbfb
Convert strings to cuda_stream_view
harrism Nov 12, 2020
4a4be90
Merge branch 'branch-0.17' into fea-cuda_stream_view
harrism Nov 12, 2020
8232fd3
Merge branch 'fea-cuda_stream_view' into fea-cuda_stream_view-2
harrism Nov 12, 2020
f8733c0
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 12, 2020
ef9f2b8
Changelog for #6744
harrism Nov 12, 2020
de8d457
Convert join and groupby to cuda_stream_view
harrism Nov 12, 2020
3246c71
Fix copyright and include order in dlpack.cpp
harrism Nov 12, 2020
3583edc
Remove unnecessary remnant cuda_stream_view construction
harrism Nov 12, 2020
518566c
contiguous_split --> cuda_stream_view
harrism Nov 12, 2020
c737693
Convert get_element to cuda_stream_view
harrism Nov 12, 2020
75064fd
Convert datetime_ops to cuda_stream_view
harrism Nov 12, 2020
904b0f1
Convert missed stream param in repeat
harrism Nov 12, 2020
edbe609
Convert semi_join, cross_join, nested_loop_join to cuda_stream_view
harrism Nov 12, 2020
b33b54e
extract -> cuda_stream_view
harrism Nov 12, 2020
c6431b1
merge -> cuda_stream_view
harrism Nov 12, 2020
9183840
partitioning --> cuda_stream_view
harrism Nov 12, 2020
15060d3
minmax --> cuda_stream_view
harrism Nov 12, 2020
ba5405d
scan --> cuda_stream_view
harrism Nov 12, 2020
b38d88f
byte_cast --> cuda_stream_view
harrism Nov 12, 2020
afc1fd0
clamp --> cuda_stream_view
harrism Nov 12, 2020
09cbc45
interleave_columns --> cuda_stream_view
harrism Nov 12, 2020
fb76a0c
is_sorted --> cuda_stream_view
harrism Nov 12, 2020
1807d64
rolling --> cuda_stream_view
harrism Nov 12, 2020
a532bae
rank --> cuda_stream_view
harrism Nov 12, 2020
af624e5
strings internals --> cuda_stream_view
harrism Nov 13, 2020
cf93ce9
tests --> cuda_stream_view
harrism Nov 13, 2020
f3185a0
benchmark synchronization --> cuda_stream_view
harrism Nov 13, 2020
9e46e6d
concurrent maps --> cuda_stream_view
harrism Nov 13, 2020
291f5cc
Remove unnecessary cudaStream_t fwd decl
harrism Nov 13, 2020
c526cd4
Merge branch 'branch-0.17' into fea-cuda_stream_view-2
harrism Nov 13, 2020
9c3f3a0
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 13, 2020
5b0592b
Fix includes, copyright and doc formatting.
harrism Nov 16, 2020
39b2ac7
Merge branch 'branch-0.17' into fea-cuda_stream_view-2
harrism Nov 16, 2020
e393ff9
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 16, 2020
05fe96c
Use `cuda_stream_default`
harrism Nov 16, 2020
06b6283
Merge branch 'branch-0.17' into fea-cuda_stream_view-2
harrism Nov 17, 2020
4150783
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 17, 2020
9d88e34
Update stream,mr order after recent merges
harrism Nov 17, 2020
bc994aa
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 17, 2020
9d8f23e
Remove MR parameter when it can be defaulted.
harrism Nov 18, 2020
6a62744
Header fix
harrism Nov 18, 2020
acbb2eb
Header fixes
harrism Nov 18, 2020
81cd601
Add missing include.
harrism Nov 18, 2020
81ab40c
Merge branch 'branch-0.17' into fea-cuda_stream_view-2
harrism Nov 19, 2020
9fc08f3
cudaStream_t to cuda_stream_view in math_ops
harrism Nov 19, 2020
ee42e87
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 19, 2020
2390e61
Merge branch 'branch-0.17' into fea-cuda_stream_view-2
harrism Nov 20, 2020
e5bdacc
Merge branch 'fea-cuda_stream_view-2' into fea-cuda-stream-view-3
harrism Nov 20, 2020
645dd7f
Merge branch 'branch-0.17' into fea-cuda-stream-view-3
harrism Nov 22, 2020
3250070
quotes -> <>
harrism Nov 23, 2020
69e1712
"" --> <>
harrism Nov 23, 2020
0a0e8ef
Merge branch 'branch-0.17' into fea-cuda-stream-view-3
harrism Nov 23, 2020
a88632c
Fix CHECK_CUDA
harrism Nov 23, 2020
1278dec
Oops, undo auto replace in error.hpp
harrism Nov 23, 2020
7538009
Add missing parens
harrism Nov 24, 2020
da7d66b
Fix debug compilation failure
harrism Nov 24, 2020
7a68c39
Fix CHECK_CUDA to actually catch errors in debug build
harrism Nov 24, 2020
7dc105d
Disable group std/var tests in debug build since it is currently unsu…
harrism Nov 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
- PR #6610 Add ability to set scalar values in `cudf.DataFrame`
- PR #6612 Update JNI to new RMM cuda_stream_view API
- PR #6646 Replace `cudaStream_t` with `rmm::cuda_stream_view` (part 1)
- PR #6648 Replace `cudaStream_t` with `rmm::cuda_stream_view` (part 2)
- PR #6744 Replace `cudaStream_t` with `rmm::cuda_stream_view` (part 3)
- PR #6579 Update scatter APIs to use reference wrapper / const scalar
- PR #6614 Add support for conversion to Pandas nullable dtypes and fix related issue in `cudf.to_json`
- PR #6622 Update `to_pandas` api docs
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/libcudf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ test:
- test -f $PREFIX/include/cudf/detail/replace.hpp
- test -f $PREFIX/include/cudf/detail/reshape.hpp
- test -f $PREFIX/include/cudf/detail/round.hpp
- test -f $PREFIX/include/cudf/detail/quantiles.hpp
- test -f $PREFIX/include/cudf/detail/scatter.hpp
- test -f $PREFIX/include/cudf/detail/search.hpp
- test -f $PREFIX/include/cudf/detail/sequence.hpp
Expand Down
13 changes: 8 additions & 5 deletions cpp/benchmarks/synchronization/synchronization.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION.
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,13 +15,15 @@
*/

#include "synchronization.hpp"

#include <cudf/utilities/error.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_buffer.hpp>

cuda_event_timer::cuda_event_timer(benchmark::State& state,
bool flush_l2_cache,
cudaStream_t stream)
rmm::cuda_stream_view stream)
: p_state(&state), stream(stream)
{
// flush all of L2$
Expand All @@ -35,18 +37,19 @@ cuda_event_timer::cuda_event_timer(benchmark::State& state,
if (l2_cache_bytes > 0) {
const int memset_value = 0;
rmm::device_buffer l2_cache_buffer(l2_cache_bytes, stream);
CUDA_TRY(cudaMemsetAsync(l2_cache_buffer.data(), memset_value, l2_cache_bytes, stream));
CUDA_TRY(
cudaMemsetAsync(l2_cache_buffer.data(), memset_value, l2_cache_bytes, stream.value()));
}
}

CUDA_TRY(cudaEventCreate(&start));
CUDA_TRY(cudaEventCreate(&stop));
CUDA_TRY(cudaEventRecord(start, stream));
CUDA_TRY(cudaEventRecord(start, stream.value()));
}

cuda_event_timer::~cuda_event_timer()
{
CUDA_TRY(cudaEventRecord(stop, stream));
CUDA_TRY(cudaEventRecord(stop, stream.value()));
CUDA_TRY(cudaEventSynchronize(stop));

float milliseconds = 0.0f;
Expand Down
15 changes: 10 additions & 5 deletions cpp/benchmarks/synchronization/synchronization.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION.
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,7 +33,7 @@

for (auto _ : state){

cudaStream_t stream = 0;
rmm::cuda_stream_view stream{}; // default stream, could be another stream

// Create (Construct) an object of this class. You HAVE to pass in the
// benchmark::State object you are using. It measures the time from its
Expand All @@ -44,7 +44,7 @@
cuda_event_timer raii(state, true, stream); // flush_l2_cache = true

// Now perform the operations that is to be benchmarked
sample_kernel<<<1, 256, 0, stream>>>(); // Possibly launching a CUDA kernel
sample_kernel<<<1, 256, 0, stream.value()>>>(); // Possibly launching a CUDA kernel

}
}
Expand All @@ -61,8 +61,11 @@

// Google Benchmark library
#include <benchmark/benchmark.h>

#include <cudf/types.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <driver_types.h>

class cuda_event_timer {
Expand All @@ -77,7 +80,9 @@ class cuda_event_timer {
* every iteration.
* @param[in] stream_ The CUDA stream we are measuring time on.
**/
cuda_event_timer(benchmark::State& state, bool flush_l2_cache, cudaStream_t stream_ = 0);
cuda_event_timer(benchmark::State& state,
bool flush_l2_cache,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);

// The user must provide a benchmark::State object to set
// the timer so we disable the default c'tor.
Expand All @@ -91,7 +96,7 @@ class cuda_event_timer {
private:
cudaEvent_t start;
cudaEvent_t stop;
cudaStream_t stream;
rmm::cuda_stream_view stream;
benchmark::State* p_state;
};

Expand Down
Loading