Skip to content

Commit

Permalink
tweak some parallelism issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed May 24, 2024
1 parent 135f729 commit a85b7b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 194 deletions.
8 changes: 7 additions & 1 deletion composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,12 @@ def __init__(
parallelism_config['fsdp'] = set_fsdp_default({**parallelism_config['fsdp']})
if parallelism_config.get('tp', None) is not None:
parallelism_config['tp'] = {**parallelism_config['tp']}
# Remove empty configs
for key in list(parallelism_config.keys()):
if parallelism_config[key] == None:
del parallelism_config[key]
if len(parallelism_config) == 0:
parallelism_config = None
if deepspeed_config is not None and parallelism_config is not None:
raise ValueError(
'Both deepspeed_config and parallelism_config are specified but incompatible. Please specify only one.',
Expand Down Expand Up @@ -1257,7 +1263,7 @@ def __init__(

# Move the model and optimizers to the device
if deepspeed_config is None and parallelism_config is None:
# check if model is already on tpu
# Check if model is already on tpu
if isinstance(device, DeviceTPU) and 'xla' not in str(next(model.parameters()).device):
raise ValueError(
'Use model.to(xm.xla_device()) to set the model to the TPU before providing to the trainer.',
Expand Down
193 changes: 0 additions & 193 deletions simulate_tp.py

This file was deleted.

0 comments on commit a85b7b6

Please sign in to comment.