Add batch inference support (WIP) - #951
Conversation
turian
commented
Dec 28, 2023
@abetlen any progress on this? I am very interested in this feature |
…to batch-processing
…n into batch-processing
thomasgauthier
commented
Jan 18, 2024
@abetlen I'm also curious to know if this is still a planned feature. |
dimaioksha
commented
Jan 18, 2024
same here |
abetlen
commented
Jan 19, 2024
Hey guys, yes it is, it's just taking longer than expected because I need to refactor a lot of the Next steps right now are
|
K-Mistele
commented
Jan 20, 2024
+1 on this, would really really love to see this feature - right now, I can't use |
aalyousfi
commented
Feb 15, 2024
Hope we can get these two great features soon! |
parallaxe
commented
Feb 21, 2024
I am also highly interested in this, would be really really great! 😀 |
@abetlen Hey; this would be huge if you're still working on it. Right now I'm using 100% of the VRAM on an A40, and getting like 3% utilization for the FLOPS and Memory Bandwidth 😆 I just need to be able to throw more inferencing at it, but running the python file twice simultaneously will take up twice the VRAM (Not viable, I'm at VRAM limit already). I will happily sponsor with the cloud compute that I will save 🙏 ~ I'm not totally sure if I understand the code, but from my understanding of this PR; with this feature:
Or, alternatively, will the kv_cache be global? It could probably save RAM by allowing the parallel processes to share in the kv_cache, but also maybe that's harder to implement and it wouldn't matter in cases where the parallel processing threads don't share any substrings. Not sure. Maybe totally high level idea would be to allow Llama() to be initialized multiple times, but implicitly share VRAM if multiple are initialized from the same underlying model file ~ would be easiest for the User, but maybe that gets weird with underlying implementation. Interesting ideas though. model = Model("../models/llama-2-70b") |
Hey @abetlen any updates on this one? Looking to add support for this into instructlab/sdg and instructlab/instructlab !!!! Really hoping for this functionality 🙏 |
zhangjustin
commented
May 19, 2025
Hey @abetlen. |
Closes#771
Llama._create_completionspaghetti-ball (should be able to fixFix mirostat sampling #914 as well)