Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
1e80bbb
feat: implemented stage FQN generation for pipeline parallelism
le1nux Aug 6, 2025
ed93d28
feat: added FQNs per stage calculation
le1nux Aug 7, 2025
6241ea8
feat: generic FQN-based PP staging
le1nux Aug 15, 2025
0ba8fbc
feat: added PP configs
le1nux Aug 15, 2025
4a41b6c
feat: wired up PP within dependency graph
le1nux Aug 15, 2025
ee529b7
feat: added FQN stages generator
le1nux Aug 15, 2025
625de59
feat: implemented scheduled pipeline
le1nux Aug 18, 2025
9677bd6
feat: wired up scheduled and staged pipelines.
le1nux Aug 18, 2025
7ac9edf
feat: added PP test config
le1nux Aug 18, 2025
d9f63c1
refactor: staging is now fully instantiable
le1nux Aug 19, 2025
83c87b9
feat: drafted pp e2e test for fwd/bwd pass
le1nux Aug 19, 2025
95f2470
refactor: renamings in the context of PP
le1nux Aug 29, 2025
521e586
chore: drafted the first PP test.
le1nux Aug 29, 2025
002b0ae
chore: pp config fixes
le1nux Aug 29, 2025
1d4943f
feat: Make test for pipeline parallelism work
rrutmann Sep 5, 2025
5b53ff9
refactor(parallelism): Removed necessity of additional model and loss…
BlueCrescent Sep 8, 2025
5147a7a
refactor(parallelism): Clean up for pp test.
BlueCrescent Sep 8, 2025
1cb9779
test: Print losses to debug tests
rrutmann Sep 8, 2025
27ad56d
feat: Use scheduled_pipeline for forwad backward pass
rrutmann Sep 9, 2025
41c4f36
feat: Use scheduled_pipeline for training
rrutmann Sep 9, 2025
6f3d5da
feat: Use scheduled_pipe in evaluation
rrutmann Sep 9, 2025
9b85334
test: Print losses if test fails
rrutmann Sep 9, 2025
84e2702
chore: Run evaluation before training
rrutmann Sep 9, 2025
32fbe94
chore: Increase microbatch size
rrutmann Sep 9, 2025
61ab311
fix: Use dp size instead of world size for last batch aggregation
rrutmann Sep 10, 2025
6952bcc
docs: Add TODOs for later check
rrutmann Sep 10, 2025
90dbe51
fix: Train before evaluation so that pp is initialized for backwards
rrutmann Sep 10, 2025
49df7d6
fix: Add missing parameter seed to GPT2LLMConfig
rrutmann Sep 12, 2025
7996a29
fix: Retrieve all PP ranks for gradient clipping
rrutmann Sep 15, 2025
cbddcbc
test: Add new parameter num_data_parallel_ranks to Trainer
rrutmann Sep 15, 2025
56a917a
fix: Make FSDP1GradientClipperConfig independent of device_mesh
rrutmann Sep 15, 2025
eb47aa9
fix: Handle optional device_mesh correctly
rrutmann Sep 15, 2025
d228351
feat: Consider pipeline parallelism in tensor pallelization
rrutmann Sep 17, 2025
55dad72
test: Use the same data on each rank & test tensor parallelism
rrutmann Sep 17, 2025
b6a1e2d
refactor(parallelism): Some clean-up.
BlueCrescent Sep 17, 2025
16a51af
chore: Merge branch 'pipeline_parallelism_fix' of github.com:Modaliti…
rrutmann Sep 18, 2025
c49895a
test: Update configs for parallelization testing
rrutmann Sep 19, 2025
f685fc5
test: Use correct length to create test sequences
rrutmann Sep 19, 2025
c07fcf6
test: Use realistic std for model initialization
rrutmann Sep 19, 2025
5019bbb
fix: Remove unused third dimension for reduced_losses
rrutmann Sep 19, 2025
a08e555
refactor: Remove unused filtering
rrutmann Sep 19, 2025
45b5418
fix: Aggregate loss of last train batch correct across pp ranks
rrutmann Sep 22, 2025
a394ab0
docs: Add example config for pipeline and tensor parallelism
rrutmann Sep 22, 2025
cae050e
docs: Add docstrings and type hints
rrutmann Sep 22, 2025
6952230
docs: Add type hints and docstrings
rrutmann Sep 22, 2025
ffa032c
fix: Check if parallelism method is initialized
rrutmann Sep 22, 2025
8d418a1
docs: Add new parameter in docstring
rrutmann Sep 22, 2025
fffd0a1
test: Run only one PP only test
rrutmann Sep 23, 2025
049472f
refactor: Addressed copilot review
rrutmann Sep 24, 2025
608c7fc
chore: Remove requirements for python and torch
rrutmann Oct 15, 2025
16c4bc4
fix: Allow dp shard degree 1
rrutmann Oct 17, 2025
f5a1020
test: Add test for checkpointing with pipeline parallelism
rrutmann Oct 17, 2025
9d1f107
fix(parallelism): Building model stages in PP now also filters the mo…
BlueCrescent Oct 17, 2025
dfc1bde
test(checkpointing): Some fixes for pp checkpointing test.
BlueCrescent Oct 17, 2025
cd9f595
test(checkpointing): Made dcp checkpointing test terminate correctly …
BlueCrescent Oct 20, 2025
edf7a4e
test(checkpointing): Checkpointing equality tests now explicitly only…
BlueCrescent Oct 21, 2025
abcf235
fix: Use ModuleDict for transformer layers for correct checkpointing …
rrutmann Oct 21, 2025
554cd39
chore: Rename layer_id to layer_idx
rrutmann Oct 21, 2025
484815e
test: Adapt tests to new gpt2 model structure
rrutmann Oct 21, 2025
ddb249b
test: Adapt code to latest changes to pass tests
rrutmann Oct 21, 2025
51b7db4
test(data): Added tests for distributed multi dim data sampling.
BlueCrescent Oct 21, 2025
a84db67
fix(parallelism): Use dp degree instead of world size in global_num_t…
BlueCrescent Oct 23, 2025
bdc684e
fix(optimizer): Optimizer groups for with and without weight decay in…
BlueCrescent Oct 23, 2025
0a8ab53
test(parallelism): Added warmstart e2e test with fsdp2 + tp + pp.
BlueCrescent Oct 23, 2025
71d1f81
test(gradient_clipping): Check that gradient clipping in pp setting i…
BlueCrescent Oct 24, 2025
c0cf6a2
refactor(gradient_clipping): Removed duplicate code in fsdp2 gradient…
BlueCrescent Oct 24, 2025
c6fee18
fix(logging): Correct number of parameters computation in case of pip…
BlueCrescent Oct 24, 2025
29acaf4
revert: Removed clarified todo.
BlueCrescent Oct 24, 2025
45a3a92
Merge branch 'main' into pipeline_parallelism_fix
rrutmann Oct 27, 2025
c90950c
Merge branch 'pipeline_parallelism_fix' of github.com:Modalities/moda…
rrutmann Oct 27, 2025
2c963e3
Merge remote-tracking branch 'origin/main' into pipeline_parallelism_fix
rrutmann Oct 27, 2025
5013420
Merge: main into current branch
rrutmann Oct 27, 2025
bf778c1
fix: Fix spelling mistake
rrutmann Oct 27, 2025
79f3a6d
Fix: Adapt configts to latest changes
rrutmann Oct 27, 2025
4aa144b
Fix: Adapt configs to latest configs
rrutmann Oct 27, 2025
af68c39
fix: Compute peak memory correctly on cpu device
rrutmann Oct 27, 2025
e4d29ca
test: Require A100 GPUs for mfu test
rrutmann Oct 27, 2025
e8781a3
test: Adapt tests to latest changes
rrutmann Oct 27, 2025
8d53b3c
test(parallelism): Adapted fsdp2+tp+tt test to recent changes.
BlueCrescent Oct 27, 2025
dfb8ce9
Update tests/fsdp2_parallelization/pipeline_parallelism/test_pp_fwd_b…
rrutmann Oct 28, 2025
37f3822
Update src/modalities/models/parallelism/pipeline_parallelism.py
rrutmann Oct 28, 2025
4f3055f
test(end2end): Reworked warmstart tests to not require torchrun and a…
BlueCrescent Nov 4, 2025
f5fc017
refactor: Implemented some PR comments.s
BlueCrescent Nov 4, 2025
8d0c012
fix: Make device_mesh required for fsdp2
rrutmann Nov 4, 2025
e25ba8e
fix: Adapt config to latest changes
rrutmann Nov 4, 2025
36525ce
docs: Add docstring for seed
rrutmann Nov 4, 2025
6d9886c
docs: Fix comment regarding loss reduction
rrutmann Nov 4, 2025
70a6370
fix: Fix typo
rrutmann Nov 4, 2025
48203b7
docs: Add comment for clarity on optimizer groups
rrutmann Nov 4, 2025
7d95fac
docs: Add missing return types
rrutmann Nov 4, 2025
868f86e
fix: Compute global_rank correctly with other_degree
rrutmann Nov 4, 2025
1adb4e3
refactor: Put tests and utilities in correct files
rrutmann Nov 5, 2025
ab12f5a
refactor: Use new function has_parallelism_method
rrutmann Nov 5, 2025
3bedd80
test: Add test for pipeline and tensor parallelism
rrutmann Nov 5, 2025
7b4139d
test: Increase size of TestDataset
rrutmann Nov 5, 2025
b558ef8
test(parallelism): Refactored PP unit test.
BlueCrescent Nov 5, 2025
238e72a
chore: Removed commented out section in test config.
BlueCrescent Nov 5, 2025
c6cbdeb
refactor: Additional assert for PR.
BlueCrescent Nov 5, 2025
c9ce2e1
test: Check for exact samples on each rank
rrutmann Nov 5, 2025
9bc28c2
docs(parallelism): Better code comment.
BlueCrescent Nov 5, 2025
e446fa3
test(multi_processing): Moved duplicate monitor_child_processes() hel…
BlueCrescent Nov 5, 2025
44954cc
test(multi_processing): Added additional multidim dataloader tests us…
BlueCrescent Nov 6, 2025
6a4420c
test: Fix tests
rrutmann Nov 6, 2025
2fce2ab
test(mfu): Added missing device mesh in test config.
BlueCrescent Nov 6, 2025
986261e
docs(readme): Added pytorch version information for pipeline parallel…
BlueCrescent Nov 6, 2025
5fe2719
chore: Merge remote-tracking branch 'origin/main' into pipeline_paral…
BlueCrescent Nov 6, 2025
36c8bcd
revert(evaluation): Reactivated evaluation before training.
BlueCrescent Nov 7, 2025
5700a94
refactor: Define function to get parallel rank in device_mesh.py
rrutmann Nov 7, 2025
0fce000
test: Use the same test data only on data parallel ranks
rrutmann Nov 7, 2025
b37cdeb
feat: Log rank information for each rank
rrutmann Nov 7, 2025
01c7b05
refactor: Minor cleanup.
BlueCrescent Nov 7, 2025
91e32cc
refactor: Replaced asserts with exceptions.
BlueCrescent Nov 7, 2025
a3e2a81
test(data): Fixed device mesh mocks for current requirements.
BlueCrescent Nov 7, 2025
51b7fa2
test(data): Added additional check in dataloader test.
BlueCrescent Nov 7, 2025
f98ea35
fix(optimizer): Switcheroo in weight decay groups.
BlueCrescent Nov 7, 2025
2a90c0e
chore: Merge remote-tracking branch 'origin/main' into pipeline_paral…
BlueCrescent Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 87 additions & 85 deletions README.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions config_files/training/config_example_coca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ settings:
gradient_accumulation_steps: 1
local_train_micro_batch_size: 1
sequence_length: 256
dp_degree: ${settings.cuda_env.world_size}
training_target:
num_target_tokens:
component_key: number_conversion
variant_key: num_tokens_from_num_steps
config:
num_steps: ${settings.training_target.num_target_steps}
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
sequence_length: ${settings.step_profile.sequence_length}
gradient_accumulation_steps: ${settings.step_profile.gradient_accumulation_steps}
num_target_steps: # for the batch progress subscriber
component_key: number_conversion
variant_key: num_steps_from_num_samples
config:
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
global_num_samples: ${settings.coca_example_settings.train_num_samples}
gradient_accumulation_steps: ${settings.step_profile.gradient_accumulation_steps}
Expand Down
5 changes: 3 additions & 2 deletions config_files/training/config_lorem_ipsum_long_fsdp1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ settings:
gradient_accumulation_steps: 2
local_train_micro_batch_size: 1
sequence_length: 256
dp_degree: ${settings.cuda_env.world_size}
training_target:
num_target_tokens:
component_key: number_conversion
variant_key: num_tokens_from_packed_mem_map_dataset_continuous
config:
dataset_path: ${settings.paths.train_dataset_path}
sequence_length: ${settings.step_profile.sequence_length}
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
gradient_accumulation_steps: ${settings.step_profile.gradient_accumulation_steps}
num_target_steps: # for the batch progress subscriber
component_key: number_conversion
variant_key: num_steps_from_num_tokens
config:
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
global_num_tokens: ${settings.training_target.num_target_tokens}
sequence_length: ${settings.step_profile.sequence_length}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ settings:
gradient_accumulation_steps: 2
local_train_micro_batch_size: 1
sequence_length: 256
dp_degree: ${settings.cuda_env.world_size}
training_target:
num_target_tokens:
component_key: number_conversion
variant_key: num_tokens_from_packed_mem_map_dataset_continuous
config:
dataset_path: ${settings.paths.train_dataset_path}
sequence_length: ${settings.step_profile.sequence_length}
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
gradient_accumulation_steps: ${settings.step_profile.gradient_accumulation_steps}
num_target_steps: # for the batch progress subscriber
component_key: number_conversion
variant_key: num_steps_from_num_tokens
config:
num_ranks: ${settings.cuda_env.world_size}
dp_degree: ${settings.cuda_env.world_size}
local_micro_batch_size: ${settings.step_profile.local_train_micro_batch_size}
global_num_tokens: ${settings.training_target.num_target_tokens}
sequence_length: ${settings.step_profile.sequence_length}
Expand Down
3 changes: 3 additions & 0 deletions config_files/training/config_lorem_ipsum_long_fsdp2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,7 @@ mfu_calculator:
world_size: ${settings.cuda_env.world_size}
wrapped_model:
instance_key: initialized_model
pass_type: BY_REFERENCE
device_mesh:
instance_key: device_mesh
pass_type: BY_REFERENCE
Loading