Commit 3fc4e10
sched : reintroduce less synchronizations during split compute (ggml-org#20793)
* CUDA: Improve performance via less synchronizations between token (ggml-org#17795)
* Adds CPU-to-CUDA copy capability to
ggml_backend_cuda_cpy_tensor_async()
* Adds function to relax sync requirements between input copies on
supported backends (CUDA for now)
* Exchanges synchronous copy with async copy function.
* Adds macro guards to allow compilation in non-CUDA builds
* Reworked backend detection in ggml-backend.cpp to avoid linking
conflicts
* Relax requirement of checks in async CUDA copies from backend and buffer type to just buffer type, to avoid linking issues
* Minor cleanup
* Makes opt-in to relax use of explicit syncs more general. Backends like
vulkan which require a synchronization between HtoD copies and graph
execution could also adopt this change now.
* Reintroduces stricter check for CPU->CUDA backend async copy via
GGML_DEVICE_TYPE_CPU.
* Corrects initialization of ggml_backend_sync_mode in
ggml_backend_sched_split initialization
* Simplifies synchronizations to adhere to `saaasg` pattern.
* Apply suggestion from @ggerganov (src->buffer to buf_src)
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* Apply suggestion from @ggerganov (src->buffer to buf_src) v2
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
---------
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
* Apply suggestions from @JohannesGaessler code review
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
* Adds single-GPU synchronizations to multi-GPU settings to fix hip backend pipeline parallel bugs.
* Scheduler Hardening: Exclude hip/MUSA from copy_from_host CPU split ->
GPU split optimization
* Scheduler Hardening: Re-adding original additional synchronizations for
non-async backends
* Adds disclaimer to hip/musa exclusion of copy_from_host. Highlights that it is out of
precaution, but that no perf-impact is visible, and that it can be
revisited separately anytime.
---------
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>1 parent 5d8ccdf commit 3fc4e10
2 files changed
Lines changed: 27 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1551 | 1551 | | |
1552 | 1552 | | |
1553 | 1553 | | |
| 1554 | + | |
| 1555 | + | |
1554 | 1556 | | |
1555 | 1557 | | |
1556 | 1558 | | |
| |||
1561 | 1563 | | |
1562 | 1564 | | |
1563 | 1565 | | |
1564 | | - | |
| 1566 | + | |
1565 | 1567 | | |
1566 | 1568 | | |
1567 | | - | |
| 1569 | + | |
1568 | 1570 | | |
1569 | 1571 | | |
1570 | 1572 | | |
1571 | 1573 | | |
1572 | | - | |
| 1574 | + | |
1573 | 1575 | | |
1574 | 1576 | | |
1575 | 1577 | | |
| |||
1674 | 1676 | | |
1675 | 1677 | | |
1676 | 1678 | | |
| 1679 | + | |
| 1680 | + | |
1677 | 1681 | | |
1678 | 1682 | | |
1679 | 1683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
3195 | | - | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
3196 | 3209 | | |
3197 | 3210 | | |
3198 | 3211 | | |
3199 | | - | |
| 3212 | + | |
3200 | 3213 | | |
3201 | 3214 | | |
3202 | 3215 | | |
| |||
3207 | 3220 | | |
3208 | 3221 | | |
3209 | 3222 | | |
3210 | | - | |
| 3223 | + | |
| 3224 | + | |
3211 | 3225 | | |
3212 | 3226 | | |
3213 | 3227 | | |
3214 | 3228 | | |
3215 | 3229 | | |
3216 | 3230 | | |
3217 | | - | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3218 | 3234 | | |
3219 | 3235 | | |
3220 | 3236 | | |
| |||
0 commit comments