forked from openucx/ucc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TL/UCP: Add stubs for sliding window allreduce
- Loading branch information
Showing
15 changed files
with
648 additions
and
53 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
90 changes: 90 additions & 0 deletions
90
src/components/tl/ucp/allreduce/allreduce_sliding_window.c
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,90 @@ | ||
/** | ||
* Copyright(c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#include "allreduce.h" | ||
#include "allreduce_sliding_window.h" | ||
#include "../allgather/allgather.h" | ||
#include "../barrier/barrier.h" | ||
#include "utils/ucc_dt_reduce.h" | ||
#include "tl_ucp_ep.h" | ||
|
||
|
||
static inline void //NOLINT | ||
ucc_tl_ucp_allreduce_sliding_window_reset_buf(ucc_tl_ucp_allreduce_sw_buf_t __attribute__((unused)) *buf) //NOLINT | ||
{ | ||
} | ||
|
||
static inline void ucc_tl_ucp_allreduce_sliding_window_reset_pipeline( //NOLINT | ||
ucc_tl_ucp_allreduce_sw_pipeline_t __attribute__((unused)) *pipe, ucc_rank_t __attribute__((unused)) rank, //NOLINT | ||
size_t __attribute__((unused)) put_window_size) //NOLINT | ||
{ | ||
} | ||
|
||
ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_start(ucc_coll_task_t __attribute__((unused)) *coll_task) //NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_finalize(ucc_coll_task_t __attribute__((unused)) *coll_task) //NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
static inline void ucc_tl_ucp_allreduce_sliding_window_reduction( | ||
ucc_coll_task_t __attribute__((unused)) *coll_task, ucc_tl_ucp_allreduce_sw_buf_t __attribute__((unused)) *accbuf,//NOLINT | ||
ucc_tl_ucp_allreduce_sw_buf_t __attribute__((unused)) *getbuf)//NOLINT | ||
{ | ||
} | ||
|
||
static inline void | ||
ucc_tl_ucp_allreduce_sliding_window_test_reduction(ucc_tl_ucp_task_t __attribute__((unused)) *task)//NOLINT | ||
{ | ||
} | ||
|
||
static inline ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_req_test(ucs_status_ptr_t __attribute__((unused)) request,//NOLINT | ||
ucc_tl_ucp_task_t __attribute__((unused)) *task)//NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
static inline void ucc_tl_ucp_allreduce_sliding_window_allgather_info_test(//NOLINT | ||
ucc_coll_task_t __attribute__((unused)) *coll_task)//NOLINT | ||
{ | ||
} | ||
|
||
static inline void ucc_tl_ucp_allreduce_sliding_window_allgather_free_rkeys(//NOLINT | ||
ucc_coll_task_t __attribute__((unused)) *coll_task)//NOLINT | ||
{ | ||
} | ||
|
||
static inline void | ||
ucc_tl_ucp_allreduce_sliding_window_barrier(ucc_coll_task_t __attribute__((unused)) *coll_task)//NOLINT | ||
{ | ||
} | ||
|
||
void ucc_tl_ucp_allreduce_sliding_window_progress(ucc_coll_task_t *coll_task)//NOLINT | ||
{ | ||
ucs_status_ptr_t request = 0; | ||
ucc_tl_ucp_task_t *task = NULL; | ||
ucc_tl_ucp_allreduce_sw_buf_t *accbuf = NULL; | ||
ucc_tl_ucp_allreduce_sw_buf_t *getbuf = NULL; | ||
ucc_tl_ucp_allreduce_sw_pipeline_t *pipe = NULL; | ||
|
||
// suppress "function unused" Werrors | ||
ucc_tl_ucp_allreduce_sliding_window_barrier(coll_task); | ||
ucc_tl_ucp_allreduce_sliding_window_allgather_free_rkeys(coll_task); | ||
ucc_tl_ucp_allreduce_sliding_window_allgather_info_test(coll_task); | ||
ucc_tl_ucp_allreduce_sliding_window_req_test(request, task); | ||
ucc_tl_ucp_allreduce_sliding_window_test_reduction(task); | ||
ucc_tl_ucp_allreduce_sliding_window_reduction(coll_task, accbuf, getbuf); | ||
ucc_tl_ucp_allreduce_sliding_window_finalize(coll_task); | ||
ucc_tl_ucp_allreduce_sliding_window_start(coll_task); | ||
ucc_tl_ucp_allreduce_sliding_window_reset_pipeline(pipe, 0, 0); | ||
ucc_tl_ucp_allreduce_sliding_window_reset_buf(accbuf); | ||
} |
77 changes: 77 additions & 0 deletions
77
src/components/tl/ucp/allreduce/allreduce_sliding_window.h
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,77 @@ | ||
/** | ||
* Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#ifndef ALLREDUCE_SW_H_ | ||
#define ALLREDUCE_SW_H_ | ||
|
||
#include "tl_ucp_coll.h" | ||
|
||
#define ALLREDUCE_PACKED_KEY_MAX_LEN 1024 | ||
|
||
typedef struct ucc_tl_ucp_allreduce_sw_global_work_buf_info { | ||
void *packed_src_memh; | ||
void *packed_dst_memh; | ||
} ucc_tl_ucp_allreduce_sw_global_work_buf_info_t; | ||
|
||
typedef enum ucc_tl_ucp_allreduce_sw_buf_state | ||
{ | ||
FREE, | ||
RECVING, | ||
REDUCING, | ||
REDUCED, | ||
SENDING, | ||
IDLE, | ||
} ucc_tl_ucp_allreduce_sw_buf_state_t; | ||
|
||
typedef struct ucc_tl_ucp_allreduce_sw_buf { | ||
void *buf; | ||
ucc_tl_ucp_allreduce_sw_buf_state_t state; | ||
ucs_status_ptr_t ucp_req; | ||
size_t count; | ||
size_t bytes; | ||
} ucc_tl_ucp_allreduce_sw_buf_t; | ||
|
||
typedef struct ucc_tl_ucp_allreduce_sw_pipeline { | ||
ucc_tl_ucp_allreduce_sw_buf_t accbuf; | ||
ucc_tl_ucp_allreduce_sw_buf_t *getbuf; | ||
ucs_status_ptr_t *put_requests; | ||
size_t buffer_size; | ||
size_t num_buffers; | ||
size_t avail_buffs; | ||
size_t my_count; | ||
size_t my_offset; | ||
size_t count_issued; | ||
size_t count_received; | ||
size_t count_reduced; | ||
size_t count_serviced; | ||
size_t get_idx; | ||
size_t red_idx; | ||
ucc_rank_t src_rank; | ||
ucc_rank_t dst_rank; | ||
int done_get; | ||
int done_red; | ||
int done_put; | ||
int posted_put; | ||
} ucc_tl_ucp_allreduce_sw_pipeline_t; | ||
|
||
struct ucc_tl_ucp_allreduce_sw_export_buf { | ||
ucp_context_h ucp_context; | ||
ucp_mem_h memh; | ||
void *packed_memh; | ||
size_t packed_memh_len; | ||
void *packed_key; | ||
size_t packed_key_len; | ||
uint64_t memh_id; | ||
}; | ||
|
||
typedef struct ucc_tl_ucp_allreduce_sw_host_allgather { | ||
void *src_buf; | ||
void *dst_buf; | ||
char packed_src_key[ALLREDUCE_PACKED_KEY_MAX_LEN]; | ||
char packed_dst_key[ALLREDUCE_PACKED_KEY_MAX_LEN]; | ||
} ucc_tl_ucp_allreduce_sw_host_allgather_t; | ||
|
||
#endif |
43 changes: 43 additions & 0 deletions
43
src/components/tl/ucp/allreduce/allreduce_sliding_window_setup.c
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,43 @@ | ||
/** | ||
* Copyright(c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#include "allreduce.h" | ||
#include "allreduce_sliding_window.h" | ||
#include "../allgather/allgather.h" | ||
#include "utils/ucc_dt_reduce.h" | ||
#include "tl_ucp_ep.h" | ||
|
||
ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_alloc_pipe( | ||
ucc_base_coll_args_t __attribute__((unused)) *coll_args,//NOLINT | ||
ucc_base_team_t __attribute__((unused)) *team,//NOLINT | ||
ucc_tl_ucp_task_t __attribute__((unused)) *task)//NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_task_init( | ||
ucc_base_coll_args_t __attribute__((unused)) *coll_args,//NOLINT | ||
ucc_base_team_t __attribute__((unused)) *team,//NOLINT | ||
ucc_tl_ucp_task_t __attribute__((unused)) *task)//NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
ucc_status_t ucc_tl_ucp_allreduce_sliding_window_allgather_info_finalize(//NOLINT | ||
ucc_service_coll_req_t __attribute__((unused)) *scoll_req, //NOLINT | ||
ucc_tl_ucp_task_t __attribute__((unused)) *sw_task)//NOLINT | ||
{ | ||
return UCC_OK; | ||
} | ||
|
||
ucc_status_t | ||
ucc_tl_ucp_allreduce_sliding_window_free_gwbi( | ||
ucc_coll_task_t __attribute__((unused)) *coll_task)//NOLINT | ||
{ | ||
return UCC_OK; | ||
} |
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
Oops, something went wrong.