Skip to content

Conversation

@jp1924
Copy link
Contributor

@jp1924 jp1924 commented Jan 30, 2026

What does this PR do?

Hello accelerate team!

First, I opened this PR to enable evaluation when performing Sequence Parallel.

The history of this PR is connected to different PRs like this:

huggingface/transformers#43517 > deepspeedai/DeepSpeed#7821 > accelerate PR
(I didn't know PRs would be chained like this lol)

So, the core maintainer in deepspeed judged that we need to ask for opinions from the accelerate side, so this PR was opened.

First, through this PR, in accelerator.py > _prepare_deepspeed's SP applying part, we add disable_in_eval to skip Sequence Parallel during evaluation.
(Why we need to skip it, check huggingface/transformers#43517 )

I hardcoded disable_in_eval for now, but this needs more discussion.

We might need to make it configurable for users, like adding disable_in_eval to ParallelismConfig or handling it conditionally, etc.

cc: @tohtana

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@SunMarc

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment !

seq_length_is_variable=sp_handler.sp_seq_length_is_variable,
core_attn_implementation=sp_handler.sp_attn_implementation,
micro_batch_size=batch_size_per_device,
disable_in_eval=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could become an arg in sp_handler but fine to first hardcode it. Also disable_in_eval is not available in the latest release of deepseed no ?

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.

2 participants