Skip to content

Allow opt-out of linear-attention refusal and make disable_in_eval configurable in sequence parallelism (#4476) - #4522

Open
Rajan-vish wants to merge 1 commit into
huggingface:mainfrom
Rajan-vish:sp-allow-recurrent-layers-and-eval-config-4476
Open

Rajan-vish wants to merge 1 commit into
huggingface:mainfrom
Rajan-vish:sp-allow-recurrent-layers-and-eval-config-4476

Conversation

@Rajan-vish

Copy link
Copy Markdown

Fixes #4476

This PR addresses two limitations on DeepSpeed Ulysses sequence parallelism:

  1. Opt-out for linear attention / recurrent layers:
    _refuse_recurrent_layers_under_sequence_parallelism now checks model capability flags (supports_sequence_parallel or supports_context_parallel) and DeepSpeedSequenceParallelConfig.sp_allow_recurrent_layers. SP-aware models (or architectures with custom recurrent state exchange wrappers) can now opt out of the refusal, while keeping the safe refusal default for stock models.
  2. Configurable disable_in_eval:
    Added sp_disable_in_eval to DeepSpeedSequenceParallelConfig (defaulting to True to retain current behavior, configurable via config or PARALLELISM_CONFIG_SP_DISABLE_IN_EVAL), allowing long-context evaluation to keep sequence parallelism enabled when desired.

Added tests covering configuration defaults/overrides and model capability bypasses.

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.

Sequence parallelism: allow an opt-out of the linear-attention refusal, and make disable_in_eval configurable

1 participant