Skip to content

[FEAT][distributed]: implement Sequence-Parallel aware LogProb and Loss reductions #49

Open

Description

@Flink-ddd

Description:

Context:

Training on extreme long-context tasks (32k+ tokens) requires Sequence Parallelism or Context Parallelism , where a single sequence is sharded across multiple GPUs. Our current loss functions (LogP, KL, Masked-Mean) assume the full sequence resides on a single device.

Tasks:

  1. Update the selected_logprobs and KL operators to accept sharded input sequences.
  2. Implement cross-rank reductions (e.g., partial sum of masked tokens -> AllReduce -> global division) for metrics like masked_mean and masked_sum.
  3. Ensure that gradients route back to the correct sequence shards during the backward pass seamlessly.

Activity

  1. added
    component: kernels
    component: distributed
    type: design
    on May 31, 2026
  2. LG-0927 commented on Aug 17, 2026

    @LG-0927

    Hi,I would like to take this issue

  3. Flink-ddd commented on Aug 17, 2026

    @Flink-ddd
    CollaboratorAuthor

    sure, assigned. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: distributedcomponent: kernelstype: design

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions