Skip to content
21 changes: 21 additions & 0 deletions config/algorithms/MPI/Cray-MPICH/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default_mpich": {
"desc": "MPICH default algorithm selection",
"version": "8.0.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": "auto",
"tags": [
"default"
]
}
}
32 changes: 31 additions & 1 deletion config/algorithms/MPI/LibPico/alltoall.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@
"external"
]
},
"bine_dh_over": {
"desc": "LibPico external Alltoall algorithm . This algorithm follows the distance-halving Bine butterfly communication pattern described in the Bine paper.",
"version": "1.0.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
},
{
"key": "comm_sz",
"conditions": [
{
"operator": "is_power_of_two",
"value": true
}
]
}
],
"selection": "pico",
"tags": [
"bine",
"external",
"distance-halving"
]
},
"pairwise_ompi_over": {
"desc": "libpico pairwise algorithm, copied from Open MPI.",
"version": "1.0.0",
Expand Down Expand Up @@ -57,4 +87,4 @@
"external"
]
}
}
}
32 changes: 32 additions & 0 deletions config/algorithms/MPI/LibPico/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"bine_dh_over": {
"desc": "LibPico external Alltoall algorithm . This algorithm follows the distance-halving Bine butterfly communication pattern described in the Bine paper.",
"version": "1.0.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
},
{
"key": "comm_sz",
"conditions": [
{
"operator": "is_power_of_two",
"value": true
}
]
}
],
"selection": "pico",
"tags": [
"bine",
"external",
"distance-halving"
]
}
}
21 changes: 21 additions & 0 deletions config/algorithms/MPI/MPICH/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default_mpich": {
"desc": "MPICH default Alltoallv algorithm selection",
"version": "4.3.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": "auto",
"tags": [
"default"
]
}
}
66 changes: 66 additions & 0 deletions config/algorithms/MPI/Open-MPI/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"default_ompi": {
"desc": "Open MPI default Alltoallv algorithm selection.",
"version": "4.1.5",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": 0,
"cuda_support": "yes",
"rocm_support": "ucx",
"tags": [
"ignore"
]
},
"basic_linear_ompi": {
"desc": "Open MPI basic linear Alltoallv algorithm.",
"version": "4.1.5",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": 1,
"cuda_support": "yes",
"rocm_support": "ucx",
"tags": [
"basic_linear",
"linear"
]
},
"pairwise_ompi": {
"desc": "Open MPI pairwise Alltoallv algorithm.",
"version": "4.1.5",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": 2,
"cuda_support": "yes",
"rocm_support": "ucx",
"tags": [
"pairwise"
]
}
}
53 changes: 53 additions & 0 deletions config/algorithms/NCCL/LibPico/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"nccl_spreadout_alltoallv_over": {
"desc": "LibPico external NCCL spread-out Alltoallv algorithm. This implementation uses NCCL point-to-point ncclSend/ncclRecv operations arranged in size - 1 communication rounds.",
"version": "1.0.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": "pico",
"tags": [
"alltoallv",
"nccl",
"cuda",
"gpu",
"spread-out",
"sendrecv",
"external"
]
},

"nccl_fanout_alltoallv_over": {
"desc": "LibPico external NCCL fan-out Alltoallv algorithm. This implementation posts all ncclSend/ncclRecv operations inside a single ncclGroupStart/ncclGroupEnd region.",
"version": "1.0.0",
"constraints": [
{
"key": "count",
"conditions": [
{
"operator": ">=",
"value": "comm_sz"
}
]
}
],
"selection": "pico",
"tags": [
"alltoallv",
"nccl",
"cuda",
"gpu",
"fan-out",
"sendrecv",
"external"
]
}
}
2 changes: 1 addition & 1 deletion config/parse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "object",
"properties": {
"libpico_version": {"type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$"},
"collective": {"type": "string", "enum": ["ALLREDUCE", "ALLTOALL", "ALLGATHER", "BCAST", "GATHER", "REDUCE", "REDUCE_SCATTER", "SCATTER"]},
"collective": {"type": "string", "enum": ["ALLREDUCE", "ALLTOALL","ALLTOALLV", "ALLGATHER", "BCAST", "GATHER", "REDUCE", "REDUCE_SCATTER", "SCATTER"]},
"MPI_Op": {"type": "string"},
"tags": {
"type": "object",
Expand Down
16 changes: 16 additions & 0 deletions config/test/alltoallv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"libpico_version": "1.0.0",
"collective": "ALLTOALLV",
"MPI_Op": "MPI_SUM",
"tags": {
"include": [
"internal",
"external"
],
"exclude": []
},
"specific": {
"include": [],
"exclude": []
}
}
13 changes: 13 additions & 0 deletions include/libpico.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
void* rbuf, size_t rcount, MPI_Datatype rdtype, MPI_Comm comm
#define ALLTOALL_MPI_ARGS const void *sbuf, size_t scount, MPI_Datatype sdtype, \
void *rbuf, size_t rcount, MPI_Datatype rdtype, MPI_Comm comm
#define ALLTOALLV_MPI_ARGS const void *sbuf, const int scounts[], const int sdispls[], MPI_Datatype sdtype, \
void *rbuf, const int rcounts[], const int rdispls[], MPI_Datatype rdtype, MPI_Comm comm
#define BCAST_MPI_ARGS void *buf, size_t count, MPI_Datatype dtype, int root, MPI_Comm comm
#define GATHER_MPI_ARGS const void *sbuf, size_t scount, MPI_Datatype sdtype, \
void *rbuf, size_t rcount, MPI_Datatype rdtype, int root, MPI_Comm comm
Expand All @@ -38,6 +40,9 @@
ncclDataType_t dtype, ncclComm_t nccl_comm, cudaStream_t stream
#define ALLTOALL_NCCL_ARGS const void *sbuf, void* rbuf, size_t count,\
ncclDataType_t dtype, ncclComm_t nccl_comm, cudaStream_t stream
#define ALLTOALLV_NCCL_ARGS const void *sbuf, const int scounts[], const int sdispls[], \
void *rbuf, const int rcounts[], const int rdispls[], \
ncclDataType_t dtype, ncclComm_t nccl_comm, cudaStream_t stream
#define BCAST_NCCL_ARGS void *buf, size_t count, ncclDataType_t dtype, \
int root, ncclComm_t nccl_comm, cudaStream_t stream
#define GATHER_NCCL_ARGS const void *sbuf, void *rbuf, size_t count, ncclDataType_t dtype, \
Expand Down Expand Up @@ -87,11 +92,19 @@ int allgather_bine_block_by_block_nccl(ALLGATHER_NCCL_ARGS);

int alltoall_pairwise_ompi(ALLTOALL_MPI_ARGS);
int alltoall_bine(ALLTOALL_MPI_ARGS);
int alltoall_bine_DH(ALLTOALL_MPI_ARGS);
// write here the prototype of NCCL alltoall functions
#ifdef PICO_NCCL
// int alltoall_nccl_custom(ALLTOALL_NCCL_ARGS)
#endif

int alltoallv_bine_DH(ALLTOALLV_MPI_ARGS);

#ifdef PICO_NCCL
int alltoallv_nccl_spreadout(ALLTOALLV_NCCL_ARGS);
int alltoallv_nccl_fanout(ALLTOALLV_NCCL_ARGS);
#endif

int bcast_linear(BCAST_MPI_ARGS);
int bcast_binomial_halving(BCAST_MPI_ARGS);
int bcast_binomial_doubling(BCAST_MPI_ARGS);
Expand Down
Loading