Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ CODEOWNERS @ai-dynamo/Devops @ai-dynamo/nixl-maintainers
/src/bindings/python @ovidiusm @mkhazraee @roiedanino
/src/bindings/rust @roiedanino @gleon99 @mkhazraee

# UCX Plugins
/src/plugins/ucx* @brminich @yosefe @gleon99
/src/utils/ucx @brminich @yosefe @gleon99
# UCX Plugin
/src/plugins/ucx @brminich @yosefe @gleon99

# Storage Plugins
/src/plugins/posix @w1ldptr @barneuman @etoledano @vvenkates27
Expand Down
20 changes: 9 additions & 11 deletions src/utils/ucx/config.cpp → src/plugins/ucx/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@

namespace nixl::ucx {
void
config::modify (std::string_view key, std::string_view value) const {
const char *env_val = std::getenv (absl::StrFormat ("UCX_%s", key.data()).c_str());
config::modify(std::string_view key, std::string_view value) const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it is impossible to avoid formatting changes for the moved files.

const char *env_val = std::getenv(absl::StrFormat("UCX_%s", key.data()).c_str());
if (env_val) {
NIXL_DEBUG << "UCX env var has already been set: " << key << "=" << env_val;
} else {
modifyAlways (key, value);
modifyAlways(key, value);
}
}

void
config::modifyAlways (std::string_view key, std::string_view value) const {
const auto status = ucp_config_modify (config_.get(), key.data(), value.data());
config::modifyAlways(std::string_view key, std::string_view value) const {
const auto status = ucp_config_modify(config_.get(), key.data(), value.data());
if (status != UCS_OK) {
NIXL_WARN << "Failed to modify UCX config: " << key << "=" << value << ": "
<< ucs_status_string (status);
<< ucs_status_string(status);
} else {
NIXL_DEBUG << "Modified UCX config: " << key << "=" << value;
}
Expand All @@ -47,12 +47,10 @@ config::modifyAlways (std::string_view key, std::string_view value) const {
ucp_config_t *
config::readUcpConfig() {
ucp_config_t *config = nullptr;
const auto status = ucp_config_read (NULL, NULL, &config);
const auto status = ucp_config_read(nullptr, nullptr, &config);
if (status != UCS_OK) {
const auto err_str =
std::string ("Failed to create UCX config: ") + ucs_status_string (status);
NIXL_ERROR << err_str;
throw std::runtime_error (err_str);
throw std::runtime_error("Failed to create UCX config: " +
std::string(ucs_status_string(status)));
}
return config;
}
Expand Down
8 changes: 4 additions & 4 deletions src/utils/ucx/config.h → src/plugins/ucx/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ class config {

// Modify the config if it is not already set via environment variable
void
modify (std::string_view key, std::string_view value) const;
modify(std::string_view key, std::string_view value) const;

// Modify the config always
void
modifyAlways (std::string_view key, std::string_view value) const;
modifyAlways(std::string_view key, std::string_view value) const;

private:
[[nodiscard]] static ucp_config_t *
readUcpConfig();

const std::unique_ptr<ucp_config_t, void (*) (ucp_config_t *)> config_{readUcpConfig(),
&ucp_config_release};
const std::unique_ptr<ucp_config_t, void (*)(ucp_config_t *)> config_{readUcpConfig(),
&ucp_config_release};
};
} // namespace nixl::ucx

Expand Down
File renamed without changes.
File renamed without changes.
35 changes: 27 additions & 8 deletions src/plugins/ucx/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,46 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ucx_utils_dep = declare_dependency(link_with: ucx_utils_lib, include_directories: utils_inc_dirs )
asio_dep = [dependency('asio', required: true)]

compile_flags = []
if cuda_dep.found()
compile_flags = [ '-DHAVE_CUDA' ]
endif

ucx_backend_includes = include_directories('.')

ucx_backend_sources = ['config.cpp',
'gpu_xfer_req_h.cpp',
'rkey.cpp',
'ucx_backend.cpp',
'ucx_plugin.cpp',
'ucx_utils.cpp']

ucx_backend_dependencies = [asio_dep,
cuda_dep,
nixl_common_dep,
nixl_infra,
serdes_interface,
thread_dep,
ucx_dep]

ucx_backend_include_directories = [nixl_inc_dirs,
utils_inc_dirs]

if 'UCX' in static_plugins
ucx_backend_lib = static_library('UCX',
'ucx_backend.cpp', 'ucx_backend.h', 'ucx_plugin.cpp',
dependencies: [nixl_infra, ucx_utils_dep, serdes_interface, cuda_dep, ucx_dep, thread_dep, nixl_common_dep, asio_dep],
include_directories: nixl_inc_dirs,
ucx_backend_sources,
dependencies: ucx_backend_dependencies,
include_directories: ucx_backend_include_directories,
install: false,
cpp_args : compile_flags,
name_prefix: 'libplugin_') # Custom prefix for plugin libraries
else
ucx_backend_lib = shared_library('UCX',
'ucx_backend.cpp', 'ucx_backend.h', 'ucx_plugin.cpp',
dependencies: [nixl_infra, ucx_utils_dep, serdes_interface, cuda_dep, ucx_dep, thread_dep, nixl_common_dep, asio_dep],
include_directories: nixl_inc_dirs,
ucx_backend_sources,
dependencies: ucx_backend_dependencies,
include_directories: ucx_backend_include_directories,
install: true,
cpp_args : compile_flags + ['-fPIC'],
name_prefix: 'libplugin_', # Custom prefix for plugin libraries
Expand All @@ -48,4 +67,4 @@ else
endif
endif

ucx_backend_interface = declare_dependency(link_with: ucx_backend_lib)
ucx_backend_interface = declare_dependency(link_with: ucx_backend_lib, include_directories: ucx_backend_includes)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/plugins/ucx/ucx_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "common/nixl_log.h"
#include "serdes/serdes.h"
#include "common/nixl_log.h"
#include "ucx/gpu_xfer_req_h.h"
#include "gpu_xfer_req_h.h"

#include <optional>
#include <limits>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/ucx/ucx_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

// Local includes
#include "common/nixl_time.h"
#include "ucx/rkey.h"
#include "ucx/ucx_utils.h"
#include "rkey.h"
#include "ucx_utils.h"

enum ucx_cb_op_t { NOTIF_STR };

Expand Down
Loading