forked from rai-project/nvidia-smi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterconnect.go
143 lines (107 loc) · 1.96 KB
/
interconnect.go
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package nvidiasmi
const (
GBps = float64(1)
Gbps = float64(0.125)
)
type Interconnect interface {
Name() string
Bandwidth() float64
}
type Infiniband struct {
}
func (Infiniband) Name() string {
return "Infiniband"
}
func (Infiniband) Bandwidth() float64 {
return float64(40) * Gbps
}
type HBM3 struct {
}
func (HBM3) Name() string {
return "HBM3"
}
func (HBM3) Bandwidth() float64 {
return float64(512) * GBps
}
type HBM2 struct {
}
func (HBM2) Name() string {
return "HBM2"
}
func (HBM2) Bandwidth() float64 {
return float64(256) * GBps
}
type Ethernet struct {
}
func (Ethernet) Name() string {
return "Ethernet"
}
func (Ethernet) Bandwidth() float64 {
return float64(10) * GBps
}
type Ethernet20 struct {
}
func (Ethernet20) Name() string {
return "Ethernet20"
}
func (Ethernet20) Bandwidth() float64 {
return float64(20) * GBps
}
type NVLink1 struct {
}
func (NVLink1) Name() string {
return "NVLink1"
}
func (NVLink1) Bandwidth() float64 {
return float64(160) * GBps
}
type NVLink2 struct {
}
func (NVLink2) Name() string {
return "NVLink2"
}
func (NVLink2) Bandwidth() float64 {
return float64(300) * GBps
}
// Here we assume PCIe x16.
// PCIe 1.0: 150MB/s per lane per direction.
type PCIe1 struct {
}
func (PCIe1) Name() string {
return "PCIe1"
}
func (PCIe1) Bandwidth() float64 {
return 2.4 * float64(GBps)
}
// Here we assume PCIe x16.
// PCIe 1.0: 500MB/s per lane per direction.
type PCIe2 struct {
}
func (PCIe2) Name() string {
return "PCIe2"
}
func (PCIe2) Bandwidth() float64 {
return float64(8) * GBps
}
// Here we assume PCIe x16.
// PCIe 3.0: 1GB/s per lane per direction.
type PCIe3 struct {
}
func (PCIe3) Name() string {
return "PCIe3"
}
func (PCIe3) Bandwidth() float64 {
return float64(16) * GBps
}
// Here we assume PCIe x16.
// PCIe 4.0: 2GB/s per lane per direction.
type PCIe4 struct {
}
func (PCIe4) Name() string {
return "PCIe4"
}
func (PCIe4) Bandwidth() float64 {
return float64(32) * GBps
}
type SXM2 struct {
}