Skip to content
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

【AutoParallelism】fix dataloader bug and add ci for static #8014

Merged
merged 11 commits into from
Mar 4, 2024
7 changes: 5 additions & 2 deletions paddlenlp/trainer/auto_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@
def _get_mesh(pp_idx=0):
return self.global_mesh.get_mesh_with_dim("pp")[pp_idx]

# Note(lizhiyu): If the values returned by `DataLoader` don't have the format `[images, labels]`,
# error may occurs here.
meshes = []
for pp_idx in range(self.args.pipeline_parallel_degree):
meshes.append(_get_mesh(pp_idx))
meshes.append(_get_mesh(0))
if self.args.pipeline_parallel_degree > 1:
meshes.append(_get_mesh(self.args.pipeline_parallel_degree - 1))

Check warning on line 100 in paddlenlp/trainer/auto_trainer.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/auto_trainer.py#L98-L100

Added lines #L98 - L100 were not covered by tests
return meshes

def _wrap_for_dist_loader(self, train_dataloader):
Expand Down
Loading