Skip to content

Commit

Permalink
Upgrade RMM version to 23.06 (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwharris authored Jul 7, 2023
1 parent d96910b commit 17a7c07
Show file tree
Hide file tree
Showing 28 changed files with 87 additions and 80 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ option(MRC_USE_CONDA "Enables finding dependencies via conda. All dependencies m
environment" ON)
option(MRC_USE_IWYU "Enable running include-what-you-use as part of the build process" OFF)

set(MRC_RAPIDS_VERSION "23.02" CACHE STRING "Which version of RAPIDS to build for. Sets default versions for RAPIDS CMake and RMM.")
set(MRC_RAPIDS_VERSION "23.06" CACHE STRING "Which version of RAPIDS to build for. Sets default versions for RAPIDS CMake and RMM.")

set(MRC_CACHE_DIR "${CMAKE_SOURCE_DIR}/.cache" CACHE PATH "Directory to contain all CPM and CCache data")
mark_as_advanced(MRC_CACHE_DIR)
Expand Down
11 changes: 5 additions & 6 deletions ci/conda/environments/dev_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ dependencies:
- gflags=2.2
- git>=2.35.3 # Needed for wildcards on safe.directory
- glog=0.6
- gmock=1.10
- gmock=1.13
- graphviz=3.0
- grpc-cpp=1.48
- gtest=1.10
- grpc-cpp=1.51
- gtest=1.13
- gxx=11.2 # Specifies which versions of GXX and GCC to use
- isort
- jinja2=3.0
- lcov=1.15
- libhwloc=2.5
- libprotobuf=3.21
- librmm=23.02
- librmm=23.06
- libtool
- ninja=1.10
- nlohmann_json=3.9
Expand All @@ -61,9 +61,8 @@ dependencies:
- pytest-timeout
- python=3.10
- scikit-build>=0.17
- spdlog=1.8.5
- sysroot_linux-64=2.17
- ucx=1.13
- ucx=1.14
- yapf

# Remove once `mamba repoquery whoneeds cudatoolkit` is empty. For now, we need to specify a version
Expand Down
2 changes: 1 addition & 1 deletion ci/conda/recipes/libmrc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export CXX=${GXX}
# Common CMake args
CMAKE_ARGS="-DBUILD_SHARED_LIBS=ON ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${MRC_BUILD_TYPE} ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES=-"ALL"} ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES=-"RAPIDS"} ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_INSTALL_LIBDIR=lib ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=$PREFIX ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_MESSAGE_CONTEXT_SHOW=ON ${CMAKE_ARGS}"
Expand Down
18 changes: 12 additions & 6 deletions ci/conda/recipes/libmrc/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,36 @@ cuda_compiler_version:
python:
- 3.8
- 3.10
- 3.10

# Setup the dependencies to build with multiple versions of RAPIDS
rapids_version: # Keep around compatibility with current version -1
- 22.12
rapids_version: # Keep around compatibility with current version -2
- 23.02
- 23.04
- 23.06

# Multiple versions of abseil are required to satisfy the solver for some
# environments. RAPIDS 22.06 only works with gRPC 1.45 and 22.08 only works with
# 1.46. For each version of gRPC, support 2 abseil versions. Zip all of the keys
# together to avoid impossible combinations
libabseil:
- 20220623.0
- 20230125.0
- 20230125.0
- 20230125.0

grpc_cpp:
- 1.46
- 1.51
- 1.51
- 1.51

ucx:
- 1.13
- 1.13
- 1.14
- 1.14

libprotobuf:
- 3.20
- 3.21
- 3.21
- 3.21

zip_keys:
Expand Down
7 changes: 3 additions & 4 deletions ci/conda/recipes/libmrc/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ source:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
script_env:
- CMAKE_CUDA_ARCHITECTURES=ALL
- CMAKE_CUDA_ARCHITECTURES=RAPIDS
- MRC_CACHE_DIR
- PARALLEL_LEVEL
include_recipe: False
Expand Down Expand Up @@ -58,9 +58,9 @@ requirements:
- flatbuffers 2.0.*
- gflags
- glog
- gmock 1.10.*
- gmock 1.13.*
- grpc-cpp
- gtest 1.10.*
- gtest 1.13.*
- libabseil
- libhwloc 2.5.*
- libprotobuf
Expand All @@ -70,7 +70,6 @@ requirements:
- pybind11-stubgen 0.10.5
- python {{ python }}
- scikit-build >=0.17
- spdlog 1.8.5
- ucx
# Need to specify cudatoolkit to get correct version. Remove once all libraries migrate to cuda-toolkit
- cudatoolkit {{ cuda_version }}.*
Expand Down
2 changes: 1 addition & 1 deletion ci/conda/recipes/run_conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fi
# Choose default variants
if hasArg quick; then
# For quick build, just do most recent version of rapids
CONDA_ARGS_ARRAY+=("--variants" "{rapids_version: 23.02}")
CONDA_ARGS_ARRAY+=("--variants" "{rapids_version: 23.06}")
fi

# And default channels
Expand Down
3 changes: 3 additions & 0 deletions ci/iwyu/mappings.imp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@

# gprc
{ "include": ["@<grpcpp/impl/.*>", "private", "<grpcpp/grpcpp.h>", "public"] },
{ "include": ["@<grpcpp/.*>", "private", "<grpcpp/grpcpp.h>", "public"] },
{ "include": ["@<grpc/impl/.*>", "private", "<grpcpp/grpcpp.h>", "public"] },
{ "include": ["@<grpc/.*>", "private", "<grpcpp/grpcpp.h>", "public"] },
{ "symbol": ["@grpc::.*", "private", "<grpcpp/grpcpp.h>", "public"] },

# nlohmann json
{ "include": ["<nlohmann/detail/iterators/iter_impl.hpp>", "private", "<nlohmann/json.hpp>", "public"] },
Expand Down
11 changes: 2 additions & 9 deletions cpp/mrc/include/mrc/memory/resources/arena_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <cuda_runtime_api.h>
#include <glog/logging.h>
#include <rmm/detail/error.hpp>
#include <rmm/detail/logging_assert.hpp>
#include <rmm/logger.hpp>
#include <spdlog/common.h>

#include <cstddef>
#include <map>
Expand Down Expand Up @@ -107,12 +107,7 @@ class arena_resource final : public adaptor<Upstream>
adaptor<Upstream>(std::move(upstream_mr)),
global_arena_(std::make_shared<global_arena>(&this->resource(), initial_size, maximum_size)),
dump_log_on_failure_(dump_log_on_failure)
{
if (dump_log_on_failure_)
{
logger_ = spdlog::basic_logger_mt("arena_memory_dump", "rmm_arena_memory_dump.log");
}
}
{}

~arena_resource() override = default;

Expand Down Expand Up @@ -316,8 +311,6 @@ class arena_resource final : public adaptor<Upstream>
// std::map<cudaStream_t, arena> stream_arenas_;
/// If true, dump memory information to log on allocation failure.
bool dump_log_on_failure_; // NOLINT
/// The logger for memory dump.
std::shared_ptr<spdlog::logger> logger_{}; // NOLINT
/// Mutex for read and write locks.
mutable std::shared_timed_mutex mtx_; // NOLINT
};
Expand Down
76 changes: 39 additions & 37 deletions cpp/mrc/include/mrc/memory/resources/detail/arena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/aligned.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/logging_assert.hpp>
#include <rmm/logger.hpp>
#include <spdlog/common.h>

#include <algorithm>
#include <cstddef>
Expand Down Expand Up @@ -400,29 +400,30 @@ class global_arena final
}
}

/**
* @brief Dump memory to log.
*
* @param logger the spdlog logger to use
*/
void dump_memory_log(std::shared_ptr<spdlog::logger> const& logger) const
{
lock_guard lock(mtx_);
// /**
// * @brief Dump memory to log.
// *
// * @param logger the spdlog logger to use
// */
// void dump_memory_log(std::shared_ptr<spdlog::logger> const& logger) const
// {
// lock_guard lock(mtx_);

logger->info(" Maximum size: {}", rmm::detail::bytes{maximum_size_});
logger->info(" Current size: {}", rmm::detail::bytes{current_size_});
// logger->info(" Maximum size: {}", rmm::detail::bytes{maximum_size_});
// logger->info(" Current size: {}", rmm::detail::bytes{current_size_});

logger->info(" # free blocks: {}", free_blocks_.size());
if (!free_blocks_.empty())
{
logger->info(" Total size of free blocks: {}", rmm::detail::bytes{total_block_size(free_blocks_)});
auto const largest_free = *std::max_element(free_blocks_.begin(), free_blocks_.end(), block_size_compare);
logger->info(" Size of largest free block: {}", rmm::detail::bytes{largest_free.size()});
}
// logger->info(" # free blocks: {}", free_blocks_.size());
// if (!free_blocks_.empty())
// {
// logger->info(" Total size of free blocks: {}", rmm::detail::bytes{total_block_size(free_blocks_)});
// auto const largest_free = *std::max_element(free_blocks_.begin(), free_blocks_.end(),
// block_size_compare); logger->info(" Size of largest free block: {}",
// rmm::detail::bytes{largest_free.size()});
// }

logger->info(" # upstream blocks={}", upstream_blocks_.size());
logger->info(" Total size of upstream blocks: {}", rmm::detail::bytes{total_block_size(upstream_blocks_)});
}
// logger->info(" # upstream blocks={}", upstream_blocks_.size());
// logger->info(" Total size of upstream blocks: {}", rmm::detail::bytes{total_block_size(upstream_blocks_)});
// }

private:
using lock_guard = std::lock_guard<std::mutex>;
Expand Down Expand Up @@ -565,22 +566,23 @@ class arena
free_blocks_.clear();
}

/**
* Dump memory to log.
*
* @param logger the spdlog logger to use
*/
void dump_memory_log(std::shared_ptr<spdlog::logger> const& logger) const
{
lock_guard lock(mtx_);
logger->info(" # free blocks: {}", free_blocks_.size());
if (!free_blocks_.empty())
{
logger->info(" Total size of free blocks: {}", rmm::detail::bytes{total_block_size(free_blocks_)});
auto const largest_free = *std::max_element(free_blocks_.begin(), free_blocks_.end(), block_size_compare);
logger->info(" Size of largest free block: {}", rmm::detail::bytes{largest_free.size()});
}
}
// /**
// * Dump memory to log.
// *
// * @param logger the spdlog logger to use
// */
// void dump_memory_log(std::shared_ptr<spdlog::logger> const& logger) const
// {
// lock_guard lock(mtx_);
// logger->info(" # free blocks: {}", free_blocks_.size());
// if (!free_blocks_.empty())
// {
// logger->info(" Total size of free blocks: {}", rmm::detail::bytes{total_block_size(free_blocks_)});
// auto const largest_free = *std::max_element(free_blocks_.begin(), free_blocks_.end(),
// block_size_compare); logger->info(" Size of largest free block: {}",
// rmm::detail::bytes{largest_free.size()});
// }
// }

private:
using lock_guard = std::lock_guard<std::mutex>;
Expand Down
2 changes: 0 additions & 2 deletions cpp/mrc/src/internal/control_plane/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include "mrc/runnable/runner.hpp"

#include <google/protobuf/any.pb.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/security/credentials.h>
#include <rxcpp/rx.hpp>

#include <ostream>
Expand Down
1 change: 0 additions & 1 deletion cpp/mrc/src/internal/grpc/progress_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <boost/fiber/operations.hpp>
#include <glog/logging.h>
#include <grpc/support/time.h>
#include <grpcpp/grpcpp.h>

#include <chrono>
Expand Down
2 changes: 0 additions & 2 deletions cpp/mrc/src/internal/grpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "mrc/runnable/launcher.hpp"
#include "mrc/runnable/runner.hpp"

#include <grpcpp/security/server_credentials.h>

#include <memory>
#include <utility>

Expand Down
1 change: 1 addition & 0 deletions cpp/mrc/src/internal/memory/callback_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "mrc/memory/adaptors.hpp"

#include <atomic>
#include <functional>

namespace mrc::memory {

Expand Down
1 change: 0 additions & 1 deletion cpp/mrc/src/internal/memory/device_resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include <boost/fiber/future/future.hpp>
#include <glog/logging.h>
#include <spdlog/sinks/basic_file_sink.h>

#include <map>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion cpp/mrc/src/internal/memory/host_resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include <boost/fiber/future/future.hpp>
#include <glog/logging.h>
#include <spdlog/sinks/basic_file_sink.h>

#include <map>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions cpp/mrc/src/internal/ucx/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <glog/logging.h>
#include <ucp/api/ucp.h>
#include <ucp/api/ucp_compat.h>
#include <ucp/api/ucp_def.h>
#include <ucs/type/status.h> // for ucs_status_string, UCS_OK

Expand Down
3 changes: 2 additions & 1 deletion cpp/mrc/src/internal/ucx/endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "mrc/types.hpp"

#include <glog/logging.h>
#include <ucp/api/ucp.h> // for ucp_ep_close_nb, ucp_ep_create, UCP_EP_...
#include <ucp/api/ucp.h> // for ucp_ep_close_nb, ucp_ep_create, UCP_EP_...
#include <ucp/api/ucp_compat.h>
#include <ucp/api/ucp_def.h> // for ucp_ep_params_t, ucp_address_t, ucp_ep
#include <ucs/type/status.h> // for ucs_status_string, UCS_OK, UCS_PTR_STATUS

Expand Down
3 changes: 2 additions & 1 deletion cpp/mrc/src/internal/ucx/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "mrc/types.hpp"

#include <glog/logging.h>
#include <ucp/api/ucp.h> // for ucp_*
#include <ucp/api/ucp.h> // for ucp_*
#include <ucp/api/ucp_compat.h>
#include <ucp/api/ucp_def.h> // for ucp_worker_h
#include <ucs/type/status.h> // for ucs_status_string, UCS_OK
#include <ucs/type/thread_mode.h> // for UCS_THREAD_MODE_MULTI
Expand Down
5 changes: 4 additions & 1 deletion cpp/mrc/src/tests/test_grpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <boost/fiber/future/future.hpp>
#include <glog/logging.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/security/credentials.h>
#include <gtest/gtest.h>
#include <rxcpp/rx.hpp>

Expand All @@ -55,10 +54,14 @@
#include <map>
#include <memory>
#include <ostream>
#include <string>
#include <thread>
#include <utility>
#include <vector>

// Avoid forward declaring template specialization base classes
// IWYU pragma: no_forward_declare grpc::ServerAsyncReaderWriter

using namespace mrc;
using namespace mrc::codable;

Expand Down
1 change: 0 additions & 1 deletion cpp/mrc/src/tests/test_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include <glog/logging.h>
#include <gtest/gtest.h>
#include <spdlog/sinks/basic_file_sink.h>

#include <array>
#include <atomic>
Expand Down
Loading

0 comments on commit 17a7c07

Please sign in to comment.