Skip to content

Commit

Permalink
REVIEW: various fixes for DPU
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrol aderholdt committed Feb 19, 2025
1 parent 9452315 commit 41f0b4e
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 132 deletions.
6 changes: 3 additions & 3 deletions src/components/cl/basic/cl_basic_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ UCC_CLASS_CLEANUP_FUNC(ucc_cl_basic_context_t)
ucc_free(self->super.tl_ctxs);
}

ucc_status_t ucc_cl_basic_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_cl_basic_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_basic_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_cl_basic_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_basic_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_cl_basic_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **packed_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/cl/hier/cl_hier_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ ucc_cl_hier_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
return UCC_OK;
}

ucc_status_t ucc_cl_hier_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_cl_hier_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_hier_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_cl_hier_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_cl_hier_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_cl_hier_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **packed_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/cuda/tl_cuda_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ UCC_CLASS_INIT_FUNC(ucc_tl_cuda_context_t,
return status;
}

ucc_status_t ucc_tl_cuda_mem_map(const ucc_base_context_t *context,
ucc_status_t ucc_tl_cuda_mem_map(const ucc_base_context_t *context, /* NOLINT */
void *address, size_t len, void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context,
ucc_status_t ucc_tl_cuda_mem_unmap(const ucc_base_context_t *context, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_cuda_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_IMPLEMENTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/mlx5/tl_mlx5_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,20 @@ ucc_status_t ucc_tl_mlx5_context_create_epilog(ucc_base_context_t *context)
return ucc_tl_mlx5_context_ib_ctx_pd_setup(context);
}

ucc_status_t ucc_tl_mlx5_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_mlx5_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_mlx5_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_IMPLEMENTED;
}

ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_mlx5_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_IMPLEMENTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/nccl/tl_nccl_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,20 @@ ucc_tl_nccl_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
return UCC_OK;
}

ucc_status_t ucc_tl_nccl_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_nccl_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_nccl_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_nccl_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/rccl/tl_rccl_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ ucc_tl_rccl_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
return UCC_OK;
}

ucc_status_t ucc_tl_rccl_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_rccl_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_rccl_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_rccl_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/self/tl_self_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ ucc_tl_self_get_context_attr(const ucc_base_context_t *context, /* NOLINT */
return UCC_OK;
}

ucc_status_t ucc_tl_self_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_self_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_self_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_self_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
6 changes: 3 additions & 3 deletions src/components/tl/sharp/tl_sharp_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,20 +512,20 @@ ucc_status_t ucc_tl_sharp_get_context_attr(const ucc_base_context_t *context, /*
return UCC_OK;
}

ucc_status_t ucc_tl_sharp_mem_map(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_sharp_mem_map(const ucc_base_context_t *context, int type, /* NOLINT */
void *address, size_t len, void *memh,
void *tl_h)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type,
ucc_status_t ucc_tl_sharp_mem_unmap(const ucc_base_context_t *context, int type, /* NOLINT */
void *memh)
{
return UCC_ERR_NOT_SUPPORTED;
}

ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context,
ucc_status_t ucc_tl_sharp_memh_pack(const ucc_base_context_t *context, /* NOLINT */
void *memh, void **pack_buffer)
{
return UCC_ERR_NOT_SUPPORTED;
Expand Down
8 changes: 4 additions & 4 deletions src/components/tl/ucp/alltoall/alltoall_onesided.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ ucc_status_t ucc_tl_ucp_alltoall_onesided_start(ucc_coll_task_t *ctask)

UCPCHECK_GOTO(
ucc_tl_ucp_put_nb((void *)(src + start * nelems), (void *)dest, nelems,
start, src_memh[start], dst_memh[start], team, task),
start, *src_memh, dst_memh[start], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, start, src_memh[start],
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, start, *src_memh,
dst_memh[start], team),
task, out);

for (peer = (start + 1) % gsize; peer != start; peer = (peer + 1) % gsize) {
UCPCHECK_GOTO(ucc_tl_ucp_put_nb(
(void *)(src + peer * nelems), (void *)dest, nelems,
peer, src_memh[peer], dst_memh[peer], team, task),
peer, *src_memh, dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer],
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, *src_memh,
dst_memh[peer], team),
task, out);
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/tl/ucp/alltoallv/alltoallv_onesided.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ ucc_status_t ucc_tl_ucp_alltoallv_onesided_start(ucc_coll_task_t *ctask)

UCPCHECK_GOTO(ucc_tl_ucp_put_nb(PTR_OFFSET(src, sd_disp),
PTR_OFFSET(dest, dd_disp),
data_size, peer, src_memh[peer],
data_size, peer, *src_memh,
dst_memh[peer], team, task),
task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, src_memh[peer],
dst_memh[peer], team), task, out);
UCPCHECK_GOTO(ucc_tl_ucp_atomic_inc(pSync, peer, *src_memh, dst_memh[peer], team), task, out);
}
return ucc_progress_queue_enqueue(UCC_TL_CORE_CTX(team)->pq, &task->super);
out:
Expand Down
18 changes: 18 additions & 0 deletions src/components/tl/ucp/tl_ucp.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,24 @@ extern ucc_config_field_t ucc_tl_ucp_lib_config_table[];
#define UCC_TL_UCP_REMOTE_RKEY(_ctx, _rank, _seg) \
((_ctx)->rkeys[_rank * _ctx->n_rinfo_segs + _seg])

#define UCC_TL_UCP_MEMH_TL_HEADERS 2

#define UCC_TL_UCP_MEMH_TL_PACKED_HEADERS 2

#define UCC_TL_UCP_MEMH_TL_HEADER_SIZE \
(sizeof(size_t) * UCC_TL_UCP_MEMH_TL_HEADERS)

#define UCC_TL_UCP_MEMH_TL_PACKED_HEADER_SIZE \
(sizeof(size_t) * \
(UCC_TL_UCP_MEMH_TL_HEADERS + UCC_TL_UCP_MEMH_TL_PACKED_HEADERS))

#define UCC_TL_UCP_MEMH_TL_KEY_SIZE(buffer) \
(*(size_t *)(PTR_OFFSET(buffer, UCC_TL_UCP_MEMH_TL_HEADER_SIZE)))

#define UCC_TL_UCP_MEMH_TL_PACKED_MEMH(buffer) \
(PTR_OFFSET(buffer, UCC_TL_UCP_MEMH_TL_PACKED_HEADER_SIZE + \
UCC_TL_UCP_MEMH_TL_KEY_SIZE(buffer)))

extern ucs_memory_type_t ucc_memtype_to_ucs[UCC_MEMORY_TYPE_LAST+1];

void ucc_tl_ucp_pre_register_mem(ucc_tl_ucp_team_t *team, void *addr,
Expand Down
Loading

0 comments on commit 41f0b4e

Please sign in to comment.