Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Apr 21, 2022
2 parents cb7d581 + d5e6941 commit 4695697
Show file tree
Hide file tree
Showing 187 changed files with 2,133 additions and 1,930 deletions.
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ function buildLibCudfJniInDocker {
-DCUDF_CPP_BUILD_DIR=$workspaceRepoDir/java/target/libcudf-cmake-build \
-DCUDA_STATIC_RUNTIME=ON \
-DPER_THREAD_DEFAULT_STREAM=ON \
-DRMM_LOGGING_LEVEL=OFF \
-DUSE_GDS=ON \
-DGPU_ARCHS=${CUDF_CMAKE_CUDA_ARCHITECTURES} \
-DCUDF_JNI_ARROW_STATIC=ON \
-DCUDF_JNI_LIBCUDF_STATIC=ON \
-Dtest=*,!CuFileTest"
}
Expand Down
10 changes: 7 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ include(cmake/thirdparty/get_gtest.cmake)
include(cmake/Modules/JitifyPreprocessKernels.cmake)
# find cuFile
include(cmake/Modules/FindcuFile.cmake)
# find KvikIO
include(cmake/thirdparty/get_kvikio.cmake)

# Workaround until https://github.com/rapidsai/rapids-cmake/issues/176 is resolved
if(NOT BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -344,10 +346,12 @@ add_library(
src/join/join.cu
src/join/join_utils.cu
src/join/mixed_join.cu
src/join/mixed_join_kernels.cu
src/join/mixed_join_kernel.cu
src/join/mixed_join_kernel_nulls.cu
src/join/mixed_join_kernels_semi.cu
src/join/mixed_join_semi.cu
src/join/mixed_join_size_kernels.cu
src/join/mixed_join_size_kernel.cu
src/join/mixed_join_size_kernel_nulls.cu
src/join/mixed_join_size_kernels_semi.cu
src/join/semi_join.cu
src/lists/contains.cu
Expand Down Expand Up @@ -585,7 +589,7 @@ add_dependencies(cudf jitify_preprocess_run)
target_link_libraries(
cudf
PUBLIC ${ARROW_LIBRARIES} libcudacxx::libcudacxx cudf::Thrust rmm::rmm
PRIVATE cuco::cuco ZLIB::ZLIB nvcomp::nvcomp
PRIVATE cuco::cuco ZLIB::ZLIB nvcomp::nvcomp kvikio::kvikio
)

# Add Conda library, and include paths if specified
Expand Down
1 change: 1 addition & 0 deletions cpp/benchmarks/copying/contiguous_split.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf_test/column_wrapper.hpp>

#include <cudf/column/column.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/benchmarks/copying/copy_if_else.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/benchmarks/hashing/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/io/csv/csv_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
Expand Down Expand Up @@ -52,6 +50,7 @@ void BM_csv_read_varying_input(benchmark::State& state)

auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
cudf_io::read_csv(read_options);
}
Expand Down Expand Up @@ -98,6 +97,7 @@ void BM_csv_read_varying_options(benchmark::State& state)
cudf::size_type const chunk_row_cnt = view.num_rows() / num_chunks;
auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
for (int32_t chunk = 0; chunk < num_chunks; ++chunk) {
// only read the header in the first chunk
Expand Down
2 changes: 0 additions & 2 deletions cpp/benchmarks/io/csv/csv_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
Expand Down
28 changes: 28 additions & 0 deletions cpp/benchmarks/io/cuio_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,31 @@ std::vector<cudf::size_type> segments_in_chunk(int num_segments, int num_chunks,

return selected_segments;
}

// Executes the command and returns stderr output
std::string exec_cmd(std::string_view cmd)
{
// Switch stderr and stdout to only capture stderr
auto const redirected_cmd = std::string{"( "}.append(cmd).append(" 3>&2 2>&1 1>&3) 2>/dev/null");
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(redirected_cmd.c_str(), "r"), pclose);
CUDF_EXPECTS(pipe != nullptr, "popen() failed");

std::array<char, 128> buffer;
std::string error_out;
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
error_out += buffer.data();
}
return error_out;
}

void try_drop_l3_cache()
{
static bool is_drop_cache_enabled = std::getenv("CUDF_BENCHMARK_DROP_CACHE") != nullptr;
if (not is_drop_cache_enabled) { return; }

std::array drop_cache_cmds{"/sbin/sysctl vm.drop_caches=3", "sudo /sbin/sysctl vm.drop_caches=3"};
CUDF_EXPECTS(std::any_of(drop_cache_cmds.cbegin(),
drop_cache_cmds.cend(),
[](auto& cmd) { return exec_cmd(cmd).empty(); }),
"Failed to execute the drop cache command");
}
14 changes: 12 additions & 2 deletions cpp/benchmarks/io/cuio_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

#pragma once

#include <cudf_test/file_utilities.hpp>

#include <cudf/io/data_sink.hpp>
#include <cudf/io/datasource.hpp>
#include <cudf/io/types.hpp>

#include <cudf_test/file_utilities.hpp>

using cudf::io::io_type;

#define RD_BENCHMARK_DEFINE_ALL_SOURCES(benchmark, name, type_or_group) \
Expand Down Expand Up @@ -132,3 +132,13 @@ std::vector<std::string> select_column_names(std::vector<std::string> const& col
* The segments could be Parquet row groups or ORC stripes.
*/
std::vector<cudf::size_type> segments_in_chunk(int num_segments, int num_chunks, int chunk);

/**
* @brief Drops L3 cache if `CUDF_BENCHMARK_DROP_CACHE` environment variable is set.
*
* Has no effect if the environment variable is not set.
* May require sudo access ro run successfully.
*
* @throw cudf::logic_error if the environment variable is set and the command fails
*/
void try_drop_l3_cache();
4 changes: 2 additions & 2 deletions cpp/benchmarks/io/orc/orc_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
Expand Down Expand Up @@ -60,6 +58,7 @@ void BM_orc_read_varying_input(benchmark::State& state)

auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
cudf_io::read_orc(read_opts);
}
Expand Down Expand Up @@ -117,6 +116,7 @@ void BM_orc_read_varying_options(benchmark::State& state)
cudf::size_type const chunk_row_cnt = view.num_rows() / num_chunks;
auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0

cudf::size_type rows_read = 0;
Expand Down
4 changes: 1 addition & 3 deletions cpp/benchmarks/io/orc/orc_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
* limitations under the License.
*/

#include "cudf/io/types.hpp"
#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf/io/orc.hpp>
#include <cudf/io/types.hpp>

// to enable, run cmake with -DBUILD_BENCHMARKS=ON

Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/io/parquet/parquet_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
Expand Down Expand Up @@ -60,6 +58,7 @@ void BM_parq_read_varying_input(benchmark::State& state)

auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer const raii(state, true); // flush_l2_cache = true, stream = 0
cudf_io::read_parquet(read_opts);
}
Expand Down Expand Up @@ -117,6 +116,7 @@ void BM_parq_read_varying_options(benchmark::State& state)
cudf::size_type const chunk_row_cnt = view.num_rows() / num_chunks;
auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0

cudf::size_type rows_read = 0;
Expand Down
2 changes: 0 additions & 2 deletions cpp/benchmarks/io/parquet/parquet_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
Expand Down
11 changes: 2 additions & 9 deletions cpp/benchmarks/io/parquet/parquet_writer_chunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>

#include <cudf/column/column.hpp>
#include <cudf/table/table.hpp>

#include <cudf_test/base_fixture.hpp>
#include <cudf_test/column_utilities.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/io/cuio_common.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf/column/column.hpp>
#include <cudf/io/parquet.hpp>
#include <cudf/table/table.hpp>

// to enable, run cmake with -DBUILD_BENCHMARKS=ON

Expand Down
6 changes: 2 additions & 4 deletions cpp/benchmarks/io/text/multibyte_split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
#include <benchmarks/io/cuio_common.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf_test/column_wrapper.hpp>

#include <cudf_test/file_utilities.hpp>

#include <cudf/column/column_factories.hpp>
#include <cudf/io/text/data_chunk_source_factories.hpp>
#include <cudf/io/text/multibyte_split.hpp>
#include <cudf/scalar/scalar_factories.hpp>
Expand All @@ -38,8 +37,6 @@
#include <fstream>
#include <memory>

using cudf::test::fixed_width_column_wrapper;

temp_directory const temp_dir("cudf_gbench");

enum data_chunk_source_type {
Expand Down Expand Up @@ -137,6 +134,7 @@ static void BM_multibyte_split(benchmark::State& state)

auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
try_drop_l3_cache();
cuda_event_timer raii(state, true);
auto output = cudf::io::text::multibyte_split(*source, delim);
}
Expand Down
9 changes: 4 additions & 5 deletions cpp/benchmarks/iterator/iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* limitations under the License.
*/

#include "../fixture/benchmark_fixture.hpp"
#include "../synchronization/synchronization.hpp"
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf_test/column_wrapper.hpp>

#include <cudf/detail/iterator.cuh>
#include <cudf/detail/utilities/device_operators.cuh>
#include <cudf/detail/utilities/vector_factories.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <rmm/device_uvector.hpp>

Expand All @@ -31,8 +32,6 @@
#include <thrust/iterator/transform_iterator.h>
#include <thrust/pair.h>

#include <benchmark/benchmark.h>

#include <random>

template <typename T>
Expand Down
4 changes: 1 addition & 3 deletions cpp/benchmarks/join/join_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>

#include <cudf_test/base_fixture.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <cudf/ast/expressions.hpp>
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/valid_if.cuh>
#include <cudf/filling.hpp>
#include <cudf/join.hpp>
Expand Down
11 changes: 4 additions & 7 deletions cpp/benchmarks/merge/merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <cudf/column/column.hpp>
#include <cudf/merge.hpp>
#include <cudf/table/table.hpp>
#include <cudf/table/table_view.hpp>

#include <cudf/merge.hpp>

#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <thrust/iterator/constant_iterator.h>

#include <random>
Expand Down
2 changes: 0 additions & 2 deletions cpp/benchmarks/null_mask/set_null_mask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include <cudf/null_mask.hpp>

#include <benchmark/benchmark.h>

class SetNullmask : public cudf::benchmark {
};

Expand Down
1 change: 0 additions & 1 deletion cpp/benchmarks/reduction/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/benchmarks/replace/clamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/benchmarks/replace/nans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <benchmark/benchmark.h>
#include <benchmarks/common/generate_input.hpp>
#include <benchmarks/fixture/benchmark_fixture.hpp>
#include <benchmarks/synchronization/synchronization.hpp>
Expand Down
Loading

0 comments on commit 4695697

Please sign in to comment.