-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data Plane - Initial P2P and RDMA Get (#112)
This PR is the first stage of bring back the data plane to the SRF runtime. This adds the following to the `data_plane` namespace: - `Callbacks` - a struct of static methods used to handle UCX callback on locally initiated UCX transactions, e.g. issuing a tagged send or and RDMA GET. - `Request` - a struct which holds the state of an async transaction. This object holds a bit more data than just a promise/future pair. I figure the API will have two ways to kick off an async transaction, one that takes a ref to a `Request` and another that return a `Request`. The latter requires a heap allocation, so the former could be used as a subtle optimization for structured concurrency. - `DataPlaneServerWorker` which is the Runnable that drives the UCX worker's progress method which ultimately executes the UCX callbacks. More functionality will be added to this component over time, specifically using `ucp_nb_probe` to match any incoming events who's payloads were larger than the pre-posted buffers. The remaining work in this PR is moving the ucx tests into the internal tests binary and re-enables the RDMA get test. This is not a complete implementation of the UCX Data Plane. #144 was created to address the WIP state. Authors: - Ryan Olson (https://github.com/ryanolson) Approvers: - Devin Robison (https://github.com/drobison00) URL: #112
- Loading branch information
Showing
36 changed files
with
987 additions
and
522 deletions.
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,5 @@ | ||
# Work In Progress | ||
|
||
Files in this directory should be considered a WIP up until this file is removed from the directory. | ||
|
||
See: https://github.com/nv-morpheus/SRF/issues/144 |
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,87 @@ | ||
/** | ||
* SPDX-FileCopyrightText: Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include "internal/data_plane/callbacks.hpp" | ||
|
||
#include "internal/data_plane/request.hpp" | ||
|
||
#include <glog/logging.h> | ||
#include <ucp/api/ucp.h> | ||
|
||
namespace srf::internal::data_plane { | ||
|
||
void Callbacks::send(void* request, ucs_status_t status, void* user_data) | ||
{ | ||
DVLOG(10) << "send callback start for request " << request; | ||
|
||
DCHECK(user_data); | ||
auto* user_req = static_cast<Request*>(user_data); | ||
DCHECK(user_req->m_state == Request::State::Running); | ||
|
||
if (user_req->m_rkey != nullptr) | ||
{ | ||
ucp_rkey_destroy(reinterpret_cast<ucp_rkey_h>(user_req->m_rkey)); | ||
} | ||
|
||
if (status == UCS_OK) | ||
{ | ||
ucp_request_free(request); | ||
user_req->m_request = nullptr; | ||
user_req->m_state = Request::State::OK; | ||
} | ||
|
||
else if (status == UCS_ERR_CANCELED) | ||
{ | ||
ucp_request_free(request); | ||
user_req->m_request = nullptr; | ||
user_req->m_state = Request::State::Cancelled; | ||
} | ||
else | ||
{ | ||
// todo(ryan) - set the promise exception ptr | ||
LOG(FATAL) << "data_plane: pre_posted_recv_callback failed with status: " << ucs_status_string(status); | ||
user_req->m_state = Request::State::Error; | ||
} | ||
} | ||
|
||
void Callbacks::recv(void* request, ucs_status_t status, const ucp_tag_recv_info_t* msg_info, void* user_data) | ||
{ | ||
DCHECK(user_data); | ||
auto* user_req = static_cast<Request*>(user_data); | ||
DCHECK(user_req->m_state == Request::State::Running); | ||
|
||
if (status == UCS_OK) // cpp20 [[likely]] | ||
{ | ||
ucp_request_free(request); | ||
user_req->m_request = nullptr; | ||
user_req->m_state = Request::State::OK; | ||
} | ||
else if (status == UCS_ERR_CANCELED) | ||
{ | ||
ucp_request_free(request); | ||
user_req->m_request = nullptr; | ||
user_req->m_state = Request::State::Cancelled; | ||
} | ||
else | ||
{ | ||
// todo(ryan) - set the promise exception ptr | ||
LOG(FATAL) << "data_plane: pre_posted_recv_callback failed with status: " << ucs_status_string(status); | ||
user_req->m_state = Request::State::Error; | ||
} | ||
} | ||
|
||
} // namespace srf::internal::data_plane |
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.