Skip to content

Commit

Permalink
Data prep on multiple GPUs (#1576)
Browse files Browse the repository at this point in the history
Co-authored-by: Eitan Turok <[email protected]>
Co-authored-by: v-chen_data <[email protected]>
Co-authored-by: Saaketh Narayan <[email protected]>
  • Loading branch information
4 people authored Oct 22, 2024
1 parent 6448e4e commit 8e78eb5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions llmfoundry/command_utils/data_prep/convert_dataset_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def convert_dataset_hf_from_args(
ValueError: If the output directory already contains the requested splits
ValueError: If `concat_tokens` is set but `tokenizer` is not
"""
os.environ['WORLD_SIZE'] = '1'
if tokenizer_kwargs:
parsed_tokenizer_kwargs = json.loads(tokenizer_kwargs)
else:
Expand Down
1 change: 1 addition & 0 deletions llmfoundry/command_utils/data_prep/convert_dataset_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def convert_dataset_json_from_args(
ValueError: If the out_root directory exists and contains files that overlap with the requested splits
ValueError: If concat_tokens is set and a tokenizer is not provided
"""
os.environ['WORLD_SIZE'] = '1'
if os.path.isdir(out_root) and len(
set(os.listdir(out_root)).intersection(set(split)),
) > 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ def convert_delta_to_json_from_args(
use_serverless (bool): Use serverless or not. Make sure the workspace is entitled with serverless
json_output_filename (str): The name of the combined final jsonl that combines all partitioned jsonl
"""
os.environ['WORLD_SIZE'] = '1'
_check_imports()
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def convert_finetuning_dataset_from_args(
ValueError: If the target settings are invalid.
ValueError: If the output directory already contains the requested splits.
"""
os.environ['WORLD_SIZE'] = '1'
if os.path.isdir(out_root) and len(
set(os.listdir(out_root)).intersection(set(splits)),
) > 0:
Expand Down
1 change: 1 addition & 0 deletions llmfoundry/command_utils/data_prep/convert_text_to_mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ def convert_text_to_mds_from_args(
Raises:
ValueError: If `use_tokenizer_eos` is True and `eos_text` is not None
"""
os.environ['WORLD_SIZE'] = '1'
if use_tokenizer_eos:
# Ensure that eos text is not specified twice.
if eos_text is not None:
Expand Down

0 comments on commit 8e78eb5

Please sign in to comment.