3 ms·
I haven't tried it, but just taking an educated guess, which is that I don't think batching should be required. The slow part for models is loading the model u
by stale2002 3y ago
I haven't tried it, but just taking an educated guess, which is that I don't think batching should be required.
The slow part for models is loading the model up. But once the model is up, you can send it whatever input that you want.
Parsing and sending the image data just doesn't pass my gut check as to what would be the bottleneck here.
- modeless 3y agoThat's not the issue, the issue is GPU utilization. Batching enables higher utilization and higher images per second throughput, but doesn't improve latency.
- Kubuxu 3y agoIn essence batching allows for more efficient usage of memory bandwidth. Without batching for every generation you need to transfer the whole model from GPU memory to GPU core once for every image which sets an upper bound on speed. With batching the bottlenecks start showing up elsewhere. For SD1.5 4090 is able to do ~17it/s without batching and ~90-100it/s with batching. Although these numbers might be old at this point, I looked at it ~3mo ago.
- godelski 3y agoEveryone does warmup before you measure. But measuring isn't always done right because we actually measure the GPU time only but some people naively use CPU time which is problematic because the process is asynchrenous. They have a few timing scripts though and I'm away from my GPU. There are some interesting things but they look like they know how to time. But it can also get confusing because is it considering batches or not. Some works do batch some do single. Only problem is when it isn't communicated correctly or left ambiguous. Their paper is ambiguous unfortunately. Abstract, intro, and conclusion suggests single image by motivating with sequential generation (specifically mentioning metaverse). Experiment section says > We note that we evaluate the throughput mainly via the average inference time per image through processing 100 images. That implies batch along with their name Stream Batch... Looking at the code I'm a bit confused. I'm away from my GPU so can't run. Maybe someone can let me know? This block[0] measures correctly but is using a downloaded image? Then just opens the image in the preprocess? (multi looks identical) This block[1] is using CPU? But running CPU. (there's another like this) So I'm quite a bit confused tbh. [0] https://github.com/cumulo-autumn/StreamDiffusion/blob/03e2a7ff7a82f7967a211419c231704db3cd5aa2/examples/benchmark/single.py#L115-L128 https://github.com/cumulo-autumn/StreamDiffusion/blob/03e2a7... [1] https://github.com/cumulo-autumn/StreamDiffusion/blob/03e2a7ff7a82f7967a211419c231704db3cd5aa2/examples/optimal-performance/single.py#L54-L62 https://github.com/cumulo-autumn/StreamDiffusion/blob/03e2a7...