[DEVICE] Enable PAT algo for RCCL 1ppn (#1756)
* Enable PAT algo for RCCL 1ppn
[ROCm/rccl commit: e96c8473a1]
Tá an tiomantas seo le fáil i:
tiomanta ag
GitHub
tuismitheoir
82a822b646
tiomantas
471fc6bff2
@@ -402,7 +402,7 @@ public:
|
||||
#endif
|
||||
|
||||
// Need a power of two to ensure it divides by parallelFactor (which is also a power of two)
|
||||
#define NCCL_PAT_NWORKERS 512
|
||||
#define NCCL_PAT_NWORKERS 128
|
||||
|
||||
static constexpr int PatUsed = 0x1,
|
||||
PatSkipped = 0x2;
|
||||
|
||||
@@ -693,48 +693,61 @@ extern int const ncclDevFuncRowToId[];
|
||||
inline int ncclDevFuncId(int coll, int devRedOp, int type, int algo, int proto) {
|
||||
int row = 0;
|
||||
do {
|
||||
// RING / <all_protos> / Sum / int8_t
|
||||
// RING/PAT | <all_protos> | Sum | int8_t
|
||||
int nAlgos = 2;
|
||||
if (coll == ncclFuncAllGather) {
|
||||
row += proto;
|
||||
int algo1 = algo == NCCL_ALGO_RING ? 0 :
|
||||
/*algo == NCCL_ALGO_PAT*/ 1;
|
||||
row += algo1 * NCCL_NUM_PROTOCOLS + proto;
|
||||
break;
|
||||
}
|
||||
row += NCCL_NUM_PROTOCOLS;
|
||||
row += nAlgos * NCCL_NUM_PROTOCOLS;
|
||||
|
||||
// <all_algos> / <all_protos> / <all_redops> / <all_types>
|
||||
// RING/TREE | <all_protos> | <all_redops> | <all_types>
|
||||
nAlgos = 2;
|
||||
if (coll == ncclFuncAllReduce) {
|
||||
row += (((algo * NCCL_NUM_PROTOCOLS + proto) * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * (algo * NCCL_NUM_PROTOCOLS + proto);
|
||||
int algo1 = algo == NCCL_ALGO_TREE ? 0 :
|
||||
/*algo == NCCL_ALGO_RING*/ 1;
|
||||
row += (((algo1 * NCCL_NUM_PROTOCOLS + proto) * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * (algo1 * NCCL_NUM_PROTOCOLS + proto);
|
||||
break;
|
||||
}
|
||||
row += (NCCL_NUM_ALGORITHMS - 5) * NCCL_NUM_PROTOCOLS * (ncclNumDevRedOps * ncclNumTypes - NCCL_NUM_FLOATS);
|
||||
row += nAlgos * NCCL_NUM_PROTOCOLS * (ncclNumDevRedOps * ncclNumTypes - NCCL_NUM_FLOATS);
|
||||
|
||||
// RING / SIMPLE / Sum / int8_t
|
||||
// RING | SIMPLE | Sum | int8_t
|
||||
nAlgos = 1;
|
||||
if (coll == ncclFuncAllToAllPivot) break;
|
||||
row += 1;
|
||||
row += nAlgos * 1;
|
||||
|
||||
// RING / <all_protos> / Sum / int8_t
|
||||
// RING | <all_protos> | Sum | int8_t
|
||||
nAlgos = 1;
|
||||
if (coll == ncclFuncBroadcast) {
|
||||
row += proto;
|
||||
break;
|
||||
}
|
||||
row += NCCL_NUM_PROTOCOLS;
|
||||
row += nAlgos * NCCL_NUM_PROTOCOLS;
|
||||
|
||||
// RING / <all_protos> / <all_redops> / <all_types>
|
||||
// RING | <all_protos> | <all_redops> | <all_types>
|
||||
nAlgos = 1;
|
||||
if (coll == ncclFuncReduce) {
|
||||
row += ((proto * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * proto;
|
||||
row += ((proto * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * proto;
|
||||
break;
|
||||
}
|
||||
row += NCCL_NUM_PROTOCOLS * (ncclNumDevRedOps * ncclNumTypes - NCCL_NUM_FLOATS);
|
||||
row += nAlgos * NCCL_NUM_PROTOCOLS * (ncclNumDevRedOps * ncclNumTypes - NCCL_NUM_FLOATS);
|
||||
|
||||
// RING / <all_protos> / <all_redops> / <all_types>
|
||||
// RING/PAT | <all_protos> | <all_redops> | <all_types>
|
||||
nAlgos = 2;
|
||||
if (coll == ncclFuncReduceScatter) {
|
||||
row += ((proto * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * proto;
|
||||
int algo1 = algo == NCCL_ALGO_RING ? 0 :
|
||||
/*algo == NCCL_ALGO_PAT*/ 1;
|
||||
row += (((algo1 * NCCL_NUM_PROTOCOLS + proto) * ncclNumDevRedOps + devRedOp) * ncclNumTypes + type) - NCCL_NUM_FLOATS * (algo1 * NCCL_NUM_PROTOCOLS + proto);
|
||||
break;
|
||||
}
|
||||
row += NCCL_NUM_PROTOCOLS * (ncclNumDevRedOps * ncclNumTypes - NCCL_NUM_FLOATS);
|
||||
|
||||
// RING / SIMPLE / Sum / int8_t
|
||||
// RING | SIMPLE | Sum | int8_t
|
||||
nAlgos = 1;
|
||||
if (coll == ncclFuncSendRecv) break;
|
||||
row += 1;
|
||||
row += nAlgos * 1;
|
||||
|
||||
} while (false);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ typedef enum {
|
||||
typedef void (*ncclDebugLogger_t)(ncclDebugLogLevel level, unsigned long flags, const char *file, int line, const char *fmt, ...);
|
||||
|
||||
#define NCCL_NUM_ONERANK 12
|
||||
#define FUNC_INDEX_TOTAL 656 + NCCL_NUM_ONERANK
|
||||
#define FUNC_INDEX_TOTAL 821 + NCCL_NUM_ONERANK
|
||||
|
||||
#define NCCL_NUM_FUNCTIONS 5 // Send/Recv not included for now
|
||||
typedef enum {
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir