Add supporting max_calls to the ray data executor - #1534
Conversation
Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
…aydata_task Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
|
/ok to test d7cf34d |
Greptile SummaryThis PR adds support for the Key Changes:
Implementation Quality:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ProcessingStage with max_calls_per_worker] --> B{Is Actor Stage?}
B -->|Yes| C[Create Actor<br/>Ignore max_calls]
B -->|No| D[Create Task<br/>Extract max_calls from ray_stage_spec]
D --> E{max_calls != None?}
E -->|Yes| F[Add max_calls to concurrency_kwargs<br/>Prevents operator fusion]
E -->|No| G[No max_calls set<br/>Allow operator fusion]
F --> H[Ray Data map_batches with max_calls]
G --> I[Ray Data map_batches without max_calls]
H --> J[Worker restarts every N tasks<br/>Mitigates memory fragmentation]
I --> K[Worker reused indefinitely<br/>May fuse with other stages]
Last reviewed commit: cd138cb |
| stop_lists=stop_lists, | ||
| ) | ||
| if extractor_max_calls_per_worker is None and isinstance(self.extractor.algorithm, JusTextExtractor): | ||
| extractor_max_calls_per_worker = 2 |
There was a problem hiding this comment.
How did you decide on 2?
There was a problem hiding this comment.
Somewhat arbitrary but verified it works a snapshot.
On average the higher this value the higher a chance for an OOM through memory fragmentation.
A lower value like 1 will rotate the PID every warc file which has some overhead to kill and spawn a new process.
Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
Description
This PR
Fixes #1533
Usage
# Add snippet demonstrating usageChecklist