Skip to content

fix: preserve 2D predictions in predict_with_generate DDP eval - #10048

Merged
hjh0119 merged 2 commits into
modelscope:mainfrom
kabishou11:cursor/fix-predict-with-generate-ddp-8256-9b42
Sep 7, 2026
Merged

fix: preserve 2D predictions in predict_with_generate DDP eval#10048
hjh0119 merged 2 commits into
modelscope:mainfrom
kabishou11:cursor/fix-predict-with-generate-ddp-8256-9b42

Conversation

@kabishou11

Copy link
Copy Markdown
Contributor

Preserve 2D (batch, seq_len) predictions when predict_with_generate gathers across DDP ranks. Fixes #8256

Pad generate outputs to the global max sequence length across ranks
before accelerator.gather so predictions stay (batch, seq_len).

Fixes modelscope#8256
@hjh0119

hjh0119 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

thanks for your contribution, please pass the lint test

@kabishou11

Copy link
Copy Markdown
Contributor Author

Addressed the lint failure on 1fae08d.

pre-commit isort had rewritten tests/train/test_seq2seq_trainer_ddp.py in CI. Applied the same isort config locally and pushed; DDP 2D prediction logic is unchanged. Lint should be green now.

@hjh0119
hjh0119 merged commit 7d00144 into modelscope:main Sep 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] predict_with_generate=True causes 1D dimension collapse of eval_prediction.predictions in custom metrics (DDP)

2 participants