Closed shreyashankar closed 2 weeks ago
We currently have max_batch_size
as a limit on parallelism. But we don't yet submit multiple map operation llm calls as a single call, as this requires prompt engineering to get all the operations in a single prompt & extra validation to make sure all the outputs exist, for each document in the batch.
This is something the optimizer may have to do.
Support Batching in Map Operations
Background
Currently, map operations execute an LLM call per input document. For very small documents, it's plausible we can execute on multiple docs together to improve efficiency. We want to introduce batching capabilities to our map operations.
Goal
Implement batching support in map operations to potentially improve performance and reduce costs when dealing with small documents.
To-Do List
Modify the map operation interface to include batch-related parameters:
batch_size
parameterclustering_method
parameter (options: 'random', 'sem_cluster')Implement batching logic in map operations:
batch_size
andclustering_method
Implement clustering methods:
Update the optimizer (
builder.py
) to handle batch size optimization:Modify the YAML config format to support batch-related parameters:
batch_size
andclustering_method
Write unit tests for batching functionality:
Update documentation:
(Proposed) Config Example
Done When
batch_size
andclustering_method
Notes