Open michaelfeil opened 4 months ago
need to fix batching ASAP for many similar HuggingFace models to work
This is related to batch_map #84 I prioritized this one.
@dberenbaum can this be closed now?
See the note from #191:
I think we should keep open https://github.com/iterative/datachain/issues/170. That request seems to be specifically about using futures to batch individual results using the existing .map without needing a separate .batch_map(). I think .batch_map() may be both simpler to implement and explain for now, but I think we could come back to the ideas in https://github.com/iterative/datachain/issues/170 in the future.
I noticed a number of various things are incorrectly implemented.
To perform batched inference, you would need to add multiple batches, with a batch size > 1 to the sentence classification pipeline.
As a result, I launched https://github.com/michaelfeil/embed and https://github.com/michaelfeil/infinity for sentence classification. The backend queues and batches the requests, allowing better instructions to be used. This is useful for CPU, but crucial for e.g. CPU usage!