Update experimental Megatron Lite package - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mlitewhile keeping model implementations namedlite.verl-project/verl@v0.8.0.PARAM_OFFLOAD/OPTIMIZER_OFFLOAD, which moves model parameters and optimizer state between CPU and GPU when VERL switches modes;offload_fraction=1.0, which keeps FSDP2 optimizer update state on CPU during forward/backward.Implementation Notes
experimental/lite, with imports exposed throughmegatron.litewhen users addexperimental/litetoPYTHONPATH.backend=mlite; model implementations remainimpl=lite.experimental/lite/examples/verl/REQUIRED_VERL.txtis now requirements-style and pinsverl @ git+https://github.com/verl-project/verl.git@v0.8.0.param.datareassignment, which avoids invalid DTensor/FSDP2 storage transitions.offload_fraction=1.0remains a separate CPU-update path.Validation
PYTHONPATH=mlite/experimental/lite python -m compileall -q mlite/experimental/lite/megatron/lite/runtime/megatron_utils.py mlite/experimental/lite/examples/verl/verl_mlite/engine/mlite_engine.py mlite/experimental/lite/tests/unit/primitive/test_fsdp2_offload_gpu.pyexperimental/lite/megatron/liteandexperimental/lite/examples.verl-project/verllatest release checked on 2026-06-06:v0.8.0.12579939:2 passedtest_fsdp2_runtime_model_and_optimizer_offload_roundtrip_single_gputest_fsdp2_offload_fraction_keeps_optimizer_update_state_on_cpu_single_gpuengine=mlite,impl=lite,optimizer=fsdp2, 4 nodes x 8 GPUs, job12537468, rc=0, step100 train/loss0.0958933, val/loss0.4291660.engine=mlite,impl=lite,optimizer=fsdp2, 4 nodes x 8 GPUs, job12545533, rc=0, step100 train/loss0.2139087, val/loss0.3420881.Merge Readiness
devlite.PARAM_OFFLOAD=True, the next validation should be a 100-step Qwen3.5 VERL SFT run with bothPARAM_OFFLOAD=TrueandOPTIMIZER_OFFLOAD=True.