Fuse document iterate and extract stages - #1458
Conversation
Signed-off-by: Sarah Yurick <sarahyurick@gmail.com>
|
|
||
|
|
||
| @dataclass | ||
| class DocumentIterateExtractStage(ProcessingStage[FileGroupTask, DocumentBatch]): |
There was a problem hiding this comment.
Open to opinions about where this class should live and/or any file restructuring ideas.
Signed-off-by: Sarah Yurick <sarahyurick@gmail.com>
Signed-off-by: Sarah Yurick <sarahyurick@gmail.com>
Signed-off-by: Sarah Yurick <sarahyurick@gmail.com>
Signed-off-by: Sarah Yurick <sarahyurick@gmail.com>
ayushdg
left a comment
There was a problem hiding this comment.
The tiny stories tutorial (and possibly some other small places) may still have references to the iterate and extract stage separately. beyond that the PR should be good to go
@ayushdg hi thanks, I checked the tutorials and found that they do not need updated. This is because the TinyStories tutorial, etc. only access the abstract classes Lmk if I am missing anything. |
Nope I missed that. In that case we should be good to go! Thanks a lot @sarahyurick |
| for record_dict in iterator_result: | ||
| if self.record_limit and record_count >= self.record_limit: | ||
| break |
There was a problem hiding this comment.
Record counts wrong
record_limit is enforced based on record_count, but record_count is only incremented after a record is kept (i.e., after extract() and after extracted is None filtering). With an extractor that filters heavily, this will iterate/extract far more than record_limit input records per file (and potentially do a lot more work/memory) before record_count reaches the limit. This is triggered when extractor is set and can return None (e.g., content filters).
There was a problem hiding this comment.
A record is only added to the result after extraction. This means that the record count is correct.
Additional Comments (2)
|
Closes #780.
This change allows the following improvements:
--memory=200g), the Common Crawl download and extract pipeline without fusion OOM'ed even when scaling all the way down to 16 CPUs. With fusion, the pipeline was able to succeed with 32 CPUs.Common Crawl benchmarks with
url_limit=16andnum_cpus=8