Skip to content

feat: Context Parallelism + Sequence Packing in Megatron + Dtensor - #651

Closed
SahilJain314 wants to merge 159 commits into
mainfrom
sahilj/cp-rebase
Closed

SahilJain314 wants to merge 159 commits into
mainfrom
sahilj/cp-rebase

Conversation

@SahilJain314

@SahilJain314 SahilJain314 commented Jul 11, 2025 •

Copy link
Copy Markdown
Contributor

Enables Context Parallelism + Sequence Packing for Megatron-Core based training

image Qwen 1.5B with TP + PP + CP (2,2,2) highlighted

SahilJain314 and others added 30 commits May 11, 2025 18:39
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
…{Dict, List, Tuple} to primitive dict, list tuple

Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Sahil Jain <[email protected]>
Signed-off-by: Terry Kong <[email protected]>

wip

Signed-off-by: Terry Kong <[email protected]>

fix it

Signed-off-by: Terry Kong <[email protected]>

patthing fix

Signed-off-by: Terry Kong <[email protected]>

wip

Signed-off-by: Terry Kong <[email protected]>

doesn't look like i needed that

Signed-off-by: Terry Kong <[email protected]>

fix

Signed-off-by: Terry Kong <[email protected]>

revert stuff

Signed-off-by: Terry Kong <[email protected]>

make it better

Signed-off-by: Terry Kong <[email protected]>

go

Signed-off-by: Terry Kong <[email protected]>

cleanup

Signed-off-by: Terry Kong <[email protected]>

mix it up

Signed-off-by: Terry Kong <[email protected]>

touch up

Signed-off-by: Terry Kong <[email protected]>

clean

Signed-off-by: Terry Kong <[email protected]>

better

Signed-off-by: Terry Kong <[email protected]>

clean up

Signed-off-by: Terry Kong <[email protected]>

add it in

Signed-off-by: Terry Kong <[email protected]>

mcore extra

Signed-off-by: Terry Kong <[email protected]>

instructions

Signed-off-by: Terry Kong <[email protected]>

works

Signed-off-by: Terry Kong <[email protected]>

revert to 3.10, 3.12 didn't seem necessary

Signed-off-by: Terry Kong <[email protected]>

ci has to recursively clone

Signed-off-by: Terry Kong <[email protected]>

bump build workflow

Signed-off-by: Terry Kong <[email protected]>

add megatron.core import

Signed-off-by: Terry Kong <[email protected]>

potential fix for unit test on CI

Signed-off-by: Terry Kong <[email protected]>

fix the test

Signed-off-by: Terry Kong <[email protected]>

this should fix test (it was a collision of namespace)

Signed-off-by: Terry Kong <[email protected]>

remove fp8 from test

Signed-off-by: Terry Kong <[email protected]>

add shallow

Signed-off-by: Terry Kong <[email protected]>

fix base build

Signed-off-by: Terry Kong <[email protected]>

fix instructions

Signed-off-by: Terry Kong <[email protected]>

fix the messed up indenting

Signed-off-by: Terry Kong <[email protected]>

fix

Signed-off-by: Terry Kong <[email protected]>

try nesting

Signed-off-by: Terry Kong <[email protected]>

okay, got it to work

Signed-off-by: Terry Kong <[email protected]>

fix up the readme

Signed-off-by: Terry Kong <[email protected]>

ok

Signed-off-by: Terry Kong <[email protected]>

touchup

Signed-off-by: Terry Kong <[email protected]>

add the lock file back

Signed-off-by: Terry Kong <[email protected]>

got

Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
@terrykong terrykong added CI:L1 Run doctests, unit tests, and functional tests and removed CI:L0 Run doctests and unit tests labels Jul 19, 2025
Signed-off-by: Sahil Jain <[email protected]>
@SahilJain314
SahilJain314 force-pushed the sahilj/cp-rebase branch 2 times, most recently from 5816d64 to 35da884 Compare July 21, 2025 19:19
@SahilJain314 SahilJain314 added CI:L1 Run doctests, unit tests, and functional tests and removed CI:L1 Run doctests, unit tests, and functional tests labels Jul 21, 2025
parthchadha
parthchadha previously approved these changes Jul 21, 2025
Signed-off-by: Sahil Jain <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator

closing since newer PR makes this one obsolete #704

@terrykong terrykong closed this Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests Documentation Improvements or additions to documentation r0.3.0 Release r0.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants