You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overlap matrix multiplication (needs tensor core) and other things like activation (needs cuda core and memory bandwidth) to speed up #1233
Hi thanks for the library! I have a naive thought: We know deep learning forward/backward cannot be parallelized, because you have to compute one operation/layer before computing the next one. But what if we have two batches computed almost parallelly? Then, for example, when our first batch is computing a big matrix multiplication (i.e. tensor core busy, cuda core idle, memory bandwidth idle), maybe we can issue some cuda instructions to compute the activation functions (tensor core idle, cuda core busy, memory bandwidth somehow busy).
Oh interesting - maybe CUDA Streams is what you're looking for? Ie you can overlap 2 CUDA operations on 1 GPU. Generally it's not that worth it, but it could work - the main issue though is if using Python CUDA streams, the overhead of Python might make it actually slower - so I guess some sort of C++ CUDA stream orchestration would work.
Activity
danielhanchen commentedon Nov 5, 2024
Oh interesting - maybe CUDA Streams is what you're looking for? Ie you can overlap 2 CUDA operations on 1 GPU. Generally it's not that worth it, but it could work - the main issue though is if using Python CUDA streams, the overhead of Python might make it actually slower - so I guess some sort of C++ CUDA stream orchestration would work.
fzyzcjy commentedon Nov 5, 2024
@danielhanchen Thank you, that looks interesting! Is there any possibilities Unsloth uses this (to speed up)?