Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
fd13913
Removed exp verbs and replaced ibv_exp_create_cq, ibv_exp_create_qp, …
pakmarkthub Mar 12, 2019
34bef14
Implemented peer-ops with direct-verbs
pakmarkthub Mar 22, 2019
0b1bc41
gds_poll_cq now returns wc with correct wr_id
pakmarkthub Mar 26, 2019
7028d97
Fixed the bug that causes auto-inline for message sizes <= 32B
pakmarkthub Apr 1, 2019
91b956f
Made the code compatible with gdrcopy v1 and v2
pakmarkthub Dec 24, 2019
07e9474
Added runtime gdrapi version checking
pakmarkthub Jan 16, 2020
ecaa221
Removed unused variables in gds_kernel_latency.c
pakmarkthub Jan 16, 2020
2f98818
Removed unused variables in gds_poll_lat.c
pakmarkthub Jan 16, 2020
07c7e79
Removed unused variables in gds_kernel_loopback_latency.c
pakmarkthub Jan 16, 2020
f2ddaa3
Reformatted include/gdsync/core.h
pakmarkthub Jan 16, 2020
762250a
Reformatted include/gdsync/mlx5.h
pakmarkthub Jan 16, 2020
cb55b57
Reformatted include/gdsync/tools.h
pakmarkthub Jan 16, 2020
36e328d
Reformatted include/gdsync/device.cuh
pakmarkthub Jan 16, 2020
3ca44c9
Reformatted src/archutils.h
pakmarkthub Jan 16, 2020
f0b2390
Reformatted src/mlnxutils.h
pakmarkthub Jan 16, 2020
c8856f5
Reformatted src/apis.cpp
pakmarkthub Jan 17, 2020
7c8ec51
Reformatted src/gdsync.cpp
pakmarkthub Jan 17, 2020
5a63ed2
Reformatted src/mem.cpp
pakmarkthub Jan 17, 2020
5a57862
Reformatted src/memmgr.cpp
pakmarkthub Jan 17, 2020
c1e4960
Reformatted src/mlx5.cpp
pakmarkthub Jan 17, 2020
8a3f7ed
Reformatted src/objs.cpp
pakmarkthub Jan 17, 2020
78b83e4
Reformatted src/objs.hpp
pakmarkthub Jan 17, 2020
0d03d1f
Reformatted src/task_queue.hpp
pakmarkthub Jan 17, 2020
edfda53
Reformatted src/utils.hpp
pakmarkthub Jan 17, 2020
0917a19
Reformatted tests/gpu.h
pakmarkthub Jan 17, 2020
ec02ba4
Reformatted tests/test_utils.h
pakmarkthub Jan 17, 2020
45f9c2d
Reformatted tests/gds_kernel_latency.c
pakmarkthub Jan 17, 2020
ca5cf7f
Reformatted tests/gds_kernel_loopback_latency.c
pakmarkthub Jan 17, 2020
9603aa2
Reformatted tests/gds_poll_lat.c
pakmarkthub Jan 17, 2020
a3411c8
Reformatted tests/pingpong.c
pakmarkthub Jan 17, 2020
bb03006
Reformatted tests/gds_sanity.cpp
pakmarkthub Jan 17, 2020
a0cdcb7
Reformatted tests/gpu.cpp
pakmarkthub Jan 17, 2020
3cfb0c1
Reformatted tests/rstest.cpp
pakmarkthub Jan 17, 2020
730784c
Reformatted tests/task_queue_test.cpp
pakmarkthub Jan 17, 2020
2a5a62b
Reformatted tests/gpu_kernels.cu
pakmarkthub Jan 17, 2020
95078f9
Fixed bugs and made gds_prepare_send support IBV_QPT_UD
pakmarkthub Jan 18, 2020
3a1dedc
Removed debug code in tests/gds_kernel_latency.c
pakmarkthub Jan 20, 2020
cdf600c
Enforced strict checking of the result of mlx5dv_init_obj in src/apis…
pakmarkthub Jan 20, 2020
81f981a
Added IBV_QPT_RC support
pakmarkthub Jan 21, 2020
742b98f
Added support for putting QP DBREC on GPU mem
pakmarkthub Jan 21, 2020
040ed51
Handled alignment in cuMemAlloc and implemented support for putting Q…
pakmarkthub Jan 21, 2020
dc619e7
Marked creating CQ on GPU as unsupported
pakmarkthub Jan 21, 2020
a9fe15f
Converted printf to gds_dbg in src/gdsync.cpp
pakmarkthub Jan 21, 2020
affe4a7
Removed unused code from include
pakmarkthub Jan 21, 2020
b7721c6
Removed unused code from src
pakmarkthub Jan 21, 2020
e15f28c
Removed unused code from tests/gds_kernel_*
pakmarkthub Jan 21, 2020
c1f37b4
Removed unused lines from configure.ac
pakmarkthub Jan 25, 2020
723ab7c
Fixed include/gdsync/core.h according to Davide's comments
pakmarkthub Jan 25, 2020
feb4bff
Added explanation to gds_poll_cq in core.h
pakmarkthub Jan 25, 2020
b925893
Fixed the algorithm of gds_poll_cq to check for all busy flags first
pakmarkthub Jan 31, 2020
893fbd4
Added a TODO comment in pd_mem_alloc
pakmarkthub Jan 31, 2020
a799016
Improved the mem alignment algorithm in gds_alloc_gdr_memory
pakmarkthub Jan 31, 2020
9eb5025
Moved peer-related data structures from core.h to mlx5_peer.h
pakmarkthub Jan 31, 2020
fe8c6c4
Implemented rollback
pakmarkthub Feb 1, 2020
75632b5
Moved ibv_exp_* emulation code to mlx5.cpp
pakmarkthub Feb 1, 2020
b720347
Fixed missing gds_abort_wait_cq in gds_stream_wait_cq
pakmarkthub Feb 1, 2020
1323471
Added missing gds_post_ops_on_cpu in gds_post_descriptors
pakmarkthub Feb 1, 2020
8c44fd1
Fixed some comment and code
pakmarkthub Feb 3, 2020
015fb42
Moved mlx5_related attributes in struct gds_cq to internal data struc…
pakmarkthub Feb 3, 2020
79cfa5f
Moved mlx5-specific attributes in gds_qp to internal data structures
pakmarkthub Feb 3, 2020
0334eea
Reverted the format of the comment in gds_memory_type
pakmarkthub Feb 3, 2020
d3b7e80
Checked send_flags in gds_mlx5_post_send
pakmarkthub Feb 3, 2020
78821b8
Turn gds_send_request_t and gds_wait_request_t to opaque objects
pakmarkthub Feb 4, 2020
454348e
Merge branch 'dev-gdrcopy-v2.0' into directverbs-dev
pakmarkthub Apr 20, 2020
0bc2084
Added support for all types of opcode and send_flags in gds_mlx5_post…
pakmarkthub Apr 21, 2020
6f93cad
Removed unused code and fixed the error code path in gds_mlx5_post_send
pakmarkthub Apr 22, 2020
26778ed
Made struct gds_qp be an attribute of gds_mlx5_qp
pakmarkthub Apr 22, 2020
a784aab
Moved mlx5-related create qp to gds_mlx5_create_qp
pakmarkthub Apr 22, 2020
d8a5453
Renamed gds_mlx5_qp to gds_mlx5_qp_t
pakmarkthub Apr 22, 2020
0fc4ee2
Renamed gds_mlx5_cq to gds_mlx5_cq_t
pakmarkthub Apr 22, 2020
5a884c0
Fixed bug in gds_poll_cq
Apr 24, 2020
8b97bb0
Implemented IB device type check
pakmarkthub Apr 24, 2020
51a3e90
Moved parent domain allocation to gds_mlx5_alloc_parent_domain
pakmarkthub Apr 24, 2020
f9aae49
Moved mlx5-related create and destroy cq to mlx5.cpp
pakmarkthub Apr 24, 2020
7f4af94
Fixed bugs in gds_mlx5_alloc_parent_domain
pakmarkthub Apr 24, 2020
fca6c8c
Moved gds_post_ops* to gds_mlx5_post_ops*
pakmarkthub Apr 24, 2020
fc85eb5
Merge branch 'dev-dv-consolidate-mlx5' into directverbs-dev
pakmarkthub Apr 24, 2020
b8bd6b7
Implemented pd_mem_free
pakmarkthub Apr 24, 2020
e3492f4
Moved mlx5-related poll cq to gds_mlx5_poll_cq
pakmarkthub Apr 25, 2020
38b7560
Fixed bug in mlx5_create_wq
pakmarkthub Apr 25, 2020
581ffb1
Bumped version to 3.0
Apr 25, 2020
bc92005
Fixed wait_* functions are referenced before defined
pakmarkthub May 9, 2020
33a6b27
Fixed bug in gds_mlx5_get_send_info
pakmarkthub May 9, 2020
2d4d9a7
Fixed bug in ibv_dealloc_pd inside gds_kernel_latency
May 12, 2020
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ libtool
# Debug files
*.dSYM/
*.su

# Editor files
*.swp
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ libgdsyncinclude_HEADERS = include/gdsync/core.h include/gdsync/device.cuh incl

src_libgdsync_la_CFLAGS = $(AM_CFLAGS)
src_libgdsync_la_SOURCES = src/gdsync.cpp src/memmgr.cpp src/mem.cpp src/objs.cpp src/apis.cpp src/mlx5.cpp include/gdsync.h
src_libgdsync_la_LDFLAGS = -version-info @VERSION_INFO@
src_libgdsync_la_LDFLAGS = -version-info @VERSION_INFO@ -lmlx5

noinst_HEADERS = src/mem.hpp src/memmgr.hpp src/objs.hpp src/rangeset.hpp src/utils.hpp src/archutils.h src/mlnxutils.h

Expand Down
5 changes: 0 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ dnl Checks for Verbs support
AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
AC_MSG_ERROR([ibv_get_device_list() not found. libgdsync requires libibverbs.]))

AC_CHECK_LIB(ibverbs, ibv_exp_create_qp,
AC_MSG_ERROR([ibv_exp_create_qp not found. libgdsync requires verbs extension support.]))

AC_CHECK_HEADER(infiniband/peer_ops.h, [],
AC_MSG_ERROR([<infiniband/peer_ops.h> not found. libgdsync requires verbs peer-direct support.]))
AC_HEADER_STDC

dnl Checks for typedefs, structures, and compiler characteristics.
Expand Down
2 changes: 0 additions & 2 deletions include/gdsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
*/

#include <infiniband/verbs.h>
#include <infiniband/verbs_exp.h>
#include <infiniband/peer_ops.h>

#include <cuda.h>
#include <gdrapi.h>
Expand Down
88 changes: 57 additions & 31 deletions include/gdsync/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,64 @@
#error "don't include directly this header, use gdsync.h always"
#endif

#define GDS_API_MAJOR_VERSION 2
#define GDS_API_MINOR_VERSION 2
#define GDS_API_MAJOR_VERSION 3
#define GDS_API_MINOR_VERSION 0
#define GDS_API_VERSION (((unsigned)GDS_API_MAJOR_VERSION << 16) | (unsigned)GDS_API_MINOR_VERSION)
#define GDS_API_VERSION_COMPATIBLE(v) \
( ((((v) & 0xffff0000U) >> 16) == (unsigned)GDS_API_MAJOR_VERSION) && \
((((v) & 0x0000ffffU) >> 0 ) >= (unsigned)GDS_API_MINOR_VERSION) )

#include <infiniband/mlx5dv.h>

typedef enum gds_param {
GDS_PARAM_VERSION,
GDS_NUM_PARAMS
GDS_PARAM_VERSION,
GDS_NUM_PARAMS
} gds_param_t;

int gds_query_param(gds_param_t param, int *value);

enum gds_create_qp_flags {
GDS_CREATE_QP_DEFAULT = 0,
GDS_CREATE_QP_WQ_ON_GPU = 1<<0,
GDS_CREATE_QP_TX_CQ_ON_GPU = 1<<1,
GDS_CREATE_QP_RX_CQ_ON_GPU = 1<<2,
GDS_CREATE_QP_WQ_DBREC_ON_GPU = 1<<5,
GDS_CREATE_QP_DEFAULT = 0,
GDS_CREATE_QP_WQ_ON_GPU = 1<<0,
GDS_CREATE_QP_TX_CQ_ON_GPU = 1<<1,
GDS_CREATE_QP_RX_CQ_ON_GPU = 1<<2,
GDS_CREATE_QP_WQ_DBREC_ON_GPU = 1<<5,
};

typedef struct ibv_exp_qp_init_attr gds_qp_init_attr_t;
typedef struct ibv_exp_send_wr gds_send_wr;

struct gds_cq {
struct ibv_cq *cq;
uint32_t curr_offset;
};
typedef struct ibv_qp_init_attr gds_qp_init_attr_t;
typedef struct ibv_send_wr gds_send_wr;

typedef enum gds_cq_type {
GDS_CQ_TYPE_SQ,
GDS_CQ_TYPE_RQ
} gds_cq_type_t;

typedef enum gds_driver_type {
GDS_DRIVER_TYPE_UNKNOW = 0,
GDS_DRIVER_TYPE_MLX5
} gds_driver_type_t;

typedef struct gds_cq {
struct ibv_cq *ibcq;
uint32_t curr_offset;
Comment thread
drossetti marked this conversation as resolved.
gds_cq_type_t ctype;
gds_driver_type_t dtype;
} gds_cq_t;

typedef struct gds_qp {
struct ibv_qp *ibqp;
gds_cq_t *send_cq;
gds_cq_t *recv_cq;
gds_driver_type_t dtype;
} gds_qp_t;

/* \brief: Poll a peer-enabled CQ.
*
* It works similarly to ibv_poll_cq while blocking CPU access to the CQ
* entries until the GPU has a chance to observe them.
*/

struct gds_qp {
struct ibv_qp *qp;
struct gds_cq send_cq;
struct gds_cq recv_cq;
struct ibv_exp_res_domain * res_domain;
struct ibv_context *dev_context;
};
int gds_poll_cq(gds_cq_t *cq, int ne, struct ibv_wc *wc);

/* \brief: Create a peer-enabled QP attached to the specified GPU id.
*
Expand All @@ -80,11 +101,16 @@ struct gds_qp *gds_create_qp(struct ibv_pd *pd, struct ibv_context *context,
gds_qp_init_attr_t *qp_init_attr,
int gpu_id, int flags);

/* \brief: Destroy a peer-enabled CQ
*
*/
void gds_destroy_cq(gds_cq_t *cq);

/* \brief: Destroy a peer-enabled QP
*
* The associated CQs are destroyed as well.
*/
int gds_destroy_qp(struct gds_qp *qp);
void gds_destroy_qp(gds_qp_t *qp);

/* \brief: CPU-synchronous post send for peer QPs
*
Expand Down Expand Up @@ -114,10 +140,10 @@ int gds_stream_queue_send(CUstream stream, struct gds_qp *qp, gds_send_wr *p_ewr
// batched submission APIs

typedef enum gds_memory_type {
GDS_MEMORY_GPU = 1, /*< use this flag for both cudaMalloc/cuMemAlloc and cudaMallocHost/cuMemHostAlloc */
GDS_MEMORY_GPU = 1, /*< use this flag for both cudaMalloc/cuMemAlloc and cudaMallocHost/cuMemHostAlloc */
GDS_MEMORY_HOST = 2,
GDS_MEMORY_IO = 4,
GDS_MEMORY_MASK = 0x7
GDS_MEMORY_MASK = 0x7
} gds_memory_type_t;

// Note: those flags below must not overlap with gds_memory_type_t
Expand Down Expand Up @@ -148,27 +174,27 @@ enum {
GDS_WAIT_INFO_MAX_OPS = 32
};


/**
* Represents a posted send operation on a particular QP
*/

typedef struct gds_send_request {
struct ibv_exp_peer_commit commit;
struct peer_op_wr wr[GDS_SEND_INFO_MAX_OPS];
uint8_t reserve0[32];
uint8_t reserve1[56 * GDS_SEND_INFO_MAX_OPS];
} gds_send_request_t;
Comment thread
drossetti marked this conversation as resolved.

int gds_prepare_send(struct gds_qp *qp, gds_send_wr *p_ewr, gds_send_wr **bad_ewr, gds_send_request_t *request);
int gds_stream_post_send(CUstream stream, gds_send_request_t *request);
int gds_stream_post_send_all(CUstream stream, int count, gds_send_request_t *request);


/**
* Represents a wait operation on a particular CQ
*/

typedef struct gds_wait_request {
struct ibv_exp_peer_peek peek;
struct peer_op_wr wr[GDS_WAIT_INFO_MAX_OPS];
uint8_t reserve0[40];
uint8_t reserve1[56 * GDS_WAIT_INFO_MAX_OPS];
} gds_wait_request_t;

/**
Expand Down
Loading