vllm.distributed.device_communicators.quick_all_reduce
QuickAllReduce
¶
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
|
_QR_MIN_SIZE
class-attribute
instance-attribute
¶
_QR_MIN_SIZE = {
(float16, 2): [1 * MB, 2 * MB, 2 * MB, 1 * MB],
(float16, 4): [1 * MB, 16 * MB, 4 * MB, 2 * MB],
(float16, 8): [16 * MB, 4 * MB, 4 * MB, 2 * MB],
(bfloat16, 2): [2 * MB, 8 * MB, 8 * MB, 8 * MB],
(bfloat16, 4): [8 * MB, 64 * MB, 64 * MB, 16 * MB],
(bfloat16, 8): [
16 * MB,
2048 * MB,
2048 * MB,
2048 * MB,
],
}
__del__
¶
__init__
¶
Custom allreduce provides non-destructive acceleration and is available for CUDA and ROCm MI300 series.
Custom quick allreduce leverages quantization for further acceleration on ROCm. It currently supports Q8, Q6, and Q4 quantization formats and FP(float16, bfloat16).
Quick allreduce is designed as a complement to custom allreduce. Its initialization requires even stricter conditions.
Only the ROCm MI300 series is supported for quick allreduce at this time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group
|
ProcessGroup
|
the process group to work on. If None, it will use the default process group. |
required |
device
|
Union[int, str, device]
|
the device to bind the CustomAllreduce to. If None, it will be bind to f"cuda:{local_rank}". |
required |
It is the caller's responsibility to make sure each communicator is bind to a unique device, and all communicators in this group are in the same node.
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
_rocm_arch_available
¶
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
close
¶
create_shared_buffer
¶
Creates a shared buffer for quickreduce. Has to be called after init_custom_qr
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
init_quick_all_reduce
¶
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
quick_all_reduce
¶
Performs an out-of-place custom quick all reduce.
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
should_quick_allreduce
¶
should_quick_allreduce(inp: Tensor)
Check if quickreduce is available
Source code in vllm/distributed/device_communicators/quick_all_reduce.py
QuickReduceRegime
¶
Bases: Enum