base.h 1.17 KB
Newer Older
lishen's avatar
lishen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once

#include <stdint.h>
#include <string.h>
#include "debug.h"
#include "check.h"
#include "param.h"
#include "alloc.h"
#include "utils.h"

/*
外部环境变量设置:

src/debug.h:
*/
namespace sccl {
#define WARP_SIZE warpSize
#define MAXCHANNELS 32
#define SCCL_MAX_NTHREADS 256
#define SCCL_MAX_OPS 2048
#define SCCL_STEPS 8

typedef enum : uint8_t {
    scclInt8     = 0,
    scclChar     = 0,
    scclUint8    = 1,
    scclInt32    = 2,
    scclInt      = 2,
    scclUint32   = 3,
    scclInt64    = 4,
    scclUint64   = 5,
    scclFloat16  = 6,
    scclHalf     = 6,
    scclFloat32  = 7,
    scclFloat    = 7,
    scclFloat64  = 8,
    scclDouble   = 8,
    scclBfloat16 = 9,
} scclDataType_t;

#define SCCL_NUM_PROTOCOLS 3 // Simple/LL/LL128
typedef enum : uint8_t {
    SCCL_PROTO_LL     = 0,
    SCCL_PROTO_LL128  = 1,
    SCCL_PROTO_SIMPLE = 2
} scclProtocolType_t;

// 每个进程的唯一ID
49
50
51
52
53
54
55
struct scclRankInfo {
    int rank;       // 当前节点的全局排名
    int nRanks;     // 总的节点数量
    int localRank;  // 当前节点的本地rank
    int localRanks; // 当前节点的本地rank数量
    int hipDev;     // CUDA 设备 ID
};
lishen's avatar
lishen committed
56
57

} // namespace sccl