-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blocksize to DocumentDataset.read_*
that uses dask_cudf.read_*
#285
base: main
Are you sure you want to change the base?
Add blocksize to DocumentDataset.read_*
that uses dask_cudf.read_*
#285
Conversation
Signed-off-by: Praateek <[email protected]>
Signed-off-by: Praateek <[email protected]>
Signed-off-by: Praateek <[email protected]>
DocumentDataset.read_*
that uses dask_cudf.read_*
columns: List[str], | ||
add_filename: bool, | ||
) -> Union[dd.DataFrame, dask_cudf.DataFrame]: | ||
# TODO : Reviewer TAL if filetype check is needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I added the "json" and "jsonl" check because columns
is already added as a kwarg to read_parquet
, so I didn't want to filter twice in the Parquet case.
@@ -43,7 +43,8 @@ def read_json( | |||
cls, | |||
input_files: Union[str, List[str]], | |||
backend: str = "pandas", | |||
files_per_partition: int = 1, | |||
files_per_partition: Optional[int] = None, | |||
blocksize: Optional[str] = "1gb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you mentioned it might be nice to add some of the information from https://github.com/rapidsai/cudf/blob/81cd4a00f8ae0dcde359ac11b53a9b3d855e50e2/docs/dask_cudf/source/best_practices.rst#use-parquet to NeMo Curator's best practices.
Also might be of interest for you: rapidsai/cudf#17250
This PR introduces a new codepath that leverages
dask_cudf.read_json / read_parquet
directly rather than our existingfrom_map
implementation.Important
The newer implementation supports fewer use-cases compared to original, however it supports the most frequently used implementations (i.e jsonl and parquet files without add_filename)
Caution
The newer implementation and older implementation have different outputs for the same input specifically
add_filename
andinput_meta
Differences between Old vs New
dask_cudf.read_*
dd.from_map(read_single_partition)
json
, along withjsonl
andparquet
jsonl
2. Output contains complete filepath rather than just filename
jsonl
, it now goes to the new implementation code path2. Output contains only filename
prune_columns
anddtype
is still parsed from it however the schema returned isn't affectedinput_meta
that's because of the behavior offrom_map
**kwarg
Benchmarking
Reading 6000 files of ~25mb each, i.e ~145gb over 8GPUs
dask.read_json
#285dask.from_map
#291add_filename=False
, latter two areTrue
where we see a lower utilizationadd_filename=False
, and the latter areTrue
where we see a lower utilizationUsage
# Add snippet demonstrating usage
Checklist